-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support DCP standard #2049
Support DCP standard #2049
Conversation
dependencies/dependencies.xml
Outdated
@@ -87,6 +87,24 @@ | |||
</releasefile> | |||
</dependency> | |||
|
|||
<dependency name="asio"> | |||
<releasefile sha1="bac61183b633a6d91ef7ae31836434bdf4f2b0d0"> | |||
<url>https://sourceforge.net/projects/asio/files/asio/1.12.1 (Stable)/asio-1.12.1.zip</url> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the exact versions listed here required? Otherwise it would be "better" to install them from the package repository on Linux systems. But i guess having them as a fall-back in-case system is to old might make sense.
More use full would be the downloads (and build scripts) for Windows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found out that Asio does not need to be compiled, it can be used as header-only. This makes things much easier.
hopsandcp/dcpmaster.cpp
Outdated
void DcpMaster::start() { | ||
std::thread b(&DcpManagerMaster::start, manager); | ||
std::chrono::seconds dura(1); | ||
std::this_thread::sleep_for(dura); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sleeping random time is not safe, sometimes its enough sometime not. Is there some other way to "wait long enough"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this either but can't think of a better solution. This code snippet is taken directly from the examples provided by DCPLib.
Made some comments, but have not had time to test, have no obvious ideas, seems like a reasonable approach |
Just so you know, I am going to remove the command line interface and convert hopsandcp into a library. Then the gui and cli can link against this library directly. The important thing is that hopsancore should not depend on DCPLib. |
067acff
to
97138db
Compare
…r. Handle empty strings in HString::split().
Fix Windows dependencies Added missing dependencies for Appveyor Added CMakeLists.txt to hopsandcp Add missing calls to dependency scripts for Appveyor Correct include directories in CMake Build all dependencies with ci-build Added Linux script for setting up DCPLib Set executable permission to DCPLib install script Added include path to libzip Fix Linux setup script for libzip Add include paths to Xerces and Asio Add include path to libzip Fix compilation error without ZMQ Remove pause from Xerces setup script Added missing include Add patch to DCPLib code to fix a missing include Add logging define to DCPLib to resolve compilation error Patch for missing function in DCPLib Enable LOGGING flag in hopsandcp Specify release build for Zlib on Windows Correct use of define in call to CMake Make Cmake define public Changed to forward slashes in CMake path Remove unneeded patch Added hopsandcp dependency to HopsanGUI Added libzip dependency to HopsanCore Patch DCPLib to make IpToString function inlined Fix release build for zlib Fix CMake build Add check for MinGW compiler flag Add Zlib, add DCPLib to setup scripts Fix Linux compilation Compilation fixes Test local libzip in ci-build Attempt to fix MSVC compilation Add Zlib setup script to Appveyor Attempt to fix MSVC linking Attempt to fix patch command for msvc Fix patch for Windows builds Attempt to link Xerces with MSVC Find local xerces with msvc Attempt to fix libzip linking on msvc
Support for the Distributed Co-simulation Protocol (DCP) standard. This enables communication between Hopsan and other DCP supporting tools, as well as with physical devices. Hopsan is hard-coded to use UDP protocol for now, but TCP/IP can alsobe supported in the future as well as CAN and Bluetooth.
It is possible to both export Hopsan models and simulate them in other tools, as well as importing and simulating models from other tools. Due to the lack of open source DCP tools, I have only been able to test simulations between Hopsan and Hopsan.
The implementation is based on the DCPLib subproject, which in turn requires three new dependencies; Asio, Xerces and libzip.