Opened 5 years ago

Closed 4 years ago

#5976 closed defect (fixed)

Impossible to set parameters with units different from displayUnit (regression!)

Reported by: massimo ceraolo Owned by: Adeel Asghar
Priority: blocker Milestone: 1.16.0
Component: OMEdit Version:
Keywords: Cc:

Description (last modified by massimo 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 by massimo ceraolo, 5 years ago

Description: modified (diff)
Summary: Impossible to set initial spees in rad/s from GUIImpossible to set initial speeds in rad/s from GUI

comment:2 by Francesco Casella, 5 years ago

Milestone: 1.16.02.0.0
Priority: highblocker
Summary: Impossible to set initial speeds in rad/s from GUIImpossible to set parameters with units different from displayUnit

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

comment:3 by massimo ceraolo, 5 years ago

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 by Francesco Casella, 5 years ago

Milestone: 2.0.01.16.0
Summary: Impossible to set parameters with units different from displayUnitImpossible to set parameters with units different from displayUnit (regression!)

Ok, then I think it should really be fixed in 1.16.0.

comment:5 by Francesco Casella, 5 years ago

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 by Adeel Asghar, 4 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.