dm_sensor Module

Sensor type declaration.


Uses

  • module~~dm_sensor~~UsesGraph module~dm_sensor dm_sensor module~dm_id dm_id module~dm_sensor->module~dm_id module~dm_kind dm_kind module~dm_sensor->module~dm_kind module~dm_node dm_node module~dm_sensor->module~dm_node iso_fortran_env iso_fortran_env module~dm_kind->iso_fortran_env module~dm_node->module~dm_id module~dm_node->module~dm_kind

Used by

  • module~~dm_sensor~~UsedByGraph module~dm_sensor dm_sensor module~dm_image dm_image module~dm_image->module~dm_sensor module~dm_log dm_log module~dm_log->module~dm_sensor module~dm_observ dm_observ module~dm_log->module~dm_observ module~dm_observ->module~dm_sensor module~dm_report dm_report module~dm_report->module~dm_sensor module~dm_report->module~dm_log module~dmpack dmpack module~dmpack->module~dm_sensor module~dmpack->module~dm_image module~dmpack->module~dm_log module~dmpack->module~dm_observ module~dmpack->module~dm_report module~dm_atom dm_atom module~dmpack->module~dm_atom module~dm_job dm_job module~dmpack->module~dm_job module~dm_logger dm_logger module~dmpack->module~dm_logger module~dm_mqueue dm_mqueue module~dmpack->module~dm_mqueue module~dm_sync dm_sync module~dmpack->module~dm_sync module~dm_mqueue_util dm_mqueue_util module~dmpack->module~dm_mqueue_util proc~dm_db_insert_sensor dm_db_insert_sensor proc~dm_db_insert_sensor->module~dm_sensor proc~dm_db_select_sensor dm_db_select_sensor proc~dm_db_select_sensor->module~dm_sensor proc~dm_db_update_sensor dm_db_update_sensor proc~dm_db_update_sensor->module~dm_sensor proc~dm_html_sensor dm_html_sensor proc~dm_html_sensor->module~dm_sensor proc~dm_html_sensors dm_html_sensors proc~dm_html_sensors->module~dm_sensor proc~dm_test_dummy_sensor dm_test_dummy_sensor proc~dm_test_dummy_sensor->module~dm_sensor proc~dm_z_compress_type dm_z_compress_type proc~dm_z_compress_type->module~dm_sensor proc~dm_z_compress_type->module~dm_log proc~dm_z_compress_type->module~dm_observ module~dm_atom->module~dm_log module~dm_job->module~dm_observ module~dm_logger->module~dm_log module~dm_logger->module~dm_observ module~dm_mqueue->module~dm_log module~dm_mqueue->module~dm_observ module~dm_sync->module~dm_observ proc~dm_arg_validate dm_arg_validate proc~dm_arg_validate->module~dm_log proc~dm_csv_header_observ dm_csv_header_observ proc~dm_csv_header_observ->module~dm_observ proc~dm_db_insert_log dm_db_insert_log proc~dm_db_insert_log->module~dm_log proc~dm_db_insert_observ dm_db_insert_observ proc~dm_db_insert_observ->module~dm_observ proc~dm_db_insert_observs dm_db_insert_observs proc~dm_db_insert_observs->module~dm_observ proc~dm_db_select_log dm_db_select_log proc~dm_db_select_log->module~dm_log proc~dm_db_select_logs_by_observ dm_db_select_logs_by_observ proc~dm_db_select_logs_by_observ->module~dm_log proc~dm_db_select_observ dm_db_select_observ proc~dm_db_select_observ->module~dm_observ proc~dm_db_select_observ_ids dm_db_select_observ_ids proc~dm_db_select_observ_ids->module~dm_observ proc~dm_db_select_observ_views dm_db_select_observ_views proc~dm_db_select_observ_views->module~dm_observ proc~dm_db_select_observs_by_id dm_db_select_observs_by_id proc~dm_db_select_observs_by_id->module~dm_observ proc~dm_db_select_observs_by_time dm_db_select_observs_by_time proc~dm_db_select_observs_by_time->module~dm_observ proc~dm_html_log dm_html_log proc~dm_html_log->module~dm_log proc~dm_html_logs dm_html_logs proc~dm_html_logs->module~dm_log proc~dm_html_observ dm_html_observ proc~dm_html_observ->module~dm_observ proc~dm_html_observs dm_html_observs proc~dm_html_observs->module~dm_observ proc~dm_lua_api_register dm_lua_api_register proc~dm_lua_api_register->module~dm_log proc~dm_test_dummy_log dm_test_dummy_log proc~dm_test_dummy_log->module~dm_log proc~dm_test_dummy_observ dm_test_dummy_observ proc~dm_test_dummy_observ->module~dm_observ module~dm_mqueue_util->module~dm_mqueue proc~dm_db_insert_sync dm_db_insert_sync proc~dm_db_insert_sync->module~dm_sync proc~dm_db_insert_sync_log dm_db_insert_sync_log proc~dm_db_insert_sync_log->module~dm_sync proc~dm_db_insert_sync_node dm_db_insert_sync_node proc~dm_db_insert_sync_node->module~dm_sync proc~dm_db_insert_sync_observ dm_db_insert_sync_observ proc~dm_db_insert_sync_observ->module~dm_sync proc~dm_db_insert_sync_sensor dm_db_insert_sync_sensor proc~dm_db_insert_sync_sensor->module~dm_sync proc~dm_db_insert_sync_target dm_db_insert_sync_target proc~dm_db_insert_sync_target->module~dm_sync proc~dm_db_select_sync_log dm_db_select_sync_log proc~dm_db_select_sync_log->module~dm_sync proc~dm_db_select_sync_logs dm_db_select_sync_logs proc~dm_db_select_sync_logs->module~dm_sync proc~dm_db_select_sync_node dm_db_select_sync_node proc~dm_db_select_sync_node->module~dm_sync proc~dm_db_select_sync_nodes dm_db_select_sync_nodes proc~dm_db_select_sync_nodes->module~dm_sync proc~dm_db_select_sync_observ dm_db_select_sync_observ proc~dm_db_select_sync_observ->module~dm_sync proc~dm_db_select_sync_observs dm_db_select_sync_observs proc~dm_db_select_sync_observs->module~dm_sync proc~dm_db_select_sync_sensor dm_db_select_sync_sensor proc~dm_db_select_sync_sensor->module~dm_sync proc~dm_db_select_sync_sensors dm_db_select_sync_sensors proc~dm_db_select_sync_sensors->module~dm_sync proc~dm_db_select_sync_target dm_db_select_sync_target proc~dm_db_select_sync_target->module~dm_sync proc~dm_db_select_sync_targets dm_db_select_sync_targets proc~dm_db_select_sync_targets->module~dm_sync

Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: SENSOR_ID_LEN = ID_LEN

Max. sensor id length.

integer, public, parameter :: SENSOR_NAME_LEN = 32

Max. sensor name length.

integer, public, parameter :: SENSOR_SN_LEN = 32

Max. sensor serial number length.

integer, public, parameter :: SENSOR_META_LEN = 32

Max. sensor meta description length.

integer, public, parameter :: SENSOR_TYPE_NONE = 0

Unknown sensor type.

integer, public, parameter :: SENSOR_TYPE_VIRTUAL = 1

Virtual sensor.

integer, public, parameter :: SENSOR_TYPE_SYSTEM = 2

Operating system.

integer, public, parameter :: SENSOR_TYPE_FS = 3

File system.

integer, public, parameter :: SENSOR_TYPE_PROCESS = 4

Process or service.

integer, public, parameter :: SENSOR_TYPE_NETWORK = 5

Network-based sensor (Ethernet, HTTP).

integer, public, parameter :: SENSOR_TYPE_MULTI = 6

Multi-sensor system.

integer, public, parameter :: SENSOR_TYPE_METEO = 7

Meteorological sensor.

integer, public, parameter :: SENSOR_TYPE_RTS = 8

Robotic total station.

integer, public, parameter :: SENSOR_TYPE_GNSS = 9

GNSS sensor.

integer, public, parameter :: SENSOR_TYPE_LEVEL = 10

