-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,14 +38,27 @@ package OperatingSystem | |
|
||
parameter Boolean setPriority = true "true, if process priority is to be set, otherwise false"; | ||
parameter Types.ProcessPriority priority = "Normal" "Priority of the simulation process" annotation(Dialog(enable=setPriority)); | ||
parameter Boolean enableRealTimeScaling = false | ||
"true, enable external real-time scaling input signal" | ||
annotation (Dialog(group="Advanced"), choices(checkBox=true)); | ||
Modelica.Blocks.Interfaces.RealInput scaling if enableRealTimeScaling | ||
"Real-time scaling factor; > 1 means the simulation is made slower than real-time" | ||
annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); | ||
output Modelica.SIunits.Time calculationTime "Time needed for calculation"; | ||
output Modelica.SIunits.Time availableTime "Time available for calculation (integrator step size)"; | ||
protected | ||
ProcessPriority procPrio(priority = priority) if setPriority; | ||
Real dummyState(start = 0, fixed=true) "dummy state to be integrated, to force synchronization in every integration step"; | ||
Modelica_DeviceDrivers.OperatingSystem.RealTimeSynchronization rtSync = Modelica_DeviceDrivers.OperatingSystem.RealTimeSynchronization(); | ||
/* Connectors for conditional connect equations */ | ||
Modelica.Blocks.Interfaces.RealInput defaultScaling = 1 if not enableRealTimeScaling "Default real-time scaling"; | ||
Modelica.Blocks.Interfaces.RealInput actScaling annotation (HideResult=true); | ||
equation | ||
(calculationTime, availableTime) = Modelica_DeviceDrivers.OperatingSystem.realtimeSynchronize(rtSync, time); | ||
/* Conditional connect equations to either use external real-time scaling input or default scaling */ | ||
connect(defaultScaling, actScaling); | ||
connect(scaling, actScaling); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
sjoelund
Contributor
|
||
|
||
(calculationTime, availableTime) = Modelica_DeviceDrivers.OperatingSystem.realtimeSynchronize(rtSync, time, enableRealTimeScaling, actScaling); | ||
der(dummyState) = calculationTime; | ||
annotation (preferredView="info", | ||
Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100, | ||
|
3 comments
on commit 6da353f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi
where to get rt.lib, I could find rt.dll but not rt.lib
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a dummy dependency on Win only and not needed for linking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So can I remove rt and compile on windows
Just wondering: Is it OK to connect two input connectors?