You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
The text was updated successfully, but these errors were encountered:
In order to support configuration change for a virtual entity, a lot of refactoring is required:
The text was updated successfully, but these errors were encountered: