diff --git a/README.md b/README.md index f607d1e..20092e2 100644 --- a/README.md +++ b/README.md @@ -151,8 +151,7 @@ $ make [freebsd|linux|linux_aarch64] $ make install PREFIX=/opt ``` -On 64-bit Raspberry Pi single-board computers, target `linux_aarch64` must be -chosen. +On 64-bit Raspberry Pi single-board computers, select target `linux_aarch64`. ## Library diff --git a/app/dmapi.f90 b/app/dmapi.f90 index b6850f3..5cfacda 100644 --- a/app/dmapi.f90 +++ b/app/dmapi.f90 @@ -189,7 +189,7 @@ subroutine route_beat(env) end if ! Uncompress payload. - rc = dm_z_uncompress(content, beat, encoding) + rc = dm_z_uncompress(content, encoding, beat) if (dm_is_error(rc)) then call api_error(HTTP_BAD_REQUEST, 'corrupted payload', rc) @@ -445,7 +445,7 @@ subroutine route_log(env) end if ! Uncompress payload. - rc = dm_z_uncompress(content, log, encoding) + rc = dm_z_uncompress(content, encoding, log) if (dm_is_error(rc)) then call api_error(HTTP_BAD_REQUEST, 'corrupted payload', rc) @@ -778,7 +778,7 @@ subroutine route_node(env) end if ! Uncompress payload. - rc = dm_z_uncompress(content, node, encoding) + rc = dm_z_uncompress(content, encoding, node) if (dm_is_error(rc)) then call api_error(HTTP_BAD_REQUEST, 'corrupted payload', rc) @@ -1035,7 +1035,7 @@ subroutine route_observ(env) end if ! Uncompress payload. - rc = dm_z_uncompress(content, observ, encoding) + rc = dm_z_uncompress(content, encoding, observ) if (dm_is_error(rc)) then call api_error(HTTP_BAD_REQUEST, 'corrupted payload', rc) @@ -1444,7 +1444,7 @@ subroutine route_sensor(env) end if ! Uncompress payload. - rc = dm_z_uncompress(content, sensor, encoding) + rc = dm_z_uncompress(content, encoding, sensor) if (dm_is_error(rc)) then call api_error(HTTP_BAD_REQUEST, 'corrupted payload', rc) @@ -1702,7 +1702,7 @@ subroutine route_target(env) end if ! Uncompress payload. - rc = dm_z_uncompress(content, target, encoding) + rc = dm_z_uncompress(content, encoding, target) if (dm_is_error(rc)) then call api_error(HTTP_BAD_REQUEST, 'corrupted payload', rc) diff --git a/app/dmbeat.f90 b/app/dmbeat.f90 index 9e924bf..b52cd4e 100644 --- a/app/dmbeat.f90 +++ b/app/dmbeat.f90 @@ -97,7 +97,7 @@ integer function read_args(app) result(rc) ] ! Read all command-line arguments. - version = dm_rpc_version() // ' ' // dm_lua_version(.true.) + version = dm_rpc_version() // ' ' // dm_lua_version(.true.) // ' ' // dm_zstd_version(.true.) rc = dm_arg_read(args, APP_NAME, APP_MAJOR, APP_MINOR, APP_PATCH, version) if (dm_is_error(rc)) return @@ -294,7 +294,7 @@ subroutine run(app, error) last_error = rc if (app%count > 0) then - niter = niter + 1 + niter = dm_inc(niter) if (niter >= app%count) exit emit_loop end if diff --git a/app/dmdb.f90 b/app/dmdb.f90 index f3eff5b..ddc0a6d 100644 --- a/app/dmdb.f90 +++ b/app/dmdb.f90 @@ -283,7 +283,7 @@ subroutine run(app, db, mqueue, sem) end if ! Increase optimise step counter. - steps = modulo(steps + 1, APP_DB_NSTEPS) + steps = modulo(dm_inc(steps), APP_DB_NSTEPS) end do ipc_loop end subroutine run diff --git a/app/dminfo.f90 b/app/dminfo.f90 index 8662693..ac99c1b 100644 --- a/app/dminfo.f90 +++ b/app/dminfo.f90 @@ -10,7 +10,7 @@ program dminfo character(len=*), parameter :: APP_NAME = 'dminfo' integer, parameter :: APP_MAJOR = 0 integer, parameter :: APP_MINOR = 9 - integer, parameter :: APP_PATCH = 1 + integer, parameter :: APP_PATCH = 2 type :: app_type !! Command-line arguments. @@ -52,9 +52,9 @@ integer function output_info(app) result(rc) type(app_type), intent(inout) :: app character(len=:), allocatable :: mode_name - integer :: app_id, mode + integer :: app_id, mode, user_version integer(kind=i8) :: n, sz - logical :: exists, has_db + logical :: exists, foreign_keys, has_db type(db_type) :: db type(uname_type) :: uname @@ -78,85 +78,67 @@ integer function output_info(app) result(rc) ! Database information. if (has_db) then rc = dm_db_get_application_id(db, app_id) - print '("db.application_id: ", z0)', app_id - - rc = dm_db_get_foreign_keys(db, exists) - print '("db.foreign_keys: ", l)', exists - + rc = dm_db_get_user_version(db, user_version) + rc = dm_db_get_foreign_keys(db, foreign_keys) rc = dm_db_get_journal_mode(db, mode, mode_name) - print '("db.journal_mode: ", a)', mode_name - print '("db.path: ", a)', trim(app%database) - print '("db.size: ", i0)', sz + print '("db.application_id: ", z0)', app_id + print '("db.foreign_keys: ", l1)', foreign_keys + print '("db.journal_mode: ", a)', mode_name + print '("db.library: ", a)', dm_db_version(.true.) + print '("db.path: ", a)', trim(app%database) + print '("db.schema.version: ", i0)', user_version + print '("db.size: ", i0)', sz rc = dm_db_table_exists(db, SQL_TABLE_BEATS, exists) - rc = dm_db_count_beats(db, n) - print '("db.table.beats: ", l)', exists - print '("db.table.beats.rows: ", i0)', n + if (exists) rc = dm_db_count_beats(db, n) + if (exists) print '("db.table.beats.rows: ", i0)', n rc = dm_db_table_exists(db, SQL_TABLE_LOGS, exists) - rc = dm_db_count_logs(db, n) - print '("db.table.logs: ", l)', exists - print '("db.table.logs.rows: ", i0)', n + if (exists) rc = dm_db_count_logs(db, n) + if (exists) print '("db.table.logs.rows: ", i0)', n rc = dm_db_table_exists(db, SQL_TABLE_NODES, exists) - rc = dm_db_count_nodes(db, n) - print '("db.table.nodes: ", l)', exists - print '("db.table.nodes.rows: ", i0)', n + if (exists) rc = dm_db_count_nodes(db, n) + if (exists) print '("db.table.nodes.rows: ", i0)', n rc = dm_db_table_exists(db, SQL_TABLE_OBSERVS, exists) - rc = dm_db_count_observs(db, n) - print '("db.table.observs: ", l)', exists - print '("db.table.observs.rows: ", i0)', n + if (exists) rc = dm_db_count_observs(db, n) + if (exists) print '("db.table.observs.rows: ", i0)', n rc = dm_db_table_exists(db, SQL_TABLE_RECEIVERS, exists) - rc = dm_db_count_receivers(db, n) - print '("db.table.receivers: ", l)', exists - print '("db.table.receivers.rows: ", i0)', n + if (exists) rc = dm_db_count_receivers(db, n) + if (exists) print '("db.table.receivers.rows: ", i0)', n rc = dm_db_table_exists(db, SQL_TABLE_REQUESTS, exists) - rc = dm_db_count_requests(db, n) - print '("db.table.requests: ", l)', exists - print '("db.table.requests.rows: ", i0)', n + if (exists) rc = dm_db_count_requests(db, n) + if (exists) print '("db.table.requests.rows: ", i0)', n rc = dm_db_table_exists(db, SQL_TABLE_RESPONSES, exists) - rc = dm_db_count_responses(db, n) - print '("db.table.responses: ", l)', exists - print '("db.table.responses.rows: ", i0)', n + if (exists) rc = dm_db_count_responses(db, n) + if (exists) print '("db.table.responses.rows: ", i0)', n rc = dm_db_table_exists(db, SQL_TABLE_SENSORS, exists) - rc = dm_db_count_sensors(db, n) - print '("db.table.sensors: ", l)', exists - print '("db.table.sensors.rows: ", i0)', n + if (exists) rc = dm_db_count_sensors(db, n) + if (exists) print '("db.table.sensors.rows: ", i0)', n rc = dm_db_table_exists(db, SQL_TABLE_TARGETS, exists) - rc = dm_db_count_targets(db, n) - print '("db.table.targets: ", l)', exists - print '("db.table.targets.rows: ", i0)', n + if (exists) rc = dm_db_count_targets(db, n) + if (exists) print '("db.table.targets.rows: ", i0)', n rc = dm_db_close(db) end if - ! DMPACK information. - print '("dmpack.version: ", a)', DM_VERSION_STRING - - ! System information. - write (*, '("system.byte_order: ")', advance='no') - - if (LITTLE_ENDIAN) then - print '("little-endian")' - else - print '("big-endian")' - end if - call dm_system_uname(uname) - print '("system.host: ", a)', trim(uname%node_name) - print '("system.machine: ", a)', trim(uname%machine) - print '("system.name: ", a)', trim(uname%system_name) - print '("system.release: ", a)', trim(uname%release) - print '("system.time.now: ", a)', dm_time_now() - print '("system.time.zone: ", a)', dm_time_zone() - print '("system.version: ", a)', trim(uname%version) + print '("dmpack.version: ", a)', DM_VERSION_STRING + print '("system.byte_order: ", a)', dm_btoa(LITTLE_ENDIAN, 'little-endian', 'big-endian') + print '("system.host: ", a)', trim(uname%node_name) + print '("system.name: ", a)', trim(uname%system_name) + print '("system.platform: ", a)', trim(uname%machine) + print '("system.release: ", a)', trim(uname%release) + print '("system.time.now: ", a)', dm_time_now() + print '("system.time.zone: ", a)', dm_time_zone() + print '("system.version: ", a)', trim(uname%version) end function output_info end program dminfo diff --git a/app/dmlogger.f90 b/app/dmlogger.f90 index d386360..ced2d8f 100644 --- a/app/dmlogger.f90 +++ b/app/dmlogger.f90 @@ -275,7 +275,7 @@ subroutine run(app, db, mqueue, sem) end if ! Increase optimise step counter. - steps = modulo(steps + 1, APP_DB_NSTEPS) + steps = modulo(dm_inc(steps), APP_DB_NSTEPS) end do ipc_loop end subroutine run diff --git a/app/dmplot.f90 b/app/dmplot.f90 index e995c19..7a55b99 100644 --- a/app/dmplot.f90 +++ b/app/dmplot.f90 @@ -161,7 +161,7 @@ integer function read_args(app) result(rc) ] ! Read all command-line arguments. - version = dm_plot_version() // ' ' // dm_lua_version(.true.) // ' ' // dm_db_version(.true.) + version = dm_plot_version(.true.) // ' ' // dm_lua_version(.true.) // ' ' // dm_db_version(.true.) rc = dm_arg_read(args, APP_NAME, APP_MAJOR, APP_MINOR, APP_PATCH, version) if (dm_is_error(rc)) return diff --git a/app/dmreport.f90 b/app/dmreport.f90 index 55ca3b8..531ae99 100644 --- a/app/dmreport.f90 +++ b/app/dmreport.f90 @@ -177,7 +177,7 @@ integer function read_args(app) result(rc) ] ! Read all command-line arguments. - version = dm_plot_version() // ' ' // dm_lua_version(.true.) // ' ' // dm_db_version(.true.) + version = dm_plot_version(.true.) // ' ' // dm_lua_version(.true.) // ' ' // dm_db_version(.true.) rc = dm_arg_read(args, APP_NAME, APP_MAJOR, APP_MINOR, APP_PATCH, version) if (dm_is_error(rc)) return diff --git a/app/dmsync.f90 b/app/dmsync.f90 index 3856d64..bc4aa6e 100644 --- a/app/dmsync.f90 +++ b/app/dmsync.f90 @@ -144,7 +144,8 @@ integer function read_args(app) result(rc) ] ! Read all command-line arguments. - version = dm_rpc_version() // ' ' // dm_lua_version(.true.) // ' ' // dm_db_version(.true.) + version = dm_rpc_version() // ' ' // dm_lua_version(.true.) // ' ' // & + dm_db_version(.true.) // ' ' // dm_zstd_version(.true.) rc = dm_arg_read(args, APP_NAME, APP_MAJOR, APP_MINOR, APP_PATCH, version) if (dm_is_error(rc)) return @@ -510,9 +511,9 @@ integer function run(app, db, sem) result(rc) last_error = max(last_error, rc) ! Update sync data. - syncs(i)%timestamp = dm_time_now() ! Time of sync attempt. - syncs(i)%code = responses(i)%code ! Server status code. - syncs(i)%attempts = syncs(i)%attempts + 1 ! Number of sync attempts. + syncs(i)%timestamp = dm_time_now() ! Time of sync attempt. + syncs(i)%code = responses(i)%code ! Server status code. + syncs(i)%attempts = dm_inc(syncs(i)%attempts) ! Number of sync attempts. ! Insert or replace the sync data in database. If the database ! is busy, try up to `APP_DB_NATTEMPTS` times, then abort. diff --git a/app/dmweb.f90 b/app/dmweb.f90 index f8bdc5f..f9fc6ec 100644 --- a/app/dmweb.f90 +++ b/app/dmweb.f90 @@ -1492,6 +1492,8 @@ subroutine route_status(env) H_TD // dm_version_to_string(APP_MAJOR, APP_MINOR, APP_PATCH) // H_TD_END // H_TR_END // & H_TR // H_TH // 'DMPACK Version' // H_TH_END // & H_TD // DM_VERSION_STRING // H_TD_END // H_TR_END // & + H_TR // H_TH // 'SQLite Version' // H_TH_END // & + H_TD // dm_db_version() // H_TD_END // H_TR_END // & H_TR // H_TH // 'Compiler' // H_TH_END // & H_TD // dm_html_encode(compiler_version()) // H_TD_END // H_TR_END // & H_TR // H_TH // 'Compiler Options' // H_TH_END // & diff --git a/runtests.sh b/runtests.sh index e0d6ebf..875d0ef 100644 --- a/runtests.sh +++ b/runtests.sh @@ -48,7 +48,7 @@ for TEST in ${TESTS}; do if [ $? -ne 0 ]; then NFAIL=`expr ${NFAIL} + 1` printf "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n" - printf "TEST ${TEST} FAILED!\n" + printf "TEST %s FAILED!\n" ${TEST} printf "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n" fi done diff --git a/src/dm_arg.f90 b/src/dm_arg.f90 index 4fa89dc..5743366 100644 --- a/src/dm_arg.f90 +++ b/src/dm_arg.f90 @@ -230,6 +230,9 @@ integer function dm_arg_read(args, app, major, minor, patch, version) result(rc) !! arguments. If one of these arguments is passed, `dm_stop(0)` is !! called afterwards. !! + !! Optional argument `version` may be a string of third-party library + !! names and version numbers. + !! !! The function returns the following error codes: !! !! * `E_EMPTY` if array of arguments is empty. diff --git a/src/dm_db.f90 b/src/dm_db.f90 index 041e52e..ecaf1c8 100644 --- a/src/dm_db.f90 +++ b/src/dm_db.f90 @@ -4208,7 +4208,7 @@ end function dm_db_valid function dm_db_version(name) result(version) !! Returns SQLite 3 library version as allocatable string. - logical, intent(in), optional :: name !! Add string `libsqlite/' as prefix. + logical, intent(in), optional :: name !! Add prefix `libsqlite/'. character(len=:), allocatable :: version logical :: name_ @@ -4217,7 +4217,7 @@ function dm_db_version(name) result(version) if (present(name)) name_ = name if (name_) then - version = 'libsqlite/' // sqlite3_libversion() + version = 'libsqlite3/' // sqlite3_libversion() else version = sqlite3_libversion() end if diff --git a/src/dm_hdf5.f90 b/src/dm_hdf5.f90 index 6dc2664..96c6ea4 100644 --- a/src/dm_hdf5.f90 +++ b/src/dm_hdf5.f90 @@ -119,6 +119,7 @@ module dm_hdf5 public :: dm_hdf5_open public :: dm_hdf5_read public :: dm_hdf5_version + public :: dm_hdf5_version_number public :: dm_hdf5_write ! Private procedures. @@ -321,7 +322,30 @@ integer function dm_hdf5_init() result(rc) rc = E_NONE end function dm_hdf5_init - integer function dm_hdf5_version(major, minor, release) result(rc) + function dm_hdf5_version(name) result(version) + !! Returns HDF5 library version as allocatable string. + logical, intent(in), optional :: name !! Add prefix `libhdf5/`. + character(len=:), allocatable :: version + + character(len=8) :: v + integer :: major, minor, release + integer :: rc + logical :: name_ + + name_ = .false. + if (present(name)) name_ = name + + rc = dm_hdf5_version_number(major, minor, release) + write (v, '(2(i0, "."), i0)') major, minor, release + + if (name_) then + version = 'libhdf5/' // trim(v) + else + version = trim(v) + end if + end function dm_hdf5_version + + integer function dm_hdf5_version_number(major, minor, release) result(rc) !! Returns version numbers of HDF5 library. The function returns !! `E_HDF5` on error. use :: h5lib, only: h5get_libversion_f @@ -342,7 +366,7 @@ integer function dm_hdf5_version(major, minor, release) result(rc) if (stat < 0) return rc = E_NONE - end function dm_hdf5_version + end function dm_hdf5_version_number ! ****************************************************************** ! PRIVATE PROCEDURES. diff --git a/src/dm_lua.f90 b/src/dm_lua.f90 index fd01deb..e654d84 100644 --- a/src/dm_lua.f90 +++ b/src/dm_lua.f90 @@ -27,11 +27,6 @@ module dm_lua implicit none (type, external) private - type, public :: lua_state_type - !! Lua state type that stores the Lua pointer. - type(c_ptr) :: ptr = c_null_ptr !! C pointer to Lua interpreter. - end type lua_state_type - abstract interface ! int *lua_CFunction(lua_State *L) function dm_lua_callback(ptr) bind(c) @@ -53,7 +48,7 @@ end function dm_lua_callback module procedure :: lua_field_real64 module procedure :: lua_field_stack module procedure :: lua_field_string - end interface + end interface dm_lua_field interface dm_lua_get !! Pushes table index on stack and optionally returns value. @@ -63,13 +58,13 @@ end function dm_lua_callback module procedure :: lua_get_real64 module procedure :: lua_get_stack module procedure :: lua_get_string - end interface + end interface dm_lua_get interface dm_lua_from !! Converts derived types to Lua table on stack. module procedure :: lua_from_observ module procedure :: lua_from_request - end interface + end interface dm_lua_from interface dm_lua_read !! Pushes global variable on stack and optionally returns value. @@ -81,7 +76,11 @@ end function dm_lua_callback module procedure :: lua_read_real64 module procedure :: lua_read_stack module procedure :: lua_read_string - end interface + end interface dm_lua_read + + interface dm_lua_set + module procedure :: lua_set_int32 + end interface dm_lua_set interface dm_lua_to !! Converts Lua table to Fortran derived type. @@ -94,6 +93,11 @@ end function dm_lua_callback module procedure :: lua_to_request end interface dm_lua_to + type, public :: lua_state_type + !! Lua state type that stores the Lua pointer. + type(c_ptr) :: ptr = c_null_ptr !! C pointer to Lua interpreter. + end type lua_state_type + ! Public procedures. public :: dm_lua_call public :: dm_lua_callback @@ -116,6 +120,7 @@ end function dm_lua_callback public :: dm_lua_open public :: dm_lua_pop public :: dm_lua_register + public :: dm_lua_set public :: dm_lua_table public :: dm_lua_table_size public :: dm_lua_to @@ -127,6 +132,7 @@ end function dm_lua_callback public :: dm_lua_to_string public :: dm_lua_unescape public :: dm_lua_version + public :: dm_lua_version_number ! Private procedures. private :: lua_field_array_int32 @@ -157,6 +163,8 @@ end function dm_lua_callback private :: lua_read_stack private :: lua_read_string + private :: lua_set_int32 + private :: lua_to_job private :: lua_to_job_list private :: lua_to_jobs @@ -164,8 +172,6 @@ end function dm_lua_callback private :: lua_to_observs private :: lua_to_report private :: lua_to_request - - private :: lua_version_number contains ! ****************************************************************** ! PUBLIC FUNCTIONS. @@ -434,7 +440,7 @@ end function dm_lua_unescape function dm_lua_version(name) result(version) !! Returns Lua version as allocatable string of the form `5.4` or !! `liblua/5.4` if argument `name` is `.true.`. - logical, intent(in), optional :: name + logical, intent(in), optional :: name !! Add prefix `liblua/`. character(len=:), allocatable :: version character(len=3) :: v @@ -449,7 +455,7 @@ function dm_lua_version(name) result(version) rc = dm_lua_init(lua) if (dm_is_ok(rc)) then - call lua_version_number(lua, major, minor) + call dm_lua_version_number(lua, major, minor) write (v, '(i1, ".", i1)') major, minor end if @@ -494,7 +500,7 @@ subroutine dm_lua_dump_stack(lua, unit) case (LUA_TNIL) write (unit_, '("nil")') case (LUA_TBOOLEAN) - write (unit_, '(l)') lua_toboolean(lua%ptr, i) + write (unit_, '(l1)') lua_toboolean(lua%ptr, i) case (LUA_TNUMBER) write (unit_, '(f0.1)') lua_tonumber(lua%ptr, i) case (LUA_TSTRING) @@ -527,6 +533,19 @@ subroutine dm_lua_register(lua, name, proc) call lua_register(lua%ptr, trim(name), c_funloc(proc)) end subroutine dm_lua_register + subroutine dm_lua_version_number(lua, major, minor) + !! Returns Lua version number. + type(lua_state_type), intent(inout) :: lua !! Lua type. + integer, intent(out) :: major !! Major version number. + integer, intent(out) :: minor !! Minor version number. + + real :: version + + version = real(lua_version(lua%ptr)) + major = floor(version / 100) + minor = floor(version - (major * 100)) + end subroutine dm_lua_version_number + ! ****************************************************************** ! PRIVATE FUNCTIONS. ! ****************************************************************** @@ -1137,6 +1156,15 @@ integer function lua_read_string(lua, name, value) result(rc) call lua_pop(lua%ptr, 1) end function lua_read_string + integer function lua_set_int32(lua, name, value) result(rc) + !! Sets 4-byte integer variable of given name. + type(lua_state_type), intent(inout) :: lua !! Lua type. + character(len=*), intent(in) :: name !! Name of variable + integer(kind=i4), intent(in) :: value !! Value of variable. + + rc = dm_lua_eval(lua, name // ' = ' // dm_itoa(value)) + end function lua_set_int32 + integer function lua_to_job(lua, job) result(rc) !! Reads Lua table into Fortran job type. The table has to be on top of !! the stack and will be removed once finished. @@ -1654,17 +1682,4 @@ subroutine lua_from_request(lua, request) call lua_setfield(lua%ptr, -2, 'responses') end subroutine lua_from_request - - subroutine lua_version_number(lua, major, minor) - !! Returns Lua version number. - type(lua_state_type), intent(inout) :: lua !! Lua type. - integer, intent(out) :: major !! Major version number. - integer, intent(out) :: minor !! Minor version number. - - real :: version - - version = real(lua_version(lua%ptr)) - major = floor(version / 100) - minor = floor(version - (major * 100)) - end subroutine lua_version_number end module dm_lua diff --git a/src/dm_lua_api.f90 b/src/dm_lua_api.f90 index 7210e67..f32ec53 100644 --- a/src/dm_lua_api.f90 +++ b/src/dm_lua_api.f90 @@ -95,122 +95,122 @@ integer function dm_lua_api_register(lua, errors, log_levels, procedures, respon ! Add error codes. if (errors_) then - rc = dm_lua_eval(lua, 'E_NONE = ' // dm_itoa(E_NONE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_ERROR = ' // dm_itoa(E_ERROR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_DUMMY = ' // dm_itoa(E_DUMMY)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_INVALID = ' // dm_itoa(E_INVALID)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_INCOMPLETE = ' // dm_itoa(E_INCOMPLETE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_TYPE = ' // dm_itoa(E_TYPE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_IO = ' // dm_itoa(E_IO)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_READ = ' // dm_itoa(E_READ)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_WRITE = ' // dm_itoa(E_WRITE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_EOF = ' // dm_itoa(E_EOF)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_EOR = ' // dm_itoa(E_EOR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_ALLOC = ' // dm_itoa(E_ALLOC)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_BOUNDS = ' // dm_itoa(E_BOUNDS)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_EXIST = ' // dm_itoa(E_EXIST)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_SYSTEM = ' // dm_itoa(E_SYSTEM)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_MEMORY = ' // dm_itoa(E_MEMORY)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_FULL = ' // dm_itoa(E_FULL)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_EMPTY = ' // dm_itoa(E_EMPTY)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_LIMIT = ' // dm_itoa(E_LIMIT)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_TIMEOUT = ' // dm_itoa(E_TIMEOUT)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_FORMAT = ' // dm_itoa(E_FORMAT)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_NOT_FOUND = ' // dm_itoa(E_NOT_FOUND)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_PERM = ' // dm_itoa(E_PERM)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_READ_ONLY = ' // dm_itoa(E_READ_ONLY)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_CORRUPT = ' // dm_itoa(E_CORRUPT)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_CONFIG = ' // dm_itoa(E_CONFIG)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_GEOCOM = ' // dm_itoa(E_GEOCOM)); if (dm_is_error(rc)) return - - rc = dm_lua_eval(lua, 'E_DB = ' // dm_itoa(E_DB)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_DB_ID = ' // dm_itoa(E_DB_ID)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_DB_BUSY = ' // dm_itoa(E_DB_BUSY)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_DB_LOCKED = ' // dm_itoa(E_DB_LOCKED)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_DB_EXEC = ' // dm_itoa(E_DB_EXEC)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_DB_CONSTRAINT = ' // dm_itoa(E_DB_CONSTRAINT)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_DB_TRANSACTION = ' // dm_itoa(E_DB_TRANSACTION)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_DB_ROLLBACK = ' // dm_itoa(E_DB_ROLLBACK)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_DB_PREPARE = ' // dm_itoa(E_DB_PREPARE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_DB_FINALIZE = ' // dm_itoa(E_DB_FINALIZE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_DB_BIND = ' // dm_itoa(E_DB_BIND)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_DB_TYPE = ' // dm_itoa(E_DB_TYPE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_DB_STEP = ' // dm_itoa(E_DB_STEP)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_DB_NO_ROWS = ' // dm_itoa(E_DB_NO_ROWS)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_DB_BACKUP = ' // dm_itoa(E_DB_BACKUP)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_DB_ATTACH = ' // dm_itoa(E_DB_ATTACH)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_DB_DETACH = ' // dm_itoa(E_DB_DETACH)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_DB_VERSION = ' // dm_itoa(E_DB_VERSION)); if (dm_is_error(rc)) return - - rc = dm_lua_eval(lua, 'E_ARG = ' // dm_itoa(E_ARG)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_ARG_NOT_FOUND = ' // dm_itoa(E_ARG_NOT_FOUND)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_ARG_INVALID = ' // dm_itoa(E_ARG_INVALID)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_ARG_NO_VALUE = ' // dm_itoa(E_ARG_NO_VALUE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_ARG_TYPE = ' // dm_itoa(E_ARG_TYPE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_ARG_LENGTH = ' // dm_itoa(E_ARG_LENGTH)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_ARG_UNKNOWN = ' // dm_itoa(E_ARG_UNKNOWN)); if (dm_is_error(rc)) return - - rc = dm_lua_eval(lua, 'E_MQUEUE = ' // dm_itoa(E_MQUEUE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_MQUEUE_EMPTY = ' // dm_itoa(E_MQUEUE_EMPTY)); if (dm_is_error(rc)) return - - rc = dm_lua_eval(lua, 'E_REGEX = ' // dm_itoa(E_REGEX)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_REGEX_COMPILE = ' // dm_itoa(E_REGEX_COMPILE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_REGEX_EXCEEDED = ' // dm_itoa(E_REGEX_EXCEEDED)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_REGEX_NO_MATCH = ' // dm_itoa(E_REGEX_NO_MATCH)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_REGEX_NO_GROUP = ' // dm_itoa(E_REGEX_NO_GROUP)); if (dm_is_error(rc)) return - - rc = dm_lua_eval(lua, 'E_SENSOR = ' // dm_itoa(E_SENSOR)); if (dm_is_error(rc)) return - - rc = dm_lua_eval(lua, 'E_RPC = ' // dm_itoa(E_RPC)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_RPC_CONNECT = ' // dm_itoa(E_RPC_CONNECT)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_RPC_SSL = ' // dm_itoa(E_RPC_SSL)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_RPC_API = ' // dm_itoa(E_RPC_API)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_RPC_AUTH = ' // dm_itoa(E_RPC_AUTH)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_RPC_CONFLICT = ' // dm_itoa(E_RPC_CONFLICT)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_RPC_SERVER = ' // dm_itoa(E_RPC_SERVER)); if (dm_is_error(rc)) return - - rc = dm_lua_eval(lua, 'E_MAIL = ' // dm_itoa(E_MAIL)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_MAIL_CONNECT = ' // dm_itoa(E_MAIL_CONNECT)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_MAIL_SSL = ' // dm_itoa(E_MAIL_SSL)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_MAIL_AUTH = ' // dm_itoa(E_MAIL_AUTH)); if (dm_is_error(rc)) return - - rc = dm_lua_eval(lua, 'E_MQTT = ' // dm_itoa(E_MQTT)); if (dm_is_error(rc)) return - - rc = dm_lua_eval(lua, 'E_LUA = ' // dm_itoa(E_LUA)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_LUA_YIELD = ' // dm_itoa(E_LUA_YIELD)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_LUA_RUNTIME = ' // dm_itoa(E_LUA_RUNTIME)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_LUA_SYNTAX = ' // dm_itoa(E_LUA_SYNTAX)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_LUA_MEM = ' // dm_itoa(E_LUA_MEM)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_LUA_ERROR = ' // dm_itoa(E_LUA_ERROR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_LUA_FILE = ' // dm_itoa(E_LUA_FILE)); if (dm_is_error(rc)) return - - rc = dm_lua_eval(lua, 'E_LIB = ' // dm_itoa(E_LIB)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_FCGI = ' // dm_itoa(E_FCGI)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_HDF5 = ' // dm_itoa(E_HDF5)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_ZLIB = ' // dm_itoa(E_ZLIB)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_ZSTD = ' // dm_itoa(E_ZSTD)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'E_MODBUS = ' // dm_itoa(E_MODBUS)); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_NONE', E_NONE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_ERROR', E_ERROR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_DUMMY', E_DUMMY); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_INVALID', E_INVALID); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_INCOMPLETE', E_INCOMPLETE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_TYPE', E_TYPE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_IO', E_IO); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_READ', E_READ); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_WRITE', E_WRITE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_EOF', E_EOF); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_EOR', E_EOR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_ALLOC', E_ALLOC); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_BOUNDS', E_BOUNDS); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_EXIST', E_EXIST); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_SYSTEM', E_SYSTEM); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_MEMORY', E_MEMORY); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_FULL', E_FULL); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_EMPTY', E_EMPTY); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_LIMIT', E_LIMIT); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_TIMEOUT', E_TIMEOUT); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_FORMAT', E_FORMAT); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_NOT_FOUND', E_NOT_FOUND); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_PERM', E_PERM); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_READ_ONLY', E_READ_ONLY); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_CORRUPT', E_CORRUPT); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_CONFIG', E_CONFIG); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_GEOCOM', E_GEOCOM); if (dm_is_error(rc)) return + + rc = dm_lua_set(lua, 'E_DB', E_DB); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_DB_ID', E_DB_ID); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_DB_BUSY', E_DB_BUSY); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_DB_LOCKED', E_DB_LOCKED); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_DB_EXEC', E_DB_EXEC); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_DB_CONSTRAINT', E_DB_CONSTRAINT); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_DB_TRANSACTION', E_DB_TRANSACTION); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_DB_ROLLBACK', E_DB_ROLLBACK); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_DB_PREPARE', E_DB_PREPARE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_DB_FINALIZE', E_DB_FINALIZE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_DB_BIND', E_DB_BIND); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_DB_TYPE', E_DB_TYPE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_DB_STEP', E_DB_STEP); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_DB_NO_ROWS', E_DB_NO_ROWS); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_DB_BACKUP', E_DB_BACKUP); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_DB_ATTACH', E_DB_ATTACH); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_DB_DETACH', E_DB_DETACH); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_DB_VERSION', E_DB_VERSION); if (dm_is_error(rc)) return + + rc = dm_lua_set(lua, 'E_ARG', E_ARG); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_ARG_NOT_FOUND', E_ARG_NOT_FOUND); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_ARG_INVALID', E_ARG_INVALID); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_ARG_NO_VALUE', E_ARG_NO_VALUE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_ARG_TYPE', E_ARG_TYPE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_ARG_LENGTH', E_ARG_LENGTH); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_ARG_UNKNOWN', E_ARG_UNKNOWN); if (dm_is_error(rc)) return + + rc = dm_lua_set(lua, 'E_MQUEUE', E_MQUEUE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_MQUEUE_EMPTY', E_MQUEUE_EMPTY); if (dm_is_error(rc)) return + + rc = dm_lua_set(lua, 'E_REGEX', E_REGEX); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_REGEX_COMPILE', E_REGEX_COMPILE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_REGEX_EXCEEDED', E_REGEX_EXCEEDED); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_REGEX_NO_MATCH', E_REGEX_NO_MATCH); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_REGEX_NO_GROUP', E_REGEX_NO_GROUP); if (dm_is_error(rc)) return + + rc = dm_lua_set(lua, 'E_SENSOR', E_SENSOR); if (dm_is_error(rc)) return + + rc = dm_lua_set(lua, 'E_RPC', E_RPC); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_RPC_CONNECT', E_RPC_CONNECT); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_RPC_SSL', E_RPC_SSL); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_RPC_API', E_RPC_API); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_RPC_AUTH', E_RPC_AUTH); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_RPC_CONFLICT', E_RPC_CONFLICT); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_RPC_SERVER', E_RPC_SERVER); if (dm_is_error(rc)) return + + rc = dm_lua_set(lua, 'E_MAIL', E_MAIL); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_MAIL_CONNECT', E_MAIL_CONNECT); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_MAIL_SSL', E_MAIL_SSL); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_MAIL_AUTH', E_MAIL_AUTH); if (dm_is_error(rc)) return + + rc = dm_lua_set(lua, 'E_MQTT', E_MQTT); if (dm_is_error(rc)) return + + rc = dm_lua_set(lua, 'E_LUA', E_LUA); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_LUA_YIELD', E_LUA_YIELD); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_LUA_RUNTIME', E_LUA_RUNTIME); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_LUA_SYNTAX', E_LUA_SYNTAX); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_LUA_MEM', E_LUA_MEM); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_LUA_ERROR', E_LUA_ERROR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_LUA_FILE', E_LUA_FILE); if (dm_is_error(rc)) return + + rc = dm_lua_set(lua, 'E_LIB', E_LIB); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_FCGI', E_FCGI); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_HDF5', E_HDF5); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_ZLIB', E_ZLIB); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_ZSTD', E_ZSTD); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'E_MODBUS', E_MODBUS); if (dm_is_error(rc)) return end if ! Add log levels. if (log_levels_) then - rc = dm_lua_eval(lua, 'LL_NONE = ' // dm_itoa(LL_NONE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'LL_DEBUG = ' // dm_itoa(LL_DEBUG)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'LL_INFO = ' // dm_itoa(LL_INFO)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'LL_WARNING = ' // dm_itoa(LL_WARNING)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'LL_ERROR = ' // dm_itoa(LL_ERROR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'LL_CRITICAL = ' // dm_itoa(LL_CRITICAL)); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'LL_NONE', LL_NONE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'LL_DEBUG', LL_DEBUG); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'LL_INFO', LL_INFO); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'LL_WARNING', LL_WARNING); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'LL_ERROR', LL_ERROR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'LL_CRITICAL', LL_CRITICAL); if (dm_is_error(rc)) return end if ! Register response type parameters. if (response_types_) then - rc = dm_lua_eval(lua, 'RESPONSE_TYPE_REAL64 = ' // dm_itoa(RESPONSE_TYPE_REAL64)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'RESPONSE_TYPE_REAL32 = ' // dm_itoa(RESPONSE_TYPE_REAL32)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'RESPONSE_TYPE_INT64 = ' // dm_itoa(RESPONSE_TYPE_INT64)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'RESPONSE_TYPE_INT32 = ' // dm_itoa(RESPONSE_TYPE_INT32)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'RESPONSE_TYPE_LOGICAL = ' // dm_itoa(RESPONSE_TYPE_LOGICAL)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'RESPONSE_TYPE_BYTE = ' // dm_itoa(RESPONSE_TYPE_BYTE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'RESPONSE_TYPE_STRING = ' // dm_itoa(RESPONSE_TYPE_STRING)); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'RESPONSE_TYPE_REAL64', RESPONSE_TYPE_REAL64); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'RESPONSE_TYPE_REAL32', RESPONSE_TYPE_REAL32); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'RESPONSE_TYPE_INT64', RESPONSE_TYPE_INT64); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'RESPONSE_TYPE_INT32', RESPONSE_TYPE_INT32); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'RESPONSE_TYPE_LOGICAL', RESPONSE_TYPE_LOGICAL); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'RESPONSE_TYPE_BYTE', RESPONSE_TYPE_BYTE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'RESPONSE_TYPE_STRING', RESPONSE_TYPE_STRING); if (dm_is_error(rc)) return end if ! Register procedures. diff --git a/src/dm_lua_geocom.f90 b/src/dm_lua_geocom.f90 index c31854c..42fe704 100644 --- a/src/dm_lua_geocom.f90 +++ b/src/dm_lua_geocom.f90 @@ -285,155 +285,155 @@ integer function dm_lua_geocom_register(lua, procedures, errors) result(rc) ! Register GeoCOM Lua API. if (procedures_) then ! Add GeoCOM type parameters. - rc = dm_lua_eval(lua, 'GEOCOM_AUT_NORMAL = ' // dm_itoa(GEOCOM_AUT_NORMAL)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_AUT_PRECISE = ' // dm_itoa(GEOCOM_AUT_PRECISE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_AUT_FAST = ' // dm_itoa(GEOCOM_AUT_FAST)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_AUT_NORM_MODE = ' // dm_itoa(GEOCOM_AUT_NORM_MODE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_AUT_POINT_MODE = ' // dm_itoa(GEOCOM_AUT_POINT_MODE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_AUT_DEFINE_MODE = ' // dm_itoa(GEOCOM_AUT_DEFINE_MODE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_AUT_POSITION = ' // dm_itoa(GEOCOM_AUT_POSITION)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_AUT_TARGET = ' // dm_itoa(GEOCOM_AUT_TARGET)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_AUT_CLOCKWISE = ' // dm_itoa(GEOCOM_AUT_CLOCKWISE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_AUT_ANTICLOCKWISE = ' // dm_itoa(GEOCOM_AUT_ANTICLOCKWISE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_NO_MEAS = ' // dm_itoa(GEOCOM_BAP_NO_MEAS)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_NO_DIST = ' // dm_itoa(GEOCOM_BAP_NO_DIST)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_DEF_DIST = ' // dm_itoa(GEOCOM_BAP_DEF_DIST)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_CLEAR_DIST = ' // dm_itoa(GEOCOM_BAP_CLEAR_DIST)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_STOP_TRK = ' // dm_itoa(GEOCOM_BAP_STOP_TRK)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_SINGLE_REF_STANDARD = ' // dm_itoa(GEOCOM_BAP_SINGLE_REF_STANDARD)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_SINGLE_REF_FAST = ' // dm_itoa(GEOCOM_BAP_SINGLE_REF_FAST)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_SINGLE_REF_VISIBLE = ' // dm_itoa(GEOCOM_BAP_SINGLE_REF_VISIBLE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_SINGLE_RLESS_VISIBLE = ' // dm_itoa(GEOCOM_BAP_SINGLE_RLESS_VISIBLE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_CONT_REF_STANDARD = ' // dm_itoa(GEOCOM_BAP_CONT_REF_STANDARD)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_CONT_REF_FAST = ' // dm_itoa(GEOCOM_BAP_CONT_REF_FAST)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_CONT_RLESS_VISIBLE = ' // dm_itoa(GEOCOM_BAP_CONT_RLESS_VISIBLE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_AVG_REF_STANDARD = ' // dm_itoa(GEOCOM_BAP_AVG_REF_STANDARD)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_AVG_REF_VISIBLE = ' // dm_itoa(GEOCOM_BAP_AVG_REF_VISIBLE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_AVG_RLESS_VISIBLE = ' // dm_itoa(GEOCOM_BAP_AVG_RLESS_VISIBLE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_CONT_REF_SYNCHRO = ' // dm_itoa(GEOCOM_BAP_CONT_REF_SYNCHRO)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_SINGLE_REF_PRECISE = ' // dm_itoa(GEOCOM_BAP_SINGLE_REF_PRECISE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_PRISM_ROUND = ' // dm_itoa(GEOCOM_BAP_PRISM_ROUND)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_PRISM_MINI = ' // dm_itoa(GEOCOM_BAP_PRISM_MINI)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_PRISM_TAPE = ' // dm_itoa(GEOCOM_BAP_PRISM_TAPE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_PRISM_360 = ' // dm_itoa(GEOCOM_BAP_PRISM_360)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_PRISM_USER1 = ' // dm_itoa(GEOCOM_BAP_PRISM_USER1)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_PRISM_USER2 = ' // dm_itoa(GEOCOM_BAP_PRISM_USER2)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_PRISM_USER3 = ' // dm_itoa(GEOCOM_BAP_PRISM_USER3)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_PRISM_360_MINI = ' // dm_itoa(GEOCOM_BAP_PRISM_360_MINI)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_PRISM_MINI_ZERO = ' // dm_itoa(GEOCOM_BAP_PRISM_MINI_ZERO)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_PRISM_USER = ' // dm_itoa(GEOCOM_BAP_PRISM_USER)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_PRISM_NDS_TAPE = ' // dm_itoa(GEOCOM_BAP_PRISM_NDS_TAPE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_PRISM_GRZ121_ROUND = ' // dm_itoa(GEOCOM_BAP_PRISM_GRZ121_ROUND)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_PRISM_MA_MPR122 = ' // dm_itoa(GEOCOM_BAP_PRISM_MA_MPR122)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_REFL_UNDEF = ' // dm_itoa(GEOCOM_BAP_REFL_UNDEF)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_REFL_PRISM = ' // dm_itoa(GEOCOM_BAP_REFL_PRISM)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_REFL_TAPE = ' // dm_itoa(GEOCOM_BAP_REFL_TAPE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_REFL_USE = ' // dm_itoa(GEOCOM_BAP_REFL_USE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_REFL_LESS = ' // dm_itoa(GEOCOM_BAP_REFL_LESS)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_ATRSET_NORMAL = ' // dm_itoa(GEOCOM_BAP_ATRSET_NORMAL)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_ATRSET_LOWVIS_ON = ' // dm_itoa(GEOCOM_BAP_ATRSET_LOWVIS_ON)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_ATRSET_LOWVIS_AON = ' // dm_itoa(GEOCOM_BAP_ATRSET_LOWVIS_AON)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_ATRSET_SRANGE_ON = ' // dm_itoa(GEOCOM_BAP_ATRSET_SRANGE_ON)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_BAP_ATRSET_SRANGE_AON = ' // dm_itoa(GEOCOM_BAP_ATRSET_SRANGE_AON)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_COM_ASCII = ' // dm_itoa(GEOCOM_COM_ASCII)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_COM_BINARY = ' // dm_itoa(GEOCOM_COM_BINARY)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_COM_STOP_SHUT_DOWN = ' // dm_itoa(GEOCOM_COM_STOP_SHUT_DOWN)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_COM_STOP_SLEEP = ' // dm_itoa(GEOCOM_COM_STOP_SLEEP)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_COM_STARTUP_LOCAL = ' // dm_itoa(GEOCOM_COM_STARTUP_LOCAL)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_COM_STARTUP_REMOTE = ' // dm_itoa(GEOCOM_COM_STARTUP_REMOTE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_CSV_EXTERNAL_POWER = ' // dm_itoa(GEOCOM_CSV_EXTERNAL_POWER)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_CSV_INTERNAL_POWER = ' // dm_itoa(GEOCOM_CSV_INTERNAL_POWER)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_EDM_EGLINTEN_OFF = ' // dm_itoa(GEOCOM_EDM_EGLINTEN_OFF)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_EDM_EGLINTEN_LOW = ' // dm_itoa(GEOCOM_EDM_EGLINTEN_LOW)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_EDM_EGLINTEN_MID = ' // dm_itoa(GEOCOM_EDM_EGLINTEN_MID)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_EDM_EGLINTEN_HIGH = ' // dm_itoa(GEOCOM_EDM_EGLINTEN_HIGH)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_EDM_MODE_NOT_USED = ' // dm_itoa(GEOCOM_EDM_MODE_NOT_USED)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_EDM_SINGLE_TAPE = ' // dm_itoa(GEOCOM_EDM_SINGLE_TAPE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_EDM_SINGLE_STANDARD = ' // dm_itoa(GEOCOM_EDM_SINGLE_STANDARD)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_EDM_SINGLE_FAST = ' // dm_itoa(GEOCOM_EDM_SINGLE_FAST)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_EDM_SINGLE_LRANGE = ' // dm_itoa(GEOCOM_EDM_SINGLE_LRANGE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_EDM_SINGLE_SRANGE = ' // dm_itoa(GEOCOM_EDM_SINGLE_SRANGE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_EDM_CONT_STANDARD = ' // dm_itoa(GEOCOM_EDM_CONT_STANDARD)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_EDM_CONT_DYNAMIC = ' // dm_itoa(GEOCOM_EDM_CONT_DYNAMIC)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_EDM_CONT_REFLESS = ' // dm_itoa(GEOCOM_EDM_CONT_REFLESS)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_EDM_CONT_FAST = ' // dm_itoa(GEOCOM_EDM_CONT_FAST)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_EDM_AVERAGE_IR = ' // dm_itoa(GEOCOM_EDM_AVERAGE_IR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_EDM_PRECISE_IR = ' // dm_itoa(GEOCOM_EDM_PRECISE_IR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_EDM_PRECISE_TAPE = ' // dm_itoa(GEOCOM_EDM_PRECISE_TAPE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_FTR_DEVICE_INTERNAL = ' // dm_itoa(GEOCOM_FTR_DEVICE_INTERNAL)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_FTR_DEVICE_PCPARD = ' // dm_itoa(GEOCOM_FTR_DEVICE_PCPARD)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_FTR_FILE_IMAGES = ' // dm_itoa(GEOCOM_FTR_FILE_IMAGES)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_IMG_INTERNAL_MEMORY = ' // dm_itoa(GEOCOM_IMG_INTERNAL_MEMORY)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_IMG_PC_CARD = ' // dm_itoa(GEOCOM_IMG_PC_CARD)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_IOS_BEEP_STDINTENS = ' // dm_itoa(GEOCOM_IOS_BEEP_STDINTENS)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_MOT_LOCKED_OUT = ' // dm_itoa(GEOCOM_MOT_LOCKED_OUT)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_MOT_LOCKED_IN = ' // dm_itoa(GEOCOM_MOT_LOCKED_IN)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_MOT_PREDICTION = ' // dm_itoa(GEOCOM_MOT_PREDICTION)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_MOT_NORMAL = ' // dm_itoa(GEOCOM_MOT_NORMAL)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_MOT_SHUTDOWN = ' // dm_itoa(GEOCOM_MOT_SHUTDOWN)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_MOT_POSIT = ' // dm_itoa(GEOCOM_MOT_POSIT)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_MOT_OCONST = ' // dm_itoa(GEOCOM_MOT_OCONST)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_MOT_MANUPOS = ' // dm_itoa(GEOCOM_MOT_MANUPOS)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_MOT_LOCK = ' // dm_itoa(GEOCOM_MOT_LOCK)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_MOT_BREAK = ' // dm_itoa(GEOCOM_MOT_BREAK)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_MOT_TERM = ' // dm_itoa(GEOCOM_MOT_TERM)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_SUP_POWER_DISABLED = ' // dm_itoa(GEOCOM_SUP_POWER_DISABLED)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_SUP_POWER_OFF = ' // dm_itoa(GEOCOM_SUP_POWER_OFF)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TMC_MEA_INC = ' // dm_itoa(GEOCOM_TMC_MEA_INC)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TMC_AUTO_INC = ' // dm_itoa(GEOCOM_TMC_AUTO_INC)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TMC_PLANE_INC = ' // dm_itoa(GEOCOM_TMC_PLANE_INC)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TMC_STOP = ' // dm_itoa(GEOCOM_TMC_STOP)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TMC_DEF_DIST = ' // dm_itoa(GEOCOM_TMC_DEF_DIST)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TMC_CLEAR = ' // dm_itoa(GEOCOM_TMC_CLEAR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TMC_SIGNAL = ' // dm_itoa(GEOCOM_TMC_SIGNAL)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TMC_DO_MEASURE = ' // dm_itoa(GEOCOM_TMC_DO_MEASURE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TMC_RTRK_DIST = ' // dm_itoa(GEOCOM_TMC_RTRK_DIST)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TMC_RED_TRK_DIST = ' // dm_itoa(GEOCOM_TMC_RED_TRK_DIST)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TMC_FREQUENCY = ' // dm_itoa(GEOCOM_TMC_FREQUENCY)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TMC_FACE_NORMAL = ' // dm_itoa(GEOCOM_TMC_FACE_NORMAL)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TMC_FACE_TURN = ' // dm_itoa(GEOCOM_TMC_FACE_TURN)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TMC_FACE_1 = ' // dm_itoa(GEOCOM_TMC_FACE_1)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TMC_FACE_2 = ' // dm_itoa(GEOCOM_TMC_FACE_2)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_CLASS_1100 = ' // dm_itoa(GEOCOM_TPS_CLASS_1100)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_CLASS_1700 = ' // dm_itoa(GEOCOM_TPS_CLASS_1700)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_CLASS_1800 = ' // dm_itoa(GEOCOM_TPS_CLASS_1800)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_CLASS_5000 = ' // dm_itoa(GEOCOM_TPS_CLASS_5000)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_CLASS_6000 = ' // dm_itoa(GEOCOM_TPS_CLASS_6000)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_CLASS_1500 = ' // dm_itoa(GEOCOM_TPS_CLASS_1500)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_CLASS_2003 = ' // dm_itoa(GEOCOM_TPS_CLASS_2003)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_CLASS_5005 = ' // dm_itoa(GEOCOM_TPS_CLASS_5005)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_CLASS_5100 = ' // dm_itoa(GEOCOM_TPS_CLASS_5100)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_CLASS_1102 = ' // dm_itoa(GEOCOM_TPS_CLASS_1102)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_CLASS_1103 = ' // dm_itoa(GEOCOM_TPS_CLASS_1103)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_CLASS_1105 = ' // dm_itoa(GEOCOM_TPS_CLASS_1105)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_CLASS_1101 = ' // dm_itoa(GEOCOM_TPS_CLASS_1101)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_CLASS_1202 = ' // dm_itoa(GEOCOM_TPS_CLASS_1202)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_CLASS_1203 = ' // dm_itoa(GEOCOM_TPS_CLASS_1203)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_CLASS_1205 = ' // dm_itoa(GEOCOM_TPS_CLASS_1205)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_CLASS_1201 = ' // dm_itoa(GEOCOM_TPS_CLASS_1201)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_CLASS_TX30 = ' // dm_itoa(GEOCOM_TPS_CLASS_TX30)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_CLASS_TX31 = ' // dm_itoa(GEOCOM_TPS_CLASS_TX31)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_DEVICE_T = ' // dm_itoa(GEOCOM_TPS_DEVICE_T)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_DEVICE_MOT = ' // dm_itoa(GEOCOM_TPS_DEVICE_MOT)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_DEVICE_ATR = ' // dm_itoa(GEOCOM_TPS_DEVICE_ATR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_DEVICE_EGL = ' // dm_itoa(GEOCOM_TPS_DEVICE_EGL)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_DEVICE_DB = ' // dm_itoa(GEOCOM_TPS_DEVICE_DB)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_DEVICE_DL = ' // dm_itoa(GEOCOM_TPS_DEVICE_DL)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_DEVICE_LP = ' // dm_itoa(GEOCOM_TPS_DEVICE_LP)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_DEVICE_TC1 = ' // dm_itoa(GEOCOM_TPS_DEVICE_TC1)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_DEVICE_TC2 = ' // dm_itoa(GEOCOM_TPS_DEVICE_TC2)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_DEVICE_TC = ' // dm_itoa(GEOCOM_TPS_DEVICE_TC)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_DEVICE_TCR = ' // dm_itoa(GEOCOM_TPS_DEVICE_TCR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_DEVICE_ATC = ' // dm_itoa(GEOCOM_TPS_DEVICE_ATC)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_DEVICE_LPNT = ' // dm_itoa(GEOCOM_TPS_DEVICE_LPNT)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_DEVICE_RL_EXT = ' // dm_itoa(GEOCOM_TPS_DEVICE_RL_EXT)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_DEVICE_PS = ' // dm_itoa(GEOCOM_TPS_DEVICE_PS)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_DEVICE_SIM = ' // dm_itoa(GEOCOM_TPS_DEVICE_SIM)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_REFLESS_NONE = ' // dm_itoa(GEOCOM_TPS_REFLESS_NONE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_REFLESS_R100 = ' // dm_itoa(GEOCOM_TPS_REFLESS_R100)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_REFLESS_R300 = ' // dm_itoa(GEOCOM_TPS_REFLESS_R300)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_REFLESS_R400 = ' // dm_itoa(GEOCOM_TPS_REFLESS_R400)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GEOCOM_TPS_REFLESS_R1000 = ' // dm_itoa(GEOCOM_TPS_REFLESS_R1000)); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_AUT_NORMAL', GEOCOM_AUT_NORMAL); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_AUT_PRECISE', GEOCOM_AUT_PRECISE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_AUT_FAST', GEOCOM_AUT_FAST); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_AUT_NORM_MODE', GEOCOM_AUT_NORM_MODE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_AUT_POINT_MODE', GEOCOM_AUT_POINT_MODE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_AUT_DEFINE_MODE', GEOCOM_AUT_DEFINE_MODE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_AUT_POSITION', GEOCOM_AUT_POSITION); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_AUT_TARGET', GEOCOM_AUT_TARGET); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_AUT_CLOCKWISE', GEOCOM_AUT_CLOCKWISE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_AUT_ANTICLOCKWISE', GEOCOM_AUT_ANTICLOCKWISE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_NO_MEAS', GEOCOM_BAP_NO_MEAS); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_NO_DIST', GEOCOM_BAP_NO_DIST); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_DEF_DIST', GEOCOM_BAP_DEF_DIST); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_CLEAR_DIST', GEOCOM_BAP_CLEAR_DIST); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_STOP_TRK', GEOCOM_BAP_STOP_TRK); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_SINGLE_REF_STANDARD', GEOCOM_BAP_SINGLE_REF_STANDARD); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_SINGLE_REF_FAST', GEOCOM_BAP_SINGLE_REF_FAST); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_SINGLE_REF_VISIBLE', GEOCOM_BAP_SINGLE_REF_VISIBLE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_SINGLE_RLESS_VISIBLE', GEOCOM_BAP_SINGLE_RLESS_VISIBLE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_CONT_REF_STANDARD', GEOCOM_BAP_CONT_REF_STANDARD); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_CONT_REF_FAST', GEOCOM_BAP_CONT_REF_FAST); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_CONT_RLESS_VISIBLE', GEOCOM_BAP_CONT_RLESS_VISIBLE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_AVG_REF_STANDARD', GEOCOM_BAP_AVG_REF_STANDARD); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_AVG_REF_VISIBLE', GEOCOM_BAP_AVG_REF_VISIBLE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_AVG_RLESS_VISIBLE', GEOCOM_BAP_AVG_RLESS_VISIBLE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_CONT_REF_SYNCHRO', GEOCOM_BAP_CONT_REF_SYNCHRO); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_SINGLE_REF_PRECISE', GEOCOM_BAP_SINGLE_REF_PRECISE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_PRISM_ROUND', GEOCOM_BAP_PRISM_ROUND); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_PRISM_MINI', GEOCOM_BAP_PRISM_MINI); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_PRISM_TAPE', GEOCOM_BAP_PRISM_TAPE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_PRISM_360', GEOCOM_BAP_PRISM_360); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_PRISM_USER1', GEOCOM_BAP_PRISM_USER1); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_PRISM_USER2', GEOCOM_BAP_PRISM_USER2); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_PRISM_USER3', GEOCOM_BAP_PRISM_USER3); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_PRISM_360_MINI', GEOCOM_BAP_PRISM_360_MINI); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_PRISM_MINI_ZERO', GEOCOM_BAP_PRISM_MINI_ZERO); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_PRISM_USER', GEOCOM_BAP_PRISM_USER); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_PRISM_NDS_TAPE', GEOCOM_BAP_PRISM_NDS_TAPE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_PRISM_GRZ121_ROUND', GEOCOM_BAP_PRISM_GRZ121_ROUND); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_PRISM_MA_MPR122', GEOCOM_BAP_PRISM_MA_MPR122); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_REFL_UNDEF', GEOCOM_BAP_REFL_UNDEF); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_REFL_PRISM', GEOCOM_BAP_REFL_PRISM); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_REFL_TAPE', GEOCOM_BAP_REFL_TAPE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_REFL_USE', GEOCOM_BAP_REFL_USE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_REFL_LESS', GEOCOM_BAP_REFL_LESS); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_ATRSET_NORMAL', GEOCOM_BAP_ATRSET_NORMAL); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_ATRSET_LOWVIS_ON', GEOCOM_BAP_ATRSET_LOWVIS_ON); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_ATRSET_LOWVIS_AON', GEOCOM_BAP_ATRSET_LOWVIS_AON); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_ATRSET_SRANGE_ON', GEOCOM_BAP_ATRSET_SRANGE_ON); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_BAP_ATRSET_SRANGE_AON', GEOCOM_BAP_ATRSET_SRANGE_AON); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_COM_ASCII', GEOCOM_COM_ASCII); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_COM_BINARY', GEOCOM_COM_BINARY); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_COM_STOP_SHUT_DOWN', GEOCOM_COM_STOP_SHUT_DOWN); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_COM_STOP_SLEEP', GEOCOM_COM_STOP_SLEEP); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_COM_STARTUP_LOCAL', GEOCOM_COM_STARTUP_LOCAL); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_COM_STARTUP_REMOTE', GEOCOM_COM_STARTUP_REMOTE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_CSV_EXTERNAL_POWER', GEOCOM_CSV_EXTERNAL_POWER); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_CSV_INTERNAL_POWER', GEOCOM_CSV_INTERNAL_POWER); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_EDM_EGLINTEN_OFF', GEOCOM_EDM_EGLINTEN_OFF); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_EDM_EGLINTEN_LOW', GEOCOM_EDM_EGLINTEN_LOW); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_EDM_EGLINTEN_MID', GEOCOM_EDM_EGLINTEN_MID); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_EDM_EGLINTEN_HIGH', GEOCOM_EDM_EGLINTEN_HIGH); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_EDM_MODE_NOT_USED', GEOCOM_EDM_MODE_NOT_USED); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_EDM_SINGLE_TAPE', GEOCOM_EDM_SINGLE_TAPE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_EDM_SINGLE_STANDARD', GEOCOM_EDM_SINGLE_STANDARD); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_EDM_SINGLE_FAST', GEOCOM_EDM_SINGLE_FAST); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_EDM_SINGLE_LRANGE', GEOCOM_EDM_SINGLE_LRANGE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_EDM_SINGLE_SRANGE', GEOCOM_EDM_SINGLE_SRANGE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_EDM_CONT_STANDARD', GEOCOM_EDM_CONT_STANDARD); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_EDM_CONT_DYNAMIC', GEOCOM_EDM_CONT_DYNAMIC); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_EDM_CONT_REFLESS', GEOCOM_EDM_CONT_REFLESS); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_EDM_CONT_FAST', GEOCOM_EDM_CONT_FAST); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_EDM_AVERAGE_IR', GEOCOM_EDM_AVERAGE_IR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_EDM_PRECISE_IR', GEOCOM_EDM_PRECISE_IR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_EDM_PRECISE_TAPE', GEOCOM_EDM_PRECISE_TAPE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_FTR_DEVICE_INTERNAL', GEOCOM_FTR_DEVICE_INTERNAL); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_FTR_DEVICE_PCPARD', GEOCOM_FTR_DEVICE_PCPARD); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_FTR_FILE_IMAGES', GEOCOM_FTR_FILE_IMAGES); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_IMG_INTERNAL_MEMORY', GEOCOM_IMG_INTERNAL_MEMORY); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_IMG_PC_CARD', GEOCOM_IMG_PC_CARD); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_IOS_BEEP_STDINTENS', GEOCOM_IOS_BEEP_STDINTENS); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_MOT_LOCKED_OUT', GEOCOM_MOT_LOCKED_OUT); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_MOT_LOCKED_IN', GEOCOM_MOT_LOCKED_IN); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_MOT_PREDICTION', GEOCOM_MOT_PREDICTION); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_MOT_NORMAL', GEOCOM_MOT_NORMAL); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_MOT_SHUTDOWN', GEOCOM_MOT_SHUTDOWN); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_MOT_POSIT', GEOCOM_MOT_POSIT); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_MOT_OCONST', GEOCOM_MOT_OCONST); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_MOT_MANUPOS', GEOCOM_MOT_MANUPOS); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_MOT_LOCK', GEOCOM_MOT_LOCK); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_MOT_BREAK', GEOCOM_MOT_BREAK); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_MOT_TERM', GEOCOM_MOT_TERM); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_SUP_POWER_DISABLED', GEOCOM_SUP_POWER_DISABLED); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_SUP_POWER_OFF', GEOCOM_SUP_POWER_OFF); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TMC_MEA_INC', GEOCOM_TMC_MEA_INC); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TMC_AUTO_INC', GEOCOM_TMC_AUTO_INC); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TMC_PLANE_INC', GEOCOM_TMC_PLANE_INC); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TMC_STOP', GEOCOM_TMC_STOP); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TMC_DEF_DIST', GEOCOM_TMC_DEF_DIST); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TMC_CLEAR', GEOCOM_TMC_CLEAR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TMC_SIGNAL', GEOCOM_TMC_SIGNAL); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TMC_DO_MEASURE', GEOCOM_TMC_DO_MEASURE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TMC_RTRK_DIST', GEOCOM_TMC_RTRK_DIST); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TMC_RED_TRK_DIST', GEOCOM_TMC_RED_TRK_DIST); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TMC_FREQUENCY', GEOCOM_TMC_FREQUENCY); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TMC_FACE_NORMAL', GEOCOM_TMC_FACE_NORMAL); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TMC_FACE_TURN', GEOCOM_TMC_FACE_TURN); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TMC_FACE_1', GEOCOM_TMC_FACE_1); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TMC_FACE_2', GEOCOM_TMC_FACE_2); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_CLASS_1100', GEOCOM_TPS_CLASS_1100); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_CLASS_1700', GEOCOM_TPS_CLASS_1700); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_CLASS_1800', GEOCOM_TPS_CLASS_1800); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_CLASS_5000', GEOCOM_TPS_CLASS_5000); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_CLASS_6000', GEOCOM_TPS_CLASS_6000); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_CLASS_1500', GEOCOM_TPS_CLASS_1500); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_CLASS_2003', GEOCOM_TPS_CLASS_2003); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_CLASS_5005', GEOCOM_TPS_CLASS_5005); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_CLASS_5100', GEOCOM_TPS_CLASS_5100); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_CLASS_1102', GEOCOM_TPS_CLASS_1102); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_CLASS_1103', GEOCOM_TPS_CLASS_1103); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_CLASS_1105', GEOCOM_TPS_CLASS_1105); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_CLASS_1101', GEOCOM_TPS_CLASS_1101); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_CLASS_1202', GEOCOM_TPS_CLASS_1202); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_CLASS_1203', GEOCOM_TPS_CLASS_1203); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_CLASS_1205', GEOCOM_TPS_CLASS_1205); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_CLASS_1201', GEOCOM_TPS_CLASS_1201); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_CLASS_TX30', GEOCOM_TPS_CLASS_TX30); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_CLASS_TX31', GEOCOM_TPS_CLASS_TX31); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_DEVICE_T', GEOCOM_TPS_DEVICE_T); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_DEVICE_MOT', GEOCOM_TPS_DEVICE_MOT); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_DEVICE_ATR', GEOCOM_TPS_DEVICE_ATR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_DEVICE_EGL', GEOCOM_TPS_DEVICE_EGL); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_DEVICE_DB', GEOCOM_TPS_DEVICE_DB); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_DEVICE_DL', GEOCOM_TPS_DEVICE_DL); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_DEVICE_LP', GEOCOM_TPS_DEVICE_LP); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_DEVICE_TC1', GEOCOM_TPS_DEVICE_TC1); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_DEVICE_TC2', GEOCOM_TPS_DEVICE_TC2); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_DEVICE_TC', GEOCOM_TPS_DEVICE_TC); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_DEVICE_TCR', GEOCOM_TPS_DEVICE_TCR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_DEVICE_ATC', GEOCOM_TPS_DEVICE_ATC); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_DEVICE_LPNT', GEOCOM_TPS_DEVICE_LPNT); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_DEVICE_RL_EXT', GEOCOM_TPS_DEVICE_RL_EXT); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_DEVICE_PS', GEOCOM_TPS_DEVICE_PS); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_DEVICE_SIM', GEOCOM_TPS_DEVICE_SIM); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_REFLESS_NONE', GEOCOM_TPS_REFLESS_NONE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_REFLESS_R100', GEOCOM_TPS_REFLESS_R100); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_REFLESS_R300', GEOCOM_TPS_REFLESS_R300); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_REFLESS_R400', GEOCOM_TPS_REFLESS_R400); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GEOCOM_TPS_REFLESS_R1000', GEOCOM_TPS_REFLESS_R1000); if (dm_is_error(rc)) return ! Add Lua functions. call dm_lua_register(lua, 'geocom_beep_alarm', lua_geocom_beep_alarm) @@ -557,260 +557,260 @@ integer function dm_lua_geocom_register(lua, procedures, errors) result(rc) ! Register GeoCOM return codes. if (errors_) then - rc = dm_lua_eval(lua, 'GRC_OK = ' // dm_itoa(GRC_OK)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_UNDEFINED = ' // dm_itoa(GRC_UNDEFINED)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_IVPARAM = ' // dm_itoa(GRC_IVPARAM)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_IVRESULT = ' // dm_itoa(GRC_IVRESULT)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_FATAL = ' // dm_itoa(GRC_FATAL)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_NOT_IMPL = ' // dm_itoa(GRC_NOT_IMPL)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_TIME_OUT = ' // dm_itoa(GRC_TIME_OUT)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_SET_INCOMPL = ' // dm_itoa(GRC_SET_INCOMPL)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ABORT = ' // dm_itoa(GRC_ABORT)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_NOMEMORY = ' // dm_itoa(GRC_NOMEMORY)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_NOTINIT = ' // dm_itoa(GRC_NOTINIT)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_SHUT_DOWN = ' // dm_itoa(GRC_SHUT_DOWN)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_SYSBUSY = ' // dm_itoa(GRC_SYSBUSY)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_HWFAILURE = ' // dm_itoa(GRC_HWFAILURE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ABORT_APPL = ' // dm_itoa(GRC_ABORT_APPL)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_LOW_POWER = ' // dm_itoa(GRC_LOW_POWER)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_IVVERSION = ' // dm_itoa(GRC_IVVERSION)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_BAT_EMPTY = ' // dm_itoa(GRC_BAT_EMPTY)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_NO_EVENT = ' // dm_itoa(GRC_NO_EVENT)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_OUT_OF_TEMP = ' // dm_itoa(GRC_OUT_OF_TEMP)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_INSTRUMENT_TILT = ' // dm_itoa(GRC_INSTRUMENT_TILT)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_COM_SETTING = ' // dm_itoa(GRC_COM_SETTING)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_NO_ACTION = ' // dm_itoa(GRC_NO_ACTION)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_SLEEP_MODE = ' // dm_itoa(GRC_SLEEP_MODE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_NOTOK = ' // dm_itoa(GRC_NOTOK)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_NA = ' // dm_itoa(GRC_NA)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_OVERFLOW = ' // dm_itoa(GRC_OVERFLOW)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_STOPPED = ' // dm_itoa(GRC_STOPPED)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG = ' // dm_itoa(GRC_ANG)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_ERROR = ' // dm_itoa(GRC_ANG_ERROR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_INCL_ERROR = ' // dm_itoa(GRC_ANG_INCL_ERROR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_BAD_ACC = ' // dm_itoa(GRC_ANG_BAD_ACC)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_BAD_ANGLE_ACC = ' // dm_itoa(GRC_ANG_BAD_ANGLE_ACC)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_BAD_INCLIN_ACC = ' // dm_itoa(GRC_ANG_BAD_INCLIN_ACC)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_WRITE_PROTECTED = ' // dm_itoa(GRC_ANG_WRITE_PROTECTED)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_OUT_OF_RANGE = ' // dm_itoa(GRC_ANG_OUT_OF_RANGE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_IR_OCCURED = ' // dm_itoa(GRC_ANG_IR_OCCURED)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_HZ_MOVED = ' // dm_itoa(GRC_ANG_HZ_MOVED)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_OS_ERROR = ' // dm_itoa(GRC_ANG_OS_ERROR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_DATA_ERROR = ' // dm_itoa(GRC_ANG_DATA_ERROR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_PEAK_CNT_UFL = ' // dm_itoa(GRC_ANG_PEAK_CNT_UFL)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_TIME_OUT = ' // dm_itoa(GRC_ANG_TIME_OUT)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_TOO_MANY_EXPOS = ' // dm_itoa(GRC_ANG_TOO_MANY_EXPOS)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_PIX_CTRL_ERR = ' // dm_itoa(GRC_ANG_PIX_CTRL_ERR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_MAX_POS_SKIP = ' // dm_itoa(GRC_ANG_MAX_POS_SKIP)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_MAX_NEG_SKIP = ' // dm_itoa(GRC_ANG_MAX_NEG_SKIP)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_EXP_LIMIT = ' // dm_itoa(GRC_ANG_EXP_LIMIT)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_UNDER_EXPOSURE = ' // dm_itoa(GRC_ANG_UNDER_EXPOSURE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_OVER_EXPOSURE = ' // dm_itoa(GRC_ANG_OVER_EXPOSURE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_TMANY_PEAKS = ' // dm_itoa(GRC_ANG_TMANY_PEAKS)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_TLESS_PEAKS = ' // dm_itoa(GRC_ANG_TLESS_PEAKS)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_PEAK_TOO_SLIM = ' // dm_itoa(GRC_ANG_PEAK_TOO_SLIM)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_PEAK_TOO_WIDE = ' // dm_itoa(GRC_ANG_PEAK_TOO_WIDE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_BAD_PEAKDIFF = ' // dm_itoa(GRC_ANG_BAD_PEAKDIFF)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_UNDER_EXP_PICT = ' // dm_itoa(GRC_ANG_UNDER_EXP_PICT)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_PEAKS_INHOMOGEN = ' // dm_itoa(GRC_ANG_PEAKS_INHOMOGEN)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_NO_DECOD_POSS = ' // dm_itoa(GRC_ANG_NO_DECOD_POSS)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_UNSTABLE_DECOD = ' // dm_itoa(GRC_ANG_UNSTABLE_DECOD)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_TLESS_FPEAKS = ' // dm_itoa(GRC_ANG_TLESS_FPEAKS)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_INCL_OLD_PLANE = ' // dm_itoa(GRC_ANG_INCL_OLD_PLANE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_INCL_NO_PLANE = ' // dm_itoa(GRC_ANG_INCL_NO_PLANE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_FAST_ANG_ERR = ' // dm_itoa(GRC_ANG_FAST_ANG_ERR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_FAST_ANG_ERR_5 = ' // dm_itoa(GRC_ANG_FAST_ANG_ERR_5)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_FAST_ANG_ERR_25 = ' // dm_itoa(GRC_ANG_FAST_ANG_ERR_25)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_TRANS_ERR = ' // dm_itoa(GRC_ANG_TRANS_ERR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_TRANS_ERR_5 = ' // dm_itoa(GRC_ANG_TRANS_ERR_5)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ANG_TRANS_ERR_25 = ' // dm_itoa(GRC_ANG_TRANS_ERR_25)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ATA_NOT_READY = ' // dm_itoa(GRC_ATA_NOT_READY)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ATA_NO_RESULT = ' // dm_itoa(GRC_ATA_NO_RESULT)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ATA_SEVERAL_TARGETS = ' // dm_itoa(GRC_ATA_SEVERAL_TARGETS)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ATA_BIG_SPOT = ' // dm_itoa(GRC_ATA_BIG_SPOT)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ATA_BACKGROUND = ' // dm_itoa(GRC_ATA_BACKGROUND)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ATA_NO_TARGETS = ' // dm_itoa(GRC_ATA_NO_TARGETS)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ATA_NOT_ACCURAT = ' // dm_itoa(GRC_ATA_NOT_ACCURAT)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ATA_SPOT_ON_EDGE = ' // dm_itoa(GRC_ATA_SPOT_ON_EDGE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ATA_BLOOMING = ' // dm_itoa(GRC_ATA_BLOOMING)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ATA_NOT_BUSY = ' // dm_itoa(GRC_ATA_NOT_BUSY)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ATA_STRANGE_LIGHT = ' // dm_itoa(GRC_ATA_STRANGE_LIGHT)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ATA_V24_FAIL = ' // dm_itoa(GRC_ATA_V24_FAIL)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ATA_DECODE_ERROR = ' // dm_itoa(GRC_ATA_DECODE_ERROR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ATA_HZ_FAIL = ' // dm_itoa(GRC_ATA_HZ_FAIL)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ATA_V_FAIL = ' // dm_itoa(GRC_ATA_V_FAIL)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ATA_HZ_STRANGE_L = ' // dm_itoa(GRC_ATA_HZ_STRANGE_L)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ATA_V_STRANGE_L = ' // dm_itoa(GRC_ATA_V_STRANGE_L)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ATA_SLDR_TRANSFER_PENDING = ' // dm_itoa(GRC_ATA_SLDR_TRANSFER_PENDING)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ATA_SLDR_TRANSFER_ILLEGAL = ' // dm_itoa(GRC_ATA_SLDR_TRANSFER_ILLEGAL)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ATA_SLDR_DATA_ERROR = ' // dm_itoa(GRC_ATA_SLDR_DATA_ERROR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ATA_SLDR_CHK_SUM_ERROR = ' // dm_itoa(GRC_ATA_SLDR_CHK_SUM_ERROR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ATA_SLDR_ADDRESS_ERROR = ' // dm_itoa(GRC_ATA_SLDR_ADDRESS_ERROR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ATA_SLDR_INV_LOADFILE = ' // dm_itoa(GRC_ATA_SLDR_INV_LOADFILE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ATA_SLDR_UNSUPPORTED = ' // dm_itoa(GRC_ATA_SLDR_UNSUPPORTED)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ATA_PS_NOT_READY = ' // dm_itoa(GRC_ATA_PS_NOT_READY)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_ATA_ATR_SYSTEM_ERR = ' // dm_itoa(GRC_ATA_ATR_SYSTEM_ERR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM = ' // dm_itoa(GRC_EDM)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_SYSTEM_ERR = ' // dm_itoa(GRC_EDM_SYSTEM_ERR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_INVALID_COMMAND = ' // dm_itoa(GRC_EDM_INVALID_COMMAND)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_BOOM_ERR = ' // dm_itoa(GRC_EDM_BOOM_ERR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_SIGN_LOW_ERR = ' // dm_itoa(GRC_EDM_SIGN_LOW_ERR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_DIL_ERR = ' // dm_itoa(GRC_EDM_DIL_ERR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_SIGN_HIGH_ERR = ' // dm_itoa(GRC_EDM_SIGN_HIGH_ERR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_TIMEOUT = ' // dm_itoa(GRC_EDM_TIMEOUT)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_FLUKT_ERR = ' // dm_itoa(GRC_EDM_FLUKT_ERR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_FMOT_ERR = ' // dm_itoa(GRC_EDM_FMOT_ERR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_DEV_NOT_INSTALLED = ' // dm_itoa(GRC_EDM_DEV_NOT_INSTALLED)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_NOT_FOUND = ' // dm_itoa(GRC_EDM_NOT_FOUND)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_ERROR_RECEIVED = ' // dm_itoa(GRC_EDM_ERROR_RECEIVED)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_MISSING_SRVPWD = ' // dm_itoa(GRC_EDM_MISSING_SRVPWD)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_INVALID_ANSWER = ' // dm_itoa(GRC_EDM_INVALID_ANSWER)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_SEND_ERR = ' // dm_itoa(GRC_EDM_SEND_ERR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_RECEIVE_ERR = ' // dm_itoa(GRC_EDM_RECEIVE_ERR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_INTERNAL_ERR = ' // dm_itoa(GRC_EDM_INTERNAL_ERR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_BUSY = ' // dm_itoa(GRC_EDM_BUSY)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_NO_MEASACTIVITY = ' // dm_itoa(GRC_EDM_NO_MEASACTIVITY)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_CHKSUM_ERR = ' // dm_itoa(GRC_EDM_CHKSUM_ERR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_INIT_OR_STOP_ERR = ' // dm_itoa(GRC_EDM_INIT_OR_STOP_ERR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_SRL_NOT_AVAILABLE = ' // dm_itoa(GRC_EDM_SRL_NOT_AVAILABLE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_MEAS_ABORTED = ' // dm_itoa(GRC_EDM_MEAS_ABORTED)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_SLDR_TRANSFER_PENDING = ' // dm_itoa(GRC_EDM_SLDR_TRANSFER_PENDING)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_SLDR_TRANSFER_ILLEGAL = ' // dm_itoa(GRC_EDM_SLDR_TRANSFER_ILLEGAL)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_SLDR_DATA_ERROR = ' // dm_itoa(GRC_EDM_SLDR_DATA_ERROR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_SLDR_CHK_SUM_ERROR = ' // dm_itoa(GRC_EDM_SLDR_CHK_SUM_ERROR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_SLDR_ADDR_ERROR = ' // dm_itoa(GRC_EDM_SLDR_ADDR_ERROR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_SLDR_INV_LOADFILE = ' // dm_itoa(GRC_EDM_SLDR_INV_LOADFILE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_SLDR_UNSUPPORTED = ' // dm_itoa(GRC_EDM_SLDR_UNSUPPORTED)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_UNKNOW_ERR = ' // dm_itoa(GRC_EDM_UNKNOW_ERR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_DISTRANGE_ERR = ' // dm_itoa(GRC_EDM_DISTRANGE_ERR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_SIGNTONOISE_ERR = ' // dm_itoa(GRC_EDM_SIGNTONOISE_ERR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_NOISEHIGH_ERR = ' // dm_itoa(GRC_EDM_NOISEHIGH_ERR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_PWD_NOTSET = ' // dm_itoa(GRC_EDM_PWD_NOTSET)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_ACTION_NO_MORE_VALID = ' // dm_itoa(GRC_EDM_ACTION_NO_MORE_VALID)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_MULTRG_ERR = ' // dm_itoa(GRC_EDM_MULTRG_ERR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_MISSING_EE_CONSTS = ' // dm_itoa(GRC_EDM_MISSING_EE_CONSTS)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_NOPRECISE = ' // dm_itoa(GRC_EDM_NOPRECISE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_EDM_MEAS_DIST_NOT_ALLOWED = ' // dm_itoa(GRC_EDM_MEAS_DIST_NOT_ALLOWED)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_GMF = ' // dm_itoa(GRC_GMF)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_GMF_WRONG_AREA_DEF = ' // dm_itoa(GRC_GMF_WRONG_AREA_DEF)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_GMF_IDENTICAL_PTS = ' // dm_itoa(GRC_GMF_IDENTICAL_PTS)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_GMF_PTS_IN_LINE = ' // dm_itoa(GRC_GMF_PTS_IN_LINE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_GMF_OUT_OF_RANGE = ' // dm_itoa(GRC_GMF_OUT_OF_RANGE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_GMF_PLAUSIBILITY_ERR = ' // dm_itoa(GRC_GMF_PLAUSIBILITY_ERR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_GMF_TOO_FEW_OBSERVATIONS = ' // dm_itoa(GRC_GMF_TOO_FEW_OBSERVATIONS)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_GMF_NO_SOLUTION = ' // dm_itoa(GRC_GMF_NO_SOLUTION)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_GMF_ONE_SOLUTION = ' // dm_itoa(GRC_GMF_ONE_SOLUTION)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_GMF_TWO_SOLUTIONS = ' // dm_itoa(GRC_GMF_TWO_SOLUTIONS)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_GMF_ANGLE_SMALLER_15GON = ' // dm_itoa(GRC_GMF_ANGLE_SMALLER_15GON)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_GMF_INVALID_TRIANGLE_TYPE = ' // dm_itoa(GRC_GMF_INVALID_TRIANGLE_TYPE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_GMF_INVALID_ANGLE_SYSTEM = ' // dm_itoa(GRC_GMF_INVALID_ANGLE_SYSTEM)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_GMF_INVALID_DIST_SYSTEM = ' // dm_itoa(GRC_GMF_INVALID_DIST_SYSTEM)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_GMF_INVALID_V_SYSTEM = ' // dm_itoa(GRC_GMF_INVALID_V_SYSTEM)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_GMF_INVALID_TEMP_SYSTEM = ' // dm_itoa(GRC_GMF_INVALID_TEMP_SYSTEM)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_GMF_INVALID_PRES_SYSTEM = ' // dm_itoa(GRC_GMF_INVALID_PRES_SYSTEM)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_GMF_RADIUS_NOT_POSSIBLE = ' // dm_itoa(GRC_GMF_RADIUS_NOT_POSSIBLE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_GMF_NO_PROVISIONAL_VALUES = ' // dm_itoa(GRC_GMF_NO_PROVISIONAL_VALUES)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_GMF_SINGULAR_MATRIX = ' // dm_itoa(GRC_GMF_SINGULAR_MATRIX)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_GMF_TOO_MANY_ITERATIONS = ' // dm_itoa(GRC_GMF_TOO_MANY_ITERATIONS)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_GMF_IDENTICAL_TIE_POINTS = ' // dm_itoa(GRC_GMF_IDENTICAL_TIE_POINTS)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_GMF_SETUP_EQUALS_TIE_POINT = ' // dm_itoa(GRC_GMF_SETUP_EQUALS_TIE_POINT)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_TMC = ' // dm_itoa(GRC_TMC)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_TMC_NO_FULL_CORRECTION = ' // dm_itoa(GRC_TMC_NO_FULL_CORRECTION)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_TMC_ACCURACY_GUARANTEE = ' // dm_itoa(GRC_TMC_ACCURACY_GUARANTEE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_TMC_ANGLE_OK = ' // dm_itoa(GRC_TMC_ANGLE_OK)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_TMC_ANGLE_NOT_FULL_CORR = ' // dm_itoa(GRC_TMC_ANGLE_NOT_FULL_CORR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_TMC_ANGLE_NO_ACC_GUARANTY = ' // dm_itoa(GRC_TMC_ANGLE_NO_ACC_GUARANTY)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_TMC_ANGLE_ERROR = ' // dm_itoa(GRC_TMC_ANGLE_ERROR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_TMC_DIST_PPM = ' // dm_itoa(GRC_TMC_DIST_PPM)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_TMC_DIST_ERROR = ' // dm_itoa(GRC_TMC_DIST_ERROR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_TMC_BUSY = ' // dm_itoa(GRC_TMC_BUSY)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_TMC_SIGNAL_ERROR = ' // dm_itoa(GRC_TMC_SIGNAL_ERROR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_MOT_UNREADY = ' // dm_itoa(GRC_MOT_UNREADY)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_MOT_BUSY = ' // dm_itoa(GRC_MOT_BUSY)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_MOT_NOT_OCONST = ' // dm_itoa(GRC_MOT_NOT_OCONST)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_MOT_NOT_CONFIG = ' // dm_itoa(GRC_MOT_NOT_CONFIG)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_MOT_NOT_POSIT = ' // dm_itoa(GRC_MOT_NOT_POSIT)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_MOT_NOT_SERVICE = ' // dm_itoa(GRC_MOT_NOT_SERVICE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_MOT_NOT_BUSY = ' // dm_itoa(GRC_MOT_NOT_BUSY)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_MOT_NOT_LOCK = ' // dm_itoa(GRC_MOT_NOT_LOCK)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_MOT_NOT_SPIRAL = ' // dm_itoa(GRC_MOT_NOT_SPIRAL)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_MOT_V_ENCODER = ' // dm_itoa(GRC_MOT_V_ENCODER)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_MOT_HZ_ENCODER = ' // dm_itoa(GRC_MOT_HZ_ENCODER)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_MOT_HZ_V_ENCODER = ' // dm_itoa(GRC_MOT_HZ_V_ENCODER)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_BMM = ' // dm_itoa(GRC_BMM)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_BMM_XFER_PENDING = ' // dm_itoa(GRC_BMM_XFER_PENDING)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_BMM_NO_XFER_OPEN = ' // dm_itoa(GRC_BMM_NO_XFER_OPEN)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_BMM_UNKNOWN_CHARSET = ' // dm_itoa(GRC_BMM_UNKNOWN_CHARSET)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_BMM_NOT_INSTALLED = ' // dm_itoa(GRC_BMM_NOT_INSTALLED)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_BMM_ALREADY_EXIST = ' // dm_itoa(GRC_BMM_ALREADY_EXIST)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_BMM_CANT_DELETE = ' // dm_itoa(GRC_BMM_CANT_DELETE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_BMM_MEM_ERROR = ' // dm_itoa(GRC_BMM_MEM_ERROR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_BMM_CHARSET_USED = ' // dm_itoa(GRC_BMM_CHARSET_USED)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_BMM_CHARSET_SAVED = ' // dm_itoa(GRC_BMM_CHARSET_SAVED)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_BMM_INVALID_ADR = ' // dm_itoa(GRC_BMM_INVALID_ADR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_BMM_CANCELANDADR_ERROR = ' // dm_itoa(GRC_BMM_CANCELANDADR_ERROR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_BMM_INVALID_SIZE = ' // dm_itoa(GRC_BMM_INVALID_SIZE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_BMM_CANCELANDINVSIZE_ERROR = ' // dm_itoa(GRC_BMM_CANCELANDINVSIZE_ERROR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_BMM_ALL_GROUP_OCC = ' // dm_itoa(GRC_BMM_ALL_GROUP_OCC)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_BMM_CANT_DEL_LAYERS = ' // dm_itoa(GRC_BMM_CANT_DEL_LAYERS)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_BMM_UNKNOWN_LAYER = ' // dm_itoa(GRC_BMM_UNKNOWN_LAYER)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_BMM_INVALID_LAYERLEN = ' // dm_itoa(GRC_BMM_INVALID_LAYERLEN)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_COM_ERO = ' // dm_itoa(GRC_COM_ERO)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_COM_CANT_ENCODE = ' // dm_itoa(GRC_COM_CANT_ENCODE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_COM_CANT_DECODE = ' // dm_itoa(GRC_COM_CANT_DECODE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_COM_CANT_SEND = ' // dm_itoa(GRC_COM_CANT_SEND)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_COM_CANT_RECV = ' // dm_itoa(GRC_COM_CANT_RECV)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_COM_TIMEDOUT = ' // dm_itoa(GRC_COM_TIMEDOUT)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_COM_WRONG_FORMAT = ' // dm_itoa(GRC_COM_WRONG_FORMAT)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_COM_VER_MISMATCH = ' // dm_itoa(GRC_COM_VER_MISMATCH)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_COM_CANT_DECODE_REQ = ' // dm_itoa(GRC_COM_CANT_DECODE_REQ)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_COM_PROC_UNAVAIL = ' // dm_itoa(GRC_COM_PROC_UNAVAIL)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_COM_CANT_ENCODE_REP = ' // dm_itoa(GRC_COM_CANT_ENCODE_REP)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_COM_SYSTEM_ERR = ' // dm_itoa(GRC_COM_SYSTEM_ERR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_COM_FAILED = ' // dm_itoa(GRC_COM_FAILED)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_COM_NO_BINARY = ' // dm_itoa(GRC_COM_NO_BINARY)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_COM_INTR = ' // dm_itoa(GRC_COM_INTR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_COM_REQUIRES_8DBITS = ' // dm_itoa(GRC_COM_REQUIRES_8DBITS)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_COM_TR_ID_MISMATCH = ' // dm_itoa(GRC_COM_TR_ID_MISMATCH)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_COM_NOT_GEOCOM = ' // dm_itoa(GRC_COM_NOT_GEOCOM)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_COM_UNKNOWN_PORT = ' // dm_itoa(GRC_COM_UNKNOWN_PORT)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_COM_ERO_END = ' // dm_itoa(GRC_COM_ERO_END)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_COM_OVERRUN = ' // dm_itoa(GRC_COM_OVERRUN)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_COM_SRVR_RX_CHECKSUM_ERRR = ' // dm_itoa(GRC_COM_SRVR_RX_CHECKSUM_ERRR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_COM_CLNT_RX_CHECKSUM_ERRR = ' // dm_itoa(GRC_COM_CLNT_RX_CHECKSUM_ERRR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_COM_PORT_NOT_AVAILABLE = ' // dm_itoa(GRC_COM_PORT_NOT_AVAILABLE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_COM_PORT_NOT_OPEN = ' // dm_itoa(GRC_COM_PORT_NOT_OPEN)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_COM_NO_PARTNER = ' // dm_itoa(GRC_COM_NO_PARTNER)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_COM_ERO_NOT_STARTED = ' // dm_itoa(GRC_COM_ERO_NOT_STARTED)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_COM_CONS_REQ = ' // dm_itoa(GRC_COM_CONS_REQ)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_COM_SRVR_IS_SLEEPING = ' // dm_itoa(GRC_COM_SRVR_IS_SLEEPING)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_COM_SRVR_IS_OFF = ' // dm_itoa(GRC_COM_SRVR_IS_OFF)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_COM_NO_CHECKSUM = ' // dm_itoa(GRC_COM_NO_CHECKSUM)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_AUT_TIMEOUT = ' // dm_itoa(GRC_AUT_TIMEOUT)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_AUT_DETENT_ERROR = ' // dm_itoa(GRC_AUT_DETENT_ERROR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_AUT_ANGLE_ERROR = ' // dm_itoa(GRC_AUT_ANGLE_ERROR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_AUT_MOTOR_ERROR = ' // dm_itoa(GRC_AUT_MOTOR_ERROR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_AUT_INCACC = ' // dm_itoa(GRC_AUT_INCACC)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_AUT_DEV_ERROR = ' // dm_itoa(GRC_AUT_DEV_ERROR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_AUT_NO_TARGET = ' // dm_itoa(GRC_AUT_NO_TARGET)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_AUT_MULTIPLE_TARGETS = ' // dm_itoa(GRC_AUT_MULTIPLE_TARGETS)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_AUT_BAD_ENVIRONMENT = ' // dm_itoa(GRC_AUT_BAD_ENVIRONMENT)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_AUT_DETECTOR_ERROR = ' // dm_itoa(GRC_AUT_DETECTOR_ERROR)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_AUT_NOT_ENABLED = ' // dm_itoa(GRC_AUT_NOT_ENABLED)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_AUT_CALACC = ' // dm_itoa(GRC_AUT_CALACC)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_AUT_ACCURACY = ' // dm_itoa(GRC_AUT_ACCURACY)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_AUT_DIST_STARTED = ' // dm_itoa(GRC_AUT_DIST_STARTED)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_AUT_SUPPLY_TOO_HIGH = ' // dm_itoa(GRC_AUT_SUPPLY_TOO_HIGH)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_AUT_SUPPLY_TOO_LOW = ' // dm_itoa(GRC_AUT_SUPPLY_TOO_LOW)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_AUT_NO_WORKING_AREA = ' // dm_itoa(GRC_AUT_NO_WORKING_AREA)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_AUT_ARRAY_FULL = ' // dm_itoa(GRC_AUT_ARRAY_FULL)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_AUT_NO_DATA = ' // dm_itoa(GRC_AUT_NO_DATA)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_KDM_NOT_AVAILABLE = ' // dm_itoa(GRC_KDM_NOT_AVAILABLE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_FTR_FILEACCESS = ' // dm_itoa(GRC_FTR_FILEACCESS)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_FTR_WRONGFILEBLOCKNUMBER = ' // dm_itoa(GRC_FTR_WRONGFILEBLOCKNUMBER)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_FTR_NOTENOUGHSPACE = ' // dm_itoa(GRC_FTR_NOTENOUGHSPACE)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_FTR_INVALIDINPUT = ' // dm_itoa(GRC_FTR_INVALIDINPUT)); if (dm_is_error(rc)) return - rc = dm_lua_eval(lua, 'GRC_FTR_MISSINGSETUP = ' // dm_itoa(GRC_FTR_MISSINGSETUP)); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_OK', GRC_OK); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_UNDEFINED', GRC_UNDEFINED); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_IVPARAM', GRC_IVPARAM); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_IVRESULT', GRC_IVRESULT); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_FATAL', GRC_FATAL); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_NOT_IMPL', GRC_NOT_IMPL); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_TIME_OUT', GRC_TIME_OUT); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_SET_INCOMPL', GRC_SET_INCOMPL); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ABORT', GRC_ABORT); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_NOMEMORY', GRC_NOMEMORY); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_NOTINIT', GRC_NOTINIT); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_SHUT_DOWN', GRC_SHUT_DOWN); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_SYSBUSY', GRC_SYSBUSY); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_HWFAILURE', GRC_HWFAILURE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ABORT_APPL', GRC_ABORT_APPL); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_LOW_POWER', GRC_LOW_POWER); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_IVVERSION', GRC_IVVERSION); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_BAT_EMPTY', GRC_BAT_EMPTY); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_NO_EVENT', GRC_NO_EVENT); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_OUT_OF_TEMP', GRC_OUT_OF_TEMP); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_INSTRUMENT_TILT', GRC_INSTRUMENT_TILT); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_COM_SETTING', GRC_COM_SETTING); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_NO_ACTION', GRC_NO_ACTION); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_SLEEP_MODE', GRC_SLEEP_MODE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_NOTOK', GRC_NOTOK); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_NA', GRC_NA); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_OVERFLOW', GRC_OVERFLOW); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_STOPPED', GRC_STOPPED); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG', GRC_ANG); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_ERROR', GRC_ANG_ERROR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_INCL_ERROR', GRC_ANG_INCL_ERROR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_BAD_ACC', GRC_ANG_BAD_ACC); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_BAD_ANGLE_ACC', GRC_ANG_BAD_ANGLE_ACC); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_BAD_INCLIN_ACC', GRC_ANG_BAD_INCLIN_ACC); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_WRITE_PROTECTED', GRC_ANG_WRITE_PROTECTED); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_OUT_OF_RANGE', GRC_ANG_OUT_OF_RANGE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_IR_OCCURED', GRC_ANG_IR_OCCURED); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_HZ_MOVED', GRC_ANG_HZ_MOVED); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_OS_ERROR', GRC_ANG_OS_ERROR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_DATA_ERROR', GRC_ANG_DATA_ERROR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_PEAK_CNT_UFL', GRC_ANG_PEAK_CNT_UFL); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_TIME_OUT', GRC_ANG_TIME_OUT); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_TOO_MANY_EXPOS', GRC_ANG_TOO_MANY_EXPOS); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_PIX_CTRL_ERR', GRC_ANG_PIX_CTRL_ERR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_MAX_POS_SKIP', GRC_ANG_MAX_POS_SKIP); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_MAX_NEG_SKIP', GRC_ANG_MAX_NEG_SKIP); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_EXP_LIMIT', GRC_ANG_EXP_LIMIT); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_UNDER_EXPOSURE', GRC_ANG_UNDER_EXPOSURE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_OVER_EXPOSURE', GRC_ANG_OVER_EXPOSURE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_TMANY_PEAKS', GRC_ANG_TMANY_PEAKS); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_TLESS_PEAKS', GRC_ANG_TLESS_PEAKS); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_PEAK_TOO_SLIM', GRC_ANG_PEAK_TOO_SLIM); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_PEAK_TOO_WIDE', GRC_ANG_PEAK_TOO_WIDE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_BAD_PEAKDIFF', GRC_ANG_BAD_PEAKDIFF); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_UNDER_EXP_PICT', GRC_ANG_UNDER_EXP_PICT); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_PEAKS_INHOMOGEN', GRC_ANG_PEAKS_INHOMOGEN); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_NO_DECOD_POSS', GRC_ANG_NO_DECOD_POSS); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_UNSTABLE_DECOD', GRC_ANG_UNSTABLE_DECOD); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_TLESS_FPEAKS', GRC_ANG_TLESS_FPEAKS); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_INCL_OLD_PLANE', GRC_ANG_INCL_OLD_PLANE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_INCL_NO_PLANE', GRC_ANG_INCL_NO_PLANE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_FAST_ANG_ERR', GRC_ANG_FAST_ANG_ERR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_FAST_ANG_ERR_5', GRC_ANG_FAST_ANG_ERR_5); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_FAST_ANG_ERR_25', GRC_ANG_FAST_ANG_ERR_25); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_TRANS_ERR', GRC_ANG_TRANS_ERR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_TRANS_ERR_5', GRC_ANG_TRANS_ERR_5); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ANG_TRANS_ERR_25', GRC_ANG_TRANS_ERR_25); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ATA_NOT_READY', GRC_ATA_NOT_READY); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ATA_NO_RESULT', GRC_ATA_NO_RESULT); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ATA_SEVERAL_TARGETS', GRC_ATA_SEVERAL_TARGETS); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ATA_BIG_SPOT', GRC_ATA_BIG_SPOT); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ATA_BACKGROUND', GRC_ATA_BACKGROUND); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ATA_NO_TARGETS', GRC_ATA_NO_TARGETS); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ATA_NOT_ACCURAT', GRC_ATA_NOT_ACCURAT); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ATA_SPOT_ON_EDGE', GRC_ATA_SPOT_ON_EDGE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ATA_BLOOMING', GRC_ATA_BLOOMING); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ATA_NOT_BUSY', GRC_ATA_NOT_BUSY); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ATA_STRANGE_LIGHT', GRC_ATA_STRANGE_LIGHT); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ATA_V24_FAIL', GRC_ATA_V24_FAIL); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ATA_DECODE_ERROR', GRC_ATA_DECODE_ERROR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ATA_HZ_FAIL', GRC_ATA_HZ_FAIL); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ATA_V_FAIL', GRC_ATA_V_FAIL); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ATA_HZ_STRANGE_L', GRC_ATA_HZ_STRANGE_L); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ATA_V_STRANGE_L', GRC_ATA_V_STRANGE_L); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ATA_SLDR_TRANSFER_PENDING', GRC_ATA_SLDR_TRANSFER_PENDING); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ATA_SLDR_TRANSFER_ILLEGAL', GRC_ATA_SLDR_TRANSFER_ILLEGAL); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ATA_SLDR_DATA_ERROR', GRC_ATA_SLDR_DATA_ERROR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ATA_SLDR_CHK_SUM_ERROR', GRC_ATA_SLDR_CHK_SUM_ERROR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ATA_SLDR_ADDRESS_ERROR', GRC_ATA_SLDR_ADDRESS_ERROR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ATA_SLDR_INV_LOADFILE', GRC_ATA_SLDR_INV_LOADFILE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ATA_SLDR_UNSUPPORTED', GRC_ATA_SLDR_UNSUPPORTED); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ATA_PS_NOT_READY', GRC_ATA_PS_NOT_READY); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_ATA_ATR_SYSTEM_ERR', GRC_ATA_ATR_SYSTEM_ERR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM', GRC_EDM); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_SYSTEM_ERR', GRC_EDM_SYSTEM_ERR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_INVALID_COMMAND', GRC_EDM_INVALID_COMMAND); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_BOOM_ERR', GRC_EDM_BOOM_ERR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_SIGN_LOW_ERR', GRC_EDM_SIGN_LOW_ERR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_DIL_ERR', GRC_EDM_DIL_ERR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_SIGN_HIGH_ERR', GRC_EDM_SIGN_HIGH_ERR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_TIMEOUT', GRC_EDM_TIMEOUT); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_FLUKT_ERR', GRC_EDM_FLUKT_ERR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_FMOT_ERR', GRC_EDM_FMOT_ERR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_DEV_NOT_INSTALLED', GRC_EDM_DEV_NOT_INSTALLED); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_NOT_FOUND', GRC_EDM_NOT_FOUND); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_ERROR_RECEIVED', GRC_EDM_ERROR_RECEIVED); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_MISSING_SRVPWD', GRC_EDM_MISSING_SRVPWD); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_INVALID_ANSWER', GRC_EDM_INVALID_ANSWER); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_SEND_ERR', GRC_EDM_SEND_ERR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_RECEIVE_ERR', GRC_EDM_RECEIVE_ERR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_INTERNAL_ERR', GRC_EDM_INTERNAL_ERR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_BUSY', GRC_EDM_BUSY); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_NO_MEASACTIVITY', GRC_EDM_NO_MEASACTIVITY); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_CHKSUM_ERR', GRC_EDM_CHKSUM_ERR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_INIT_OR_STOP_ERR', GRC_EDM_INIT_OR_STOP_ERR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_SRL_NOT_AVAILABLE', GRC_EDM_SRL_NOT_AVAILABLE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_MEAS_ABORTED', GRC_EDM_MEAS_ABORTED); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_SLDR_TRANSFER_PENDING', GRC_EDM_SLDR_TRANSFER_PENDING); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_SLDR_TRANSFER_ILLEGAL', GRC_EDM_SLDR_TRANSFER_ILLEGAL); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_SLDR_DATA_ERROR', GRC_EDM_SLDR_DATA_ERROR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_SLDR_CHK_SUM_ERROR', GRC_EDM_SLDR_CHK_SUM_ERROR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_SLDR_ADDR_ERROR', GRC_EDM_SLDR_ADDR_ERROR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_SLDR_INV_LOADFILE', GRC_EDM_SLDR_INV_LOADFILE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_SLDR_UNSUPPORTED', GRC_EDM_SLDR_UNSUPPORTED); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_UNKNOW_ERR', GRC_EDM_UNKNOW_ERR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_DISTRANGE_ERR', GRC_EDM_DISTRANGE_ERR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_SIGNTONOISE_ERR', GRC_EDM_SIGNTONOISE_ERR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_NOISEHIGH_ERR', GRC_EDM_NOISEHIGH_ERR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_PWD_NOTSET', GRC_EDM_PWD_NOTSET); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_ACTION_NO_MORE_VALID', GRC_EDM_ACTION_NO_MORE_VALID); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_MULTRG_ERR', GRC_EDM_MULTRG_ERR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_MISSING_EE_CONSTS', GRC_EDM_MISSING_EE_CONSTS); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_NOPRECISE', GRC_EDM_NOPRECISE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_EDM_MEAS_DIST_NOT_ALLOWED', GRC_EDM_MEAS_DIST_NOT_ALLOWED); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_GMF', GRC_GMF); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_GMF_WRONG_AREA_DEF', GRC_GMF_WRONG_AREA_DEF); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_GMF_IDENTICAL_PTS', GRC_GMF_IDENTICAL_PTS); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_GMF_PTS_IN_LINE', GRC_GMF_PTS_IN_LINE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_GMF_OUT_OF_RANGE', GRC_GMF_OUT_OF_RANGE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_GMF_PLAUSIBILITY_ERR', GRC_GMF_PLAUSIBILITY_ERR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_GMF_TOO_FEW_OBSERVATIONS', GRC_GMF_TOO_FEW_OBSERVATIONS); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_GMF_NO_SOLUTION', GRC_GMF_NO_SOLUTION); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_GMF_ONE_SOLUTION', GRC_GMF_ONE_SOLUTION); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_GMF_TWO_SOLUTIONS', GRC_GMF_TWO_SOLUTIONS); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_GMF_ANGLE_SMALLER_15GON', GRC_GMF_ANGLE_SMALLER_15GON); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_GMF_INVALID_TRIANGLE_TYPE', GRC_GMF_INVALID_TRIANGLE_TYPE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_GMF_INVALID_ANGLE_SYSTEM', GRC_GMF_INVALID_ANGLE_SYSTEM); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_GMF_INVALID_DIST_SYSTEM', GRC_GMF_INVALID_DIST_SYSTEM); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_GMF_INVALID_V_SYSTEM', GRC_GMF_INVALID_V_SYSTEM); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_GMF_INVALID_TEMP_SYSTEM', GRC_GMF_INVALID_TEMP_SYSTEM); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_GMF_INVALID_PRES_SYSTEM', GRC_GMF_INVALID_PRES_SYSTEM); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_GMF_RADIUS_NOT_POSSIBLE', GRC_GMF_RADIUS_NOT_POSSIBLE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_GMF_NO_PROVISIONAL_VALUES', GRC_GMF_NO_PROVISIONAL_VALUES); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_GMF_SINGULAR_MATRIX', GRC_GMF_SINGULAR_MATRIX); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_GMF_TOO_MANY_ITERATIONS', GRC_GMF_TOO_MANY_ITERATIONS); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_GMF_IDENTICAL_TIE_POINTS', GRC_GMF_IDENTICAL_TIE_POINTS); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_GMF_SETUP_EQUALS_TIE_POINT', GRC_GMF_SETUP_EQUALS_TIE_POINT); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_TMC', GRC_TMC); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_TMC_NO_FULL_CORRECTION', GRC_TMC_NO_FULL_CORRECTION); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_TMC_ACCURACY_GUARANTEE', GRC_TMC_ACCURACY_GUARANTEE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_TMC_ANGLE_OK', GRC_TMC_ANGLE_OK); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_TMC_ANGLE_NOT_FULL_CORR', GRC_TMC_ANGLE_NOT_FULL_CORR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_TMC_ANGLE_NO_ACC_GUARANTY', GRC_TMC_ANGLE_NO_ACC_GUARANTY); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_TMC_ANGLE_ERROR', GRC_TMC_ANGLE_ERROR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_TMC_DIST_PPM', GRC_TMC_DIST_PPM); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_TMC_DIST_ERROR', GRC_TMC_DIST_ERROR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_TMC_BUSY', GRC_TMC_BUSY); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_TMC_SIGNAL_ERROR', GRC_TMC_SIGNAL_ERROR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_MOT_UNREADY', GRC_MOT_UNREADY); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_MOT_BUSY', GRC_MOT_BUSY); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_MOT_NOT_OCONST', GRC_MOT_NOT_OCONST); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_MOT_NOT_CONFIG', GRC_MOT_NOT_CONFIG); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_MOT_NOT_POSIT', GRC_MOT_NOT_POSIT); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_MOT_NOT_SERVICE', GRC_MOT_NOT_SERVICE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_MOT_NOT_BUSY', GRC_MOT_NOT_BUSY); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_MOT_NOT_LOCK', GRC_MOT_NOT_LOCK); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_MOT_NOT_SPIRAL', GRC_MOT_NOT_SPIRAL); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_MOT_V_ENCODER', GRC_MOT_V_ENCODER); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_MOT_HZ_ENCODER', GRC_MOT_HZ_ENCODER); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_MOT_HZ_V_ENCODER', GRC_MOT_HZ_V_ENCODER); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_BMM', GRC_BMM); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_BMM_XFER_PENDING', GRC_BMM_XFER_PENDING); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_BMM_NO_XFER_OPEN', GRC_BMM_NO_XFER_OPEN); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_BMM_UNKNOWN_CHARSET', GRC_BMM_UNKNOWN_CHARSET); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_BMM_NOT_INSTALLED', GRC_BMM_NOT_INSTALLED); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_BMM_ALREADY_EXIST', GRC_BMM_ALREADY_EXIST); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_BMM_CANT_DELETE', GRC_BMM_CANT_DELETE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_BMM_MEM_ERROR', GRC_BMM_MEM_ERROR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_BMM_CHARSET_USED', GRC_BMM_CHARSET_USED); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_BMM_CHARSET_SAVED', GRC_BMM_CHARSET_SAVED); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_BMM_INVALID_ADR', GRC_BMM_INVALID_ADR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_BMM_CANCELANDADR_ERROR', GRC_BMM_CANCELANDADR_ERROR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_BMM_INVALID_SIZE', GRC_BMM_INVALID_SIZE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_BMM_CANCELANDINVSIZE_ERROR', GRC_BMM_CANCELANDINVSIZE_ERROR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_BMM_ALL_GROUP_OCC', GRC_BMM_ALL_GROUP_OCC); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_BMM_CANT_DEL_LAYERS', GRC_BMM_CANT_DEL_LAYERS); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_BMM_UNKNOWN_LAYER', GRC_BMM_UNKNOWN_LAYER); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_BMM_INVALID_LAYERLEN', GRC_BMM_INVALID_LAYERLEN); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_COM_ERO', GRC_COM_ERO); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_COM_CANT_ENCODE', GRC_COM_CANT_ENCODE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_COM_CANT_DECODE', GRC_COM_CANT_DECODE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_COM_CANT_SEND', GRC_COM_CANT_SEND); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_COM_CANT_RECV', GRC_COM_CANT_RECV); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_COM_TIMEDOUT', GRC_COM_TIMEDOUT); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_COM_WRONG_FORMAT', GRC_COM_WRONG_FORMAT); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_COM_VER_MISMATCH', GRC_COM_VER_MISMATCH); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_COM_CANT_DECODE_REQ', GRC_COM_CANT_DECODE_REQ); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_COM_PROC_UNAVAIL', GRC_COM_PROC_UNAVAIL); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_COM_CANT_ENCODE_REP', GRC_COM_CANT_ENCODE_REP); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_COM_SYSTEM_ERR', GRC_COM_SYSTEM_ERR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_COM_FAILED', GRC_COM_FAILED); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_COM_NO_BINARY', GRC_COM_NO_BINARY); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_COM_INTR', GRC_COM_INTR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_COM_REQUIRES_8DBITS', GRC_COM_REQUIRES_8DBITS); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_COM_TR_ID_MISMATCH', GRC_COM_TR_ID_MISMATCH); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_COM_NOT_GEOCOM', GRC_COM_NOT_GEOCOM); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_COM_UNKNOWN_PORT', GRC_COM_UNKNOWN_PORT); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_COM_ERO_END', GRC_COM_ERO_END); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_COM_OVERRUN', GRC_COM_OVERRUN); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_COM_SRVR_RX_CHECKSUM_ERRR', GRC_COM_SRVR_RX_CHECKSUM_ERRR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_COM_CLNT_RX_CHECKSUM_ERRR', GRC_COM_CLNT_RX_CHECKSUM_ERRR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_COM_PORT_NOT_AVAILABLE', GRC_COM_PORT_NOT_AVAILABLE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_COM_PORT_NOT_OPEN', GRC_COM_PORT_NOT_OPEN); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_COM_NO_PARTNER', GRC_COM_NO_PARTNER); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_COM_ERO_NOT_STARTED', GRC_COM_ERO_NOT_STARTED); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_COM_CONS_REQ', GRC_COM_CONS_REQ); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_COM_SRVR_IS_SLEEPING', GRC_COM_SRVR_IS_SLEEPING); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_COM_SRVR_IS_OFF', GRC_COM_SRVR_IS_OFF); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_COM_NO_CHECKSUM', GRC_COM_NO_CHECKSUM); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_AUT_TIMEOUT', GRC_AUT_TIMEOUT); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_AUT_DETENT_ERROR', GRC_AUT_DETENT_ERROR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_AUT_ANGLE_ERROR', GRC_AUT_ANGLE_ERROR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_AUT_MOTOR_ERROR', GRC_AUT_MOTOR_ERROR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_AUT_INCACC', GRC_AUT_INCACC); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_AUT_DEV_ERROR', GRC_AUT_DEV_ERROR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_AUT_NO_TARGET', GRC_AUT_NO_TARGET); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_AUT_MULTIPLE_TARGETS', GRC_AUT_MULTIPLE_TARGETS); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_AUT_BAD_ENVIRONMENT', GRC_AUT_BAD_ENVIRONMENT); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_AUT_DETECTOR_ERROR', GRC_AUT_DETECTOR_ERROR); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_AUT_NOT_ENABLED', GRC_AUT_NOT_ENABLED); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_AUT_CALACC', GRC_AUT_CALACC); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_AUT_ACCURACY', GRC_AUT_ACCURACY); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_AUT_DIST_STARTED', GRC_AUT_DIST_STARTED); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_AUT_SUPPLY_TOO_HIGH', GRC_AUT_SUPPLY_TOO_HIGH); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_AUT_SUPPLY_TOO_LOW', GRC_AUT_SUPPLY_TOO_LOW); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_AUT_NO_WORKING_AREA', GRC_AUT_NO_WORKING_AREA); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_AUT_ARRAY_FULL', GRC_AUT_ARRAY_FULL); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_AUT_NO_DATA', GRC_AUT_NO_DATA); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_KDM_NOT_AVAILABLE', GRC_KDM_NOT_AVAILABLE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_FTR_FILEACCESS', GRC_FTR_FILEACCESS); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_FTR_WRONGFILEBLOCKNUMBER', GRC_FTR_WRONGFILEBLOCKNUMBER); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_FTR_NOTENOUGHSPACE', GRC_FTR_NOTENOUGHSPACE); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_FTR_INVALIDINPUT', GRC_FTR_INVALIDINPUT); if (dm_is_error(rc)) return + rc = dm_lua_set(lua, 'GRC_FTR_MISSINGSETUP', GRC_FTR_MISSINGSETUP); if (dm_is_error(rc)) return end if rc = E_NONE diff --git a/src/dm_modbus.f90 b/src/dm_modbus.f90 index 4d2e053..aefa3d6 100644 --- a/src/dm_modbus.f90 +++ b/src/dm_modbus.f90 @@ -125,24 +125,24 @@ module dm_modbus ! ****************************************************************** ! PUBLIC FUNCTIONS. ! ****************************************************************** - integer function dm_modbus_byte_order_from_name(string, byte_order) result(rc) + integer function dm_modbus_byte_order_from_name(name, byte_order) result(rc) !! Returns byte order named parameter associated with given string. !! Sets argument `byte_order` to `MODBUS_REAL_ACBD` if `string` is - !! `abcd` or `ABCD`. Returns `E_INVALID` and sets `byte_order` to - !! `MODBUS_REAL_ABCD` if the string is invalid. + !! `ABCD` (case insensitive). Returns `E_INVALID` and sets `byte_order` + !! to `MODBUS_REAL_ABCD` if the string is invalid. use :: dm_string, only: dm_string_upper - character(len=*), intent(in) :: string !! Input string. + character(len=*), intent(in) :: name !! Input string. integer, intent(out) :: byte_order !! Byte order of real values. - character(len=4) :: string_ + character(len=4) :: name_ rc = E_NONE - ! Normalise string. - string_ = dm_string_upper(string) + ! Normalise name. + name_ = dm_string_upper(name) - select case (string_) + select case (name_) case ('ABCD') byte_order = MODBUS_REAL_ABCD case ('BADC') @@ -447,13 +447,8 @@ integer function dm_modbus_set_debug(modbus, debug) result(rc) type(modbus_type), intent(inout) :: modbus !! Modbus type. logical, intent(in) :: debug !! Enable debug mode. - integer :: debug_ - - debug_ = dm_f_c_logical(debug) - rc = E_MODBUS - if (modbus_set_debug(modbus%ctx, debug_) == -1) return - + if (modbus_set_debug(modbus%ctx, dm_f_c_logical(debug)) == -1) return rc = E_NONE end function dm_modbus_set_debug @@ -503,7 +498,7 @@ end function dm_modbus_set_slave function dm_modbus_version(name) result(version) !! Returns libmodbus version as allocatable string. - logical, intent(in), optional :: name !! Add `libmodbus/` as prefix. + logical, intent(in), optional :: name !! Add prefix `libmodbus/`. character(len=:), allocatable :: version character(len=8) :: v @@ -512,7 +507,9 @@ function dm_modbus_version(name) result(version) name_ = .false. if (present(name)) name_ = name - write (v, '(2(i0, "."), i0)') LIBMODBUS_VERSION_MAJOR, LIBMODBUS_VERSION_MINOR, LIBMODBUS_VERSION_MICRO + write (v, '(2(i0, "."), i0)') LIBMODBUS_VERSION_MAJOR, & + LIBMODBUS_VERSION_MINOR, & + LIBMODBUS_VERSION_MICRO if (name_) then version = 'libmodbus/' // trim(v) diff --git a/src/dm_node.f90 b/src/dm_node.f90 index caae6b2..5342288 100644 --- a/src/dm_node.f90 +++ b/src/dm_node.f90 @@ -12,7 +12,7 @@ module dm_node integer, parameter, public :: NODE_META_LEN = 32 !! Max. node meta description length. type, public :: node_type - !! Node type. + !! Sensor node type. character(len=NODE_ID_LEN) :: id = ' ' !! Node id (`-0-9A-Z_a-z`). character(len=NODE_NAME_LEN) :: name = ' ' !! Node name. character(len=NODE_META_LEN) :: meta = ' ' !! Additional description text (optional). diff --git a/src/dm_plot.f90 b/src/dm_plot.f90 index f2fced2..e029b8a 100644 --- a/src/dm_plot.f90 +++ b/src/dm_plot.f90 @@ -222,24 +222,36 @@ pure elemental logical function dm_plot_term_valid(term) result(valid) valid = (term > PLOT_TERM_NONE .and. term <= PLOT_TERM_LAST) end function dm_plot_term_valid - function dm_plot_version() result(version) + function dm_plot_version(name) result(version) !! Returns Gnuplot version as allocatable string. + logical, intent(in), optional :: name !! Add prefix `gnuplot/`. character(len=:), allocatable :: version + character(len=3) :: v character(len=32) :: buffer integer :: rc integer(kind=i8) :: sz + logical :: name_ type(pipe_type) :: pipe + name_ = .false. + if (present(name)) name_ = name + rc = dm_pipe_open(pipe, PLOT_GNUPLOT // ' --version', PIPE_RDONLY) + v = '0.0' if (dm_is_ok(rc)) then sz = dm_pipe_read(pipe, buffer) - if (sz > 10) version = 'gnuplot/' // buffer(9:11) + if (sz > 11) v = buffer(9:11) end if call dm_pipe_close(pipe) - if (.not. allocated(version)) version = 'gnuplot/0.0' + + if (name_) then + version = 'gnuplot/' // v + else + version = v + end if end function dm_plot_version ! ****************************************************************** diff --git a/src/dm_rpc.f90 b/src/dm_rpc.f90 index fa31771..44e59f3 100644 --- a/src/dm_rpc.f90 +++ b/src/dm_rpc.f90 @@ -379,7 +379,7 @@ integer function dm_rpc_send_type(request, response, type, url, username, passwo rc = E_INVALID if (.not. dm_z_valid(request%compression)) return - rc = dm_z_compress_type(type, request%payload, request%compression) + rc = dm_z_compress_type(type, request%compression, request%payload) if (dm_is_error(rc)) return rc = rpc_request(request, response) @@ -466,9 +466,9 @@ integer function dm_rpc_send_types(requests, responses, types, url, username, pa ! Serialise and compress payload. if (z == Z_TYPE_ZSTD) then ! Use Zstandard compression context. - rc = dm_z_compress_type(types(i), requests(i)%payload, z, context=context) + rc = dm_z_compress_type(types(i), z, requests(i)%payload, context=context) else - rc = dm_z_compress_type(types(i), requests(i)%payload, z) + rc = dm_z_compress_type(types(i), z, requests(i)%payload) end if if (dm_is_error(rc)) exit diff --git a/src/dm_rts.f90 b/src/dm_rts.f90 index 4693e9e..fe33b76 100644 --- a/src/dm_rts.f90 +++ b/src/dm_rts.f90 @@ -20,13 +20,12 @@ module dm_rts !! real(kind=r8) :: ppm, ppm1, ppm2 !! real(kind=r8) :: corr_dist, hz_dist, slope_dist, v !! - !! temperature = 15.0_r8 ! Air temperature [°C]. - !! pressure = 1010.0_r8 ! Air pressure [mbar]. - !! humidity = 0.65_r8 ! Relative humidity [none]. - !! height = 100.0_r8 ! Instrument height [m]. - !! slope_dist = 42.0_r8 ! Slope distance [m]. - !! - !! v = dm_gon_to_rad(101.5_r8) ! Vertical angle [rad]. + !! temperature = 15.0_r8 ! Air temperature [°C]. + !! pressure = 1010.0_r8 ! Air pressure [mbar]. + !! humidity = 0.6_r8 ! Relative humidity [none]. + !! height = 100.0_r8 ! Instrument height [m]. + !! slope_dist = 42.0_r8 ! Slope distance [m]. + !! v = dm_gon_to_rad(101.5_r8) ! Vertical angle [rad]. !! !! ppm1 = dm_rts_correction_atmospheric(temperature, pressure, humidity) !! ppm2 = dm_rts_correction_sea_level(height) diff --git a/src/dm_util.f90 b/src/dm_util.f90 index b268493..bcf5262 100644 --- a/src/dm_util.f90 +++ b/src/dm_util.f90 @@ -19,6 +19,12 @@ module dm_util module procedure :: equals_real64 end interface + interface dm_inc + !! Returns increased integer value. + module procedure :: inc_int32 + module procedure :: inc_int64 + end interface dm_inc + interface dm_itoa !! Generic integer to string converter. module procedure :: int32_to_string @@ -57,6 +63,7 @@ module dm_util public :: dm_array_has public :: dm_equals + public :: dm_inc public :: dm_sleep public :: dm_usleep @@ -84,6 +91,8 @@ module dm_util private :: array_has_int64 private :: equals_real32 private :: equals_real64 + private :: inc_int32 + private :: inc_int64 private :: int32_to_string private :: int64_to_string private :: real32_to_string @@ -321,6 +330,30 @@ pure elemental logical function equals_real64(a, b) result(equals) equals = (abs(a - b) <= epsilon(a)) end function equals_real64 + pure elemental integer(kind=i4) function inc_int32(a, b) result(c) + !! Increases argument `a` by 1 or `b`. + integer(kind=i4), intent(in) :: a !! Value to increase. + integer(kind=i4), intent(in), optional :: b !! Summand to use. + + if (present(b)) then + c = a + b + else + c = a + 1 + end if + end function inc_int32 + + pure elemental integer(kind=i8) function inc_int64(a, b) result(c) + !! Increases argument `a` by 1 or `b`. + integer(kind=i8), intent(in) :: a !! Value to increase. + integer(kind=i8), intent(in), optional :: b !! Summand to use. + + if (present(b)) then + c = a + b + else + c = a + 1 + end if + end function inc_int64 + ! ****************************************************************** ! PRIVATE NUMBER TO STRING FUNCTIONS. ! ****************************************************************** diff --git a/src/dm_z.f90 b/src/dm_z.f90 index 497dac0..f89ad0c 100644 --- a/src/dm_z.f90 +++ b/src/dm_z.f90 @@ -81,7 +81,7 @@ module dm_z ! ****************************************************************** ! PUBLIC PROCEDURES. ! ****************************************************************** - integer function dm_z_compress_type(type, output, z, output_len, context) result(rc) + integer function dm_z_compress_type(type, z, output, output_len, context) result(rc) !! Serialises derived `type` to namelist format and compresses it !! depending on compression type `z`. The serialised and compressed !! result is returned in `output`. The argument `output_len` will equal @@ -95,24 +95,24 @@ integer function dm_z_compress_type(type, output, z, output_len, context) result use :: dm_target, only: target_type class(*), intent(inout) :: type !! Derived type to serialise and compress. - character(len=:), allocatable, intent(out) :: output !! Serialised and compressed type. integer, intent(in) :: z !! Output compression enumerator (`Z_TYPE_*`). + character(len=:), allocatable, intent(out) :: output !! Serialised and compressed type. 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`. select type (t => type) type is (beat_type) - rc = z_compress_beat (t, output, z, output_len, context) + rc = z_compress_beat (t, z, output, output_len, context) type is (log_type) - rc = z_compress_log (t, output, z, output_len, context) + rc = z_compress_log (t, z, output, output_len, context) type is (node_type) - rc = z_compress_node (t, output, z, output_len, context) + rc = z_compress_node (t, z, output, output_len, context) type is (observ_type) - rc = z_compress_observ(t, output, z, output_len, context) + rc = z_compress_observ(t, z, output, output_len, context) type is (sensor_type) - rc = z_compress_sensor(t, output, z, output_len, context) + rc = z_compress_sensor(t, z, output, output_len, context) type is (target_type) - rc = z_compress_target(t, output, z, output_len, context) + rc = z_compress_target(t, z, output, output_len, context) class default rc = E_INVALID output = '' @@ -120,7 +120,7 @@ integer function dm_z_compress_type(type, output, z, output_len, context) result end select end function dm_z_compress_type - integer function dm_z_compress_types(types, output, z) result(rc) + integer function dm_z_compress_types(types, z, output) result(rc) !! Serialises derived types `types` to namelist format and compresses !! them depending on compression type `z`. If `z` is `Z_TYPE_ZSTD`, the !! function uses a Zstandard compression context. The serialised and @@ -130,8 +130,8 @@ integer function dm_z_compress_types(types, output, z) result(rc) use :: dm_string, only: string_type class(*), intent(inout) :: types(:) !! Derived types to serialise and compress. - type(string_type), allocatable, intent(out) :: output(:) !! Serialised and compressed types. integer, intent(in) :: z !! Output compression enumerator (`Z_TYPE_*`). + type(string_type), allocatable, intent(out) :: output(:) !! Serialised and compressed types. integer :: i, n, stat type(zstd_context_type) :: context @@ -148,9 +148,9 @@ integer function dm_z_compress_types(types, output, z) result(rc) do i = 1, n if (z == Z_TYPE_ZSTD) then ! Use Zstandard compression context. - rc = dm_z_compress_type(types(i), output(i)%data, z, context=context) + rc = dm_z_compress_type(types(i), z, output(i)%data, context=context) else - rc = dm_z_compress_type(types(i), output(i)%data, z) + rc = dm_z_compress_type(types(i), z, output(i)%data) end if if (dm_is_error(rc)) exit @@ -233,7 +233,7 @@ end function dm_z_valid_type ! ****************************************************************** ! PRIVATE PROCEDURES. ! ****************************************************************** - integer function z_compress(input, output, z, input_len, output_len, context) result(rc) + integer function z_compress(input, z, output, input_len, output_len, context) result(rc) !! Compresses given input and returns the result in allocatable string !! `output`. The actual length may be smaller than the string length !! and is returned in `output_len`. @@ -251,8 +251,8 @@ integer function z_compress(input, output, z, input_len, output_len, context) re !! * `E_ZSTD` if zstd library call failed. !! character(len=*), intent(inout) :: input !! Uncompressed data. - character(len=:), allocatable, intent(out) :: output !! Compressed data. integer, intent(in) :: z !! Output compression enumerator (`Z_TYPE_*`). + character(len=:), allocatable, intent(out) :: output !! Compressed data. integer(kind=i8), intent(in), optional :: input_len !! Actual input length. integer(kind=i8), intent(out), optional :: output_len !! Actual output length. type(zstd_context_type), intent(inout), optional :: context !! Zstandard compression context to use with type `Z_TYPE_ZSTD`. @@ -288,7 +288,7 @@ integer function z_compress(input, output, z, input_len, output_len, context) re end select end function z_compress - integer function z_compress_beat(beat, output, z, output_len, context) result(rc) + integer function z_compress_beat(beat, z, output, output_len, context) result(rc) !! Serialises beat `beat` to namelist format and compresses it !! depending on `z`. The serialised and compressed result is returned !! in `output`. The argument `output_len` will equal the length of @@ -296,8 +296,8 @@ integer function z_compress_beat(beat, output, z, output_len, context) result(rc use :: dm_beat, only: beat_type type(beat_type), intent(inout) :: beat !! Beat type to serialise and compress. - character(len=:), allocatable, intent(out) :: output !! Serialised and compressed beat. integer, intent(in) :: z !! Output compression enumerator (`Z_TYPE_*`). + character(len=:), allocatable, intent(out) :: output !! Serialised and compressed beat. 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`. @@ -306,12 +306,12 @@ integer function z_compress_beat(beat, output, z, output_len, context) result(rc rc = dm_nml_from(beat, input) if (dm_is_error(rc)) return - rc = z_compress(input, output, z, input_len=len_trim(input, kind=i8), output_len=output_len_, context=context) + rc = z_compress(input, z, output, input_len=len_trim(input, kind=i8), output_len=output_len_, context=context) if (len(output) /= output_len_) output = output(:output_len_) if (present(output_len)) output_len = output_len_ end function z_compress_beat - integer function z_compress_log(log, output, z, output_len, context) result(rc) + integer function z_compress_log(log, z, output, output_len, context) result(rc) !! Serialises log `log` to namelist format and compresses it depending !! on `z`. The serialised and compressed result is returned in !! `output`. The argument `output_len` will equal the length of @@ -319,8 +319,8 @@ integer function z_compress_log(log, output, z, output_len, context) result(rc) use :: dm_log, only: log_type type(log_type), intent(inout) :: log !! Log type to serialise and compress. - character(len=:), allocatable, intent(out) :: output !! Serialised and compressed log. integer, intent(in) :: z !! Output compression enumerator (`Z_TYPE_*`). + character(len=:), allocatable, intent(out) :: output !! Serialised and compressed log. 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`. @@ -329,12 +329,12 @@ integer function z_compress_log(log, output, z, output_len, context) result(rc) rc = dm_nml_from(log, input) if (dm_is_error(rc)) return - rc = z_compress(input, output, z, input_len=len_trim(input, kind=i8), output_len=output_len_, context=context) + rc = z_compress(input, z, output, input_len=len_trim(input, kind=i8), output_len=output_len_, context=context) if (len(output) /= output_len_) output = output(:output_len_) if (present(output_len)) output_len = output_len_ end function z_compress_log - integer function z_compress_node(node, output, z, output_len, context) result(rc) + integer function z_compress_node(node, z, output, output_len, context) result(rc) !! Serialises node `node` to namelist format and compresses it !! depending on `z`. The serialised and compressed result is !! returned in `output`. The argument `output_len` will equal the @@ -342,8 +342,8 @@ integer function z_compress_node(node, output, z, output_len, context) result(rc use :: dm_node, only: node_type type(node_type), intent(inout) :: node !! Node type to serialise and compress. - character(len=:), allocatable, intent(out) :: output !! Serialised and compressed node. integer, intent(in) :: z !! Output compression enumerator (`Z_TYPE_*`). + character(len=:), allocatable, intent(out) :: output !! Serialised and compressed node. 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`. @@ -352,12 +352,12 @@ integer function z_compress_node(node, output, z, output_len, context) result(rc rc = dm_nml_from(node, input) if (dm_is_error(rc)) return - rc = z_compress(input, output, z, input_len=len_trim(input, kind=i8), output_len=output_len_, context=context) + rc = z_compress(input, z, output, input_len=len_trim(input, kind=i8), output_len=output_len_, context=context) if (len(output) /= output_len_) output = output(:output_len_) if (present(output_len)) output_len = output_len_ end function z_compress_node - integer function z_compress_observ(observ, output, z, output_len, context) result(rc) + integer function z_compress_observ(observ, z, output, output_len, context) result(rc) !! Serialises observation `observ` to namelist format and compresses it !! depending on `z`. The serialised and compressed result is returned !! in `output`. The argument `output_len` will equal the length of @@ -365,8 +365,8 @@ integer function z_compress_observ(observ, output, z, output_len, context) resul use :: dm_observ, only: observ_type type(observ_type), intent(inout) :: observ !! Observation type to serialise and compress. - character(len=:), allocatable, intent(out) :: output !! Serialised and compressed observation. integer, intent(in) :: z !! Output compression enumerator (`Z_TYPE_*`). + character(len=:), allocatable, intent(out) :: output !! Serialised and compressed observation. 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`. @@ -375,12 +375,12 @@ integer function z_compress_observ(observ, output, z, output_len, context) resul rc = dm_nml_from(observ, input) if (dm_is_error(rc)) return - rc = z_compress(input, output, z, input_len=len_trim(input, kind=i8), output_len=output_len_, context=context) + rc = z_compress(input, z, output, input_len=len_trim(input, kind=i8), output_len=output_len_, context=context) if (len(output) /= output_len_) output = output(:output_len_) if (present(output_len)) output_len = output_len_ end function z_compress_observ - integer function z_compress_sensor(sensor, output, z, output_len, context) result(rc) + integer function z_compress_sensor(sensor, z, output, output_len, context) result(rc) !! Serialises sensor `sensor` to namelist format and compresses it !! depending on `z`. The serialised and compressed result is !! returned in `output`. The argument `output_len` will equal the @@ -388,8 +388,8 @@ integer function z_compress_sensor(sensor, output, z, output_len, context) resul use :: dm_sensor, only: sensor_type type(sensor_type), intent(inout) :: sensor !! Sensor type to serialise and compress. - character(len=:), allocatable, intent(out) :: output !! Serialised and compressed sensor. integer, intent(in) :: z !! Output compression enumerator (`Z_TYPE_*`). + character(len=:), allocatable, intent(out) :: output !! Serialised and compressed sensor. 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`. @@ -398,12 +398,12 @@ integer function z_compress_sensor(sensor, output, z, output_len, context) resul rc = dm_nml_from(sensor, input) if (dm_is_error(rc)) return - rc = z_compress(input, output, z, input_len=len_trim(input, kind=i8), output_len=output_len_, context=context) + rc = z_compress(input, z, output, input_len=len_trim(input, kind=i8), output_len=output_len_, context=context) if (len(output) /= output_len_) output = output(:output_len_) if (present(output_len)) output_len = output_len_ end function z_compress_sensor - integer function z_compress_target(target, output, z, output_len, context) result(rc) + integer function z_compress_target(target, z, output, output_len, context) result(rc) !! Serialises target `target` to namelist format and compresses it !! depending on `z`. The serialised and compressed result is !! returned in `output`. The argument `output_len` will equal the @@ -411,8 +411,8 @@ integer function z_compress_target(target, output, z, output_len, context) resul use :: dm_target, only: target_type type(target_type), intent(inout) :: target !! Target type to serialise and compress. - character(len=:), allocatable, intent(out) :: output !! Serialised and compressed target. integer, intent(in) :: z !! Output compression enumerator (`Z_TYPE_*`). + character(len=:), allocatable, intent(out) :: output !! Serialised and compressed target. 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`. @@ -421,12 +421,12 @@ integer function z_compress_target(target, output, z, output_len, context) resul rc = dm_nml_from(target, input) if (dm_is_error(rc)) return - rc = z_compress(input, output, z, input_len=len_trim(input, kind=i8), output_len=output_len_, context=context) + rc = z_compress(input, z, output, input_len=len_trim(input, kind=i8), output_len=output_len_, context=context) if (len(output) /= output_len_) output = output(:output_len_) if (present(output_len)) output_len = output_len_ end function z_compress_target - integer function z_uncompress(input, output, z, input_len, output_len, context) result(rc) + integer function z_uncompress(input, z, output, input_len, output_len, context) result(rc) !! Uncompresses given input and returns the result in string `output`. !! The string must be allocated and large enough to hold the !! uncompressed data. The actual length may be smaller than the output @@ -445,8 +445,8 @@ integer function z_uncompress(input, output, z, input_len, output_len, context) !! * `E_ZSTD` if zstd library call failed. !! character(len=*), intent(inout) :: input !! Compressed data. - character(len=*), intent(inout) :: output !! Uncompressed data. integer, intent(in) :: z !! Input compression enumerator (`Z_TYPE_*`). + character(len=*), intent(inout) :: output !! Uncompressed data. integer(kind=i8), intent(in), optional :: input_len !! Actual input length. integer(kind=i8), intent(out), optional :: output_len !! Actual output length. type(zstd_context_type), intent(inout), optional :: context !! Zstandard decompression context to use with type `Z_TYPE_ZSTD`. @@ -478,110 +478,110 @@ integer function z_uncompress(input, output, z, input_len, output_len, context) end select end function z_uncompress - integer function z_uncompress_beat(input, beat, z, input_len, context) result(rc) + integer function z_uncompress_beat(input, z, beat, input_len, context) result(rc) !! Uncompressed compressed beat namelist `input` and returns !! deserialised type in `beat`. use :: dm_beat, only: beat_type character(len=*), intent(inout) :: input !! Compressed and Namelist-serialised beat. - type(beat_type), intent(out) :: beat !! Uncompressed and deserialised beat. integer, intent(in) :: z !! Input compression enumerator (`Z_TYPE_*`). + type(beat_type), intent(out) :: beat !! Uncompressed and deserialised beat. integer(kind=i8), intent(in), optional :: input_len !! Actual input length. type(zstd_context_type), intent(inout), optional :: context !! Zstandard decompression context to use with type `Z_TYPE_ZSTD`. character(len=NML_BEAT_LEN) :: output - rc = z_uncompress(input, output, z, input_len=input_len, context=context) + rc = z_uncompress(input, z, output, input_len=input_len, context=context) if (dm_is_error(rc)) return rc = dm_nml_to(output, beat) end function z_uncompress_beat - integer function z_uncompress_log(input, log, z, input_len, context) result(rc) + integer function z_uncompress_log(input, z, log, input_len, context) result(rc) !! Uncompressed compressed log namelist `input` and returns !! deserialised type in `log`. use :: dm_log, only: log_type character(len=*), intent(inout) :: input !! Compressed and Namelist-serialised log. - type(log_type), intent(out) :: log !! Uncompressed and deserialised log. integer, intent(in) :: z !! Input compression enumerator (`Z_TYPE_*`). + type(log_type), intent(out) :: log !! Uncompressed and deserialised log. integer(kind=i8), intent(in), optional :: input_len !! Actual input length. type(zstd_context_type), intent(inout), optional :: context !! Zstandard decompression context to use with type `Z_TYPE_ZSTD`. character(len=NML_LOG_LEN) :: output - rc = z_uncompress(input, output, z, input_len=input_len, context=context) + rc = z_uncompress(input, z, output, input_len=input_len, context=context) if (dm_is_error(rc)) return rc = dm_nml_to(output, log) end function z_uncompress_log - integer function z_uncompress_node(input, node, z, input_len, context) result(rc) + integer function z_uncompress_node(input, z, node, input_len, context) result(rc) !! Uncompressed compressed node namelist `input` and returns !! deserialised type in `node`. use :: dm_node, only: node_type character(len=*), intent(inout) :: input !! Compressed and Namelist-serialised node. - type(node_type), intent(out) :: node !! Uncompressed and deserialised node. integer, intent(in) :: z !! Input compression enumerator (`Z_TYPE_*`). + type(node_type), intent(out) :: node !! Uncompressed and deserialised node. integer(kind=i8), intent(in), optional :: input_len !! Actual input length. type(zstd_context_type), intent(inout), optional :: context !! Zstandard decompression context to use with type `Z_TYPE_ZSTD`. character(len=NML_NODE_LEN) :: output - rc = z_uncompress(input, output, z, input_len=input_len, context=context) + rc = z_uncompress(input, z, output, input_len=input_len, context=context) if (dm_is_error(rc)) return rc = dm_nml_to(output, node) end function z_uncompress_node - integer function z_uncompress_observ(input, observ, z, input_len, context) result(rc) + integer function z_uncompress_observ(input, z, observ, input_len, context) result(rc) !! Uncompressed compressed observation namelist `input` and returns !! deserialised z in `observ`. use :: dm_observ, only: observ_type character(len=*), intent(inout) :: input !! Compressed and Namelist-serialised observation. - type(observ_type), intent(out) :: observ !! Uncompressed and deserialised observation. integer, intent(in) :: z !! Input compression enumerator (`Z_TYPE_*`). + type(observ_type), intent(out) :: observ !! Uncompressed and deserialised observation. integer(kind=i8), intent(in), optional :: input_len !! Actual input length. type(zstd_context_type), intent(inout), optional :: context !! Zstandard decompression context to use with type `Z_TYPE_ZSTD`. character(len=NML_OBSERV_LEN) :: output - rc = z_uncompress(input, output, z, input_len=input_len, context=context) + rc = z_uncompress(input, z, output, input_len=input_len, context=context) if (dm_is_error(rc)) return rc = dm_nml_to(output, observ) end function z_uncompress_observ - integer function z_uncompress_sensor(input, sensor, z, input_len, context) result(rc) + integer function z_uncompress_sensor(input, z, sensor, input_len, context) result(rc) !! Uncompressed compressed sensor namelist `input` and returns !! deserialised type in `sensor`. use :: dm_sensor, only: sensor_type character(len=*), intent(inout) :: input !! Compressed and Namelist-serialised sensor. - type(sensor_type), intent(out) :: sensor !! Uncompressed and deserialised sensor. integer, intent(in) :: z !! Input compression enumerator (`Z_TYPE_*`). + type(sensor_type), intent(out) :: sensor !! Uncompressed and deserialised sensor. integer(kind=i8), intent(in), optional :: input_len !! Actual input length. type(zstd_context_type), intent(inout), optional :: context !! Zstandard decompression context to use with type `Z_TYPE_ZSTD`. character(len=NML_SENSOR_LEN) :: output - rc = z_uncompress(input, output, z, input_len=input_len, context=context) + rc = z_uncompress(input, z, output, input_len=input_len, context=context) if (dm_is_error(rc)) return rc = dm_nml_to(output, sensor) end function z_uncompress_sensor - integer function z_uncompress_target(input, target, z, input_len, context) result(rc) + integer function z_uncompress_target(input, z, target, input_len, context) result(rc) !! Uncompressed compressed target namelist `input` and returns !! deserialised type in `target`. use :: dm_target, only: target_type character(len=*), intent(inout) :: input !! Compressed and Namelist-serialised target. - type(target_type), intent(out) :: target !! Uncompressed and deserialised target. integer, intent(in) :: z !! Input compression enumerator (`Z_TYPE_*`). + type(target_type), intent(out) :: target !! Uncompressed and deserialised target. integer(kind=i8), intent(in), optional :: input_len !! Actual input length. type(zstd_context_type), intent(inout), optional :: context !! Zstandard decompression context to use with type `Z_TYPE_ZSTD`. character(len=NML_TARGET_LEN) :: output - rc = z_uncompress(input, output, z, input_len=input_len, context=context) + rc = z_uncompress(input, z, output, input_len=input_len, context=context) if (dm_is_error(rc)) return rc = dm_nml_to(output, target) end function z_uncompress_target diff --git a/src/dm_zstd.f90 b/src/dm_zstd.f90 index 1e96e6b..36c3504 100644 --- a/src/dm_zstd.f90 +++ b/src/dm_zstd.f90 @@ -34,6 +34,7 @@ module dm_zstd public :: dm_zstd_level_max public :: dm_zstd_level_min public :: dm_zstd_uncompress + public :: dm_zstd_version private :: zstd_compress_multi private :: zstd_compress_single @@ -78,6 +79,23 @@ integer function dm_zstd_level_min() result(level) level = zstd_min_c_level() end function dm_zstd_level_min + function dm_zstd_version(name) result(version) + !! Returns zstd library version as allocatable string. + logical, intent(in), optional :: name !! Add prefix `libzstd/`. + character(len=:), allocatable :: version + + logical :: name_ + + name_ = .false. + if (present(name)) name_ = name + + if (name_) then + version = 'libzstd/' // zstd_version_string() + else + version = zstd_version_string() + end if + end function dm_zstd_version + ! ****************************************************************** ! PRIVATE PROCEDURES. ! ****************************************************************** diff --git a/test/dmtestdb.f90 b/test/dmtestdb.f90 index 6387550..c6655b2 100644 --- a/test/dmtestdb.f90 +++ b/test/dmtestdb.f90 @@ -57,6 +57,7 @@ logical function test01() result(stat) stat = TEST_FAILED + print '(" Library: ", a)', dm_db_version(.true.) print *, 'Checking for stale database "' // DB_OBSERV // '" ...' if (dm_file_exists(DB_OBSERV)) then diff --git a/test/dmtesthdf5.f90 b/test/dmtesthdf5.f90 index 596d149..e8e25e1 100644 --- a/test/dmtesthdf5.f90 +++ b/test/dmtesthdf5.f90 @@ -43,13 +43,14 @@ logical function test01() result(stat) if (dm_is_error(rc)) return print *, 'Reading HDF5 library version ...' - rc = dm_hdf5_version(major, minor, release) + rc = dm_hdf5_version_number(major, minor, release) call dm_error_out(rc) if (dm_is_error(rc)) return print '(" Major..: ", i0)', major print '(" Minor..: ", i0)', minor print '(" Release: ", i0)', release + print '(" Library: ", a)', dm_hdf5_version(.true.) print *, 'Clean-up ...' rc = dm_hdf5_destroy() diff --git a/test/dmtestlua.f90 b/test/dmtestlua.f90 index 9902cb8..23ea5e3 100644 --- a/test/dmtestlua.f90 +++ b/test/dmtestlua.f90 @@ -9,7 +9,7 @@ program dmtestlua character(len=*), parameter :: TEST_NAME = 'dmtestlua' character(len=*), parameter :: LUA_FILE = 'test/test.lua' - integer, parameter :: NTESTS = 11 + integer, parameter :: NTESTS = 12 type(test_type) :: tests(NTESTS) logical :: stats(NTESTS) @@ -25,7 +25,8 @@ program dmtestlua test_type('test08', test08), & test_type('test09', test09), & test_type('test10', test10), & - test_type('test11', test11) & + test_type('test11', test11), & + test_type('test12', test12) & ] call dm_init() @@ -44,6 +45,7 @@ logical function test01() result(stat) stat = TEST_FAILED + print '(" Library: ", a)', dm_lua_version(.true.) print *, 'Creating new Lua state ...' rc = dm_lua_init(lua) if (dm_is_error(rc)) return @@ -576,4 +578,43 @@ logical function test11() result(stat) stat = TEST_PASSED end function test11 + + logical function test12() result(stat) + !! Writes and reads variable. + integer :: rc + integer :: v1, v2 + type(lua_state_type) :: lua + + stat = TEST_FAILED + + print *, 'Creating new Lua state ...' + rc = dm_lua_init(lua) + if (dm_is_error(rc)) return + + test_block: block + v1 = 12345 + + print *, 'Writing int ...' + rc = dm_lua_set(lua, 'foo', v1) + if (dm_is_error(rc)) exit test_block + print *, 'Value: ', v1 + + print *, 'Reading int ...' + rc = dm_lua_read(lua, 'foo', v2) + if (dm_is_error(rc)) exit test_block + print *, 'Value: ', v2 + + print *, 'Validating values ...' + if (v1 /= v2) exit test_block + end block test_block + + call dm_lua_destroy(lua) + + if (dm_is_error(rc)) then + call dm_error_out(rc, dm_lua_last_error(lua)) + return + end if + + stat = TEST_PASSED + end function test12 end program dmtestlua diff --git a/test/dmtestmodbus.f90 b/test/dmtestmodbus.f90 index f3e5413..8bcf5e6 100644 --- a/test/dmtestmodbus.f90 +++ b/test/dmtestmodbus.f90 @@ -27,7 +27,7 @@ logical function test01() result(stat) stat = TEST_FAILED - print '(" libmodbus: ", a)', dm_modbus_version() + print '(" Library: ", a)', dm_modbus_version(.true.) mb_block: block print *, 'Creating Modbus TCP context ...' diff --git a/test/dmtestplot.f90 b/test/dmtestplot.f90 index 1c5a3f8..383003b 100644 --- a/test/dmtestplot.f90 +++ b/test/dmtestplot.f90 @@ -60,6 +60,7 @@ logical function test01() result(stat) dps(2) = dp_type('1970-01-01T00:01:00.000+00:00', 223.123_8) dps(3) = dp_type('1970-01-01T00:02:00.000+00:00', 23.123_8) + print '(" Library: ", a)', dm_plot_version(.true.) print *, 'Writing to stdin ...' rc = dm_plot_lines(plot, dps) call dm_error_out(rc) diff --git a/test/dmtestrpc.f90 b/test/dmtestrpc.f90 index 62564ef..4384b09 100644 --- a/test/dmtestrpc.f90 +++ b/test/dmtestrpc.f90 @@ -65,6 +65,7 @@ logical function test01() result(stat) stat = TEST_FAILED + print '(" Libraries: ", a)', dm_rpc_version() print *, 'Validating URLs ...' url = dm_rpc_url('example.com', 8080, '/api/v1') print *, url diff --git a/test/dmtestz.f90 b/test/dmtestz.f90 index 578c067..b07d042 100644 --- a/test/dmtestz.f90 +++ b/test/dmtestz.f90 @@ -66,8 +66,8 @@ logical function test02() result(stat) do z = Z_TYPE_NONE, Z_TYPE_LAST print *, 'Type beat (' // trim(Z_TYPE_NAMES(z)) // ') ...' call dm_timer_start(timer) - rc = dm_z_compress (beat1, str, z); if (dm_is_error(rc)) exit test_block - rc = dm_z_uncompress(str, beat2, z); if (dm_is_error(rc)) exit test_block + rc = dm_z_compress (beat1, z, str); if (dm_is_error(rc)) exit test_block + rc = dm_z_uncompress(str, z, beat2); if (dm_is_error(rc)) exit test_block call dm_timer_stop(timer, t) print '(" Compressed to ", i0, " bytes and finished in ", f8.6, " sec.")', len(str), t rc = E_CORRUPT @@ -79,8 +79,8 @@ logical function test02() result(stat) do z = Z_TYPE_NONE, Z_TYPE_LAST print *, 'Type log (' // trim(Z_TYPE_NAMES(z)) // ') ...' call dm_timer_start(timer) - rc = dm_z_compress (log1, str, z); if (dm_is_error(rc)) exit test_block - rc = dm_z_uncompress(str, log2, z); if (dm_is_error(rc)) exit test_block + rc = dm_z_compress (log1, z, str); if (dm_is_error(rc)) exit test_block + rc = dm_z_uncompress(str, z, log2); if (dm_is_error(rc)) exit test_block call dm_timer_stop(timer, t) print '(" Compressed to ", i0, " bytes and finished in ", f8.6, " sec.")', len(str), t rc = E_CORRUPT @@ -92,8 +92,8 @@ logical function test02() result(stat) do z = Z_TYPE_NONE, Z_TYPE_LAST print *, 'Type node (' // trim(Z_TYPE_NAMES(z)) // ') ...' call dm_timer_start(timer) - rc = dm_z_compress (node1, str, z); if (dm_is_error(rc)) exit test_block - rc = dm_z_uncompress(str, node2, z); if (dm_is_error(rc)) exit test_block + rc = dm_z_compress (node1, z, str); if (dm_is_error(rc)) exit test_block + rc = dm_z_uncompress(str, z, node2); if (dm_is_error(rc)) exit test_block call dm_timer_stop(timer, t) print '(" Compressed to ", i0, " bytes and finished in ", f8.6, " sec.")', len(str), t rc = E_CORRUPT @@ -105,8 +105,8 @@ logical function test02() result(stat) do z = Z_TYPE_NONE, Z_TYPE_LAST print *, 'Type observation (' // trim(Z_TYPE_NAMES(z)) // ') ...' call dm_timer_start(timer) - rc = dm_z_compress (observ1, str, z); if (dm_is_error(rc)) exit test_block - rc = dm_z_uncompress(str, observ2, z); if (dm_is_error(rc)) exit test_block + rc = dm_z_compress (observ1, z, str); if (dm_is_error(rc)) exit test_block + rc = dm_z_uncompress(str, z, observ2); if (dm_is_error(rc)) exit test_block call dm_timer_stop(timer, t) print '(" Compressed to ", i0, " bytes and finished in ", f8.6, " sec.")', len(str), t rc = E_CORRUPT @@ -118,8 +118,8 @@ logical function test02() result(stat) do z = Z_TYPE_NONE, Z_TYPE_LAST print *, 'Type sensor (' // trim(Z_TYPE_NAMES(z)) // ') ...' call dm_timer_start(timer) - rc = dm_z_compress (sensor1, str, z); if (dm_is_error(rc)) exit test_block - rc = dm_z_uncompress(str, sensor2, z); if (dm_is_error(rc)) exit test_block + rc = dm_z_compress (sensor1, z, str); if (dm_is_error(rc)) exit test_block + rc = dm_z_uncompress(str, z, sensor2); if (dm_is_error(rc)) exit test_block call dm_timer_stop(timer, t) print '(" Compressed to ", i0, " bytes and finished in ", f8.6, " sec.")', len(str), t rc = E_CORRUPT @@ -131,8 +131,8 @@ logical function test02() result(stat) do z = Z_TYPE_NONE, Z_TYPE_LAST print *, 'Type target (' // trim(Z_TYPE_NAMES(z)) // ') ...' call dm_timer_start(timer) - rc = dm_z_compress (target1, str, z); if (dm_is_error(rc)) exit test_block - rc = dm_z_uncompress(str, target2, z); if (dm_is_error(rc)) exit test_block + rc = dm_z_compress (target1, z, str); if (dm_is_error(rc)) exit test_block + rc = dm_z_uncompress(str, z, target2); if (dm_is_error(rc)) exit test_block call dm_timer_stop(timer, t) print '(" Compressed to ", i0, " bytes and finished in ", f8.6, " sec.")', len(str), t rc = E_CORRUPT @@ -168,7 +168,7 @@ logical function test03() result(stat) print *, 'Compressing without zstd context ...' call dm_timer_start(timer) do i = 1, N - rc = dm_z_compress(observs(i), str, Z_TYPE_ZSTD) + rc = dm_z_compress(observs(i), Z_TYPE_ZSTD, str) if (dm_is_error(rc)) exit end do call dm_timer_stop(timer, t) @@ -177,7 +177,7 @@ logical function test03() result(stat) print *, 'Uncompressing without zstd context ...' call dm_timer_start(timer) do i = 1, N - rc = dm_z_uncompress(str, observs(i), Z_TYPE_ZSTD) + rc = dm_z_uncompress(str, Z_TYPE_ZSTD, observs(i)) if (dm_is_error(rc)) exit end do call dm_timer_stop(timer, t) @@ -190,7 +190,7 @@ logical function test03() result(stat) print *, 'Compressing with zstd context ...' call dm_timer_start(timer) do i = 1, N - rc = dm_z_compress(observs(i), str, Z_TYPE_ZSTD, context=context) + rc = dm_z_compress(observs(i), Z_TYPE_ZSTD, str, context=context) if (dm_is_error(rc)) exit end do call dm_timer_stop(timer, t) @@ -199,7 +199,7 @@ logical function test03() result(stat) print *, 'Uncompressing with zstd context ...' call dm_timer_start(timer) do i = 1, N - rc = dm_z_uncompress(str, observs(i), Z_TYPE_ZSTD, context=context) + rc = dm_z_uncompress(str, Z_TYPE_ZSTD, observs(i), context=context) if (dm_is_error(rc)) exit end do call dm_timer_stop(timer, t) @@ -214,7 +214,7 @@ logical function test03() result(stat) print *, 'Compressing type with zstd context ...' call dm_timer_start(timer) do i = 1, N - rc = dm_z_compress_type(observs(i), str, Z_TYPE_ZSTD, context=context) + rc = dm_z_compress_type(observs(i), Z_TYPE_ZSTD, str, context=context) if (dm_is_error(rc)) exit end do call dm_timer_stop(timer, t) @@ -228,7 +228,7 @@ logical function test03() result(stat) ! Types context. print *, 'Compressing types with zstd context ...' call dm_timer_start(timer) - rc = dm_z_compress_types(observs, strings, Z_TYPE_ZSTD) + rc = dm_z_compress_types(observs, Z_TYPE_ZSTD, strings) call dm_timer_stop(timer, t) print '(" Finished ", i0, " observs in ", f8.6, " sec.")', N, t diff --git a/test/dmtestzstd.f90 b/test/dmtestzstd.f90 index 6e2847d..36b93e7 100644 --- a/test/dmtestzstd.f90 +++ b/test/dmtestzstd.f90 @@ -30,15 +30,17 @@ logical function test01() result(stat) stat = TEST_FAILED + print '(" Library: ", a)', dm_zstd_version(.true.) + call dm_test_dummy(observ1) rc = dm_nml_from(observ1, input) zstd_block: block - print *, 'compressing ...' + print *, 'Compressing ...' rc = dm_zstd_compress(input, output1, output_len=output_len) if (dm_is_error(rc)) exit zstd_block - print *, 'uncompressing ...' + print *, 'Uncompressing ...' rc = dm_zstd_uncompress(output1, output2, input_len=output_len) if (dm_is_error(rc)) exit zstd_block end block zstd_block @@ -46,7 +48,7 @@ logical function test01() result(stat) call dm_error_out(rc) if (dm_is_error(rc)) return - print *, 'matching ...' + print *, 'Matching ...' rc = dm_nml_to(output2, observ2) if (.not. (observ2 == observ1)) return @@ -67,22 +69,22 @@ logical function test02() result(stat) rc = dm_nml_from(observ1, input) zstd_block: block - print *, 'compressing with context ...' + print *, 'Compressing with context ...' rc = dm_zstd_compress(context, input, output1, output_len=output_len) if (dm_is_error(rc)) exit zstd_block - print *, 'uncompressing with context ...' + print *, 'Uncompressing with context ...' rc = dm_zstd_uncompress(context, output1, output2, input_len=output_len) if (dm_is_error(rc)) exit zstd_block end block zstd_block - print *, 'destroying ...' + print *, 'Destroying ...' if (dm_is_error(dm_zstd_destroy(context))) return call dm_error_out(rc) if (dm_is_error(rc)) return - print *, 'matching ...' + print *, 'Matching ...' rc = dm_nml_to(output2, observ2) if (.not. (observ2 == observ1)) return