Skip to content

Conversation

@Yunusbcr
Copy link
Contributor

Changes to settings and connections handling:

  • src/main_window.cpp: Fixed the order of fields in the QDataStream& operator>>(QDataStream& in, plugin_connection& conn) function to match the order in the << operator.

  • src/main_window.cpp: Modified the block_cache parameter in loadDAQSettings, loadWidgetSettings, and loadConnectionSettings to be passed by reference instead of by value. [1] [2] [3]

  • src/main_window.cpp: Updated the logic in saveWidgetSettings to skip saving system plugins, preventing crashes due to connections from the device to any plugin.

  • src/main_window.cpp: Added a call to saveConnectionSettings in the saveSettings function to ensure connection settings are saved.

  • src/main_window.hpp: Updated the function declarations to reflect the changes in the block_cache parameter being passed by reference.

@fusge fusge self-requested a review March 1, 2025 15:56
@fusge fusge self-assigned this Mar 1, 2025
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are plugins that do not contain a Component class because they do not hook into the real-time system for computations. These plugins are default constructed with ID=0. Due to this limitation, we ignore the ID and instead just use a simple count, because otherwise those plugins would be ignored.

Plugin IDs are meant to be independent between sessions, and propagating this information in the settings could be an issue as well. This is another reason why we avoid assigning IDs on the settings file

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After thinking about it there is no harm in using the plugin's actual ID to keep track of it's identity, however there would have to be a way to store the identity of those plugins that do not contain a component. One way to do this is to store negative numbers instead for those types of widgets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants