From 1db27b66822c937b29f38ff9aa20de8ac1b63823 Mon Sep 17 00:00:00 2001 From: Philipp Date: Thu, 29 Feb 2024 00:20:11 +0100 Subject: [PATCH] Updated observation data model. --- Makefile | 15 +- adoc/dmfeed.adoc | 4 +- app/dmweb.f90 | 10 +- config/dmfs.conf.sample | 1 + config/dmpipe.conf.sample | 2 + config/dmserial.conf.sample | 2 + fpm.toml | 36 +- guide/guide.adoc | 1660 +++++++++++++++++++++++++++-- guide/resources/images/beat.svg | 2 +- guide/resources/images/log.svg | 2 +- guide/resources/images/observ.svg | 2 +- man/dmfeed.1 | 8 +- runtests.sh | 8 +- src/dm_api.f90 | 8 +- src/dm_arg.f90 | 28 +- src/dm_beat.f90 | 2 +- src/dm_csv.f90 | 16 +- src/dm_db.f90 | 113 +- src/dm_geocom_api.f90 | 1358 ++++++++++++----------- src/dm_hdf5.f90 | 21 +- src/dm_html.f90 | 15 +- src/dm_id.f90 | 4 +- src/dm_json.f90 | 5 +- src/dm_lua.f90 | 18 +- src/dm_lua_geocom.f90 | 32 +- src/dm_node.f90 | 2 +- src/dm_observ.f90 | 38 +- src/dm_request.f90 | 21 +- src/dm_response.f90 | 3 +- src/dm_sensor.f90 | 3 +- src/dm_sql.f90 | 40 +- src/dm_sync.f90 | 1 + src/dm_target.f90 | 3 +- src/dm_test.f90 | 55 +- src/dm_uuid.f90 | 6 +- test/dmtestcsv.f90 | 20 +- test/dmtestdb.f90 | 4 +- test/dmtestid.f90 | 35 + test/dmtestjson.f90 | 29 +- test/dmtestobserv.f90 | 25 +- test/test.lua | 2 + 41 files changed, 2699 insertions(+), 960 deletions(-) create mode 100644 test/dmtestid.f90 diff --git a/Makefile b/Makefile index 0c7238d..ecf575e 100644 --- a/Makefile +++ b/Makefile @@ -145,7 +145,7 @@ DEBUG = -g -O0 -Wall -fcheck=all -fmax-errors=1 RELEASE = -mtune=native -O2 # Common build options. -FFLAGS = $(RELEASE) -ffree-line-length-0 +FFLAGS = $(RELEASE) -ffree-line-length-0 -std=f2018 CFLAGS = $(RELEASE) PPFLAGS = -cpp -D__$(OS)__ ARFLAGS = -rcs @@ -266,11 +266,11 @@ app: $(DMAPI) $(DMBACKUP) $(DMBEAT) $(DMDB) $(DMDBCTL) $(DMEXPORT) $(DMFEED) \ # Tests target. test: dmtestapi dmtestatom dmtestbase64 dmtestcgi dmtestconfig dmtestcsv \ - dmtestdb dmtestdp dmtestfile dmtesthash dmtesthdf5 dmtesthtml dmtestlogger \ - dmtestlua dmtestjob dmtestjson dmtestmail dmtestmqtt dmtestmqueue dmtestnml \ - dmtestobserv dmtestpath dmtestpipe dmtestplot dmtestregex dmtestrpc \ - dmtestrts dmteststring dmtesttime dmtesttty dmtestunit dmtestutil \ - dmtestuuid dmtestz + dmtestdb dmtestdp dmtestfile dmtesthash dmtesthdf5 dmtesthtml dmtestid \ + dmtestlogger dmtestlua dmtestjob dmtestjson dmtestmail dmtestmqtt \ + dmtestmqueue dmtestnml dmtestobserv dmtestpath dmtestpipe dmtestplot \ + dmtestregex dmtestrpc dmtestrts dmteststring dmtesttime dmtesttty \ + dmtestunit dmtestutil dmtestuuid dmtestz # ****************************************************************************** # @@ -494,6 +494,9 @@ dmtesthdf5: test/dmtesthdf5.f90 $(TARGET) dmtesthtml: test/dmtesthtml.f90 $(TARGET) $(FC) $(FFLAGS) $(LDFLAGS) -o dmtesthtml test/dmtesthtml.f90 $(TARGET) $(LDLIBS) +dmtestid: test/dmtestid.f90 $(TARGET) + $(FC) $(FFLAGS) $(LDFLAGS) -o dmtestid test/dmtestid.f90 $(TARGET) $(LDLIBS) + dmtestlogger: test/dmtestlogger.f90 $(TARGET) $(FC) $(FFLAGS) $(LDFLAGS) -o dmtestlogger test/dmtestlogger.f90 $(TARGET) $(LDLIBS) $(LIBRT) diff --git a/adoc/dmfeed.adoc b/adoc/dmfeed.adoc index c8fa258..8d89077 100644 --- a/adoc/dmfeed.adoc +++ b/adoc/dmfeed.adoc @@ -35,8 +35,8 @@ different feeds. Run _dmuuid(1)_ to generate a valid UUID4. The time stamp of the feed in the updated element is set to the date and time of the last log message. If no logs have been added to the database since the last -file modification time of the feed, the output file is not updated, unless -argument `--force` is passed. +file modification of the feed, the output file is not updated, unless argument +`--force` is passed. == OPTIONS diff --git a/app/dmweb.f90 b/app/dmweb.f90 index 2ddb656..8344b24 100644 --- a/app/dmweb.f90 +++ b/app/dmweb.f90 @@ -1737,7 +1737,7 @@ function html_form_logs(nodes, sensors, targets, max_results, node_id, sensor_id H_DIV_COL // & dm_html_label('Source', for='source') // & dm_html_input(HTML_INPUT_TYPE_TEXT, id='source', name='source', & - max_length=LOG_SOURCE_LEN, pattern='[\-0-9A-Za-z]+', & + max_length=LOG_SOURCE_LEN, pattern='[\-0-9A-Z_a-z]+', & placeholder='Enter log source (optional)', value=source_) // & dm_html_label('From', for='from') // & dm_html_input(HTML_INPUT_TYPE_DATETIME_LOCAL, id='from', name='from', required=.true., value=from_) // & @@ -1779,7 +1779,7 @@ function html_form_nodes(disabled) result(html) H_DIV_COL // & dm_html_label('ID', for='id') // & dm_html_input(HTML_INPUT_TYPE_TEXT, disabled=disabled_, id='id', name='id', & - max_length=NODE_ID_LEN, pattern='[\-0-9A-Za-z]+', & + max_length=NODE_ID_LEN, pattern='[\-0-9A-Z_a-z]+', & placeholder='Enter unique node id', required=.true.) // & dm_html_label('Name', for='name') // & dm_html_input(HTML_INPUT_TYPE_TEXT, disabled=disabled_, id='name', name='name', & @@ -1999,7 +1999,7 @@ function html_form_plots(nodes, sensors, targets, max_results, node_id, sensor_i H_DIV_COL // & dm_html_label('Response Name', for='response_name') // & dm_html_input(HTML_INPUT_TYPE_TEXT, id='response_name', name='response_name', & - max_length=RESPONSE_NAME_LEN, pattern='[\-0-9A-Za-z]+', & + max_length=RESPONSE_NAME_LEN, pattern='[\-0-9A-Z_a-z]+', & placeholder='Enter response name', required=.true., & value=response_name_) // & dm_html_label('From', for='from') // & @@ -2056,7 +2056,7 @@ function html_form_sensors(nodes, disabled) result(html) dm_html_select(select_node, 'node_id', 'node_id', '', disabled=disabled_) // & dm_html_label('ID', for='id') // & dm_html_input(HTML_INPUT_TYPE_TEXT, disabled=disabled_, id='id', name='id', & - max_length=SENSOR_ID_LEN, pattern='[\-0-9A-Za-z]+', & + max_length=SENSOR_ID_LEN, pattern='[\-0-9A-Z_a-z]+', & placeholder='Enter unique sensor id', required=.true.) // & dm_html_label('Name', for='name') // & dm_html_input(HTML_INPUT_TYPE_TEXT, disabled=disabled_, id='name', name='name', & @@ -2118,7 +2118,7 @@ function html_form_targets(disabled) result(html) H_DIV_COL // & ! column 1 dm_html_label('ID', for='id') // & dm_html_input(HTML_INPUT_TYPE_TEXT, disabled=disabled_, id='id', name='id', & - max_length=TARGET_ID_LEN, pattern='[\-0-9A-Za-z]+', & + max_length=TARGET_ID_LEN, pattern='[\-0-9A-Z_a-z]+', & placeholder='Enter unique target id', required=.true.) // & dm_html_label('Name', for='name') // & dm_html_input(HTML_INPUT_TYPE_TEXT, disabled=disabled_, id='name', name='name', & diff --git a/config/dmfs.conf.sample b/config/dmfs.conf.sample index e4a52c6..4adb297 100644 --- a/config/dmfs.conf.sample +++ b/config/dmfs.conf.sample @@ -36,6 +36,7 @@ observs = { receivers = { "dmdb" }, requests = { { + name = "get-temp" request = path, pattern = "(?[-+0-9\\.]+)", delay = 500, diff --git a/config/dmpipe.conf.sample b/config/dmpipe.conf.sample index cee4355..833b007 100644 --- a/config/dmpipe.conf.sample +++ b/config/dmpipe.conf.sample @@ -32,6 +32,7 @@ observ = { -- Read CPU temperature. -- { + name = "get-cpu-temp", request = "sysctl hw.acpi.thermal.tz0.temperature", pattern = "hw\\.acpi\\.thermal\\.tz0\\.temperature: (?[-+0-9\\.,]+)C", delay = 0, @@ -46,6 +47,7 @@ observ = { -- Read laptop battery status. -- { + name = "get-battery", request = "sysctl hw.acpi.battery.life", pattern = "hw\\.acpi\\.battery\\.life: (?[0-9]+)", delay = 0, diff --git a/config/dmserial.conf.sample b/config/dmserial.conf.sample index 3b0ea3d..ea957da 100644 --- a/config/dmserial.conf.sample +++ b/config/dmserial.conf.sample @@ -58,6 +58,7 @@ observs = { receivers = { }, requests = { { + name = "stop", request = "s" .. del, delimiter = "", pattern = "", @@ -74,6 +75,7 @@ observs = { receivers = { "dmdb" }, requests = { { + name = "get-values", request = "Meter" .. del, delimiter = del, pattern = "^\\s*(?[-0-9.]+)\\s.C\\s+.t\\s+(?[-0-9.]+)\\s%\\s+.t\\s+(?[-0-9.]+)\\sg.m3.t\\s+(?[-0-9.]+)\\s.C\\s+.t\\s+(?[-0-9.]+)", diff --git a/fpm.toml b/fpm.toml index 22ca455..a5ef7df 100644 --- a/fpm.toml +++ b/fpm.toml @@ -157,6 +157,10 @@ main = "dmtestbase64.f90" name = "dmtestcgi" main = "dmtestcgi.f90" +[[test]] +name = "dmtestconfig" +main = "dmtestconfig.f90" + [[test]] name = "dmtestcsv" main = "dmtestcsv.f90" @@ -170,6 +174,10 @@ link = [ "sqlite3" ] name = "dmtestdp" main = "dmtestdp.f90" +[[test]] +name = "dmtestfile" +main = "dmtestfile.f90" + [[test]] name = "dmtesthash" main = "dmtesthash.f90" @@ -184,14 +192,8 @@ name = "dmtesthtml" main = "dmtesthtml.f90" [[test]] -name = "dmtestlogger" -main = "dmtestlogger.f90" -link = [ "rt" ] - -[[test]] -name = "dmtestlua" -main = "dmtestlua.f90" -link = [ "lua-5.4" ] +name = "dmtestid" +main = "dmtestid.f90" [[test]] name = "dmtestjob" @@ -201,6 +203,16 @@ main = "dmtestjob.f90" name = "dmtestjson" main = "dmtestjson.f90" +[[test]] +name = "dmtestlogger" +main = "dmtestlogger.f90" +link = [ "rt" ] + +[[test]] +name = "dmtestlua" +main = "dmtestlua.f90" +link = [ "lua-5.4" ] + [[test]] name = "dmtestmail" main = "dmtestmail.f90" @@ -241,15 +253,15 @@ name = "dmtestregex" main = "dmtestregex.f90" link = [ "pcre2-8" ] -[[test]] -name = "dmtestrouter" -main = "dmtestrouter.f90" - [[test]] name = "dmtestrpc" main = "dmtestrpc.f90" link = [ "curl", "z" ] +[[test]] +name = "dmtestrts" +main = "dmtestrts.f90" + [[test]] name = "dmteststring" main = "dmteststring.f90" diff --git a/guide/guide.adoc b/guide/guide.adoc index 68b8593..a471643 100644 --- a/guide/guide.adoc +++ b/guide/guide.adoc @@ -822,8 +822,8 @@ different feeds. Run <> to generate a valid UUID4. The time stamp of the feed in the updated element is set to the date and time of the last log message. If no logs have been added to the database since the last -file modification time of the feed, the output file is not updated, unless -argument `--force` is passed. +file modification of the feed, the output file is not updated, unless argument +`--force` is passed. If an XSLT style sheet is given, web browsers may be able to display the Atom feed in HTML format. Set the option to the (relative) path of the public XSL on @@ -3458,7 +3458,7 @@ error=0 |=== | Attribute | Type | Size | Description -| `node_id` | string | 32 | Node id (`-0-9A-Za-z`). +| `node_id` | string | 32 | Node id (`-0-9A-Z_a-z`). | `address` | string | 45 | IPv4/IPv6 address of client. | `client` | string | 32 | Client software name and version. | `time_sent` | string | 32 | Date and time heartbeat was sent (ISO 8601). @@ -3675,7 +3675,7 @@ LOG%MESSAGE="dummy log message", |=== | Attribute | Type | Size | Description -| `id` | string | 32 | Node id (`-0-9A-Za-z`). +| `id` | string | 32 | Node id (`-0-9A-Z_a-z`). | `name` | string | 32 | Node name. | `meta` | string | 32 | Node description (optional). | `x` | double | 8 | Node x or easting (optional). @@ -3759,12 +3759,12 @@ NODE%Z=0.0, | Attribute | Type | Size | Description | `id` | string | 32 | Observation id (UUID4). -| `node_id` | string | 32 | Node id (`-0-9A-Za-z`). -| `sensor_id` | string | 32 | Sensor id (`-0-9A-Za-z`). -| `target_id` | string | 32 | Target id (`-0-9A-Za-z`). -| `name` | string | 32 | Observation name (`-0-9A-Za-z`). -| `source` | string | 32 | Observation source or name of origin (`-0-9A-Za-z`). +| `node_id` | string | 32 | Node id (`-0-9A-Z_a-z`). +| `sensor_id` | string | 32 | Sensor id (`-0-9A-Z_a-z`). +| `target_id` | string | 32 | Target id (`-0-9A-Z_a-z`). +| `name` | string | 32 | Observation name (`-0-9A-Z_a-z`). | `timestamp` | string | 32 | Date and time of observation (ISO 8601). +| `source` | string | 32 | Observation source or name of origin (`-0-9A-Z_a-z`). | `path` | string | 32 | Path of TTY/PTY device. | `priority` | integer | 4 | Message queue priority (>= 0). | `error` | integer | 4 | Observation <>. @@ -3772,7 +3772,7 @@ NODE%Z=0.0, | `nreceiver` | integer | 4 | Number of receivers (0 to 16). | `nrequests` | integer | 4 | Number of sensor requests (0 to 8). | `receivers` | array | 16{nbsp}×{nbsp}32 | Array of receiver names (16). -| `requests` | array | 8{nbsp}×{nbsp}1348 | Array of requests (8). +| `requests` | array | 8{nbsp}×{nbsp}1380 | Array of requests (8). |=== .Request derived type of an observation @@ -3780,6 +3780,7 @@ NODE%Z=0.0, |=== | Attribute | Type | Size | Description +| `name` | string | 32 | Request name (`-0-9A-Z_a-z`). | `timestamp` | string | 32 | Date and time of request (ISO 8601). | `request` | string | 256 | Raw request to sensor. Non-printable characters have to be escaped. | `response` | string | 256 | Raw response of sensor. Non-printable characters will be escaped. @@ -3800,7 +3801,7 @@ NODE%Z=0.0, |=== | Attribute | Type | Size | Description -| `name` | string | 8 | Response name (`-0-9A-Za-z`). +| `name` | string | 8 | Response name (`-0-9A-Z_a-z`). | `unit` | string | 8 | Response unit. | `type` | integer | 4 | Response <>. | `error` | integer | 4 | Response <>. @@ -3831,8 +3832,8 @@ NODE%Z=0.0, | 3 | `sensor_id` | Sensor id. | 4 | `target_id` | Target id. | 5 | `name` | Observation name. -| 6 | `source` | Observation source. -| 7 | `timestamp` | Date and time of observation. +| 6 | `timestamp` | Date and time of observation. +| 7 | `source` | Observation source. | 8 | `path` | Path of TTY/PTY device. | 9 | `priority` | Message queue priority. | 10 | `error` | Error code. @@ -3856,49 +3857,50 @@ NODE%Z=0.0, | 27 | `receiver` | Receiver 14. | 28 | `receiver` | Receiver 15. | 29 | `receiver` | Receiver 16. -| 30 – 765 | `requests` | Array of requests (8). -| 30 – 104 | `request` | Request 1. -| 30 | `timestamp` | Date and time of request. -| 31 | `request` | Raw request to sensor. -| 32 | `response` | Raw response of sensor. -| 33 | `delimiter` | Request delimiter. -| 34 | `pattern` | Regular expression pattern that describes the raw response. -| 35 | `delay` | Delay in mseconds to wait after the request. -| 36 | `error` | Error code. -| 37 | `mode` | Request mode. -| 38 | `retries` | Number of retries performed. -| 39 | `state` | Request state. -| 40 | `timeout` | Request timeout in mseconds. -| 41 | `nresponses` | Number of responses (0 to 16). -| 42 – 121 | `responses` | Array of responses (16). -| 42 – 46 | `response` | Response 1. -| 42 | `name` | Response 1 name. -| 43 | `unit` | Response 1 unit. -| 44 | `type` | Response 1 value type. -| 45 | `error` | Response 1 error. -| 46 | `value` | Response 1 value. -| 47 – 51 | `response` | Response 2. -| 52 – 56 | `response` | Response 3. -| 57 – 61 | `response` | Response 4. -| 62 – 66 | `response` | Response 5. -| 67 – 71 | `response` | Response 6. -| 72 – 76 | `response` | Response 7. -| 77 – 81 | `response` | Response 8. -| 82 – 86 | `response` | Response 9. -| 87 – 91 | `response` | Response 10. -| 92 – 96 | `response` | Response 11. -| 97 – 101 | `response` | Response 12. -| 102 – 106 | `response` | Response 13. -| 107 – 111 | `response` | Response 14. -| 112 – 116 | `response` | Response 15. -| 117 – 121 | `response` | Response 16. -| 122 – 213 | `request` | Request 2. -| 214 – 305 | `request` | Request 3. -| 306 – 397 | `request` | Request 4. -| 398 – 489 | `request` | Request 5. -| 490 – 581 | `request` | Request 6. -| 582 – 673 | `request` | Request 7. -| 674 – 765 | `request` | Request 8. +| 30 – 773 | `requests` | Array of requests (8). +| 30 – 105 | `request` | Request 1. +| 30 | `name` | Request name. +| 31 | `timestamp` | Date and time of request. +| 32 | `request` | Raw request to sensor. +| 33 | `response` | Raw response of sensor. +| 34 | `delimiter` | Request delimiter. +| 35 | `pattern` | Regular expression pattern that describes the raw response. +| 36 | `delay` | Delay in mseconds to wait after the request. +| 37 | `error` | Error code. +| 38 | `mode` | Request mode. +| 39 | `retries` | Number of retries performed. +| 40 | `state` | Request state. +| 41 | `timeout` | Request timeout in mseconds. +| 42 | `nresponses` | Number of responses (0 to 16). +| 43 – 122 | `responses` | Array of responses (16). +| 43 – 47 | `response` | Response 1. +| 43 | `name` | Response 1 name. +| 44 | `unit` | Response 1 unit. +| 45 | `type` | Response 1 value type. +| 46 | `error` | Response 1 error. +| 47 | `value` | Response 1 value. +| 48 – 52 | `response` | Response 2. +| 53 – 57 | `response` | Response 3. +| 58 – 62 | `response` | Response 4. +| 63 – 67 | `response` | Response 5. +| 68 – 72 | `response` | Response 6. +| 73 – 77 | `response` | Response 7. +| 78 – 82 | `response` | Response 8. +| 83 – 87 | `response` | Response 9. +| 88 – 92 | `response` | Response 10. +| 93 – 97 | `response` | Response 11. +| 98 – 102 | `response` | Response 12. +| 103 – 107 | `response` | Response 13. +| 108 – 112 | `response` | Response 14. +| 113 – 117 | `response` | Response 15. +| 118 – 122 | `response` | Response 16. +| 123 – 215 | `request` | Request 2. +| 216 – 308 | `request` | Request 3. +| 309 – 401 | `request` | Request 4. +| 402 – 494 | `request` | Request 5. +| 495 – 587 | `request` | Request 6. +| 588 – 680 | `request` | Request 7. +| 681 – 773 | `request` | Request 8. |=== .HDF5 [[data-observ-hdf5]] @@ -3913,8 +3915,8 @@ The HDF5 data-set description is too large to be fully shown in this document. "sensor_id": "dummy-sensor", "target_id": "dummy-target", "name": "dummy-observ", - "source": "dmdummy", "timestamp": "1970-01-01T00:00:00.000000+00:00", + "source": "dmdummy", "path": "/dev/null", "priority": 0, "error": 0, @@ -3927,6 +3929,7 @@ The HDF5 data-set description is too large to be fully shown in this document. ], "requests": [ { + "name": "dummy", "timestamp": "1970-01-01T00:00:00.000000+00:00", "request": "?\\n", "response": "10.0\\n", @@ -3962,8 +3965,8 @@ The HDF5 data-set description is too large to be fully shown in this document. sensor_id = "dummy-sensor", target_id = "dummy-target", name = "dummy-observ", - source = "dmdummy", timestamp = "1970-01-01T00:00:00.000000+00:00", + source = "dmdummy", path = "/dev/null", error = 0, next = 1, @@ -3973,6 +3976,7 @@ The HDF5 data-set description is too large to be fully shown in this document. receivers = { "dummy-receiver1", "dummy-receiver2" }, requests = { { + name = "dummy", timestamp = "1970-01-01T00:00:00.000000+00:00", request = "?\\n", response = "10.0\\n", @@ -4007,8 +4011,8 @@ OBSERV%NODE_ID="dummy-node", OBSERV%SENSOR_ID="dummy-sensor", OBSERV%TARGET_ID="dummy-target", OBSERV%NAME="dummy-observ", -OBSERV%SOURCE="dmdummy", OBSERV%TIMESTAMP="1970-01-01T00:00:00.000000+00:00", +OBSERV%SOURCE="dmdummy", OBSERV%PATH="/dev/null", OBSERV%PRIORITY=0, OBSERV%ERROR=0, @@ -4016,6 +4020,7 @@ OBSERV%NEXT=0, OBSERV%NRECEIVERS=2, OBSERV%NREQUESTS=1, OBSERV%RECEIVERS="dummy-receiver1","dummy-receiver2", +OBSERV%REQUESTS(1)%NAME="dummy", OBSERV%REQUESTS(1)%TIMESTAMP="1970-01-01T00:00:00.000000+00:00", OBSERV%REQUESTS(1)%REQUEST="?\n", OBSERV%REQUESTS(1)%RESPONSE="10.0\n", @@ -4036,7 +4041,6 @@ OBSERV%REQUESTS(1)%RESPONSES(1)%VALUE=10.00000000000000, / .... - === Sensor [[data-sensor]] .Sensor derived type @@ -4044,8 +4048,8 @@ OBSERV%REQUESTS(1)%RESPONSES(1)%VALUE=10.00000000000000, |=== | Attribute | Type | Size | Description -| `id` | string | 32 | Sensor id (`-0-9A-Za-z`). -| `node_id` | string | 32 | Node id (`-0-9A-Za-z`). +| `id` | string | 32 | Sensor id (`-0-9A-Z_a-z`). +| `node_id` | string | 32 | Node id (`-0-9A-Z_a-z`). | `type` | integer | 4 | <>. | `name` | string | 32 | Sensor name. | `sn` | string | 32 | Sensor serial number (optional). @@ -4169,7 +4173,7 @@ SENSOR%Z=0.0, |=== | Attribute | Type | Size | Description -| `id` | string | 32 | Target id (`-0-9A-Za-z`). +| `id` | string | 32 | Target id (`-0-9A-Z_a-z`). | `name` | string | 32 | Target name. | `meta` | string | 32 | Target description (optional). | `state` | integer | 4 | Target <> (optional). @@ -4640,20 +4644,394 @@ $ cd build/HDF_Group/HDFView/99.99.99/ $ sh hdfview.sh .... +== GeoCOM API + +All GeoCOM named parameters provided by DMPACK start with prefix `GEOCOM_`. + +[%autowidth] +|=== +| Name | Description + +| `GEOCOM_IOS_BEEP_STDINTENS` | Standard intensity of beep expressed as percentage. +| `GEOCOM_AUT_CLOCKWISE` | Direction close-wise. +| `GEOCOM_AUT_ANTICLOCKWISE` | Direction counter clock-wise. +|=== + +.GEOCOM_AUT_ADJMODE: Fine-adjust position mode [[geocom-api-aut-adjmode]] +[%autowidth] +|=== +| Name | Description + +| `GEOCOM_AUT_NORM_MODE` | Angle tolerance. +| `GEOCOM_AUT_POINT_MODE` | Point tolerance. +| `GEOCOM_AUT_DEFINE_MODE` | System independent positioning tolerance. +|=== + +.GEOCOM_AUT_ATRMODE: Automatic target recognition mode [[geocom-api-aut-atrmode]] +[%autowidth] +|=== +| Name | Description + +| `GEOCOM_AUT_POSITION` | Positioning to Hz and V angle. +| `GEOCOM_AUT_TARGET` | Positioning to a target in the env. of the Hz and V angle. +|=== + +.GEOCOM_AUT_POSMODE: Position precision [[geocom-api-aut-posmode]] +[%autowidth] +|=== +| Name | Description + +| `GEOCOM_AUT_NORMAL` | Fast positioning mode. +| `GEOCOM_AUT_PRECISE` | Exact positioning mode. +| `GEOCOM_AUT_FAST` | For TM30/TS30. +|=== + +.GEOCOM_BAP_ATRSETTING: ATR low-vis mode definition [[geocom-api-bap-atrsetting]] +[%autowidth] +|=== +| Name | Description + +| `GEOCOM_BAP_ATRSET_NORMAL` | ATR is using no special flags or modes. +| `GEOCOM_BAP_ATRSET_LOWVIS_ON` | ATR low-vis mode on. +| `GEOCOM_BAP_ATRSET_LOWVIS_AON` | ATR low-vis mode always on. +| `GEOCOM_BAP_ATRSET_SRANGE_ON` | ATR high-reflectivity mode on. +| `GEOCOM_BAP_ATRSET_SRANGE_AON` | ATR high-reflectivity mode always on. +|=== + +.GEOCOM_BAP_MEASURE_PRG: Measurement modes [[geocom-api-bap-measure-prg]] +[%autowidth] +|=== +| Name | Description + +| `GEOCOM_BAP_NO_MEAS` | No measurements, take last one. +| `GEOCOM_BAP_NO_DIST` | No distance measurement, angles only. +| `GEOCOM_BAP_DEF_DIST` | Default distance measurements. +| `GEOCOM_BAP_CLEAR_DIST` | Clear distances. +| `GEOCOM_BAP_STOP_TRK` | Stop tracking. +|=== + +.GEOCOM_BAP_PRISMTYPE: Prism type definition [[geocom-api-bap-prismtype]] +[%autowidth] +|=== +| Name | Description + +| `GEOCOM_BAP_PRISM_ROUND` | Leica Circular Prism. +| `GEOCOM_BAP_PRISM_MINI` | Leica Mini Prism. +| `GEOCOM_BAP_PRISM_TAPE` | Leica Reflector Tape. +| `GEOCOM_BAP_PRISM_360` | Leica 360° Prism. +| `GEOCOM_BAP_PRISM_USER1` | Not supported by TPS1200. +| `GEOCOM_BAP_PRISM_USER2` | Not supported by TPS1200. +| `GEOCOM_BAP_PRISM_USER3` | Not supported by TPS1200. +| `GEOCOM_BAP_PRISM_360_MINI` | Leica Mini 360° Prism +| `GEOCOM_BAP_PRISM_MINI_ZERO` | Leica Mini Zero Prism. +| `GEOCOM_BAP_PRISM_USER` | User-defined Prism. +| `GEOCOM_BAP_PRISM_NDS_TAPE` | Leica HDS Target. +| `GEOCOM_BAP_PRISM_GRZ121_ROUND` | GRZ121 360º Prism for Machine Guidance. +| `GEOCOM_BAP_PRISM_MA_MPR122` | MPR122 360º Prism for Machine Guidance. +|=== + +.GEOCOM_BAP_REFLTYPE: Reflector type definition [[geocom-api-bap-refltype]] +[%autowidth] +|=== +| Name | Description + +| `GEOCOM_BAP_REFL_UNDEF` | Reflector not defined. +| `GEOCOM_BAP_REFL_PRISM` | Reflector prism. +| `GEOCOM_BAP_REFL_TAPE` | Reflector tape. +|=== + +.GEOCOM_BAP_TARGET_TYPE: Target type definition [[geocom-api-bap-target-type]] +[%autowidth] +|=== +| Name | Description + +| `GEOCOM_BAP_REFL_USE` | With reflector. +| `GEOCOM_BAP_REFL_LESS` | Without reflector. +|=== + +.GEOCOM_BAP_USER_MEASPRG: Distance measurement programs [[geocom-api-bap-user-measprg]] +[%autowidth] +|=== +| Name | Description + +| `GEOCOM_BAP_SINGLE_REF_STANDARD` | IR standard. +| `GEOCOM_BAP_SINGLE_REF_FAST` | IR fast. +| `GEOCOM_BAP_SINGLE_REF_VISIBLE` | LO standard. +| `GEOCOM_BAP_SINGLE_RLESS_VISIBLE` | RL standard. +| `GEOCOM_BAP_CONT_REF_STANDARD` | IR tracking. +| `GEOCOM_BAP_CONT_REF_FAST` | Not supported by TPS1200. +| `GEOCOM_BAP_CONT_RLESS_VISIBLE` | RL fast tracking. +| `GEOCOM_BAP_AVG_REF_STANDARD` | IR average. +| `GEOCOM_BAP_AVG_REF_VISIBLE` | LO average. +| `GEOCOM_BAP_AVG_RLESS_VISIBLE` | RL average. +| `GEOCOM_BAP_CONT_REF_SYNCHRO` | IR synchro-tracking. +| `GEOCOM_BAP_SINGLE_REF_PRECISE` | IR precise (TM30/TS30). +|=== + +.GEOCOM_COM_BAUD_RATE: Baud rate [[geocom-api-com-baud-rate]] +[%autowidth] +|=== +| Name | Description + +| `GEOCOM_COM_BAUD_2400` | 2400 baud. +| `GEOCOM_COM_BAUD_4800` | 4800 baud. +| `GEOCOM_COM_BAUD_9600` | 9600 baud. +| `GEOCOM_COM_BAUD_19200` | 19200 baud (default). +| `GEOCOM_COM_BAUD_38400` | 38400 baud. +| `GEOCOM_COM_BAUD_57600` | 57600 baud. +| `GEOCOM_COM_BAUD_115200` | 115200 baud. +|=== + +.GEOCOM_COM_FORMAT: Transmission data format [[geocom-api-com-format]] +[%autowidth] +|=== +| Name | Description + +| `GEOCOM_COM_ASCII` | ASCII protocol. +| `GEOCOM_COM_BINARY` | Binary protocol. +|=== + +.GEOCOM_CSV_POWER_PATH: Power sources [[geocom-api-csv-power-path]] +[%autowidth] +|=== +| Name | Description + +| `GEOCOM_CSV_EXTERNAL_POWER` | Power source is external. +| `GEOCOM_CSV_INTERNAL_POWER` | Power source is the internal battery. +|=== + +.GEOCOM_COM_TPS_STARTUP_MODE: Start mode [[geocom-api-tps-startup-mode]] +[%autowidth] +|=== +| Name | Description + +| `GEOCOM_COM_STARTUP_LOCAL` | Not supported by TPS1200. +| `GEOCOM_COM_STARTUP_REMOTE` | RPC is enabled (online mode). +|=== + +.GEOCOM_COM_TPS_STOP_MODE: Stop mode [[geocom-api-tps-stop-mode]] +[%autowidth] +|=== +| Name | Description + +| `GEOCOM_COM_STOP_SHUT_DOWN` | Power down instrument. +| `GEOCOM_COM_STOP_SLEEP` | Not supported by TPS1200. +|=== + +.GEOCOM_EDM_EGLINTENSITY_TYPE: Intensity of Electronic Guidelight (EGL) [[geocom-api-egl-intensity-type]] +[%autowidth] +|=== +| Name | Description + +| `GEOCOM_EDM_EGLINTEN_OFF` | Off. +| `GEOCOM_EDM_EGLINTEN_LOW` | Low intensity. +| `GEOCOM_EDM_EGLINTEN_MID` | Medium intensity. +| `GEOCOM_EDM_EGLINTEN_HIGH` | High intensity. +|=== + +.GEOCOM_EDM_MODE: EDM measurement mode [[geocom-api-edm-mode]] +[%autowidth] +|=== +| Name | Description + +| `GEOCOM_EDM_MODE_NOT_USED` | Initial value. +| `GEOCOM_EDM_SINGLE_TAPE` | IR standard Reflector Tape. +| `GEOCOM_EDM_SINGLE_STANDARD` | IR standard. +| `GEOCOM_EDM_SINGLE_FAST` | IR fast. +| `GEOCOM_EDM_SINGLE_LRANGE` | LO standard. +| `GEOCOM_EDM_SINGLE_SRANGE` | RL standard. +| `GEOCOM_EDM_CONT_STANDARD` | Standard repeated measurement. +| `GEOCOM_EDM_CONT_DYNAMIC` | IR tacking. +| `GEOCOM_EDM_CONT_REFLESS` | RL tracking. +| `GEOCOM_EDM_CONT_FAST` | Fast repeated measurement. +| `GEOCOM_EDM_AVERAGE_IR` | IR average. +| `GEOCOM_EDM_AVERAGE_SR` | RL average. +| `GEOCOM_EDM_AVERAGE_LR` | LO average. +| `GEOCOM_EDM_PRECISE_IR` | IR precise (TM30, TS30). +| `GEOCOM_EDM_PRECISE_TAPE` | IR precise Reflector Tape (TM30, TS30). +|=== + +.GEOCOM_FTR_DEVICETYPE: Device type [[geocom-api-ftr-devicetype]] +[%autowidth] +|=== +| Name | Description + +| `GEOCOM_FTR_DEVICE_INTERNAL` | Internal memory module. +| `GEOCOM_FTR_DEVICE_PCPARD` | External memory card. +|=== + +.GEOCOM_FTR_FILETYPE: File type [[geocom-api-ftr-filetype]] +[%autowidth] +|=== +| Name | Description + +| `GEOCOM_FTR_FILE_UNKNOWN` | Undocumented (0). +| `GEOCOM_FTR_FILE_IMAGES` | Extension wildcard: `*.jpg`. +|=== + +.GEOCOM_IMG_MEM_TYPE: Memory device type [[geocom-api-img-mem-type]] +[%autowidth] +|=== +| Name | Description + +| `GEOCOM_IMG_INTERNAL_MEMORY` | Internal memory module. +| `GEOCOM_IMG_PC_CARD` | External memory card. +|=== + +.GEOCOM_MOT_LOCK_STATUS: Lock conditions [[geocom-api-mot-lock-status]] +[%autowidth] +|=== +| Name | Description + +| `GEOCOM_MOT_LOCKED_OUT` | Locked out. +| `GEOCOM_MOT_LOCKED_IN` | Locked in. +| `GEOCOM_MOT_PREDICTION` | Prediction mode. +|=== + +.GEOCOM_MOT_MODE: Controller configuration [[geocom-api-mot-mode]] +[%autowidth] +|=== +| Name | Description + +| `GEOCOM_MOT_POSIT` | Configured for relative positioning. +| `GEOCOM_MOT_OCONST` | Configured for constant speed. +| `GEOCOM_MOT_MANUPOS` | Configured for manual positioning (default setting). +| `GEOCOM_MOT_LOCK` | Configured as “Lock-in” controller. +| `GEOCOM_MOT_BREAK` | Configured as “Brake” controller. +| `GEOCOM_MOT_TERM` | Terminates the controller task. +|=== + +.GEOCOM_MOT_STOPMODE: Controller stop mode [[geocom-api-mot-stopmode]] +[%autowidth] +|=== +| Name | Description + +| `GEOCOM_MOT_NORMAL` | Slow down with current acceleration. +| `GEOCOM_MOT_SHUTDOWN` | Slow down by switch off power supply. +|=== + +.GEOCOM_SUP_AUTO_POWER: Automatic shutdown mechanism for the system [[geocom-api-sup-auto-power]] +[%autowidth] +|=== +| Name | Description + +| `GEOCOM_SUP_POWER_DISABLED` | Instrument remains on. +| `GEOCOM_SUP_POWER_OFF` | Turns off mechanism. +|=== + +.GEOCOM_TMC_FACE: Actual face [[geocom-api-tmc-face]] +[%autowidth] +|=== +| Name | Description + +| `GEOCOM_TMC_FACE_1` | Position 1 of telescope. +| `GEOCOM_TMC_FACE_2` | Position 2 of telescope. +|=== + +.GEOCOM_TMC_FACE_DEF: Face position [[geocom-api-tmc-face-def]] +[%autowidth] +|=== +| Name | Description + +| `GEOCOM_TMC_FACE_NORMAL` | Face in normal position. +| `GEOCOM_TMC_FACE_TURN` | Face turned. +|=== + +.GEOCOM_TMC_INCLINE_PRG: Inclination sensor measurement program [[geocom-api-tmc-incline-prg]] +[%autowidth] +|=== +| Name | Description + +| `GEOCOM_TMC_MEA_INC` | Use sensor (_a priori_ sigma). +| `GEOCOM_TMC_AUTO_INC` | Automatic mode (sensor/plane). +| `GEOCOM_TMC_PLANE_INC` | Use plane (_a priori_ sigma). +|=== + +.GEOCOM_TMC_MEASURE_PRG: TMC measurement mode [[geocom-api-tmc-measure-prg]] +[%autowidth] +|=== +| Name | Description + +| `GEOCOM_TMC_STOP` | Stop measurement program. +| `GEOCOM_TMC_DEF_DIST` | Default distance measurement program. +| `GEOCOM_TMC_CLEAR` | `GEOCOM_TMC_STOP` and clear data. +| `GEOCOM_TMC_SIGNAL` | Signal measurement (test function). +| `GEOCOM_TMC_DO_MEASURE` | (Re-)start measurement task. +| `GEOCOM_TMC_RTRK_DIST` | Distance-TRK measurement program. +| `GEOCOM_TMC_RED_TRK_DIST` | Reflectorless tracking. +| `GEOCOM_TMC_FREQUENCY` | Frequency measurement (test). +|=== + +.GEOCOM_TPS_DEVICE_CLASS: TPS device precision class [[geocom-api-tps-device-class]] +[%autowidth] +|=== +| Name | Description + +| `GEOCOM_TPS_CLASS_1100` | TPS1000 family member, 1 mgon, 3 ". +| `GEOCOM_TPS_CLASS_1700` | TPS1000 family member, 0.5 mgon, 1.5 ". +| `GEOCOM_TPS_CLASS_1800` | TPS1000 family member, 0.3 mgon, 1 ". +| `GEOCOM_TPS_CLASS_5000` | TPS2000 family member. +| `GEOCOM_TPS_CLASS_6000` | TPS2000 family member. +| `GEOCOM_TPS_CLASS_1500` | TPS1000 family member. +| `GEOCOM_TPS_CLASS_2003` | TPS2000 family member. +| `GEOCOM_TPS_CLASS_5005` | TPS5000 family member. +| `GEOCOM_TPS_CLASS_5100` | TPS5000 family member. +| `GEOCOM_TPS_CLASS_1102` | TPS1100 family member, 2 ". +| `GEOCOM_TPS_CLASS_1103` | TPS1100 family member, 3 ". +| `GEOCOM_TPS_CLASS_1105` | TPS1100 family member, 5 ". +| `GEOCOM_TPS_CLASS_1101` | TPS1100 family member, 1 ". +| `GEOCOM_TPS_CLASS_1202` | TPS1200 family member, 2 ". +| `GEOCOM_TPS_CLASS_1203` | TPS1200 family member, 3 ". +| `GEOCOM_TPS_CLASS_1205` | TPS1200 family member, 5 ". +| `GEOCOM_TPS_CLASS_1201` | TPS1200 family member, 1 ". +| `GEOCOM_TPS_CLASS_TX30` | TS30, TM30 family member, 0.5 ". +| `GEOCOM_TPS_CLASS_TX31` | TS30, TM30 family member, 1 ". +|=== + +.GEOCOM_TPS_DEVICE_TYPE: TPS device configuration type [[geocom-api-tps-device-type]] +[%autowidth] +|=== +| Name | Description + +| `GEOCOM_TPS_DEVICE_T` | Theodolite without built-in EDM. +| `GEOCOM_TPS_DEVICE_MOT` | Motorised device. +| `GEOCOM_TPS_DEVICE_ATR` | Automatic Target Recognition (ATR). +| `GEOCOM_TPS_DEVICE_EGL` | Electronic Guide Light (EGL). +| `GEOCOM_TPS_DEVICE_DB` | Reserved (database, not GSI). +| `GEOCOM_TPS_DEVICE_DL` | Diode laser. +| `GEOCOM_TPS_DEVICE_LP` | Laser plumbed. +| `GEOCOM_TPS_DEVICE_TC1` | Tachymeter (TCW1). +| `GEOCOM_TPS_DEVICE_TC2` | Tachymeter (TCW2). +| `GEOCOM_TPS_DEVICE_TC` | Tachymeter (TCW3). +| `GEOCOM_TPS_DEVICE_TCR` | Tachymeter (TCW3 with red laser). +| `GEOCOM_TPS_DEVICE_ATC` | Auto-collimation lamp (used only PMU). +| `GEOCOM_TPS_DEVICE_LPNT` | Laser pointer. +| `GEOCOM_TPS_DEVICE_RL_EXT` | Reflectorless EDM with extended range (Pinpoint R100, R300). +| `GEOCOM_TPS_DEVICE_PS` | PowerSearch. +| `GEOCOM_TPS_DEVICE_SIM` | Runs on simulation, no hardware. +|=== + +.GEOCOM_TPS_REFLESS_CLASS: Reflectorless class [[geocom-api-tps-refless-class]] +[%autowidth] +|=== +| Name | Description + +| `GEOCOM_TPS_REFLESS_NONE` | None. +| `GEOCOM_TPS_REFLESS_R100` | Pinpoint R100. +| `GEOCOM_TPS_REFLESS_R300` | Pinpoint R300. +| `GEOCOM_TPS_REFLESS_R400` | Pinpoint R400. +| `GEOCOM_TPS_REFLESS_R1000` | Pinpoint R1000. +|=== + == Lua API [[lua-api]] -Parts of the DMPACK library are exposed to Lua through a distinct API. All log -levels are exported: +Parts of the DMPACK library are exposed to Lua through a distinct API. Log +levels and error codes are registered as named constants. The GeoCOM API +includes functions and named parameters for request preparation. -* `LOG_NONE` – No log level (0). -* `LOG_DEBUG` – Debug level (1). -* `LOG_INFO` – Information level (2). -* `LOG_WARNING` – Warning level (3). -* `LOG_ERROR` – Error level (4). -* `LOG_CRITICAL` – Critical error level (5). +=== Functions -Furthermore, all <> are registered, starting -with `E_NONE`, as well as the following Lua functions: +The following utility functions are exported to convert units: * `deg2gon(deg)` – Converts degrees to gon. * `deg2rad(deg)` – Converts degrees to radiants. @@ -4662,23 +5040,1141 @@ with `E_NONE`, as well as the following Lua functions: * `rad2deg(rad)` – Converts radiants to degrees. * `rad2gon(rad)` – Converts radiants to gon. -At the moment, the Lua API is used only for configuration file handling and -observation processing. Load the shared library `libdmpack.so` from Lua to -import the functions, for example: +The Lua functions may be called inside of configuration files. For testing, load +the shared library `libdmpack.so` first, for example: [source,lua] .... --- Import the shared library `libdmpack.so`. The file must be --- located in the Lua search path. +-- Import the shared library `libdmpack.so`. +-- The file must be located in the Lua search path. require("libdmpack") --- Convert angle from [deg] to [gon]. -deg = 360.0 -gon = deg2gon(deg) +-- Convert angle from [deg] to [gon]. Output: 400.0 +gon = deg2gon(360.0) print(gon) --- Output: 400.0 .... +=== GeoCOM + +The GeoCOM API for Lua is used to automate the creation of observation requests +in DMPACK configuration files. The official GeoCOM API is divided into the +following sub-systems: + +* `AUT` – Automation. +* `BAP` – Basic Applications. +* `BMM` – Basic Man-Machine Interface. +* `COM` – Communication Settings. +* `CSV` – Central Services. +* `EDM` – Electronic Distance Measurement. +* `FTR` – File Transfer. +* `IMG` – Image Processing. +* `MOT` – Motorisation. +* `SUP` – Supervisor. +* `TMC` – Theodolite Measurement and Calculation. + +The Lua function names do not match the GeoCOM API names. All functions start +with prefix `geocom_`, all named parameters with `GEOCOM_`. The names of the +requests are set to the name of the respective function without the prefix. + +[%autowidth] +|=== +| GeoCOM API | Lua API + +| `AUS_GetUserAtrState` | <> +| `AUS_GetUserLockState` | <> +| `AUS_SetUserAtrState` | <> +| `AUS_SetUserLockState` | <> +| `AUT_ChangeFace` | <> +| `AUT_FineAdjust` | <> +| `AUT_GetFineAdjustMode` | <> +| `AUT_GetSearchArea` | <> +| `AUT_GetUserSpiral` | <> +| `AUT_LockIn` | <> +| `AUT_MakePositioning` | <> +| `AUT_PS_EnableRange` | <> +| `AUT_PS_SearchNext` | <> +| `AUT_PS_SearchWindow` | <> +| `AUT_PS_SetRange` | <> +| `AUT_ReadTimeout` | <> +| `AUT_ReadTol` | <> +| `AUT_Search` | <> +| `AUT_SetFineAdjustMode` | <> +| `AUT_SetSearchArea` | <> +| `AUT_SetTimeout` | <> +| `AUT_SetTol` | <> +| `AUT_SetUserSpiral` | <> +| `BAP_GetATRSetting` | <> +| `BAP_GetMeasPrg` | <> +| `BAP_GetPrismDef` | <> +| `BAP_GetRedATRFov` | <> +| `BAP_GetTargetType` | <> +| `BAP_GetUserPrismDef` | <> +| `BAP_SearchTarget` | <> +| `BAP_SetATRSetting` | <> +| `BAP_SetAtmCorr` | <> +| `BAP_SetAtmPpm` | <> +| `BAP_SetMeasPrg` | <> +| `BAP_SetPrismType2` | <> +| `BAP_SetPrismType` | <> +| `BAP_SetRedATRFov` | <> +| `BAP_SetTargetType` | <> +| `BAP_SetUserPrismDef` | <> +| `BMM_BeepAlarm` | <> +| `BMM_BeepNormal` | <> +| `COM_GetBinaryAvailable` | <> +| `COM_GetDoublePrecision` | <> +| `COM_GetSWVersion` | <> +| `COM_NullProc` | <> +| `COM_SetBinaryAvailable` | <> +| `COM_SetDoublePrecision` | <> +| `COM_SwitchOffTPS` | <> +| `COM_SwitchOffTPS` | <> +| `CSV_CheckPower` | <> +| `CSV_GetDateTimeCentiSec` | <> +| `CSV_GetDateTime` | <> +| `CSV_GetDeviceConfig` | <> +| `CSV_GetInstrumentName` | <> +| `CSV_GetInstrumentNo` | <> +| `CSV_GetIntTemp` | <> +| `CSV_GetReflectorlessClass` | <> +| `CSV_GetSWVersion` | <> +| `CSV_SetDateTime` | <> +| `EDM_GetEglIntensity` | <> +| `EDM_Laserpointer` | <> +| `EDM_SetEglIntensity` | <> +| `FTR_AbortDownload` | <> +| `FTR_AbortList` | <> +| `FTR_Delete` | <> +| `FTR_Download` | <> +| `FTR_List` | <> +| `FTR_SetupDownload` | <> +| `FTR_SetupList` | <> +| `IMG_GetTccConfig` | <> +| `IMG_SetTccConfig` | <> +| `IMG_TakeTccImage` | <> +| `IOS_BeepOff` | <> +| `IOS_BeepOn` | <> +| `MOT_ReadLockStatus` | <> +| `MOT_SetVelocity` | <> +| `MOT_StartController` | <> +| `MOT_StopController` | <> +| `SUP_GetConfig` | <> +| `SUP_SetConfig` | <> +| `TMC_DoMeasure` | <> +| `TMC_GeoPpm` | <> +| `TMC_GetAngSwitch` | <> +| `TMC_GetAngle1` | <> +| `TMC_GetAngle5` | <> +| `TMC_GetAtmCorr` | <> +| `TMC_GetAtmPpm` | <> +| `TMC_GetCoordinate` | <> +| `TMC_GetEdmMode` | <> +| `TMC_GetFace` | <> +| `TMC_GetFullMeas` | <> +| `TMC_GetHeight` | <> +| `TMC_GetInclineSwitch` | <> +| `TMC_GetPrismCorr` | <> +| `TMC_GetPrismType2` | <> +| `TMC_GetPrismType` | <> +| `TMC_GetQuickDist` | <> +| `TMC_GetRefractiveMethod` | <> +| `TMC_GetSignal` | <> +| `TMC_GetSimpleCoord` | <> +| `TMC_GetSimpleMea` | <> +| `TMC_GetSlopeDistCorr` | <> +| `TMC_GetStation` | <> +| `TMC_IfDataAzeCorrError` | <> +| `TMC_IfDataIncCorrError` | <> +| `TMC_QuickDist` | <> +| `TMC_SetAngSwitch` | <> +| `TMC_SetEdmMode` | <> +| `TMC_SetGeoPpm` | <> +| `TMC_SetHandDist` | <> +| `TMC_SetHeight` | <> +| `TMC_SetInclineSwitch` | <> +| `TMC_SetOrientation` | <> +| `TMC_SetPrismCorr` | <> +| `TMC_SetRefractiveMethod` | <> +| `TMC_SetStation` | <> +|=== + + +==== geocom_abort_download() [[lua-api-geocom-abort-download]] + +Returns request of *FTR_AbortDownload* procedure. Creates request to abort or end the +file download command. + +==== geocom_abort_list() [[lua-api-geocom-abort-list]] + +Returns request of *FTR_AbortList* procedure. Creates request to abort or end +the file list command. + +==== geocom_beep_alarm() [[lua-api-geocom-beep-alarm]] + +Returns request of *BMM_BeepAlarm* procedure. Creates request to output an alarm +signal (triple beep). + +==== geocom_beep_normal() [[lua-api-geocom-beep-normal]] + +Returns request of *BMM_BeepNormal* procedure. Creates request to output an +alarm signal (single beep). + +==== geocom_beep_off() [[lua-api-geocom-beep-off]] + +Returns request of *IOS_BeepOff* procedure. Creates request to stop an active +beep signal. + +==== geocom_beep_on(intensity) [[lua-api-geocom-beep-on]] + +* `intensity` (_integer_) – Intensity of the beep signal. + +Returns request of *IOS_BeepOn* procedure. Creates request for continuous beep +signal of given `intensity` from 0 to 100. The constant +`GEOCOM_IOS_BEEP_STDINTENS` sets the intensity to 100. + +==== geocom_change_face(pos_mode, atr_mode) [[lua-api-geocom-change-face]] + +* `pos_mode` (_integer_) – Position mode (<>). +* `atr_mode` (_integer_) – ATR mode (<>). + +Returns request of *AUT_ChangeFace* procedure. Creates request for turning the +telescope to the other face. + +If `pos_mode` is `GEOCOM_AUT_NORMAL`, the instrument uses the current value of +the compensator. For positioning distances > 25 gon, this mode might tend to +inaccuracy. If set to `GEOCOM_AUT_PRECISE`, it tries to measure the exact +inclination of the target. Tends to long positioning time. + +If `atr_mode` is `GEOCOM_AUT_POSITION`, the instrument uses conventional +positioning to other face. If set to `GEOCOM_AUT_TARGET`, it tries to position +into a target in the destination area. This mode requires activated ATR. + +==== geocom_delete(device_type, file_type, day, month, year, file_name) [[lua-api-geocom-delete]] + +* `device_type` (_integer_) – Internal memory or memory card (<>). +* `file_type` (_integer_) – Type of file (<>). +* `day` (_integer_) – Day (`DD`). +* `month` (_integer_) – Month (`MM`). +* `year` (_integer_) – Year (`YY`). +* `file_name` (_string_) – Name of file to delete. + +Returns request of *FTR_Delete* procedure. Creates request for deleting one or +more files. Wildcards may be used to delete multiple files. If the deletion date +is valid, only files older than the deletion date are deleted. + +==== geocom_do_measure(tmc_prog, inc_mode) [[lua-api-geocom-do-measure]] + +* `tmc_prog` (_integer_) – TMC measurement program (<>). +* `inc_mode` (_integer_) – Inclination measurement mode (<>). + +Returns request of *TMC_DoMeasure* procedure. Creates request for trying a +distance measurement. This command does not return any values. If a distance +measurement is performed in measurement program `GEOCOM_TMC_DEF_DIST`, the +distance sensor will work with the set EDM mode. + +==== geocom_download(block_number) [[lua-api-geocom-download]] + +* `block_number` (_integer_) – Block number to download (0 – 65535). + +Returns request of *FTR_Download* procedure. Creates request to get a single +block of data. The *FTR_SetupDownload* command has to be called first. The block +sequence starts with 1. The download process will be aborted if the block number +is set to 0. The maximum block number is 65535. The file size is therefore +limited to 28 MiB. The function should not be used inside of configuration +files. + +==== geocom_fine_adjust(search_hz, search_v) [[lua-api-geocom-fine-adjust]] + +* `search_hz` (_number_) – Search range, Hz axis [rad]. +* `search_v` (_number_) – Search range, V axis [rad]. + +Returns request of *AUT_FineAdjust* procedure. Creates request for automatic +target positioning. + +The procedure positions the telescope onto the target prosm and measures the ATR +Hz and V deviations. If the target is not within the visible area of the ATR +sensor (field of view), a target search will be executed. The target search +range is limited by the parameter `search_v` in V direction, and by parameter +`search_hz` in Hz direction. If no target was found, the instrument turns back +to the initial start position. + +The Fine Adjust Lock-in towards a target is terminated by this procedure call. +After positioning, the _lock_ mode will be active. The timeout of the operation +is set to 5 seconds, regardless of the general position timeout settings. The +position tolerance depends on the previously selected find adjust mode. + +The tolerance settings have no influence to this operation. The tolerance +settings and the ATR precision depend on the instrument class and the used EDM +mode. + +==== geocom_get_angle(inc_mode) [[lua-api-geocom-get-angle]] + +* `inc_mode` (_integer_) – Inclination measurement mode (<>). + +Returns request of *TMC_GetAngle5* procedure. Creates request for returning a +simple angle measurement. The function starts an angle measurement and returns +the results. + +==== geocom_get_angle_complete(inc_mode) [[lua-api-geocom-get-angle-complete]] + +* `inc_mode` (_integer_) – Inclination measurement mode (<>). + +Returns request of *TMC_GetAngle1* procedure. Creates request for returning a +complete angle measurement. The function starts an angle and, depending on the +configuration, an inclination measurement, and returns the results. + +==== geocom_get_angular_correction_status() [[lua-api-geocom-get-angular-correction-status]] + +Returns request of *TMC_GetAngSwitch* procedure. Creates request for getting the +angular correction status. + +==== geocom_get_atmospheric_correction() [[lua-api-geocom-get-atmospheric-correction]] + +Returns request of *TMC_GetAtmCorr* procedure. Creates request for getting the +atmospheric correction parameters + +==== geocom_get_atmospheric_ppm() [[lua-api-geocom-get-atmospheric-ppm]] + +Returns request of *TMC_GetAtmPpm* procedure. Creates request for getting the +atmospheric ppm correction factor. + +==== geocom_get_atr_error() [[lua-api-geocom-get-atr-error]] + +Returns request of *TMC_IfDataAzeCorrError* procedure. Creates request for +getting the ATR error status. + +==== geocom_get_atr_setting() [[lua-api-geocom_get-atr-setting]] + +Returns request of *BAP_GetATRSetting* procedure. Creates request for getting +the current ATR low-vis mode. + +==== geocom_get_binary_mode() [[lua-api-geocom_get-binary-mode]] + +Returns request of *COM_GetBinaryAvailable* procedure. Creates request for +getting the binary attribute of the server. + +==== geocom_get_config() [[lua-api-geocom_get-config]] + +Returns request of *SUP_GetConfig* procedure. Creates request for getting the +power management configuration status. The power timeout specifies the time +after which the device switches into the mode indicated by response `autopwr`. + +==== geocom_get_coordinate(wait_time, inc_mode) [[lua-api-geocom-get-coordinate]] + +* `wait_time` (_integer_) – Delay to wait for the distance measurement to finish [ms]. +* `inc_mode` (_integer_) – Inclination measurement mode (<>). + +Returns request of *TMC_GetCoordinate* procedure. Creates request for getting +the coordinates of a measured point. + +This function conducts an angle and, in dependence of the selected `inc_mode`, +an inclination measurement, and the calculates the coordinates of the measured +point with the last distance. The argument `wait_time` specifies the delay to +wait for the distance measurement to finish. Single and tracking measurements +are supported. The quality of the result is returned in the GeoCOM return code. + +==== geocom_get_date_time() [[lua-api-geocom-get-date-time]] + +Returns request of *CSV_GetDateTime* procedure. Creates request for getting the +current date and time of the instrument. A possible response may look like +`%R1P,0,0:0,1996,'07','19','10','13','2f'`. + +==== geocom_get_date_time_centi() [[lua-api-geocom-get-date-time-centi]] + +Returns request of *CSV_GetDateTimeCentiSec* procedure. Creates request for +getting the current date and time of the instrument, including centiseconds. + +==== geocom_get_device_config() [[lua-api-geocom-get-device-config]] + +Returns request of *CSV_GetDeviceConfig* procedure. Creates request for getting +the instrument configuration. + +==== geocom_get_double_precision() [[lua-api-geocom-get-double-precision]] + +Returns request of *COM_GetDoublePrecision* procedure. Creates request for +getting the double precision setting – the number of digits to the right of the +decimal point – when double floating-point values are transmitted. + +==== geocom_get_edm_mode() [[lua-api-geocom-get-edm-mode]] + +Returns request of *TMC_GetEdmMode* procedure. Creates request for getting the +EDM measurement mode. + +==== geocom_get_egl_intensity() [[lua-api-geocom-get-egl-intensity]] + +Returns request of *EDM_GetEglIntensity* procedure. Creates request for getting +the value of the intensity of the electronic guide light (EGL). + +==== geocom_get_face() [[lua-api-geocom-get-face]] + +Returns request of *TMC_GetFace* procedure. Creates request for getting the face +of the current telescope position. + +==== geocom_get_fine_adjust_mode() [[lua-api-geocom-get-fine-adjust-mode]] + +Returns request of *AUT_GetFineAdjustMode* procedure. Creates request for +getting the fine adjustment positioning mode. + +==== geocom_get_full_measurement(wait_time, inc_mode) [[lua-api-geocom-get-full-measurement]] + +* `wait_time` (_integer_) – Delay to wait for the distance measurement to finish [ms]. +* `inc_mode` (_integer_) – Inclination measurement mode (<>). + +Returns request of *TMC_GetFullMeas* procedure. The GeoCOM function returns +angle, inclination, and distance measurement data, including accuracy and +measurement time. This command does not issue a new distance measurement. A +distance measurement has to be started in advance. If the distance is valid, the +function ignores `wait_time` and returns the results immediately. If no valid +distance is available, and the measurement unit is not activated, the angle +measurement result is retuned after the waiting time. + +==== geocom_get_geocom_version() [[lua-api-geocom-get-geocom-version]] + +Returns request of *COM_GetSWVersion* procedure. Creates request for getting the +GeoCOM server software version. + +==== geocom_get_geometric_ppm() [[lua-api-geocom-get-geometric-ppm]] + +Returns request of *TMC_GeoPpm* procedure. Creates request for getting the +geometric ppm correction factor. + +==== geocom_get_height() [[lua-api-geocom-get-height]] + +Returns request of *TMC_GetHeight* procedure. Creates request for getting the +current reflector height. + +==== geocom_get_image_config(mem_type) [[lua-api-geocom-get-image-config]] + +* `mem_type` (_integer_) – Memory device type (<>). + +Returns request of *IMG_GetTccConfig* procedure. Creates request to read +the current image configuration. The response `subfunc` is a binary +combination of the following settings: + +* `1` – Test image. +* `2` – Automatic exposure time selection. +* `4` – Two-times sub-sampling. +* `8` – Four-times sub-sampling. + +==== geocom_get_inclination_correction() [[lua-api-geocom-get-inclination-correction]] + +Returns request of *TMC_GetInclineSwitch* procedure. Creates request for getting the +dual-axis compensator status + +==== geocom_get_inclination_error() [[lua-api-geocom-get-inclination-error]] + +Returns request of *TMC_IfDataIncCorrError* procedure. Creates request for +getting the inclination error status. + +==== geocom_get_instrument_name() [[lua-api-geocom-get-instrument-name]] + +Returns request of *CSV_GetInstrumentName* procedure. Creates request for +getting the Leica-specific instrument name. + +==== geocom_get_instrument_number() [[lua-api-geocom-get-instrument-number]] + +Returns request of *CSV_GetInstrumentNo* procedure. Creates request for getting +the factory defined instrument number. + +==== geocom_get_internal_temperature() [[lua-api-geocom-get-internal-temperature]] + +Returns request of *CSV_GetIntTemp* procedure. Creates request for getting the +internal temperature of the instrument, measured on the mainboard side. + +==== geocom_get_lock_status() [[lua-api-geocom-get-lock-status]] + +Returns request of *MOT_ReadLockStatus* procedure. Creates request for returning +the condition of the Lock-In control. + +==== geocom_get_measurement_program() [[lua-api-geocom-get-measurement-program]] + +Returns request of *BAP_GetMeasPrg* procedure. Creates request for getting the +distance measurement program of the instrument. + +==== geocom_get_power() [[lua-api-geocom-get-power]] + +Returns request of *CSV_CheckPower* procedure. Creates request for checking the +available power. + +==== geocom_get_prism_constant() [[lua-api-geocom-get-prism-constant]] + +Returns request of *TMC_GetPrismCorr* procedure. Creates request for getting the +prism constant. + +==== geocom_get_prism_definition(prism_type) [[lua-api-geocom-get-prism-definition]] + +* `prism_type` (_integer_) – Prism type (<>). + +Returns request of *BAP_GetPrismDef* procedure. Creates request for getting the +default prism definition. + +==== geocom_get_prism_type() [[lua-api-geocom-get-prism-type]] + +Returns request of *TMC_GetPrismType* procedure. Creates request for getting the +default prism type. + +==== geocom_get_prism_type_v2() [[lua-api-geocom-get-prism-type-v2]] + +Returns request of *TMC_GetPrismType2* procedure. Creates request for getting +the default or user prism type. + +==== geocom_get_quick_distance() [[lua-api-geocom-get-quick-distance]] + +Returns request of *TMC_QuickDist* procedure. Creates request for returning the +slope distance and both angles. The function starts an EDM tracking measurement, +and waits until a distance has been measured. Then, it returns the angles and +the slope distance, but no coordinates. If no distance could be measured, only +angles and an error code are returned. A measurement may be aborted by calling +*TMC_DoMeasure*. + +==== geocom_get_reduced_atr_fov() [[lua-api-geocom-get-reduced-atr-fov]] + +Returns request of *BAP_GetRedATRFov* procedure. Creates request for getting the +reduced ATR field of view. + +==== geocom_get_reflectorless_class() [[lua-api-geocom-get-reflectorless-class]] + +Returns request of *CSV_GetReflectorlessClass* procedure. Creates request for +getting the RL type. The function returns the class of the reflectorless and +long-range distance measurement of the instrument. + +==== geocom_get_refraction_mode() [[lua-api-geocom-get-refraction_mode]] + +Returns request of *TMC_GetRefractiveMethod* procedure. Creates request for +getting the refraction model. The function is used to get the current +refraction model. Changing the method is not indicated on the interface of the +instrument. + +==== geocom_get_search_area() [[lua-api-geocom-get-search-area]] + +Returns request of *AUT_GetSearchArea* procedure. Creates request for getting +the dimensions of the PowerSearch window. This command is valid for all +instruments, but has only effects for instruments equipped with PowerSearch. + +==== geocom_get_signal() [[lua-api-geocom-get-signal]] + +Returns request of *TMC_GetSignal* procedure. Creates request for getting the +EDM signal intensity. The function returns the intensity of the EDM signal. The +function can only perform a measurement if the signal measurement program is +activated. Start the signal measurement program with *TMC_DoMeasure* in program +`GEOCOM_TMC_SIGNAL`. After the measurement, the EDM must be switched off with +program `GEOCOM_TMC_CLEAR`. While measuring, there is no angle data available. + +==== geocom_get_simple_coordinates(wait_time, inc_mode) [[lua-api-geocom-get-simple-coordinates]] + +* `wait_time` (_integer_) – Delay to wait for the distance measurement to finish [ms]. +* `inc_mode` (_integer_) – Inclination measurement mode (<>). + +Returns request of *TMC_GetSimpleCoord* procedure. The API function returns the +cartesian coordinates if a valid distance is set. The argument `wait_time` sets +the maximum time to wait for a valid distance. Without a valid distance, the +coordinates are set to 0.0, and an error is returned. The coordinate calculation +requires inclination results. The argument `inc_mode` sets the inclination +measurement mode (`GEOCOM_TMC_INCLINE_PRG`). + +==== geocom_get_simple_measurement(wait_time, inc_mode) [[lua-api-geocom-get-simple-measurement]] + +* `wait_time` (_integer_) – Delay to wait for the distance measurement to finish [ms]. +* `inc_mode` (_integer_) – Inclination measurement mode (<>). + +Returns request of *TMC_GetSimpleMea* procedure. The API function returns the +angles and distance measurement data. The argument `wait_time` sets the maximum +time to wait for a valid distance. If a distance is available, the wait time is +ignored. + +==== geocom_get_slope_distance_correction() [[lua-api-geocom-get-slope-distance-correction]] + +Returns request of *TMC_GetSlopeDistCorr* procedure. The function returns the +total ppm value (atmospheric ppm + geometric ppm) plus the current prism +constant. + +==== geocom_get_software_version() [[lua-api-geocom-get-software-version]] + +Returns request of *CSV_GetSWVersion* procedure. Creates request for getting the +system software version of the instrument. + +==== geocom_get_station() [[lua-api-geocom-get-station]] + +Returns request of *TMC_GetStation* procedure. Creates request for getting the +station coordinates of the instrument. + +==== geocom_get_target_type() [[lua-api-geocom-get-target-type]] + +Returns request of *BAP_GetTargetType* procedure. Creates request for getting +the EDM type. The function returns the current EDM type +(`GEOCOM_BAP_TARGET_TYPE`) for distance measurements: reflector (IR) or +reflectorless (RL). + +==== geocom_get_timeout() [[lua-api-geocom-get-timeout]] + +Returns request of *AUT_ReadTimeout* procedure. Creates request for getting +the timeout for positioning. The function returns the maximum time to perform +positioning. + +==== geocom_get_tolerance() [[lua-api-geocom-get-tolerance]] + +Returns request of *AUT_ReadTol* procedure. The function returns the positioning +tolerances of the Hz and V instrument axis. + +==== geocom_get_user_atr_mode() [[lua-api-geocom-get-user-atr-mode]] + +Returns request of *AUS_GetUserAtrState* procedure. Creates request for getting +the status of the ATR mode. + +==== geocom_get_user_lock_mode() [[lua-api-geocom-get-user-lock-mode]] + +Returns request of *AUS_GetUserLockState* procedure. Creates request for getting +the status of the _lock_ mode. + +==== geocom_get_user_prism_definition(name) [[lua-api-geocom-get-user-prism-definition]] + +* `name` (_string_) – Prism name. + +Returns equest of *BAP_GetUserPrismDef* procedure. Creates request for getting +the user prism definition. + +==== geocom_get_user_spiral() [[lua-api-geocom-get-user-spiral]] + +Returns request of *AUT_GetUserSpiral* procedure. The function returns the +current dimensions of the searching spiral. Requires at least a TCA instrument. + +==== geocom_list(next) [[lua-api-geocom-list]] + +* `next` (_bool_) – First or next entry. + +Returns request of *FTR_List* procedure. Creates request for listing file +information. + +==== geocom_lock_in() [[lua-api-geocom-lock-in]] + +Returns request of *AUT_LockIn* procedure. Creates request for starting the +target tracking. The API function will start the target tracking if the _lock_ +mode is activated (*AUS_SetUserLockState*). The *AUT_FineAdjust* call must have +finished successfully before executing this function. + +==== geocom_null() [[lua-api-geocom-null]] + +Returns request of *COM_NullProc* procedure. Creates request for checking the +communication. + +==== geocom_ps_enable_range(enabled) [[lua-api-geocom-ps-enable-range]] + +* `enabled` (_bool_) – Enable PowerSearch. + +Returns request of *AUT_PS_EnableRange* procedure. The function enabled or +disables the predefined PowerSearch window including the PowerSearch range +limits set by API call *AUT_PS_SetRange* (requires GeoCOM robotic licence). If +`enabled` is `false`, the default range is set to ≤ 400 m. + +==== geocom_ps_search_next(direction, swing) [[lua-api-geocom-ps-search-next]] + +* `direction` (_integer_) – Searching direction (`1` for clockwise, `-1` for counter-clockwise). +* `swing` (_bool_) – Searching starts –10 gon to the given direction. + +Returns request of *AUT_PS_SearchNext* procedure. The function executes the 360° +default PowerSearch and searches for the next targets. A previously defined +PowerSearch window (*AUT_SetSearchArea*) is not taken into account. Use API call +*AUT_PS_SearchWindow* first. + +==== geocom_ps_search_window() [[lua-api-geocom-ps-search-window]] + +Returns request of *AUT_PS_SearchWindow* procedure. Creates request for starting +PowerSearch. The function starts PowerSearch in the window defined by API calls +*AUT_SetSearchArea* and *AUT_PS_SetRange* (requires GeoCOM robotic licence). + +==== geocom_ps_set_range(min_dist, max_dist) [[lua-api-geocom-ps-set-range]] + +* `min_dist` (_integer_) – Min. distance to prism (≥ 0) [m]. +* `max_dist` (_integer_) – Max. distance to prism (≤ 400, ≥ `min_dist` + 10) [m]. + +Returns request of *AUT_PS_SetRange* procedure. Creates request for setting the +PowerSearch range. + +==== geocom_search(search_hz, search_v) [[lua-api-geocom-search]] + +* `search_hz` (_number_) – Horizontal search region [rad]. +* `search_v` (_number_) – Vertical search region [rad]. + +Returns request of *AUT_Search* procedure. The function performs an automatic +target search within the given search area (requires GeoCOM robotic licence). +The search is terminated once the prism appears in the field of view of the ATR +sensor. If no prism is found in the specified area, the instrument turns back +into the initial position. For an exact positioning onto the prism centre, use +the fine-adjust API call afterwards (*AUT_FineAdjust*). If the search range of +the API function *AUT_FineAdjust* is expanded, target search and fine +positioning are done in one step. + +==== geocom_search_target() [[lua-api-geocom-search-target]] + +Returns request of *BAP_SearchTarget* procedure. Creates request for searching a +target. The function searches for a target in the ATR search window. + +==== geocom_set_angle_correction(incline, stand_axis, collimation, tilt_axis) [[lua-api-geocom-set-angle-correction]] + +* `incline` (_bool_) – Enable inclination correction. +* `stand_axis` (_bool_) – Enable standard axis correction. +* `collimation` (_bool_) – Enable collimation correction. +* `tilt_axis` (_bool_) – Enable tilt axis correction. + +Returns request of *TMC_SetAngSwitch* procedure. Creates request for turning +angle corrections on or off. + +==== geocom_set_atmospheric_correction(lambda, pressure, dry_temp, wet_temp) [[lua-api-geocom-set-atmospheric-correction]] + +* `lambda` (_number_) – Wave-length of EDM transmitter [m]. +* `pressure` (_number_) – Atmospheric pressure [mbar]. +* `dry_temp` (_number_) – Dry temperature [°C]. +* `wet_temp` (_number_) – Wet temperature [°C]. + +Returns request of *BAP_SetAtmCorr* procedure. Creates request for setting the +atmospheric correction parameters. The argument `lambda` should be queried with +API call *TMC_GetAtmCorr*. + +==== geocom_set_atmospheric_ppm(atm_ppm) [[lua-api-geocom-set-atmospheric-ppm]] + +* `atm_ppm` (_number_) – Atmospheric ppm correction factor [ppm]. + +Returns request of *BAP_SetAtmPpm* procedure. Creates request for setting +the atmospheric ppm correction factor. + +==== geocom_set_atr_mode(atr_mode) [[lua-api-geocom-set-atr-mode]] + +* `atm_mode` (_integer_) – ATR low-vis mode (<>). + +Returns request of *BAP_SetATRSetting* procedure. Creates request for +setting the ATR low-vis mode. + +==== geocom_set_binary_mode(enabled) [[lua-api-geocom-set-binary-mode]] + +* `enabled` (_bool_) – Enable binary communication. + +Returns request of *COM_SetBinaryAvailable* procedure. Creates request for +setting the binary attribute of the server. The function sets the ability of the +GeoCOM server to handle binary communication (not supported by DMPACK). + +==== geocom_set_config(auto_power, timeout) [[lua-api-geocom-set-config]] + +* `auto_power` (_integer_) – Power-off mode (<>). +* `timeout` (_integer_) – Timeout [ms]. + +Returns request of *SUP_SetConfig* procedure. Creates request for setting the +power management configuration. The argument `timeout` sets the duration after +which the instrument switches into the mode `auto_power` +(`GEOCOM_SUP_AUTO_POWER`) when no user activity occured (key press, GeoCOM +communication). The value must be between 60,000 m/s (1 min) and 6,000,000 m/s +(100 min). + +==== geocom_set_date_time(year, month, day, hour, minute, second) [[lua-api-geocom-set-date-time]] + +* `year` (_integer_) – Year (`YYYY`). +* `month` (_integer_) – Month (`MM`). +* `day` (_integer_) – Day of month (`DD`). +* `hour` (_integer_) – Hour (`hh`). +* `minute` (_integer_) – Minute (`mm`). +* `second` (_integer_) – Second (`ss`). + +Returns request of *CSV_SetDateTime* procedure. Creates request for setting the +date and time of the instrument. + +==== geocom_set_distance(slope_dist, height_offset, inc_mode) [[lua-api-geocom-set-distance]] + +* `slope_dist` (_number_) – Slope distance [m]. +* `height_offset` (_number_) – Height offset [m]. +* `inc_mode` (_integer_) – Inclination measurement mode (<>). + +Returns request of *TMC_SetHandDist* procedure. The function is used to set the +manually measured slope distance and height offset for a following measurement. +Additionally, an inclination and an angle measurement are started to determine +the coordinates of the target. The vertical angle is corrected to π/2 or 3π/2, +depending on the face of the instrument. The previously measured distance is +cleared. + +==== geocom_set_double_precision(ndigits) [[lua-api-geocom-set-double-precision]] + +* `ndigits` (_integer_) – Number of digits right to the comma. + +Returns request of *COM_SetDoublePrecision* procedure. The function sets the +precision – the number of digits right of the decimal – when double +floating-point values are transmitted. The default precision is 15 digits. The +setting is only valid for the ASCII transmission mode. Trailing zeroes will not +be sent by the instrument. For example, if `ndigits` is set to 3 and the exact +value is 1.99975, the resulting value will be 2.0. + +==== geocom_set_edm_mode(edm_mode) [[lua-api-geocom-set-edm-mode]] + +* `edm_mode` (_integer_) – EDM measurement mode (<>). + +Returns request of *TMC_SetEdmMode* procedure. Creates request for setting the +EDM measurement mode. The EDM mode set by this function is used by +*TMC_DoMeasure(TMC_DEF_DIST)*. + +==== geocom_set_egl_intensity(intensity) [[lua-api-geocom-set-egl-intensity]] + +* `intensity` (_integer_) – EGL intensity (<>). + +Returns request of *EDM_SetEglIntensity* procedure. Creates request for setting +the intensity of the electronic guide light. + +==== geocom_set_fine_adjust_mode(adj_mode) [[lua-api-geocom-set-fine-adjust_mode]] + +* `adj_mode` (_integer_) – Fine adjust positioning mode (<>). + +Returns request of *AUT_SetFineAdjustMode* procedure. The function sets the +positioning tolerances relating to angle accuracy or point accuracy for the fine +adjust (requires GeoCOM robotic licence). If a target is near or held by hand, +it is recommended to set the adjust mode to `GEOCOM_AUT_POINT_MODE`. The +argument `adj_mode` has to be either `GEOCOM_AUT_NORM_MODE` or +`GEOCOM_AUT_POINT_MODE`. + +==== geocom_set_geometric_ppm(enabled, scale_factor, offset, height_ppm, individual_ppm) [[lua-api-geocom-set-geometric-ppm]] + +* `enabled` (_bool_) – Enable binary communication. +* `scale_factor` (_number_) – Scale factor on central meridian. +* `offset` (_number_) – Offset from central meridian [m]. +* `height_ppm` (_number_) – Ppm value due to height above reference. +* `individual_ppm` (_number_) – Individual ppm value. + +Returns request of *TMC_SetGeoPpm* procedure. Creates request for setting the +geometric ppm correction factor. + +==== geocom_set_height(height) [[lua-api-geocom-set-height]] + +* `height` (_number_) – Reflector height [m]. + +Returns request of *TMC_SetHeight* procedure. Creates request for setting a new +reflector height. + +==== geocom_set_image_config(mem_type, image_number, quality, sub_function, prefix) [[lua-api-geocom-set-image-config]] + +* `mem_type` (_integer_) – Memory device type (<>). +* `image_number` (_integer_) – Actual image number. +* `quality` (_integer_) – JPEG compression factor (0 – 100). +* `sub_function` (_integer_) – Additional sub-functions to call. +* `prefix` (_string_) – File name prefix. + +Returns request of *IMG_SetTccConfig* procedure. Creates request for setting the +image configuration. The argument `sub_function` may be a binary combination of +the following settings: + +* `1` – Test image. +* `2` – Automatic exposure-time selection. +* `3` – Two-times sub-sampling. +* `4` – Four-times sub-sampling. + +==== geocom_set_inclination_correction(enabled) [[lua-api-geocom-set-inclination-correction]] + +* `enabled` (_bool_) – Enable dual-axis compensator. + +Returns request of *TMC_SetInclineSwitch* procedure. Creates request for turning +the dual-axis compensator on or off. + +==== geocom_set_laser_pointer(enabled) [[lua-api-geocom-set-laser-pointer]] + +* `enabled` (_bool_) – Enable laser pointer. + +Returns request of *EDM_Laserpointer* procedure. Creates request for turning the +laser pointer on or off. The function is only available on models which support +reflectorless distance measurement. + +==== geocom_set_measurement_program(bap_prog) [[lua-api-geocom-set-measurement-program]] + +* `bap_prog` (_integer_) – Measurement program (<>). + +Returns request of *BAP_SetMeasPrg* procedure. The function sets the distance +measurement program, for example, for API call *BAP_MeasDistanceAngle*. The RL +EDM type programs are not available on all instruments. Changing the measurement +program may change the EDM type as well (IR, RL). + +==== geocom_set_orientation(hz) [[lua-api-geocom-set-orientation]] + +* `hz` (_number_) – Horizontal orientation [rad]. + +Returns request of *TMC_SetOrientation* procedure. Creates request for +orientating the instrument in horizontal direction. The API function is a +combination of an angle measurement to get the horizontal offset and setting the +angle offset afterwards, in order to orientate to a target. Before the new +orientation can be set, an existing distance must be cleared by calling API +function *TMC_DoMeasure* with command `GEOCOM_TMC_CLEAR`. + +==== geocom_set_position(hz, v, pos_mode, atr_mode) [[lua-api-geocom-set-position]] + +* `hz` (_number_) – Horizontal angle [rad]. +* `v` (_number_) – Vertical angle [rad]. +* `pos_mode` (_integer_) – Position mode (<>). +* `atr_mode` (_integer_) – ATR mode (<>). + +Returns request of *AUT_MakePositioning* procedure. Creates request for turning +the telescope to a specified position. + +If `pos_mode` is `GEOCOM_AUT_NORMAL`, uses the current value of the compensator. +For positioning distances > 25 gon, this mode might tend to inaccuracy. If set +to `GEOCOM_AUT_PRECISE`, tries to measure the exact inclination of the target +(tends to long position time). + +If `atr_mode` is `GEOCOM_AUT_POSITION`, uses conventional position to other +face. If set to `GEOCOM_AUT_TARGET`, tries to position into a target in the +destination area. This mode requires activated ATR. + +==== geocom_set_positioning_timeout(time_hz, time_v) [[lua-api-geocom-set-positioning-timeout]] + +* `time_hz` (_number_) – Timeout in Hz direction [s]. +* `time_v` (_number_) – Timeout in V direction [s]. + +Returns request of *AUT_SetTimeout* procedure. This function sets the maximum +time to perform a positioning. The timeout is reset on 7 seconds after each +power on. Valid value for `hz` and `v` are between 7 [sec] and 60 [sec]. + +==== geocom_set_prism_constant(prism_const) [[lua-api-geocom-set-prism-constant]] + +* `prism_const` (_number_) – Prism constant [mm]. + +Returns request of *TMC_SetPrismCorr* procedure. Creates request for setting the +prism constant. The API function *BAP_SetPrismType* overwrites this setting. + +==== geocom_set_prism_type(prism_type) [[lua-api-geocom-set-prism-type]] + +* `prism_type` (_integer_) – Prism type (<>). + +Returns request of *BAP_SetPrismType* procedure. Creates request for setting the +default prism type. This function sets the prism type for measurement with a +reflector (`GEOCOM_BAP_PRISMTYPE`). It overwrites the prism constant set by API +call *TMC_SetPrimCorr*. + +==== geocom_set_prism_type_v2(prism_type, prism_name) [[lua-api-geocom-set-prism-type-v2]] + +* `prism_type` (_integer_) – Prism type (<>). +* `prism_name` (_string_) – Prism name (required if prism type is `GEOCOM_BAP_PRISM_USER`). + +Returns request of *BAP_SetPrismType2* procedure. Creates request for setting +the default or user prism type. This function sets the default or the user prism +type for measurements with a reflector. It overwrites the prism constant set by +*TMC_SetPrismCorr*. The user defined prism must have been added with API call +*BAP_SetUserPrismDef* beforehand. + +==== geocom_set_reduced_atr_fov(enabled) [[lua-api-geocom-set-reduced-atr-fov]] + +* `enabled` (_bool_) – Use reduced field of view. + +Returns request of *BAP_SetRedATRFov* procedure. Creates request for setting the +reduced ATR field of view. If `enabled` is `true`, ATR uses reduced field of +view (about 1/9), full field of view otherwise. + +==== geocom_set_refraction_mode(mode) [[lua-api-geocom-set-refraction-mode]] + +* `mode` (_integer_) – Refraction data method (1 or 2). + +Returns request of *TMC_SetRefractiveMethod* procedure. Creates request for +setting the refraction model. Mode `1` means method 1 for the rest of the world, +mode `2` means method for Australia. + +==== geocom_set_search_area(center_hz, center_v, range_hz, range_v, enabled) [[lua-api-geocom-set-search-area]] + +* `center_hz` (_number_) – Search area center Hz angle [rad]. +* `center_v` (_number_) – Search area center V angle [rad]. +* `range_v` (_number_) – Search area range Hz angle [rad]. +* `range_v` (_number_) – Search area range V angle [rad]. +* `enabled` (_bool_) – Enable search area. + +Returns request of *AUT_SetSearchArea* procedure. The function sets the position +and dimensions of the PowerSearch window, and activates it. The API call is +valid for all instruments, but has effects only for those equipped with +PowerSearch (requires GeoCOM robotic licence). + +==== geocom_set_station(easting, northing, height, instr_height) [[lua-api-geocom-set-station]] + +* `easting` (_number_) – E coordinate [m]. +* `northing` (_number_) – N coordinate [m]. +* `height` (_number_) – H coordinate [m]. +* `instr_height` (_number_) – Instrument height [m]. + +Returns request of *TMC_SetStation* procedure. Creates request for setting the +station coordinates of the instrument. + +==== geocom_set_target_type(target_type) [[lua-api-geocom-set-target-type]] + +* `target_type` (_integer_) – Target type (<>). + +Returns request of *BAP_SetTargetType* procedure. Creates request for setting +the EDM type. + +The function sets the current EDM type (`GEOCOM_BAP_TARGET_TYPE`) for distance +measurements: reflector (IR) or reflectorless (RL). For each EDM type, the EDM +mode used last is remembered and actived if the EDM type is changed. If EDM type +IR is selected, the automation mode used last is activated automatically. The +API function *BAP_SetMeasPrg* can also change the target type. The EDM type RL +is not available on all instruments. + +==== geocom_set_tolerance(hz, v) [[lua-api-geocom-set_tolerance]] + +* `hz` (_number_) – Positioning tolerance in Hz direction [rad]. +* `v` (_number_) – Positioning tolerance in V direction [rad]. + +Returns request of *AUT_SetTol* procedure. Creates request for setting the +positioning tolerances. + +This function sets the position tolerances of the Hz and V instrument axes +(GeoCOM robotic licence required). The tolerances must be in the range of 1 [cc] +(1.57079E-06 [rad]) to 100 [cc] (1.57079E-04 [rad]). + +The maximum resolution of the angle measurement system depends on the instrument +accuracy class. If smaller positioning tolerances are required, the positioning +time can increase drastically + +==== geocom_set_user_atr_mode(enabled) [[lua-api-geocom-set-user-atr-mode]] + +* `enabled` (_bool_) – Enable ATR state. + +Returns request of *AUS_SetUserAtrState* procedure. Creates request for setting +the status of the ATR state. + +The function activates or deactivates the ATR mode (requires GeoCOM robotic +licence). If `enabled` is `true`, ATR mode is activated, and if _lock_ mode is +enabled while the API call is made, _lock_ mode will change to ATR mode. If +`enabled` is `false`, ATR mode is deactivated, and if LOCK mode is enabled then +it stays enabled. + +==== geocom_set_user_lock_mode(enabled) [[lua-api-geocom-set-user-lock-mode]] + +* `enabled` (_bool_) – Enable _lock_ state. + +Returns request of *AUS_SetUserLockState* procedure. Creates request for setting +the status of the _lock_ state. + +The function activated or deactivates the _lock_ mode (GeoCOM robotic licence +required). If `enabled` is `true`, _lock_ mode is activated. In order to lock +and follow a moving target, call API function *AUT_LockIn*. If `enabled` is +`false`, _lock_ mode is deactivated. Tracking of a moving target will be +aborted, and the manual drive wheel is activated. + +==== geocom_set_user_prism_definition(prism_name, prism_const, prism_type, creator) [[lua-api-geocom-set-user-prism-definition]] + +* `prism_name` (_string_) – Prism name. +* `prism_const` (_number_) – Prism constant [mm]. +* `prism_type` (_integer_) – Prism type (<>). +* `creator` (_string_) – Name of creator. + +Returns request of *BAP_SetUserPrismDef* procedure. Creates request for +setting a user prism definition. + +==== geocom_set_user_spiral(hz, v) [[lua-api-geocom-set-user-spiral]] + +* `hz` (_number_) – ATR search window in Hz direction [rad]. +* `v` (_number_) – ATR search window in V direction [rad]. + +Returns request of *AUT_SetUserSpiral* procedure. The function sets the +dimensions of the ATR search window (GeoCOM robotic licence required). + +==== geocom_set_velocity(omega_hz, omega_v) [[lua-api-geocom-set-velocity]] + +* `omega_hz` (_number_) – Velocity in Hz direction [rad/s]. +* `omega_v` (_number_) – Velocity in V direction [rad/s]. + +Returns request of *MOT_SetVelocity* procedure. Creates request for driving the +instrument with constant speed. + +The function is used to set up the velocity of the motorisation (GeoCOM robotic +licence required). The API function *MOT_StartController* must have been called +with argument `GEOCOM_MOT_OCONST` before. + +The velocity in horizontal and vertical direction are in [rad/s]. The maximum +velocity is ±3.14 rad/s for TM30/TS30, and ±0.79 rad/s for TPS1100/TPS1200. + +==== geocom_setup_download(device_type, file_type, file_name, block_size) [[lua-api-geocom-setup-download]] + +* `device_type` (_integer_) – Device type (<>). +* `file_type` (_integer_) – File type (<>). +* `file_name` (_string_) – File name with extension. +* `block_size` (_integer_) – Block size. + +Returns request of *FTR_SetupDownload* procedure. Creates request for setting up +a file download. The function has to be called before *FTR_Download*. If the +file type is `GEOCOM_FTR_FILE_UNKNOWN`, an additional file path is required. + +The argument `device_type` must be one of the following: + +* `GEOCOM_FTR_DEVICE_INTERNAL` – Internal memory module (path `/ata1a/`). +* `GEOCOM_FTR_DEVICE_PCPARD` – External memory card (path `/ata0a/`). + +The argument `file_type` is usually `GEOCOM_FTR_FILE_IMAGES`. The maximum value +for `block_size` is `GEOCOM_FTR_MAX_BLOCKSIZE`. + +==== geocom_setup_list(device_type, file_type, search_path) [[lua-api-geocom-setup-list]] + +* `device_type` (_integer_) – Device type (<>). +* `file_type` (_integer_) – File type (<>). +* `search_path` (_string_) – Optional search path, required for file type `GEOCOM_FTR_FILE_UNKNOWN`. + +Returns request of *FTR_SetupList* procedure. Creates request for setting up +file listing. The function sets up the device type, file type, and search path. +It has to be called before *FTR_List*. + +==== geocom_start_controller(start_mode) [[lua-api-geocom-start-controller]] + +* `start_mode` (_integer_) – Controller start mode (<>). + +Returns request of *MOT_StartController* procedure. Creates request for starting +the motor controller. + +If this function is used in combination with API call *MOT_SetVelocity*, the +controller mode has to be `GEOCOM_MOT_OCONST`. + +The argument `start_mode` must be one of the following: + +* `GEOCOM_MOT_POSIT` – Relative positioning. +* `GEOCOM_MOT_OCONST` – Constant speed. +* `GEOCOM_MOT_MANUPOS` – Manual positioning (default setting). +* `GEOCOM_MOT_LOCK` – “Lock-in” controller. +* `GEOCOM_MOT_BREAK` – “Brake” controller. +* `GEOCOM_MOT_TERM` – Terminates the controller task. + +==== geocom_stop_controller(stop_mode) [[lua-api-geocom-stop-controller]] + +* `stop_mode` (_integer_) – Controller stop mode (<>). + +Returns request of *MOT_StartController* procedure. Creates request for stopping +the motor controller. + +The argument `stop_mode` must be one of the following: + +* `GEOCOM_MOT_NORMAL` – Slow down with current acceleration. +* `GEOCOM_MOT_SHUTDOWN` – Slow down by switching off power supply. + +==== geocom_switch_off(stop_mode) [[lua-api-geocom-switch-off]] + +* `stop_mode` (_integer_) – Switch-off mode (<>). + +Returns request of *COM_SwitchOffTPS* procedure. Creates request for turning the +instrument off. + +The argument `stop_mode` has to be one of the following: + +* `GEOCOM_COM_TPS_STOP_SHUT_DOWN` – Power down instrument. +* `GEOCOM_COM_TPS_STOP_SLEEP` – Sleep mode (not supported by TPS1200). + +==== geocom_switch_on(start_mode) [[lua-api-geocom-switch-on]] + +* `start_mode` (_integer_) – Switch-on mode (<>). + +Returns request of *COM_SwitchOnTPS* procedure. Creates request for turning the +instrument on. + +The argument `start_mode` has to be one of the following: + +* `GEOCOM_COM_TPS_STARTUP_LOCAL` – Not supported by TPS1200. +* `GEOCOM_COM_TPS_STARTUP_REMOTE` – Online mode (RPC is enabled). + +==== geocom_take_image(mem_type) [[lua-api-geocom-take-image]] + +* `mem_type` (_integer_) – Memory type (`GEOCOM_IMG_MEM_TYPE`). + +Returns request of *IMG_TakeTccImage* procedure. Creates request for capturing a +telescope image. + +The memory type `mem_type` has to be one of the following: + +* `GEOCOM_IMG_INTERNAL_MEMORY` – Internal memory module. +* `GEOCOM_IMG_PC_CARD` – External memory card. + == Error Codes [[error-codes]] [cols="1,2,7"] diff --git a/guide/resources/images/beat.svg b/guide/resources/images/beat.svg index 34d1384..1aceb52 100644 --- a/guide/resources/images/beat.svg +++ b/guide/resources/images/beat.svg @@ -1 +1 @@ -beatsbeat_id : INTEGERnode_id : TEXTaddress : TEXTclient : TEXTtime_sent : TEXTtime_recv : TEXTerror : INTEGERinterval : INTEGERuptime : INTEGERidx_node_id (node_id)sqlite_autoindex_beats_1 (node_id) \ No newline at end of file +beatsbeat_id : INTEGERnode_id : TEXTaddress : TEXTclient : TEXTtime_sent : TEXTtime_recv : TEXTerror : INTEGERinterval : INTEGERuptime : INTEGER \ No newline at end of file diff --git a/guide/resources/images/log.svg b/guide/resources/images/log.svg index efb5f06..38eddab 100644 --- a/guide/resources/images/log.svg +++ b/guide/resources/images/log.svg @@ -1 +1 @@ -logslog_id : INTEGERid : TEXTlevel : INTEGERerror : INTEGERtimestamp : TEXTnode_id : TEXTsensor_id : TEXTtarget_id : TEXTobserv_id : TEXTsource : TEXTmessage : TEXTidx_source (source)idx_observ_id (observ_id)idx_target_id (target_id)idx_sensor_id (sensor_id)idx_node_id (node_id)idx_error (error)idx_level (level)idx_timestamp (timestamp)sqlite_autoindex_logs_1 (id)sync_logssync_log_id : INTEGERlog_id : INTEGERtimestamp : TEXTcode : INTEGERnattempts : INTEGERsqlite_autoindex_sync_logs_1 (log_id) \ No newline at end of file +logslog_id : INTEGERid : TEXTlevel : INTEGERerror : INTEGERtimestamp : TEXTnode_id : TEXTsensor_id : TEXTtarget_id : TEXTobserv_id : TEXTsource : TEXTmessage : TEXTsync_logssync_log_id : INTEGERlog_id : INTEGERtimestamp : TEXTcode : INTEGERnattempts : INTEGER \ No newline at end of file diff --git a/guide/resources/images/observ.svg b/guide/resources/images/observ.svg index 75f0078..c815148 100644 --- a/guide/resources/images/observ.svg +++ b/guide/resources/images/observ.svg @@ -1 +1 @@ -nodesnode_id : INTEGERid : TEXTname : TEXTmeta : TEXTx : REALy : REALz : REALidx_nodes_id (id)sqlite_autoindex_nodes_1 (id)observsobserv_id : INTEGERnode_id : INTEGERsensor_id : INTEGERtarget_id : INTEGERid : TEXTname : TEXTsource : TEXTtimestamp : TEXTpath : TEXTpriority : INTEGERerror : INTEGERnext : INTEGERnreceivers : INTEGERnrequests : INTEGERidx_observs_timestamp (timestamp)idx_observs (timestamp, name, error)sqlite_autoindex_observs_1 (id)receiversreceiver_id : INTEGERobserv_id : INTEGERidx : INTEGERname : TEXTidx_receivers_idx (idx)sqlite_autoindex_receivers_1 (observ_id, idx)requestsrequest_id : INTEGERobserv_id : INTEGERidx : INTEGERrequest : TEXTresponse : TEXTdelimiter : TEXTpattern : TEXTtimestamp : TEXTdelay : INTEGERerror : INTEGERmode : INTEGERretries : INTEGERstate : INTEGERtimeout : INTEGERnresponses : INTEGERidx_requests_timestamp (timestamp)idx_requests_idx (idx)sqlite_autoindex_requests_1 (observ_id, idx)responsesresponse_id : INTEGERrequest_id : INTEGERidx : INTEGERname : TEXTunit : TEXTtype : INTEGERerror : INTEGERvalue : REALidx_responses_name (name)idx_responses_request_id (request_id)idx_responses (request_id, idx, name, unit, type, error, value)sqlite_autoindex_responses_1 (request_id, idx)sensorssensor_id : INTEGERnode_id : INTEGERid : TEXTtype : INTEGERname : TEXTsn : TEXTmeta : TEXTx : REALy : REALz : REALidx_sensors_id (id)sqlite_autoindex_sensors_1 (id)sync_nodessync_node_id : INTEGERnode_id : INTEGERtimestamp : TEXTcode : INTEGERattempts : INTEGERsqlite_autoindex_sync_nodes_1 (node_id)sync_observssync_observ_id : INTEGERobserv_id : INTEGERtimestamp : TEXTcode : INTEGERattempts : INTEGERsqlite_autoindex_sync_observs_1 (observ_id)sync_sensorssync_sensor_id : INTEGERsensor_id : INTEGERtimestamp : TEXTcode : INTEGERattempts : INTEGERsqlite_autoindex_sync_sensors_1 (sensor_id)sync_targetssync_target_id : INTEGERtarget_id : INTEGERtimestamp : TEXTcode : INTEGERattempts : INTEGERsqlite_autoindex_sync_targets_1 (target_id)targetstarget_id : INTEGERid : TEXTname : TEXTmeta : TEXTstate : INTEGERx : REALy : REALz : REALidx_targets_id (id)sqlite_autoindex_targets_1 (id) \ No newline at end of file +nodesnode_id : INTEGERid : TEXTname : TEXTmeta : TEXTx : REALy : REALz : REALobservsobserv_id : INTEGERnode_id : INTEGERsensor_id : INTEGERtarget_id : INTEGERid : TEXTname : TEXTtimestamp : TEXTsource : TEXTpath : TEXTpriority : INTEGERerror : INTEGERnext : INTEGERnreceivers : INTEGERnrequests : INTEGERreceiversreceiver_id : INTEGERobserv_id : INTEGERidx : INTEGERname : TEXTrequestsrequest_id : INTEGERobserv_id : INTEGERidx : INTEGERname: TEXTtimestamp : TEXTrequest : TEXTresponse : TEXTdelimiter : TEXTpattern : TEXTdelay : INTEGERerror : INTEGERmode : INTEGERretries : INTEGERstate : INTEGERtimeout : INTEGERnresponses : INTEGERresponsesresponse_id : INTEGERrequest_id : INTEGERidx : INTEGERname : TEXTunit : TEXTtype : INTEGERerror : INTEGERvalue : REALsensorssensor_id : INTEGERnode_id : INTEGERid : TEXTtype : INTEGERname : TEXTsn : TEXTmeta : TEXTx : REALy : REALz : REALsync_nodessync_node_id : INTEGERnode_id : INTEGERtimestamp : TEXTcode : INTEGERattempts : INTEGERsync_observssync_observ_id : INTEGERobserv_id : INTEGERtimestamp : TEXTcode : INTEGERattempts : INTEGERsync_sensorssync_sensor_id : INTEGERsensor_id : INTEGERtimestamp : TEXTcode : INTEGERattempts : INTEGERsync_targetssync_target_id : INTEGERtarget_id : INTEGERtimestamp : TEXTcode : INTEGERattempts : INTEGERtargetstarget_id : INTEGERid : TEXTname : TEXTmeta : TEXTstate : INTEGERx : REALy : REALz : REAL \ No newline at end of file diff --git a/man/dmfeed.1 b/man/dmfeed.1 index 377ae41..630eb2a 100644 --- a/man/dmfeed.1 +++ b/man/dmfeed.1 @@ -2,12 +2,12 @@ .\" Title: dmfeed .\" Author: Philipp Engel .\" Generator: Asciidoctor 2.0.20 -.\" Date: 2024-02-27 +.\" Date: 2024-02-28 .\" Manual: User Commands .\" Source: DMFEED .\" Language: English .\" -.TH "DMFEED" "1" "2024-02-27" "DMFEED" "User Commands" +.TH "DMFEED" "1" "2024-02-28" "DMFEED" "User Commands" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 @@ -54,8 +54,8 @@ different feeds. Run \fIdmuuid(1)\fP to generate a valid UUID4. .sp The time stamp of the feed in the updated element is set to the date and time of the last log message. If no logs have been added to the database since the last -file modification time of the feed, the output file is not updated, unless -argument \f(CR\-\-force\fP is passed. +file modification of the feed, the output file is not updated, unless argument +\f(CR\-\-force\fP is passed. .SH "OPTIONS" .sp \fB\-\-author\fP, \fB\-A\fP \fIname\fP diff --git a/runtests.sh b/runtests.sh index b77ca44..41c0c0d 100644 --- a/runtests.sh +++ b/runtests.sh @@ -35,10 +35,10 @@ # export DM_PIPE_SKIP=1 # TESTS="dmtestapi dmtestbase64 dmtestcgi dmtestconfig dmtestcsv dmtestdb \ -dmtestdp dmtestfile dmtesthash dmtesthdf5 dmtesthtml dmtestlogger dmtestlua dmtestjob \ -dmtestjson dmtestmail dmtestmqueue dmtestmqtt dmtestnml dmtestobserv dmtestpath \ -dmtestpipe dmtestplot dmtestregex dmtestrpc dmtestrts dmteststring dmtesttime \ -dmtesttty dmtestunit dmtestutil dmtestuuid" +dmtestdp dmtestfile dmtesthash dmtesthdf5 dmtesthtml dmtestid dmtestlogger \ +dmtestlua dmtestjob dmtestjson dmtestmail dmtestmqueue dmtestmqtt dmtestnml \ +dmtestobserv dmtestpath dmtestpipe dmtestplot dmtestregex dmtestrpc dmtestrts \ +dmteststring dmtesttime dmtesttty dmtestunit dmtestutil dmtestuuid" NTEST=`echo ${TESTS} | wc -w` NFAIL=0 diff --git a/src/dm_api.f90 b/src/dm_api.f90 index 31408e8..3524e59 100644 --- a/src/dm_api.f90 +++ b/src/dm_api.f90 @@ -16,11 +16,11 @@ module dm_api type, public :: api_status_type !! API status type that stores an HTTP-RPC API response. - character(len=API_STATUS_LEN) :: version = ' ' !! DMPACK application version. - character(len=API_STATUS_LEN) :: dmpack = DM_VERSION_STRING !! DMPACK library version. - character(len=API_STATUS_LEN) :: host = ' ' !! Host name. + character(len=API_STATUS_LEN) :: version = ' ' !! Server application version. + character(len=API_STATUS_LEN) :: dmpack = DM_VERSION_STRING !! Server library version. + character(len=API_STATUS_LEN) :: host = ' ' !! Server host name. character(len=API_STATUS_LEN) :: server = ' ' !! Server software (web server). - character(len=API_STATUS_LEN) :: timestamp = TIME_DEFAULT !! Current date and time in ISO 8601. + character(len=API_STATUS_LEN) :: timestamp = TIME_DEFAULT !! Server date and time in ISO 8601. character(len=API_STATUS_LEN) :: message = ' ' !! Status message. integer :: error = E_NONE !! Error code. end type api_status_type diff --git a/src/dm_arg.f90 b/src/dm_arg.f90 index 8daaebb..7baaee9 100644 --- a/src/dm_arg.f90 +++ b/src/dm_arg.f90 @@ -148,7 +148,7 @@ integer function dm_arg_parse(args, ignore_unknown, verbose) result(rc) if (a(1:1) /= '-') then ! Argument does not start with `-` and is therefore invalid. rc = E_ARG_UNKNOWN - if (verbose_) call dm_error_out(rc, 'unknown command-line option "' // trim(a) // '"') + if (verbose_) call dm_error_out(rc, 'unknown option "' // trim(a) // '"') return end if @@ -162,7 +162,7 @@ integer function dm_arg_parse(args, ignore_unknown, verbose) result(rc) ! Argument has been passed already. if (args(j)%passed) then rc = E_ARG_INVALID - if (verbose_) call dm_error_out(rc, 'command-line option ' // trim(a) // ' already set') + if (verbose_) call dm_error_out(rc, 'option ' // trim(a) // ' already set') return end if @@ -203,7 +203,7 @@ integer function dm_arg_parse(args, ignore_unknown, verbose) result(rc) if (.not. exists .and. .not. ignore_unknown_) then ! Argument starts with `-` but is unknown or unexpected. rc = E_ARG_UNKNOWN - if (verbose_) call dm_error_out(rc, 'command-line option ' // trim(a) // ' not allowed') + if (verbose_) call dm_error_out(rc, 'argument ' // trim(a) // ' not allowed') return end if @@ -294,25 +294,25 @@ integer function dm_arg_read(args, app, major, minor, patch) result(rc) cycle validate_loop case (E_ARG_INVALID) - call dm_error_out(rc, 'option --' // trim(args(i)%name) // ' is required') + call dm_error_out(rc, 'argument --' // trim(args(i)%name) // ' is required') exit validate_loop case (E_ARG_NO_VALUE) - call dm_error_out(rc, 'option --' // trim(args(i)%name) // ' requires value') + call dm_error_out(rc, 'argument --' // trim(args(i)%name) // ' requires value') exit validate_loop case (E_ARG_TYPE) select case (args(i)%type) case (ARG_TYPE_INTEGER) - call dm_error_out(rc, 'option --' // trim(args(i)%name) // ' is not an integer') + call dm_error_out(rc, 'argument --' // trim(args(i)%name) // ' is not an integer') case (ARG_TYPE_FLOAT) - call dm_error_out(rc, 'option --' // trim(args(i)%name) // ' is not a number') + call dm_error_out(rc, 'argument --' // trim(args(i)%name) // ' is not a number') case (ARG_TYPE_ID) - call dm_error_out(rc, 'option --' // trim(args(i)%name) // ' is not a valid id') + call dm_error_out(rc, 'argument --' // trim(args(i)%name) // ' is not a valid id') case (ARG_TYPE_UUID) - call dm_error_out(rc, 'option --' // trim(args(i)%name) // ' is not a valid UUID4') + call dm_error_out(rc, 'argument --' // trim(args(i)%name) // ' is not a valid UUID4') case (ARG_TYPE_TIME) - call dm_error_out(rc, 'option --' // trim(args(i)%name) // ' is not in ISO 8601 format') + call dm_error_out(rc, 'argument --' // trim(args(i)%name) // ' is not in ISO 8601 format') case (ARG_TYPE_FILE) call dm_error_out(rc, 'file "' // trim(args(i)%value) // '" not found') case (ARG_TYPE_DB) @@ -323,10 +323,10 @@ integer function dm_arg_read(args, app, major, minor, patch) result(rc) case (E_ARG_LENGTH) n = len_trim(args(i)%value) if (n > args(i)%max_len) then - call dm_error_out(rc, 'option --' // trim(args(i)%name) // ' is too long, must be <= ' // & + call dm_error_out(rc, 'argument --' // trim(args(i)%name) // ' is too long, must be <= ' // & dm_itoa(args(i)%max_len)) else if (n < args(i)%min_len) then - call dm_error_out(rc, 'option --' // trim(args(i)%name) // ' is too short, must be >= ' // & + call dm_error_out(rc, 'argument --' // trim(args(i)%name) // ' is too short, must be >= ' // & dm_itoa(args(i)%min_len)) end if exit validate_loop @@ -421,8 +421,8 @@ subroutine dm_arg_help(args) end select end do - write (stdout, '(/, 4x, "-v, --version")') - write (stdout, '(4x, "-h, --help", /)') + write (stdout, '(/, 4x, "-h, --help")') + write (stdout, '(4x, "-v, --version", /)') end subroutine dm_arg_help ! ****************************************************************** diff --git a/src/dm_beat.f90 b/src/dm_beat.f90 index 6eeb23f..8f5308b 100644 --- a/src/dm_beat.f90 +++ b/src/dm_beat.f90 @@ -16,7 +16,7 @@ module dm_beat type, public :: beat_type !! Status message (heartbeat) type. - character(len=NODE_ID_LEN) :: node_id = ' ' !! Node id. + character(len=NODE_ID_LEN) :: node_id = ' ' !! Node id (`-0-9A-Z_a-z`). character(len=BEAT_ADDR_LEN) :: address = ' ' !! Client IP address (IPv4 or IPv6). character(len=BEAT_CLIENT_LEN) :: client = ' ' !! Client software name and version. character(len=TIME_LEN) :: time_sent = TIME_DEFAULT !! Time heartbeat was sent. diff --git a/src/dm_csv.f90 b/src/dm_csv.f90 index 98cab53..4011904 100644 --- a/src/dm_csv.f90 +++ b/src/dm_csv.f90 @@ -243,6 +243,7 @@ function dm_csv_header_observ(separator) result(header) do i = 1, OBSERV_MAX_NREQUESTS header = header // s // & + 'requests(' // dm_itoa(i) // ').name' // s // & 'requests(' // dm_itoa(i) // ').timestamp' // s // & 'requests(' // dm_itoa(i) // ').request' // s // & 'requests(' // dm_itoa(i) // ').response' // s // & @@ -284,6 +285,7 @@ function dm_csv_header_observ_view(separator) result(header) 'observ_id' // s // & 'observ_name' // s // & 'observ_error' // s // & + 'request_name' // s // & 'request_timestamp' // s // & 'request_error' // s // & 'response_name' // s // & @@ -554,8 +556,8 @@ function csv_from_observ(observ, separator) result(csv) trim(observ%sensor_id) // s // & trim(observ%target_id) // s // & trim(observ%name) // s // & - trim(observ%source) // s // & trim(observ%timestamp) // s // & + trim(observ%source) // s // & trim(observ%path) // s // & dm_itoa(observ%priority) // s // & dm_itoa(observ%error) // s // & @@ -574,7 +576,8 @@ function csv_from_observ(observ, separator) result(csv) cycle end if - csv = csv // s // trim(observ%requests(i)%timestamp) // s // & + csv = csv // s // trim(observ%requests(i)%name) // s // & + trim(observ%requests(i)%timestamp) // s // & '"' // trim(observ%requests(i)%request) // '"' // s // & '"' // trim(observ%requests(i)%response) // '"' // s // & '"' // trim(observ%requests(i)%delimiter) // '"' // s // & @@ -621,6 +624,7 @@ function csv_from_observ_view(view, separator) result(csv) trim(view%observ_id) // s // & trim(view%observ_name) // s // & dm_itoa(view%observ_error) // s // & + trim(view%request_name) // s // & trim(view%request_timestamp) // s // & dm_itoa(view%request_error) // s // & trim(view%response_name) // s // & @@ -1086,8 +1090,8 @@ integer function csv_read_observ(observ, unit, separator, quote) result(rc) rc = csv_next(buffer, observ%sensor_id, s, n, p, q); if (rc /= E_NONE) return rc = csv_next(buffer, observ%target_id, s, n, p, q); if (rc /= E_NONE) return rc = csv_next(buffer, observ%name, s, n, p, q); if (rc /= E_NONE) return - rc = csv_next(buffer, observ%source, s, n, p, q); if (rc /= E_NONE) return rc = csv_next(buffer, observ%timestamp, s, n, p, q); if (rc /= E_NONE) return + rc = csv_next(buffer, observ%source, s, n, p, q); if (rc /= E_NONE) return rc = csv_next(buffer, observ%path, s, n, p, q); if (rc /= E_NONE) return rc = csv_next(buffer, observ%priority, s, n, p, q); if (rc /= E_NONE) return rc = csv_next(buffer, observ%error, s, n, p, q); if (rc /= E_NONE) return @@ -1101,6 +1105,7 @@ integer function csv_read_observ(observ, unit, separator, quote) result(rc) end do do i = 1, OBSERV_MAX_NREQUESTS + rc = csv_next(buffer, observ%requests(i)%name, s, n, p, q); if (rc /= E_NONE) return rc = csv_next(buffer, observ%requests(i)%timestamp, s, n, p, q); if (rc /= E_NONE) return rc = csv_next(buffer, observ%requests(i)%request, s, n, p, q); if (rc /= E_NONE) return rc = csv_next(buffer, observ%requests(i)%response, s, n, p, q); if (rc /= E_NONE) return @@ -1546,8 +1551,8 @@ integer function csv_write_observ(observ, unit, header, separator) result(rc) trim(observ%sensor_id), s, & trim(observ%target_id), s, & trim(observ%name), s, & - trim(observ%source), s, & trim(observ%timestamp), s, & + trim(observ%source), s, & trim(observ%path), s, & observ%priority, s, & observ%error, s, & @@ -1572,7 +1577,8 @@ integer function csv_write_observ(observ, unit, header, separator) result(rc) write (unit_, '(a)', advance='no', iostat=stat) s if (stat /= 0) return - write (unit_, '(18a, 6(i0, a), i0)', advance='no', iostat=stat) & + write (unit_, '(20a, 6(i0, a), i0)', advance='no', iostat=stat) & + trim(observ%requests(i)%name), s, & trim(observ%requests(i)%timestamp), s, & '"', trim(observ%requests(i)%request), '"', s, & '"', trim(observ%requests(i)%response), '"', s, & diff --git a/src/dm_db.f90 b/src/dm_db.f90 index e44d6ad..83c2c20 100644 --- a/src/dm_db.f90 +++ b/src/dm_db.f90 @@ -1605,8 +1605,8 @@ integer function dm_db_insert_observ(db, observ, db_stmt) result(rc) if (sqlite3_bind_text(stmt, 3, trim(observ%sensor_id)) /= SQLITE_OK) exit sql_block if (sqlite3_bind_text(stmt, 4, trim(observ%target_id)) /= SQLITE_OK) exit sql_block if (sqlite3_bind_text(stmt, 5, trim(observ%name)) /= SQLITE_OK) exit sql_block - if (sqlite3_bind_text(stmt, 6, trim(observ%source)) /= SQLITE_OK) exit sql_block - if (sqlite3_bind_text(stmt, 7, trim(observ%timestamp)) /= SQLITE_OK) exit sql_block + if (sqlite3_bind_text(stmt, 6, trim(observ%timestamp)) /= SQLITE_OK) exit sql_block + if (sqlite3_bind_text(stmt, 7, trim(observ%source)) /= SQLITE_OK) exit sql_block if (sqlite3_bind_text(stmt, 8, trim(observ%path)) /= SQLITE_OK) exit sql_block if (sqlite3_bind_int (stmt, 9, observ%priority) /= SQLITE_OK) exit sql_block if (sqlite3_bind_int (stmt, 10, observ%error) /= SQLITE_OK) exit sql_block @@ -4871,18 +4871,19 @@ integer function db_insert_requests(db, observ_id, requests) result(rc) rc = E_DB_BIND if (sqlite3_bind_text(stmt, 1, trim(observ_id)) /= SQLITE_OK) exit row_loop if (sqlite3_bind_int (stmt, 2, i) /= SQLITE_OK) exit row_loop - if (sqlite3_bind_text(stmt, 3, trim(requests(i)%request)) /= SQLITE_OK) exit row_loop - if (sqlite3_bind_text(stmt, 4, trim(requests(i)%response)) /= SQLITE_OK) exit row_loop - if (sqlite3_bind_text(stmt, 5, trim(requests(i)%delimiter)) /= SQLITE_OK) exit row_loop - if (sqlite3_bind_text(stmt, 6, trim(requests(i)%pattern)) /= SQLITE_OK) exit row_loop - if (sqlite3_bind_text(stmt, 7, trim(requests(i)%timestamp)) /= SQLITE_OK) exit row_loop - if (sqlite3_bind_int (stmt, 8, requests(i)%delay) /= SQLITE_OK) exit row_loop - if (sqlite3_bind_int (stmt, 9, requests(i)%error) /= SQLITE_OK) exit row_loop - if (sqlite3_bind_int (stmt, 10, requests(i)%mode) /= SQLITE_OK) exit row_loop - if (sqlite3_bind_int (stmt, 11, requests(i)%retries) /= SQLITE_OK) exit row_loop - if (sqlite3_bind_int (stmt, 12, requests(i)%state) /= SQLITE_OK) exit row_loop - if (sqlite3_bind_int (stmt, 13, requests(i)%timeout) /= SQLITE_OK) exit row_loop - if (sqlite3_bind_int (stmt, 14, requests(i)%nresponses) /= SQLITE_OK) exit row_loop + if (sqlite3_bind_text(stmt, 3, trim(requests(i)%name)) /= SQLITE_OK) exit row_loop + if (sqlite3_bind_text(stmt, 4, trim(requests(i)%timestamp)) /= SQLITE_OK) exit row_loop + if (sqlite3_bind_text(stmt, 5, trim(requests(i)%request)) /= SQLITE_OK) exit row_loop + if (sqlite3_bind_text(stmt, 6, trim(requests(i)%response)) /= SQLITE_OK) exit row_loop + if (sqlite3_bind_text(stmt, 7, trim(requests(i)%delimiter)) /= SQLITE_OK) exit row_loop + if (sqlite3_bind_text(stmt, 8, trim(requests(i)%pattern)) /= SQLITE_OK) exit row_loop + if (sqlite3_bind_int (stmt, 9, requests(i)%delay) /= SQLITE_OK) exit row_loop + if (sqlite3_bind_int (stmt, 10, requests(i)%error) /= SQLITE_OK) exit row_loop + if (sqlite3_bind_int (stmt, 11, requests(i)%mode) /= SQLITE_OK) exit row_loop + if (sqlite3_bind_int (stmt, 12, requests(i)%retries) /= SQLITE_OK) exit row_loop + if (sqlite3_bind_int (stmt, 13, requests(i)%state) /= SQLITE_OK) exit row_loop + if (sqlite3_bind_int (stmt, 14, requests(i)%timeout) /= SQLITE_OK) exit row_loop + if (sqlite3_bind_int (stmt, 15, requests(i)%nresponses) /= SQLITE_OK) exit row_loop rc = E_DB_STEP if (sqlite3_step(stmt) /= SQLITE_DONE) exit row_loop @@ -5132,8 +5133,8 @@ integer function db_next_row_observ(stmt, observ, validate) result(rc) observ%sensor_id = sqlite3_column_text(stmt, 2) observ%target_id = sqlite3_column_text(stmt, 3) observ%name = sqlite3_column_text(stmt, 4) - observ%source = sqlite3_column_text(stmt, 5) - observ%timestamp = sqlite3_column_text(stmt, 6) + observ%timestamp = sqlite3_column_text(stmt, 5) + observ%source = sqlite3_column_text(stmt, 6) observ%path = sqlite3_column_text(stmt, 7) observ%priority = sqlite3_column_int (stmt, 8) observ%error = sqlite3_column_int (stmt, 9) @@ -5165,12 +5166,13 @@ integer function db_next_row_observ_view(stmt, view, validate) result(rc) if (sqlite3_column_type(stmt, 4) /= SQLITE_TEXT) return if (sqlite3_column_type(stmt, 5) /= SQLITE_INTEGER) return if (sqlite3_column_type(stmt, 6) /= SQLITE_TEXT) return - if (sqlite3_column_type(stmt, 7) /= SQLITE_INTEGER) return - if (sqlite3_column_type(stmt, 8) /= SQLITE_TEXT) return + if (sqlite3_column_type(stmt, 7) /= SQLITE_TEXT) return + if (sqlite3_column_type(stmt, 8) /= SQLITE_INTEGER) return if (sqlite3_column_type(stmt, 9) /= SQLITE_TEXT) return - if (sqlite3_column_type(stmt, 10) /= SQLITE_INTEGER) return + if (sqlite3_column_type(stmt, 10) /= SQLITE_TEXT) return if (sqlite3_column_type(stmt, 11) /= SQLITE_INTEGER) return - if (sqlite3_column_type(stmt, 12) /= SQLITE_FLOAT) return + if (sqlite3_column_type(stmt, 12) /= SQLITE_INTEGER) return + if (sqlite3_column_type(stmt, 13) /= SQLITE_FLOAT) return end if view%observ_id = sqlite3_column_text (stmt, 0) @@ -5179,13 +5181,14 @@ integer function db_next_row_observ_view(stmt, view, validate) result(rc) view%target_id = sqlite3_column_text (stmt, 3) view%observ_name = sqlite3_column_text (stmt, 4) view%observ_error = sqlite3_column_int (stmt, 5) - view%request_timestamp = sqlite3_column_text (stmt, 6) - view%request_error = sqlite3_column_int (stmt, 7) - view%response_name = sqlite3_column_text (stmt, 8) - view%response_unit = sqlite3_column_text (stmt, 9) - view%response_type = sqlite3_column_int (stmt, 10) - view%response_error = sqlite3_column_int (stmt, 11) - view%response_value = sqlite3_column_double(stmt, 12) + view%request_name = sqlite3_column_text (stmt, 6) + view%request_timestamp = sqlite3_column_text (stmt, 7) + view%request_error = sqlite3_column_int (stmt, 8) + view%response_name = sqlite3_column_text (stmt, 9) + view%response_unit = sqlite3_column_text (stmt, 10) + view%response_type = sqlite3_column_int (stmt, 11) + view%response_error = sqlite3_column_int (stmt, 12) + view%response_value = sqlite3_column_double(stmt, 13) rc = E_NONE end function db_next_row_observ_view @@ -5521,32 +5524,36 @@ integer function db_select_requests(db, requests, observ_id, nrequests, statemen row_loop: do i = 1, OBSERV_MAX_NREQUESTS if (sqlite3_step(stmt) /= SQLITE_ROW) exit row_loop - rc = E_DB_TYPE - if (sqlite3_column_type(stmt, 0) /= SQLITE_TEXT) exit sql_block - if (sqlite3_column_type(stmt, 1) /= SQLITE_TEXT) exit sql_block - if (sqlite3_column_type(stmt, 2) /= SQLITE_TEXT) exit sql_block - if (sqlite3_column_type(stmt, 3) /= SQLITE_TEXT) exit sql_block - if (sqlite3_column_type(stmt, 4) /= SQLITE_TEXT) exit sql_block - if (sqlite3_column_type(stmt, 5) /= SQLITE_INTEGER) exit sql_block - if (sqlite3_column_type(stmt, 6) /= SQLITE_INTEGER) exit sql_block - if (sqlite3_column_type(stmt, 7) /= SQLITE_INTEGER) exit sql_block - if (sqlite3_column_type(stmt, 8) /= SQLITE_INTEGER) exit sql_block - if (sqlite3_column_type(stmt, 9) /= SQLITE_INTEGER) exit sql_block - if (sqlite3_column_type(stmt, 10) /= SQLITE_INTEGER) exit sql_block - if (sqlite3_column_type(stmt, 11) /= SQLITE_INTEGER) exit sql_block - - requests(i)%request = sqlite3_column_text(stmt, 0) - requests(i)%response = sqlite3_column_text(stmt, 1) - requests(i)%delimiter = sqlite3_column_text(stmt, 2) - requests(i)%pattern = sqlite3_column_text(stmt, 3) - requests(i)%timestamp = sqlite3_column_text(stmt, 4) - requests(i)%delay = sqlite3_column_int (stmt, 5) - requests(i)%error = sqlite3_column_int (stmt, 6) - requests(i)%mode = sqlite3_column_int (stmt, 7) - requests(i)%retries = sqlite3_column_int (stmt, 8) - requests(i)%state = sqlite3_column_int (stmt, 9) - requests(i)%timeout = sqlite3_column_int (stmt, 10) - requests(i)%nresponses = sqlite3_column_int (stmt, 11) + if (i == 1) then + rc = E_DB_TYPE + if (sqlite3_column_type(stmt, 0) /= SQLITE_TEXT) exit sql_block + if (sqlite3_column_type(stmt, 1) /= SQLITE_TEXT) exit sql_block + if (sqlite3_column_type(stmt, 2) /= SQLITE_TEXT) exit sql_block + if (sqlite3_column_type(stmt, 3) /= SQLITE_TEXT) exit sql_block + if (sqlite3_column_type(stmt, 4) /= SQLITE_TEXT) exit sql_block + if (sqlite3_column_type(stmt, 5) /= SQLITE_TEXT) exit sql_block + if (sqlite3_column_type(stmt, 6) /= SQLITE_INTEGER) exit sql_block + if (sqlite3_column_type(stmt, 7) /= SQLITE_INTEGER) exit sql_block + if (sqlite3_column_type(stmt, 8) /= SQLITE_INTEGER) exit sql_block + if (sqlite3_column_type(stmt, 9) /= SQLITE_INTEGER) exit sql_block + if (sqlite3_column_type(stmt, 10) /= SQLITE_INTEGER) exit sql_block + if (sqlite3_column_type(stmt, 11) /= SQLITE_INTEGER) exit sql_block + if (sqlite3_column_type(stmt, 12) /= SQLITE_INTEGER) exit sql_block + end if + + requests(i)%name = sqlite3_column_text(stmt, 0) + requests(i)%timestamp = sqlite3_column_text(stmt, 1) + requests(i)%request = sqlite3_column_text(stmt, 2) + requests(i)%response = sqlite3_column_text(stmt, 3) + requests(i)%delimiter = sqlite3_column_text(stmt, 4) + requests(i)%pattern = sqlite3_column_text(stmt, 5) + requests(i)%delay = sqlite3_column_int (stmt, 6) + requests(i)%error = sqlite3_column_int (stmt, 7) + requests(i)%mode = sqlite3_column_int (stmt, 8) + requests(i)%retries = sqlite3_column_int (stmt, 9) + requests(i)%state = sqlite3_column_int (stmt, 10) + requests(i)%timeout = sqlite3_column_int (stmt, 11) + requests(i)%nresponses = sqlite3_column_int (stmt, 12) nreq = nreq + 1 end do row_loop diff --git a/src/dm_geocom_api.f90 b/src/dm_geocom_api.f90 index 47e09b9..8567d6b 100644 --- a/src/dm_geocom_api.f90 +++ b/src/dm_geocom_api.f90 @@ -19,7 +19,7 @@ module dm_geocom_api !! * `SUP` – Supervisor !! * `TMC` – Theodolite Measurement and Calculation !! - !! All GeoCOM parameters start with prefix `GEOCOM_`. + !! All GeoCOM named parameters start with prefix `GEOCOM_`. !! !! ## API !! @@ -152,104 +152,105 @@ module dm_geocom_api ! ************************************************************************** ! PRIVATE GEOCOM API CONSTANTS. ! ************************************************************************** - character(len=*), parameter :: GEOCOM_DELIMITER = '\r\n' !! Default GeoCOM delimiter. - character(len=*), parameter :: GEOCOM_GRC_PATTERN = '(?\d+)' !! Default GeoCOM response pattern. + character(len=*), parameter :: GEOCOM_DELIMITER = '\r\n' !! Default GeoCOM delimiter. + character(len=*), parameter :: GEOCOM_PATTERN = '(?\d+)' !! Default GeoCOM response pattern. - type(response_type), parameter :: GEOCOM_GRC_RESPONSES(1) = [ response_type('grc', type=RESPONSE_TYPE_INT32) ] !! Default GeoCOM responses (GRC only). + type(response_type), parameter :: GEOCOM_RESPONSES(1) = & + [ response_type('grc', type=RESPONSE_TYPE_INT32) ] !! Default GeoCOM responses (GRC only). ! ************************************************************************** ! AUT - AUTOMATION. ! ************************************************************************** ! AUT_ADJMODE: Fine-adjust position mode. - integer, parameter, public :: GEOCOM_AUT_NORM_MODE = 0 !! Angle tolerance. - integer, parameter, public :: GEOCOM_AUT_POINT_MODE = 1 !! Point tolerance. - integer, parameter, public :: GEOCOM_AUT_DEFINE_MODE = 2 !! System independent positioning tolerance. + integer, parameter, public :: GEOCOM_AUT_NORM_MODE = 0 !! Angle tolerance. + integer, parameter, public :: GEOCOM_AUT_POINT_MODE = 1 !! Point tolerance. + integer, parameter, public :: GEOCOM_AUT_DEFINE_MODE = 2 !! System independent positioning tolerance. ! AUT_ATRMODE: Automatic target recognition mode. - integer, parameter, public :: GEOCOM_AUT_POSITION = 0 !! Positioning to Hz and V angle. - integer, parameter, public :: GEOCOM_AUT_TARGET = 1 !! Positioning to a target in the env. of the Hz V angle. + integer, parameter, public :: GEOCOM_AUT_POSITION = 0 !! Positioning to Hz and V angle. + integer, parameter, public :: GEOCOM_AUT_TARGET = 1 !! Positioning to a target in the env. of the Hz and V angle. ! AUT_POSMODE: Position precision. - integer, parameter, public :: GEOCOM_AUT_NORMAL = 0 !! Fast positioning mode. - integer, parameter, public :: GEOCOM_AUT_PRECISE = 1 !! Exact positioning mode. - integer, parameter, public :: GEOCOM_AUT_FAST = 2 !! For TM30/TS30. + integer, parameter, public :: GEOCOM_AUT_NORMAL = 0 !! Fast positioning mode. + integer, parameter, public :: GEOCOM_AUT_PRECISE = 1 !! Exact positioning mode. + integer, parameter, public :: GEOCOM_AUT_FAST = 2 !! For TM30/TS30. - integer, parameter, public :: GEOCOM_AUT_CLOCKWISE = 1 !! Direction close-wise. - integer, parameter, public :: GEOCOM_AUT_ANTICLOCKWISE = -1 !! Direction counter clock-wise. + integer, parameter, public :: GEOCOM_AUT_CLOCKWISE = 1 !! Direction close-wise. + integer, parameter, public :: GEOCOM_AUT_ANTICLOCKWISE = -1 !! Direction counter clock-wise. ! ************************************************************************** ! BAP - BASIC APPLICATIONS. ! ************************************************************************** ! BAP_MEASURE_PRG: Measurement modes. - integer, parameter, public :: GEOCOM_BAP_NO_MEAS = 0 !! No measurements, take last one. - integer, parameter, public :: GEOCOM_BAP_NO_DIST = 1 !! No dist. measurement, angles only. - integer, parameter, public :: GEOCOM_BAP_DEF_DIST = 2 !! Default distance measurements. - integer, parameter, public :: GEOCOM_BAP_CLEAR_DIST = 5 !! Clear distances. - integer, parameter, public :: GEOCOM_BAP_STOP_TRK = 6 !! Stop tracking. + integer, parameter, public :: GEOCOM_BAP_NO_MEAS = 0 !! No measurements, take last one. + integer, parameter, public :: GEOCOM_BAP_NO_DIST = 1 !! No dist. measurement, angles only. + integer, parameter, public :: GEOCOM_BAP_DEF_DIST = 2 !! Default distance measurements. + integer, parameter, public :: GEOCOM_BAP_CLEAR_DIST = 5 !! Clear distances. + integer, parameter, public :: GEOCOM_BAP_STOP_TRK = 6 !! Stop tracking. ! BAP_USER_MEASPRG: Distance measurement programs. - integer, parameter, public :: GEOCOM_BAP_SINGLE_REF_STANDARD = 0 !! IR standard. - integer, parameter, public :: GEOCOM_BAP_SINGLE_REF_FAST = 1 !! IR fast. - integer, parameter, public :: GEOCOM_BAP_SINGLE_REF_VISIBLE = 2 !! LO standard. - integer, parameter, public :: GEOCOM_BAP_SINGLE_RLESS_VISIBLE = 3 !! RL standard. - integer, parameter, public :: GEOCOM_BAP_CONT_REF_STANDARD = 4 !! IR tracking. - integer, parameter, public :: GEOCOM_BAP_CONT_REF_FAST = 5 !! Not supported by TPS1200. - integer, parameter, public :: GEOCOM_BAP_CONT_RLESS_VISIBLE = 6 !! RL fast tracking. - integer, parameter, public :: GEOCOM_BAP_AVG_REF_STANDARD = 7 !! IR average. - integer, parameter, public :: GEOCOM_BAP_AVG_REF_VISIBLE = 8 !! LO average. - integer, parameter, public :: GEOCOM_BAP_AVG_RLESS_VISIBLE = 9 !! RL average. - integer, parameter, public :: GEOCOM_BAP_CONT_REF_SYNCHRO = 10 !! IR synchro tracking. - integer, parameter, public :: GEOCOM_BAP_SINGLE_REF_PRECISE = 11 !! IR precise (TM30/TS30). + integer, parameter, public :: GEOCOM_BAP_SINGLE_REF_STANDARD = 0 !! IR standard. + integer, parameter, public :: GEOCOM_BAP_SINGLE_REF_FAST = 1 !! IR fast. + integer, parameter, public :: GEOCOM_BAP_SINGLE_REF_VISIBLE = 2 !! LO standard. + integer, parameter, public :: GEOCOM_BAP_SINGLE_RLESS_VISIBLE = 3 !! RL standard. + integer, parameter, public :: GEOCOM_BAP_CONT_REF_STANDARD = 4 !! IR tracking. + integer, parameter, public :: GEOCOM_BAP_CONT_REF_FAST = 5 !! Not supported by TPS1200. + integer, parameter, public :: GEOCOM_BAP_CONT_RLESS_VISIBLE = 6 !! RL fast tracking. + integer, parameter, public :: GEOCOM_BAP_AVG_REF_STANDARD = 7 !! IR average. + integer, parameter, public :: GEOCOM_BAP_AVG_REF_VISIBLE = 8 !! LO average. + integer, parameter, public :: GEOCOM_BAP_AVG_RLESS_VISIBLE = 9 !! RL average. + integer, parameter, public :: GEOCOM_BAP_CONT_REF_SYNCHRO = 10 !! IR synchro tracking. + integer, parameter, public :: GEOCOM_BAP_SINGLE_REF_PRECISE = 11 !! IR precise (TM30/TS30). ! BAP_PRISMTYPE: Prism type definition. - integer, parameter, public :: GEOCOM_BAP_PRISM_ROUND = 0 !! Leica Circular Prism. - integer, parameter, public :: GEOCOM_BAP_PRISM_MINI = 1 !! Leica Mini Prism. - integer, parameter, public :: GEOCOM_BAP_PRISM_TAPE = 2 !! Leica Reflector Tape. - integer, parameter, public :: GEOCOM_BAP_PRISM_360 = 3 !! Leica 360° Prism. - integer, parameter, public :: GEOCOM_BAP_PRISM_USER1 = 4 !! not supported by TPS1200. - integer, parameter, public :: GEOCOM_BAP_PRISM_USER2 = 5 !! not supported by TPS1200. - integer, parameter, public :: GEOCOM_BAP_PRISM_USER3 = 6 !! not supported by TPS1200. - integer, parameter, public :: GEOCOM_BAP_PRISM_360_MINI = 7 !! Leica Mini 360° Prism - integer, parameter, public :: GEOCOM_BAP_PRISM_MINI_ZERO = 8 !! Leica Mini Zero Prism. - integer, parameter, public :: GEOCOM_BAP_PRISM_USER = 9 !! User Defined Prism. - integer, parameter, public :: GEOCOM_BAP_PRISM_NDS_TAPE = 10 !! Leica HDS Target. - integer, parameter, public :: GEOCOM_BAP_PRISM_GRZ121_ROUND = 11 !! GRZ121 360º Prism for Machine Guidance. - integer, parameter, public :: GEOCOM_BAP_PRISM_MA_MPR122 = 12 !! MPR122 360º Prism for Machine Guidance. + integer, parameter, public :: GEOCOM_BAP_PRISM_ROUND = 0 !! Leica Circular Prism. + integer, parameter, public :: GEOCOM_BAP_PRISM_MINI = 1 !! Leica Mini Prism. + integer, parameter, public :: GEOCOM_BAP_PRISM_TAPE = 2 !! Leica Reflector Tape. + integer, parameter, public :: GEOCOM_BAP_PRISM_360 = 3 !! Leica 360° Prism. + integer, parameter, public :: GEOCOM_BAP_PRISM_USER1 = 4 !! Not supported by TPS1200. + integer, parameter, public :: GEOCOM_BAP_PRISM_USER2 = 5 !! Not supported by TPS1200. + integer, parameter, public :: GEOCOM_BAP_PRISM_USER3 = 6 !! Not supported by TPS1200. + integer, parameter, public :: GEOCOM_BAP_PRISM_360_MINI = 7 !! Leica Mini 360° Prism + integer, parameter, public :: GEOCOM_BAP_PRISM_MINI_ZERO = 8 !! Leica Mini Zero Prism. + integer, parameter, public :: GEOCOM_BAP_PRISM_USER = 9 !! User Defined Prism. + integer, parameter, public :: GEOCOM_BAP_PRISM_NDS_TAPE = 10 !! Leica HDS Target. + integer, parameter, public :: GEOCOM_BAP_PRISM_GRZ121_ROUND = 11 !! GRZ121 360º Prism for Machine Guidance. + integer, parameter, public :: GEOCOM_BAP_PRISM_MA_MPR122 = 12 !! MPR122 360º Prism for Machine Guidance. ! BAP_REFLTYPE: Reflector type definition. - integer, parameter, public :: GEOCOM_BAP_REFL_UNDEF = 0 !! Reflector not defined. - integer, parameter, public :: GEOCOM_BAP_REFL_PRISM = 1 !! Reflector prism. - integer, parameter, public :: GEOCOM_BAP_REFL_TAPE = 2 !! Reflector tape. + integer, parameter, public :: GEOCOM_BAP_REFL_UNDEF = 0 !! Reflector not defined. + integer, parameter, public :: GEOCOM_BAP_REFL_PRISM = 1 !! Reflector prism. + integer, parameter, public :: GEOCOM_BAP_REFL_TAPE = 2 !! Reflector tape. ! BAP_TARGET_TYPE: Target type definition. - integer, parameter, public :: GEOCOM_BAP_REFL_USE = 0 !! With reflector. - integer, parameter, public :: GEOCOM_BAP_REFL_LESS = 1 !! Without reflector. + integer, parameter, public :: GEOCOM_BAP_REFL_USE = 0 !! With reflector. + integer, parameter, public :: GEOCOM_BAP_REFL_LESS = 1 !! Without reflector. ! BAP_ATRSETTING: ATR Low-Vis mode definition. - integer, parameter, public :: GEOCOM_BAP_ATRSET_NORMAL = 0 !! ATR is using no special flags or modes. - integer, parameter, public :: GEOCOM_BAP_ATRSET_LOWVIS_ON = 1 !! ATR low vis mode on. - integer, parameter, public :: GEOCOM_BAP_ATRSET_LOWVIS_AON = 2 !! ATR low vis mode always on. - integer, parameter, public :: GEOCOM_BAP_ATRSET_SRANGE_ON = 3 !! ATR high reflectivity mode on. - integer, parameter, public :: GEOCOM_BAP_ATRSET_SRANGE_AON = 4 !! ATR high reflectivity mode always on. + integer, parameter, public :: GEOCOM_BAP_ATRSET_NORMAL = 0 !! ATR is using no special flags or modes. + integer, parameter, public :: GEOCOM_BAP_ATRSET_LOWVIS_ON = 1 !! ATR low vis mode on. + integer, parameter, public :: GEOCOM_BAP_ATRSET_LOWVIS_AON = 2 !! ATR low vis mode always on. + integer, parameter, public :: GEOCOM_BAP_ATRSET_SRANGE_ON = 3 !! ATR high reflectivity mode on. + integer, parameter, public :: GEOCOM_BAP_ATRSET_SRANGE_AON = 4 !! ATR high reflectivity mode always on. ! BAP_PRISMDEF: Prism definition. - integer, parameter, public :: GEOCOM_BAP_PRISMNAME_LEN = 16 !! Prism name string length. + integer, parameter, public :: GEOCOM_BAP_PRISMNAME_LEN = 16 !! Prism name string length. ! ************************************************************************** ! BMM - BASIC MAN-MACHINE INTERFACE. ! ************************************************************************** - integer, parameter, public :: GEOCOM_IOS_BEEP_STDINTENS = 100 !! Standard intensity of beep expressed as percentage. + integer, parameter, public :: GEOCOM_IOS_BEEP_STDINTENS = 100 !! Standard intensity of beep expressed as percentage. ! ************************************************************************** ! COM - COMMUNICATION SETTINGS. ! ************************************************************************** ! COM_FORMAT: Transmission data format. - integer, parameter, public :: GEOCOM_COM_ASCII = 0 !! ASCII protocol. - integer, parameter, public :: GEOCOM_COM_BINARY = 1 !! Binary protocol. + integer, parameter, public :: GEOCOM_COM_ASCII = 0 !! ASCII protocol. + integer, parameter, public :: GEOCOM_COM_BINARY = 1 !! Binary protocol. ! COM_BAUD_RATE: Baud rate. integer, parameter, public :: GEOCOM_COM_BAUD_38400 = 0 - integer, parameter, public :: GEOCOM_COM_BAUD_19200 = 1 !! Default baud rate. + integer, parameter, public :: GEOCOM_COM_BAUD_19200 = 1 !! Default baud rate. integer, parameter, public :: GEOCOM_COM_BAUD_9600 = 2 integer, parameter, public :: GEOCOM_COM_BAUD_4800 = 3 integer, parameter, public :: GEOCOM_COM_BAUD_2400 = 4 @@ -268,58 +269,58 @@ module dm_geocom_api ! CSV - CENTRAL SERVICES. ! ************************************************************************** ! CSV_POWER_PATH: Power sources. - integer, parameter, public :: GEOCOM_CSV_EXTERNAL_POWER = 1 !! Power source is external. - integer, parameter, public :: GEOCOM_CSV_INTERNAL_POWER = 2 !! Power source is the internal battery. + integer, parameter, public :: GEOCOM_CSV_EXTERNAL_POWER = 1 !! Power source is external. + integer, parameter, public :: GEOCOM_CSV_INTERNAL_POWER = 2 !! Power source is the internal battery. ! TPS_DEVICE_CLASS: TPS device precision class. - integer, parameter, public :: GEOCOM_TPS_CLASS_1100 = 0 !! TPS1000 family member, 1 mgon, 3 ". - integer, parameter, public :: GEOCOM_TPS_CLASS_1700 = 1 !! TPS1000 family member, 0.5 mgon, 1.5 ". - integer, parameter, public :: GEOCOM_TPS_CLASS_1800 = 2 !! TPS1000 family member, 0.3 mgon, 1 ". - integer, parameter, public :: GEOCOM_TPS_CLASS_5000 = 3 !! TPS2000 family member. - integer, parameter, public :: GEOCOM_TPS_CLASS_6000 = 4 !! TPS2000 family member. - integer, parameter, public :: GEOCOM_TPS_CLASS_1500 = 5 !! TPS1000 family member. - integer, parameter, public :: GEOCOM_TPS_CLASS_2003 = 6 !! TPS2000 family member. - integer, parameter, public :: GEOCOM_TPS_CLASS_5005 = 7 !! TPS5000 family member. - integer, parameter, public :: GEOCOM_TPS_CLASS_5100 = 8 !! TPS5000 family member. - integer, parameter, public :: GEOCOM_TPS_CLASS_1102 = 100 !! TPS1100 family member, 2 ". - integer, parameter, public :: GEOCOM_TPS_CLASS_1103 = 101 !! TPS1100 family member, 3 ". - integer, parameter, public :: GEOCOM_TPS_CLASS_1105 = 102 !! TPS1100 family member, 5 ". - integer, parameter, public :: GEOCOM_TPS_CLASS_1101 = 103 !! TPS1100 family member, 1 ". - integer, parameter, public :: GEOCOM_TPS_CLASS_1202 = 200 !! TPS1200 family member, 2 ". - integer, parameter, public :: GEOCOM_TPS_CLASS_1203 = 201 !! TPS1200 family member, 3 ". - integer, parameter, public :: GEOCOM_TPS_CLASS_1205 = 202 !! TPS1200 family member, 5 ". - integer, parameter, public :: GEOCOM_TPS_CLASS_1201 = 203 !! TPS1200 family member, 1 ". - integer, parameter, public :: GEOCOM_TPS_CLASS_TX30 = 300 !! TS30,TM30 family member, 0.5 ". - integer, parameter, public :: GEOCOM_TPS_CLASS_TX31 = 301 !! TS30,TM30 family member, 1 ". + integer, parameter, public :: GEOCOM_TPS_CLASS_1100 = 0 !! TPS1000 family member, 1 mgon, 3 ". + integer, parameter, public :: GEOCOM_TPS_CLASS_1700 = 1 !! TPS1000 family member, 0.5 mgon, 1.5 ". + integer, parameter, public :: GEOCOM_TPS_CLASS_1800 = 2 !! TPS1000 family member, 0.3 mgon, 1 ". + integer, parameter, public :: GEOCOM_TPS_CLASS_5000 = 3 !! TPS2000 family member. + integer, parameter, public :: GEOCOM_TPS_CLASS_6000 = 4 !! TPS2000 family member. + integer, parameter, public :: GEOCOM_TPS_CLASS_1500 = 5 !! TPS1000 family member. + integer, parameter, public :: GEOCOM_TPS_CLASS_2003 = 6 !! TPS2000 family member. + integer, parameter, public :: GEOCOM_TPS_CLASS_5005 = 7 !! TPS5000 family member. + integer, parameter, public :: GEOCOM_TPS_CLASS_5100 = 8 !! TPS5000 family member. + integer, parameter, public :: GEOCOM_TPS_CLASS_1102 = 100 !! TPS1100 family member, 2 ". + integer, parameter, public :: GEOCOM_TPS_CLASS_1103 = 101 !! TPS1100 family member, 3 ". + integer, parameter, public :: GEOCOM_TPS_CLASS_1105 = 102 !! TPS1100 family member, 5 ". + integer, parameter, public :: GEOCOM_TPS_CLASS_1101 = 103 !! TPS1100 family member, 1 ". + integer, parameter, public :: GEOCOM_TPS_CLASS_1202 = 200 !! TPS1200 family member, 2 ". + integer, parameter, public :: GEOCOM_TPS_CLASS_1203 = 201 !! TPS1200 family member, 3 ". + integer, parameter, public :: GEOCOM_TPS_CLASS_1205 = 202 !! TPS1200 family member, 5 ". + integer, parameter, public :: GEOCOM_TPS_CLASS_1201 = 203 !! TPS1200 family member, 1 ". + integer, parameter, public :: GEOCOM_TPS_CLASS_TX30 = 300 !! TS30,TM30 family member, 0.5 ". + integer, parameter, public :: GEOCOM_TPS_CLASS_TX31 = 301 !! TS30,TM30 family member, 1 ". ! TPS_DEVICE_TYPE: TPS device configuration type. ! -- TPS1x00 common. - integer, parameter, public :: GEOCOM_TPS_DEVICE_T = int(z'00000') !! Theodolite without built-in EDM. - integer, parameter, public :: GEOCOM_TPS_DEVICE_MOT = int(z'00004') !! Motorized device. - integer, parameter, public :: GEOCOM_TPS_DEVICE_ATR = int(z'00008') !! Automatic Target Recognition. - integer, parameter, public :: GEOCOM_TPS_DEVICE_EGL = int(z'00010') !! Electronic Guide Light. - integer, parameter, public :: GEOCOM_TPS_DEVICE_DB = int(z'00020') !! Reserved (Database, not GSI). - integer, parameter, public :: GEOCOM_TPS_DEVICE_DL = int(z'00040') !! Diode laser. - integer, parameter, public :: GEOCOM_TPS_DEVICE_LP = int(z'00080') !! Laser plumbed. + integer, parameter, public :: GEOCOM_TPS_DEVICE_T = int(z'00000') !! Theodolite without built-in EDM. + integer, parameter, public :: GEOCOM_TPS_DEVICE_MOT = int(z'00004') !! Motorized device. + integer, parameter, public :: GEOCOM_TPS_DEVICE_ATR = int(z'00008') !! Automatic Target Recognition. + integer, parameter, public :: GEOCOM_TPS_DEVICE_EGL = int(z'00010') !! Electronic Guide Light. + integer, parameter, public :: GEOCOM_TPS_DEVICE_DB = int(z'00020') !! Reserved (Database, not GSI). + integer, parameter, public :: GEOCOM_TPS_DEVICE_DL = int(z'00040') !! Diode laser. + integer, parameter, public :: GEOCOM_TPS_DEVICE_LP = int(z'00080') !! Laser plumbed. ! -- TPS1000 specific. - integer, parameter, public :: GEOCOM_TPS_DEVICE_TC1 = int(z'00001') !! Tachymeter (TCW1). - integer, parameter, public :: GEOCOM_TPS_DEVICE_TC2 = int(z'00002') !! Tachymeter (TCW2). + integer, parameter, public :: GEOCOM_TPS_DEVICE_TC1 = int(z'00001') !! Tachymeter (TCW1). + integer, parameter, public :: GEOCOM_TPS_DEVICE_TC2 = int(z'00002') !! Tachymeter (TCW2). ! -- TPS1100/TPS1200 specific. - integer, parameter, public :: GEOCOM_TPS_DEVICE_TC = int(z'00001') !! Tachymeter (TCW3). - integer, parameter, public :: GEOCOM_TPS_DEVICE_TCR = int(z'00002') !! Tachymeter (TCW3 with red laser). - integer, parameter, public :: GEOCOM_TPS_DEVICE_ATC = int(z'00100') !! Autocollimation lamp (used only PMU). - integer, parameter, public :: GEOCOM_TPS_DEVICE_LPNT = int(z'00200') !! Laserpointer. - integer, parameter, public :: GEOCOM_TPS_DEVICE_RL_EXT = int(z'00400') !! Reflectorless EDM with extended range (Pinpoint R100, R300). - integer, parameter, public :: GEOCOM_TPS_DEVICE_PS = int(z'00800') !! Power Search. + integer, parameter, public :: GEOCOM_TPS_DEVICE_TC = int(z'00001') !! Tachymeter (TCW3). + integer, parameter, public :: GEOCOM_TPS_DEVICE_TCR = int(z'00002') !! Tachymeter (TCW3 with red laser). + integer, parameter, public :: GEOCOM_TPS_DEVICE_ATC = int(z'00100') !! Autocollimation lamp (used only PMU). + integer, parameter, public :: GEOCOM_TPS_DEVICE_LPNT = int(z'00200') !! Laserpointer. + integer, parameter, public :: GEOCOM_TPS_DEVICE_RL_EXT = int(z'00400') !! Reflectorless EDM with extended range (Pinpoint R100, R300). + integer, parameter, public :: GEOCOM_TPS_DEVICE_PS = int(z'00800') !! Power Search. ! -- TPSSim specific. - integer, parameter, public :: GEOCOM_TPS_DEVICE_SIM = int(z'04000') !! Runs on simulation, no hardware. + integer, parameter, public :: GEOCOM_TPS_DEVICE_SIM = int(z'04000') !! Runs on simulation, no hardware. ! TPS_REFLESS_CLASS: Reflectorless class. integer, parameter, public :: GEOCOM_TPS_REFLESS_NONE = 0 - integer, parameter, public :: GEOCOM_TPS_REFLESS_R100 = 1 !! Pinpoint R100. - integer, parameter, public :: GEOCOM_TPS_REFLESS_R300 = 2 !! Pinpoint R300. - integer, parameter, public :: GEOCOM_TPS_REFLESS_R400 = 3 !! Pinpoint R400. - integer, parameter, public :: GEOCOM_TPS_REFLESS_R1000 = 4 !! Pinpoint R1000. + integer, parameter, public :: GEOCOM_TPS_REFLESS_R100 = 1 !! Pinpoint R100. + integer, parameter, public :: GEOCOM_TPS_REFLESS_R300 = 2 !! Pinpoint R300. + integer, parameter, public :: GEOCOM_TPS_REFLESS_R400 = 3 !! Pinpoint R400. + integer, parameter, public :: GEOCOM_TPS_REFLESS_R1000 = 4 !! Pinpoint R1000. ! ************************************************************************** ! EDM - ELECTRONIC DISTANCE MEASUREMENT. @@ -331,89 +332,89 @@ module dm_geocom_api integer, parameter, public :: GEOCOM_EDM_EGLINTEN_HIGH = 3 ! EDM_MODE: EDM measurement mode. - integer, parameter, public :: GEOCOM_EDM_MODE_NOT_USED = 0 !! Initial value. - integer, parameter, public :: GEOCOM_EDM_SINGLE_TAPE = 1 !! IR Standard Reflector Tape. - integer, parameter, public :: GEOCOM_EDM_SINGLE_STANDARD = 2 !! IR Standard. - integer, parameter, public :: GEOCOM_EDM_SINGLE_FAST = 3 !! IR Fast. - integer, parameter, public :: GEOCOM_EDM_SINGLE_LRANGE = 4 !! LO Standard. - integer, parameter, public :: GEOCOM_EDM_SINGLE_SRANGE = 5 !! RL Standard. - integer, parameter, public :: GEOCOM_EDM_CONT_STANDARD = 6 !! Standard repeated measurement. - integer, parameter, public :: GEOCOM_EDM_CONT_DYNAMIC = 7 !! IR Tacking. - integer, parameter, public :: GEOCOM_EDM_CONT_REFLESS = 8 !! RL Tracking. - integer, parameter, public :: GEOCOM_EDM_CONT_FAST = 9 !! Fast repeated measurement. - integer, parameter, public :: GEOCOM_EDM_AVERAGE_IR = 10 !! IR Average. - integer, parameter, public :: GEOCOM_EDM_AVERAGE_SR = 11 !! RL Average. - integer, parameter, public :: GEOCOM_EDM_AVERAGE_LR = 12 !! LO Average. - integer, parameter, public :: GEOCOM_EDM_PRECISE_IR = 13 !! IR Precise (TM30, TS30). - integer, parameter, public :: GEOCOM_EDM_PRECISE_TAPE = 14 !! IR Precise Reflector Tape (TM30, TS30). + integer, parameter, public :: GEOCOM_EDM_MODE_NOT_USED = 0 !! Initial value. + integer, parameter, public :: GEOCOM_EDM_SINGLE_TAPE = 1 !! IR Standard Reflector Tape. + integer, parameter, public :: GEOCOM_EDM_SINGLE_STANDARD = 2 !! IR Standard. + integer, parameter, public :: GEOCOM_EDM_SINGLE_FAST = 3 !! IR Fast. + integer, parameter, public :: GEOCOM_EDM_SINGLE_LRANGE = 4 !! LO Standard. + integer, parameter, public :: GEOCOM_EDM_SINGLE_SRANGE = 5 !! RL Standard. + integer, parameter, public :: GEOCOM_EDM_CONT_STANDARD = 6 !! Standard repeated measurement. + integer, parameter, public :: GEOCOM_EDM_CONT_DYNAMIC = 7 !! IR Tacking. + integer, parameter, public :: GEOCOM_EDM_CONT_REFLESS = 8 !! RL Tracking. + integer, parameter, public :: GEOCOM_EDM_CONT_FAST = 9 !! Fast repeated measurement. + integer, parameter, public :: GEOCOM_EDM_AVERAGE_IR = 10 !! IR Average. + integer, parameter, public :: GEOCOM_EDM_AVERAGE_SR = 11 !! RL Average. + integer, parameter, public :: GEOCOM_EDM_AVERAGE_LR = 12 !! LO Average. + integer, parameter, public :: GEOCOM_EDM_PRECISE_IR = 13 !! IR Precise (TM30, TS30). + integer, parameter, public :: GEOCOM_EDM_PRECISE_TAPE = 14 !! IR Precise Reflector Tape (TM30, TS30). ! ************************************************************************** ! FTR - FILE TRANSFER. ! ************************************************************************** - integer, parameter, public :: GEOCOM_FTR_MAX_BLOCKSIZE = 450 !! Max. block size. + integer, parameter, public :: GEOCOM_FTR_MAX_BLOCKSIZE = 450 !! Max. block size. ! FTR_DEVICETYPE: Device type. - integer, parameter, public :: GEOCOM_FTR_DEVICE_INTERNAL = 0 !! Internal memory. - integer, parameter, public :: GEOCOM_FTR_DEVICE_PCPARD = 1 !! Memory card. + integer, parameter, public :: GEOCOM_FTR_DEVICE_INTERNAL = 0 !! Internal memory. + integer, parameter, public :: GEOCOM_FTR_DEVICE_PCPARD = 1 !! Memory card. ! FTR_FILETYPE: File type. - integer, parameter, public :: GEOCOM_FTR_FILE_UNKNOWN = 0 !! Undocumented. - integer, parameter, public :: GEOCOM_FTR_FILE_IMAGES = 170 !! Extension wildcard: `*.jpg`. + integer, parameter, public :: GEOCOM_FTR_FILE_UNKNOWN = 0 !! Undocumented. + integer, parameter, public :: GEOCOM_FTR_FILE_IMAGES = 170 !! Extension wildcard: `*.jpg`. ! ************************************************************************** ! IMG - IMAGE PROCESSING. ! ************************************************************************** ! IMG_MEM_TYPE: Memory device type. - integer, parameter, public :: GEOCOM_IMG_INTERNAL_MEMORY = int(z'0') !! Internal memory module. - integer, parameter, public :: GEOCOM_IMG_PC_CARD = int(z'1') !! External PC Card. + integer, parameter, public :: GEOCOM_IMG_INTERNAL_MEMORY = int(z'0') !! Internal memory module. + integer, parameter, public :: GEOCOM_IMG_PC_CARD = int(z'1') !! External PC Card. - integer, parameter, public :: GEOCOM_IMG_MAX_FILE_PREFIX_LEN = 20 !! Length of file name prefix. + integer, parameter, public :: GEOCOM_IMG_MAX_FILE_PREFIX_LEN = 20 !! Length of file name prefix. ! ************************************************************************** ! MOT - MOTORISATION. ! ************************************************************************** ! MOT_LOCK_STATUS: Lock conditions. - integer, parameter, public :: GEOCOM_MOT_LOCKED_OUT = 0 !! Locked out. - integer, parameter, public :: GEOCOM_MOT_LOCKED_IN = 1 !! Locked in. - integer, parameter, public :: GEOCOM_MOT_PREDICTION = 2 !! Prediction mode. + integer, parameter, public :: GEOCOM_MOT_LOCKED_OUT = 0 !! Locked out. + integer, parameter, public :: GEOCOM_MOT_LOCKED_IN = 1 !! Locked in. + integer, parameter, public :: GEOCOM_MOT_PREDICTION = 2 !! Prediction mode. ! MOT_STOPMODE: Controller stop mode. - integer, parameter, public :: GEOCOM_MOT_NORMAL = 0 !! Slow down with current acceleration. - integer, parameter, public :: GEOCOM_MOT_SHUTDOWN = 1 !! Slow down by switch off power supply. + integer, parameter, public :: GEOCOM_MOT_NORMAL = 0 !! Slow down with current acceleration. + integer, parameter, public :: GEOCOM_MOT_SHUTDOWN = 1 !! Slow down by switch off power supply. ! MOT_MODE: Controller configuration. - integer, parameter, public :: GEOCOM_MOT_POSIT = 0 !! Configured for relative positioning. - integer, parameter, public :: GEOCOM_MOT_OCONST = 1 !! Configured for constant speed. - integer, parameter, public :: GEOCOM_MOT_MANUPOS = 2 !! Configured for manual positioning (default setting). - integer, parameter, public :: GEOCOM_MOT_LOCK = 3 !! Configured as "Lock-In" controller. - integer, parameter, public :: GEOCOM_MOT_BREAK = 4 !! Configured as "Brake" controller. - integer, parameter, public :: GEOCOM_MOT_TERM = 7 !! Terminates the controller task. + integer, parameter, public :: GEOCOM_MOT_POSIT = 0 !! Configured for relative positioning. + integer, parameter, public :: GEOCOM_MOT_OCONST = 1 !! Configured for constant speed. + integer, parameter, public :: GEOCOM_MOT_MANUPOS = 2 !! Configured for manual positioning (default setting). + integer, parameter, public :: GEOCOM_MOT_LOCK = 3 !! Configured as "Lock-In" controller. + integer, parameter, public :: GEOCOM_MOT_BREAK = 4 !! Configured as "Brake" controller. + integer, parameter, public :: GEOCOM_MOT_TERM = 7 !! Terminates the controller task. ! ************************************************************************** ! TMC - THEODOLITE MEASUREMENT AND CALCULATION. ! ************************************************************************** ! TMC_INCLINE_PRG: Inclination sensor measurement program. - integer, parameter, public :: GEOCOM_TMC_MEA_INC = 0 !! Use sensor (a priori sigma). - integer, parameter, public :: GEOCOM_TMC_AUTO_INC = 1 !! Automatic mode (sensor/plane). - integer, parameter, public :: GEOCOM_TMC_PLANE_INC = 2 !! Use plane (a priori sigma). + integer, parameter, public :: GEOCOM_TMC_MEA_INC = 0 !! Use sensor (a priori sigma). + integer, parameter, public :: GEOCOM_TMC_AUTO_INC = 1 !! Automatic mode (sensor/plane). + integer, parameter, public :: GEOCOM_TMC_PLANE_INC = 2 !! Use plane (a priori sigma). ! TMC_MEASURE_PRG: TMC measurement mode. - integer, parameter, public :: GEOCOM_TMC_STOP = 0 !! Stop measurement program - integer, parameter, public :: GEOCOM_TMC_DEF_DIST = 1 !! Default DIST-measurement program. - integer, parameter, public :: GEOCOM_TMC_CLEAR = 3 !! TMC_STOP and clear data. - integer, parameter, public :: GEOCOM_TMC_SIGNAL = 4 !! Signal measurement (test function). - integer, parameter, public :: GEOCOM_TMC_DO_MEASURE = 6 !! (Re-)start measurement task. - integer, parameter, public :: GEOCOM_TMC_RTRK_DIST = 8 !! Distance-TRK measurement program. - integer, parameter, public :: GEOCOM_TMC_RED_TRK_DIST = 10 !! Reflectorless tracking. - integer, parameter, public :: GEOCOM_TMC_FREQUENCY = 11 !! Frequency measurement (test). + integer, parameter, public :: GEOCOM_TMC_STOP = 0 !! Stop measurement program. + integer, parameter, public :: GEOCOM_TMC_DEF_DIST = 1 !! Default DIST-measurement program. + integer, parameter, public :: GEOCOM_TMC_CLEAR = 3 !! TMC_STOP and clear data. + integer, parameter, public :: GEOCOM_TMC_SIGNAL = 4 !! Signal measurement (test function). + integer, parameter, public :: GEOCOM_TMC_DO_MEASURE = 6 !! (Re-)start measurement task. + integer, parameter, public :: GEOCOM_TMC_RTRK_DIST = 8 !! Distance-TRK measurement program. + integer, parameter, public :: GEOCOM_TMC_RED_TRK_DIST = 10 !! Reflectorless tracking. + integer, parameter, public :: GEOCOM_TMC_FREQUENCY = 11 !! Frequency measurement (test). ! TMC_FACE_DEF: Face position. - integer, parameter, public :: GEOCOM_TMC_FACE_NORMAL = 0 !! Face in normal position. - integer, parameter, public :: GEOCOM_TMC_FACE_TURN = 1 !! Face turned. + integer, parameter, public :: GEOCOM_TMC_FACE_NORMAL = 0 !! Face in normal position. + integer, parameter, public :: GEOCOM_TMC_FACE_TURN = 1 !! Face turned. ! TMC_FACE: Actual face. - integer, parameter, public :: GEOCOM_TMC_FACE_1 = 0 !! Position 1 of telescope. - integer, parameter, public :: GEOCOM_TMC_FACE_2 = 1 !! Position 2 of telescope. + integer, parameter, public :: GEOCOM_TMC_FACE_1 = 0 !! Position 1 of telescope. + integer, parameter, public :: GEOCOM_TMC_FACE_2 = 1 !! Position 2 of telescope. ! ************************************************************************** ! SUP - SUPERVISOR. @@ -672,10 +673,11 @@ end function dm_geocom_api_parameter_tmc_measure_prg ! ************************************************************************** ! PUBLIC REQUEST PREPARATION PROCEDURES. ! ************************************************************************** - pure subroutine dm_geocom_api_request(request, code, arguments, pattern, responses, mode) + pure subroutine dm_geocom_api_request(request, name, code, arguments, pattern, responses, mode) !! Prepares a DMPACK request type by setting request command, response !! pattern, response delimiter, and response definition array. type(request_type), intent(out) :: request !! Prepared request type. + character(len=*), intent(in) :: name !! Request name. integer, intent(in) :: code !! GeoCOM request code. character(len=*), intent(in), optional :: arguments !! GeoCOM request arguments. character(len=*), intent(in), optional :: pattern !! Regular expression pattern that matches the raw response. @@ -684,6 +686,7 @@ pure subroutine dm_geocom_api_request(request, code, arguments, pattern, respons integer :: n + request%name = name request%delimiter = GEOCOM_DELIMITER if (present(arguments)) then @@ -710,7 +713,7 @@ end subroutine dm_geocom_api_request ! PUBLIC GEOCOM REQUEST PREPARATION PROCEDURES. ! ************************************************************************** pure subroutine dm_geocom_api_request_abort_download(request) - !! Request of `FTR_AbortDownload` procedure. Creates request to abort + !! Request of *FTR_AbortDownload* procedure. Creates request to abort !! or end the file download command. !! !! The instrument returns the following responses: @@ -723,15 +726,16 @@ pure subroutine dm_geocom_api_request_abort_download(request) !! | ASCII request | `%R1Q,23305:` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 23305 + character(len=*), parameter :: REQUEST_NAME = 'abort_download' + integer, parameter :: REQUEST_CODE = 23305 type(request_type), intent(out) :: request !! Prepared request. - call dm_geocom_api_request(request, REQCODE, pattern=GEOCOM_GRC_PATTERN, responses=GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=GEOCOM_PATTERN, responses=GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_abort_download pure subroutine dm_geocom_api_request_abort_list(request) - !! Request of `FTR_AbortList` procedure. Creates request to aborts or + !! Request of *FTR_AbortList* procedure. Creates request to abort or !! end the file list command. !! !! The instrument returns the following responses: @@ -744,15 +748,16 @@ pure subroutine dm_geocom_api_request_abort_list(request) !! | ASCII request | `%R1Q,23308:` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 23308 + character(len=*), parameter :: REQUEST_NAME = 'abort_list' + integer, parameter :: REQUEST_CODE = 23308 type(request_type), intent(out) :: request !! Prepared request. - call dm_geocom_api_request(request, REQCODE, pattern=GEOCOM_GRC_PATTERN, responses=GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=GEOCOM_PATTERN, responses=GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_abort_list pure subroutine dm_geocom_api_request_beep_alarm(request) - !! Request of `BMM_BeepAlarm` procedure. Creates request to output an + !! Request of *BMM_BeepAlarm* procedure. Creates request to output an !! alarm signal (triple beep). !! !! The instrument returns the following responses: @@ -765,15 +770,16 @@ pure subroutine dm_geocom_api_request_beep_alarm(request) !! | ASCII request | `%R1Q,11004:` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 11004 + character(len=*), parameter :: REQUEST_NAME = 'beep_alarm' + integer, parameter :: REQUEST_CODE = 11004 type(request_type), intent(out) :: request !! Prepared request. - call dm_geocom_api_request(request, REQCODE, pattern=GEOCOM_GRC_PATTERN, responses=GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=GEOCOM_PATTERN, responses=GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_beep_alarm pure subroutine dm_geocom_api_request_beep_normal(request) - !! Request of `BMM_BeepNormal` procedure. Creates request to output an + !! Request of *BMM_BeepNormal* procedure. Creates request to output an !! alarm signal (single beep). !! !! The instrument returns the following responses: @@ -786,15 +792,16 @@ pure subroutine dm_geocom_api_request_beep_normal(request) !! | ASCII request | `%R1Q,11003:` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 11003 + character(len=*), parameter :: REQUEST_NAME = 'beep_normal' + integer, parameter :: REQUEST_CODE = 11003 type(request_type), intent(out) :: request !! Prepared request. - call dm_geocom_api_request(request, REQCODE, pattern=GEOCOM_GRC_PATTERN, responses=GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=GEOCOM_PATTERN, responses=GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_beep_normal pure subroutine dm_geocom_api_request_beep_off(request) - !! Request of `IOS_BeepOff` procedure. Creates request to stop an + !! Request of *IOS_BeepOff* procedure. Creates request to stop an !! active beep signal. !! !! The instrument returns the following responses: @@ -807,15 +814,16 @@ pure subroutine dm_geocom_api_request_beep_off(request) !! | ASCII request | `%R1Q,20000:` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 20000 + character(len=*), parameter :: REQUEST_NAME = 'beep_off' + integer, parameter :: REQUEST_CODE = 20000 type(request_type), intent(out) :: request !! Prepared request. - call dm_geocom_api_request(request, REQCODE, pattern=GEOCOM_GRC_PATTERN, responses=GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=GEOCOM_PATTERN, responses=GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_beep_off pure subroutine dm_geocom_api_request_beep_on(request, intensity) - !! Request of `IOS_BeepOn` procedure. Creates request for continuous + !! Request of *IOS_BeepOn* procedure. Creates request for continuous !! beep signal of given intensity. !! !! The instrument returns the following responses: @@ -828,7 +836,8 @@ pure subroutine dm_geocom_api_request_beep_on(request, intensity) !! | ASCII request | `%R1Q,20001:` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 20001 + character(len=*), parameter :: REQUEST_NAME = 'beep_on' + integer, parameter :: REQUEST_CODE = 20001 type(request_type), intent(out) :: request !! Prepared request. integer, intent(in) :: intensity !! Intensity of beep, from 0 to 100. @@ -836,11 +845,11 @@ pure subroutine dm_geocom_api_request_beep_on(request, intensity) character(len=80) :: args write (args, '(i0)') intensity - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_beep_on pure subroutine dm_geocom_api_request_change_face(request, pos_mode, atr_mode) - !! Request of `AUT_ChangeFace` procedure. Creates request for turning + !! Request of *AUT_ChangeFace* procedure. Creates request for turning !! the telescope to the other face. !! !! If `pos_mode` is `AUT_NORMAL`, uses the current value of the @@ -862,7 +871,8 @@ pure subroutine dm_geocom_api_request_change_face(request, pos_mode, atr_mode) !! | ASCII request | `%R1Q,9028:,,0` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 9028 + character(len=*), parameter :: REQUEST_NAME = 'change_face' + integer, parameter :: REQUEST_CODE = 9028 type(request_type), intent(out) :: request !! Prepared request. integer, intent(in) :: pos_mode !! Position mode (`AUT_POSMODE`). @@ -871,11 +881,11 @@ pure subroutine dm_geocom_api_request_change_face(request, pos_mode, atr_mode) character(len=80) :: args write (args, '(i0, ",", i0, ",0")') pos_mode, atr_mode - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_change_face pure subroutine dm_geocom_api_request_delete(request, device_type, file_type, day, month, year, file_name) - !! Request of `FTR_Delete` procedure. Creates request for deleting one + !! Request of *FTR_Delete* procedure. Creates request for deleting one !! or more files. !! !! Wildcards may be used to delete multiple files. If the deletion date @@ -892,8 +902,9 @@ pure subroutine dm_geocom_api_request_delete(request, device_type, file_type, da !! | ASCII request | `%R1Q,23309:,,,,,` | !! | ASCII response | `%R1P,0,0:,` | !! - integer, parameter :: REQCODE = 23309 - character(len=*), parameter :: PATTERN = '(?\d+),(?\d+)' + character(len=*), parameter :: REQUEST_NAME = 'delete' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?\d+)' + integer, parameter :: REQUEST_CODE = 23309 type(request_type), intent(out) :: request !! Prepared request. integer, intent(in) :: device_type !! Internal memory or memory card (`FTR_DEVICETYPE`). @@ -913,15 +924,15 @@ pure subroutine dm_geocom_api_request_delete(request, device_type, file_type, da response_type('nfiles', type=RESPONSE_TYPE_INT32) & ] - call dm_geocom_api_request(request, REQCODE, args, PATTERN, responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, REQUEST_PATTERN, responses) end subroutine dm_geocom_api_request_delete - pure subroutine dm_geocom_api_request_do_measure(request, prog, inc_mode) - !! Request of `TMC_DoMeasure` procedure. Creates request for trying a + pure subroutine dm_geocom_api_request_do_measure(request, tmc_prog, inc_mode) + !! Request of *TMC_DoMeasure* procedure. Creates request for trying a !! distance measurement. This command does not return any values. !! - !! The argument `prog` (`TMC_MEASURE_PRG`) may be one of the following - !! TMC measurement modes: + !! The argument `tmc_prog` (`TMC_MEASURE_PRG`) may be one of the + !! following TMC measurement modes: !! !! * `TMC_STOP` !! * `TMC_DEF_DIST` @@ -949,24 +960,25 @@ pure subroutine dm_geocom_api_request_do_measure(request, prog, inc_mode) !! | Property | Values | !! |----------------|--------------------------------------------------| !! | Instruments | TPS1100, TPS1200, TM30/TS30, TS16 | - !! | ASCII request | `%R1Q,2008:,` | + !! | ASCII request | `%R1Q,2008:,` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 2008 + character(len=*), parameter :: REQUEST_NAME = 'do_measure' + integer, parameter :: REQUEST_CODE = 2008 type(request_type), intent(out) :: request !! Prepared request. - integer, intent(in) :: prog !! TMC measurement program (`TMC_MEASURE_PRG`). + integer, intent(in) :: tmc_prog !! TMC measurement program (`TMC_MEASURE_PRG`). integer, intent(in) :: inc_mode !! Inclination measurement mode (`TMC_INCLINE_PRG`). character(len=80) :: args - write (args, '(i0, ",", i0)') prog, inc_mode - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + write (args, '(i0, ",", i0)') tmc_prog, inc_mode + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_do_measure pure subroutine dm_geocom_api_request_download(request, block_number) - !! Request of `FTR_Download` procedure. Creates request to get a - !! single block of data. The `FTR_SetupDownload` command has to be + !! Request of *FTR_Download* procedure. Creates request to get a + !! single block of data. The *FTR_SetupDownload* command has to be !! called first. !! !! The block sequence starts with 1. The download process will be @@ -987,8 +999,9 @@ pure subroutine dm_geocom_api_request_download(request, block_number) !! | ASCII request | `%R1Q,23304:` | !! | ASCII response | `%R1P,0,0:,,` | !! - integer, parameter :: REQCODE = 23304 - character(len=*), parameter :: PATTERN = '(?\d+),(?[0-9a-f]+),(?\d+)' + character(len=*), parameter :: REQUEST_NAME = 'download' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?[0-9a-f]+),(?\d+)' + integer, parameter :: REQUEST_CODE = 23304 integer, parameter :: MODE = REQUEST_MODE_GEOCOM_FILE type(request_type), intent(out) :: request !! Prepared request. @@ -1005,11 +1018,11 @@ pure subroutine dm_geocom_api_request_download(request, block_number) response_type('blocklen', type=RESPONSE_TYPE_INT32) & ] - call dm_geocom_api_request(request, REQCODE, args, PATTERN, responses, mode=MODE) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, REQUEST_PATTERN, responses, mode=MODE) end subroutine dm_geocom_api_request_download pure subroutine dm_geocom_api_request_fine_adjust(request, search_hz, search_v) - !! Request of `AUT_FineAdjust` procedure. Creates request for + !! Request of *AUT_FineAdjust* procedure. Creates request for !! automatic target positioning. !! !! The procedure positions the telescope onto the target prosm and @@ -1040,7 +1053,8 @@ pure subroutine dm_geocom_api_request_fine_adjust(request, search_hz, search_v) !! | ASCII request | `%R1Q,9037:,` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 9027 + character(len=*), parameter :: REQUEST_NAME = 'fine_adjust' + integer, parameter :: REQUEST_CODE = 9027 type(request_type), intent(out) :: request !! Prepared request. real(kind=r8), intent(in) :: search_hz !! Search range, Hz axis [rad]. @@ -1049,11 +1063,11 @@ pure subroutine dm_geocom_api_request_fine_adjust(request, search_hz, search_v) character(len=80) :: args write (args, '(2(f0.12, ","), "0")') search_hz, search_v - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_fine_adjust pure subroutine dm_geocom_api_request_get_angle(request, inc_mode) - !! Request of `TMC_GetAngle5` procedure. Creates request for returning + !! Request of *TMC_GetAngle5* procedure. Creates request for returning !! a simple angle measurement. !! !! The function starts an angle measurement and returns the results. @@ -1070,8 +1084,9 @@ pure subroutine dm_geocom_api_request_get_angle(request, inc_mode) !! | ASCII request | `%R1Q,2107:` | !! | ASCII response | `%R1P,0,0:,,` | !! - integer, parameter :: REQCODE = 2107 - character(len=*), parameter :: PATTERN = '(?\d+),(?[\d\.]+),(?[\d\.]+)' + character(len=*), parameter :: REQUEST_NAME = 'get_angle' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?[\d\.]+),(?[\d\.]+)' + integer, parameter :: REQUEST_CODE = 2107 type(request_type), intent(out) :: request !! Prepared request. integer, intent(in) :: inc_mode !! Inclination measurement mode (`TMC_INCLINE_PRG`). @@ -1087,11 +1102,11 @@ pure subroutine dm_geocom_api_request_get_angle(request, inc_mode) response_type('v', unit='rad', type=RESPONSE_TYPE_REAL64) & ! Vertical angle [rad]. ] - call dm_geocom_api_request(request, REQCODE, args, PATTERN, responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, REQUEST_PATTERN, responses) end subroutine dm_geocom_api_request_get_angle pure subroutine dm_geocom_api_request_get_angle_complete(request, inc_mode) - !! Request of `TMC_GetAngle1` procedure. Creates request for returning + !! Request of *TMC_GetAngle1* procedure. Creates request for returning !! a complete angle measurement. !! !! The function starts an angle and, depending on the configuration, an @@ -1116,10 +1131,11 @@ pure subroutine dm_geocom_api_request_get_angle_complete(request, inc_mode) !! | ASCII request | `%R1Q,2003:` | !! | ASCII response | `%R1P,0,0:,,,,,,,,,` | !! - integer, parameter :: REQCODE = 2003 - character(len=*), parameter :: PATTERN = & + character(len=*), parameter :: REQUEST_NAME = 'get_angle_complete' + character(len=*), parameter :: REQUEST_PATTERN = & '(?\d+),(?[-\d\.]+),(?[-\d\.]+),(?[-\d\.]+),(?\d+),' // & '(?[-\d\.]+),(?[-\d\.]+),(?[-\d\.]+),(?\d+),(?\d+)' + integer, parameter :: REQUEST_CODE = 2003 type(request_type), intent(out) :: request !! Prepared request. integer, intent(in) :: inc_mode !! Inclination measurement mode (`TMC_INCLINE_PRG`). @@ -1142,11 +1158,11 @@ pure subroutine dm_geocom_api_request_get_angle_complete(request, inc_mode) response_type('face', unit=' ', type=RESPONSE_TYPE_INT32) & ! Face position of telescope. ] - call dm_geocom_api_request(request, REQCODE, args, PATTERN, responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, REQUEST_PATTERN, responses) end subroutine dm_geocom_api_request_get_angle_complete pure subroutine dm_geocom_api_request_get_angular_correction_status(request) - !! Request of `TMC_GetAngSwitch` procedure. Creates request for + !! Request of *TMC_GetAngSwitch* procedure. Creates request for !! getting the angular correction status. !! !! The instrument returns the following responses: @@ -1163,9 +1179,10 @@ pure subroutine dm_geocom_api_request_get_angular_correction_status(request) !! | ASCII request | `%R1Q,2014:` | !! | ASCII response | `%R1P,0,0:,,,,` | !! - integer, parameter :: REQCODE = 2014 - character(len=*), parameter :: PATTERN = & + character(len=*), parameter :: REQUEST_NAME = 'get_angular_correction_status' + character(len=*), parameter :: REQUEST_PATTERN = & '(?\d+),(?\d+),(?\d+),(?\d+),(?\d+)' + integer, parameter :: REQUEST_CODE = 2014 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(5) @@ -1178,11 +1195,11 @@ pure subroutine dm_geocom_api_request_get_angular_correction_status(request) response_type('tilcor', type=RESPONSE_TYPE_LOGICAL) & ! Tilting axis correction on/off [bool]. ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_angular_correction_status pure subroutine dm_geocom_api_request_get_atmospheric_correction(request) - !! Request of `TMC_GetAtmCorr` procedure. Creates request for getting + !! Request of *TMC_GetAtmCorr* procedure. Creates request for getting !! the atmospheric correction parameters. !! !! The instrument returns the following responses: @@ -1199,9 +1216,10 @@ pure subroutine dm_geocom_api_request_get_atmospheric_correction(request) !! | ASCII request | `%R1Q,2029:` | !! | ASCII response | `%R1P,0,0:,,,,` | !! - integer, parameter :: REQCODE = 2029 - character(len=*), parameter :: PATTERN = & + character(len=*), parameter :: REQUEST_NAME = 'get_atmospheric_correction' + character(len=*), parameter :: REQUEST_PATTERN = & '(?\d+),(?[-\d\.]+),(?[-\d\.]+),(?[-\d\.]+),(?[-\d\.]+)' + integer, parameter :: REQUEST_CODE = 2029 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(5) @@ -1214,11 +1232,11 @@ pure subroutine dm_geocom_api_request_get_atmospheric_correction(request) response_type('wettemp', unit='degC', type=RESPONSE_TYPE_REAL64) & ! Wet temperature [°C]. ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_atmospheric_correction pure subroutine dm_geocom_api_request_get_atmospheric_ppm(request) - !! Request of `TMC_GetAtmPpm` procedure. Creates request for getting + !! Request of *TMC_GetAtmPpm* procedure. Creates request for getting !! the atmospheric ppm correction factor. !! !! The instrument returns the following responses: @@ -1232,8 +1250,9 @@ pure subroutine dm_geocom_api_request_get_atmospheric_ppm(request) !! | ASCII request | `%R1Q,2151:` | !! | ASCII response | `%R1P,0,0:,` | !! - integer, parameter :: REQCODE = 2151 - character(len=*), parameter :: PATTERN = '(?\d+),(?[-\d\.]+)' + character(len=*), parameter :: REQUEST_NAME = 'get_atmospheric_ppm' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?[-\d\.]+)' + integer, parameter :: REQUEST_CODE = 2151 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(2) @@ -1243,11 +1262,11 @@ pure subroutine dm_geocom_api_request_get_atmospheric_ppm(request) response_type('atmppm', unit='ppm', type=RESPONSE_TYPE_REAL64) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_atmospheric_ppm pure subroutine dm_geocom_api_request_get_atr_error(request) - !! Request of `TMC_IfDataAzeCorrError` procedure. Creates request for + !! Request of *TMC_IfDataAzeCorrError* procedure. Creates request for !! getting the ATR error status. !! !! The instrument returns the following responses: @@ -1261,8 +1280,9 @@ pure subroutine dm_geocom_api_request_get_atr_error(request) !! | ASCII request | `%R1Q,2114:` | !! | ASCII response | `%R1P,0,0:,` | !! - integer, parameter :: REQCODE = 2114 - character(len=*), parameter :: PATTERN = '(?\d+),(?\d+)' + character(len=*), parameter :: REQUEST_NAME = 'get_atr_error' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?\d+)' + integer, parameter :: REQUEST_CODE = 2114 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(2) @@ -1272,11 +1292,11 @@ pure subroutine dm_geocom_api_request_get_atr_error(request) response_type('atrerr', type=RESPONSE_TYPE_LOGICAL) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_atr_error pure subroutine dm_geocom_api_request_get_atr_setting(request) - !! Request of `BAP_GetATRSetting` procedure. Creates request for + !! Request of *BAP_GetATRSetting* procedure. Creates request for !! getting the current ATR Low-Vis mode. !! !! The instrument returns the following responses: @@ -1290,8 +1310,9 @@ pure subroutine dm_geocom_api_request_get_atr_setting(request) !! | ASCII request | `%R1Q,17034:` | !! | ASCII response | `%R1P,0,0:,` | !! - integer, parameter :: REQCODE = 17034 - character(len=*), parameter :: PATTERN = '(?\d+),(?\d+)' + character(len=*), parameter :: REQUEST_NAME = 'get_atr_setting' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?\d+)' + integer, parameter :: REQUEST_CODE = 17034 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(2) @@ -1301,11 +1322,11 @@ pure subroutine dm_geocom_api_request_get_atr_setting(request) response_type('atrset', type=RESPONSE_TYPE_INT32) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_atr_setting pure subroutine dm_geocom_api_request_get_binary_mode(request) - !! Request of `COM_GetBinaryAvailable` procedure. Creates request for + !! Request of *COM_GetBinaryAvailable* procedure. Creates request for !! getting the binary attribute of the server. !! !! The instrument returns the following responses: @@ -1319,8 +1340,9 @@ pure subroutine dm_geocom_api_request_get_binary_mode(request) !! | ASCII request | `%R1Q,113:` | !! | ASCII response | `%R1P,0,0:,` | !! - integer, parameter :: REQCODE = 113 - character(len=*), parameter :: PATTERN = '(?\d+),(?\d+)' + character(len=*), parameter :: REQUEST_NAME = 'get_binary_mode' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?\d+)' + integer, parameter :: REQUEST_CODE = 113 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(2) @@ -1330,11 +1352,11 @@ pure subroutine dm_geocom_api_request_get_binary_mode(request) response_type('binmode', type=RESPONSE_TYPE_LOGICAL) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_binary_mode pure subroutine dm_geocom_api_request_get_config(request) - !! Request of `SUP_GetConfig` procedure. Creates request for getting + !! Request of *SUP_GetConfig* procedure. Creates request for getting !! the power management configuration status. The power timeout !! specifies the time after which the device switches into the mode !! indicated by `autopwr`. @@ -1351,8 +1373,9 @@ pure subroutine dm_geocom_api_request_get_config(request) !! | ASCII request | `%R1Q,14001:` | !! | ASCII response | `%R1P,0,0:,0,,` | !! - integer, parameter :: REQCODE = 14001 - character(len=*), parameter :: PATTERN = '(?\d+),\d+,(?\d+),(?\d+)' + character(len=*), parameter :: REQUEST_NAME = 'get_config' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),\d+,(?\d+),(?\d+)' + integer, parameter :: REQUEST_CODE = 14001 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(3) @@ -1363,15 +1386,15 @@ pure subroutine dm_geocom_api_request_get_config(request) response_type('pwrtime', unit='ms', type=RESPONSE_TYPE_INT32) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_config - pure subroutine dm_geocom_api_request_get_coordinate(request, inc_mode, wait_time) - !! Request of `TMC_GetCoordinate` procedure. Creates request for + pure subroutine dm_geocom_api_request_get_coordinate(request, wait_time, inc_mode) + !! Request of *TMC_GetCoordinate* procedure. Creates request for !! getting the coordinates of a measured point. !! !! This function conducts an angle and, in dependence of the selected - !! `mode`, an inclination measurement, and the calculates the + !! `inc_mode`, an inclination measurement, and the calculates the !! coordinates of the measured point with the last distance. !! !! The argument `wait_time` specifies the delay to wait for the @@ -1397,14 +1420,15 @@ pure subroutine dm_geocom_api_request_get_coordinate(request, inc_mode, wait_tim !! | ASCII request | `%R1Q,2082:,` | !! | ASCII response | `%R1P,0,0:,,,,,,,,` | !! - integer, parameter :: REQCODE = 2082 - character(len=*), parameter :: PATTERN = & + character(len=*), parameter :: REQUEST_NAME = 'get_coordinate' + character(len=*), parameter :: REQUEST_PATTERN = & '(?\d+),(?[-\d\.]+),(?[-\d\.]+),(?[-\d\.]+),(?\d+),' // & '(?[-\d\.]+),(?[-\d\.]+),(?[-\d\.]+),(?\d+)' + integer, parameter :: REQUEST_CODE = 2082 type(request_type), intent(out) :: request !! Prepared request. - integer, intent(in) :: inc_mode !! Inclination measurement mode (`TMC_INCLINE_PRG`). integer, intent(in) :: wait_time !! Delay to wait for the distance measurement to finish [ms]. + integer, intent(in) :: inc_mode !! Inclination measurement mode (`TMC_INCLINE_PRG`). character(len=80) :: args type(response_type) :: responses(9) @@ -1423,11 +1447,11 @@ pure subroutine dm_geocom_api_request_get_coordinate(request, inc_mode, wait_tim response_type('ctimec', unit='ms', type=RESPONSE_TYPE_INT64) & ! Timestamp of continuous measurement [m]. ] - call dm_geocom_api_request(request, REQCODE, args, PATTERN, responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, REQUEST_PATTERN, responses) end subroutine dm_geocom_api_request_get_coordinate pure subroutine dm_geocom_api_request_get_date_time(request) - !! Request of `CSV_GetDateTime` procedure. Creates request for getting + !! Request of *CSV_GetDateTime* procedure. Creates request for getting !! the current date and time of the instrument. A possible response may !! look like `%R1P,0,0:0,1996,'07','19','10','13','2f'`. !! @@ -1447,10 +1471,11 @@ pure subroutine dm_geocom_api_request_get_date_time(request) !! | ASCII request | `%R1Q,5008:` | !! | ASCII response | `%R1P,0,0:,,'','','','',''` | !! - integer, parameter :: REQCODE = 5008 - character(len=*), parameter :: PATTERN = & + character(len=*), parameter :: REQUEST_NAME = 'get_date_time' + character(len=*), parameter :: REQUEST_PATTERN = & "(?\d+),(?\d+),'(?[0-9a-f]+)','(?[0-9a-f]+)'," // & "'(?[0-9a-f]+)','(?[0-9a-f]+)','(?[0-9a-f]+)'" + integer, parameter :: REQUEST_CODE = 5008 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(7) @@ -1465,11 +1490,11 @@ pure subroutine dm_geocom_api_request_get_date_time(request) response_type('second', type=RESPONSE_TYPE_BYTE) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_date_time pure subroutine dm_geocom_api_request_get_date_time_centi(request) - !! Request of `CSV_GetDateTimeCentiSec` procedure. Creates request for + !! Request of *CSV_GetDateTimeCentiSec* procedure. Creates request for !! getting the current date and time of the instrument, including !! centiseconds. !! @@ -1490,10 +1515,11 @@ pure subroutine dm_geocom_api_request_get_date_time_centi(request) !! | ASCII request | `%R1Q,5117:` | !! | ASCII response | `%R1P,0,0:,,,,,,,` | !! - integer, parameter :: REQCODE = 5117 - character(len=*), parameter :: PATTERN = & + character(len=*), parameter :: REQUEST_NAME = 'get_date_time_centi' + character(len=*), parameter :: REQUEST_PATTERN = & '(?\d+),(?\d+),(?\d+),(?\d+),(?\d+),' // & '(?\d+),(?\d+),(?\d+)' + integer, parameter :: REQUEST_CODE = 5117 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(8) @@ -1509,11 +1535,11 @@ pure subroutine dm_geocom_api_request_get_date_time_centi(request) response_type('csecond', type=RESPONSE_TYPE_INT32) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_date_time_centi pure subroutine dm_geocom_api_request_get_device_config(request) - !! Request of `CSV_GetDeviceConfig` procedure. Creates request for + !! Request of *CSV_GetDeviceConfig* procedure. Creates request for !! getting the instrument configuration. !! !! The instrument returns the following responses: @@ -1528,8 +1554,9 @@ pure subroutine dm_geocom_api_request_get_device_config(request) !! | ASCII request | `%R1Q,5035:` | !! | ASCII response | `%R1P,0,0:,,` | !! - integer, parameter :: REQCODE = 5035 - character(len=*), parameter :: PATTERN = '(?\d+),(?\d+),(?\d+)' + character(len=*), parameter :: REQUEST_NAME = 'get_device_config' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?\d+),(?\d+)' + integer, parameter :: REQUEST_CODE = 5035 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(3) @@ -1540,11 +1567,11 @@ pure subroutine dm_geocom_api_request_get_device_config(request) response_type('devtype', type=RESPONSE_TYPE_INT32) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_device_config pure subroutine dm_geocom_api_request_get_double_precision(request) - !! Request of `COM_GetDoublePrecision` procedure. Creates request for + !! Request of *COM_GetDoublePrecision* procedure. Creates request for !! getting the double precision setting – the number of digits to the !! right of the decimal point – when double floating-point values are !! transmitted. @@ -1560,8 +1587,9 @@ pure subroutine dm_geocom_api_request_get_double_precision(request) !! | ASCII request | `%R1Q,108:` | !! | ASCII response | `%R1P,0,0:,` | !! - integer, parameter :: REQCODE = 108 - character(len=*), parameter :: PATTERN = '(?\d+),(?\d+)' + character(len=*), parameter :: REQUEST_NAME = 'get_double_precision' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?\d+)' + integer, parameter :: REQUEST_CODE = 108 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(2) @@ -1571,11 +1599,11 @@ pure subroutine dm_geocom_api_request_get_double_precision(request) response_type('ndigits', type=RESPONSE_TYPE_INT32) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_double_precision pure subroutine dm_geocom_api_request_get_edm_mode(request) - !! Request of `TMC_GetEdmMode` procedure. Creates request for getting + !! Request of *TMC_GetEdmMode* procedure. Creates request for getting !! the EDM measurement mode. !! !! The instrument returns the following responses: @@ -1589,8 +1617,9 @@ pure subroutine dm_geocom_api_request_get_edm_mode(request) !! | ASCII request | `%R1Q,2021:` | !! | ASCII response | `%R1P,0,0:,` | !! - integer, parameter :: REQCODE = 2021 - character(len=*), parameter :: PATTERN = '(?\d+),(?\d+)' + character(len=*), parameter :: REQUEST_NAME = 'get_edm_mode' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?\d+)' + integer, parameter :: REQUEST_CODE = 2021 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(2) @@ -1600,11 +1629,11 @@ pure subroutine dm_geocom_api_request_get_edm_mode(request) response_type('edmmode', type=RESPONSE_TYPE_INT32) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_edm_mode pure subroutine dm_geocom_api_request_get_egl_intensity(request) - !! Request of `EDM_GetEglIntensity` procedure. Creates request for + !! Request of *EDM_GetEglIntensity* procedure. Creates request for !! getting the value of the intensity of the electronic guide light !! (EGL). !! @@ -1619,8 +1648,9 @@ pure subroutine dm_geocom_api_request_get_egl_intensity(request) !! | ASCII request | `%R1Q,1058:` | !! | ASCII response | `%R1P,0,0:,` | !! - integer, parameter :: REQCODE = 1058 - character(len=*), parameter :: PATTERN = '(?\d+),(?\d+)' + character(len=*), parameter :: REQUEST_NAME = 'get_egl_intensity' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?\d+)' + integer, parameter :: REQUEST_CODE = 1058 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(2) @@ -1630,11 +1660,11 @@ pure subroutine dm_geocom_api_request_get_egl_intensity(request) response_type('eglint', type=RESPONSE_TYPE_INT32) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_egl_intensity pure subroutine dm_geocom_api_request_get_face(request) - !! Request of `TMC_GetFace` procedure. Creates request for getting the + !! Request of *TMC_GetFace* procedure. Creates request for getting the !! face of the current telescope position. !! !! The instrument returns the following responses: @@ -1648,8 +1678,9 @@ pure subroutine dm_geocom_api_request_get_face(request) !! | ASCII request | `%R1Q,2026:` | !! | ASCII response | `%R1P,0,0:,` | !! - integer, parameter :: REQCODE = 2026 - character(len=*), parameter :: PATTERN = '(?\d+),(?\d+)' + character(len=*), parameter :: REQUEST_NAME = 'get_face' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?\d+)' + integer, parameter :: REQUEST_CODE = 2026 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(2) @@ -1659,11 +1690,11 @@ pure subroutine dm_geocom_api_request_get_face(request) response_type('face', type=RESPONSE_TYPE_INT32) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_face pure subroutine dm_geocom_api_request_get_fine_adjust_mode(request) - !! Request of `AUT_GetFineAdjustMode` procedure. Creates request for + !! Request of *AUT_GetFineAdjustMode* procedure. Creates request for !! getting the fine adjustment positioning mode. !! !! The instrument returns the following responses: @@ -1677,8 +1708,9 @@ pure subroutine dm_geocom_api_request_get_fine_adjust_mode(request) !! | ASCII request | `%R1Q,9030:` | !! | ASCII response | `%R1P,0,0:,` | !! - integer, parameter :: REQCODE = 9030 - character(len=*), parameter :: PATTERN = '(?\d+),(?\d+)' + character(len=*), parameter :: REQUEST_NAME = 'get_fine_adjust_mode' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?\d+)' + integer, parameter :: REQUEST_CODE = 9030 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(2) @@ -1688,11 +1720,11 @@ pure subroutine dm_geocom_api_request_get_fine_adjust_mode(request) response_type('adjmode', type=RESPONSE_TYPE_INT32) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_fine_adjust_mode - pure subroutine dm_geocom_api_request_get_full_measurement(request, inc_mode, wait_time) - !! Request of `TMC_GetFullMeas` procedure. Creates request to query + pure subroutine dm_geocom_api_request_get_full_measurement(request, wait_time, inc_mode) + !! Request of *TMC_GetFullMeas* procedure. Creates request to query !! angle, inclination, and distance measurement values. !! !! The GeoCOM function returns angle, inclination, and distance @@ -1722,14 +1754,15 @@ pure subroutine dm_geocom_api_request_get_full_measurement(request, inc_mode, wa !! | ASCII request | `%R1Q,2167:,` | !! | ASCII response | `%R1P,0,0:,,,,,,,,` | !! - integer, parameter :: REQCODE = 2167 - character(len=*), parameter :: PATTERN = & + character(len=*), parameter :: REQUEST_NAME = 'get_full_measurement' + character(len=*), parameter :: REQUEST_PATTERN = & '(?\d+),(?[-\d\.]+),(?[-\d\.]+),(?[-\d\.]+),(?[-\d\.]+),' // & '(?[-\d\.]+),(?[-\d\.]+),(?[-\d\.]+),(?[-\d\.]+)' + integer, parameter :: REQUEST_CODE = 2167 type(request_type), intent(out) :: request !! Prepared request. - integer, intent(in) :: inc_mode !! Inclination measurement mode (`TMC_INCLINE_PRG`). integer, intent(in) :: wait_time !! Delay to wait for the distance measurement to finish [ms]. + integer, intent(in) :: inc_mode !! Inclination measurement mode (`TMC_INCLINE_PRG`). character(len=80) :: args type(response_type) :: responses(9) @@ -1748,11 +1781,11 @@ pure subroutine dm_geocom_api_request_get_full_measurement(request, inc_mode, wa response_type('disttime', unit='ms', type=RESPONSE_TYPE_REAL64) & ! Time of distance measurement [ms]. ] - call dm_geocom_api_request(request, REQCODE, args, PATTERN, responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, REQUEST_PATTERN, responses) end subroutine dm_geocom_api_request_get_full_measurement pure subroutine dm_geocom_api_request_get_geocom_version(request) - !! Request of `COM_GetSWVersion` procedure. Creates request for getting + !! Request of *COM_GetSWVersion* procedure. Creates request for getting !! the GeoCOM server software version. !! !! The instrument returns the following responses: @@ -1768,8 +1801,9 @@ pure subroutine dm_geocom_api_request_get_geocom_version(request) !! | ASCII request | `%R1Q,110:` | !! | ASCII response | `%R1P,0,0:,,,` | !! - integer, parameter :: REQCODE = 110 - character(len=*), parameter :: PATTERN = '(?\d+),(?\d+),(?\d+),(?\d+)' + character(len=*), parameter :: REQUEST_NAME = 'get_geocom_version' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?\d+),(?\d+),(?\d+)' + integer, parameter :: REQUEST_CODE = 110 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(4) @@ -1781,11 +1815,11 @@ pure subroutine dm_geocom_api_request_get_geocom_version(request) response_type('gcsub', type=RESPONSE_TYPE_INT32) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_geocom_version pure subroutine dm_geocom_api_request_get_geometric_ppm(request) - !! Request of `TMC_GeoPpm` procedure. Creates request for getting the + !! Request of *TMC_GeoPpm* procedure. Creates request for getting the !! geometric ppm correction factor. !! !! The instrument returns the following responses: @@ -1803,10 +1837,11 @@ pure subroutine dm_geocom_api_request_get_geometric_ppm(request) !! | ASCII request | `%R1Q,2154:` | !! | ASCII response | `%R1P,0,0:,,,,,` | !! - integer, parameter :: REQCODE = 2154 - character(len=*), parameter :: PATTERN = & + character(len=*), parameter :: REQUEST_NAME = 'get_geometric_ppm' + character(len=*), parameter :: REQUEST_PATTERN = & '(?\d+),(?\d+),(?[-\d\.]+),(?[-\d\.]+),' // & '(?[-\d\.]+),(?[-\d\.]+)' + integer, parameter :: REQUEST_CODE = 2154 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(6) @@ -1820,11 +1855,11 @@ pure subroutine dm_geocom_api_request_get_geometric_ppm(request) response_type('indippm', unit='ppm', type=RESPONSE_TYPE_REAL64) & ! Individual ppm value [ppm]. ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_geometric_ppm pure subroutine dm_geocom_api_request_get_height(request) - !! Request of `TMC_GetHeight` procedure. Creates request for getting + !! Request of *TMC_GetHeight* procedure. Creates request for getting !! the current reflector height. !! !! The instrument returns the following responses: @@ -1838,8 +1873,9 @@ pure subroutine dm_geocom_api_request_get_height(request) !! | ASCII request | `%R1Q,2011:` | !! | ASCII response | `%R1P,0,0:,` | !! - integer, parameter :: REQCODE = 2011 - character(len=*), parameter :: PATTERN = '(?\d+),(?[-\d\.]+)' + character(len=*), parameter :: REQUEST_NAME = 'get_height' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?[-\d\.]+)' + integer, parameter :: REQUEST_CODE = 2011 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(2) @@ -1849,11 +1885,11 @@ pure subroutine dm_geocom_api_request_get_height(request) response_type('rheight', unit='m', type=RESPONSE_TYPE_REAL64) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_height pure subroutine dm_geocom_api_request_get_image_config(request, mem_type) - !! Request of `IMG_GetTccConfig` procedure. Creates request to read + !! Request of *IMG_GetTccConfig* procedure. Creates request to read !! the current image configuration. The response `subfunc` is a binary !! combination of the following settings: !! @@ -1876,9 +1912,10 @@ pure subroutine dm_geocom_api_request_get_image_config(request, mem_type) !! | ASCII request | `%R1Q,23400:` | !! | ASCII response | `%R1P,0,0:,,,,` | !! - integer, parameter :: REQCODE = 23400 - character(len=*), parameter :: PATTERN = & + character(len=*), parameter :: REQUEST_NAME = 'get_image_config' + character(len=*), parameter :: REQUEST_PATTERN = & '(?\d+),(?\d+),(?\d+),(?\d+),(?.+)' + integer, parameter :: REQUEST_CODE = 23400 type(request_type), intent(out) :: request !! Prepared request. integer, intent(in) :: mem_type !! Memory device type (`IMG_MEM_TYPE`). @@ -1896,11 +1933,11 @@ pure subroutine dm_geocom_api_request_get_image_config(request, mem_type) response_type('fnprefix', type=RESPONSE_TYPE_STRING) & ] - call dm_geocom_api_request(request, REQCODE, args, PATTERN, responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, REQUEST_PATTERN, responses) end subroutine dm_geocom_api_request_get_image_config pure subroutine dm_geocom_api_request_get_inclination_correction(request) - !! Request of `TMC_GetInclineSwitch` procedure. Creates request for + !! Request of *TMC_GetInclineSwitch* procedure. Creates request for !! getting the dual-axis compensator status. !! !! The instrument returns the following responses: @@ -1914,8 +1951,9 @@ pure subroutine dm_geocom_api_request_get_inclination_correction(request) !! | ASCII request | `%R1Q,2007:` | !! | ASCII response | `%R1P,0,0:,` | !! - integer, parameter :: REQCODE = 2007 - character(len=*), parameter :: PATTERN = '(?\d+),(?\d+)' + character(len=*), parameter :: REQUEST_NAME = 'get_inclination_correction' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?\d+)' + integer, parameter :: REQUEST_CODE = 2007 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(2) @@ -1925,11 +1963,11 @@ pure subroutine dm_geocom_api_request_get_inclination_correction(request) response_type('inccor',type=RESPONSE_TYPE_LOGICAL) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_inclination_correction pure subroutine dm_geocom_api_request_get_inclination_error(request) - !! Request of `TMC_IfDataIncCorrError` procedure. Creates request for + !! Request of *TMC_IfDataIncCorrError* procedure. Creates request for !! getting the inclination error status. !! !! The instrument returns the following responses: @@ -1943,8 +1981,9 @@ pure subroutine dm_geocom_api_request_get_inclination_error(request) !! | ASCII request | `%R1Q,2115:` | !! | ASCII response | `%R1P,0,0:,` | !! - integer, parameter :: REQCODE = 2115 - character(len=*), parameter :: PATTERN = '(?\d+),(?\d+)' + character(len=*), parameter :: REQUEST_NAME = 'get_inclination_error' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?\d+)' + integer, parameter :: REQUEST_CODE = 2115 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(2) @@ -1954,11 +1993,11 @@ pure subroutine dm_geocom_api_request_get_inclination_error(request) response_type('incerr', type=RESPONSE_TYPE_LOGICAL) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_inclination_error pure subroutine dm_geocom_api_request_get_instrument_name(request) - !! Request of `CSV_GetInstrumentName` procedure. Creates request for + !! Request of *CSV_GetInstrumentName* procedure. Creates request for !! getting the Leica-specific instrument name. !! !! The instrument returns the following responses: @@ -1972,8 +2011,9 @@ pure subroutine dm_geocom_api_request_get_instrument_name(request) !! | ASCII request | `%R1Q,5004:` | !! | ASCII response | `%R1P,0,0:,` | !! - integer, parameter :: REQCODE = 5004 - character(len=*), parameter :: PATTERN = '(?\d+),(?.+)' + character(len=*), parameter :: REQUEST_NAME = 'get_instrument_name' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?.+)' + integer, parameter :: REQUEST_CODE = 5004 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(2) @@ -1983,11 +2023,11 @@ pure subroutine dm_geocom_api_request_get_instrument_name(request) response_type('name', type=RESPONSE_TYPE_STRING) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_instrument_name pure subroutine dm_geocom_api_request_get_instrument_number(request) - !! Request of `CSV_GetInstrumentNo` procedure. Creates request for + !! Request of *CSV_GetInstrumentNo* procedure. Creates request for !! getting the factory defined instrument number. !! !! The instrument returns the following responses: @@ -2001,8 +2041,9 @@ pure subroutine dm_geocom_api_request_get_instrument_number(request) !! | ASCII request | `%R1Q,5003:` | !! | ASCII response | `%R1P,0,0:,` | !! - integer, parameter :: REQCODE = 5003 - character(len=*), parameter :: PATTERN = '(?\d+),(?\d+)' + character(len=*), parameter :: REQUEST_NAME = 'get_instrument_number' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?\d+)' + integer, parameter :: REQUEST_CODE = 5003 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(2) @@ -2012,11 +2053,11 @@ pure subroutine dm_geocom_api_request_get_instrument_number(request) response_type('serialno', type=RESPONSE_TYPE_INT32) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_instrument_number pure subroutine dm_geocom_api_request_get_internal_temperature(request) - !! Request of `CSV_GetIntTemp` procedure. Creates request for getting + !! Request of *CSV_GetIntTemp* procedure. Creates request for getting !! the internal temperature of the instrument, measured on the !! mainboard side. !! @@ -2031,8 +2072,9 @@ pure subroutine dm_geocom_api_request_get_internal_temperature(request) !! | ASCII request | `%R1Q,5011:` | !! | ASCII response | `%R1P,0,0:,` | !! - integer, parameter :: REQCODE = 5011 - character(len=*), parameter :: PATTERN = '(?\d+),(?\d+)' + character(len=*), parameter :: REQUEST_NAME = 'get_internal_temperature' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?\d+)' + integer, parameter :: REQUEST_CODE = 5011 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(2) @@ -2042,11 +2084,11 @@ pure subroutine dm_geocom_api_request_get_internal_temperature(request) response_type('temp', type=RESPONSE_TYPE_INT32) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_internal_temperature pure subroutine dm_geocom_api_request_get_lock_status(request) - !! Request of `MOT_ReadLockStatus` procedure. Creates request for + !! Request of *MOT_ReadLockStatus* procedure. Creates request for !! returning the condition of the Lock-In control. !! !! The instrument returns the following responses: @@ -2060,8 +2102,9 @@ pure subroutine dm_geocom_api_request_get_lock_status(request) !! | ASCII request | `%R1Q,6021:` | !! | ASCII response | `%R1P,0,0:,` | !! - integer, parameter :: REQCODE = 6021 - character(len=*), parameter :: PATTERN = '(?\d+),(?\d+)' + character(len=*), parameter :: REQUEST_NAME = 'get_lock_status' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?\d+)' + integer, parameter :: REQUEST_CODE = 6021 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(2) @@ -2071,11 +2114,11 @@ pure subroutine dm_geocom_api_request_get_lock_status(request) response_type('lockstat', type=RESPONSE_TYPE_INT32) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_lock_status pure subroutine dm_geocom_api_request_get_measurement_program(request) - !! Request of `BAP_GetMeasPrg` procedure. Creates request for getting + !! Request of *BAP_GetMeasPrg* procedure. Creates request for getting !! the distance measurement program of the instrument. !! !! The instrument returns the following responses: @@ -2089,8 +2132,9 @@ pure subroutine dm_geocom_api_request_get_measurement_program(request) !! | ASCII request | `%R1Q,17018:` | !! | ASCII response | `%R1P,0,0:,` | !! - integer, parameter :: REQCODE = 17018 - character(len=*), parameter :: PATTERN = '(?\d+),(?\d+)' + character(len=*), parameter :: REQUEST_NAME = 'get_measurement_program' + integer, parameter :: REQUEST_CODE = 17018 + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?\d+)' type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(2) @@ -2100,11 +2144,11 @@ pure subroutine dm_geocom_api_request_get_measurement_program(request) response_type('measprg', type=RESPONSE_TYPE_INT32) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_measurement_program pure subroutine dm_geocom_api_request_get_power(request) - !! Request of `CSV_CheckPower` procedure. Creates request for checking + !! Request of *CSV_CheckPower* procedure. Creates request for checking !! the available power. !! !! The instrument returns the following responses: @@ -2120,8 +2164,9 @@ pure subroutine dm_geocom_api_request_get_power(request) !! | ASCII request | `%R1Q,5039:` | !! | ASCII response | `%R1P,0,0:,,, ` | !! - integer, parameter :: REQCODE = 5039 - character(len=*), parameter :: PATTERN = '(?\d+),(?\d+),(?\d+),(?\d+)' + character(len=*), parameter :: REQUEST_NAME = 'get_power' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?\d+),(?\d+),(?\d+)' + integer, parameter :: REQUEST_CODE = 5039 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(4) @@ -2133,11 +2178,11 @@ pure subroutine dm_geocom_api_request_get_power(request) response_type('pwrsug', unit=' ', type=RESPONSE_TYPE_INT32) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_power pure subroutine dm_geocom_api_request_get_prism_constant(request) - !! Request of `TMC_GetPrismCorr` procedure. Creates request for + !! Request of *TMC_GetPrismCorr* procedure. Creates request for !! getting the prism constant. !! !! The instrument returns the following responses: @@ -2151,8 +2196,9 @@ pure subroutine dm_geocom_api_request_get_prism_constant(request) !! | ASCII request | `%R1Q,2023:` | !! | ASCII response | `%R1P,0,0:,` | !! - integer, parameter :: REQCODE = 2023 - character(len=*), parameter :: PATTERN = '(?\d+),(?[-\d\.]+)' + character(len=*), parameter :: REQUEST_NAME = 'get_prism_constant' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?[-\d\.]+)' + integer, parameter :: REQUEST_CODE = 2023 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(2) @@ -2162,11 +2208,11 @@ pure subroutine dm_geocom_api_request_get_prism_constant(request) response_type('reflcor', unit='m', type=RESPONSE_TYPE_REAL64) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_prism_constant pure subroutine dm_geocom_api_request_get_prism_definition(request, prism_type) - !! Request of `BAP_GetPrismDef` procedure. Creates request for getting + !! Request of *BAP_GetPrismDef* procedure. Creates request for getting !! the default prism definition. !! !! The instrument returns the following responses: @@ -2182,8 +2228,10 @@ pure subroutine dm_geocom_api_request_get_prism_definition(request, prism_type) !! | ASCII request | `%R1Q,17023:` | !! | ASCII response | `%R1P,0,0:,,,` | !! - integer, parameter :: REQCODE = 17023 - character(len=*), parameter :: PATTERN = '(?\d+),(?.+),(?[-\d\.]+),(?\d+)' + character(len=*), parameter :: REQUEST_NAME = 'get_prism_definition' + character(len=*), parameter :: REQUEST_PATTERN = & + '(?\d+),(?.+),(?[-\d\.]+),(?\d+)' + integer, parameter :: REQUEST_CODE = 17023 type(request_type), intent(out) :: request !! Prepared request. integer, intent(in) :: prism_type !! Prism type (`BAP_PRISMTYPE`). @@ -2200,11 +2248,11 @@ pure subroutine dm_geocom_api_request_get_prism_definition(request, prism_type) response_type('refltype', unit=' ', type=RESPONSE_TYPE_INT32) & ] - call dm_geocom_api_request(request, REQCODE, args, PATTERN, responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, REQUEST_PATTERN, responses) end subroutine dm_geocom_api_request_get_prism_definition pure subroutine dm_geocom_api_request_get_prism_type(request) - !! Request of `TMC_GetPrismType` procedure. Creates request for + !! Request of *TMC_GetPrismType* procedure. Creates request for !! getting the default prism type. !! !! The instrument returns the following responses: @@ -2218,8 +2266,9 @@ pure subroutine dm_geocom_api_request_get_prism_type(request) !! | ASCII request | `%R1Q,17009:` | !! | ASCII response | `%R1P,0,0:,` | !! - integer, parameter :: REQCODE = 17009 - character(len=*), parameter :: PATTERN = '(?\d+),(?\d+)' + character(len=*), parameter :: REQUEST_NAME = 'get_prism_type' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?\d+)' + integer, parameter :: REQUEST_CODE = 17009 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(2) @@ -2229,11 +2278,11 @@ pure subroutine dm_geocom_api_request_get_prism_type(request) response_type('refltype', type=RESPONSE_TYPE_INT32) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_prism_type pure subroutine dm_geocom_api_request_get_prism_type_v2(request) - !! Request of `TMC_GetPrismType2` procedure. Creates request for + !! Request of *TMC_GetPrismType2* procedure. Creates request for !! getting the default or user prism type. !! !! The instrument returns the following responses: @@ -2247,8 +2296,9 @@ pure subroutine dm_geocom_api_request_get_prism_type_v2(request) !! | ASCII request | `%R1Q,17031:` | !! | ASCII response | `%R1P,0,0:,` | !! - integer, parameter :: REQCODE = 17031 - character(len=*), parameter :: PATTERN = '(?\d+),(?\d+)' + character(len=*), parameter :: REQUEST_NAME = 'get_prism_type_v2' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?\d+)' + integer, parameter :: REQUEST_CODE = 17031 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(2) @@ -2258,18 +2308,18 @@ pure subroutine dm_geocom_api_request_get_prism_type_v2(request) response_type('refltype', type=RESPONSE_TYPE_INT32) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_prism_type_v2 pure subroutine dm_geocom_api_request_get_quick_distance(request) - !! Request of `TMC_QuickDist` procedure. Creates request for returning + !! Request of *TMC_QuickDist* procedure. Creates request for returning !! the slope distance and both angles. !! !! The function starts an EDM tracking measurement, and waits until a !! distance has been measured. Then, it returns the angles and the !! slope distance, but no coordinates. If no distance could be !! measured, only angles and an error code are returned. A measurement - !! may be aborted by calling `TMC_DoMeasure`. + !! may be aborted by calling *TMC_DoMeasure*. !! !! The instrument returns the following responses: !! @@ -2284,8 +2334,10 @@ pure subroutine dm_geocom_api_request_get_quick_distance(request) !! | ASCII request | `%R1Q,2117:` | !! | ASCII response | `%R1P,0,0:,,,` | !! - integer, parameter :: REQCODE = 2117 - character(len=*), parameter :: PATTERN = '(?\d+),(?[-\d\.]+),(?[-\d\.]+),(?[-\d\.]+)' + character(len=*), parameter :: REQUEST_NAME = 'get_quick_distance' + character(len=*), parameter :: REQUEST_PATTERN = & + '(?\d+),(?[-\d\.]+),(?[-\d\.]+),(?[-\d\.]+)' + integer, parameter :: REQUEST_CODE = 2117 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(4) @@ -2297,11 +2349,11 @@ pure subroutine dm_geocom_api_request_get_quick_distance(request) response_type('sdist', unit='m', type=RESPONSE_TYPE_REAL64) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_quick_distance pure subroutine dm_geocom_api_request_get_reduced_atr_fov(request) - !! Request of `BAP_GetRedATRFov` procedure. Creates request for + !! Request of *BAP_GetRedATRFov* procedure. Creates request for !! getting the reduced ATR field of view. !! !! The instrument returns the following responses: @@ -2315,8 +2367,9 @@ pure subroutine dm_geocom_api_request_get_reduced_atr_fov(request) !! | ASCII request | `%R1Q,17036:` | !! | ASCII response | `%R1P,0,0:,` | !! - integer, parameter :: REQCODE = 17036 - character(len=*), parameter :: PATTERN = '(?\d+),(?\d+)' + character(len=*), parameter :: REQUEST_NAME = 'get_reduced_atr_fov' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?\d+)' + integer, parameter :: REQUEST_CODE = 17036 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(2) @@ -2326,11 +2379,11 @@ pure subroutine dm_geocom_api_request_get_reduced_atr_fov(request) response_type('atrfov', type=RESPONSE_TYPE_LOGICAL) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_reduced_atr_fov pure subroutine dm_geocom_api_request_get_reflectorless_class(request) - !! Request of `CSV_GetReflectorlessClass` procedure. Creates request + !! Request of *CSV_GetReflectorlessClass* procedure. Creates request !! for getting the RL type. !! !! The function returns the class of the reflectorless and long-range @@ -2347,8 +2400,9 @@ pure subroutine dm_geocom_api_request_get_reflectorless_class(request) !! | ASCII request | `%R1Q,5100:` | !! | ASCII response | `%R1P,0,0:,` | !! - integer, parameter :: REQCODE = 5100 - character(len=*), parameter :: PATTERN = '(?\d+),(?\d+)' + character(len=*), parameter :: REQUEST_NAME = 'get_reflectorless_class' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?\d+)' + integer, parameter :: REQUEST_CODE = 5100 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(2) @@ -2358,11 +2412,11 @@ pure subroutine dm_geocom_api_request_get_reflectorless_class(request) response_type('rlclass', type=RESPONSE_TYPE_INT32) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_reflectorless_class pure subroutine dm_geocom_api_request_get_refraction_mode(request) - !! Request of `TMC_GetRefractiveMethod` procedure. Creates request for + !! Request of *TMC_GetRefractiveMethod* procedure. Creates request for !! getting the refraction model. !! !! The function is used to get the current refraction model. Changing @@ -2379,8 +2433,9 @@ pure subroutine dm_geocom_api_request_get_refraction_mode(request) !! | ASCII request | `%R1Q,2091:` | !! | ASCII response | `%R1P,0,0:,` | !! - integer, parameter :: REQCODE = 2091 - character(len=*), parameter :: PATTERN = '(?\d+),(?\d+)' + character(len=*), parameter :: REQUEST_NAME = 'get_refraction_mode' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?\d+)' + integer, parameter :: REQUEST_CODE = 2091 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(2) @@ -2390,15 +2445,15 @@ pure subroutine dm_geocom_api_request_get_refraction_mode(request) response_type('refrmode', type=RESPONSE_TYPE_INT32) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_refraction_mode pure subroutine dm_geocom_api_request_get_search_area(request) - !! Request of `AUT_GetSearchArea` procedure. Creates request for - !! getting the dimensions of the Power Search window. + !! Request of *AUT_GetSearchArea* procedure. Creates request for + !! getting the dimensions of the PowerSearch window. !! !! This command is valid for all instruments, but has only effects for - !! instruments equipped with Power Search. + !! instruments equipped with PowerSearch. !! !! The instrument returns the following responses: !! @@ -2415,10 +2470,11 @@ pure subroutine dm_geocom_api_request_get_search_area(request) !! | ASCII request | `%R1Q,9042:` | !! | ASCII response | `%R1P,0,0:,,,,,` | !! - integer, parameter :: REQCODE = 9042 - character(len=*), parameter :: PATTERN = & + character(len=*), parameter :: REQUEST_NAME = 'get_search_area' + character(len=*), parameter :: REQUEST_PATTERN = & '(?\d+),(?[-\d\.]+),(?[-\d\.]+),(?[-\d\.]+),' // & '(?[-\d\.]+),(?\d+)' + integer, parameter :: REQUEST_CODE = 9042 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(6) @@ -2432,16 +2488,16 @@ pure subroutine dm_geocom_api_request_get_search_area(request) response_type('userarea', unit=' ', type=RESPONSE_TYPE_LOGICAL) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_search_area pure subroutine dm_geocom_api_request_get_signal(request) - !! Request of `TMC_GetSignal` procedure. Creates request for + !! Request of *TMC_GetSignal* procedure. Creates request for !! getting the EDM signal intensity. !! !! The function returns the intensity of the EDM signal. The function !! can only perform a measurement if the signal measurement program is - !! activated. Start the signal measurement program with `TMC_DoMeasure` in + !! activated. Start the signal measurement program with *TMC_DoMeasure* in !! program `TMC_SIGNAL`. After the measurement, the EDM must be !! switched off with program `TMC_CLEAR`. While measuring, there is no !! angle data available. @@ -2458,8 +2514,9 @@ pure subroutine dm_geocom_api_request_get_signal(request) !! | ASCII request | `%R1Q,2022:` | !! | ASCII response | `%R1P,0,0:,,` | !! - integer, parameter :: REQCODE = 2022 - character(len=*), parameter :: PATTERN = '(?\d+),(?[-\d\.]+),(?\d+)' + character(len=*), parameter :: REQUEST_NAME = 'get_signal' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?[-\d\.]+),(?\d+)' + integer, parameter :: REQUEST_CODE = 2022 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(3) @@ -2470,18 +2527,18 @@ pure subroutine dm_geocom_api_request_get_signal(request) response_type('sigtime', unit='ms', type=RESPONSE_TYPE_LOGICAL) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_signal - pure subroutine dm_geocom_api_request_get_simple_coordinates(request, inc_mode, wait_time) - !! Request of `TMC_GetSimpleCoord` procedure. Creates request for + pure subroutine dm_geocom_api_request_get_simple_coordinates(request, wait_time, inc_mode) + !! Request of *TMC_GetSimpleCoord* procedure. Creates request for !! returning cartesian coordinates. !! !! The API function returns the cartesian coordinates if a valid !! distance is set. The argument `wait_time` sets the maximum time to !! wait for a valid distance. Without a valid distance, the coordinates !! are set to 0.0, and an error is returned. The coordinate calculation - !! requires inclination results. The argument `mode` sets the + !! requires inclination results. The argument `inc_mode` sets the !! inclination measurement mode (`TMC_INCLINE_PRG`). !! !! The instrument returns the following responses: @@ -2497,13 +2554,14 @@ pure subroutine dm_geocom_api_request_get_simple_coordinates(request, inc_mode, !! | ASCII request | `%R1Q,2116:,` | !! | ASCII response | `%R1P,0,0:,,,` | !! - integer, parameter :: REQCODE = 2116 - character(len=*), parameter :: PATTERN = & + character(len=*), parameter :: REQUEST_NAME = 'get_simple_coordinates' + character(len=*), parameter :: REQUEST_PATTERN = & '(?\d+),(?[-\d\.]+),(?[-\d\.]+),(?[-\d\.]+)' + integer, parameter :: REQUEST_CODE = 2116 type(request_type), intent(out) :: request !! Prepared request. - integer, intent(in) :: inc_mode !! Inclination measurement mode (`TMC_INCLINE_PRG`). integer, intent(in) :: wait_time !! Delay to wait for the distance measurement to finish [ms]. + integer, intent(in) :: inc_mode !! Inclination measurement mode (`TMC_INCLINE_PRG`). character(len=80) :: args type(response_type) :: responses(4) @@ -2517,11 +2575,11 @@ pure subroutine dm_geocom_api_request_get_simple_coordinates(request, inc_mode, response_type('height', unit='m', type=RESPONSE_TYPE_REAL64) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_simple_coordinates - pure subroutine dm_geocom_api_request_get_simple_measurement(request, inc_mode, wait_time) - !! Request of `TMC_GetSimpleMea` procedure. Creates request for + pure subroutine dm_geocom_api_request_get_simple_measurement(request, wait_time, inc_mode) + !! Request of *TMC_GetSimpleMea* procedure. Creates request for !! returning the values of the angle and distance measurement. !! !! The API function returns the angles and distance measurement data. @@ -2541,12 +2599,13 @@ pure subroutine dm_geocom_api_request_get_simple_measurement(request, inc_mode, !! | ASCII request | `%R1Q,2108:,` | !! | ASCII response | `%R1P,0,0:,,,` | !! - integer, parameter :: REQCODE = 2108 - character(len=*), parameter :: PATTERN = '(?\d+),(?[-\d\.]+),(?[-\d\.]+),(?[-\d\.]+)' + character(len=*), parameter :: REQUEST_NAME = 'get_simple_measurement' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?[-\d\.]+),(?[-\d\.]+),(?[-\d\.]+)' + integer, parameter :: REQUEST_CODE = 2108 type(request_type), intent(out) :: request !! Prepared request. - integer, intent(in) :: inc_mode !! Inclination measurement mode (`TMC_INCLINE_PRG`). integer, intent(in) :: wait_time !! Delay to wait for the distance measurement to finish [ms]. + integer, intent(in) :: inc_mode !! Inclination measurement mode (`TMC_INCLINE_PRG`). character(len=80) :: args type(response_type) :: responses(4) @@ -2560,11 +2619,11 @@ pure subroutine dm_geocom_api_request_get_simple_measurement(request, inc_mode, response_type('sdist', unit='m', type=RESPONSE_TYPE_REAL64) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_simple_measurement pure subroutine dm_geocom_api_request_get_slope_distance_correction(request) - !! Request of `TMC_GetSlopeDistCorr` procedure. Creates request for + !! Request of *TMC_GetSlopeDistCorr* procedure. Creates request for !! getting the total ppm and prism correction. !! !! The function returns the total ppm value (atmospheric ppm + @@ -2580,10 +2639,11 @@ pure subroutine dm_geocom_api_request_get_slope_distance_correction(request) !! |----------------|--------------------------------------------------| !! | Instruments | TPS1100, TPS1200, TM30/TS30, TS16 | !! | ASCII request | `%R1Q,2126:` | - !! | ASCII response | `%R1P,0,0:,,` | + !! | ASCII response | `%R1P,0,0:,,` | !! - integer, parameter :: REQCODE = 2126 - character(len=*), parameter :: PATTERN = '(?\d+),(?[-\d\.]+),(?[-\d\.]+)' + character(len=*), parameter :: REQUEST_NAME = 'get_slope_distance_correction' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?[-\d\.]+),(?[-\d\.]+)' + integer, parameter :: REQUEST_CODE = 2126 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(3) @@ -2594,11 +2654,11 @@ pure subroutine dm_geocom_api_request_get_slope_distance_correction(request) response_type('reflcor', unit='m', type=RESPONSE_TYPE_REAL64) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_slope_distance_correction pure subroutine dm_geocom_api_request_get_software_version(request) - !! Request of `CSV_GetSWVersion` procedure. Creates request for getting + !! Request of *CSV_GetSWVersion* procedure. Creates request for getting !! the system software version of the instrument. !! !! The instrument returns the following responses: @@ -2614,8 +2674,9 @@ pure subroutine dm_geocom_api_request_get_software_version(request) !! | ASCII request | `%R1Q,5034:` | !! | ASCII response | `%R1P,0,0:,,,` | !! - integer, parameter :: REQCODE = 5034 - character(len=*), parameter :: PATTERN = '(?\d+),(?\d+),(?\d+),(?\d+)' + character(len=*), parameter :: REQUEST_NAME = 'get_software_version' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?\d+),(?\d+),(?\d+)' + integer, parameter :: REQUEST_CODE = 5034 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(4) @@ -2627,11 +2688,11 @@ pure subroutine dm_geocom_api_request_get_software_version(request) response_type('swsub', type=RESPONSE_TYPE_INT32) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_software_version pure subroutine dm_geocom_api_request_get_station(request) - !! Request of `TMC_GetStation` procedure. Creates request for getting + !! Request of *TMC_GetStation* procedure. Creates request for getting !! the station coordinates of the instrument. !! !! The instrument returns the following responses: @@ -2648,9 +2709,10 @@ pure subroutine dm_geocom_api_request_get_station(request) !! | ASCII request | `%R1Q,2009:` | !! | ASCII response | `%R1P,0,0:,,,` | !! - integer, parameter :: REQCODE = 2009 - character(len=*), parameter :: PATTERN = & + character(len=*), parameter :: REQUEST_NAME = 'get_station' + character(len=*), parameter :: REQUEST_PATTERN = & '(?\d+),(?[-\d\.]+),(?[-\d\.]+),(?[-\d\.]+),(?[-\d\.]+)' + integer, parameter :: REQUEST_CODE = 2009 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(5) @@ -2663,11 +2725,11 @@ pure subroutine dm_geocom_api_request_get_station(request) response_type('heighti', unit='m', type=RESPONSE_TYPE_REAL64) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_station pure subroutine dm_geocom_api_request_get_target_type(request) - !! Request of `BAP_GetTargetType` procedure. Creates request for + !! Request of *BAP_GetTargetType* procedure. Creates request for !! getting the EDM type. !! !! The function returns the current EDM type (`BAP_TARGET_TYPE`) for @@ -2684,8 +2746,9 @@ pure subroutine dm_geocom_api_request_get_target_type(request) !! | ASCII request | `%R1Q,17022:` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 17022 - character(len=*), parameter :: PATTERN = '(?\d+),(?\d+)' + character(len=*), parameter :: REQUEST_NAME = 'get_target_type' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?\d+)' + integer, parameter :: REQUEST_CODE = 17022 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(2) @@ -2695,11 +2758,11 @@ pure subroutine dm_geocom_api_request_get_target_type(request) response_type('tartype', type=RESPONSE_TYPE_INT32) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_target_type pure subroutine dm_geocom_api_request_get_timeout(request) - !! Request of `AUT_ReadTimeout` procedure. Creates request for getting + !! Request of *AUT_ReadTimeout* procedure. Creates request for getting !! the timeout for positioning. !! !! The function returns the maximum time to perform positioning. @@ -2716,8 +2779,9 @@ pure subroutine dm_geocom_api_request_get_timeout(request) !! | ASCII request | `%R1Q,9012:` | !! | ASCII response | `%R1P,0,0:,` | !! - integer, parameter :: REQCODE = 9012 - character(len=*), parameter :: PATTERN = '(?\d+),(?[-\d\.]+),(?[-\d\.]+)' + character(len=*), parameter :: REQUEST_NAME = 'get_timeout' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?[-\d\.]+),(?[-\d\.]+)' + integer, parameter :: REQUEST_CODE = 9012 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(3) @@ -2728,11 +2792,11 @@ pure subroutine dm_geocom_api_request_get_timeout(request) response_type('timev', unit='s', type=RESPONSE_TYPE_REAL64) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_timeout pure subroutine dm_geocom_api_request_get_tolerance(request) - !! Request of `AUT_ReadTol` procedure. Creates request for getting the + !! Request of *AUT_ReadTol* procedure. Creates request for getting the !! positioning tolerances. !! !! The function returns the positioning tolerances of the Hz and V @@ -2750,8 +2814,9 @@ pure subroutine dm_geocom_api_request_get_tolerance(request) !! | ASCII request | `%R1Q,9008:` | !! | ASCII response | `%R1P,0,0:,` | !! - integer, parameter :: REQCODE = 9008 - character(len=*), parameter :: PATTERN = '(?\d+),(?[-\d\.]+),(?[-\d\.]+)' + character(len=*), parameter :: REQUEST_NAME = 'get_tolerance' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?[-\d\.]+),(?[-\d\.]+)' + integer, parameter :: REQUEST_CODE = 9008 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(3) @@ -2762,11 +2827,11 @@ pure subroutine dm_geocom_api_request_get_tolerance(request) response_type('tolv', unit='rad', type=RESPONSE_TYPE_REAL64) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_tolerance pure subroutine dm_geocom_api_request_get_user_atr_mode(request) - !! Request of `AUS_GetUserAtrState` procedure. Creates request for + !! Request of *AUS_GetUserAtrState* procedure. Creates request for !! getting the status of the ATR mode. !! !! The instrument returns the following responses: @@ -2780,8 +2845,9 @@ pure subroutine dm_geocom_api_request_get_user_atr_mode(request) !! | ASCII request | `%R1Q,18006:` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 18006 - character(len=*), parameter :: PATTERN = '(?\d+),(?\d+)' + character(len=*), parameter :: REQUEST_NAME = 'get_user_atr_mode' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?\d+)' + integer, parameter :: REQUEST_CODE = 18006 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(2) @@ -2791,11 +2857,11 @@ pure subroutine dm_geocom_api_request_get_user_atr_mode(request) response_type('atr', type=RESPONSE_TYPE_LOGICAL) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_user_atr_mode pure subroutine dm_geocom_api_request_get_user_lock_mode(request) - !! Request of `AUS_GetUserLockState` procedure. Creates request for + !! Request of *AUS_GetUserLockState* procedure. Creates request for !! getting the status of the LOCK mode. !! !! The instrument returns the following responses: @@ -2809,8 +2875,9 @@ pure subroutine dm_geocom_api_request_get_user_lock_mode(request) !! | ASCII request | `%R1Q,18008:` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 18006 - character(len=*), parameter :: PATTERN = '(?\d+),(?\d+)' + character(len=*), parameter :: REQUEST_NAME = 'get_user_lock_mode' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?\d+)' + integer, parameter :: REQUEST_CODE = 18006 type(request_type), intent(out) :: request !! Prepared request. type(response_type) :: responses(2) @@ -2820,11 +2887,11 @@ pure subroutine dm_geocom_api_request_get_user_lock_mode(request) response_type('lock', type=RESPONSE_TYPE_LOGICAL) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_user_lock_mode pure subroutine dm_geocom_api_request_get_user_prism_definition(request, name) - !! Request of `BAP_GetUserPrismDef` procedure. Creates request for + !! Request of *BAP_GetUserPrismDef* procedure. Creates request for !! getting the user prism definition. !! !! The instrument returns the following responses: @@ -2840,8 +2907,9 @@ pure subroutine dm_geocom_api_request_get_user_prism_definition(request, name) !! | ASCII request | `%R1Q,17033:` | !! | ASCII response | `%R1P,0,0:,,,` | !! - integer, parameter :: REQCODE = 17033 - character(len=*), parameter :: PATTERN = '(?\d+),(?[-\d\.]+),(?\d+),(?.+)' + character(len=*), parameter :: REQUEST_NAME = 'get_user_prism_definition' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?[-\d\.]+),(?\d+),(?.+)' + integer, parameter :: REQUEST_CODE = 17033 type(request_type), intent(out) :: request !! Prepared request. character(len=*), intent(in) :: name !! Prism name. @@ -2855,11 +2923,11 @@ pure subroutine dm_geocom_api_request_get_user_prism_definition(request, name) response_type('refluser', unit=' ', type=RESPONSE_TYPE_STRING) & ] - call dm_geocom_api_request(request, REQCODE, name, PATTERN, responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, name, REQUEST_PATTERN, responses) end subroutine dm_geocom_api_request_get_user_prism_definition pure subroutine dm_geocom_api_request_get_user_spiral(request) - !! Request of `AUT_GetUserSpiral` procedure. Creates request for + !! Request of *AUT_GetUserSpiral* procedure. Creates request for !! getting the user-defined search spiral. !! !! The function returns the current dimensions of the searching spiral. @@ -2877,8 +2945,9 @@ pure subroutine dm_geocom_api_request_get_user_spiral(request) !! | ASCII request | `%R1Q,9040:` | !! | ASCII response | `%R1P,0,0:,,` | !! - integer, parameter :: REQCODE = 9040 - character(len=*), parameter :: PATTERN = '(?\d+),(?[-\d\.]+),(?[-\d\.]+)' + character(len=*), parameter :: REQUEST_NAME = 'get_user_spiral' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?[-\d\.]+),(?[-\d\.]+)' + integer, parameter :: REQUEST_CODE = 9040 type(request_type), intent(out) :: request !! Prepared request. @@ -2890,11 +2959,11 @@ pure subroutine dm_geocom_api_request_get_user_spiral(request) response_type('rangev', unit='rad', type=RESPONSE_TYPE_INT64) & ] - call dm_geocom_api_request(request, REQCODE, pattern=PATTERN, responses=responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=REQUEST_PATTERN, responses=responses) end subroutine dm_geocom_api_request_get_user_spiral pure subroutine dm_geocom_api_request_list(request, next) - !! Request of `FTR_List` procedure. Creates request for listing file + !! Request of *FTR_List* procedure. Creates request for listing file !! information. !! !! The instrument returns the following responses: @@ -2916,8 +2985,9 @@ pure subroutine dm_geocom_api_request_list(request, next) !! | ASCII request | `%R1Q,23307:` | !! | ASCII response | `%R1P,0,0:,,,,,,,,,,` | !! - integer, parameter :: REQCODE = 23307 - character(len=*), parameter :: PATTERN = & + character(len=*), parameter :: REQUEST_NAME = 'list' + integer, parameter :: REQUEST_CODE = 23307 + character(len=*), parameter :: REQUEST_PATTERN = & '(?\d+),(?\d+),(?.+),(?\d+),(?[0-9a-f]+),' // & '(?[0-9a-f]+),(?[0-9a-f]+),(?[0-9a-f]+),' // & '(?[0-9a-f]+),(?[0-9a-f]+),(?[0-9a-f]+)' @@ -2944,15 +3014,15 @@ pure subroutine dm_geocom_api_request_list(request, next) response_type('fyear', unit='utc', type=RESPONSE_TYPE_BYTE) & ] - call dm_geocom_api_request(request, REQCODE, args, PATTERN, responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, REQUEST_PATTERN, responses) end subroutine dm_geocom_api_request_list pure subroutine dm_geocom_api_request_lock_in(request) - !! Request of `AUT_LockIn` procedure. Creates request for starting the + !! Request of *AUT_LockIn* procedure. Creates request for starting the !! target tracking. !! !! The API function will start the target tracking if the LOCK mode is - !! activated (`AUS_SetUserLockState`). The `AUT_FineAdjust` call must + !! activated (`AUS_SetUserLockState`). The *AUT_FineAdjust* call must !! have finished successfully before executing this function. !! !! The instrument returns the following responses: @@ -2965,15 +3035,16 @@ pure subroutine dm_geocom_api_request_lock_in(request) !! | ASCII request | `%R1Q,9013:` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 9013 + character(len=*), parameter :: REQUEST_NAME = 'lock_in' + integer, parameter :: REQUEST_CODE = 9013 type(request_type), intent(out) :: request !! Prepared request. - call dm_geocom_api_request(request, REQCODE, pattern=GEOCOM_GRC_PATTERN, responses=GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=GEOCOM_PATTERN, responses=GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_lock_in pure subroutine dm_geocom_api_request_null(request) - !! Request of `COM_NullProc` procedure. Creates request for checking + !! Request of *COM_NullProc* procedure. Creates request for checking !! the communication. !! !! The instrument returns the following responses: @@ -2986,20 +3057,21 @@ pure subroutine dm_geocom_api_request_null(request) !! | ASCII request | `%R1Q,0:` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 0 + character(len=*), parameter :: REQUEST_NAME = 'null' + integer, parameter :: REQUEST_CODE = 0 type(request_type), intent(out) :: request !! Prepared request. - call dm_geocom_api_request(request, REQCODE, pattern=GEOCOM_GRC_PATTERN, responses=GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=GEOCOM_PATTERN, responses=GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_null pure subroutine dm_geocom_api_request_ps_enable_range(request, enabled) - !! Request of `AUT_PS_EnableRange` procedure. Creates request for + !! Request of *AUT_PS_EnableRange* procedure. Creates request for !! enabling the PowerSearch window and range. !! !! The function enabled or disables the predefined PowerSearch window !! including the PowerSearch range limits set by API call - !! `AUT_PS_SetRange` (requires GeoCOM robotic licence). If `enabled` is + !! *AUT_PS_SetRange* (requires GeoCOM robotic licence). If `enabled` is !! `.false.`, the default range is set to ≤ 400 m. !! !! The instrument returns the following responses: @@ -3012,7 +3084,8 @@ pure subroutine dm_geocom_api_request_ps_enable_range(request, enabled) !! | ASCII request | `%R1Q,9048:` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 9048 + character(len=*), parameter :: REQUEST_NAME = 'ps_enable_range' + integer, parameter :: REQUEST_CODE = 9048 type(request_type), intent(out) :: request !! Prepared request. logical, intent(in) :: enabled !! Enable PowerSearch. @@ -3020,17 +3093,17 @@ pure subroutine dm_geocom_api_request_ps_enable_range(request, enabled) character(len=80) :: args write (args, '(i1)') dm_btoi(enabled) - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_ps_enable_range pure subroutine dm_geocom_api_request_ps_search_next(request, direction, swing) - !! Request of `AUT_PS_SearchNext` procedure. Creates request for + !! Request of *AUT_PS_SearchNext* procedure. Creates request for !! searching for the next target !! !! The function executes the 360° default PowerSearch and searches for !! the next targets. A previously defined PowerSearch window - !! (`AUT_SetSearchArea`) is not taken into account. Use API call - !! `AUT_PS_SearchWindow` first. + !! (*AUT_SetSearchArea*) is not taken into account. Use API call + !! *AUT_PS_SearchWindow* first. !! !! The instrument returns the following responses: !! @@ -3042,7 +3115,8 @@ pure subroutine dm_geocom_api_request_ps_search_next(request, direction, swing) !! | ASCII request | `%R1Q,9051:,` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 9051 + character(len=*), parameter :: REQUEST_NAME = 'ps_search_next' + integer, parameter :: REQUEST_CODE = 9051 type(request_type), intent(out) :: request !! Prepared request. integer, intent(in) :: direction !! Searching direction (`1` for clockwise, `-1` for counter-clockwise). @@ -3051,15 +3125,15 @@ pure subroutine dm_geocom_api_request_ps_search_next(request, direction, swing) character(len=80) :: args write (args, '(i0, ",", i1)') direction, dm_btoi(swing) - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_ps_search_next pure subroutine dm_geocom_api_request_ps_search_window(request) - !! Request of `AUT_PS_SearchWindow` procedure. Creates request for + !! Request of *AUT_PS_SearchWindow* procedure. Creates request for !! starting PowerSearch. !! !! The function starts PowerSearch in the window defined by API calls - !! `AUT_SetSearchArea` and `AUT_PS_SetRange` (requires GeoCOM robotic + !! *AUT_SetSearchArea* and *AUT_PS_SetRange* (requires GeoCOM robotic !! licence). !! !! The instrument returns the following responses: @@ -3072,15 +3146,16 @@ pure subroutine dm_geocom_api_request_ps_search_window(request) !! | ASCII request | `%R1Q,9052:` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 9052 + character(len=*), parameter :: REQUEST_NAME = 'ps_search_window' + integer, parameter :: REQUEST_CODE = 9052 type(request_type), intent(out) :: request !! Prepared request. - call dm_geocom_api_request(request, REQCODE, pattern=GEOCOM_GRC_PATTERN, responses=GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=GEOCOM_PATTERN, responses=GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_ps_search_window pure subroutine dm_geocom_api_request_ps_set_range(request, min_dist, max_dist) - !! Request of `AUT_PS_SetRange` procedure. Creates request for setting + !! Request of *AUT_PS_SetRange* procedure. Creates request for setting !! the PowerSearch range. !! !! The instrument returns the following responses: @@ -3093,7 +3168,8 @@ pure subroutine dm_geocom_api_request_ps_set_range(request, min_dist, max_dist) !! | ASCII request | `%R1Q,9047:,` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 9047 + character(len=*), parameter :: REQUEST_NAME = 'ps_set_range' + integer, parameter :: REQUEST_CODE = 9047 type(request_type), intent(out) :: request !! Prepared request. integer, intent(in) :: min_dist !! Min. distance to prism (≥ 0) [m]. @@ -3102,11 +3178,11 @@ pure subroutine dm_geocom_api_request_ps_set_range(request, min_dist, max_dist) character(len=80) :: args write (args, '(i0, ",", i0)') min_dist, max_dist - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_ps_set_range pure subroutine dm_geocom_api_request_search(request, search_hz, search_v) - !! Request of `AUT_Search` procedure. Creates request for performing an + !! Request of *AUT_Search* procedure. Creates request for performing an !! automatic target search. !! !! The function performs an automatic target search within the given @@ -3115,9 +3191,9 @@ pure subroutine dm_geocom_api_request_search(request, search_hz, search_v) !! sensor. If no prism is found in the specified area, the instrument !! turns back into the initial position. For an exact positioning onto !! the prism centre, use the fine-adjust API call afterwards - !! (`AUT_FineAdjust`). + !! (*AUT_FineAdjust*). !! - !! If the search range of the API function `AUT_FineAdjust` is + !! If the search range of the API function *AUT_FineAdjust* is !! expanded, target search and fine positioning are done in one step. !! !! The instrument returns the following responses: @@ -3130,7 +3206,8 @@ pure subroutine dm_geocom_api_request_search(request, search_hz, search_v) !! | ASCII request | `%R1Q,9029:,,0` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 9029 + character(len=*), parameter :: REQUEST_NAME = 'search' + integer, parameter :: REQUEST_CODE = 9029 type(request_type), intent(out) :: request !! Prepared request. real(kind=r8), intent(in) :: search_hz !! Horizontal search region [rad]. @@ -3139,11 +3216,11 @@ pure subroutine dm_geocom_api_request_search(request, search_hz, search_v) character(len=80) :: args write (args, '(f0.12, ",", f0.12, ",0")') search_hz, search_v - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_search pure subroutine dm_geocom_api_request_search_target(request) - !! Request of `BAP_SearchTarget` procedure. Creates request for + !! Request of *BAP_SearchTarget* procedure. Creates request for !! searching a target. !! !! The function searches for a target in the ATR search window. @@ -3158,15 +3235,16 @@ pure subroutine dm_geocom_api_request_search_target(request) !! | ASCII request | `%R1Q,17020:0` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 17020 + character(len=*), parameter :: REQUEST_NAME = 'search_target' + integer, parameter :: REQUEST_CODE = 17020 type(request_type), intent(out) :: request !! Prepared request. - call dm_geocom_api_request(request, REQCODE, pattern=GEOCOM_GRC_PATTERN, responses=GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, pattern=GEOCOM_PATTERN, responses=GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_search_target pure subroutine dm_geocom_api_request_set_angle_correction(request, incline, stand_axis, collimation, tilt_axis) - !! Request of `TMC_SetAngSwitch` procedure. Creates request for + !! Request of *TMC_SetAngSwitch* procedure. Creates request for !! turning angle corrections on or off. !! !! The instrument returns the following responses: @@ -3179,7 +3257,8 @@ pure subroutine dm_geocom_api_request_set_angle_correction(request, incline, sta !! | ASCII request | `%R1Q,2016:,,,` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 2016 + character(len=*), parameter :: REQUEST_NAME = 'set_angle_correction' + integer, parameter :: REQUEST_CODE = 2016 type(request_type), intent(out) :: request !! Prepared request. logical, intent(in) :: incline !! Enable inclination correction. @@ -3190,14 +3269,14 @@ pure subroutine dm_geocom_api_request_set_angle_correction(request, incline, sta character(len=80) :: args write (args, '(3(i1, ","), i1)') dm_btoi(incline), dm_btoi(stand_axis), dm_btoi(collimation), dm_btoi(tilt_axis) - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_set_angle_correction pure subroutine dm_geocom_api_request_set_atmospheric_correction(request, lambda, pressure, dry_temp, wet_temp) - !! Request of `BAP_SetAtmCorr` procedure. Creates request for setting + !! Request of *BAP_SetAtmCorr* procedure. Creates request for setting !! the atmospheric correction parameters. !! - !! The argument `lambda` should be queried with API call `TMC_GetAtmCorr`. + !! The argument `lambda` should be queried with API call *TMC_GetAtmCorr*. !! !! The instrument returns the following responses: !! @@ -3209,7 +3288,8 @@ pure subroutine dm_geocom_api_request_set_atmospheric_correction(request, lambda !! | ASCII request | `%R1Q,2028:,,,` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 2028 + character(len=*), parameter :: REQUEST_NAME = 'set_atmospheric_correction' + integer, parameter :: REQUEST_CODE = 2028 type(request_type), intent(out) :: request !! Prepared request. real(kind=r8), intent(in) :: lambda !! Wave-length of EDM transmitter [m]. @@ -3220,11 +3300,11 @@ pure subroutine dm_geocom_api_request_set_atmospheric_correction(request, lambda character(len=80) :: args write (args, '(4(f0.12, ","), f0.12)') lambda, pressure, dry_temp, wet_temp - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_set_atmospheric_correction pure subroutine dm_geocom_api_request_set_atmospheric_ppm(request, atm_ppm) - !! Request of `BAP_SetAtmPpm` procedure. Creates request for setting + !! Request of *BAP_SetAtmPpm* procedure. Creates request for setting !! the atmospheric ppm correction factor. !! !! The instrument returns the following responses: @@ -3237,7 +3317,8 @@ pure subroutine dm_geocom_api_request_set_atmospheric_ppm(request, atm_ppm) !! | ASCII request | `%R1Q,2148:` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 2148 + character(len=*), parameter :: REQUEST_NAME = 'set_atmospheric_ppm' + integer, parameter :: REQUEST_CODE = 2148 type(request_type), intent(out) :: request !! Prepared request. real(kind=r8), intent(in) :: atm_ppm !! Atmospheric ppm correction factor [ppm]. @@ -3245,11 +3326,11 @@ pure subroutine dm_geocom_api_request_set_atmospheric_ppm(request, atm_ppm) character(len=80) :: args write (args, '(f0.12)') atm_ppm - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_set_atmospheric_ppm pure subroutine dm_geocom_api_request_set_atr_mode(request, atr_mode) - !! Request of `BAP_SetATRSetting` procedure. Creates request for + !! Request of *BAP_SetATRSetting* procedure. Creates request for !! setting the ATR low-vis mode. !! !! The argument `atr_mode` (`BAP_ATRSETTING`) must be one of the @@ -3271,7 +3352,8 @@ pure subroutine dm_geocom_api_request_set_atr_mode(request, atr_mode) !! | ASCII request | `%R1Q,17035:` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 17035 + character(len=*), parameter :: REQUEST_NAME = 'set_atr_mode' + integer, parameter :: REQUEST_CODE = 17035 type(request_type), intent(out) :: request !! Prepared request. integer, intent(in) :: atr_mode !! ATR low-vis mode (`BAP_ATRSETTING`). @@ -3279,14 +3361,14 @@ pure subroutine dm_geocom_api_request_set_atr_mode(request, atr_mode) character(len=80) :: args write (args, '(i0)') atr_mode - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_set_atr_mode pure subroutine dm_geocom_api_request_set_binary_mode(request, enabled) - !! Request of `COM_SetBinaryAvailable` procedure. Creates request for + !! Request of *COM_SetBinaryAvailable* procedure. Creates request for !! setting the binary attribute of the server. !! - !! The function set the ability of the GeoCOM server to handle binary + !! The function sets the ability of the GeoCOM server to handle binary !! communication (not supported by DMPACK). !! !! The instrument returns the following responses: @@ -3299,7 +3381,8 @@ pure subroutine dm_geocom_api_request_set_binary_mode(request, enabled) !! | ASCII request | `%R1Q,114:` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 114 + character(len=*), parameter :: REQUEST_NAME = 'set_binary_mode' + integer, parameter :: REQUEST_CODE = 114 type(request_type), intent(out) :: request !! Prepared request. logical, intent(in) :: enabled !! Enable binary communication. @@ -3307,11 +3390,11 @@ pure subroutine dm_geocom_api_request_set_binary_mode(request, enabled) character(len=80) :: args write (args, '(i1)') dm_btoi(enabled) - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_set_binary_mode pure subroutine dm_geocom_api_request_set_config(request, auto_power, timeout) - !! Request of `SUP_SetConfig` procedure. Creates request for setting + !! Request of *SUP_SetConfig* procedure. Creates request for setting !! the power management configuration. !! !! The argument `timeout` sets the duration after which the instrument @@ -3329,7 +3412,8 @@ pure subroutine dm_geocom_api_request_set_config(request, auto_power, timeout) !! | ASCII request | `%R1Q,14002:,,` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 14002 + character(len=*), parameter :: REQUEST_NAME = 'set_config' + integer, parameter :: REQUEST_CODE = 14002 type(request_type), intent(out) :: request !! Prepared request. integer, intent(in) :: auto_power !! Power-off mode (`SUP_AUTO_POWER`). @@ -3338,11 +3422,11 @@ pure subroutine dm_geocom_api_request_set_config(request, auto_power, timeout) character(len=80) :: args write (args, '("0", 2(",", i0))') auto_power, timeout - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_set_config pure subroutine dm_geocom_api_request_set_date_time(request, year, month, day, hour, minute, second) - !! Request of `CSV_SetDateTime` procedure. Creates request for + !! Request of *CSV_SetDateTime* procedure. Creates request for !! setting the date and time of the instrument. !! !! The instrument returns the following responses: @@ -3355,7 +3439,8 @@ pure subroutine dm_geocom_api_request_set_date_time(request, year, month, day, h !! | ASCII request | `%R1Q,5007:,,,,,` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 5007 + character(len=*), parameter :: REQUEST_NAME = 'set_date_time' + integer, parameter :: REQUEST_CODE = 5007 type(request_type), intent(out) :: request !! Prepared request. integer, intent(in) :: year !! Year (`YYYY`). @@ -3368,11 +3453,11 @@ pure subroutine dm_geocom_api_request_set_date_time(request, year, month, day, h character(len=80) :: args write (args, '(i0, 5(",", z2.2))') year, month, day, hour, minute, second - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_set_date_time pure subroutine dm_geocom_api_request_set_distance(request, slope_dist, height_offset, inc_mode) - !! Request of `TMC_SetHandDist` procedure. Creates request for + !! Request of *TMC_SetHandDist* procedure. Creates request for !! setting the slope distance and height offset. !! !! The function is used to set the manually measured slope distance and @@ -3399,7 +3484,8 @@ pure subroutine dm_geocom_api_request_set_distance(request, slope_dist, height_o !! | ASCII request | `%R1Q,2019:,,` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 2019 + character(len=*), parameter :: REQUEST_NAME = 'set_distance' + integer, parameter :: REQUEST_CODE = 2019 type(request_type), intent(out) :: request !! Prepared request. real(kind=r8), intent(in) :: slope_dist !! Slope distance [m]. @@ -3409,11 +3495,11 @@ pure subroutine dm_geocom_api_request_set_distance(request, slope_dist, height_o character(len=80) :: args write (args, '(2(f0.12, ","), i0)') slope_dist, height_offset, inc_mode - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_set_distance pure subroutine dm_geocom_api_request_set_double_precision(request, ndigits) - !! Request of `COM_SetDoublePrecision` procedure. Creates request for + !! Request of *COM_SetDoublePrecision* procedure. Creates request for !! setting the double precision. !! !! The function sets the precision – the number of digits right of the @@ -3433,7 +3519,8 @@ pure subroutine dm_geocom_api_request_set_double_precision(request, ndigits) !! | ASCII request | `%R1Q,107:` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 107 + character(len=*), parameter :: REQUEST_NAME = 'set_double_precision' + integer, parameter :: REQUEST_CODE = 107 type(request_type), intent(out) :: request !! Prepared request. integer, intent(in) :: ndigits !! Number of digits right to the comma. @@ -3441,15 +3528,15 @@ pure subroutine dm_geocom_api_request_set_double_precision(request, ndigits) character(len=80) :: args write (args, '(i0)') ndigits - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_set_double_precision pure subroutine dm_geocom_api_request_set_edm_mode(request, edm_mode) - !! Request of `TMC_SetEdmMode` procedure. Creates request for setting + !! Request of *TMC_SetEdmMode* procedure. Creates request for setting !! the EDM measurement mode. !! !! The mode (`EDM_MODE`) set by this function is used by - !! `TMC_DoMeasure(TMC_DEF_DIST)`. + !! *TMC_DoMeasure(TMC_DEF_DIST)*. !! !! The instrument returns the following responses: !! @@ -3461,7 +3548,8 @@ pure subroutine dm_geocom_api_request_set_edm_mode(request, edm_mode) !! | ASCII request | `%R1Q,2020:` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 2020 + character(len=*), parameter :: REQUEST_NAME = 'set_edm_mode' + integer, parameter :: REQUEST_CODE = 2020 type(request_type), intent(out) :: request !! Prepared request. integer, intent(in) :: edm_mode !! EDM measurement mode (`EDM_MODE`). @@ -3469,11 +3557,11 @@ pure subroutine dm_geocom_api_request_set_edm_mode(request, edm_mode) character(len=80) :: args write (args, '(i0)') edm_mode - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_set_edm_mode pure subroutine dm_geocom_api_request_set_egl_intensity(request, intensity) - !! Request of `EDM_SetEglIntensity` procedure. Creates request for + !! Request of *EDM_SetEglIntensity* procedure. Creates request for !! setting the intensity of the electronic guide light. !! !! The argument `intensity` (`EDM_EGLINTENSITY_TYPE`) must be one of @@ -3494,7 +3582,8 @@ pure subroutine dm_geocom_api_request_set_egl_intensity(request, intensity) !! | ASCII request | `%R1Q,1059:` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 1059 + character(len=*), parameter :: REQUEST_NAME = 'set_egl_intensity' + integer, parameter :: REQUEST_CODE = 1059 type(request_type), intent(out) :: request !! Prepared request. integer, intent(in) :: intensity !! EGL intensity (`EDM_EGLINTENSITY_TYPE`). @@ -3502,11 +3591,11 @@ pure subroutine dm_geocom_api_request_set_egl_intensity(request, intensity) character(len=80) :: args write (args, '(i0)') intensity - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_set_egl_intensity pure subroutine dm_geocom_api_request_set_fine_adjust_mode(request, adj_mode) - !! Request of `AUT_SetFineAdjustMode` procedure. Creates request for + !! Request of *AUT_SetFineAdjustMode* procedure. Creates request for !! setting the fine adjust positioning mode. !! !! The function sets the positioning tolerances relating to angle @@ -3527,7 +3616,8 @@ pure subroutine dm_geocom_api_request_set_fine_adjust_mode(request, adj_mode) !! | ASCII request | `%R1Q,9031:` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 9031 + character(len=*), parameter :: REQUEST_NAME = 'set_fine_adjust_mode' + integer, parameter :: REQUEST_CODE = 9031 type(request_type), intent(out) :: request !! Prepared request. integer, intent(in) :: adj_mode !! Fine adjust positioning mode (`AUT_ADJMODE`). @@ -3535,11 +3625,11 @@ pure subroutine dm_geocom_api_request_set_fine_adjust_mode(request, adj_mode) character(len=80) :: args write (args, '(i0)') adj_mode - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_set_fine_adjust_mode pure subroutine dm_geocom_api_request_set_geometric_ppm(request, enabled, scale_factor, offset, height_ppm, individual_ppm) - !! Request of `TMC_SetGeoPpm` procedure. Creates request for setting the + !! Request of *TMC_SetGeoPpm* procedure. Creates request for setting the !! geometric ppm correction factor. !! !! The instrument returns the following responses: @@ -3552,7 +3642,8 @@ pure subroutine dm_geocom_api_request_set_geometric_ppm(request, enabled, scale_ !! | ASCII request | `%R1Q,2153:,,,,` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 2153 + character(len=*), parameter :: REQUEST_NAME = 'set_geometric_ppm' + integer, parameter :: REQUEST_CODE = 2153 type(request_type), intent(out) :: request !! Prepared request. logical, intent(in) :: enabled !! Enable geometric ppm calculation. @@ -3564,11 +3655,11 @@ pure subroutine dm_geocom_api_request_set_geometric_ppm(request, enabled, scale_ character(len=80) :: args write (args, '(i1, 4(",", f0.12))') dm_btoi(enabled), scale_factor, offset, height_ppm, individual_ppm - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_set_geometric_ppm pure subroutine dm_geocom_api_request_set_height(request, height) - !! Request of `TMC_SetHeight` procedure. Creates request for setting a + !! Request of *TMC_SetHeight* procedure. Creates request for setting a !! new reflector height. !! !! The instrument returns the following responses: @@ -3581,19 +3672,20 @@ pure subroutine dm_geocom_api_request_set_height(request, height) !! | ASCII request | `%R1Q,2012:` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 2012 + character(len=*), parameter :: REQUEST_NAME = 'set_height' + integer, parameter :: REQUEST_CODE = 2012 type(request_type), intent(out) :: request !! Prepared request. - real(kind=r8), intent(in) :: height !! Reflector height. + real(kind=r8), intent(in) :: height !! Reflector height [m]. character(len=80) :: args write (args, '(f0.12)') height - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_set_height pure subroutine dm_geocom_api_request_set_image_config(request, mem_type, image_number, quality, sub_function, prefix) - !! Request of `IMG_SetTccConfig` procedure. Creates request for setting + !! Request of *IMG_SetTccConfig* procedure. Creates request for setting !! the image configuration. !! !! The argument `sub_function` may be a binary combination of the @@ -3614,7 +3706,8 @@ pure subroutine dm_geocom_api_request_set_image_config(request, mem_type, image_ !! | ASCII request | `%R1Q,23401:,,,,` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 23401 + character(len=*), parameter :: REQUEST_NAME = 'set_image_config' + integer, parameter :: REQUEST_CODE = 23401 type(request_type), intent(out) :: request !! Prepared request. integer, intent(in) :: mem_type !! Memory device type (`IMG_MEM_TYPE`). @@ -3626,11 +3719,11 @@ pure subroutine dm_geocom_api_request_set_image_config(request, mem_type, image_ character(len=80) :: args write (args, '(4(i0, ","), a)') mem_type, image_number, quality, sub_function, trim(prefix) - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_set_image_config pure subroutine dm_geocom_api_request_set_inclination_correction(request, enabled) - !! Request of `TMC_SetInclineSwitch` procedure. Creates request for turning + !! Request of *TMC_SetInclineSwitch* procedure. Creates request for turning !! the dual-axis compensator on or off. !! !! The instrument returns the following responses: @@ -3643,7 +3736,8 @@ pure subroutine dm_geocom_api_request_set_inclination_correction(request, enable !! | ASCII request | `%R1Q,2006:` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 2006 + character(len=*), parameter :: REQUEST_NAME = 'set_inclination_correction' + integer, parameter :: REQUEST_CODE = 2006 type(request_type), intent(out) :: request !! Prepared request. logical, intent(in) :: enabled !! Enable dual-axis compensator. @@ -3651,11 +3745,11 @@ pure subroutine dm_geocom_api_request_set_inclination_correction(request, enable character(len=80) :: args write (args, '(i1)') dm_btoi(enabled) - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_set_inclination_correction pure subroutine dm_geocom_api_request_set_laser_pointer(request, enabled) - !! Request of `EDM_Laserpointer` procedure. Creates request for turning + !! Request of *EDM_Laserpointer* procedure. Creates request for turning !! the laser pointer on or off. !! !! The function is only available on models which support reflectorless @@ -3671,7 +3765,8 @@ pure subroutine dm_geocom_api_request_set_laser_pointer(request, enabled) !! | ASCII request | `%R1Q,1004:` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 1004 + character(len=*), parameter :: REQUEST_NAME = 'set_laser_pointer' + integer, parameter :: REQUEST_CODE = 1004 type(request_type), intent(out) :: request !! Prepared request. logical, intent(in) :: enabled !! Enable laser pointer. @@ -3679,15 +3774,15 @@ pure subroutine dm_geocom_api_request_set_laser_pointer(request, enabled) character(len=80) :: args write (args, '(i1)') dm_btoi(enabled) - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_set_laser_pointer - pure subroutine dm_geocom_api_request_set_measurement_program(request, prog) - !! Request of `BAP_SetMeasPrg` procedure. Creates request for setting + pure subroutine dm_geocom_api_request_set_measurement_program(request, bap_prog) + !! Request of *BAP_SetMeasPrg* procedure. Creates request for setting !! the distance measurement program. !! !! The function sets the distance measurement program, for example, for - !! API call `BAP_MeasDistanceAngle`. The RL EDM type programs are not + !! API call *BAP_MeasDistanceAngle*. The RL EDM type programs are not !! available on all instruments. Changing the measurement program may !! change the EDM type as well (IR, RL). !! @@ -3698,29 +3793,30 @@ pure subroutine dm_geocom_api_request_set_measurement_program(request, prog) !! | Property | Values | !! |----------------|--------------------------------------------------| !! | Instruments | TPS1100, TPS1200, TM30/TS30, TS16 | - !! | ASCII request | `%R1Q,17019:` | + !! | ASCII request | `%R1Q,17019:` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 17019 + character(len=*), parameter :: REQUEST_NAME = 'set_measurement_program' + integer, parameter :: REQUEST_CODE = 17019 - type(request_type), intent(out) :: request !! Prepared request. - integer, intent(in) :: prog !! Measurement program (`BAP_USER_MEASPRG`). + type(request_type), intent(out) :: request !! Prepared request. + integer, intent(in) :: bap_prog !! Measurement program (`BAP_USER_MEASPRG`). character(len=80) :: args - write (args, '(i0)') prog - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + write (args, '(i0)') bap_prog + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_set_measurement_program pure subroutine dm_geocom_api_request_set_orientation(request, hz) - !! Request of `TMC_SetOrientation` procedure. Creates request for + !! Request of *TMC_SetOrientation* procedure. Creates request for !! orientating the instrument in horizontal direction. !! !! The API function is a combination of an angle measurement to get the !! horizontal offset and setting the angle offset afterwards, in order !! to orientate to a target. Before the new orientation can be set, an !! existing distance must be cleared by calling API function - !! `TMC_DoMeasure` with command `TMC_CLEAR`. + !! *TMC_DoMeasure* with command `TMC_CLEAR`. !! !! The instrument returns the following responses: !! @@ -3732,7 +3828,8 @@ pure subroutine dm_geocom_api_request_set_orientation(request, hz) !! | ASCII request | `%R1Q,2113:` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 2113 + character(len=*), parameter :: REQUEST_NAME = 'set_orientation' + integer, parameter :: REQUEST_CODE = 2113 type(request_type), intent(out) :: request !! Prepared request. real(kind=r8), intent(in) :: hz !! Horizontal orientation [rad]. @@ -3740,11 +3837,11 @@ pure subroutine dm_geocom_api_request_set_orientation(request, hz) character(len=80) :: args write (args, '(f0.12)') hz - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_set_orientation pure subroutine dm_geocom_api_request_set_position(request, hz, v, pos_mode, atr_mode) - !! Request of `AUT_MakePositioning` procedure. Creates request for + !! Request of *AUT_MakePositioning* procedure. Creates request for !! turning the telescope to a specified position. !! !! If `pos_mode` is `AUT_NORMAL`, uses the current value of the @@ -3766,7 +3863,8 @@ pure subroutine dm_geocom_api_request_set_position(request, hz, v, pos_mode, atr !! | ASCII request | `%R1Q,9027:,,,,0` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 9027 + character(len=*), parameter :: REQUEST_NAME = 'set_position' + integer, parameter :: REQUEST_CODE = 9027 type(request_type), intent(out) :: request !! Prepared request. real(kind=r8), intent(in) :: hz !! Horizontal angle [rad]. @@ -3777,16 +3875,16 @@ pure subroutine dm_geocom_api_request_set_position(request, hz, v, pos_mode, atr character(len=80) :: args write (args, '(2(f0.12, ","), 2(i0, ","), "0")') hz, v, pos_mode, atr_mode - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_set_position - pure subroutine dm_geocom_api_request_set_positioning_timeout(request, hz, v) - !! Request of `AUT_SetTimeout` procedure. Creates request for setting + pure subroutine dm_geocom_api_request_set_positioning_timeout(request, time_hz, time_v) + !! Request of *AUT_SetTimeout* procedure. Creates request for setting !! the timeout for positioning. !! !! This function sets the maximum time to perform a positioning. The !! timeout is reset on 7 seconds after each power on. Valid value for - !! `hz` and `v` are between 7 [sec] and 60 [sec]. + !! `time_hz` and `time_v` are between 7.0 [sec] and 60.0 [sec]. !! !! The instrument returns the following responses: !! @@ -3795,24 +3893,25 @@ pure subroutine dm_geocom_api_request_set_positioning_timeout(request, hz, v) !! | Property | Values | !! |----------------|--------------------------------------------------| !! | Instruments | TPS1100, TPS1200, TM30/TS30, TS16 | - !! | ASCII request | `%R1Q,9011:,` | + !! | ASCII request | `%R1Q,9011:,` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 9011 + character(len=*), parameter :: REQUEST_NAME = 'set_positioning_timeout' + integer, parameter :: REQUEST_CODE = 9011 type(request_type), intent(out) :: request !! Prepared request. - real(kind=r8), intent(in) :: hz !! Timeout in Hz direction [s]. - real(kind=r8), intent(in) :: v !! Timeout in V direction [s]. + real(kind=r8), intent(in) :: time_hz !! Timeout in Hz direction [s]. + real(kind=r8), intent(in) :: time_v !! Timeout in V direction [s]. character(len=80) :: args - write (args, '(f0.12, ",", f0.12)') hz, v - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + write (args, '(f0.12, ",", f0.12)') time_hz, time_v + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_set_positioning_timeout pure subroutine dm_geocom_api_request_set_prism_constant(request, prism_const) - !! Request of `TMC_SetPrismCorr` procedure. Creates request for - !! setting the prism constant. The API function `BAP_SetPrismType` + !! Request of *TMC_SetPrismCorr* procedure. Creates request for + !! setting the prism constant. The API function *BAP_SetPrismType* !! overwrites this setting. !! !! The instrument returns the following responses: @@ -3825,7 +3924,8 @@ pure subroutine dm_geocom_api_request_set_prism_constant(request, prism_const) !! | ASCII request | `%R1Q,2024:` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 2024 + character(len=*), parameter :: REQUEST_NAME = 'set_prism_constant' + integer, parameter :: REQUEST_CODE = 2024 type(request_type), intent(out) :: request !! Prepared request. real(kind=r8), intent(in) :: prism_const !! Prism constant [mm]. @@ -3833,16 +3933,16 @@ pure subroutine dm_geocom_api_request_set_prism_constant(request, prism_const) character(len=80) :: args write (args, '(f0.12)') prism_const - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_set_prism_constant pure subroutine dm_geocom_api_request_set_prism_type(request, prism_type) - !! Request of `BAP_SetPrismType` procedure. Creates request for + !! Request of *BAP_SetPrismType* procedure. Creates request for !! setting the default prism type. !! !! This function sets the prism type for measurement with a reflector !! (`BAP_PRISMTYPE`). It overwrites the prism constant set by API call - !! `TMC_SetPrimCorr`. + !! *TMC_SetPrimCorr*. !! !! The instrument returns the following responses: !! @@ -3854,7 +3954,8 @@ pure subroutine dm_geocom_api_request_set_prism_type(request, prism_type) !! | ASCII request | `%R1Q,17008:` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 17008 + character(len=*), parameter :: REQUEST_NAME = 'set_prism_type' + integer, parameter :: REQUEST_CODE = 17008 type(request_type), intent(out) :: request !! Prepared request. integer, intent(in) :: prism_type !! Prism type (`BAP_PRISMTYPE`). @@ -3862,17 +3963,17 @@ pure subroutine dm_geocom_api_request_set_prism_type(request, prism_type) character(len=80) :: args write (args, '(i0)') prism_type - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_set_prism_type pure subroutine dm_geocom_api_request_set_prism_type_v2(request, prism_type, prism_name) - !! Request of `BAP_SetPrismType2` procedure. Creates request for + !! Request of *BAP_SetPrismType2* procedure. Creates request for !! setting the default or user prism type. !! !! This function sets the default or the user prism type for !! measurements with a reflector. It overwrites the prism constant set - !! by `TMC_SetPrismCorr`. The user defined prism must have been added - !! with API call `BAP_SetUserPrismDef` beforehand. + !! by *TMC_SetPrismCorr*. The user defined prism must have been added + !! with API call *BAP_SetUserPrismDef* beforehand. !! !! The instrument returns the following responses: !! @@ -3884,7 +3985,8 @@ pure subroutine dm_geocom_api_request_set_prism_type_v2(request, prism_type, pri !! | ASCII request | `%R1Q,17030:,` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 17030 + character(len=*), parameter :: REQUEST_NAME = 'set_prism_type_v2' + integer, parameter :: REQUEST_CODE = 17030 type(request_type), intent(out) :: request !! Prepared request. integer, intent(in) :: prism_type !! Prism type (`BAP_PRISMTYPE`). @@ -3893,11 +3995,11 @@ pure subroutine dm_geocom_api_request_set_prism_type_v2(request, prism_type, pri character(len=80) :: args write (args, '(i0, ",", a)') prism_type, prism_name - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_set_prism_type_v2 pure subroutine dm_geocom_api_request_set_reduced_atr_fov(request, enabled) - !! Request of `BAP_SetRedATRFov` procedure. Creates request for + !! Request of *BAP_SetRedATRFov* procedure. Creates request for !! setting the reduced ATR field of view. !! !! If `enabled` is `.true.`, ATR uses reduced field of view (about @@ -3913,7 +4015,8 @@ pure subroutine dm_geocom_api_request_set_reduced_atr_fov(request, enabled) !! | ASCII request | `%R1Q,17008:` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 17008 + character(len=*), parameter :: REQUEST_NAME = 'set_reduced_atr_fov' + integer, parameter :: REQUEST_CODE = 17008 type(request_type), intent(out) :: request !! Prepared request. logical, intent(in) :: enabled !! Use reduced field of view. @@ -3921,11 +4024,11 @@ pure subroutine dm_geocom_api_request_set_reduced_atr_fov(request, enabled) character(len=80) :: args write (args, '(i1)') dm_btoi(enabled) - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_set_reduced_atr_fov pure subroutine dm_geocom_api_request_set_refraction_mode(request, mode) - !! Request of `TMC_SetRefractiveMethod` procedure. Creates request for + !! Request of *TMC_SetRefractiveMethod* procedure. Creates request for !! setting the refraction model. !! !! Mode `1` means method 1 for the rest of the world, mode `2` means @@ -3941,7 +4044,8 @@ pure subroutine dm_geocom_api_request_set_refraction_mode(request, mode) !! | ASCII request | `%R1Q,2090:` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 2090 + character(len=*), parameter :: REQUEST_NAME = 'set_refraction_mode' + integer, parameter :: REQUEST_CODE = 2090 type(request_type), intent(out) :: request !! Prepared request. integer, intent(in) :: mode !! Refraction data method (1 or 2). @@ -3949,11 +4053,11 @@ pure subroutine dm_geocom_api_request_set_refraction_mode(request, mode) character(len=80) :: args write (args, '(i0)') mode - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_set_refraction_mode pure subroutine dm_geocom_api_request_set_search_area(request, center_hz, center_v, range_hz, range_v, enabled) - !! Request of `AUT_SetSearchArea` procedure. Creates request for + !! Request of *AUT_SetSearchArea* procedure. Creates request for !! setting the PowerSearch window. !! !! The function sets the position and dimensions of the PowerSearch @@ -3971,7 +4075,8 @@ pure subroutine dm_geocom_api_request_set_search_area(request, center_hz, center !! | ASCII request | `%R1Q,9043:,,,,` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 9043 + character(len=*), parameter :: REQUEST_NAME = 'set_search_area' + integer, parameter :: REQUEST_CODE = 9043 type(request_type), intent(out) :: request !! Prepared request. real(kind=r8), intent(in) :: center_hz !! Search area center Hz angle [rad]. @@ -3983,11 +4088,11 @@ pure subroutine dm_geocom_api_request_set_search_area(request, center_hz, center character(len=80) :: args write (args, '(4(f0.12, ","), i1)') center_hz, center_v, range_hz, range_v, dm_btoi(enabled) - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_set_search_area pure subroutine dm_geocom_api_request_set_station(request, easting, northing, height, instr_height) - !! Request of `TMC_SetStation` procedure. Creates request for setting + !! Request of *TMC_SetStation* procedure. Creates request for setting !! the station coordinates of the instrument. !! !! The instrument returns the following responses: @@ -4000,7 +4105,8 @@ pure subroutine dm_geocom_api_request_set_station(request, easting, northing, he !! | ASCII request | `%R1Q,2010:,,,` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 2010 + character(len=*), parameter :: REQUEST_NAME = 'set_station' + integer, parameter :: REQUEST_CODE = 2010 type(request_type), intent(out) :: request !! Prepared request. real(kind=r8), intent(in) :: easting !! E coordinate [m]. @@ -4011,11 +4117,11 @@ pure subroutine dm_geocom_api_request_set_station(request, easting, northing, he character(len=80) :: args write (args, '(3(f0.12, ","), f0.12)') easting, northing, height, instr_height - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_set_station pure subroutine dm_geocom_api_request_set_target_type(request, target_type) - !! Request of `BAP_SetTargetType` procedure. Creates request for + !! Request of *BAP_SetTargetType* procedure. Creates request for !! setting the EDM type. !! !! The function sets the current EDM type (`BAP_TARGET_TYPE`) for @@ -4023,7 +4129,7 @@ pure subroutine dm_geocom_api_request_set_target_type(request, target_type) !! each EDM type, the EDM mode used last is remembered and actived if !! the EDM type is changed. If EDM type IR is selected, the automation !! mode used last is activated automatically. The API function - !! `BAP_SetMeasPrg` can also change the target type. The EDM type RL is + !! *BAP_SetMeasPrg* can also change the target type. The EDM type RL is !! not available on all instruments. !! !! The instrument returns the following responses: @@ -4036,7 +4142,8 @@ pure subroutine dm_geocom_api_request_set_target_type(request, target_type) !! | ASCII request | `%R1Q,17021:` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 17021 + character(len=*), parameter :: REQUEST_NAME = 'set_target_type' + integer, parameter :: REQUEST_CODE = 17021 type(request_type), intent(out) :: request !! Prepared request. integer, intent(in) :: target_type !! Target type (`BAP_TARGET_TYPE`). @@ -4044,11 +4151,11 @@ pure subroutine dm_geocom_api_request_set_target_type(request, target_type) character(len=80) :: args write (args, '(i0)') target_type - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_set_target_type pure subroutine dm_geocom_api_request_set_tolerance(request, hz, v) - !! Request of `AUT_SetTol` procedure. Creates request for setting + !! Request of *AUT_SetTol* procedure. Creates request for setting !! the positioning tolerances. !! !! This function sets the position tolerances of the Hz and V @@ -4070,7 +4177,8 @@ pure subroutine dm_geocom_api_request_set_tolerance(request, hz, v) !! | ASCII request | `%R1Q,9007:,` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 9007 + character(len=*), parameter :: REQUEST_NAME = 'set_tolerance' + integer, parameter :: REQUEST_CODE = 9007 type(request_type), intent(out) :: request !! Prepared request. real(kind=r8), intent(in) :: hz !! Positioning tolerance in Hz direction [rad]. @@ -4079,12 +4187,12 @@ pure subroutine dm_geocom_api_request_set_tolerance(request, hz, v) character(len=80) :: args write (args, '(f0.12, ",", f0.12)') hz, v - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_set_tolerance pure subroutine dm_geocom_api_request_set_user_atr_mode(request, enabled) - !! Request of `AUS_SetUserAtrState` procedure. Creates request for - !! setting the status of the ATR mode. + !! Request of *AUS_SetUserAtrState* procedure. Creates request for + !! setting the status of the ATR state. !! !! The function activates or deactivates the ATR mode (requires GeoCOM !! robotic licence). If `enabled` is `.true.`, ATR mode is activated, @@ -4102,7 +4210,8 @@ pure subroutine dm_geocom_api_request_set_user_atr_mode(request, enabled) !! | ASCII request | `%R1Q,18005:` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 18005 + character(len=*), parameter :: REQUEST_NAME = 'set_user_atr_mode' + integer, parameter :: REQUEST_CODE = 18005 type(request_type), intent(out) :: request !! Prepared request. logical, intent(in) :: enabled !! Enable ATR mode. @@ -4110,17 +4219,17 @@ pure subroutine dm_geocom_api_request_set_user_atr_mode(request, enabled) character(len=80) :: args write (args, '(i1)') dm_btoi(enabled) - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_set_user_atr_mode pure subroutine dm_geocom_api_request_set_user_lock_mode(request, enabled) - !! Request of `AUS_SetUserLockState` procedure. Creates request for - !! setting the status of the LOCK mode. + !! Request of *AUS_SetUserLockState* procedure. Creates request for + !! setting the status of the LOCK state. !! !! The function activated or deactivates the LOCK mode (GeoCOM robotic !! licence required). If `enabled` is `.true.`, LOCK mode is activated. !! In order to lock and follow a moving target, call API function - !! `AUT_LockIn`. If `enabled` is `.false.`, LOCK mode is deactivated. + !! *AUT_LockIn*. If `enabled` is `.false.`, LOCK mode is deactivated. !! Tracking of a moving target will be aborted, and the manual drive !! wheel is activated. !! @@ -4134,7 +4243,8 @@ pure subroutine dm_geocom_api_request_set_user_lock_mode(request, enabled) !! | ASCII request | `%R1Q,18007:` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 18007 + character(len=*), parameter :: REQUEST_NAME = 'set_user_lock_mode' + integer, parameter :: REQUEST_CODE = 18007 type(request_type), intent(out) :: request !! Prepared request. logical, intent(in) :: enabled !! Enable LOCK mode. @@ -4142,11 +4252,11 @@ pure subroutine dm_geocom_api_request_set_user_lock_mode(request, enabled) character(len=80) :: args write (args, '(i1)') dm_btoi(enabled) - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_set_user_lock_mode pure subroutine dm_geocom_api_request_set_user_prism_definition(request, prism_name, prism_const, prism_type, creator) - !! Request of `BAP_SetUserPrismDef` procedure. Creates request for + !! Request of *BAP_SetUserPrismDef* procedure. Creates request for !! setting a user prism definition. !! !! The instrument returns the following responses: @@ -4159,7 +4269,8 @@ pure subroutine dm_geocom_api_request_set_user_prism_definition(request, prism_n !! | ASCII request | `%R1Q,17032:,,,` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 17032 + character(len=*), parameter :: REQUEST_NAME = 'set_user_prism_definition' + integer, parameter :: REQUEST_CODE = 17032 type(request_type), intent(out) :: request !! Prepared request. character(len=*), intent(in) :: prism_name !! Prism name. @@ -4170,11 +4281,11 @@ pure subroutine dm_geocom_api_request_set_user_prism_definition(request, prism_n character(len=80) :: args write (args, '(a, ",", f0.12, ",", i0, ",", a)') prism_name, prism_const, prism_type, creator - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_set_user_prism_definition pure subroutine dm_geocom_api_request_set_user_spiral(request, hz, v) - !! Request of `AUT_SetUserSpiral` procedure. Creates request for + !! Request of *AUT_SetUserSpiral* procedure. Creates request for !! setting the ATR search window. !! !! The function sets the dimensions of the ATR search window (GeoCOM @@ -4190,7 +4301,8 @@ pure subroutine dm_geocom_api_request_set_user_spiral(request, hz, v) !! | ASCII request | `%R1Q,9041:,` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 9041 + character(len=*), parameter :: REQUEST_NAME = 'set_user_spiral' + integer, parameter :: REQUEST_CODE = 9041 type(request_type), intent(out) :: request !! Prepared request. real(kind=r8), intent(in) :: hz !! ATR search window in Hz direction [rad]. @@ -4199,16 +4311,16 @@ pure subroutine dm_geocom_api_request_set_user_spiral(request, hz, v) character(len=80) :: args write (args, '(f0.12, ",", f0.12)') hz, v - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_set_user_spiral pure subroutine dm_geocom_api_request_set_velocity(request, omega_hz, omega_v) - !! Request of `MOT_SetVelocity` procedure. Creates request for + !! Request of *MOT_SetVelocity* procedure. Creates request for !! driving the instrument with constant speed. !! !! The function is used to set up the velocity of the motorisation !! (GeoCOM robotic licence required). The API function - !! `MOT_StartController` must have been called with argument + !! *MOT_StartController* must have been called with argument !! `MOT_OCONST` before. !! !! The velocity in horizontal and vertical direction are in [rad/s]. @@ -4225,7 +4337,8 @@ pure subroutine dm_geocom_api_request_set_velocity(request, omega_hz, omega_v) !! | ASCII request | `%R1Q,6004:,` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 6004 + character(len=*), parameter :: REQUEST_NAME = 'set_velocity' + integer, parameter :: REQUEST_CODE = 6004 type(request_type), intent(out) :: request !! Prepared request. real(kind=r8), intent(in) :: omega_hz !! Velocity in Hz direction [rad/s]. @@ -4234,25 +4347,23 @@ pure subroutine dm_geocom_api_request_set_velocity(request, omega_hz, omega_v) character(len=80) :: args write (args, '(f0.12, ",", f0.12)') omega_hz, omega_v - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_set_velocity pure subroutine dm_geocom_api_request_setup_download(request, device_type, file_type, file_name, block_size) - !! Request of `FTR_SetupDownload` procedure. Creates request for + !! Request of *FTR_SetupDownload* procedure. Creates request for !! setting up a file download. !! - !! The function has to be called before `FTR_Download`. If the file + !! The function has to be called before *FTR_Download*. If the file !! type is `FTR_FILE_UNKNOWN`, an additional file path is required. !! - !! The argument `device_type` (`FTR_DEVICETYPE`) must be one of the - !! following: + !! The argument `device_type` must be one of the following: !! !! * `FTR_DEVICE_INTERNAL` – Internal memory (path `/ata1a/`). !! * `FTR_DEVICE_PCPARD` – CF Card (path `/ata0a/`). !! - !! The argument `file_type` (`FTR_FILETYPE`) is usually - !! `FTR_FILE_IMAGES`. The maximum value for `block_size` is - !! `FTR_MAX_BLOCKSIZE`. + !! The argument `file_type` is usually `FTR_FILE_IMAGES`. The maximum + !! value for `block_size` is `FTR_MAX_BLOCKSIZE`. !! !! The instrument returns the following responses: !! @@ -4265,8 +4376,9 @@ pure subroutine dm_geocom_api_request_setup_download(request, device_type, file_ !! | ASCII request | `%R1Q,23303:,,,` | !! | ASCII response | `%R1P,0,0:,` | !! - integer, parameter :: REQCODE = 23303 - character(len=*), parameter :: PATTERN = '(?\d+),(?\d+)' + character(len=*), parameter :: REQUEST_NAME = 'setup_download' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?\d+)' + integer, parameter :: REQUEST_CODE = 23303 type(request_type), intent(out) :: request !! Prepared request. integer, intent(in) :: device_type !! Device type (`FTR_DEVICETYPE`). @@ -4283,15 +4395,15 @@ pure subroutine dm_geocom_api_request_setup_download(request, device_type, file_ ] write (args, '(2(i0, ","), a, ",", i0)') device_type, file_type, file_name, block_size - call dm_geocom_api_request(request, REQCODE, args, PATTERN, responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, REQUEST_PATTERN, responses) end subroutine dm_geocom_api_request_setup_download pure subroutine dm_geocom_api_request_setup_list(request, device_type, file_type, search_path) - !! Request of `FTR_SetupList` procedure. Creates request for + !! Request of *FTR_SetupList* procedure. Creates request for !! setting up file listing. !! !! The function sets up the device type, file type, and search path. It - !! has to be called before `FTR_List`. + !! has to be called before *FTR_List*. !! !! The instrument returns the following responses: !! @@ -4303,7 +4415,8 @@ pure subroutine dm_geocom_api_request_setup_list(request, device_type, file_type !! | ASCII request | `%R1Q,23306:,,` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 23306 + character(len=*), parameter :: REQUEST_NAME = 'setup_list' + integer, parameter :: REQUEST_CODE = 23306 type(request_type), intent(out) :: request !! Prepared request. integer, intent(in) :: device_type !! Device type (`FTR_DEVICETYPE`). @@ -4313,17 +4426,17 @@ pure subroutine dm_geocom_api_request_setup_list(request, device_type, file_type character(len=80) :: args write (args, '(2(i0, ","), a)') device_type, file_type, search_path - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_setup_list pure subroutine dm_geocom_api_request_start_controller(request, start_mode) - !! Request of `MOT_StartController` procedure. Creates request for + !! Request of *MOT_StartController* procedure. Creates request for !! starting the motor controller. !! !! If this function is used in combination with API call - !! `MOT_SetVelocity`, the controller mode has to be `MOT_OCONST`. + !! *MOT_SetVelocity*, the controller mode has to be `MOT_OCONST`. !! - !! The argument `start_mode` (`MOT_MODE`) must be one of the following: + !! The argument `start_mode` must be one of the following: !! !! * `MOT_POSIT` – Relative positioning. !! * `MOT_OCONST` – Constant speed. @@ -4342,7 +4455,8 @@ pure subroutine dm_geocom_api_request_start_controller(request, start_mode) !! | ASCII request | `%R1Q,6001:` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 6001 + character(len=*), parameter :: REQUEST_NAME = 'start_controller' + integer, parameter :: REQUEST_CODE = 6001 type(request_type), intent(out) :: request !! Prepared request. integer, intent(in) :: start_mode !! Controller start mode (`MOT_MODE`). @@ -4350,16 +4464,16 @@ pure subroutine dm_geocom_api_request_start_controller(request, start_mode) character(len=80) :: args write (args, '(i0)') start_mode - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_start_controller pure subroutine dm_geocom_api_request_stop_controller(request, stop_mode) - !! Request of `MOT_StartController` procedure. Creates request for + !! Request of *MOT_StartController* procedure. Creates request for !! stopping the motor controller. !! !! This function stops the movement and the motor controller program. !! - !! The argument `stop_mode` (`MOT_STOPMODE`) must be one of the following: + !! The argument `stop_mode` must be one of the following: !! !! * `MOT_NORMAL` – Slow down with current acceleration. !! * `MOT_SHUTDOWN` – Slow down by switching off power supply. @@ -4374,7 +4488,8 @@ pure subroutine dm_geocom_api_request_stop_controller(request, stop_mode) !! | ASCII request | `%R1Q,6002:` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 6002 + character(len=*), parameter :: REQUEST_NAME = 'stop_controller' + integer, parameter :: REQUEST_CODE = 6002 type(request_type), intent(out) :: request !! Prepared request. integer, intent(in) :: stop_mode !! Controller stop mode (`MOT_STOPMODE`). @@ -4382,11 +4497,11 @@ pure subroutine dm_geocom_api_request_stop_controller(request, stop_mode) character(len=80) :: args write (args, '(i0)') stop_mode - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_stop_controller pure subroutine dm_geocom_api_request_switch_off(request, stop_mode) - !! Request of `COM_SwitchOffTPS` procedure. Creates request for + !! Request of *COM_SwitchOffTPS* procedure. Creates request for !! turning the instrument off. !! !! The argument `stop_mode` has to be one of the following: @@ -4404,19 +4519,20 @@ pure subroutine dm_geocom_api_request_switch_off(request, stop_mode) !! | ASCII request | `%R1Q,112:` | !! | ASCII response | `%R1P,0,0:` | !! - integer, parameter :: REQCODE = 112 + character(len=*), parameter :: REQUEST_NAME = 'switch_off' + integer, parameter :: REQUEST_CODE = 112 type(request_type), intent(out) :: request !! Prepared request. - integer, intent(in) :: stop_mode !! Switch off mode (`COM_TPS_STOP_MODE`). + integer, intent(in) :: stop_mode !! Switch-off mode (`COM_TPS_STOP_MODE`). character(len=80) :: args write (args, '(i0)') stop_mode - call dm_geocom_api_request(request, REQCODE, args, GEOCOM_GRC_PATTERN, GEOCOM_GRC_RESPONSES) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, GEOCOM_PATTERN, GEOCOM_RESPONSES) end subroutine dm_geocom_api_request_switch_off pure subroutine dm_geocom_api_request_switch_on(request, start_mode) - !! Request of `COM_SwitchOnTPS` procedure. Creates request for turning + !! Request of *COM_SwitchOnTPS* procedure. Creates request for turning !! the instrument on. !! !! The argument `start_mode` has to be one of the following: @@ -4436,19 +4552,20 @@ pure subroutine dm_geocom_api_request_switch_on(request, start_mode) !! | ASCII request | `%R1Q,111:` | !! | ASCII response | `%R1P,0,0:5` (if switched on) | !! - integer, parameter :: REQCODE = 111 + character(len=*), parameter :: REQUEST_NAME = 'switch_on' + integer, parameter :: REQUEST_CODE = 111 type(request_type), intent(out) :: request !! Prepared request. - integer, intent(in) :: start_mode !! Switch on mode (`COM_TPS_STARTUP_MODE`). + integer, intent(in) :: start_mode !! Switch-on mode (`COM_TPS_STARTUP_MODE`). character(len=80) :: args write (args, '(i0)') start_mode - call dm_geocom_api_request(request, REQCODE, args) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args) end subroutine dm_geocom_api_request_switch_on pure subroutine dm_geocom_api_request_take_image(request, mem_type) - !! Request of `IMG_TakeTccImage` procedure. Creates request for + !! Request of *IMG_TakeTccImage* procedure. Creates request for !! capturing a telescope image. !! !! The memory type `mem_type` has to be one of the following: @@ -4467,8 +4584,9 @@ pure subroutine dm_geocom_api_request_take_image(request, mem_type) !! | ASCII request | `%R1Q,23402:` | !! | ASCII response | `%R1P,0,0:,` | !! - integer, parameter :: REQCODE = 23402 - character(len=*), parameter :: PATTERN = '(?\d+),(?\d+)' + character(len=*), parameter :: REQUEST_NAME = 'take_image' + character(len=*), parameter :: REQUEST_PATTERN = '(?\d+),(?\d+)' + integer, parameter :: REQUEST_CODE = 23402 type(request_type), intent(out) :: request !! Prepared request. integer, intent(in) :: mem_type !! Memory type (`IMG_MEM_TYPE`). @@ -4482,6 +4600,6 @@ pure subroutine dm_geocom_api_request_take_image(request, mem_type) ] write (args, '(i0)') mem_type - call dm_geocom_api_request(request, REQCODE, args, PATTERN, responses) + call dm_geocom_api_request(request, REQUEST_NAME, REQUEST_CODE, args, REQUEST_PATTERN, responses) end subroutine dm_geocom_api_request_take_image end module dm_geocom_api diff --git a/src/dm_hdf5.f90 b/src/dm_hdf5.f90 index f45c6d8..4d649bf 100644 --- a/src/dm_hdf5.f90 +++ b/src/dm_hdf5.f90 @@ -493,13 +493,6 @@ integer function hdf5_create_observ(type_id) result(rc) call h5tinsert_f(type_id, 'name', offset, tid, stat); if (stat < 0) return call h5tclose_f(tid, stat); if (stat < 0) return - ! Observation source. - dims(1) = int(OBSERV_SOURCE_LEN, kind=hsize_t) - offset = h5offsetof(c_loc(observ), c_loc(observ%source)) - call h5tarray_create_f(H5T_NATIVE_CHARACTER, 1, dims, tid, stat); if (stat < 0) return - call h5tinsert_f(type_id, 'source', offset, tid, stat); if (stat < 0) return - call h5tclose_f(tid, stat); if (stat < 0) return - ! Observation timestamp. dims(1) = int(TIME_LEN, kind=hsize_t) offset = h5offsetof(c_loc(observ), c_loc(observ%timestamp)) @@ -507,6 +500,13 @@ integer function hdf5_create_observ(type_id) result(rc) call h5tinsert_f(type_id, 'timestamp', offset, tid, stat); if (stat < 0) return call h5tclose_f(tid, stat); if (stat < 0) return + ! Observation source. + dims(1) = int(OBSERV_SOURCE_LEN, kind=hsize_t) + offset = h5offsetof(c_loc(observ), c_loc(observ%source)) + call h5tarray_create_f(H5T_NATIVE_CHARACTER, 1, dims, tid, stat); if (stat < 0) return + call h5tinsert_f(type_id, 'source', offset, tid, stat); if (stat < 0) return + call h5tclose_f(tid, stat); if (stat < 0) return + ! Observation path. dims(1) = int(OBSERV_PATH_LEN, kind=hsize_t) offset = h5offsetof(c_loc(observ), c_loc(observ%path)) @@ -551,6 +551,13 @@ integer function hdf5_create_observ(type_id) result(rc) ! Observation requests. do i = 1, OBSERV_MAX_NREQUESTS + write (name, '("requests_", i0, "_name")') i + dims(1) = int(TIME_LEN, kind=hsize_t) + offset = h5offsetof(c_loc(observ), c_loc(observ%requests(i)%name)) + call h5tarray_create_f(H5T_NATIVE_CHARACTER, 1, dims, tid, stat); if (stat < 0) return + call h5tinsert_f(type_id, trim(name), offset, tid, stat); if (stat < 0) return + call h5tclose_f(tid, stat); if (stat < 0) return + write (name, '("requests_", i0, "_timestamp")') i dims(1) = int(TIME_LEN, kind=hsize_t) offset = h5offsetof(c_loc(observ), c_loc(observ%requests(i)%timestamp)) diff --git a/src/dm_html.f90 b/src/dm_html.f90 index 8dbc03a..908442d 100644 --- a/src/dm_html.f90 +++ b/src/dm_html.f90 @@ -1133,10 +1133,10 @@ function dm_html_observ(observ, prefix_node, prefix_sensor, prefix_target) resul H_TD // tid // H_TD_END // H_TR_END // & H_TR // H_TH // 'Name' // H_TH_END // & H_TD // dm_html_encode(observ%name) // H_TD_END // H_TR_END // & - H_TR // H_TH // 'Source' // H_TH_END // & - H_TD // dm_html_encode(observ%source) // H_TD_END // H_TR_END // & H_TR // H_TH // 'Timestamp' // H_TH_END // & H_TD // dm_html_encode(observ%timestamp) // H_TD_END // H_TR_END // & + H_TR // H_TH // 'Source' // H_TH_END // & + H_TD // dm_html_encode(observ%source) // H_TD_END // H_TR_END // & H_TR // H_TH // 'Path' // H_TH_END // & H_TD // H_CODE // dm_html_encode(observ%path) // H_CODE_END // H_TD_END // H_TR_END // & H_TR // H_TH // 'Priority' // H_TH_END // & @@ -1155,13 +1155,10 @@ function dm_html_observ(observ, prefix_node, prefix_sensor, prefix_target) resul if (n > 0) then html = html // H_TR // dm_html_th('Receivers', row_span=n) // & - H_TD // H_CODE // dm_html_encode(observ%receivers(1)) // & - H_CODE_END // H_TD_END // H_TR_END + H_TD // dm_html_encode(observ%receivers(1)) // H_TD_END // H_TR_END do i = 2, n - html = html // H_TR // H_TD // H_CODE // & - dm_html_encode(observ%receivers(i)) // H_CODE_END // & - H_TD_END // H_TR_END + html = html // H_TR // H_TD // dm_html_encode(observ%receivers(i)) // H_TD_END // H_TR_END end do end if @@ -1312,8 +1309,10 @@ function dm_html_request(request) result(html) character(len=:), allocatable :: html !! Generated HTML. html = H_TABLE // H_TBODY // & + H_TR // H_TH // 'Name' // H_TH_END // & + H_TD // H_CODE // dm_html_encode(request%name) // H_CODE_END // H_TD_END // H_TR_END // & H_TR // H_TH // 'Timestamp' // H_TH_END // & - H_TD // dm_html_time(request%timestamp, human=.true.) // H_TD_END // H_TR_END // & + H_TD // dm_html_encode(request%timestamp) // H_TD_END // H_TR_END // & H_TR // H_TH // 'Request' // H_TH_END // & H_TD // H_CODE // dm_html_encode(request%request) // H_CODE_END // H_TD_END // H_TR_END // & H_TR // H_TH // 'Response' // H_TH_END // & diff --git a/src/dm_id.f90 b/src/dm_id.f90 index 0ad9804..3daaf8e 100644 --- a/src/dm_id.f90 +++ b/src/dm_id.f90 @@ -12,12 +12,12 @@ module dm_id pure elemental logical function dm_id_valid(id, max_len) result(valid) !! Returns `.true.` if given string is a valid id. A valid id must !! be between 1 and 32 characters long, and all characters have to - !! be in set [-0-9A-Za-z]. + !! be in set [-0-9A-Z_a-z]. !! !! The optional argument `max_len` overwrites the default maximum id !! length. character(len=*), parameter :: ID_SET = & - '-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' + '-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz' character(len=*), intent(in) :: id !! String to validate. integer, intent(in), optional :: max_len !! Max. id length. diff --git a/src/dm_json.f90 b/src/dm_json.f90 index 8b6970e..6d6ca94 100644 --- a/src/dm_json.f90 +++ b/src/dm_json.f90 @@ -293,7 +293,8 @@ function json_from_observ(observ) result(json) do i = 1, observ%nrequests requests = requests // & - ' { "timestamp": "' // trim(observ%requests(i)%timestamp) // '",' // & + ' { "name": "' // trim(observ%requests(i)%name) // '",' // & + ' "timestamp": "' // trim(observ%requests(i)%timestamp) // '",' // & ' "request": "' // json_escape(observ%requests(i)%request) // '",' // & ' "response": "' // json_escape(observ%requests(i)%response) // '",' // & ' "delimiter": "' // json_escape(observ%requests(i)%delimiter) // '",' // & @@ -330,8 +331,8 @@ function json_from_observ(observ) result(json) ' "sensor_id": "' // trim(observ%sensor_id) // '",' // & ' "target_id": "' // trim(observ%target_id) // '",' // & ' "name": "' // trim(observ%name) // '",' // & - ' "source": "' // trim(observ%source) // '",' // & ' "timestamp": "' // trim(observ%timestamp) // '",' // & + ' "source": "' // trim(observ%source) // '",' // & ' "path": "' // json_escape(observ%path) // '",' // & ' "priority": ' // dm_itoa(observ%priority) // ',' // & ' "error": ' // dm_itoa(observ%error) // ',' // & diff --git a/src/dm_lua.f90 b/src/dm_lua.f90 index d2b9ed3..4125849 100644 --- a/src/dm_lua.f90 +++ b/src/dm_lua.f90 @@ -1061,8 +1061,8 @@ integer function lua_to_observ(lua, observ) result(rc) rc = dm_lua_field(lua, 'target_id', observ%target_id) rc = dm_lua_field(lua, 'id', observ%id) rc = dm_lua_field(lua, 'name', observ%name) - rc = dm_lua_field(lua, 'source', observ%source) rc = dm_lua_field(lua, 'timestamp', observ%timestamp) + rc = dm_lua_field(lua, 'source', observ%source) rc = dm_lua_field(lua, 'path', observ%path, unescape=.true.) rc = dm_lua_field(lua, 'priority', observ%priority) rc = dm_lua_field(lua, 'error', observ%error) @@ -1257,6 +1257,7 @@ integer function lua_to_request(lua, request) result(rc) rc = E_TYPE if (.not. dm_lua_is_table(lua)) exit request_block + rc = dm_lua_field(lua, 'name', request%name) rc = dm_lua_field(lua, 'timestamp', request%timestamp) rc = dm_lua_field(lua, 'request', request%request, unescape=.true.) rc = dm_lua_field(lua, 'response', request%response, unescape=.true.) @@ -1309,7 +1310,7 @@ subroutine lua_from_observ(lua, observ) integer :: i type(c_ptr) :: ptr - call lua_createtable(lua%ptr, 0, 14) + call lua_createtable(lua%ptr, 0, 15) ptr = lua_pushstring(lua%ptr, trim(observ%node_id)) call lua_setfield(lua%ptr, -2, 'node_id') @@ -1326,12 +1327,12 @@ subroutine lua_from_observ(lua, observ) ptr = lua_pushstring(lua%ptr, trim(observ%name)) call lua_setfield(lua%ptr, -2, 'name') - ptr = lua_pushstring(lua%ptr, trim(observ%source)) - call lua_setfield(lua%ptr, -2, 'source') - ptr = lua_pushstring(lua%ptr, trim(observ%timestamp)) call lua_setfield(lua%ptr, -2, 'timestamp') + ptr = lua_pushstring(lua%ptr, trim(observ%source)) + call lua_setfield(lua%ptr, -2, 'source') + ptr = lua_pushstring(lua%ptr, dm_lua_escape(observ%path)) call lua_setfield(lua%ptr, -2, 'path') @@ -1382,7 +1383,10 @@ subroutine lua_from_request(lua, request) integer :: i type(c_ptr) :: ptr - call lua_createtable(lua%ptr, 0, 12) + call lua_createtable(lua%ptr, 0, 14) + + ptr = lua_pushstring(lua%ptr, trim(request%name)) + call lua_setfield(lua%ptr, -2, 'name') ptr = lua_pushstring(lua%ptr, trim(request%timestamp)) call lua_setfield(lua%ptr, -2, 'timestamp') @@ -1425,7 +1429,7 @@ subroutine lua_from_request(lua, request) do i = 1, request%nresponses call lua_pushinteger(lua%ptr, int(i, kind=lua_integer)) - call lua_createtable(lua%ptr, 0, 4) + call lua_createtable(lua%ptr, 0, 5) ptr = lua_pushstring(lua%ptr, trim(request%responses(i)%name)) call lua_setfield(lua%ptr, -2, 'name') diff --git a/src/dm_lua_geocom.f90 b/src/dm_lua_geocom.f90 index 6a05f6b..b639d65 100644 --- a/src/dm_lua_geocom.f90 +++ b/src/dm_lua_geocom.f90 @@ -641,14 +641,14 @@ end function lua_geocom_delete integer(kind=c_int) function lua_geocom_do_measure(ptr) bind(c) result(n) type(c_ptr), intent(in), value :: ptr !! Lua state pointer. - integer :: inc_mode, prog + integer :: inc_mode, tmc_prog type(lua_state_type) :: lua type(request_type) :: request lua = lua_state_type(ptr) - prog = dm_geocom_api_parameter_tmc_measure_prg(dm_lua_to_int32(lua, 1)) + tmc_prog = dm_geocom_api_parameter_tmc_measure_prg(dm_lua_to_int32(lua, 1)) inc_mode = dm_geocom_api_parameter_tmc_incline_prg(dm_lua_to_int32(lua, 2)) - call dm_geocom_api_request_do_measure(request, prog, inc_mode) + call dm_geocom_api_request_do_measure(request, tmc_prog, inc_mode) call dm_lua_from(lua, request) n = 1 end function lua_geocom_do_measure @@ -802,9 +802,9 @@ integer(kind=c_int) function lua_geocom_get_coordinate(ptr) bind(c) result(n) type(request_type) :: request lua = lua_state_type(ptr) - inc_mode = dm_geocom_api_parameter_tmc_incline_prg(dm_lua_to_int32(lua, 1)) - wait_time = max(0, dm_lua_to_int32(lua, 2)) - call dm_geocom_api_request_get_coordinate(request, inc_mode, wait_time) + wait_time = max(0, dm_lua_to_int32(lua, 1)) + inc_mode = dm_geocom_api_parameter_tmc_incline_prg(dm_lua_to_int32(lua, 2)) + call dm_geocom_api_request_get_coordinate(request, wait_time, inc_mode) call dm_lua_from(lua, request) n = 1 end function lua_geocom_get_coordinate @@ -913,9 +913,9 @@ integer(kind=c_int) function lua_geocom_get_full_measurement(ptr) bind(c) result type(request_type) :: request lua = lua_state_type(ptr) - inc_mode = dm_geocom_api_parameter_tmc_incline_prg(dm_lua_to_int32(lua, 1)) - wait_time = max(0, dm_lua_to_int32(lua, 2)) - call dm_geocom_api_request_get_full_measurement(request, inc_mode, wait_time) + wait_time = max(0, dm_lua_to_int32(lua, 1)) + inc_mode = dm_geocom_api_parameter_tmc_incline_prg(dm_lua_to_int32(lua, 2)) + call dm_geocom_api_request_get_full_measurement(request, wait_time, inc_mode) call dm_lua_from(lua, request) n = 1 end function lua_geocom_get_full_measurement @@ -1196,9 +1196,9 @@ integer(kind=c_int) function lua_geocom_get_simple_coordinates(ptr) bind(c) resu type(request_type) :: request lua = lua_state_type(ptr) - inc_mode = dm_geocom_api_parameter_tmc_incline_prg(dm_lua_to_int32(lua, 1)) - wait_time = max(0, dm_lua_to_int32(lua, 2)) - call dm_geocom_api_request_get_simple_coordinates(request, inc_mode, wait_time) + wait_time = max(0, dm_lua_to_int32(lua, 1)) + inc_mode = dm_geocom_api_parameter_tmc_incline_prg(dm_lua_to_int32(lua, 2)) + call dm_geocom_api_request_get_simple_coordinates(request, wait_time, inc_mode) call dm_lua_from(lua, request) n = 1 end function lua_geocom_get_simple_coordinates @@ -1211,9 +1211,9 @@ integer(kind=c_int) function lua_geocom_get_simple_measurement(ptr) bind(c) resu type(request_type) :: request lua = lua_state_type(ptr) - inc_mode = dm_geocom_api_parameter_tmc_incline_prg(dm_lua_to_int32(lua, 1)) - wait_time = max(0, dm_lua_to_int32(lua, 2)) - call dm_geocom_api_request_get_simple_measurement(request, inc_mode, wait_time) + wait_time = max(0, dm_lua_to_int32(lua, 1)) + inc_mode = dm_geocom_api_parameter_tmc_incline_prg(dm_lua_to_int32(lua, 2)) + call dm_geocom_api_request_get_simple_measurement(request, wait_time, inc_mode) call dm_lua_from(lua, request) n = 1 end function lua_geocom_get_simple_measurement @@ -1675,7 +1675,7 @@ integer(kind=c_int) function lua_geocom_set_measurement_program(ptr) bind(c) res type(request_type) :: request lua = lua_state_type(ptr) - ! call dm_geocom_api_request_set_measurement_program(request, prog) + ! call dm_geocom_api_request_set_measurement_program(request, bap_prog) call dm_lua_from(lua, request) n = 1 end function lua_geocom_set_measurement_program diff --git a/src/dm_node.f90 b/src/dm_node.f90 index f26220d..3a0bdda 100644 --- a/src/dm_node.f90 +++ b/src/dm_node.f90 @@ -13,7 +13,7 @@ module dm_node type, public :: node_type !! Node type. - character(len=NODE_ID_LEN) :: id = ' ' !! Node id (`-0-9A-Za-z`). + character(len=NODE_ID_LEN) :: id = ' ' !! Node id (`-0-9A-Z_a-z`). character(len=NODE_NAME_LEN) :: name = ' ' !! Note name. character(len=NODE_META_LEN) :: meta = ' ' !! Additional description text (optional). real(kind=r8) :: x = 0.0_r8 !! Node x or easting (optional). diff --git a/src/dm_observ.f90 b/src/dm_observ.f90 index 692124d..b246368 100644 --- a/src/dm_observ.f90 +++ b/src/dm_observ.f90 @@ -32,21 +32,21 @@ module dm_observ !! Observation with receivers, requests, and responses. Modifying this !! type requires changes in `dm_csv`, `dm_db`, `dm_hdf5`, `dm_html`, !! `dm_json`, and several other modules (you probably don’t want that!). - character(len=OBSERV_ID_LEN) :: id = UUID_DEFAULT !! Observation id. - character(len=NODE_ID_LEN) :: node_id = ' ' !! Node id. - character(len=SENSOR_ID_LEN) :: sensor_id = ' ' !! Sensor id. - character(len=TARGET_ID_LEN) :: target_id = ' ' !! Target id. + character(len=OBSERV_ID_LEN) :: id = UUID_DEFAULT !! Observation id (UUID4). + character(len=NODE_ID_LEN) :: node_id = ' ' !! Node id (`-0-9A-Z_a-z`). + character(len=SENSOR_ID_LEN) :: sensor_id = ' ' !! Sensor id (`-0-9A-Z_a-z`). + character(len=TARGET_ID_LEN) :: target_id = ' ' !! Target id (`-0-9A-Z_a-z`). character(len=OBSERV_NAME_LEN) :: name = ' ' !! Observation name. - character(len=OBSERV_SOURCE_LEN) :: source = ' ' !! Observation source. character(len=TIME_LEN) :: timestamp = ' ' !! ISO 8601 timestamp. + character(len=OBSERV_SOURCE_LEN) :: source = ' ' !! Observation source (`-0-9A-Z_a-z`). character(len=OBSERV_PATH_LEN) :: path = ' ' !! TTY/PTY path. integer :: priority = 0 !! Message queue priority (>= 0). integer :: error = E_NONE !! Error code. integer :: next = 0 !! Next receiver index. integer :: nreceivers = 0 !! Number of receivers. integer :: nrequests = 0 !! Number of requests. - character(len=OBSERV_RECEIVER_LEN) :: receivers(OBSERV_MAX_NRECEIVERS) = ' ' !! Array of receivers. - type(request_type) :: requests(OBSERV_MAX_NREQUESTS) !! Array of requests. + character(len=OBSERV_RECEIVER_LEN) :: receivers(OBSERV_MAX_NRECEIVERS) = ' ' !! Array of receivers (`-0-9A-Z_a-z`). + type(request_type) :: requests(OBSERV_MAX_NREQUESTS) !! Array of requests. end type observ_type integer, parameter, public :: OBSERV_SIZE = storage_size(observ_type()) / 8 !! Size of `observ_type` in bytes. @@ -56,15 +56,16 @@ module dm_observ ! ****************************************************************** type, public :: observ_view_type !! View of an observation with only one response of a single request. - character(len=OBSERV_ID_LEN) :: observ_id = UUID_DEFAULT !! Observation id. - character(len=NODE_ID_LEN) :: node_id = ' ' !! Node id. - character(len=SENSOR_ID_LEN) :: sensor_id = ' ' !! Sensor id. - character(len=TARGET_ID_LEN) :: target_id = ' ' !! Target id. + character(len=OBSERV_ID_LEN) :: observ_id = UUID_DEFAULT !! Observation id (UUID4). + character(len=NODE_ID_LEN) :: node_id = ' ' !! Node id (`-0-9A-Z_a-z`). + character(len=SENSOR_ID_LEN) :: sensor_id = ' ' !! Sensor id (`-0-9A-Z_a-z`). + character(len=TARGET_ID_LEN) :: target_id = ' ' !! Target id (`-0-9A-Z_a-z`). character(len=OBSERV_NAME_LEN) :: observ_name = ' ' !! Observation name. integer :: observ_error = E_NONE !! Observation error code. + character(len=REQUEST_NAME_LEN) :: request_name = ' ' !! Request name (`-0-9A-Z_a-z`). character(len=TIME_LEN) :: request_timestamp = ' ' !! Request timestamp (ISO 8601). integer :: request_error = E_NONE !! Request error code. - character(len=RESPONSE_NAME_LEN) :: response_name = ' ' !! Response name. + character(len=RESPONSE_NAME_LEN) :: response_name = ' ' !! Response name (`-0-9A-Z_a-z`). character(len=RESPONSE_UNIT_LEN) :: response_unit = ' ' !! Response unit (optional). integer :: response_type = RESPONSE_TYPE_REAL64 !! Response value type. integer :: response_error = E_NONE !! Response error code. @@ -152,8 +153,8 @@ pure elemental logical function dm_observ_equals(observ1, observ2) result(equals if (observ1%sensor_id /= observ2%sensor_id) return if (observ1%target_id /= observ2%target_id) return if (observ1%name /= observ2%name) return - if (observ1%source /= observ2%source) return if (observ1%timestamp /= observ2%timestamp) return + if (observ1%source /= observ2%source) return if (observ1%path /= observ2%path) return if (observ1%priority /= observ2%priority) return if (observ1%error /= observ2%error) return @@ -252,14 +253,15 @@ pure elemental logical function dm_observ_valid(observ, id, timestamp) result(va end if if (.not. dm_id_valid(observ%name)) return - if (len_trim(observ%source) > 0) then - if (.not. dm_id_valid(observ%source)) return - end if if (timestamp_) then if (.not. dm_time_valid(observ%timestamp)) return end if + if (len_trim(observ%source) > 0) then + if (.not. dm_id_valid(observ%source)) return + end if + if (observ%priority < 0) return if (.not. dm_error_valid(observ%error)) return if (observ%next < 0 .or. observ%next > OBSERV_MAX_NRECEIVERS) return @@ -291,6 +293,7 @@ pure elemental logical function dm_observ_view_equals(view1, view2) result(equal if (view1%target_id /= view2%target_id) return if (view1%observ_name /= view2%observ_name) return if (view1%observ_error /= view2%observ_error) return + if (view1%request_name /= view2%request_name) return if (view1%request_timestamp /= view2%request_timestamp) return if (view1%request_error /= view2%request_error) return if (view1%response_name /= view2%response_name) return @@ -318,8 +321,8 @@ subroutine dm_observ_out(observ, unit) write (unit_, '("observ.sensor_id: ", a)') trim(observ%sensor_id) write (unit_, '("observ.target_id: ", a)') trim(observ%target_id) write (unit_, '("observ.name: ", a)') trim(observ%name) - write (unit_, '("observ.source: ", a)') trim(observ%source) write (unit_, '("observ.timestamp: ", a)') observ%timestamp + write (unit_, '("observ.source: ", a)') trim(observ%source) write (unit_, '("observ.path: ", a)') trim(observ%path) write (unit_, '("observ.priority: ", i0)') observ%priority write (unit_, '("observ.error: ", i0)') observ%error @@ -332,6 +335,7 @@ subroutine dm_observ_out(observ, unit) end do do i = 1, observ%nrequests + write (unit_, '("observ.requests(", i0, ").name: ", a)') i, trim(observ%requests(i)%name) write (unit_, '("observ.requests(", i0, ").timestamp: ", a)') i, trim(observ%requests(i)%timestamp) write (unit_, '("observ.requests(", i0, ").request: ", a)') i, trim(observ%requests(i)%request) write (unit_, '("observ.requests(", i0, ").response: ", a)') i, trim(observ%requests(i)%response) diff --git a/src/dm_request.f90 b/src/dm_request.f90 index 081befb..477dcfe 100644 --- a/src/dm_request.f90 +++ b/src/dm_request.f90 @@ -12,24 +12,28 @@ module dm_request implicit none (type, external) private - integer, parameter, public :: REQUEST_REQUEST_LEN = 256 !! Request string length. - integer, parameter, public :: REQUEST_RESPONSE_LEN = 256 !! Response string length. + integer, parameter, public :: REQUEST_NAME_LEN = 32 !! Request name length. + integer, parameter, public :: REQUEST_REQUEST_LEN = 256 !! Raw request string length. + integer, parameter, public :: REQUEST_RESPONSE_LEN = 256 !! Raw response string length. integer, parameter, public :: REQUEST_DELIMITER_LEN = 8 !! Delimiter string length. integer, parameter, public :: REQUEST_PATTERN_LEN = 256 !! Regular expression string length. integer, parameter, public :: REQUEST_MAX_NRESPONSES = 16 !! Response array size. + ! Request modes. integer, parameter, public :: REQUEST_MODE_NONE = 0 !! Default mode. integer, parameter, public :: REQUEST_MODE_GEOCOM_FILE = 512 !! GeoCOM file download mode. + ! Request states. integer, parameter, public :: REQUEST_STATE_NONE = 0 !! Default state. integer, parameter, public :: REQUEST_STATE_DISABLED = 1 !! Disabled state. type, public :: request_type !! Request to send to a sensor. - character(len=TIME_LEN) :: timestamp = ' ' !! ISO 8601 timestamp. - character(len=REQUEST_REQUEST_LEN) :: request = ' ' !! Request command. - character(len=REQUEST_RESPONSE_LEN) :: response = ' ' !! Raw response. - character(len=REQUEST_DELIMITER_LEN) :: delimiter = ' ' !! Response delimiter. + character(len=REQUEST_NAME_LEN) :: name = ' ' !! Request name (`-0-9A-Z_a-z`). + character(len=TIME_LEN) :: timestamp = ' ' !! ISO 8601 time stamp. + character(len=REQUEST_REQUEST_LEN) :: request = ' ' !! Raw request command (printable). + character(len=REQUEST_RESPONSE_LEN) :: response = ' ' !! Raw response (printable). + character(len=REQUEST_DELIMITER_LEN) :: delimiter = ' ' !! Response delimiter (printable). character(len=REQUEST_PATTERN_LEN) :: pattern = ' ' !! Regular expression pattern. integer :: delay = 0 !! Delay in msec (optional). integer :: error = E_NONE !! Error code. @@ -122,6 +126,7 @@ pure elemental logical function dm_request_equals(request1, request2) result(equ equals = .false. + if (request1%name /= request2%name) return if (request1%timestamp /= request2%timestamp) return if (request1%request /= request2%request) return if (request1%response /= request2%response) return @@ -200,6 +205,7 @@ pure elemental logical function dm_request_valid(request, timestamp) result(vali !! Returns `.true.` if given observation request is valid. A request is !! valid if it conforms to the following rules: !! + !! * A request name is set and a valid id. !! * A time stamp is set and in ISO 8601 format, unless argument !! `timestamp` is passed and `.false.`. !! * All ASCII characters in attribute _request_ are printable. @@ -219,6 +225,8 @@ pure elemental logical function dm_request_valid(request, timestamp) result(vali timestamp_ = .true. if (present(timestamp)) timestamp_ = timestamp + if (.not. dm_id_valid(request%name)) return + if (timestamp_) then if (.not. dm_time_valid(request%timestamp)) return end if @@ -250,6 +258,7 @@ subroutine dm_request_out(request, unit) unit_ = stdout if (present(unit)) unit_ = unit + write (unit_, '("request.name: ", a)') trim(request%name) write (unit_, '("request.timestamp: ", a)') trim(request%timestamp) write (unit_, '("request.request: ", a)') trim(request%request) write (unit_, '("request.response: ", a)') trim(request%response) diff --git a/src/dm_response.f90 b/src/dm_response.f90 index b432ea7..a00d5e6 100644 --- a/src/dm_response.f90 +++ b/src/dm_response.f90 @@ -12,6 +12,7 @@ module dm_response integer, parameter, public :: RESPONSE_NAME_LEN = 8 !! Max. response name length. integer, parameter, public :: RESPONSE_UNIT_LEN = 8 !! Max. response unit length. + ! Response types. integer, parameter, public :: RESPONSE_TYPE_REAL64 = 0 !! 8-byte signed real. integer, parameter, public :: RESPONSE_TYPE_REAL32 = 1 !! 4-byte signed real. integer, parameter, public :: RESPONSE_TYPE_INT64 = 2 !! 8-byte signed integer. @@ -26,7 +27,7 @@ module dm_response type, public :: response_type !! Response of a sensor. - character(len=RESPONSE_NAME_LEN) :: name = ' ' !! Response name. + character(len=RESPONSE_NAME_LEN) :: name = ' ' !! Response name (`-0-9A-Z_a-z`). character(len=RESPONSE_UNIT_LEN) :: unit = ' ' !! Response unit. integer :: type = RESPONSE_TYPE_REAL64 !! Response value type. integer :: error = E_NONE !! Response error. diff --git a/src/dm_sensor.f90 b/src/dm_sensor.f90 index 2cb69b6..442e4a1 100644 --- a/src/dm_sensor.f90 +++ b/src/dm_sensor.f90 @@ -13,6 +13,7 @@ module dm_sensor integer, parameter, public :: SENSOR_SN_LEN = 32 integer, parameter, public :: SENSOR_META_LEN = 32 + ! Sensor types. integer, parameter, public :: SENSOR_TYPE_NONE = 0 !! Unknown sensor type. integer, parameter, public :: SENSOR_TYPE_VIRTUAL = 1 !! Virtual sensor. integer, parameter, public :: SENSOR_TYPE_FS = 2 !! File system. @@ -33,7 +34,7 @@ module dm_sensor type, public :: sensor_type !! Sensor description. - character(len=SENSOR_ID_LEN) :: id = ' ' !! Sensor id (-0-9A-Za-z). + character(len=SENSOR_ID_LEN) :: id = ' ' !! Sensor id (`-0-9A-Z_a-z`). character(len=NODE_ID_LEN) :: node_id = ' ' !! Associated sensor node. integer :: type = SENSOR_TYPE_NONE !! Sensor type. character(len=SENSOR_NAME_LEN) :: name = ' ' !! Sensor name. diff --git a/src/dm_sql.f90 b/src/dm_sql.f90 index 8061a28..1ac18ab 100644 --- a/src/dm_sql.f90 +++ b/src/dm_sql.f90 @@ -125,8 +125,8 @@ module dm_sql 'target_id INTEGER NOT NULL,' // NL // & 'id TEXT NOT NULL UNIQUE,' // NL // & 'name TEXT NOT NULL,' // NL // & - 'source TEXT,' // NL // & 'timestamp TEXT NOT NULL DEFAULT (strftime(''%FT%R:%f000+00:00'')),' // NL // & + 'source TEXT,' // NL // & 'path TEXT,' // NL // & 'priority INTEGER NOT NULL DEFAULT 0,' // NL // & 'error INTEGER NOT NULL DEFAULT 0,' // NL // & @@ -153,11 +153,12 @@ module dm_sql 'request_id INTEGER PRIMARY KEY,' // NL // & 'observ_id INTEGER NOT NULL,' // NL // & 'idx INTEGER NOT NULL,' // NL // & + 'name TEXT NOT NULL,' // NL // & + 'timestamp TEXT NOT NULL DEFAULT (strftime(''%FT%R:%f000+00:00'')),' // NL // & 'request TEXT,' // NL // & 'response TEXT,' // NL // & 'delimiter TEXT,' // NL // & 'pattern TEXT,' // NL // & - 'timestamp TEXT,' // NL // & 'delay INTEGER NOT NULL DEFAULT 0,' // NL // & 'error INTEGER NOT NULL DEFAULT 0,' // NL // & 'mode INTEGER NOT NULL DEFAULT 0,' // NL // & @@ -253,14 +254,15 @@ module dm_sql 'CREATE INDEX IF NOT EXISTS idx_source ON logs(source)' & ] - character(len=*), parameter, public :: SQL_CREATE_OBSERVS_INDICES(11) = [ character(len=128) :: & + character(len=*), parameter, public :: SQL_CREATE_OBSERVS_INDICES(12) = [ character(len=128) :: & 'CREATE INDEX IF NOT EXISTS idx_nodes_id ON nodes(id)', & 'CREATE INDEX IF NOT EXISTS idx_sensors_id ON sensors(id)', & 'CREATE INDEX IF NOT EXISTS idx_targets_id ON targets(id)', & - 'CREATE INDEX IF NOT EXISTS idx_observs ON observs(timestamp, name, error)', & + 'CREATE INDEX IF NOT EXISTS idx_observs ON observs(name, timestamp, error)', & 'CREATE INDEX IF NOT EXISTS idx_observs_timestamp ON observs(timestamp)', & 'CREATE INDEX IF NOT EXISTS idx_receivers_idx ON receivers(idx)', & 'CREATE INDEX IF NOT EXISTS idx_requests_idx ON requests(idx)', & + 'CREATE INDEX IF NOT EXISTS idx_requests_name ON requests(name)', & 'CREATE INDEX IF NOT EXISTS idx_requests_timestamp ON requests(timestamp)', & 'CREATE INDEX IF NOT EXISTS idx_responses ON responses(request_id, idx, name, unit, type, error, value)', & 'CREATE INDEX IF NOT EXISTS idx_responses_request_id ON responses(request_id)', & @@ -396,11 +398,11 @@ module dm_sql ! Query to insert observation. ! Arguments: nodes.id, sensors.id, targets.id, observs.id, observs.name, - ! observs.source, observs.timestamp, observs.path, observs.priority, + ! observs.timestamp, observs.source, observs.path, observs.priority, ! observs.error, observs.next, observs.nreceivers, observs.nrequests character(len=*), parameter, public :: SQL_INSERT_OBSERV = & 'INSERT OR FAIL INTO observs ' // & - '(id, node_id, sensor_id, target_id, name, source, timestamp, path, ' // & + '(id, node_id, sensor_id, target_id, name, timestamp, source, path, ' // & 'priority, error, next, nreceivers, nrequests) ' // & 'VALUES (' // & '?, ' // & @@ -416,14 +418,15 @@ module dm_sql '(SELECT observ_id FROM observs WHERE id = ?), ?, ?)' ! Query to insert request. - ! Arguments: observs.id, requests.idx, requests.request, requests.response, - ! requests.delimiter, requests.pattern, requests.delay, - ! requests.error, requests.mode, requests.retries, requests.state, - ! requests.timeout, requests.nresponses + ! Arguments: observs.id, requests.idx, requests.name, requests.timestamp, + ! requests.request, requests.response, requests.delimiter, + ! requests.pattern, requests.delay, requests.error, requests.mode, + ! requests.retries, requests.state, requests.timeout, + ! requests.nresponses character(len=*), parameter, public :: SQL_INSERT_REQUEST = & - 'INSERT OR FAIL INTO requests(observ_id, idx, request, response, delimiter, ' // & - 'pattern, timestamp, delay, error, mode, retries, state, timeout, nresponses) VALUES (' // & - '(SELECT observ_id FROM observs WHERE id = ?), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' + 'INSERT OR FAIL INTO requests(observ_id, idx, name, timestamp, request, response, ' // & + 'delimiter, pattern, delay, error, mode, retries, state, timeout, nresponses) VALUES (' // & + '(SELECT observ_id FROM observs WHERE id = ?), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' ! Query to insert response that references observation, request index. ! Arguments: responses.request_id, responses.idx, responses.name, @@ -668,8 +671,8 @@ module dm_sql 'sensors.id, ' // & 'targets.id, ' // & 'observs.name, ' // & - 'observs.source, ' // & 'observs.timestamp, ' // & + 'observs.source, ' // & 'observs.path, ' // & 'observs.priority, ' // & 'observs.error, ' // & @@ -699,8 +702,8 @@ module dm_sql 'sensors.id, ' // & 'targets.id, ' // & 'observs.name, ' // & - 'observs.source, ' // & 'observs.timestamp, ' // & + 'observs.source, ' // & 'observs.path, ' // & 'observs.priority, ' // & 'observs.error, ' // & @@ -740,6 +743,7 @@ module dm_sql 'targets.id, ' // & 'observs.name, ' // & 'observs.error, ' // & + 'requests.name, ' // & 'requests.timestamp, ' // & 'requests.error, ' // & 'responses.name, ' // & @@ -780,11 +784,12 @@ module dm_sql ! Arguments: observs.id, requests.idx character(len=*), parameter, public :: SQL_SELECT_REQUEST = & 'SELECT ' // & + 'requests.name, ' // & + 'requests.timestamp, ' // & 'requests.request, ' // & 'requests.response, ' // & 'requests.delimiter, ' // & 'requests.pattern, ' // & - 'requests.timestamp, ' // & 'requests.delay, ' // & 'requests.error, ' // & 'requests.mode, ' // & @@ -800,11 +805,12 @@ module dm_sql ! Arguments: observs.id character(len=*), parameter, public :: SQL_SELECT_REQUESTS = & 'SELECT ' // & + 'requests.name, ' // & + 'requests.timestamp, ' // & 'requests.request, ' // & 'requests.response, ' // & 'requests.delimiter, ' // & 'requests.pattern, ' // & - 'requests.timestamp, ' // & 'requests.delay, ' // & 'requests.error, ' // & 'requests.mode, ' // & diff --git a/src/dm_sync.f90 b/src/dm_sync.f90 index 5ba1f8e..07580b5 100644 --- a/src/dm_sync.f90 +++ b/src/dm_sync.f90 @@ -12,6 +12,7 @@ module dm_sync integer, parameter, public :: SYNC_ID_LEN = UUID_LEN !! Synchronisation id length (must equal UUID4 length). + ! Synchronisation types. integer, parameter, public :: SYNC_TYPE_NONE = 0 !! No type (invalid). integer, parameter, public :: SYNC_TYPE_NODE = 1 !! Node. integer, parameter, public :: SYNC_TYPE_SENSOR = 2 !! Sensor. diff --git a/src/dm_target.f90 b/src/dm_target.f90 index 1f2d147..60a1f9b 100644 --- a/src/dm_target.f90 +++ b/src/dm_target.f90 @@ -12,6 +12,7 @@ module dm_target integer, parameter, public :: TARGET_NAME_LEN = 32 integer, parameter, public :: TARGET_META_LEN = 32 + ! Target states. integer, parameter, public :: TARGET_STATE_NONE = 0 !! Default state. integer, parameter, public :: TARGET_STATE_REMOVED = 1 !! Target was removed. integer, parameter, public :: TARGET_STATE_MISSING = 2 !! Target is missing. @@ -29,7 +30,7 @@ module dm_target type, public :: target_type !! Target description. - character(len=TARGET_ID_LEN) :: id = ' ' !! Target id (`-0-9A-Za-z`). + character(len=TARGET_ID_LEN) :: id = ' ' !! Target id (`-0-9A-Z_a-z`). character(len=TARGET_NAME_LEN) :: name = ' ' !! Target name. character(len=TARGET_META_LEN) :: meta = ' ' !! Target meta information (optional). integer :: state = TARGET_STATE_NONE !! Target state (optional). diff --git a/src/dm_test.f90 b/src/dm_test.f90 index 4c4a7a5..71a093e 100644 --- a/src/dm_test.f90 +++ b/src/dm_test.f90 @@ -144,19 +144,19 @@ pure elemental subroutine dm_test_dummy_node(node, id, name) end subroutine dm_test_dummy_node impure elemental subroutine dm_test_dummy_observ(observ, id, node_id, sensor_id, target_id, & - name, timestamp, nrequests, value) + name, timestamp, nrequests, response_value) !! Generates dummy observation data type. use :: dm_observ use :: dm_request - type(observ_type), intent(out) :: observ !! Observation type. - character(len=*), intent(in), optional :: id !! Observation id. - character(len=*), intent(in), optional :: node_id !! Node id. - character(len=*), intent(in), optional :: sensor_id !! Sensor id. - character(len=*), intent(in), optional :: target_id !! Target id. - character(len=*), intent(in), optional :: name !! Observation name. - character(len=*), intent(in), optional :: timestamp !! Observation and request timestamp (ISO 8601). - integer, intent(in), optional :: nrequests !! Number of requests. - real(kind=r8), intent(in), optional :: value !! Response value. + type(observ_type), intent(out) :: observ !! Observation type. + character(len=*), intent(in), optional :: id !! Observation id. + character(len=*), intent(in), optional :: node_id !! Node id. + character(len=*), intent(in), optional :: sensor_id !! Sensor id. + character(len=*), intent(in), optional :: target_id !! Target id. + character(len=*), intent(in), optional :: name !! Observation name. + character(len=*), intent(in), optional :: timestamp !! Observation and request timestamp (ISO 8601). + integer, intent(in), optional :: nrequests !! Number of requests. + real(kind=r8), intent(in), optional :: response_value !! Response value. integer :: i, n, rc type(request_type) :: request @@ -166,8 +166,8 @@ impure elemental subroutine dm_test_dummy_observ(observ, id, node_id, sensor_id, observ%sensor_id = 'dummy-sensor' observ%target_id = 'dummy-target' observ%name = 'dummy-observ' - observ%source = 'dmdummy' observ%timestamp = dm_time_now() + observ%source = 'dmdummy' observ%path = '/dev/null' if (present(id)) observ%id = id @@ -185,31 +185,37 @@ impure elemental subroutine dm_test_dummy_observ(observ, id, node_id, sensor_id, if (present(nrequests)) n = nrequests do i = 1, n - if (present(value)) then - call dm_test_dummy_request(request, observ%timestamp, name='dummy-' // dm_itoa(i), value=value) + if (present(response_value)) then + call dm_test_dummy_request(request, 'dummy-' // dm_itoa(i), observ%timestamp, & + response_name='dummy-' // dm_itoa(i), & + response_value=response_value) else - call dm_test_dummy_request(request, observ%timestamp, nresponses=REQUEST_MAX_NRESPONSES) + call dm_test_dummy_request(request, 'dummy-' // dm_itoa(i), observ%timestamp, & + nresponses=REQUEST_MAX_NRESPONSES) end if rc = dm_observ_add_request(observ, request) end do end subroutine dm_test_dummy_observ - impure elemental subroutine dm_test_dummy_request(request, timestamp, nresponses, name, value) + impure elemental subroutine dm_test_dummy_request(request, name, timestamp, nresponses, & + response_name, response_value) !! Generates dummy request data type. use :: dm_request use :: dm_response - type(request_type), intent(out) :: request !! Request type. - character(len=*), intent(in), optional :: timestamp !! Request timestamp (ISO 8601). - integer, intent(in), optional :: nresponses !! Number of responses. - character(len=*), intent(in), optional :: name !! Response name. - real(kind=r8), intent(in), optional :: value !! Response value. + type(request_type), intent(out) :: request !! Request type. + character(len=*), intent(in), optional :: name !! Request name. + character(len=*), intent(in), optional :: timestamp !! Request timestamp (ISO 8601). + integer, intent(in), optional :: nresponses !! Number of responses. + character(len=*), intent(in), optional :: response_name !! Response name. + real(kind=r8), intent(in), optional :: response_value !! Response value. integer :: i, n, rc type(response_type) :: response n = 1 - request = request_type(timestamp = dm_time_now(), & + request = request_type(name = 'dummy-request', & + timestamp = dm_time_now(), & request = 'dummy', & response = dm_ascii_escape('999.99' // ASCII_CR // ASCII_LF), & delimiter = dm_ascii_escape(ASCII_CR // ASCII_LF), & @@ -219,13 +225,14 @@ impure elemental subroutine dm_test_dummy_request(request, timestamp, nresponses timeout = 500, & error = 0) - if (present(timestamp)) request%timestamp = timestamp + if (present(name)) request%name = name + if (present(timestamp)) request%timestamp = timestamp if (present(nresponses)) n = max(0, min(REQUEST_MAX_NRESPONSES, nresponses)) do i = 1, n response = response_type('dummy-' // dm_itoa(i), 'none', RESPONSE_TYPE_REAL64, E_NONE, 999.99_r8) - if (present(name)) response%name = name - if (present(value)) response%value = value + if (present(response_name)) response%name = response_name + if (present(response_value)) response%value = response_value rc = dm_request_add(request, response) end do end subroutine dm_test_dummy_request diff --git a/src/dm_uuid.f90 b/src/dm_uuid.f90 index 27029bb..10c8604 100644 --- a/src/dm_uuid.f90 +++ b/src/dm_uuid.f90 @@ -7,7 +7,7 @@ module dm_uuid private integer, parameter, public :: UUID_LEN = 32 !! Hex UUID4 length. - integer, parameter, public :: UUID_FULL_LEN = 36 !! Full UUID4 length. + integer, parameter, public :: UUID_FULL_LEN = 36 !! Full UUID4 length (with hypens). character(len=*), parameter, public :: UUID_DEFAULT = repeat('0', UUID_LEN) !! Default ID (hex). character(len=*), parameter :: UUID_SET = '0123456789abcdef' @@ -23,8 +23,8 @@ impure elemental function dm_uuid4() result(uuid) !! before the first invocation by calling `dm_init()` once. character(len=UUID_LEN) :: uuid - integer :: b(32), i, j - real :: r(32) + integer :: b(UUID_LEN), i, j + real :: r(UUID_LEN) call random_number(r) diff --git a/test/dmtestcsv.f90 b/test/dmtestcsv.f90 index 8b90569..cffad83 100644 --- a/test/dmtestcsv.f90 +++ b/test/dmtestcsv.f90 @@ -221,8 +221,8 @@ logical function test05() result(stat) integer, parameter :: LEN_DP = 4 !! Data points header length. integer, parameter :: LEN_LOG = 71 !! Logs header length. integer, parameter :: LEN_NODE = 19 !! Nodes header length. - integer, parameter :: LEN_OBSERV = 21961 !! Observations header length. - integer, parameter :: LEN_VIEW = 167 !! Observation views header length. + integer, parameter :: LEN_OBSERV = 22097 !! Observations header length. + integer, parameter :: LEN_VIEW = 180 !! Observation views header length. integer, parameter :: LEN_SENSOR = 35 !! Sensors header length. integer, parameter :: LEN_TARGET = 25 !! Targets header length. @@ -235,56 +235,56 @@ logical function test05() result(stat) print *, '-- beat' n = len(dm_csv_header_beat()) if (n /= LEN_BEAT) then - print '(" Error: expected " i0, ", got ", i0)', LEN_BEAT, n + print '(" Error: expected ", i0, ", got ", i0)', LEN_BEAT, n return end if print *, '-- data point' n = len(dm_csv_header_data_point()) if (n /= LEN_DP) then - print '(" Error: expected " i0, ", got ", i0)', LEN_DP, n + print '(" Error: expected ", i0, ", got ", i0)', LEN_DP, n return end if print *, '-- log' n = len(dm_csv_header_log()) if (n /= LEN_LOG) then - print '(" Error: expected " i0, ", got ", i0)', LEN_LOG, n + print '(" Error: expected ", i0, ", got ", i0)', LEN_LOG, n return end if print *, '-- node' n = len(dm_csv_header_node()) if (n /= LEN_NODE) then - print '(" Error: expected " i0, ", got ", i0)', LEN_NODE, n + print '(" Error: expected ", i0, ", got ", i0)', LEN_NODE, n return end if print *, '-- observ' n = len(dm_csv_header_observ()) if (n /= LEN_OBSERV) then - print '(" Error: expected " i0, ", got ", i0)', LEN_OBSERV, n + print '(" Error: expected ", i0, ", got ", i0)', LEN_OBSERV, n return end if print *, '-- observ_view' n = len(dm_csv_header_observ_view()) if (n /= LEN_VIEW) then - print '(" Error: expected " i0, ", got ", i0)', LEN_VIEW, n + print '(" Error: expected ", i0, ", got ", i0)', LEN_VIEW, n return end if print *, '-- sensor' n = len(dm_csv_header_sensor()) if (n /= LEN_SENSOR) then - print '(" Error: expected " i0, ", got ", i0)', LEN_SENSOR, n + print '(" Error: expected ", i0, ", got ", i0)', LEN_SENSOR, n return end if print *, '-- target' n = len(dm_csv_header_target()) if (n /= LEN_TARGET) then - print '(" Error: expected " i0, ", got ", i0)', LEN_TARGET, n + print '(" Error: expected ", i0, ", got ", i0)', LEN_TARGET, n return end if diff --git a/test/dmtestdb.f90 b/test/dmtestdb.f90 index 29d011d..4b96e7c 100644 --- a/test/dmtestdb.f90 +++ b/test/dmtestdb.f90 @@ -441,7 +441,7 @@ logical function test06() result(stat) minute = int(r(3) * 60), & second = int(r(4) * 60), & usecond = int(r(5) * 1000)) - call dm_test_dummy(observs1(i), timestamp=timestamp, value=sin(r(6) * PI)) + call dm_test_dummy(observs1(i), timestamp=timestamp, response_value=sin(r(6) * PI)) end do observs2 = observs1 @@ -526,7 +526,7 @@ logical function test07() result(stat) minute = int(r(2) * 60), & second = int(r(3) * 60), & usecond = int(r(4) * 1000)) - call dm_test_dummy(observs1(i), timestamp=timestamp, value=sin(r(5) * PI)) + call dm_test_dummy(observs1(i), timestamp=timestamp, response_value=sin(r(5) * PI)) end do print *, 'Opening database "' // DB_OBSERV // '" ...' diff --git a/test/dmtestid.f90 b/test/dmtestid.f90 new file mode 100644 index 0000000..d951204 --- /dev/null +++ b/test/dmtestid.f90 @@ -0,0 +1,35 @@ +! dmtestid.f90 +! +! Author: Philipp Engel +! Licence: ISC +program dmtestid + !! Test program for id validation. + use :: dmpack + implicit none (type, external) + integer, parameter :: NTESTS = 1 + + type(test_type) :: tests(NTESTS) + logical :: stats(NTESTS) + + tests(1) = test_type('dmtestid.test01', test01) + + call dm_init() + call dm_test_run(tests, stats, dm_env_has('NO_COLOR')) +contains + logical function test01() result(stat) + stat = TEST_FAILED + + print *, 'Testing id validation ...' + + if (.not. dm_id_valid('foo_bar-12345')) return + if (.not. dm_id_valid('2c62c1d467a843ac8cfed34f2152f63c')) return + + if (dm_id_valid('')) return + if (dm_id_valid(repeat('a', ID_LEN + 1))) return + if (dm_id_valid(repeat('a', 9), max_len=8)) return + if (dm_id_valid('foo?bar')) return + if (dm_id_valid(' foo_bar-12345')) return + + stat = TEST_PASSED + end function test01 +end program dmtestid diff --git a/test/dmtestjson.f90 b/test/dmtestjson.f90 index 7037ef9..9118cee 100644 --- a/test/dmtestjson.f90 +++ b/test/dmtestjson.f90 @@ -163,16 +163,17 @@ end function test06 logical function test07() result(stat) character(len=*), parameter :: JSON = & '{ "id": "9273ab62f9a349b6a4da6dd274ee83e7", "node_id": "dummy-node", "sensor_id": "dummy-sensor", ' // & - '"target_id": "dummy-target", "name": "dummy-observ", "source": "dmdummy", "timestamp": ' // & - '"1970-01-01T00:00:00.000000+00:00", "path": "/dev/null", "priority": 0, "error": 0, "next": 0, ' // & - '"nreceivers": 3, "nrequests": 2, "receivers": [ "dummy-receiver1", "dummy-receiver2", "dummy-receiver3" ], ' // & - '"requests": [ { "timestamp": "1970-01-01T00:00:00.000000+00:00", "request": "A", "response": ' // & - '"123.45\\r\\n", "delimiter": "\\r\\n", "pattern": "^(.*)$", "delay": 1000, "error": 0, "mode": 0, ' // & - '"retries": 0, "state": 0, "timeout": 500, "nresponses": 1, "responses": [ { "name": "a", "unit": "none", ' // & - '"type": 0, "error": 0, "value": 123.450000000 } ] }, { "timestamp": "1970-01-01T00:00:00.000000+00:00", ' // & - '"request": "B", "response": "OK\\r\\n", "delimiter": "\\r\\n", "pattern": "^OK", "delay": 500, ' // & - '"error": 1, "mode": 0, "retries": 0, "state": 0, "timeout": 500, "nresponses": 1, "responses": ' // & - '[ { "name": "b", "unit": "none", "type": 0, "error": 0, "value": 0.990000000000 } ] } ] }' + '"target_id": "dummy-target", "name": "dummy-observ", "timestamp": "1970-01-01T00:00:00.000000+00:00", ' // & + '"source": "dmdummy", "path": "/dev/null", "priority": 0, "error": 0, "next": 0, "nreceivers": 3, ' // & + '"nrequests": 2, "receivers": [ "dummy-receiver1", "dummy-receiver2", "dummy-receiver3" ], ' // & + '"requests": [ { "name": "dummy-1", "timestamp": "1970-01-01T00:00:00.000000+00:00", "request": "A", ' // & + '"response": "123.45\\r\\n", "delimiter": "\\r\\n", "pattern": "^(.*)$", "delay": 1000, "error": 0, ' // & + '"mode": 0, "retries": 0, "state": 0, "timeout": 500, "nresponses": 1, "responses": [ { "name": "a", ' // & + '"unit": "none", "type": 0, "error": 0, "value": 123.450000000 } ] }, { "name": "dummy-2", ' // & + '"timestamp": "1970-01-01T00:00:00.000000+00:00", "request": "B", "response": "OK\\r\\n", "delimiter": ' // & + '"\\r\\n", "pattern": "^OK", "delay": 500, "error": 1, "mode": 0, "retries": 0, "state": 0, ' // & + '"timeout": 500, "nresponses": 1, "responses": [ { "name": "b", "unit": "none", "type": 0, "error": 0, ' // & + '"value": 0.990000000000 } ] } ] }' character(len=:), allocatable :: buf integer :: rc @@ -190,8 +191,8 @@ logical function test07() result(stat) observ%sensor_id = 'dummy-sensor' observ%target_id = 'dummy-target' observ%name = 'dummy-observ' - observ%source = 'dmdummy' observ%timestamp = TIME_DEFAULT + observ%source = 'dmdummy' observ%path = '/dev/null' print *, 'Adding receivers ...' @@ -205,7 +206,8 @@ logical function test07() result(stat) if (dm_is_error(rc)) return print *, 'Creating request ...' - request = request_type(timestamp = TIME_DEFAULT, & + request = request_type(name = 'dummy-1', & + timestamp = TIME_DEFAULT, & request = 'A', & response = dm_ascii_escape('123.45' // ASCII_CR // ASCII_LF), & delimiter = dm_ascii_escape(ASCII_CR // ASCII_LF), & @@ -225,7 +227,8 @@ logical function test07() result(stat) if (dm_is_error(rc)) return print *, 'Creating request ...' - request = request_type(timestamp = TIME_DEFAULT, & + request = request_type(name = 'dummy-2', & + timestamp = TIME_DEFAULT, & request = 'B', & response = dm_ascii_escape('OK' // CR_LF), & delimiter = dm_ascii_escape(ASCII_CR // ASCII_LF), & diff --git a/test/dmtestobserv.f90 b/test/dmtestobserv.f90 index a725195..7d301de 100644 --- a/test/dmtestobserv.f90 +++ b/test/dmtestobserv.f90 @@ -7,13 +7,16 @@ program dmtestobserv !! handling, use :: dmpack implicit none (type, external) - integer, parameter :: NTESTS = 2 + integer, parameter :: NTESTS = 3 type(test_type) :: tests(NTESTS) logical :: stats(NTESTS) - tests(1) = test_type('dmtestobserv.test01', test01) - tests(2) = test_type('dmtestobserv.test02', test02) + tests = [ & + test_type('dmtestobserv.test01', test01), & + test_type('dmtestobserv.test02', test02), & + test_type('dmtestobserv.test03', test03) & + ] call dm_init() call dm_test_run(tests, stats, dm_env_has('NO_COLOR')) @@ -33,8 +36,9 @@ logical function test01() result(stat) observ1%sensor_id = 'dummy-sensor' observ1%target_id = 'dummy-target' observ1%name = 'dummy-observ' - observ1%path = '/dev/null' observ1%timestamp = TIME_DEFAULT + observ1%source = 'dmtestobserv' + observ1%path = '/dev/null' print *, 'Adding receivers ...' rc = dm_observ_add_receiver(observ1, 'dummy-receiver1') @@ -47,7 +51,8 @@ logical function test01() result(stat) if (dm_is_error(rc)) return print *, 'Creating request ...' - request = request_type(timestamp = TIME_DEFAULT, & + request = request_type(name = 'dummy-1', & + timestamp = TIME_DEFAULT, & request = 'A', & response = dm_ascii_escape('123.45' // ASCII_CR // ASCII_LF), & delimiter = dm_ascii_escape(ASCII_CR // ASCII_LF), & @@ -67,7 +72,8 @@ logical function test01() result(stat) if (dm_is_error(rc)) return print *, 'Creating request ...' - request = request_type(timestamp = TIME_DEFAULT, & + request = request_type(name = 'dummy-2', & + timestamp = TIME_DEFAULT, & request = 'B', & response = dm_ascii_escape('OK' // CR_LF), & delimiter = dm_ascii_escape(ASCII_CR // ASCII_LF), & @@ -147,5 +153,10 @@ logical function test02() result(stat) stat = TEST_PASSED end function test02 -end program dmtestobserv + logical function test03() result(stat) + stat = TEST_PASSED + + print '(" Observation size: ", i0)', OBSERV_SIZE + end function test03 +end program dmtestobserv diff --git a/test/test.lua b/test/test.lua index 2f48d96..5df2feb 100644 --- a/test/test.lua +++ b/test/test.lua @@ -17,6 +17,7 @@ observ = { id = "00fbf0570bc54ac88041f4db64e38397", name = "lua-observ", timestamp = "1970-01-01T00:00:00.000+00:00", + source = "dmlua", tty = "/dev/ttyU0", priority = 1, error = 1, @@ -26,6 +27,7 @@ observ = { receivers = { "dmdb" }, requests = { { + name = "dummy-1", timestamp = "1970-01-01T00:00:00.000+00:00", request = "?", response = "123\\r\\n",