XMLSerializer ignores value of parameters
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 11
- Forks
- 11
- Avg merge
- 8h 6m
- Merged PRs (30d)
- 1
Description
The following is inside a component:
ParamValue: delay(time, svalue = null, dvalue = NaN) = 2.2E-4
ParamValue: duration(time, svalue = null, dvalue = NaN) = 4.0E8
ParamValue: amplitude(current, svalue = null, dvalue = NaN) = 7.300000000000001E-10
however when doing
String serialisedModel = XMLSerializer.serialize(lems)
the file shows
<pulseGenerator id="pulseGen1" delay="0ms" duration="100000000s" amplitude="0.08nA"/>
I suspect the problem is caused by the following objects which are also inside the LEMS component model:
XMLAttribute(delay, 0ms)
XMLAttribute(duration, 100000000s)
XMLAttribute(amplitude, 0.08nA)
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue through XMLSerializer.serialize(lems) after changing values with lemsParameter.setDoubleValue(...), then inspect how XMLAttribute values are used alongside component parameters. Done means serialized delay, duration, and amplitude reflect the updated parameter values without stale XMLAttribute data.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100