DelftIO Par/Loc/Time Dataset Delphi Interface
The dataset object
Enumerations
type | ||
TDataType | dParameter, dLocation, dTime | Indicates the data type for some methods |
The dataset object
constructor Create (stream : TStream; identification : String);
The constructor creates a dataset object and immediately writes/reads structure information about the dataset.
arguments | ||
TStream | stream | stream on which dataset is defined |
string | identification | A logical name identifying the dataset. If the name belongs to an existing dataset in the stream, this dataset will be used for reading and writing. If it does not exist, it will be created if the stream is opened for writing, otherwise an exception will be raised. |
result | ||
TDataset | Parameter/Location/Time dataset object | |
exception | ||
EDelftIOError | An exception is raised if the stream is opened in read mode and the dataset does not exist |
Defining the dataset structure
procedure Define (Datatype : TDatatype; Name : string); overload;
This procedure adds an extra string identifier along one of the axes of the PLT structure.
arguments | ||
TDataType | datatype | The data type item to be defined |
string | name | The string identifier along one of the axes. If the string identifier already exists for this data type, nothing happens. |
procedure Define (Datatype : TDatatype; Names : TStringList); overload;
This procedure adds a number of string identifiers along one of the axes of the PLT structure.
arguments | ||
TDataType | datatype | The data type item to be defined |
TStringList | names | A list of string identifiers along one of the axes. Existing string identifiers in the dataset are ignored. |
function Count (Datatype : TDatatype) : integer;
This function tells the number of string identifiers along one of the axes.
arguments | ||
TDataType | datatype | The data type item to be counted |
result | ||
integer | The number of string identifiers. If the dataset has not been flushed yet, the newly added or deleted string identifiers are taken into account. |
function getIndex (Datatype : TDatatype; Name : string) : integer;
Returns the index number of a specified string identifier along one the axes.
arguments | ||
TDataType | datatype | The data type item, which should contain the string identifier |
String | name | The name of the string identifier |
result | ||
integer | The index number of the string identifier, zero based. If the string identifier has not been found, -1 is returned. |
function getName (Datatype : TDatatype; Index : integer) : string;
Returns the name of a string identifier at a specified position along one of the axes.
arguments | ||
TDataType | datatype | The data type item, which should contain the string identifier |
integer | index | The position of the string identifier |
result | ||
String | The name of the string identifier |
procedure setName (Datatype : TDatatype; Index : integer; Name : string);
Sets the name of a string identifier at a specified position along one of the axes.
arguments | ||
TDataType | datatype | The data type item, which should contain the string identifier |
integer | index | The position of the string identifier |
String | name | The name of the string identifier |
Reading and writing the dataset values
function getValue (Par, Loc, Time : integer) : double; overload;
Gets the value at a specified position.
arguments | ||
integer | Par | The index along the parameter axis, zero based |
integer | Loc | The index along the location axis |
integer | Time | The index along the time axis |
result | ||
double | The value at the specified position | |
exception | ||
EDelftIOError | Raised if one of the indices is out of bounds |
function getValue (Index1, Index2 : integer) : double; overload;
Gets the value at a specified position. This function is appropriate if the dataset is at most two dimensional, i.e. the number of string identifiers along at most two of the axes is greater than one, along the other axes it is exactly one.
arguments | ||
integer | Index1 | The index along the first axis, which contains more than one string identifier. The axes are ordered as Par, Loc, Time. |
integer | Index2 | The index along the second axis, which contains more than one string identifier |
result | ||
double | The value at the specified position | |
exception | ||
EDelftIOError | Raised if one of the indices is out of bounds or if the dataset is three dimensional. |
function getValue (Index : integer) : double; overload;
Gets the value at a specified position. This function is appropriate if the dataset is at most one dimensional, i.e. the number of string identifiers along at most one of the axes is greater than one, along the other axes it is excatly one.
arguments | ||
integer | Index | The index along the axis, which contains more than one string identifier. |
result | ||
double | The value at the specified position | |
exception | ||
EDelftIOError | Raised if the index is out of bounds or if the dataset is two or three dimensional. |
function getValue: double; overload;
Gets the value at a specified position. This function is appropriate if the dataset is zero dimensional, i.e. the number of string identifiers along all axes is exactly one.
result | ||
double | The value at the specified position | |
exception | ||
EDelftIOError | Raised if the index is out of bounds or if the dataset is not zero dimensional |
procedure setValue (Par, Loc, Time : integer; Value : double); overload;
Sets the value at a specified position.
arguments | ||
integer | Par | The index along the parameter axis, zero based |
integer | Loc | The index along the location axis |
integer | Time | The index along the time axis |
double | Value | The value at the specified position |
exception | ||
EDelftIOError | Raised if one of the indices is out of bounds |
procedure setValue (Index1, Index2 : integer; Value : double); overload;
Sets the value at a specified position. This function is appropriate if the dataset is at most two dimensional, i.e. the number of string identifiers along at most two of the axes is greater than one, along the other axes it is exactly one.
arguments | ||
integer | Index1 | The index along the first axis, which contains more than one string identifier. The axes are ordered as Par, Loc, Time. |
integer | Index2 | The index along the second axis, which contains more than one string identifier |
double | Value | The value at the specified position |
exception | ||
EDelftIOError | Raised if one of the indices is out of bounds or if the dataset is three dimensional. |
procedure setValue (Index : integer; Value : double); overload;
Sets the value at a specified position. This function is appropriate if the dataset is at most one dimensional, i.e. the number of string identifiers along at most one of the axes is greater than one, along the other axes it is excatly one.
arguments | ||
integer | Index | The index along the axis, which contains more than one string identifier. |
result | ||
double | The value at the specified position | |
exception | ||
EDelftIOError | Raised if the index is out of bounds or if the dataset is two or three dimensional. |
procedure setValue (Value : double); overload;
Sets the value at a specified position. This function is appropriate if the dataset is zero dimensional, i.e. the number of string identifiers along all axes is exactly one.
result | ||
double | The value at the specified position | |
exception | ||
EDelftIOError | Raised if the index is out of bounds or if the dataset is not zero dimensional |
Flushing the dataset
procedure Read;
This method retrieves the stored values. To perform a meaningful getValue accessing the stored values, this method must be called first. Otherwise, only values put by a setValue are retrieved, or zero values.
exception | ||
EDelftIOError | Raised if an error occurs when accessing the stored values |
procedure Write;
This method stores the values. To store the values, which have been set by setValue, this methos must be called. If you do not call this method after a (number of) setValue(s), these values will be lost.
If necessary, this method calls WriteFramework first to store the dataset structure.
exception | ||
EDelftIOError | Raised if an error occurs when writing the values |
procedure WriteFramework;
This method stores the structure of the dataset. If you changed the dataset structure, this method must be called to actually store this structure.
exception | ||
EDelftIOError | Raised if an error occurs when writing the dataset structure |