Buildings.Utilities.IO.Files.Validation
Collection of models that validate the models that access files
Information
This package contains models that validate the models that access files. The examples plot various outputs. These model outputs are stored as reference data to allow continuous validation whenever models in the library change.
Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).
Package Content
Name | Description |
---|---|
WeeklyScheduleWindowsLineEndings | Weekly schedule example |
Buildings.Utilities.IO.Files.Validation.WeeklyScheduleWindowsLineEndings
Weekly schedule example
Information
Example for a weekly schedule that reads the schedule data from a file. There are two file readers, one reading a file with Windows line endings and the other with Linux line endings.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
---|---|---|---|
String | data | "double tab1(3,5) #test: mon... | Contents of schedule.txt |
Modelica definition
model WeeklyScheduleWindowsLineEndings "Weekly schedule example"
extends Modelica.Icons.Example;
parameter String data = "double tab1(3,5) #test:
mon:0:0:10 - 3 1 -
tue,thu:20:30:59 123 - 45 -
wed 12 1 4 -" "Contents of schedule.txt";
Buildings.Utilities.IO.Files.WeeklySchedule weeSchLin(
columns={2,3,4,5},
tableOnFile=true,
fileName=Modelica.Utilities.Files.loadResource("modelica://Buildings/Resources/Data/schedule.txt"),
t_offset=1e6) "Weekly schedule example using file data source";
Buildings.Utilities.IO.Files.WeeklySchedule weeSchWin(
columns={2,3,4,5},
tableOnFile=true,
fileName=Modelica.Utilities.Files.loadResource("modelica://Buildings/Resources/Data/scheduleWindows.txt"),
t_offset=1e6) "Weekly schedule example using parameter data source";
Diagnostics.AssertEquality assEqu[4](
each startTime=-10000,
each threShold=Modelica.Constants.small)
"Trigger an assertion if the outputs differ";
equation
connect(weeSchLin.y, assEqu.u1);
connect(weeSchWin.y, assEqu.u2);
end WeeklyScheduleWindowsLineEndings;