Opened 8 years ago
Last modified 8 years ago
#4110 closed defect
OMEdit introduces additional newline if annotation starts on new line — at Initial Version
Reported by: | Rüdiger Franke | Owned by: | Adeel Asghar |
---|---|---|---|
Priority: | high | Milestone: | 1.9.x |
Component: | Interactive Environment | Version: | |
Keywords: | Cc: |
Description
Many models place the annotation of a component declaration on a new line. OMEdit will introduce an additional newline between the component name and the modifiers.
See the following example. Open the parameter dialog for IconWithValues.Test.component1
, change the value of x
and press OK
.
package IconWithValues model Test Component component1(x = 5) annotation(Placement(visible = true, transformation(origin = {0, 0}, extent = {{-45, -45}, {45, 45}}))); end Test; model Component parameter Real x; Real y = sin(x); Boolean neg = y < 0; Boolean pos = not neg; annotation(Icon(graphics = { Rectangle(origin = {0, 0}, extent = {{-95, 95}, {95, -95}}, visible = DynamicSelect(false, neg)), Text(origin = {-55, 35}, extent = {{-35, 15}, {50, -30}}, textString = "x = "), Text(origin = {-55, 35}, extent = {{50, 15}, {150, -30}}, textString = DynamicSelect("x", String(x))), Text(origin = {-55, -30}, extent = {{-35, 15}, {150, -30}}, textString = DynamicSelect("%y", String(y, significantDigits = 3)), visible = DynamicSelect(true, pos)), Text(origin = {-55, -30}, extent = {{-35, 15}, {150, -30}}, textString = DynamicSelect("%y", String(y, significantDigits = 3)), visible = DynamicSelect(false, neg), lineColor = {255, 0, 0})}, coordinateSystem(initialScale = 0.1))); end Component; end IconWithValues;
This will result in the following model text with additional newline:
model Test Component component1 (x = 6) annotation(Placement(visible = true, ...); end Test;
Note:
See TracTickets
for help on using tickets.