-
Notifications
You must be signed in to change notification settings - Fork 41
Rework native library #237
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
Conversation
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.
Pull Request Overview
This PR reworks the native library by refactoring core FMU functions, improving logging behavior and error handling, and updating API usage for greater clarity and support for FMI3 in the future.
- Refactored fmi2.cpp to replace reinterpret_cast with static_cast and improved logger usage.
- Updated PySlaveInstance implementation and removed deprecated setup_experiment.
- Removed legacy cppfmu_cs files and updated log message formatting.
Reviewed Changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
pythonfmu/fmu_except.hpp | New exception class added for fatal errors. |
pythonfmu/fmi2.cpp | Refactored casting, logging, and FMI function implementations. |
pythonfmu/SlaveInstance.hpp | Updated interface for SlaveInstance with optional parameters. |
pythonfmu/PySlaveInstance.{hpp,cpp} | Reworked Python slave instance integration with improved resource handling. |
pythonfmu/Logger.hpp | Introduced a new PyLogger interface for consistent logging. |
pythonfmu/cppfmu/cppfmu_cs.{hpp,cpp} | Legacy co-simulation interface removed. |
pythonfmu/logmsg.py | Adjusted LogMsg class and its string formatting. |
pythonfmu/fmi2slave.py | Minor API changes in initialization mode and logging support. |
pythonfmu/_version.py | Version bumped to 0.7.0. |
Files not reviewed (1)
- pythonfmu/pythonfmu-export/src/CMakeLists.txt: Language not supported
Also fixes and enables old logging tests
A first attempt to rework the native library.
setup_experiment is removed (API change).startTime
is moved to enter_initiliaization_mode`This change should make it easier to understand the native workings and also make it easier to add FMI3 support. The structure is similar to fmu4cpp.