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
which I suspect is what is getting used during serialization.
The same information seems to be stored in two places, if XMLAttribute are necessary for whatever reason then the library should reconcile them if the user changes the value of a parameter through the API
lemsParameter.setDoubleValue(...)
which is what we are doing to let the user change the parameters in the model.
Either that or there should be some method that can be called to update the XMLAttributes.
However ideally redundant information should probably be best avoided altogether.
The text was updated successfully, but these errors were encountered:
The problem here is commented at line 236 of XMLSerializer.java. ParamValue is dimensionless whereas the original attribute value is the only place we have the unit that was supplied with the quantity.
When you let the user change the values, you must be making them supply them in SI, or do you do unit conversions too? By the time you're into ParamValues there's no longer a 1:1 mapping back to XML so I'm not really sure what the solution is here: units get discarded as soon as possible in the pipeline and ParamValues shouldn't know about them as they don't affect the subsequent calculation.
One option would be to supply the attribute value from the UI (number and unit) rather than than accessing the ParamValue directly. Or we could use the ParamValues and add the SI units (so you'd read a model with "mV" and write it out and get with "V"). Or, we store a set of preferred units with each component for its parameter values which are just used for serializing. Maybe the last option is best?
The following is inside a component:
however when doing
the file shows
I suspect the problem is caused by the following objects which are also inside the LEMS component model:
which I suspect is what is getting used during serialization.
The same information seems to be stored in two places, if XMLAttribute are necessary for whatever reason then the library should reconcile them if the user changes the value of a parameter through the API
which is what we are doing to let the user change the parameters in the model.
Either that or there should be some method that can be called to update the XMLAttributes.
However ideally redundant information should probably be best avoided altogether.
The text was updated successfully, but these errors were encountered: