Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#3473 closed defect (fixed)

Conditional arrays don't work

Reported by: Maksimov Doe Owned by: Per Östlund
Priority: high Milestone: 1.9.4
Component: Frontend Version:
Keywords: Cc:

Description (last modified by Maksimov Doe)

package My

  connector InConn = input Real;
  connector OutConn = output Real;

  block Foo
    parameter Boolean enabled = false;
    InConn x if enabled;
  end Foo;

  block Src
    OutConn x = time;
  end Src;

  model Ex
    Foo[2] foo(enabled = {true, false});
    Src src;
    Src src1;
  equation
    connect(src.x, foo[1].x);
    connect(src1.x, foo[2].x);
  end Ex;

end My;

For the model My.Ex I have got flattened output:

class My.Ex
  parameter Boolean foo[1].enabled = true;
  Real foo[1].x;
  parameter Boolean foo[2].enabled = false;
  Real src.x = time;
  Real src1.x = time;
equation
  foo[1].x = src.x;
  foo[2].x = src1.x;
end My.Ex;

You can see that although foo[2].enabled is false and foo[2].x is deleted, equation 'connect(src1.x, foo[2].x)' has remained in equations set.

Change History (6)

comment:1 by Maksimov Doe, 9 years ago

Description: modified (diff)

comment:2 by Per Östlund, 9 years ago

Owner: changed from somebody to Per Östlund
Status: newaccepted

comment:3 by Per Östlund, 9 years ago

Resolution: fixed
Status: acceptedclosed

Fixed in ad14fcb.

comment:4 by Dietmar Winkler, 9 years ago

Milestone: Future1.9.4

Sorting these closed tickets away from "Future". Since they were closed after the last 1.9.3 release, it's very likely that they should have been part of the 1.9.4 release.

comment:5 by Martin Sjölund, 9 years ago

Milestone: 1.9.41.9.4-1.9.x

Milestone renamed

comment:6 by Martin Sjölund, 9 years ago

Milestone: 1.9.4-1.9.x1.9.4

Milestone renamed

Note: See TracTickets for help on using tickets.