Just simply test StateGraph2 with latest openmodelica nightly building package, to make it works , just to replace Modelica.SIunits by Modelica.Units.SI is enough.
--- package.mo.orig 2022-06-14 16:34:23.027300648 +0800
+++ package.mo 2022-06-14 16:36:14.488418483 +0800
@@ -3632,14 +3632,14 @@
model TankController1
"Controller 1 for tank system (using expressions to control the valves)"
extends Modelica.Blocks.Interfaces.BlockIcon;
- parameter Modelica.SIunits.Height limit1(min=0) = 0.98
+ parameter Modelica.Units.SI.Height limit1(min=0) = 0.98
"Maximum level of tank 1";
- parameter Modelica.SIunits.Height limit2(min=0) = 0.98
+ parameter Modelica.Units.SI.Height limit2(min=0) = 0.98
"Maximum level of tank 2";
- parameter Modelica.SIunits.Height minLevel(min=0) = 0.01
+ parameter Modelica.Units.SI.Height minLevel(min=0) = 0.01
"Minimum fill level of a tank";
- parameter Modelica.SIunits.Time waitTime=3
+ parameter Modelica.Units.SI.Time waitTime=3
"Wait time to newly open a valve";
Modelica.Blocks.Interfaces.BooleanInput start annotation (Placement(
@@ -4078,13 +4078,13 @@
model TankController2
"Controller 2 for tank system (using expressions to control the valves)"
extends Modelica.Blocks.Interfaces.BlockIcon;
- parameter Modelica.SIunits.Height limit1(min=0) = 0.98
+ parameter Modelica.Units.SI.Height limit1(min=0) = 0.98
"Maximum level of tank 1";
- parameter Modelica.SIunits.Height limit2(min=0) = 0.98
+ parameter Modelica.Units.SI.Height limit2(min=0) = 0.98
"Maximum level of tank 2";
- parameter Modelica.SIunits.Height minLevel(min=0) = 0.01
+ parameter Modelica.Units.SI.Height minLevel(min=0) = 0.01
"Minimum fill level of a tank";
- parameter Modelica.SIunits.Time waitTime=3
+ parameter Modelica.Units.SI.Time waitTime=3
"Wait time to newly open a valve";
Modelica_StateGraph2.Step stopStep1(nIn=1, nOut=2)
@@ -4312,13 +4312,13 @@
final use_outPort=false,
nEntry=1,
nExit=1);
- parameter Modelica.SIunits.Height limit1(min=0) = 0.98
+ parameter Modelica.Units.SI.Height limit1(min=0) = 0.98
"Maximum level of tank 1";
- parameter Modelica.SIunits.Height limit2(min=0) = 0.98
+ parameter Modelica.Units.SI.Height limit2(min=0) = 0.98
"Maximum level of tank 2";
- parameter Modelica.SIunits.Height minLevel(min=0) = 0.01
+ parameter Modelica.Units.SI.Height minLevel(min=0) = 0.01
"Minimum fill level of a tank";
- parameter Modelica.SIunits.Time waitTime=3
+ parameter Modelica.Units.SI.Time waitTime=3
"Wait time to newly open a valve";
SignalBus bus annotation (Placement(transformation(
@@ -4491,7 +4491,7 @@
final use_outPort=true,
final nEntry=2,
final nExit=2);
- parameter Modelica.SIunits.Height minLevel(min=0) = 0.01
+ parameter Modelica.Units.SI.Height minLevel(min=0) = 0.01
"Minimum fill level of a tank";
SignalBus bus annotation (Placement(transformation(
@@ -4602,8 +4602,8 @@
Boolean start annotation (HideResult=false);
Boolean stop annotation (HideResult=false);
Boolean shut annotation (HideResult=false);
- Modelica.SIunits.Length level1 annotation (HideResult=false);
- Modelica.SIunits.Length level2 annotation (HideResult=false);
+ Modelica.Units.SI.Length level1 annotation (HideResult=false);
+ Modelica.Units.SI.Length level2 annotation (HideResult=false);
annotation (Icon(graphics={Rectangle(
extent={{0,0},{0,0}},
@@ -12332,7 +12332,7 @@
Evaluate=true,
HideResult=true,
choices(__Dymola_checkBox=true));
- parameter Modelica.SIunits.Time waitTime=0
+ parameter Modelica.Units.SI.Time waitTime=0
"Wait time before transition fires (> 0 required)"
annotation (Dialog(enable=delayedTransition));
@@ -12369,8 +12369,8 @@
output Boolean enableFire "= true, if firing condition is true";
protected
- constant Modelica.SIunits.Time minimumWaitTime=100*Modelica.Constants.eps;
- Modelica.SIunits.Time t_start
+ constant Modelica.Units.SI.Time minimumWaitTime=100*Modelica.Constants.eps;
+ Modelica.Units.SI.Time t_start
"Time instant at which the transition would fire, if waitTime would be zero";
Modelica.Blocks.Interfaces.BooleanInput localCondition;
initial equation
@@ -12589,7 +12589,7 @@
"Fire condition (time varying Boolean expression)"
annotation (Dialog(enable=not use_conditionPort));
- parameter Modelica.SIunits.Time waitTime(min=1e-8) = 0.001
+ parameter Modelica.Units.SI.Time waitTime(min=1e-8) = 0.001
"Time to wait in internal step after transition fired";
Modelica_StateGraph2.Internal.Interfaces.Transition_in inPort
@@ -13337,11 +13337,11 @@
block OnDelay
"Delay a rising edge of the input, but do not delay a falling edge."
extends Interfaces.PartialBooleanSISO;
- parameter Modelica.SIunits.Time delayTime "Delay time";
+ parameter Modelica.Units.SI.Time delayTime "Delay time";
protected
Boolean delaySignal(start=false, fixed=true);
- discrete Modelica.SIunits.Time t_next;
+ discrete Modelica.Units.SI.Time t_next;
initial equation
pre(u) = false;
pre(t_next) = time - 1;
@@ -13850,7 +13850,7 @@
block RadioButtonSource "Boolean signal source that mimis a radio button"
- parameter Modelica.SIunits.Time buttonTimeTable[:]
+ parameter Modelica.Units.SI.Time buttonTimeTable[:]
"Time instants where button is pressed";
input Boolean reset[:]={false}
"Reset button to false, if an element of reset becomes true"
@@ -14385,7 +14385,7 @@
choices(__Dymola_checkBox=true));
input Boolean guard=true "y not changing, if guard=false (time varying)"
annotation (Dialog(group="Other options", enable=use_guard));
- parameter Modelica.SIunits.Time samplePeriod=0
+ parameter Modelica.Units.SI.Time samplePeriod=0
"Sample period if active=true (only temporarily)"
annotation (Dialog(group="Other options", enable=active));