Opened 6 years ago
Last modified 3 years ago
#5405 assigned defect
OMEdit cannot generate 'each' modifiers for parameters of arrays of components
Reported by: | Francesco Casella | Owned by: | Adrian Pop |
---|---|---|---|
Priority: | blocker | Milestone: | 1.19.0 |
Component: | NF API | Version: | |
Keywords: | Cc: |
Description
Drag any component from the Modelica Standard Library into a test system model. Right-click on it, select Attributes and give the component some array dimension (e.g., [3]). Then, try to modify any of the parameters of the component array: the parameter window only allows me to input an array value for each parameter. There is no way to use the each
modifier, allowing to only input one value if it is the same for all the components.
We should introduce a way to do so in an intuitive way, e.g. with an by adding an each
checkbox side by side to the value input field (of course only in the case of arrays of components).
BTW, we should also allow to make the parameter final, but that's probably the topic for another ticket.
Change History (11)
comment:1 by , 5 years ago
Milestone: | 2.0.0 → 1.16.0 |
---|---|
Priority: | critical → blocker |
comment:2 by , 5 years ago
follow-up: 4 comment:3 by , 5 years ago
You should switch to the textual view and locate the component declaration, which will have a modifier like BodyCylinder bodyCylinder(r_0(fixed = true))
. Just add each
before fixed
, e.g. r_0(each fixed = true)
, so that all the element of the array get the scalar value.
Of course this is just a workaround, OMEdit should generate correct Modelica code out of the box.
comment:4 by , 5 years ago
Thank you!
Replying to casella:
You should switch to the textual view and locate the component declaration, which will have a modifier like
BodyCylinder bodyCylinder(r_0(fixed = true))
. Just addeach
beforefixed
, e.g.r_0(each fixed = true)
, so that all the element of the array get the scalar value.
Of course this is just a workaround, OMEdit should generate correct Modelica code out of the box.
comment:5 by , 4 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Reassigned to @adrpo after today's devmeeting, there is probably already some support for this in the new API.
We agree that we should have a checkbox for "each" in case the parameter is an array. It is then up to the user to select it or not, and hence provide a scalar or an appropriate array.
comment:7 by , 4 years ago
Component: | OMEdit → NF API |
---|
comment:9 by , 3 years ago
@adeas31 reports that the updateComponent
API function needs to be fixed.
This is causing a problem for me. I have dropped a bodyCylinder onto my model, I have tried to set the r_0.start checkbox to 'false' but when I try to run the model I get the error:
I also get the same problem if I set it to 'true', the only value that actually works in the checkbox is 'inherited'. Is there any other way to work around this?