function
Vehicles.Interfaces.scheduledChannels
Hold one row of a time-indexed channel schedule
The lookup is a function of time alone, so the held row does not depend on when sampling started or on a retained index, and the schedule composes into an ordinary equation rather than needing a clock of its own.
Public declarations
Explicit source declarations; dimensions, modifications and defaults are shown as written, without evaluation.
| Role | Name | Type | Dimensions / attributes / default | Description |
|---|---|---|---|---|
| input | now_s | Real | (unit = "s") | |
| input | activationTime_s | Real | [:](each unit = "s") | Strictly ascending activation times |
| input | channelValue | Real | [size(activationTime_s, 1), :] | One row of channel values per activation time |
| output | value | Real | [size(channelValue, 2)] | Row currently in force |
Modelica declarations and implementation
Show parameters, interfaces and source
Parameters, inputs, outputs, defaults and equations from the source file.
function scheduledChannels
"Hold one row of a time-indexed channel schedule"
input Real now_s(unit = "s");
input Real activationTime_s[:](each unit = "s")
"Strictly ascending activation times";
input Real channelValue[size(activationTime_s, 1), :]
"One row of channel values per activation time";
output Real value[size(channelValue, 2)] "Row currently in force";
algorithm
value := channelValue[
Vehicles.Interfaces.activeScheduleRow(now_s, activationTime_s), :];
annotation(Documentation(info = "<html>
<p>The lookup is a function of time alone, so the held row does not depend
on when sampling started or on a retained index, and the schedule composes
into an ordinary equation rather than needing a clock of its own.</p>
</html>"));
end scheduledChannels;