Skip to content

Commit 165783b

Browse files
authored
Merge branch 'main' into feature/serial-transfer
2 parents 9f72b37 + da6a36e commit 165783b

File tree

17 files changed

+852
-2
lines changed

17 files changed

+852
-2
lines changed

docs/commands/files/list.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ separators (contrary to other Windows conventions) and should end with a ``/``.
2424
If a special type of file is to be listed (e.g. database), then it is enough
2525
to specify the file type, the path can be left out.
2626

27+
.. note::
28+
29+
On newer instruments giving just the directory path might not be enough
30+
to list all files in the directory. It may be necessary to give the path
31+
in a glob-like pattern, with wildcards for the filenames (e.g. to to list
32+
all files in the Data folder, the path would be ``Data/*.*``)
33+
2734
Examples
2835
--------
2936

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
Downloading
2+
===========
3+
4+
The settings are saved by iterating over a set collection of parameter names.
5+
Any particular instrument might not respond to the query of any of the
6+
parameters (e.g. a total station will not respond to queries regarding the
7+
digital level settings). These settings are marked empty, and later cleaned up
8+
before the config file is saved to disk.
9+
10+
It is possible to save the default values for the parameters, that the
11+
instrument did not respond to. In this case, the config file might need to be
12+
manually cleaned of the irrelevant or unwanted settings.
13+
14+
Examples
15+
--------
16+
17+
.. code-block:: shell
18+
:caption: Saving only applicable GeoCom settings
19+
20+
iman download settings COM1 geocom tps_settings.json
21+
22+
.. code-block:: shell
23+
:caption: Saving to YAML format in a file without extension
24+
25+
iman download settings -f yaml COM1 geocom tps_settings
26+
27+
.. code-block:: shell
28+
:caption: Saving all settings including defaults of not applicable ones
29+
30+
iman download settings --defaults COM1 geocom tps_settings.json
31+
32+
Usage
33+
-----
34+
35+
.. click:: instrumentman.settings:cli_download
36+
:prog: iman download settings

docs/commands/settings/index.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
:icon: material/cog
2+
3+
Settings
4+
========
5+
6+
For different measurements, different instrument settings might be required.
7+
The settings commands can be used to save the settings to the config file,
8+
and later load them back as necessary.
9+
10+
.. toctree::
11+
:maxdepth: 1
12+
13+
download
14+
validate
15+
upload

docs/commands/settings/upload.rst

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
Uploading
2+
=========
3+
4+
Once a config file is created (either manually, or saved from the instrument),
5+
the parameters can be uploaded back to the instrument. The config file must
6+
have a valid structure, or the upload will be refused.
7+
8+
The config file can either be in JSON, YAML or TOML format, but regardless,
9+
the structure must follow the required schema.
10+
11+
.. note::
12+
13+
Configs can be validated before upload with the validation command.
14+
15+
Examples
16+
--------
17+
18+
.. code-block:: json
19+
:caption: Total station ATR and target setting
20+
21+
{
22+
"protocol": "geocom",
23+
"settings": [
24+
{
25+
"subsystem": "aut",
26+
"options": {
27+
"atr": true
28+
}
29+
},
30+
{
31+
"subsystem": "bap",
32+
"options": {
33+
"target_type": "REFLECTOR",
34+
"prizm_type": "MINI"
35+
}
36+
}
37+
]
38+
}
39+
40+
41+
.. code-block:: json
42+
:caption: DNA normal staff direction with meter units
43+
44+
{
45+
"protocol": "gsidna",
46+
"settings": [
47+
{
48+
"subsystem": "settings",
49+
"options": {
50+
"distance_unit": "METER",
51+
"staff_mode": false
52+
}
53+
}
54+
]
55+
}
56+
57+
Usage
58+
-----
59+
60+
.. click:: instrumentman.settings:cli_upload
61+
:prog: iman upload settings
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Validation
2+
==========
3+
4+
An instrument settings file must have a valid structure, or the upload will be
5+
refused. The schema file is available in the
6+
`GitHub repository <https://github.com/MrClock8163/Instrumentman/blob/main/src/instrumentman/settings/schema_settings.json>`_.
7+
8+
Usage
9+
-----
10+
11+
.. click:: instrumentman.settings:cli_validate
12+
:prog: iman validate settings
13+

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Content
4545
commands/files/index
4646
commands/data/index
4747
commands/jobs/index
48+
commands/settings/index
4849

4950
Indices
5051

docs/latexindex.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ Applications
3030
commands/files/index
3131
commands/data/index
3232
commands/jobs/index
33+
commands/settings/index

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ dependencies = [
1717
"rapidfuzz",
1818
"jsonschema",
1919
"jmespath",
20+
"toml",
21+
"PyYAML",
2022
"click-extra"
2123
]
2224
classifiers = [
@@ -62,6 +64,8 @@ linting = [
6264
"types-pyserial",
6365
"types-jsonschema",
6466
"types-jmespath",
67+
"types-toml",
68+
"types-PyYAML",
6569
"mypy",
6670
"flake8"
6771
]

src/instrumentman/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from . import filetransfer
1515
from . import jobs
1616
from . import datatransfer
17+
from . import settings
1718

1819

1920
@extra_group("iman", params=None) # type: ignore[misc]
@@ -81,9 +82,12 @@ def cli_upload() -> None:
8182
cli_merge.add_command(setmeasurement.cli_merge)
8283
cli_merge.add_command(inclination.cli_merge)
8384
cli_validate.add_command(setmeasurement.cli_validate)
85+
cli_validate.add_command(settings.cli_validate)
8486
cli_import.add_command(setup.cli_import)
8587
cli_list.add_command(filetransfer.cli_list)
8688
cli_list.add_command(jobs.cli_list)
8789
cli_download.add_command(filetransfer.cli_download)
8890
cli_download.add_command(datatransfer.cli_download)
91+
cli_download.add_command(settings.cli_download)
8992
cli_upload.add_command(datatransfer.cli_upload)
93+
cli_upload.add_command(settings.cli_upload)

src/instrumentman/schema_targets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"title": "GeoComPy set measurement targets schema",
2+
"title": "Instrumentman set measurement targets schema",
33
"description": "Target point records for set measurements",
44
"tpye": "object",
55
"additionalProperties": false,

0 commit comments

Comments
 (0)