Opened 5 years ago
Last modified 4 years ago
#6277 new defect
Parameter with negative sign changes display unit
| Reported by: | Owned by: | Adeel Asghar | |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | OMEdit | Version: | v1.17.0-dev |
| Keywords: | Cc: |
Description
Consider the following (attached) example:
model Degree
Modelica.Electrical.QuasiStationary.SinglePhase.Basic.Ground ground annotation(
Placement(visible = true, transformation(origin = {0, -26}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Electrical.QuasiStationary.SinglePhase.Sources.VoltageSource voltageSource(phi (displayUnit = "deg") = 0) annotation(
Placement(visible = true, transformation(origin = {0, 10}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
equation
connect(voltageSource.pin_n, ground.pin) annotation(
Line(points = {{0, 0}, {0, -16}}, color = {85, 170, 255}));
annotation(
uses(Modelica(version = "3.2.3")));
end Degree;
For the angle phi the display unit deg is defined.
I perform a double click on the voltage source model to change the parameter settings. I mark the 0 of phi by double clicking on it and to then overwrite it with a new negative number. As I start typing the negative sign, e.g. in -240, the display unit switches to rad.
Attachments (3)
Change History (7)
by , 5 years ago
by , 5 years ago
Entering a negative number switches to display unit "rad"
comment:1 by , 5 years ago
The rationale here is that as soon as you type an expression, and not just a literal value, it makes no sense to interpret it in any other unit than the native (SI) unit.
I guess the problem is that OMEdit inteprets the unary minus operator attached to a literal value as an expression. Of course it shouldn't.
@adeas31, can you get this in 1.16.2? Otherwise please reschedule to 1.17.0
comment:2 by , 5 years ago
| Milestone: | 1.16.2 → 1.17.0 |
|---|
comment:3 by , 5 years ago
| Milestone: | 1.17.0 → 1.18.0 |
|---|
Retargeted to 1.18.0 because of 1.17.0 timed release.

Example model showing the issue