Skip to content
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 configuration change for virtual entities #159

Open
18 tasks
christophe-calmejane opened this issue Nov 13, 2024 · 0 comments
Open
18 tasks

Support configuration change for virtual entities #159

christophe-calmejane opened this issue Nov 13, 2024 · 0 comments

Comments

@christophe-calmejane
Copy link
Contributor

christophe-calmejane commented Nov 13, 2024

In order to support configuration change for a virtual entity, a lot of refactoring is required:

  • Add a new ControlledEntity method: canChangeVirtualEntityConfiguration(configurationIndex)
    • Checks the model exists for the specified configuration
    • Check all dynamic fields exists in the specified configuration tree
    • Check that no connection is currently active (neither input nor output)
    • Method should return an enum type code to differentiate cases
    • ControllerVirtualProxy should call this method internally, if any error occurs, remove the device from the controller (it's the responsibility of the application to make sure it's possible to change the configuration before doing so, by using canChangeVirtualEntityConfiguration
  • MilanInfo must be stored per configuration (in ConfigurationTree/ConfigurationNode)
    • Update json file format
      • Update the json format version
      • Dump in configuration section of the json model (dumpConfigurationTrees method)
      • Load in configuration section of the json model (readConfigurationTrees method)
      • Based on the json format version, read the global (old format) MilanInfo, otherwise ignore it
      • Add unit tests for files with different dump version
  • compatibility_flags, adp_information and entity_model_id json fields should also be stored per configuration
  • Dynamic model should always be read from the json file, if present
    • readConfigurationTrees computes a ignoreDynamicModel variable but we need to change the meaning of that variable. Currently, if true, prevents reading the dynamic model even if present. Rename it to isActiveConfiguration (initialize properly! Only true if currentConfiguration is defined and is the active config). Then pass it to readLeafModels (and such), which will only cause errors if true and dynamicModel (or static for that matter) is not defined (and only if flags ask for such config ofc).
    • Rework the readLeafModels template method, it's using a lot of boolean template parameter that might not be needed if we check the dump format version (and redundant with previous check point). Or at least they must be changed to include which version of the format version each model is mandatory
  • ControlledEntity should keep the MilanInfo struct globally accessible, but it should correctly be updated when swapping config (to be tested if that is possible), or simply keep the getMilanInfo global but returning the struct stored in the ConfigurationNode (maybe better)
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

No branches or pull requests

1 participant