constructor function
Requirements.Internal.CSV.File.constructor
· source
Open the file, resolve the requested column names against its header, convert the columns
Extends Modelica.Icons.Function
Reads the MA-HS-CSV file fileName completely into memory, resolves the names in
realNames, booleanNames and integerNames against its header row and converts
those columns to Real, Boolean and Integer values; the other columns are skipped. Called when the parameter
file of Sources.PartialSignalsFromFile
is evaluated (at initialization). It raises an error (ModelicaError) if the file cannot be opened or read, is
empty, has a column name twice in its header, if a requested name is not in the header or names the time column,
or if a field cannot be converted to the requested type. extrapolateHold and rowEvents are
stored with the file and used by getReal and
nextTimeEvent.
Inputs
| Name | Type | Description |
|---|---|---|
fileName input | String | Absolute path of the MA-HS-CSV file |
realNames[…] input | String | Header names of the columns read as Real |
booleanNames[…] input | String | Header names of the columns read as Boolean |
integerNames[…] input | String | Header names of the columns read as Integer |
extrapolateHold input | Boolean | = true: hold the first/last row outside the file's time range; = false: error |
rowEvents input | Boolean | = true: an event at every row's time, not only where a Boolean or Integer column changes |
Outputs
| Name | Type | Description |
|---|---|---|
file output | File | The file, held in memory |