Opened 10 years ago

Closed 10 years ago

#3196 closed defect (fixed)

OMEdit vectorization support

Reported by: Rüdiger Franke Owned by: Adeel Asghar
Priority: high Milestone: 1.9.3
Component: OMEdit Version: trunk
Keywords: Cc: Adrian Pop, massimo ceraolo

Description

OMEdit already supports vector connections with the Connect Array dialog. This dialog expects positive integer values, like 1 to connect u1 to y3[1] in the example below. Additionally it should allow:

  1. enter no values and press ok -- e.g. to connect u2 to y2 in the example below
  2. enter array_subscripts with colon, like 2:3 for the connection of u2 to y3[2:3] in the example below

Moreover OMEdit does not seem to support the creation of vectors of components yet.

  1. The Attributes dialog should support names with a dimension specifier, like y2[2] and pass these unchanged to the Modelica text (currently such names lead to some undefined behavior).

See also the attached screenshot.

model Vectorization
  Modelica.Blocks.Interfaces.RealInput u1 annotation(Placement(visible = true, transformation(origin = {-30, 60}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {-52, 64}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Blocks.Interfaces.RealInput u2[2] annotation(Placement(visible = true, transformation(origin = {-30, 40}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {-50, 40}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Blocks.Interfaces.RealOutput y2[2] annotation(Placement(visible = true, transformation(origin = {30, 40}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {38, 62}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Blocks.Interfaces.RealOutput y3[3] annotation(Placement(visible = true, transformation(origin = {30, 60}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {30, 64}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
  connect(u1, y3[1]) annotation(Line(points = {{-30, 60}, {22, 60}, {22, 60}, {22, 60}}, color = {0, 0, 127}));
  connect(u2, y3[2:3]) annotation(Line(points = {{-30, 40}, {0, 40}, {0, 58}, {22, 58}, {22, 58}}, color = {0, 0, 127}));
  connect(u2, y2) annotation(Line(points = {{-30, 40}, {24, 40}, {24, 40}, {24, 40}}, color = {0, 0, 127}));
  annotation(Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})), Diagram(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})));
end Vectorization;

Attachments (1)

OMEdit_Vectorization.png (132.0 KB ) - added by Rüdiger Franke 10 years ago.

Download all attachments as: .zip

Change History (7)

by Rüdiger Franke, 10 years ago

Attachment: OMEdit_Vectorization.png added

comment:1 by Martin Sjölund, 10 years ago

Milestone: 1.9.21.9.3

Milestone changed to 1.9.3 since 1.9.2 was released.

comment:2 by Adeel Asghar, 10 years ago

Cc: Adrian Pop added

comment:3 by Adeel Asghar, 10 years ago

r25186 fixed point 1 and 2. For point 3 we first need to enhance OMC API to support the component dimension attribute.

comment:4 by Adrian Pop, 10 years ago

Added setComponentDimensions(class, component, {dim1, dim2, dim3}) API in r25289.

comment:5 by Adeel Asghar, 10 years ago

Cc: massimo ceraolo added

comment:6 by Adeel Asghar, 10 years ago

Resolution: fixed
Status: newclosed

Fixed in r25296.

Note: See TracTickets for help on using tickets.