Skip to content

Commit eb0530e

Browse files
adeas31OpenModelica-Hudson
authored andcommitted
Test the initial state APIs.
1 parent 17af9c5 commit eb0530e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

openmodelica/interactive-API/StateMachine.mos

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ getTransitions(StateMachine); getErrorString();
1414
deleteTransition(StateMachine, "state1", "state2", "a < 1", false, false, true, 2); getErrorString();
1515
getTransitions(StateMachine); getErrorString();
1616

17+
addInitialState(StateMachine, "state2", annotate = Line(points={{-8,6},{0,72}},color={175,175,175},thickness=0.25,smooth=Smooth.Bezier)); getErrorString();
18+
updateInitialState(StateMachine, "state2", annotate = Line(points={{-18,26},{10,37}},color={175,175,175},thickness=0.5,smooth=Smooth.Bezier)); getErrorString();
19+
deleteInitialState(StateMachine, "state1"); getErrorString();
20+
getInitialStates(StateMachine); getErrorString();
21+
1722
// Result:
1823
// true
1924
// ""
@@ -31,4 +36,12 @@ getTransitions(StateMachine); getErrorString();
3136
// ""
3237
// {{"state1","state2","i > 10","false","true","false","1","Line(true, {0.0, 0.0}, 0, {{-8, 6}, {0, 72}}, {175, 175, 175}, LinePattern.Solid, 0.25, {Arrow.Filled, Arrow.None}, 3, Smooth.None)"},{"state2","state1","b > 10","true","false","false","1",""},{"state2","state1","c > 20","false","false","true","1","Line(true, {0.0, 0.0}, 0, {{-8, 6}, {0, 72}}, {175, 175, 175}, LinePattern.Solid, 0.25, {Arrow.Filled, Arrow.None}, 3, Smooth.None)"}}
3338
// ""
39+
// true
40+
// ""
41+
// true
42+
// ""
43+
// true
44+
// ""
45+
// {{"state2","Line(true, {0.0, 0.0}, 0, {{-18, 26}, {10, 37}}, {175, 175, 175}, LinePattern.Solid, 0.5, {Arrow.None, Arrow.None}, 3, Smooth.Bezier)"}}
46+
// ""
3447
// endResult

0 commit comments

Comments
 (0)