From b0be94f97c797051175e1617fc2f3fdc7053b240 Mon Sep 17 00:00:00 2001 From: Philipp Date: Tue, 15 Oct 2024 23:58:45 +0200 Subject: [PATCH] Reformatted. --- src/dm_arg.f90 | 33 +- src/dm_ascii.f90 | 30 +- src/dm_error.f90 | 273 +++++--------- src/dm_format.f90 | 21 +- src/dm_geocom.f90 | 21 +- src/dm_geocom_error.f90 | 778 +++++++++++++--------------------------- src/dm_log.f90 | 29 +- src/dm_plot.f90 | 54 +-- src/dm_sensor.f90 | 39 +- src/dm_sync.f90 | 18 +- src/dm_tty.f90 | 111 ++---- src/dm_type.f90 | 35 +- src/dm_z.f90 | 56 ++- 13 files changed, 495 insertions(+), 1003 deletions(-) diff --git a/src/dm_arg.f90 b/src/dm_arg.f90 index df2b438..30f86eb 100644 --- a/src/dm_arg.f90 +++ b/src/dm_arg.f90 @@ -466,28 +466,17 @@ subroutine dm_arg_help(args) args(i)%short, trim(args(i)%name) select case (args(i)%type) - case (ARG_TYPE_INTEGER) - write (stdout, '("")') - case (ARG_TYPE_REAL) - write (stdout, '("")') - case (ARG_TYPE_CHAR) - write (stdout, '("")') - case (ARG_TYPE_STRING) - write (stdout, '("")') - case (ARG_TYPE_ID) - write (stdout, '("")') - case (ARG_TYPE_UUID) - write (stdout, '("")') - case (ARG_TYPE_TIME) - write (stdout, '("")') - case (ARG_TYPE_LEVEL) - write (stdout, '("")') - case (ARG_TYPE_FILE) - write (stdout, '("")') - case (ARG_TYPE_DATABASE) - write (stdout, '("")') - case default - write (stdout, *) + case (ARG_TYPE_INTEGER); write (stdout, '("")') + case (ARG_TYPE_REAL); write (stdout, '("")') + case (ARG_TYPE_CHAR); write (stdout, '("")') + case (ARG_TYPE_STRING); write (stdout, '("")') + case (ARG_TYPE_ID); write (stdout, '("")') + case (ARG_TYPE_UUID); write (stdout, '("")') + case (ARG_TYPE_TIME); write (stdout, '("")') + case (ARG_TYPE_LEVEL); write (stdout, '("")') + case (ARG_TYPE_FILE); write (stdout, '("")') + case (ARG_TYPE_DATABASE); write (stdout, '("")') + case default; write (stdout, *) end select end do diff --git a/src/dm_ascii.f90 b/src/dm_ascii.f90 index da30ede..bd7dd74 100644 --- a/src/dm_ascii.f90 +++ b/src/dm_ascii.f90 @@ -212,26 +212,16 @@ pure function dm_ascii_unescape(str) result(res) esc = .false. select case (str(i:i)) - case ('a') - res = res // ASCII_BEL - case ('b') - res = res // ASCII_BS - case ('t') - res = res // ASCII_TAB - case ('n') - res = res // ASCII_LF - case ('v') - res = res // ASCII_VT - case ('f') - res = res // ASCII_FF - case ('r') - res = res // ASCII_CR - case ('e') - res = res // ASCII_ESC - case ('x') - npc = .true. - case (achar(92)) ! \ - res = res // str(i:i) + case ('a'); res = res // ASCII_BEL + case ('b'); res = res // ASCII_BS + case ('t'); res = res // ASCII_TAB + case ('n'); res = res // ASCII_LF + case ('v'); res = res // ASCII_VT + case ('f'); res = res // ASCII_FF + case ('r'); res = res // ASCII_CR + case ('e'); res = res // ASCII_ESC + case ('x'); npc = .true. + case (achar(92)); res = res // str(i:i) end select else if (npc) then ! Escaped non-printable characters, from `\x00` to `\xFF`. diff --git a/src/dm_error.f90 b/src/dm_error.f90 index 628e018..b07f48e 100644 --- a/src/dm_error.f90 +++ b/src/dm_error.f90 @@ -153,201 +153,104 @@ pure function dm_error_message(error) result(message) select case (error) ! General errors. - case (E_NONE) - message = 'none' - case (E_ERROR) - message = 'error' - case (E_DUMMY) - message = 'dummy error' - case (E_INVALID) - message = 'invalid' - case (E_INCOMPLETE) - message = 'incomplete' - case (E_TYPE) - message = 'type error' - case (E_IO) - message = 'I/O error' - case (E_READ) - message = 'read error' - case (E_WRITE) - message = 'write error' - case (E_EOF) - message = 'end of file' - case (E_EOR) - message = 'end of record' - case (E_ALLOC) - message = 'memory allocation error' - case (E_BOUNDS) - message = 'out of bounds' - case (E_EXIST) - message = 'resource exists' - case (E_NOT_FOUND) - message = 'resource not found' - case (E_SYSTEM) - message = 'system call failed' - case (E_MEMORY) - message = 'no memory' - case (E_FULL) - message = 'disk full' - case (E_EMPTY) - message = 'no data' - case (E_NULL) - message = 'null pointer' - case (E_LIMIT) - message = 'limit reached' - case (E_TIMEOUT) - message = 'timeout' - case (E_FORMAT) - message = 'format error' - case (E_PERM) - message = 'no permission' - case (E_READ_ONLY) - message = 'read only' - case (E_CORRUPT) - message = 'data corrupted' - case (E_CONFIG) - message = 'configuration error' - case (E_GEOCOM) - message = 'GeoCOM error' - + case (E_NONE); message = 'none' + case (E_ERROR); message = 'error' + case (E_DUMMY); message = 'dummy error' + case (E_INVALID); message = 'invalid' + case (E_INCOMPLETE); message = 'incomplete' + case (E_TYPE); message = 'type error' + case (E_IO); message = 'I/O error' + case (E_READ); message = 'read error' + case (E_WRITE); message = 'write error' + case (E_EOF); message = 'end of file' + case (E_EOR); message = 'end of record' + case (E_ALLOC); message = 'memory allocation error' + case (E_BOUNDS); message = 'out of bounds' + case (E_EXIST); message = 'resource exists' + case (E_NOT_FOUND); message = 'resource not found' + case (E_SYSTEM); message = 'system call failed' + case (E_MEMORY); message = 'no memory' + case (E_FULL); message = 'disk full' + case (E_EMPTY); message = 'no data' + case (E_NULL); message = 'null pointer' + case (E_LIMIT); message = 'limit reached' + case (E_TIMEOUT); message = 'timeout' + case (E_FORMAT); message = 'format error' + case (E_PERM); message = 'no permission' + case (E_READ_ONLY); message = 'read only' + case (E_CORRUPT); message = 'data corrupted' + case (E_CONFIG); message = 'configuration error' + case (E_GEOCOM); message = 'GeoCOM error' ! Database. - case (E_DB) - message = 'database error' - case (E_DB_ID) - message = 'database application id invalid' - case (E_DB_BUSY) - message = 'database busy' - case (E_DB_LOCKED) - message = 'database locked' - case (E_DB_EXEC) - message = 'database execution failed' - case (E_DB_CONSTRAINT) - message = 'database contraint error' - case (E_DB_TRANSACTION) - message = 'database transaction failed' - case (E_DB_ROLLBACK) - message = 'database rollback failed' - case (E_DB_PREPARE) - message = 'database statement preparation failed' - case (E_DB_FINALIZE) - message = 'database statement finalization failed' - case (E_DB_BIND) - message = 'database bind failed' - case (E_DB_TYPE) - message = 'database type mismatch' - case (E_DB_STEP) - message = 'database execution step failed' - case (E_DB_NO_ROWS) - message = 'database returned no rows' - case (E_DB_BACKUP) - message = 'database backup error' - case (E_DB_ATTACH) - message = 'database attach failed' - case (E_DB_DETACH) - message = 'database detach failed' - case (E_DB_VERSION) - message = 'database version incompatible' - + case (E_DB); message = 'database error' + case (E_DB_ID); message = 'database application id invalid' + case (E_DB_BUSY); message = 'database busy' + case (E_DB_LOCKED); message = 'database locked' + case (E_DB_EXEC); message = 'database execution failed' + case (E_DB_CONSTRAINT); message = 'database contraint error' + case (E_DB_TRANSACTION); message = 'database transaction failed' + case (E_DB_ROLLBACK); message = 'database rollback failed' + case (E_DB_PREPARE); message = 'database statement preparation failed' + case (E_DB_FINALIZE); message = 'database statement finalization failed' + case (E_DB_BIND); message = 'database bind failed' + case (E_DB_TYPE); message = 'database type mismatch' + case (E_DB_STEP); message = 'database execution step failed' + case (E_DB_NO_ROWS); message = 'database returned no rows' + case (E_DB_BACKUP); message = 'database backup error' + case (E_DB_ATTACH); message = 'database attach failed' + case (E_DB_DETACH); message = 'database detach failed' + case (E_DB_VERSION); message = 'database version incompatible' ! Options. - case (E_ARG) - message = 'argument error' - case (E_ARG_NOT_FOUND) - message = 'argument not found' - case (E_ARG_INVALID) - message = 'argument invalid or missing' - case (E_ARG_NO_VALUE) - message = 'argument value missing' - case (E_ARG_TYPE) - message = 'argument type invalid' - case (E_ARG_LENGTH) - message = 'argument length invalid' - case (E_ARG_UNKNOWN) - message = 'argument is unknown' - + case (E_ARG); message = 'argument error' + case (E_ARG_NOT_FOUND); message = 'argument not found' + case (E_ARG_INVALID); message = 'argument invalid or missing' + case (E_ARG_NO_VALUE); message = 'argument value missing' + case (E_ARG_TYPE); message = 'argument type invalid' + case (E_ARG_LENGTH); message = 'argument length invalid' + case (E_ARG_UNKNOWN); message = 'argument is unknown' ! POSIX message queue. - case (E_MQUEUE) - message = 'message queue operation failed' - case (E_MQUEUE_EMPTY) - message = 'message empty' - + case (E_MQUEUE); message = 'message queue operation failed' + case (E_MQUEUE_EMPTY); message = 'message empty' ! Regular expressions. - case (E_REGEX) - message = 'regular expression failed' - case (E_REGEX_COMPILE) - message = 'regular expression failed to compile' - case (E_REGEX_EXCEEDED) - message = 'regular expression pattern exceeds maximum matches' - case (E_REGEX_NO_MATCH) - message = 'regular expression pattern does not match' - case (E_REGEX_NO_GROUP) - message = 'regular expression group not found' - + case (E_REGEX); message = 'regular expression failed' + case (E_REGEX_COMPILE); message = 'regular expression failed to compile' + case (E_REGEX_EXCEEDED); message = 'regular expression pattern exceeds maximum matches' + case (E_REGEX_NO_MATCH); message = 'regular expression pattern does not match' + case (E_REGEX_NO_GROUP); message = 'regular expression group not found' ! Sensor. - case (E_SENSOR) - message = 'sensor error' - + case (E_SENSOR); message = 'sensor error' ! RPC. - case (E_RPC) - message = 'RPC error' - case (E_RPC_CONNECT) - message = 'RPC connection error' - case (E_RPC_SSL) - message = 'RPC SSL error' - case (E_RPC_API) - message = 'RPC API error' - case (E_RPC_AUTH) - message = 'RPC authorization error' - case (E_RPC_CONFLICT) - message = 'RPC conflict' - case (E_RPC_SERVER) - message = 'RPC server error' - + case (E_RPC); message = 'RPC error' + case (E_RPC_CONNECT); message = 'RPC connection error' + case (E_RPC_SSL); message = 'RPC SSL error' + case (E_RPC_API); message = 'RPC API error' + case (E_RPC_AUTH); message = 'RPC authorization error' + case (E_RPC_CONFLICT); message = 'RPC conflict' + case (E_RPC_SERVER); message = 'RPC server error' ! Mail. - case (E_MAIL) - message = 'mail error' - case (E_MAIL_CONNECT) - message = 'mail connection error' - case (E_MAIL_SSL) - message = 'mail SSL error' - case (E_MAIL_AUTH) - message = 'mail authorization error' - + case (E_MAIL); message = 'mail error' + case (E_MAIL_CONNECT); message = 'mail connection error' + case (E_MAIL_SSL); message = 'mail SSL error' + case (E_MAIL_AUTH); message = 'mail authorization error' ! MQTT. - case (E_MQTT) - message = 'MQTT error' - + case (E_MQTT); message = 'MQTT error' ! Lua. - case (E_LUA) - message = 'Lua error' - case (E_LUA_YIELD) - message = 'Lua thread yields' - case (E_LUA_RUNTIME) - message = 'Lua runtime error' - case (E_LUA_SYNTAX) - message = 'Lua syntax error' - case (E_LUA_MEM) - message = 'Lua memory error' - case (E_LUA_ERROR) - message = 'Lua message handling error' - case (E_LUA_FILE) - message = 'Lua file I/O error' - + case (E_LUA); message = 'Lua error' + case (E_LUA_YIELD); message = 'Lua thread yields' + case (E_LUA_RUNTIME); message = 'Lua runtime error' + case (E_LUA_SYNTAX); message = 'Lua syntax error' + case (E_LUA_MEM); message = 'Lua memory error' + case (E_LUA_ERROR); message = 'Lua message handling error' + case (E_LUA_FILE); message = 'Lua file I/O error' ! Libraries. - case (E_LIB) - message = 'library error' - case (E_MODBUS) - message = 'Modbus error' - case (E_HDF5) - message = 'HDF5 error' - case (E_ZLIB) - message = 'zlib error' - case (E_ZSTD) - message = 'zstd error' - case (E_XMPP) - message = 'XMPP error' - - case default - message = 'unknown error' + case (E_LIB); message = 'library error' + case (E_MODBUS); message = 'Modbus error' + case (E_HDF5); message = 'HDF5 error' + case (E_ZLIB); message = 'zlib error' + case (E_ZSTD); message = 'zstd error' + case (E_XMPP); message = 'XMPP error' + ! Default. + case default; message = 'unknown error' end select end function dm_error_message diff --git a/src/dm_format.f90 b/src/dm_format.f90 index 5ada1a4..5b807e8 100644 --- a/src/dm_format.f90 +++ b/src/dm_format.f90 @@ -36,20 +36,13 @@ pure elemental integer function dm_format_from_name(name) result(format) name_ = dm_to_lower(name) select case (name_) - case (FORMAT_NAMES(FORMAT_BLOCK)) - format = FORMAT_BLOCK - case (FORMAT_NAMES(FORMAT_CSV)) - format = FORMAT_CSV - case (FORMAT_NAMES(FORMAT_GEOJSON)) - format = FORMAT_GEOJSON - case (FORMAT_NAMES(FORMAT_JSON)) - format = FORMAT_JSON - case (FORMAT_NAMES(FORMAT_JSONL)) - format = FORMAT_JSONL - case (FORMAT_NAMES(FORMAT_NML)) - format = FORMAT_NML - case default - format = FORMAT_NONE + case (FORMAT_NAMES(FORMAT_BLOCK)); format = FORMAT_BLOCK + case (FORMAT_NAMES(FORMAT_CSV)); format = FORMAT_CSV + case (FORMAT_NAMES(FORMAT_GEOJSON)); format = FORMAT_GEOJSON + case (FORMAT_NAMES(FORMAT_JSON)); format = FORMAT_JSON + case (FORMAT_NAMES(FORMAT_JSONL)); format = FORMAT_JSONL + case (FORMAT_NAMES(FORMAT_NML)); format = FORMAT_NML + case default; format = FORMAT_NONE end select end function dm_format_from_name diff --git a/src/dm_geocom.f90 b/src/dm_geocom.f90 index 6d62070..418c78f 100644 --- a/src/dm_geocom.f90 +++ b/src/dm_geocom.f90 @@ -809,20 +809,13 @@ subroutine geocom_open(this, path, baud_rate, retries, verbose, error) ! Convert GeoCOM baud rate parameter to TTY baud rate parameter. rc = E_INVALID select case (baud_rate) - case (GEOCOM_COM_BAUD_2400) - baud_rate_ = TTY_B2400 - case (GEOCOM_COM_BAUD_4800) - baud_rate_ = TTY_B4800 - case (GEOCOM_COM_BAUD_9600) - baud_rate_ = TTY_B9600 - case (GEOCOM_COM_BAUD_19200) - baud_rate_ = TTY_B19200 - case (GEOCOM_COM_BAUD_38400) - baud_rate_ = TTY_B38400 - case (GEOCOM_COM_BAUD_57600) - baud_rate_ = TTY_B57600 - case (GEOCOM_COM_BAUD_115200) - baud_rate_ = TTY_B115200 + case (GEOCOM_COM_BAUD_2400); baud_rate_ = TTY_B2400 + case (GEOCOM_COM_BAUD_4800); baud_rate_ = TTY_B4800 + case (GEOCOM_COM_BAUD_9600); baud_rate_ = TTY_B9600 + case (GEOCOM_COM_BAUD_19200); baud_rate_ = TTY_B19200 + case (GEOCOM_COM_BAUD_38400); baud_rate_ = TTY_B38400 + case (GEOCOM_COM_BAUD_57600); baud_rate_ = TTY_B57600 + case (GEOCOM_COM_BAUD_115200); baud_rate_ = TTY_B115200 case default call this%output(rc, 'invalid baud rate') exit tty_block diff --git a/src/dm_geocom_error.f90 b/src/dm_geocom_error.f90 index b6899a0..32ea42a 100644 --- a/src/dm_geocom_error.f90 +++ b/src/dm_geocom_error.f90 @@ -303,539 +303,273 @@ pure function dm_geocom_error_message(grc) result(message) select case (grc) ! TPS - case (GRC_OK) - message = 'function successfully completed' - case (GRC_UNDEFINED) - message = 'unknown error, result unspecified' - case (GRC_IVPARAM) - message = 'invalid parameter detected, result unspecified' - case (GRC_IVRESULT) - message = 'invalid result' - case (GRC_FATAL) - message = 'fatal error' - case (GRC_NOT_IMPL) - message = 'not implemented' - case (GRC_TIME_OUT) - message = 'function execution timed out, result unspecified' - case (GRC_SET_INCOMPL) - message = 'parameter setup for subsystem is incomplete' - case (GRC_ABORT) - message = 'function execution has been aborted' - case (GRC_NOMEMORY) - message = 'fatal error (not enough memory)' - case (GRC_NOTINIT) - message = 'fatal error (subsystem not initialised)' - case (GRC_SHUT_DOWN) - message = 'subsystem is down' - case (GRC_SYSBUSY) - message = 'system busy/already in use of another process' - case (GRC_HWFAILURE) - message = 'fatal error (hardware failure)' - case (GRC_ABORT_APPL) - message = 'execution of application has been aborted' - case (GRC_LOW_POWER) - message = 'operation aborted (insufficient power supply level)' - case (GRC_IVVERSION) - message = 'invalid version of file' - case (GRC_BAT_EMPTY) - message = 'battery empty, about 1 min remaining' - case (GRC_NO_EVENT) - message = 'no event pending' - case (GRC_OUT_OF_TEMP) - message = 'out of temperature range' - case (GRC_INSTRUMENT_TILT) - message = 'instrument tilting out of range' - case (GRC_COM_SETTING) - message = 'communication error' - case (GRC_NO_ACTION) - message = 'GRC_TYPE input (do no action)' - case (GRC_SLEEP_MODE) - message = 'instrument went into sleep mode' - case (GRC_NOTOK) - message = 'function not successfully completed' - case (GRC_NA) - message = 'not available' - case (GRC_OVERFLOW) - message = 'overflow error' - case (GRC_STOPPED) - message = 'system or subsystem has been stopped' - + case (GRC_OK); message = 'function successfully completed' + case (GRC_UNDEFINED); message = 'unknown error, result unspecified' + case (GRC_IVPARAM); message = 'invalid parameter detected, result unspecified' + case (GRC_IVRESULT); message = 'invalid result' + case (GRC_FATAL); message = 'fatal error' + case (GRC_NOT_IMPL); message = 'not implemented' + case (GRC_TIME_OUT); message = 'function execution timed out, result unspecified' + case (GRC_SET_INCOMPL); message = 'parameter setup for subsystem is incomplete' + case (GRC_ABORT); message = 'function execution has been aborted' + case (GRC_NOMEMORY); message = 'fatal error (not enough memory)' + case (GRC_NOTINIT); message = 'fatal error (subsystem not initialised)' + case (GRC_SHUT_DOWN); message = 'subsystem is down' + case (GRC_SYSBUSY); message = 'system busy/already in use of another process' + case (GRC_HWFAILURE); message = 'fatal error (hardware failure)' + case (GRC_ABORT_APPL); message = 'execution of application has been aborted' + case (GRC_LOW_POWER); message = 'operation aborted (insufficient power supply level)' + case (GRC_IVVERSION); message = 'invalid version of file' + case (GRC_BAT_EMPTY); message = 'battery empty, about 1 min remaining' + case (GRC_NO_EVENT); message = 'no event pending' + case (GRC_OUT_OF_TEMP); message = 'out of temperature range' + case (GRC_INSTRUMENT_TILT); message = 'instrument tilting out of range' + case (GRC_COM_SETTING); message = 'communication error' + case (GRC_NO_ACTION); message = 'GRC_TYPE input (do no action)' + case (GRC_SLEEP_MODE); message = 'instrument went into sleep mode' + case (GRC_NOTOK); message = 'function not successfully completed' + case (GRC_NA); message = 'not available' + case (GRC_OVERFLOW); message = 'overflow error' + case (GRC_STOPPED); message = 'system or subsystem has been stopped' ! ANG - case (GRC_ANG) - message = 'ANG error' - case (GRC_ANG_ERROR) - message = 'angles and inclinations not valid' - case (GRC_ANG_INCL_ERROR) - message = 'inclinations not valid' - case (GRC_ANG_BAD_ACC) - message = 'value accuracies not reached' - case (GRC_ANG_BAD_ANGLE_ACC) - message = 'angle accuracies not reached' - case (GRC_ANG_BAD_INCLIN_ACC) - message = 'inclination accuracies not reached' - case (GRC_ANG_WRITE_PROTECTED) - message = 'no write access allowed' - case (GRC_ANG_OUT_OF_RANGE) - message = 'value out of range' - case (GRC_ANG_IR_OCCURED) - message = 'function aborted due to interrupt' - case (GRC_ANG_HZ_MOVED) - message = 'Hz moved during incline measurement' - case (GRC_ANG_OS_ERROR) - message = 'troubles with operation system' - case (GRC_ANG_DATA_ERROR) - message = 'overflow at parameter values' - case (GRC_ANG_PEAK_CNT_UFL) - message = 'not enough peaks' - case (GRC_ANG_TIME_OUT) - message = 'reading timeout' - case (GRC_ANG_TOO_MANY_EXPOS) - message = 'too many exposures wanted' - case (GRC_ANG_PIX_CTRL_ERR) - message = 'picture height out of range' - case (GRC_ANG_MAX_POS_SKIP) - message = 'positive exposure dynamic overflow' - case (GRC_ANG_MAX_NEG_SKIP) - message = 'negative exposure dynamic overflow' - case (GRC_ANG_EXP_LIMIT) - message = 'exposure time overflow' - case (GRC_ANG_UNDER_EXPOSURE) - message = 'picture under-exposured' - case (GRC_ANG_OVER_EXPOSURE) - message = 'picture over-exposured' - case (GRC_ANG_TMANY_PEAKS) - message = 'too many peaks detected' - case (GRC_ANG_TLESS_PEAKS) - message = 'not enough peaks detected' - case (GRC_ANG_PEAK_TOO_SLIM) - message = 'peak too slim' - case (GRC_ANG_PEAK_TOO_WIDE) - message = 'peak too wide' - case (GRC_ANG_BAD_PEAKDIFF) - message = 'bad peak difference' - case (GRC_ANG_UNDER_EXP_PICT) - message = 'peak amplitude too low' - case (GRC_ANG_PEAKS_INHOMOGEN) - message = 'inhomogeneous peak amplitudes' - case (GRC_ANG_NO_DECOD_POSS) - message = 'no peak decoding possible' - case (GRC_ANG_UNSTABLE_DECOD) - message = 'peak decoding not stable' - case (GRC_ANG_TLESS_FPEAKS) - message = 'not enough valid fine-peaks' - case (GRC_ANG_INCL_OLD_PLANE) - message = 'inclination plane out of time range' - case (GRC_ANG_INCL_NO_PLANE) - message = 'inclination plane not available' - case (GRC_ANG_FAST_ANG_ERR) - message = 'errors in 5 kHz and or 2.5 kHz angle' - case (GRC_ANG_FAST_ANG_ERR_5) - message = 'errors in 5 kHz angle' - case (GRC_ANG_FAST_ANG_ERR_25) - message = 'errors in 2.5 kHz angle' - case (GRC_ANG_TRANS_ERR) - message = 'LVDS transfer error detected' - case (GRC_ANG_TRANS_ERR_5) - message = 'LVDS transfer error detected in 5 kHz mode' - case (GRC_ANG_TRANS_ERR_25) - message = 'LVDS transfer error detected in 2.5 kHz mode' - + case (GRC_ANG); message = 'ANG error' + case (GRC_ANG_ERROR); message = 'angles and inclinations not valid' + case (GRC_ANG_INCL_ERROR); message = 'inclinations not valid' + case (GRC_ANG_BAD_ACC); message = 'value accuracies not reached' + case (GRC_ANG_BAD_ANGLE_ACC); message = 'angle accuracies not reached' + case (GRC_ANG_BAD_INCLIN_ACC); message = 'inclination accuracies not reached' + case (GRC_ANG_WRITE_PROTECTED); message = 'no write access allowed' + case (GRC_ANG_OUT_OF_RANGE); message = 'value out of range' + case (GRC_ANG_IR_OCCURED); message = 'function aborted due to interrupt' + case (GRC_ANG_HZ_MOVED); message = 'Hz moved during incline measurement' + case (GRC_ANG_OS_ERROR); message = 'troubles with operation system' + case (GRC_ANG_DATA_ERROR); message = 'overflow at parameter values' + case (GRC_ANG_PEAK_CNT_UFL); message = 'not enough peaks' + case (GRC_ANG_TIME_OUT); message = 'reading timeout' + case (GRC_ANG_TOO_MANY_EXPOS); message = 'too many exposures wanted' + case (GRC_ANG_PIX_CTRL_ERR); message = 'picture height out of range' + case (GRC_ANG_MAX_POS_SKIP); message = 'positive exposure dynamic overflow' + case (GRC_ANG_MAX_NEG_SKIP); message = 'negative exposure dynamic overflow' + case (GRC_ANG_EXP_LIMIT); message = 'exposure time overflow' + case (GRC_ANG_UNDER_EXPOSURE); message = 'picture under-exposured' + case (GRC_ANG_OVER_EXPOSURE); message = 'picture over-exposured' + case (GRC_ANG_TMANY_PEAKS); message = 'too many peaks detected' + case (GRC_ANG_TLESS_PEAKS); message = 'not enough peaks detected' + case (GRC_ANG_PEAK_TOO_SLIM); message = 'peak too slim' + case (GRC_ANG_PEAK_TOO_WIDE); message = 'peak too wide' + case (GRC_ANG_BAD_PEAKDIFF); message = 'bad peak difference' + case (GRC_ANG_UNDER_EXP_PICT); message = 'peak amplitude too low' + case (GRC_ANG_PEAKS_INHOMOGEN); message = 'inhomogeneous peak amplitudes' + case (GRC_ANG_NO_DECOD_POSS); message = 'no peak decoding possible' + case (GRC_ANG_UNSTABLE_DECOD); message = 'peak decoding not stable' + case (GRC_ANG_TLESS_FPEAKS); message = 'not enough valid fine-peaks' + case (GRC_ANG_INCL_OLD_PLANE); message = 'inclination plane out of time range' + case (GRC_ANG_INCL_NO_PLANE); message = 'inclination plane not available' + case (GRC_ANG_FAST_ANG_ERR); message = 'errors in 5 kHz and or 2.5 kHz angle' + case (GRC_ANG_FAST_ANG_ERR_5); message = 'errors in 5 kHz angle' + case (GRC_ANG_FAST_ANG_ERR_25); message = 'errors in 2.5 kHz angle' + case (GRC_ANG_TRANS_ERR); message = 'LVDS transfer error detected' + case (GRC_ANG_TRANS_ERR_5); message = 'LVDS transfer error detected in 5 kHz mode' + case (GRC_ANG_TRANS_ERR_25); message = 'LVDS transfer error detected in 2.5 kHz mode' ! ATA - case (GRC_ATA_NOT_READY) - message = 'ATR system is not ready' - case (GRC_ATA_NO_RESULT) - message = 'result is not available yet' - case (GRC_ATA_SEVERAL_TARGETS) - message = 'several targets detected' - case (GRC_ATA_BIG_SPOT) - message = 'spot is too big for analyse' - case (GRC_ATA_BACKGROUND) - message = 'background is too bright' - case (GRC_ATA_NO_TARGETS) - message = 'no targets detected' - case (GRC_ATA_NOT_ACCURAT) - message = 'accuracy worse than asked for' - case (GRC_ATA_SPOT_ON_EDGE) - message = 'spot is on the edge of the sensing area' - case (GRC_ATA_BLOOMING) - message = 'blooming or spot on edge detected' - case (GRC_ATA_NOT_BUSY) - message = 'ATR is not in a continuous mode' - case (GRC_ATA_STRANGE_LIGHT) - message = 'not the spot of the own target illuminator' - case (GRC_ATA_V24_FAIL) - message = 'communication error to sensor (ATR)' - case (GRC_ATA_DECODE_ERROR) - message = 'received Arguments cannot be decoded' - case (GRC_ATA_HZ_FAIL) - message = 'no spot detected in Hz direction' - case (GRC_ATA_V_FAIL) - message = 'no spot detected in V direction' - case (GRC_ATA_HZ_STRANGE_L) - message = 'strange light in Hz direction' - case (GRC_ATA_V_STRANGE_L) - message = 'strange light in V direction' - case (GRC_ATA_SLDR_TRANSFER_PENDING) - message = 'on multiple ATA_SLDR_OpenTransfer' - case (GRC_ATA_SLDR_TRANSFER_ILLEGAL) - message = 'no ATA_SLDR_OpenTransfer happened' - case (GRC_ATA_SLDR_DATA_ERROR) - message = 'unexpected data format received' - case (GRC_ATA_SLDR_CHK_SUM_ERROR) - message = 'checksum error in transmitted data' - case (GRC_ATA_SLDR_ADDRESS_ERROR) - message = 'address out of valid range' - case (GRC_ATA_SLDR_INV_LOADFILE) - message = 'firmware file has invalid format' - case (GRC_ATA_SLDR_UNSUPPORTED) - message = 'currently loaded firmware does not support upload' - case (GRC_ATA_PS_NOT_READY) - message = 'PowerSearch system is not ready' - case (GRC_ATA_ATR_SYSTEM_ERR) - message = 'ATR system error' - + case (GRC_ATA_NOT_READY); message = 'ATR system is not ready' + case (GRC_ATA_NO_RESULT); message = 'result is not available yet' + case (GRC_ATA_SEVERAL_TARGETS); message = 'several targets detected' + case (GRC_ATA_BIG_SPOT); message = 'spot is too big for analyse' + case (GRC_ATA_BACKGROUND); message = 'background is too bright' + case (GRC_ATA_NO_TARGETS); message = 'no targets detected' + case (GRC_ATA_NOT_ACCURAT); message = 'accuracy worse than asked for' + case (GRC_ATA_SPOT_ON_EDGE); message = 'spot is on the edge of the sensing area' + case (GRC_ATA_BLOOMING); message = 'blooming or spot on edge detected' + case (GRC_ATA_NOT_BUSY); message = 'ATR is not in a continuous mode' + case (GRC_ATA_STRANGE_LIGHT); message = 'not the spot of the own target illuminator' + case (GRC_ATA_V24_FAIL); message = 'communication error to sensor (ATR)' + case (GRC_ATA_DECODE_ERROR); message = 'received Arguments cannot be decoded' + case (GRC_ATA_HZ_FAIL); message = 'no spot detected in Hz direction' + case (GRC_ATA_V_FAIL); message = 'no spot detected in V direction' + case (GRC_ATA_HZ_STRANGE_L); message = 'strange light in Hz direction' + case (GRC_ATA_V_STRANGE_L); message = 'strange light in V direction' + case (GRC_ATA_SLDR_TRANSFER_PENDING); message = 'on multiple ATA_SLDR_OpenTransfer' + case (GRC_ATA_SLDR_TRANSFER_ILLEGAL); message = 'no ATA_SLDR_OpenTransfer happened' + case (GRC_ATA_SLDR_DATA_ERROR); message = 'unexpected data format received' + case (GRC_ATA_SLDR_CHK_SUM_ERROR); message = 'checksum error in transmitted data' + case (GRC_ATA_SLDR_ADDRESS_ERROR); message = 'address out of valid range' + case (GRC_ATA_SLDR_INV_LOADFILE); message = 'firmware file has invalid format' + case (GRC_ATA_SLDR_UNSUPPORTED); message = 'currently loaded firmware does not support upload' + case (GRC_ATA_PS_NOT_READY); message = 'PowerSearch system is not ready' + case (GRC_ATA_ATR_SYSTEM_ERR); message = 'ATR system error' ! EDM - case (GRC_EDM) - message = 'EDM error' - case (GRC_EDM_SYSTEM_ERR) - message = 'fatal EDM sensor error' - case (GRC_EDM_INVALID_COMMAND) - message = 'invalid command or unknown command' - case (GRC_EDM_BOOM_ERR) - message = 'boomerang error' - case (GRC_EDM_SIGN_LOW_ERR) - message = 'received signal too low, prism too far away, or natural barrier, bad environment' - case (GRC_EDM_DIL_ERR) - message = 'obsolete' - case (GRC_EDM_SIGN_HIGH_ERR) - message = 'received signal to strong, prism to near, strange light effect' - case (GRC_EDM_TIMEOUT) - message = 'timeout, measuring time exceeded (signal too weak, beam interrupted)' - case (GRC_EDM_FLUKT_ERR) - message = 'too much turbulences or distractions' - case (GRC_EDM_FMOT_ERR) - message = 'filter motor defective' - case (GRC_EDM_DEV_NOT_INSTALLED) - message = 'device like EGL, DL is not installed' - case (GRC_EDM_NOT_FOUND) - message = 'search result invalid' - case (GRC_EDM_ERROR_RECEIVED) - message = 'communication ok, but error reported from the EDM sensor' - case (GRC_EDM_MISSING_SRVPWD) - message = 'no service password is set' - case (GRC_EDM_INVALID_ANSWER) - message = 'communication ok, but unexpected answer received' - case (GRC_EDM_SEND_ERR) - message = 'data send error, sending buffer is full' - case (GRC_EDM_RECEIVE_ERR) - message = 'data receive error, like parity buffer overflow' - case (GRC_EDM_INTERNAL_ERR) - message = 'internal EDM subsystem error' - case (GRC_EDM_BUSY) - message = 'sensor is working already, abort current measuring first' - case (GRC_EDM_NO_MEASACTIVITY) - message = 'no measurement activity started' - case (GRC_EDM_CHKSUM_ERR) - message = 'calculated checksum, resp. received data wrong' - case (GRC_EDM_INIT_OR_STOP_ERR) - message = 'during start up or shut down phase an error occured' - case (GRC_EDM_SRL_NOT_AVAILABLE) - message = 'red laser not available on this sensor hardware' - case (GRC_EDM_MEAS_ABORTED) - message = 'measurement will be aborted for laser security' - case (GRC_EDM_SLDR_TRANSFER_PENDING) - message = 'multiple open transfer calls' - case (GRC_EDM_SLDR_TRANSFER_ILLEGAL) - message = 'no open transfer happened' - case (GRC_EDM_SLDR_DATA_ERROR) - message = 'unexpected data format received' - case (GRC_EDM_SLDR_CHK_SUM_ERROR) - message = 'checksum error in transmitted data' - case (GRC_EDM_SLDR_ADDR_ERROR) - message = 'address out of valid range' - case (GRC_EDM_SLDR_INV_LOADFILE) - message = 'firmware file has invalid format' - case (GRC_EDM_SLDR_UNSUPPORTED) - message = 'currently loaded firmware does not support upload' - case (GRC_EDM_UNKNOW_ERR) - message = 'undocumented error from the EDM sensor' - case (GRC_EDM_DISTRANGE_ERR) - message = 'out of distance range (too short or too long)' - case (GRC_EDM_SIGNTONOISE_ERR) - message = 'signal to noise ratio too small' - case (GRC_EDM_NOISEHIGH_ERR) - message = 'noise too high' - case (GRC_EDM_PWD_NOTSET) - message = 'password is not set' - case (GRC_EDM_ACTION_NO_MORE_VALID) - message = 'elapsed time between prepare and start of fast measurement for ATR too long' - case (GRC_EDM_MULTRG_ERR) - message = 'possibly more than one target (also a sensor error)' - case (GRC_EDM_MISSING_EE_CONSTS) - message = 'EEPROM constants are missing' - case (GRC_EDM_NOPRECISE) - message = 'no precise measurement possible' - case (GRC_EDM_MEAS_DIST_NOT_ALLOWED) - message = 'measured distance is too long (not allowed)' - + case (GRC_EDM); message = 'EDM error' + case (GRC_EDM_SYSTEM_ERR); message = 'fatal EDM sensor error' + case (GRC_EDM_INVALID_COMMAND); message = 'invalid command or unknown command' + case (GRC_EDM_BOOM_ERR); message = 'boomerang error' + case (GRC_EDM_SIGN_LOW_ERR); message = 'received signal too low, prism too far away, or natural barrier, bad environment' + case (GRC_EDM_DIL_ERR); message = 'obsolete' + case (GRC_EDM_SIGN_HIGH_ERR); message = 'received signal to strong, prism to near, strange light effect' + case (GRC_EDM_TIMEOUT); message = 'timeout, measuring time exceeded (signal too weak, beam interrupted)' + case (GRC_EDM_FLUKT_ERR); message = 'too much turbulences or distractions' + case (GRC_EDM_FMOT_ERR); message = 'filter motor defective' + case (GRC_EDM_DEV_NOT_INSTALLED); message = 'device like EGL, DL is not installed' + case (GRC_EDM_NOT_FOUND); message = 'search result invalid' + case (GRC_EDM_ERROR_RECEIVED); message = 'communication ok, but error reported from the EDM sensor' + case (GRC_EDM_MISSING_SRVPWD); message = 'no service password is set' + case (GRC_EDM_INVALID_ANSWER); message = 'communication ok, but unexpected answer received' + case (GRC_EDM_SEND_ERR); message = 'data send error, sending buffer is full' + case (GRC_EDM_RECEIVE_ERR); message = 'data receive error, like parity buffer overflow' + case (GRC_EDM_INTERNAL_ERR); message = 'internal EDM subsystem error' + case (GRC_EDM_BUSY); message = 'sensor is working already, abort current measuring first' + case (GRC_EDM_NO_MEASACTIVITY); message = 'no measurement activity started' + case (GRC_EDM_CHKSUM_ERR); message = 'calculated checksum, resp. received data wrong' + case (GRC_EDM_INIT_OR_STOP_ERR); message = 'during start up or shut down phase an error occured' + case (GRC_EDM_SRL_NOT_AVAILABLE); message = 'red laser not available on this sensor hardware' + case (GRC_EDM_MEAS_ABORTED); message = 'measurement will be aborted for laser security' + case (GRC_EDM_SLDR_TRANSFER_PENDING); message = 'multiple open transfer calls' + case (GRC_EDM_SLDR_TRANSFER_ILLEGAL); message = 'no open transfer happened' + case (GRC_EDM_SLDR_DATA_ERROR); message = 'unexpected data format received' + case (GRC_EDM_SLDR_CHK_SUM_ERROR); message = 'checksum error in transmitted data' + case (GRC_EDM_SLDR_ADDR_ERROR); message = 'address out of valid range' + case (GRC_EDM_SLDR_INV_LOADFILE); message = 'firmware file has invalid format' + case (GRC_EDM_SLDR_UNSUPPORTED); message = 'currently loaded firmware does not support upload' + case (GRC_EDM_UNKNOW_ERR); message = 'undocumented error from the EDM sensor' + case (GRC_EDM_DISTRANGE_ERR); message = 'out of distance range (too short or too long)' + case (GRC_EDM_SIGNTONOISE_ERR); message = 'signal to noise ratio too small' + case (GRC_EDM_NOISEHIGH_ERR); message = 'noise too high' + case (GRC_EDM_PWD_NOTSET); message = 'password is not set' + case (GRC_EDM_ACTION_NO_MORE_VALID); message = 'elapsed time between prepare and start of fast measurement for ATR too long' + case (GRC_EDM_MULTRG_ERR); message = 'possibly more than one target (also a sensor error)' + case (GRC_EDM_MISSING_EE_CONSTS); message = 'EEPROM constants are missing' + case (GRC_EDM_NOPRECISE); message = 'no precise measurement possible' + case (GRC_EDM_MEAS_DIST_NOT_ALLOWED); message = 'measured distance is too long (not allowed)' ! GMF - case (GRC_GMF) - message = 'GMF error' - case (GRC_GMF_WRONG_AREA_DEF) - message = 'wrong area definition' - case (GRC_GMF_IDENTICAL_PTS) - message = 'identical points' - case (GRC_GMF_PTS_IN_LINE) - message = 'points on one line' - case (GRC_GMF_OUT_OF_RANGE) - message = 'out of range' - case (GRC_GMF_PLAUSIBILITY_ERR) - message = 'plausibility error' - case (GRC_GMF_TOO_FEW_OBSERVATIONS) - message = 'too few observations to calculate the average' - case (GRC_GMF_NO_SOLUTION) - message = 'no solution' - case (GRC_GMF_ONE_SOLUTION) - message = 'only one solution' - case (GRC_GMF_TWO_SOLUTIONS) - message = 'second solution' - case (GRC_GMF_ANGLE_SMALLER_15GON) - message = 'intersection angle < 15 gon' - case (GRC_GMF_INVALID_TRIANGLE_TYPE) - message = 'invalid triangle' - case (GRC_GMF_INVALID_ANGLE_SYSTEM) - message = 'invalid angle unit' - case (GRC_GMF_INVALID_DIST_SYSTEM) - message = 'invalid distance unit' - case (GRC_GMF_INVALID_V_SYSTEM) - message = 'invalid vertical angle' - case (GRC_GMF_INVALID_TEMP_SYSTEM) - message = 'invalid temperature system' - case (GRC_GMF_INVALID_PRES_SYSTEM) - message = 'invalid pressure unit' - case (GRC_GMF_RADIUS_NOT_POSSIBLE) - message = 'invalid radius' - case (GRC_GMF_NO_PROVISIONAL_VALUES) - message = 'insufficient data (GM2)' - case (GRC_GMF_SINGULAR_MATRIX) - message = 'bad data (GM2)' - case (GRC_GMF_TOO_MANY_ITERATIONS) - message = 'bad data distr (GM2)' - case (GRC_GMF_IDENTICAL_TIE_POINTS) - message = 'same tie points (GM2)' - case (GRC_GMF_SETUP_EQUALS_TIE_POINT) - message = 'station and tie point same (GM2)' - + case (GRC_GMF); message = 'GMF error' + case (GRC_GMF_WRONG_AREA_DEF); message = 'wrong area definition' + case (GRC_GMF_IDENTICAL_PTS); message = 'identical points' + case (GRC_GMF_PTS_IN_LINE); message = 'points on one line' + case (GRC_GMF_OUT_OF_RANGE); message = 'out of range' + case (GRC_GMF_PLAUSIBILITY_ERR); message = 'plausibility error' + case (GRC_GMF_TOO_FEW_OBSERVATIONS); message = 'too few observations to calculate the average' + case (GRC_GMF_NO_SOLUTION); message = 'no solution' + case (GRC_GMF_ONE_SOLUTION); message = 'only one solution' + case (GRC_GMF_TWO_SOLUTIONS); message = 'second solution' + case (GRC_GMF_ANGLE_SMALLER_15GON); message = 'intersection angle < 15 gon' + case (GRC_GMF_INVALID_TRIANGLE_TYPE); message = 'invalid triangle' + case (GRC_GMF_INVALID_ANGLE_SYSTEM); message = 'invalid angle unit' + case (GRC_GMF_INVALID_DIST_SYSTEM); message = 'invalid distance unit' + case (GRC_GMF_INVALID_V_SYSTEM); message = 'invalid vertical angle' + case (GRC_GMF_INVALID_TEMP_SYSTEM); message = 'invalid temperature system' + case (GRC_GMF_INVALID_PRES_SYSTEM); message = 'invalid pressure unit' + case (GRC_GMF_RADIUS_NOT_POSSIBLE); message = 'invalid radius' + case (GRC_GMF_NO_PROVISIONAL_VALUES); message = 'insufficient data (GM2)' + case (GRC_GMF_SINGULAR_MATRIX); message = 'bad data (GM2)' + case (GRC_GMF_TOO_MANY_ITERATIONS); message = 'bad data distr (GM2)' + case (GRC_GMF_IDENTICAL_TIE_POINTS); message = 'same tie points (GM2)' + case (GRC_GMF_SETUP_EQUALS_TIE_POINT); message = 'station and tie point same (GM2)' ! TMC - case (GRC_TMC) - message = 'TMC error' - case (GRC_TMC_NO_FULL_CORRECTION) - message = 'measurement without full correction' - case (GRC_TMC_ACCURACY_GUARANTEE) - message = 'accuracy can not be guaranteed' - case (GRC_TMC_ANGLE_OK) - message = 'only angle measurement valid' - case (GRC_TMC_ANGLE_NOT_FULL_CORR) - message = 'only angle measurement valid but without full correction' - case (GRC_TMC_ANGLE_NO_ACC_GUARANTY) - message = 'only angle measurement valid but accuracy can not be guaranteed' - case (GRC_TMC_ANGLE_ERROR) - message = 'no angle measurement' - case (GRC_TMC_DIST_PPM) - message = 'wrong setting of ppm or mm on EDM' - case (GRC_TMC_DIST_ERROR) - message = 'distance measurement not done (no aim)' - case (GRC_TMC_BUSY) - message = 'system is busy (no measurement done)' - case (GRC_TMC_SIGNAL_ERROR) - message = 'no signal on EDM (only in signal mode)' - + case (GRC_TMC); message = 'TMC error' + case (GRC_TMC_NO_FULL_CORRECTION); message = 'measurement without full correction' + case (GRC_TMC_ACCURACY_GUARANTEE); message = 'accuracy can not be guaranteed' + case (GRC_TMC_ANGLE_OK); message = 'only angle measurement valid' + case (GRC_TMC_ANGLE_NOT_FULL_CORR); message = 'only angle measurement valid but without full correction' + case (GRC_TMC_ANGLE_NO_ACC_GUARANTY); message = 'only angle measurement valid but accuracy can not be guaranteed' + case (GRC_TMC_ANGLE_ERROR); message = 'no angle measurement' + case (GRC_TMC_DIST_PPM); message = 'wrong setting of ppm or mm on EDM' + case (GRC_TMC_DIST_ERROR); message = 'distance measurement not done (no aim)' + case (GRC_TMC_BUSY); message = 'system is busy (no measurement done)' + case (GRC_TMC_SIGNAL_ERROR); message = 'no signal on EDM (only in signal mode)' ! MOT - case (GRC_MOT_UNREADY) - message = 'motorisation is not ready' - case (GRC_MOT_BUSY) - message = 'motorisation is handling another task' - case (GRC_MOT_NOT_OCONST) - message = 'motorisation is not in velocity mode' - case (GRC_MOT_NOT_CONFIG) - message = 'motorisation is in the wrong mode or busy' - case (GRC_MOT_NOT_POSIT) - message = 'motorisation is not in posit mode' - case (GRC_MOT_NOT_SERVICE) - message = 'motorisation is not in service mode' - case (GRC_MOT_NOT_BUSY) - message = 'motorisation is handling no task' - case (GRC_MOT_NOT_LOCK) - message = 'motorisation is not in tracking mode' - case (GRC_MOT_NOT_SPIRAL) - message = 'motorisation is not in spiral mode' - case (GRC_MOT_V_ENCODER) - message = 'vertical encoder/motor error' - case (GRC_MOT_HZ_ENCODER) - message = 'horizontal encoder/motor error' - case (GRC_MOT_HZ_V_ENCODER) - message = 'horizontal and vertical encoder/motor error' - + case (GRC_MOT_UNREADY); message = 'motorisation is not ready' + case (GRC_MOT_BUSY); message = 'motorisation is handling another task' + case (GRC_MOT_NOT_OCONST); message = 'motorisation is not in velocity mode' + case (GRC_MOT_NOT_CONFIG); message = 'motorisation is in the wrong mode or busy' + case (GRC_MOT_NOT_POSIT); message = 'motorisation is not in posit mode' + case (GRC_MOT_NOT_SERVICE); message = 'motorisation is not in service mode' + case (GRC_MOT_NOT_BUSY); message = 'motorisation is handling no task' + case (GRC_MOT_NOT_LOCK); message = 'motorisation is not in tracking mode' + case (GRC_MOT_NOT_SPIRAL); message = 'motorisation is not in spiral mode' + case (GRC_MOT_V_ENCODER); message = 'vertical encoder/motor error' + case (GRC_MOT_HZ_ENCODER); message = 'horizontal encoder/motor error' + case (GRC_MOT_HZ_V_ENCODER); message = 'horizontal and vertical encoder/motor error' ! BMM - case (GRC_BMM) - message = 'BMM error' - case (GRC_BMM_XFER_PENDING) - message = 'loading process already opened' - case (GRC_BMM_NO_XFER_OPEN) - message = 'transfer not opened' - case (GRC_BMM_UNKNOWN_CHARSET) - message = 'unknown character set' - case (GRC_BMM_NOT_INSTALLED) - message = 'display module not present' - case (GRC_BMM_ALREADY_EXIST) - message = 'character set already exists' - case (GRC_BMM_CANT_DELETE) - message = 'character set cannot be deleted' - case (GRC_BMM_MEM_ERROR) - message = 'memory cannot be allocated' - case (GRC_BMM_CHARSET_USED) - message = 'character set still used' - case (GRC_BMM_CHARSET_SAVED) - message = 'charset cannot be deleted or is protected' - case (GRC_BMM_INVALID_ADR) - message = 'attempt to copy a character block outside the allocated memory' - case (GRC_BMM_CANCELANDADR_ERROR) - message = 'error during release of allocated memory' - case (GRC_BMM_INVALID_SIZE) - message = 'number of bytes specified in header does not match the bytes read' - case (GRC_BMM_CANCELANDINVSIZE_ERROR) - message = 'allocated memory could not be released' - case (GRC_BMM_ALL_GROUP_OCC) - message = 'max. number of character sets already loaded' - case (GRC_BMM_CANT_DEL_LAYERS) - message = 'layer cannot be deleted' - case (GRC_BMM_UNKNOWN_LAYER) - message = 'required layer does not exist' - case (GRC_BMM_INVALID_LAYERLEN) - message = 'layer length exceeds maximum' - + case (GRC_BMM); message = 'BMM error' + case (GRC_BMM_XFER_PENDING); message = 'loading process already opened' + case (GRC_BMM_NO_XFER_OPEN); message = 'transfer not opened' + case (GRC_BMM_UNKNOWN_CHARSET); message = 'unknown character set' + case (GRC_BMM_NOT_INSTALLED); message = 'display module not present' + case (GRC_BMM_ALREADY_EXIST); message = 'character set already exists' + case (GRC_BMM_CANT_DELETE); message = 'character set cannot be deleted' + case (GRC_BMM_MEM_ERROR); message = 'memory cannot be allocated' + case (GRC_BMM_CHARSET_USED); message = 'character set still used' + case (GRC_BMM_CHARSET_SAVED); message = 'charset cannot be deleted or is protected' + case (GRC_BMM_INVALID_ADR); message = 'attempt to copy a character block outside the allocated memory' + case (GRC_BMM_CANCELANDADR_ERROR); message = 'error during release of allocated memory' + case (GRC_BMM_INVALID_SIZE); message = 'number of bytes specified in header does not match the bytes read' + case (GRC_BMM_CANCELANDINVSIZE_ERROR); message = 'allocated memory could not be released' + case (GRC_BMM_ALL_GROUP_OCC); message = 'max. number of character sets already loaded' + case (GRC_BMM_CANT_DEL_LAYERS); message = 'layer cannot be deleted' + case (GRC_BMM_UNKNOWN_LAYER); message = 'required layer does not exist' + case (GRC_BMM_INVALID_LAYERLEN); message = 'layer length exceeds maximum' ! COM - case (GRC_COM_ERO) - message = 'initiate Extended Runtime Operation (ERO)' - case (GRC_COM_CANT_ENCODE) - message = 'cannot encode arguments in client' - case (GRC_COM_CANT_DECODE) - message = 'cannot decode results in client' - case (GRC_COM_CANT_SEND) - message = 'hardware error while sending' - case (GRC_COM_CANT_RECV) - message = 'hardware error while receiving' - case (GRC_COM_TIMEDOUT) - message = 'request timed out' - case (GRC_COM_WRONG_FORMAT) - message = 'packet format error' - case (GRC_COM_VER_MISMATCH) - message = 'version mismatch between client and server' - case (GRC_COM_CANT_DECODE_REQ) - message = 'cannot decode arguments in server' - case (GRC_COM_PROC_UNAVAIL) - message = 'unknown RPC, procedure ID invalid' - case (GRC_COM_CANT_ENCODE_REP) - message = 'cannot encode results in server' - case (GRC_COM_SYSTEM_ERR) - message = 'unspecified generic system error' - case (GRC_COM_FAILED) - message = 'unspecified error' - case (GRC_COM_NO_BINARY) - message = 'binary protocol not available' - case (GRC_COM_INTR) - message = 'call interrupted' - case (GRC_COM_REQUIRES_8DBITS) - message = 'protocol needs 8 bit encoded characters' - case (GRC_COM_TR_ID_MISMATCH) - message = 'transaction id mismatch error' - case (GRC_COM_NOT_GEOCOM) - message = 'protocol not recognisable' - case (GRC_COM_UNKNOWN_PORT) - message = 'invalid port address' - case (GRC_COM_ERO_END) - message = 'ERO is terminating' - case (GRC_COM_OVERRUN) - message = 'internal error (data buffer overflow)' - case (GRC_COM_SRVR_RX_CHECKSUM_ERRR) - message = 'invalid checksum on server side received' - case (GRC_COM_CLNT_RX_CHECKSUM_ERRR) - message = 'invalid checksum on client side received' - case (GRC_COM_PORT_NOT_AVAILABLE) - message = 'port not available' - case (GRC_COM_PORT_NOT_OPEN) - message = 'port not opened' - case (GRC_COM_NO_PARTNER) - message = 'unable to find TPS' - case (GRC_COM_ERO_NOT_STARTED) - message = 'Extended Runtime Operation (ERO) could not be started' - case (GRC_COM_CONS_REQ) - message = 'att to send cons reqs' - case (GRC_COM_SRVR_IS_SLEEPING) - message = 'TPS has gone to sleep (wait and try again)' - case (GRC_COM_SRVR_IS_OFF) - message = 'TPS has shut down (wait and try again)' - case (GRC_COM_NO_CHECKSUM) - message = 'no checksum in ASCII protocol available' - + case (GRC_COM_ERO); message = 'initiate Extended Runtime Operation (ERO)' + case (GRC_COM_CANT_ENCODE); message = 'cannot encode arguments in client' + case (GRC_COM_CANT_DECODE); message = 'cannot decode results in client' + case (GRC_COM_CANT_SEND); message = 'hardware error while sending' + case (GRC_COM_CANT_RECV); message = 'hardware error while receiving' + case (GRC_COM_TIMEDOUT); message = 'request timed out' + case (GRC_COM_WRONG_FORMAT); message = 'packet format error' + case (GRC_COM_VER_MISMATCH); message = 'version mismatch between client and server' + case (GRC_COM_CANT_DECODE_REQ); message = 'cannot decode arguments in server' + case (GRC_COM_PROC_UNAVAIL); message = 'unknown RPC, procedure ID invalid' + case (GRC_COM_CANT_ENCODE_REP); message = 'cannot encode results in server' + case (GRC_COM_SYSTEM_ERR); message = 'unspecified generic system error' + case (GRC_COM_FAILED); message = 'unspecified error' + case (GRC_COM_NO_BINARY); message = 'binary protocol not available' + case (GRC_COM_INTR); message = 'call interrupted' + case (GRC_COM_REQUIRES_8DBITS); message = 'protocol needs 8 bit encoded characters' + case (GRC_COM_TR_ID_MISMATCH); message = 'transaction id mismatch error' + case (GRC_COM_NOT_GEOCOM); message = 'protocol not recognisable' + case (GRC_COM_UNKNOWN_PORT); message = 'invalid port address' + case (GRC_COM_ERO_END); message = 'ERO is terminating' + case (GRC_COM_OVERRUN); message = 'internal error (data buffer overflow)' + case (GRC_COM_SRVR_RX_CHECKSUM_ERRR); message = 'invalid checksum on server side received' + case (GRC_COM_CLNT_RX_CHECKSUM_ERRR); message = 'invalid checksum on client side received' + case (GRC_COM_PORT_NOT_AVAILABLE); message = 'port not available' + case (GRC_COM_PORT_NOT_OPEN); message = 'port not opened' + case (GRC_COM_NO_PARTNER); message = 'unable to find TPS' + case (GRC_COM_ERO_NOT_STARTED); message = 'Extended Runtime Operation (ERO) could not be started' + case (GRC_COM_CONS_REQ); message = 'att to send cons reqs' + case (GRC_COM_SRVR_IS_SLEEPING); message = 'TPS has gone to sleep (wait and try again)' + case (GRC_COM_SRVR_IS_OFF); message = 'TPS has shut down (wait and try again)' + case (GRC_COM_NO_CHECKSUM); message = 'no checksum in ASCII protocol available' ! AUT - case (GRC_AUT_TIMEOUT) - message = 'position not reached' - case (GRC_AUT_DETENT_ERROR) - message = 'positioning not possible due to mounted EDM' - case (GRC_AUT_ANGLE_ERROR) - message = 'angle measurement error' - case (GRC_AUT_MOTOR_ERROR) - message = 'motorisation error' - case (GRC_AUT_INCACC) - message = 'position not exactly reached' - case (GRC_AUT_DEV_ERROR) - message = 'deviation measurement error' - case (GRC_AUT_NO_TARGET) - message = 'no target detected' - case (GRC_AUT_MULTIPLE_TARGETS) - message = 'multiple targets detected' - case (GRC_AUT_BAD_ENVIRONMENT) - message = 'bad environment conditions' - case (GRC_AUT_DETECTOR_ERROR) - message = 'error in target acquisition' - case (GRC_AUT_NOT_ENABLED) - message = 'target acquisition not enabled' - case (GRC_AUT_CALACC) - message = 'ATR calibration failed' - case (GRC_AUT_ACCURACY) - message = 'target position not exactly reached' - case (GRC_AUT_DIST_STARTED) - message = 'distance measurement has been started' - case (GRC_AUT_SUPPLY_TOO_HIGH) - message = 'external supply voltage is too high' - case (GRC_AUT_SUPPLY_TOO_LOW) - message = 'internal or external supply voltage is too low' - case (GRC_AUT_NO_WORKING_AREA) - message = 'working area not set' - case (GRC_AUT_ARRAY_FULL) - message = 'power search data array is filled' - case (GRC_AUT_NO_DATA) - message = 'no data available' - + case (GRC_AUT_TIMEOUT); message = 'position not reached' + case (GRC_AUT_DETENT_ERROR); message = 'positioning not possible due to mounted EDM' + case (GRC_AUT_ANGLE_ERROR); message = 'angle measurement error' + case (GRC_AUT_MOTOR_ERROR); message = 'motorisation error' + case (GRC_AUT_INCACC); message = 'position not exactly reached' + case (GRC_AUT_DEV_ERROR); message = 'deviation measurement error' + case (GRC_AUT_NO_TARGET); message = 'no target detected' + case (GRC_AUT_MULTIPLE_TARGETS); message = 'multiple targets detected' + case (GRC_AUT_BAD_ENVIRONMENT); message = 'bad environment conditions' + case (GRC_AUT_DETECTOR_ERROR); message = 'error in target acquisition' + case (GRC_AUT_NOT_ENABLED); message = 'target acquisition not enabled' + case (GRC_AUT_CALACC); message = 'ATR calibration failed' + case (GRC_AUT_ACCURACY); message = 'target position not exactly reached' + case (GRC_AUT_DIST_STARTED); message = 'distance measurement has been started' + case (GRC_AUT_SUPPLY_TOO_HIGH); message = 'external supply voltage is too high' + case (GRC_AUT_SUPPLY_TOO_LOW); message = 'internal or external supply voltage is too low' + case (GRC_AUT_NO_WORKING_AREA); message = 'working area not set' + case (GRC_AUT_ARRAY_FULL); message = 'power search data array is filled' + case (GRC_AUT_NO_DATA); message = 'no data available' ! KDM - case (GRC_KDM_NOT_AVAILABLE) - message = 'KDM device is not available' - + case (GRC_KDM_NOT_AVAILABLE); message = 'KDM device is not available' ! FTR - case (GRC_FTR_FILEACCESS) - message = 'file access error' - case (GRC_FTR_WRONGFILEBLOCKNUMBER) - message = 'block number was not the expected one' - case (GRC_FTR_NOTENOUGHSPACE) - message = 'not enough space on device to proceed uploading' - case (GRC_FTR_INVALIDINPUT) - message = 'rename of file failed' - case (GRC_FTR_MISSINGSETUP) - message = 'invalid parameter as input' - - case default - message = 'unknown GeoCOM code (' // dm_itoa(grc) // ')' + case (GRC_FTR_FILEACCESS); message = 'file access error' + case (GRC_FTR_WRONGFILEBLOCKNUMBER); message = 'block number was not the expected one' + case (GRC_FTR_NOTENOUGHSPACE); message = 'not enough space on device to proceed uploading' + case (GRC_FTR_INVALIDINPUT); message = 'rename of file failed' + case (GRC_FTR_MISSINGSETUP); message = 'invalid parameter as input' + ! Default + case default; message = 'unknown GeoCOM code (' // dm_itoa(grc) // ')' end select end function dm_geocom_error_message diff --git a/src/dm_log.f90 b/src/dm_log.f90 index 6ef009c..6f32e63 100644 --- a/src/dm_log.f90 +++ b/src/dm_log.f90 @@ -133,20 +133,13 @@ pure elemental integer function dm_log_level_from_name(name) result(level) name_ = dm_to_lower(name) select case (name_) - case (LOG_LEVEL_NAMES_LOWER(LL_DEBUG)) - level = LL_DEBUG - case (LOG_LEVEL_NAMES_LOWER(LL_INFO)) - level = LL_INFO - case (LOG_LEVEL_NAMES_LOWER(LL_WARNING)) - level = LL_WARNING - case (LOG_LEVEL_NAMES_LOWER(LL_ERROR)) - level = LL_ERROR - case (LOG_LEVEL_NAMES_LOWER(LL_CRITICAL)) - level = LL_CRITICAL - case (LOG_LEVEL_NAMES_LOWER(LL_USER)) - level = LL_USER - case default - level = LL_NONE + case (LOG_LEVEL_NAMES_LOWER(LL_DEBUG)); level = LL_DEBUG + case (LOG_LEVEL_NAMES_LOWER(LL_INFO)); level = LL_INFO + case (LOG_LEVEL_NAMES_LOWER(LL_WARNING)); level = LL_WARNING + case (LOG_LEVEL_NAMES_LOWER(LL_ERROR)); level = LL_ERROR + case (LOG_LEVEL_NAMES_LOWER(LL_CRITICAL)); level = LL_CRITICAL + case (LOG_LEVEL_NAMES_LOWER(LL_USER)); level = LL_USER + case default; level = LL_NONE end select end function dm_log_level_from_name @@ -223,11 +216,11 @@ pure elemental logical function log_is_valid_log(log) result(valid) valid = .false. - if (.not. dm_log_is_valid(log%level)) return - if (.not. dm_error_is_valid(log%error)) return + if (.not. dm_log_is_valid(log%level)) return + if (.not. dm_error_is_valid(log%error)) return if (log%id == UUID_DEFAULT) return - if (.not. dm_uuid4_is_valid(log%id)) return - if (.not. dm_time_is_valid(log%timestamp)) return + if (.not. dm_uuid4_is_valid(log%id)) return + if (.not. dm_time_is_valid(log%timestamp)) return if (.not. dm_string_is_printable(log%message)) return valid = .true. diff --git a/src/dm_plot.f90 b/src/dm_plot.f90 index ffbe442..e37c21d 100644 --- a/src/dm_plot.f90 +++ b/src/dm_plot.f90 @@ -185,33 +185,15 @@ pure elemental integer function dm_plot_terminal_from_name(name) result(terminal name_ = dm_to_lower(name) select case (name_) - case (PLOT_TERMINAL_NAMES(PLOT_TERMINAL_ANSI)) - ! ANSI - terminal = PLOT_TERMINAL_ANSI - case (PLOT_TERMINAL_NAMES(PLOT_TERMINAL_ASCII)) - ! ASCII - terminal = PLOT_TERMINAL_ASCII - case (PLOT_TERMINAL_NAMES(PLOT_TERMINAL_GIF)) - ! GIF - terminal = PLOT_TERMINAL_GIF - case (PLOT_TERMINAL_NAMES(PLOT_TERMINAL_PNG)) - ! PNG - terminal = PLOT_TERMINAL_PNG - case (PLOT_TERMINAL_NAMES(PLOT_TERMINAL_PNG_CAIRO)) - ! PNG Cairo - terminal = PLOT_TERMINAL_PNG_CAIRO - case (PLOT_TERMINAL_NAMES(PLOT_TERMINAL_SIXEL)) - ! Sixel - terminal = PLOT_TERMINAL_SIXEL - case (PLOT_TERMINAL_NAMES(PLOT_TERMINAL_SVG)) - ! SVG - terminal = PLOT_TERMINAL_SVG - case (PLOT_TERMINAL_NAMES(PLOT_TERMINAL_X11)) - ! X11 - terminal = PLOT_TERMINAL_X11 - case default - ! none - terminal = PLOT_TERMINAL_NONE + case (PLOT_TERMINAL_NAMES(PLOT_TERMINAL_ANSI)); terminal = PLOT_TERMINAL_ANSI ! ANSI + case (PLOT_TERMINAL_NAMES(PLOT_TERMINAL_ASCII)); terminal = PLOT_TERMINAL_ASCII ! ASCII + case (PLOT_TERMINAL_NAMES(PLOT_TERMINAL_GIF)); terminal = PLOT_TERMINAL_GIF ! GIF + case (PLOT_TERMINAL_NAMES(PLOT_TERMINAL_PNG)); terminal = PLOT_TERMINAL_PNG ! PNG + case (PLOT_TERMINAL_NAMES(PLOT_TERMINAL_PNG_CAIRO)); terminal = PLOT_TERMINAL_PNG_CAIRO ! PNG Cairo + case (PLOT_TERMINAL_NAMES(PLOT_TERMINAL_SIXEL)); terminal = PLOT_TERMINAL_SIXEL ! Sixel + case (PLOT_TERMINAL_NAMES(PLOT_TERMINAL_SVG)); terminal = PLOT_TERMINAL_SVG ! SVG + case (PLOT_TERMINAL_NAMES(PLOT_TERMINAL_X11)); terminal = PLOT_TERMINAL_X11 ! X11 + case default; terminal = PLOT_TERMINAL_NONE ! none end select end function dm_plot_terminal_from_name @@ -224,7 +206,8 @@ pure elemental logical function dm_plot_terminal_is_valid(terminal) result(valid end function dm_plot_terminal_is_valid function dm_plot_version(name, found) result(version) - !! Returns Gnuplot version as allocatable string. + !! Returns Gnuplot version as allocatable string. This function is quite + !! slow as Gnuplot has to be started in a new process. character(len=*), parameter :: NAME_STR = 'gnuplot' logical, intent(in), optional :: name !! Add prefix `gnuplot/`. @@ -276,16 +259,11 @@ integer function plot_output(plot, dps) result(rc) if (size(dps) == 0) return select case (plot%style) - case (PLOT_STYLE_LINES) - style = 'lines' - case (PLOT_STYLE_LINESPOINTS) - style = 'linespoints' - case (PLOT_STYLE_DOTS) - style = 'dots' - case (PLOT_STYLE_POINTS) - style = 'points' - case default - style = 'lines' + case (PLOT_STYLE_LINES); style = 'lines' + case (PLOT_STYLE_LINESPOINTS); style = 'linespoints' + case (PLOT_STYLE_DOTS); style = 'dots' + case (PLOT_STYLE_POINTS); style = 'points' + case default; style = 'lines' end select if (len_trim(plot%foreground) > 0) then diff --git a/src/dm_sensor.f90 b/src/dm_sensor.f90 index 578eb44..948133f 100644 --- a/src/dm_sensor.f90 +++ b/src/dm_sensor.f90 @@ -122,32 +122,19 @@ pure elemental integer function dm_sensor_type_from_name(name) result(type) name_ = dm_to_lower(name) select case (name_) - case (SENSOR_TYPE_NAMES(SENSOR_TYPE_VIRTUAL)) - type = SENSOR_TYPE_VIRTUAL - case (SENSOR_TYPE_NAMES(SENSOR_TYPE_SYSTEM)) - type = SENSOR_TYPE_SYSTEM - case (SENSOR_TYPE_NAMES(SENSOR_TYPE_FS)) - type = SENSOR_TYPE_FS - case (SENSOR_TYPE_NAMES(SENSOR_TYPE_PROCESS)) - type = SENSOR_TYPE_PROCESS - case (SENSOR_TYPE_NAMES(SENSOR_TYPE_NETWORK)) - type = SENSOR_TYPE_NETWORK - case (SENSOR_TYPE_NAMES(SENSOR_TYPE_MULTI)) - type = SENSOR_TYPE_MULTI - case (SENSOR_TYPE_NAMES(SENSOR_TYPE_METEO)) - type = SENSOR_TYPE_METEO - case (SENSOR_TYPE_NAMES(SENSOR_TYPE_GNSS)) - type = SENSOR_TYPE_GNSS - case (SENSOR_TYPE_NAMES(SENSOR_TYPE_RTS)) - type = SENSOR_TYPE_RTS - case (SENSOR_TYPE_NAMES(SENSOR_TYPE_LEVEL)) - type = SENSOR_TYPE_LEVEL - case (SENSOR_TYPE_NAMES(SENSOR_TYPE_MEMS)) - type = SENSOR_TYPE_MEMS - case (SENSOR_TYPE_NAMES(SENSOR_TYPE_CAMERA)) - type = SENSOR_TYPE_CAMERA - case default - type = SENSOR_TYPE_NONE + case (SENSOR_TYPE_NAMES(SENSOR_TYPE_VIRTUAL)); type = SENSOR_TYPE_VIRTUAL + case (SENSOR_TYPE_NAMES(SENSOR_TYPE_SYSTEM)); type = SENSOR_TYPE_SYSTEM + case (SENSOR_TYPE_NAMES(SENSOR_TYPE_FS)); type = SENSOR_TYPE_FS + case (SENSOR_TYPE_NAMES(SENSOR_TYPE_PROCESS)); type = SENSOR_TYPE_PROCESS + case (SENSOR_TYPE_NAMES(SENSOR_TYPE_NETWORK)); type = SENSOR_TYPE_NETWORK + case (SENSOR_TYPE_NAMES(SENSOR_TYPE_MULTI)); type = SENSOR_TYPE_MULTI + case (SENSOR_TYPE_NAMES(SENSOR_TYPE_METEO)); type = SENSOR_TYPE_METEO + case (SENSOR_TYPE_NAMES(SENSOR_TYPE_GNSS)); type = SENSOR_TYPE_GNSS + case (SENSOR_TYPE_NAMES(SENSOR_TYPE_RTS)); type = SENSOR_TYPE_RTS + case (SENSOR_TYPE_NAMES(SENSOR_TYPE_LEVEL)); type = SENSOR_TYPE_LEVEL + case (SENSOR_TYPE_NAMES(SENSOR_TYPE_MEMS)); type = SENSOR_TYPE_MEMS + case (SENSOR_TYPE_NAMES(SENSOR_TYPE_CAMERA)); type = SENSOR_TYPE_CAMERA + case default; type = SENSOR_TYPE_NONE end select end function dm_sensor_type_from_name diff --git a/src/dm_sync.f90 b/src/dm_sync.f90 index 29292ee..c454cf0 100644 --- a/src/dm_sync.f90 +++ b/src/dm_sync.f90 @@ -86,18 +86,12 @@ pure elemental integer function dm_sync_type_from_name(name) result(type) name_ = dm_to_lower(name) select case (name_) - case (SYNC_TYPE_NAMES(SYNC_TYPE_NODE)) - type = SYNC_TYPE_NODE - case (SYNC_TYPE_NAMES(SYNC_TYPE_SENSOR)) - type = SYNC_TYPE_SENSOR - case (SYNC_TYPE_NAMES(SYNC_TYPE_TARGET)) - type = SYNC_TYPE_TARGET - case (SYNC_TYPE_NAMES(SYNC_TYPE_OBSERV)) - type = SYNC_TYPE_OBSERV - case (SYNC_TYPE_NAMES(SYNC_TYPE_LOG)) - type = SYNC_TYPE_LOG - case default - type = SYNC_TYPE_NONE + case (SYNC_TYPE_NAMES(SYNC_TYPE_NODE)); type = SYNC_TYPE_NODE + case (SYNC_TYPE_NAMES(SYNC_TYPE_SENSOR)); type = SYNC_TYPE_SENSOR + case (SYNC_TYPE_NAMES(SYNC_TYPE_TARGET)); type = SYNC_TYPE_TARGET + case (SYNC_TYPE_NAMES(SYNC_TYPE_OBSERV)); type = SYNC_TYPE_OBSERV + case (SYNC_TYPE_NAMES(SYNC_TYPE_LOG)); type = SYNC_TYPE_LOG + case default; type = SYNC_TYPE_NONE end select end function dm_sync_type_from_name diff --git a/src/dm_tty.f90 b/src/dm_tty.f90 index e7631ab..d20c54a 100644 --- a/src/dm_tty.f90 +++ b/src/dm_tty.f90 @@ -495,86 +495,52 @@ integer function dm_tty_set_attributes(tty) result(rc) ! Byte size (start bits). select case (tty%byte_size) - case (TTY_BYTE_SIZE5) - byte_size = CS5 - case (TTY_BYTE_SIZE6) - byte_size = CS6 - case (TTY_BYTE_SIZE7) - byte_size = CS7 - case (TTY_BYTE_SIZE8) - byte_size = CS8 - case default - return + case (TTY_BYTE_SIZE5); byte_size = CS5 + case (TTY_BYTE_SIZE6); byte_size = CS6 + case (TTY_BYTE_SIZE7); byte_size = CS7 + case (TTY_BYTE_SIZE8); byte_size = CS8 + case default; return end select ! Stop bits. select case (tty%stop_bits) - case (TTY_STOP_BITS1) - stop_bits = 0 - case (TTY_STOP_BITS2) - stop_bits = CSTOPB - case default - return + case (TTY_STOP_BITS1); stop_bits = 0 + case (TTY_STOP_BITS2); stop_bits = CSTOPB + case default; return end select ! Parity. select case (tty%parity) - case (TTY_PARITY_NONE) - parity = 0 - case (TTY_PARITY_ODD) - parity = ior(PARENB, PARODD) - case (TTY_PARITY_EVEN) - parity = PARENB - case default - return + case (TTY_PARITY_NONE); parity = 0 + case (TTY_PARITY_ODD); parity = ior(PARENB, PARODD) + case (TTY_PARITY_EVEN); parity = PARENB + case default; return end select ! Baud rate. select case (tty%baud_rate) - case (TTY_B0) - baud_rate = B0 - case (TTY_B50) - baud_rate = B50 - case (TTY_B75) - baud_rate = B75 - case (TTY_B110) - baud_rate = B110 - case (TTY_B134) - baud_rate = B134 - case (TTY_B150) - baud_rate = B150 - case (TTY_B200) - baud_rate = B200 - case (TTY_B300) - baud_rate = B300 - case (TTY_B600) - baud_rate = B600 - case (TTY_B1200) - baud_rate = B1200 - case (TTY_B1800) - baud_rate = B1800 - case (TTY_B2400) - baud_rate = B2400 - case (TTY_B4800) - baud_rate = B4800 - case (TTY_B9600) - baud_rate = B9600 - case (TTY_B19200) - baud_rate = B19200 - case (TTY_B38400) - baud_rate = B38400 - case (TTY_B57600) - baud_rate = B57600 - case (TTY_B115200) - baud_rate = B115200 - case (TTY_B230400) - baud_rate = B230400 - case (TTY_B460800) - baud_rate = B460800 - case (TTY_B921600) - baud_rate = B921600 - case default - return + case (TTY_B0); baud_rate = B0 + case (TTY_B50); baud_rate = B50 + case (TTY_B75); baud_rate = B75 + case (TTY_B110); baud_rate = B110 + case (TTY_B134); baud_rate = B134 + case (TTY_B150); baud_rate = B150 + case (TTY_B200); baud_rate = B200 + case (TTY_B300); baud_rate = B300 + case (TTY_B600); baud_rate = B600 + case (TTY_B1200); baud_rate = B1200 + case (TTY_B1800); baud_rate = B1800 + case (TTY_B2400); baud_rate = B2400 + case (TTY_B4800); baud_rate = B4800 + case (TTY_B9600); baud_rate = B9600 + case (TTY_B19200); baud_rate = B19200 + case (TTY_B38400); baud_rate = B38400 + case (TTY_B57600); baud_rate = B57600 + case (TTY_B115200); baud_rate = B115200 + case (TTY_B230400); baud_rate = B230400 + case (TTY_B460800); baud_rate = B460800 + case (TTY_B921600); baud_rate = B921600 + case default; return end select rc = E_SYSTEM @@ -726,12 +692,9 @@ integer function dm_tty_stop_bits_from_value(value, error) result(stop_bits) if (present(error)) error = E_INVALID select case (value) - case (1) - stop_bits = TTY_STOP_BITS1 - case (2) - stop_bits = TTY_STOP_BITS2 - case default - return + case (1); stop_bits = TTY_STOP_BITS1 + case (2); stop_bits = TTY_STOP_BITS2 + case default; return end select if (present(error)) error = E_NONE diff --git a/src/dm_type.f90 b/src/dm_type.f90 index fd0cd09..d173781 100644 --- a/src/dm_type.f90 +++ b/src/dm_type.f90 @@ -22,8 +22,9 @@ module dm_type ! Derived type names. character(len=*), parameter, public :: TYPE_NAMES(TYPE_NONE:TYPE_LAST) = [ & - character(len=TYPE_NAME_LEN) :: 'none', 'node', 'sensor', 'target', 'observ', & - 'request', 'response', 'log', 'beat', 'dp' ] !! Type names array. + character(len=TYPE_NAME_LEN) :: & + 'none', 'node', 'sensor', 'target', 'observ', 'request', 'response', 'log', 'beat', 'dp' & + ] !! Type names array. public :: dm_type_from_name public :: dm_type_is_valid @@ -41,26 +42,16 @@ integer function dm_type_from_name(name) result(type) name_ = dm_to_lower(name) select case (name_) - case (TYPE_NAMES(TYPE_NODE)) - type = TYPE_NODE - case (TYPE_NAMES(TYPE_SENSOR)) - type = TYPE_SENSOR - case (TYPE_NAMES(TYPE_TARGET)) - type = TYPE_TARGET - case (TYPE_NAMES(TYPE_OBSERV)) - type = TYPE_OBSERV - case (TYPE_NAMES(TYPE_REQUEST)) - type = TYPE_REQUEST - case (TYPE_NAMES(TYPE_RESPONSE)) - type = TYPE_RESPONSE - case (TYPE_NAMES(TYPE_LOG)) - type = TYPE_LOG - case (TYPE_NAMES(TYPE_BEAT)) - type = TYPE_BEAT - case (TYPE_NAMES(TYPE_DP)) - type = TYPE_DP - case default - type = TYPE_NONE + case (TYPE_NAMES(TYPE_NODE)); type = TYPE_NODE + case (TYPE_NAMES(TYPE_SENSOR)); type = TYPE_SENSOR + case (TYPE_NAMES(TYPE_TARGET)); type = TYPE_TARGET + case (TYPE_NAMES(TYPE_OBSERV)); type = TYPE_OBSERV + case (TYPE_NAMES(TYPE_REQUEST)); type = TYPE_REQUEST + case (TYPE_NAMES(TYPE_RESPONSE)); type = TYPE_RESPONSE + case (TYPE_NAMES(TYPE_LOG)); type = TYPE_LOG + case (TYPE_NAMES(TYPE_BEAT)); type = TYPE_BEAT + case (TYPE_NAMES(TYPE_DP)); type = TYPE_DP + case default; type = TYPE_NONE end select end function dm_type_from_name diff --git a/src/dm_z.f90 b/src/dm_z.f90 index 56d9b7e..4355a42 100644 --- a/src/dm_z.f90 +++ b/src/dm_z.f90 @@ -102,23 +102,18 @@ integer function dm_z_compress_type(type, z, output, output_len, context) result integer(kind=i8), intent(out), optional :: output_len !! Output length. type(zstd_context_type), intent(inout), optional :: context !! Zstandard compression context to use with type `Z_TYPE_ZSTD`. + rc = E_INVALID + select type (t => type) - type is (beat_type) - rc = z_compress_beat (t, z, output, output_len, context) - type is (log_type) - rc = z_compress_log (t, z, output, output_len, context) - type is (node_type) - rc = z_compress_node (t, z, output, output_len, context) - type is (observ_type) - rc = z_compress_observ(t, z, output, output_len, context) - type is (sensor_type) - rc = z_compress_sensor(t, z, output, output_len, context) - type is (target_type) - rc = z_compress_target(t, z, output, output_len, context) + type is (beat_type); rc = z_compress_beat (t, z, output, output_len, context) + type is (log_type); rc = z_compress_log (t, z, output, output_len, context) + type is (node_type); rc = z_compress_node (t, z, output, output_len, context) + type is (observ_type); rc = z_compress_observ(t, z, output, output_len, context) + type is (sensor_type); rc = z_compress_sensor(t, z, output, output_len, context) + type is (target_type); rc = z_compress_target(t, z, output, output_len, context) class default - rc = E_INVALID - output = '' if (present(output_len)) output_len = 0_i8 + output = '' end select end function dm_z_compress_type @@ -172,14 +167,10 @@ pure elemental integer function dm_z_type_from_encoding(encoding) result(z) character(len=*), intent(in) :: encoding !! Content encoding name. select case (trim(encoding)) - case ('') - z = Z_TYPE_NONE - case ('deflate') - z = Z_TYPE_ZLIB - case ('zstd') - z = Z_TYPE_ZSTD - case default - z = Z_TYPE_INVALID + case (''); z = Z_TYPE_NONE + case ('deflate'); z = Z_TYPE_ZLIB + case ('zstd'); z = Z_TYPE_ZSTD + case default; z = Z_TYPE_INVALID end select end function dm_z_type_from_encoding @@ -195,14 +186,10 @@ pure elemental integer function dm_z_type_from_name(name) result(z) name_ = dm_to_lower(name) select case (name_) - case (Z_TYPE_NAMES(Z_TYPE_NONE)) - z = Z_TYPE_NONE - case (Z_TYPE_NAMES(Z_TYPE_ZLIB)) - z = Z_TYPE_ZLIB - case (Z_TYPE_NAMES(Z_TYPE_ZSTD)) - z = Z_TYPE_ZSTD - case default - z = Z_TYPE_INVALID + case (Z_TYPE_NAMES(Z_TYPE_NONE)); z = Z_TYPE_NONE + case (Z_TYPE_NAMES(Z_TYPE_ZLIB)); z = Z_TYPE_ZLIB + case (Z_TYPE_NAMES(Z_TYPE_ZSTD)); z = Z_TYPE_ZSTD + case default; z = Z_TYPE_INVALID end select end function dm_z_type_from_name @@ -236,12 +223,9 @@ pure function dm_z_type_to_encoding(z) result(encoding) character(len=:), allocatable :: encoding !! Content encoding string. select case (z) - case (Z_TYPE_ZLIB) - encoding = 'deflate' - case (Z_TYPE_ZSTD) - encoding = 'zstd' - case default - encoding = '' + case (Z_TYPE_ZLIB); encoding = 'deflate' + case (Z_TYPE_ZSTD); encoding = 'zstd' + case default; encoding = '' end select end function dm_z_type_to_encoding