| 1 | package TestReplaceable
|
|---|
| 2 | model M
|
|---|
| 3 | replaceable model RM = TestReplaceable.RM1 constrainedby TestReplaceable.BM
|
|---|
| 4 | annotation(choicesAllMatching = true);
|
|---|
| 5 | parameter Real p = 4;
|
|---|
| 6 | RM rm;
|
|---|
| 7 | end M;
|
|---|
| 8 |
|
|---|
| 9 | model S1
|
|---|
| 10 | TestReplaceable.M m(
|
|---|
| 11 | redeclare model RM = TestReplaceable.RM1,
|
|---|
| 12 | p = 5) annotation(
|
|---|
| 13 | Placement(visible = true, transformation(origin = {0, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
|
|---|
| 14 | end S1;
|
|---|
| 15 |
|
|---|
| 16 | partial model BM "Partial model"
|
|---|
| 17 | end BM;
|
|---|
| 18 |
|
|---|
| 19 | model RM1 "Replaceable model 1"
|
|---|
| 20 | extends TestReplaceable.BM;
|
|---|
| 21 | Real x = 3;
|
|---|
| 22 | end RM1;
|
|---|
| 23 | end TestReplaceable;
|
|---|