block Transition "Transition where the fire condition is set by a modification of variable condition"
input Boolean condition = true "= true, if transition may fire (time varying expression)"
annotation (Dialog(group = "Fire condition"));
extends Interfaces.PartialTransition(final localCondition = condition);
annotation (
Icon(
coordinateSystem(
preserveAspectRatio = true,
extent = {
{-100, -100},
{100, 100}}),
graphics = {
Rectangle(
extent = {
{-10, 100},
{10, -100}},
fillColor = DynamicSelect({0, 0, 0}, if enableFire then {0, 255, 0} else {0, 0, 0}),
fillPattern = FillPattern.Solid),
Line(points = {
{-30, 0},
{-10, 0}}),
Text(
extent = {
{200, 110},
{-200, 150}},
textString = "%name",
lineColor = {0, 0, 255}),
Text(
extent = {
{20, 20},
{200, 45}},
lineColor = DynamicSelect({0, 0, 0}, if enableTimer then {255, 255, 255} else {0, 0, 0}),
textString = "%waitTime"),
Text(
extent = {
{-200, -120},
{200, -145}},
lineColor = DynamicSelect({0, 0, 0}, if condition then {0, 255, 0} else {0, 0, 0}),
textString = "%condition")}),
Diagram(
coordinateSystem(
preserveAspectRatio = true,
extent = {
{-100, -100},
{100, 100}}),
graphics = {
Line(points = {
{-31, 0},
{-11, 0}}),
Rectangle(
extent = {
{-10, 100},
{10, -100}},
fillPattern = FillPattern.Solid)}));
end Transition;