Level sensor.

integer, public, parameter :: SENSOR_TYPE_MEMS = 11

MEMS sensor.

integer, public, parameter :: SENSOR_TYPE_CAMERA = 12

IP camera or webcam.

integer, public, parameter :: SENSOR_TYPE_LAST = 12

Never use this.

integer, public, parameter :: SENSOR_TYPE_NAME_LEN = 7

Max. length of sensor type name.

character(len=*), public, parameter :: SENSOR_TYPE_NAMES(SENSOR_TYPE_NONE:SENSOR_TYPE_LAST) = [character(len=SENSOR_TYPE_NAME_LEN)::'none', 'virtual', 'system', 'fs', 'process', 'network', 'multi', 'meteo', 'rts', 'gnss', 'level', 'mems', 'camera']

Array of sensor type names.

integer, public, parameter :: SENSOR_SIZE = storage_size(sensor_type())/8

Size of sensor_type in bytes.


Interfaces

public interface operator (==)

Returns whether sensors are equal.

  • public pure elemental function dm_sensor_equals(sensor1, sensor2) result(equals)

    Returns .true. if given sensors are equal.

    Arguments

    Type IntentOptional Attributes Name
    type(sensor_type), intent(in) :: sensor1

    First sensor.

    type(sensor_type), intent(in) :: sensor2

    Second sensor.

    Return Value logical


Derived Types

type, public ::  sensor_type

Sensor description.

Components

Type Visibility Attributes Name Initial
character(len=SENSOR_ID_LEN), public :: id = ' '

Sensor id (-0-9A-Z_a-z).

character(len=NODE_ID_LEN), public :: node_id = ' '

Associated sensor node.

integer, public :: type = SENSOR_TYPE_NONE

Sensor type.

character(len=SENSOR_NAME_LEN), public :: name = ' '

Sensor name.

character(len=SENSOR_SN_LEN), public :: sn = ' '

Serial number (optional).

character(len=SENSOR_META_LEN), public :: meta = ' '

Meta information (optional).

real(kind=r8), public :: x = 0.0_r8

Sensor x or easting (optional).

real(kind=r8), public :: y = 0.0_r8

Sensor y or northing (optional).

real(kind=r8), public :: z = 0.0_r8

Sensor z or alt (optional).

real(kind=r8), public :: lon = 0.0_r8

Longitude in degrees (optional).

real(kind=r8), public :: lat = 0.0_r8

Latitude in degrees (optional).

real(kind=r8), public :: alt = 0.0_r8

Altitude or elevation in metres (optional).


Functions

public pure elemental function dm_sensor_equals(sensor1, sensor2) result(equals)

Returns .true. if given sensors are equal.

Arguments

Type IntentOptional Attributes Name
type(sensor_type), intent(in) :: sensor1

First sensor.

type(sensor_type), intent(in) :: sensor2

Second sensor.

Return Value logical

public pure elemental function dm_sensor_is_valid(sensor) result(valid)

Returns .true. if the attributes of the given sensor type are valid.

Arguments

Type IntentOptional Attributes Name
type(sensor_type), intent(in) :: sensor

Sensor type.

Return Value logical

public pure elemental function dm_sensor_type_from_name(name) result(type)

Returns type enumerator from given name.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name

Sensor type name.

Return Value integer

public pure elemental function dm_sensor_type_is_valid(type) result(valid)

Returns .true. if type is valid sensor type. The type SENSOR_TYPE_NONE is a valid type.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: type

Sensor type.

Return Value logical

public pure function dm_sensor_type_to_name(type) result(name)

Returns name of given type enumerator as allocatable string.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: type

Sensor type enumerator (SENSOR_TYPE_*).

Return Value character(len=:), allocatable

Sensor type name.


Subroutines

public subroutine dm_sensor_out(sensor, unit)

Prints sensor to standard output or given file unit.

Arguments

Type IntentOptional Attributes Name
type(sensor_type), intent(inout) :: sensor

Sensor type.

integer, intent(in), optional :: unit

File unit.