The observation data derived type declaration, and all associated procedures.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public, | parameter | :: | OBSERV_ID_LEN | = | UUID_LEN |
Max. observation id length. |
integer, | public, | parameter | :: | OBSERV_NAME_LEN | = | ID_LEN |
Max. observation name length. |
integer, | public, | parameter | :: | OBSERV_SOURCE_LEN | = | ID_LEN |
Max. observation source length. |
integer, | public, | parameter | :: | OBSERV_DEVICE_LEN | = | 32 |
Max. observation device length. |
integer, | public, | parameter | :: | OBSERV_RECEIVER_LEN | = | ID_LEN |
Max. observation receiver length. |
integer, | public, | parameter | :: | OBSERV_MAX_NRECEIVERS | = | 16 |
Max. number of receivers. |
integer, | public, | parameter | :: | OBSERV_MAX_NREQUESTS | = | 8 |
Max. number of requests. |
integer, | public, | parameter | :: | OBSERV_SIZE | = | storage_size(observ_type())/8 |
Size of |
integer, | public, | parameter | :: | OBSERV_VIEW_SIZE | = | storage_size(observ_view_type())/8 |
Size of |
Returns whether observations or observation views are equal.
Returns .true.
if given observations are equal.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(observ_type), | intent(in) | :: | observ1 |
The first observation. |
||
type(observ_type), | intent(in) | :: | observ2 |
The second observation. |
Returns .true.
if given observation views are equal.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(observ_view_type), | intent(in) | :: | view1 |
The first observation view. |
||
type(observ_view_type), | intent(in) | :: | view2 |
The second observation view. |
Observation with receivers, requests, and responses. Modifying this
type requires changes in dm_csv
, dm_db
, dm_hdf5
, dm_html
,
dm_json
, and several other modules (you probably don’t want that!).
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=OBSERV_ID_LEN), | public | :: | id | = | UUID_DEFAULT |
Observation id (UUIDv4). |
|
character(len=NODE_ID_LEN), | public | :: | node_id | = | ' ' |
Node id ( |
|
character(len=SENSOR_ID_LEN), | public | :: | sensor_id | = | ' ' |
Sensor id ( |
|
character(len=TARGET_ID_LEN), | public | :: | target_id | = | ' ' |
Target id ( |
|
character(len=OBSERV_NAME_LEN), | public | :: | name | = | ' ' |
Observation name ( |
|
character(len=TIME_LEN), | public | :: | timestamp | = | ' ' |
ISO 8601 timestamp. |
|
character(len=OBSERV_SOURCE_LEN), | public | :: | source | = | ' ' |
Observation source ( |
|
character(len=OBSERV_DEVICE_LEN), | public | :: | device | = | ' ' |
Physical device (TTY/PTY). |
|
integer, | public | :: | priority | = | 0 |
Message queue priority (>= 0). |
|
integer, | public | :: | error | = | E_NONE |
Error code. |
|
integer, | public | :: | next | = | 0 |
Next receiver index. |
|
integer, | public | :: | nreceivers | = | 0 |
Number of receivers. |
|
integer, | public | :: | nrequests | = | 0 |
Number of requests. |
|
character(len=OBSERV_RECEIVER_LEN), | public | :: | receivers(OBSERV_MAX_NRECEIVERS) | = | ' ' |
Array of receivers ( |
|
type(request_type), | public | :: | requests(OBSERV_MAX_NREQUESTS) |
Array of requests. |
View of an observation with only one response of a single request.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=OBSERV_ID_LEN), | public | :: | observ_id | = | UUID_DEFAULT |
Observation id (UUID). |
|
character(len=NODE_ID_LEN), | public | :: | node_id | = | ' ' |
Node id ( |
|
character(len=SENSOR_ID_LEN), | public | :: | sensor_id | = | ' ' |
Sensor id ( |
|
character(len=TARGET_ID_LEN), | public | :: | target_id | = | ' ' |
Target id ( |
|
character(len=OBSERV_NAME_LEN), | public | :: | observ_name | = | ' ' |
Observation name. |
|
integer, | public | :: | observ_error | = | E_NONE |
Observation error code. |
|
character(len=REQUEST_NAME_LEN), | public | :: | request_name | = | ' ' |
Request name ( |
|
character(len=TIME_LEN), | public | :: | request_timestamp | = | ' ' |
Request timestamp (ISO 8601). |
|
integer, | public | :: | request_error | = | E_NONE |
Request error code. |
|
character(len=RESPONSE_NAME_LEN), | public | :: | response_name | = | ' ' |
Response name ( |
|
character(len=RESPONSE_UNIT_LEN), | public | :: | response_unit | = | ' ' |
Response unit (optional). |
|
integer, | public | :: | response_type | = | RESPONSE_TYPE_REAL64 |
Response value type. |
|
integer, | public | :: | response_error | = | E_NONE |
Response error code. |
|
real(kind=r8), | public | :: | response_value | = | 0.0_r8 |
Response value. |
Validates and adds receiver to observation.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(observ_type), | intent(inout) | :: | observ |
Observation type. |
||
character(len=*), | intent(in) | :: | receiver |
Receiver name. |
Appends a request to an observation. Returns E_BOUNDS
if the list
of requests is full. The function does not validate the given
request.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(observ_type), | intent(inout) | :: | observ |
Observation type. |
||
type(request_type), | intent(inout) | :: | request |
Request type. |
Returns .true.
if given observations are equal.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(observ_type), | intent(in) | :: | observ1 |
The first observation. |
||
type(observ_type), | intent(in) | :: | observ2 |
The second observation. |
Searches requests array of the observation for responses of passed name
and returns the index of the first found. If no request of this name
is found, E_NOT_FOUND
is returned and request and index are set to 0.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(observ_type), | intent(inout) | :: | observ |
Observation type. |
||
character(len=*), | intent(in) | :: | response_name |
Response name. |
||
integer, | intent(out), | optional | :: | request_index |
Position of request in requests array. |
|
integer, | intent(out), | optional | :: | response_index |
Position of response in responses array. |
Returns .true.
if given observation is valid. An observation is
valid if it conforms to the following requirements:
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(observ_type), | intent(in) | :: | observ |
Observation type. |
||
logical, | intent(in), | optional | :: | id |
Enable id validation (on by default). |
|
logical, | intent(in), | optional | :: | timestamp |
Enable timestamp validation (on by default). |
Returns .true.
if given observation views are equal.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(observ_view_type), | intent(in) | :: | view1 |
The first observation view. |
||
type(observ_view_type), | intent(in) | :: | view2 |
The second observation view. |
Prints observation to standard output or given file unit.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(observ_type), | intent(inout) | :: | observ |
Observation type. |
||
integer, | intent(in), | optional | :: | unit |
File unit. |