Saving a class to XML is a hazardous operation, best summed up by "don't do it." We have been living dangerously for a long time and changes made in SMO 1.4.0.66+ have made us face reality.
bad idea to flatten directly class unless it is purely byValue.
If it is, then best is to use a Serializer specifically for your class.
If it is ByReference, you absolutely need a flatten/unflatten method
If it is a mix of ByRef/ByValue (like SMO), I suggest you consider it as a ByRef object.
Base Class ==> Flatten.vi and Unflatten.vi (or Marshal/Unmarshal, or Serialize/Deserialize)
If it works with NI-XML, go for it... but be prepared to have a second-try on error, which would be to do it class-by-class.
Each class overrides the parent method and serializes to known format.
--- Francois Normandin
Even though all of the LevyLab SMOs are byValue (as of 1/2022), SMOs are a mixture.
I propose we abandon flattening altogether and pass metadata out of Control Experiment.vi after first stripping the classes themselves.
Replace this existing code:
Saving a class to XML is a hazardous operation, best summed up by "don't do it." We have been living dangerously for a long time and changes made in SMO 1.4.0.66+ have made us face reality.
Even though all of the LevyLab SMOs are byValue (as of 1/2022), SMOs are a mixture.
I propose we abandon flattening altogether and pass metadata out of Control Experiment.vi after first stripping the classes themselves. Replace this existing code:![image](https://user-images.githubusercontent.com/26659428/151177588-0585edd3-5fd1-47db-8306-d028eb7d55c3.png)
With something like:
![image](https://user-images.githubusercontent.com/26659428/151185559-460fa0ad-46bc-4194-ae35-28f93719b002.png)