Skip to content

Commit

Permalink
fix example
Browse files Browse the repository at this point in the history
  • Loading branch information
lenaRB committed Nov 29, 2024
1 parent ba6ae4f commit e27bdd4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions resources/modelica_libraries/CRMLtoModelica.mo
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
package CRMLtoModelica
import CRML.ETL.Types.Boolean4;
package Types

record CRMLClock
Expand Down Expand Up @@ -90,7 +89,7 @@ end CRMLClock;
CRMLPeriod P;

equation
P.is_open = if( CRMLtoModelica.Functions.Event2Boolean (P.start_event) and not CRMLtoModelica.Functions.Event2Boolean (P.close_event))then true else false;
P.is_open = if( (CRMLtoModelica.Functions.Event2Boolean (P.start_event) == Boolean4.true4) and not (CRMLtoModelica.Functions.Event2Boolean (P.close_event)== Boolean4.true4))then true else false;


end CRMLPeriod_build;
Expand Down Expand Up @@ -286,11 +285,11 @@ end cvBooleanToBoolean4;
function Event2Boolean
input Types.Event e;

output Boolean b;
output Boolean4 b;

algorithm

b:=if(e.b == CRMLtoModelica.Types.Boolean4.true4)then true else false;
b:=if(e.b == CRMLtoModelica.Types.Boolean4.true4)then Boolean4.true4 else Boolean4.false4;

end Event2Boolean;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
model BooleanAtEvent_no_ext is {
Boolean b1 is if 2.5 < time and time < 5 then true else false;
Boolean b is if (2.0 <= time and time < 3.5) or (4.0 <= time and time < 5.5) then true else false;
Boolean b1 is if (2.5 < time) and (time < 5) then true else false;
Boolean b is if ((2.0 <= time) and (time < 3.5)) or ((4.0 <= time) and (time < 5.5)) then true else false;
Clock c is new Clock b;
Boolean b_at_event is b1 at c; // Should start at false and becomes true at t=4s
};

0 comments on commit e27bdd4

Please sign in to comment.