#4697 closed defect (fixed)
OMEdit does not accept parameter with brackets
| Reported by: | Andrea Bartolini | Owned by: | Adrian Pop |
|---|---|---|---|
| Priority: | blocker | Milestone: | 1.13.0 |
| Component: | OMEdit | Version: | v1.13.0-dev-nightly |
| Keywords: | Cc: |
Description
Consider the following model (also attached):
package test
model A
parameter Modelica.SIunit.Time T "time";
end A;
model B
parameter Modelica.SIunit.Time T1 "time1";
parameter Modelica.SIunit.Time T2 "time2";
test.A a1 annotation(
Placement(visible = true, transformation(origin = {-90, 10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
annotation(
Icon(coordinateSystem(grid = {0.1, 0.1})),
Diagram(coordinateSystem(extent = {{-200, -100}, {200, 100}})));
end B;
end test;
- open the model B
- open parameters window of model a1 and type (T1+T2)/T2 as value of T
The following error is rised in messages browser:
[1] 18:35:19 Scripting Error Unable to set the component modifier value using command setComponentModifierValue(test.B, a1.T, $Code((T1+T2)/T2)) [2] 18:35:19 Translation Error Class setComponentModifierValue not found in scope <global scope> (looking for a function or record).
And the typed value of parameter is lost.
OMEdit 1.13.0~dev-77-ga63f2df
Connected to OpenModelica 1.13.0~dev-489-g623259e
sysop: Linux Ubuntu 16.04 - 64 bit
Attachments (1)
Change History (6)
by , 8 years ago
comment:1 by , 8 years ago
| Component: | OMEdit → Interactive Environment |
|---|---|
| Owner: | changed from to |
| Status: | new → assigned |
comment:2 by , 8 years ago
comment:4 by , 8 years ago
| Component: | Interactive Environment → OMEdit |
|---|
comment:5 by , 8 years ago
It is great that this is fixed! I think ticket #4651 is related. Could you please check?
Note:
See TracTickets
for help on using tickets.

Seems OMEdit doesn't use setComponentModifierValue correctly in this case, is missing an
=which is:$Code(=(T1+T2)/T2). This works perfectly fine:giving:
adrpo33@ida-0030 MINGW64 /c/home/adrpo33/dev/OMTesting/bugs/4697 $ ~/dev/OpenModelica/build/bin/omc t.mos true "" true "" Ok "" "package test model A parameter Modelica.SIunit.Time T \"time\"; end A; model B parameter Modelica.SIunit.Time T1 \"time1\"; parameter Modelica.SIunit.Time T2 \"time2\"; test.A a1(T = (T1 + T2) / T2) annotation( Placement(visible = true, transformation(origin = {-90, 10}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); annotation( Icon(coordinateSystem(grid = {0.1, 0.1})), Diagram(coordinateSystem(extent = {{-200, -100}, {200, 100}}))); end B; end test;" ""