Opened 4 years ago
Closed 4 years ago
#5976 closed defect (fixed)
Impossible to set parameters with units different from displayUnit (regression!)
Reported by: | ceraolo | Owned by: | adeas31 |
---|---|---|---|
Priority: | blocker | Milestone: | 1.16.0 |
Component: | OMEdit | Version: | |
Keywords: | Cc: |
Description (last modified by ceraolo)
Consider the following model:
model speed Modelica.Mechanics.Rotational.Components.Inertia ICE(J = 0.73, w(displayUnit = "rpm", fixed = true, start = 17.48)) annotation( Placement(visible = true, transformation(extent = {{-12, -8}, {8, 12}}, rotation = 0))); equation annotation( Diagram(coordinateSystem(extent = {{-100, -80}, {100, 80}})), uses(Modelica(version = "3.2.3"))); end speed;
From the GUI it seems possible to set the initial speed in rad/s, but indeed it is impossible.
Tested with OM v1.16.0-dev-330.
Change History (6)
comment:1 Changed 4 years ago by ceraolo
- Description modified (diff)
- Summary changed from Impossible to set initial spees in rad/s from GUI to Impossible to set initial speeds in rad/s from GUI
comment:2 Changed 4 years ago by casella
- Milestone changed from 1.16.0 to 2.0.0
- Priority changed from high to blocker
- Summary changed from Impossible to set initial speeds in rad/s from GUI to Impossible to set parameters with units different from displayUnit
comment:3 Changed 4 years ago by ceraolo
It's also a regression.
At least my 1.14-dev234 version (which I still use for teaching) did not have this issue.
comment:4 Changed 4 years ago by casella
- Milestone changed from 2.0.0 to 1.16.0
- Summary changed from Impossible to set parameters with units different from displayUnit to Impossible to set parameters with units different from displayUnit (regression!)
Ok, then I think it should really be fixed in 1.16.0.
comment:5 Changed 4 years ago by casella
BTW, I think the behaviour should be as follows:
- when the parameter window is opened, the displayUnit should be used to show the parameter value
- if I change the unit, the value in the input field should be converted (of course only if it is a literal value, otherwise only the default unit should be selected)
- if I type in a literal value and hit return, the value should be accepted in the currently selected unit
comment:6 Changed 4 years ago by adeas31
- Resolution set to fixed
- Status changed from new to closed
Fixed in 737ef3b/OpenModelica.
Thank you @ceraolo! I thought I had already opened a ticket on this issue, but it turns out I haven't.
The problem is completely general, I changed the title accordingly. This should be really fixed for the 2.0.0 release, possibly earlier