Skip to content

Commit 8e4e247

Browse files
authored
Merge pull request #20 from MrClock8163/feature/resection
Add station management
2 parents 69a9ca3 + 941d737 commit 8e4e247

File tree

17 files changed

+900
-15
lines changed

17 files changed

+900
-15
lines changed

.github/workflows/run-tests.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,30 @@ env:
77
MYPY_FORCE_COLOR: 1
88

99
jobs:
10+
testing:
11+
name: Running tests
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
python-version: ["3.11", "3.12", "3.13"]
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Setup Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Build and install package
26+
run: python -m pip install .
27+
28+
- name: Test with pytest
29+
run: |
30+
python -m pip install --upgrade pip
31+
python -m pip install --group testing
32+
python -m pytest
33+
1034
linting:
1135
name: Linting
1236
runs-on: ubuntu-latest

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ The project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## Unreleased
99

10+
### Added
11+
12+
- Added resection calculation logic
13+
- Added station calculation (`calc station`) using resection from set
14+
measurements
15+
- Added station uploading (`upload station`) to set station coordinates and
16+
orientation
17+
1018
### Changed
1119

1220
- Updated file listing to display results in a tree view

docs/commands/station/calc.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Calculation
2+
===========
3+
4+
Resection calculation is commonly used when setting up an instrument on an
5+
unkown point. Alternatively resection can be used in monitoring setups as well,
6+
to handle the possible movement of the instrument between measurement cycles,
7+
and to verify the integrity of the control points. The resection
8+
calculation will always have excess measurements, which means it can be
9+
adjusted with least squares, that provides standard deviations. If the
10+
deviations of the resection suddenly increase in one of the cycles, it likely
11+
indicates, that one of the control points moved.
12+
13+
The resection is done in two steps, separate horizontal and vertical
14+
calculations.
15+
16+
Requirements
17+
------------
18+
19+
- Session result file from previous set measurement
20+
21+
Usage
22+
-----
23+
24+
.. click:: instrumentman.station:cli_calc
25+
:prog: iman calc station

docs/commands/station/index.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
:icon: material/map-marker-outline
2+
3+
Station
4+
=======
5+
6+
Managing the instrument station setup is an important part of measurements.
7+
The stationing commands can be used to manage various aspects of a setup.
8+
9+
.. toctree::
10+
:maxdepth: 1
11+
12+
calc
13+
upload

docs/commands/station/upload.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Uploading
2+
=========
3+
4+
If a station setup was calculated separately (not using the on-board software),
5+
it has to be uploaded to the instrument. This command allows to set the station
6+
coordinates, instrument height and orientation.
7+
8+
.. note::
9+
10+
The station name cannot be set. It will remain the last point name set with
11+
the on-board software.
12+
13+
Requirements
14+
------------
15+
16+
- GeoCom capable total station
17+
18+
Usage
19+
-----
20+
21+
.. click:: instrumentman.station:cli_upload
22+
:prog: iman upload station

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Content
4646
commands/data/index
4747
commands/jobs/index
4848
commands/settings/index
49+
commands/station/index
4950

5051
Indices
5152

docs/latexindex.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ Applications
3131
commands/data/index
3232
commands/jobs/index
3333
commands/settings/index
34+
commands/station/index

pyproject.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@ readme = "README.md"
1313
requires-python = ">=3.11"
1414
dependencies = [
1515
"pyserial ~= 3.5.0",
16-
"geocompy >= 0.8.1",
16+
"geocompy >= 0.10.0",
1717
"rich >= 13.9",
1818
"textual >= 3.2.0",
1919
"rapidfuzz ~= 3.13.0",
2020
"jsonschema ~= 4.21",
2121
"jmespath ~= 1.0.1",
2222
"toml ~= 0.10.2",
2323
"PyYAML ~= 6.0.2",
24+
"numpy ~= 2.0",
2425
"cloup ~= 3.0.7",
2526
"click-extra ~= 5.0.2"
2627
]
@@ -59,7 +60,9 @@ Changelog = "https://instrumentman.readthedocs.io/latest/changelog"
5960
iman = "instrumentman:cli"
6061

6162
[dependency-groups]
62-
testing = []
63+
testing = [
64+
"pytest ~= 8.4.1"
65+
]
6366
linting = [
6467
{include-group = "testing"},
6568
"types-pyserial ~= 3.5.0.20250326",
@@ -94,7 +97,6 @@ version-file = "src/instrumentman/_version.py"
9497
[tool.pytest.ini_options]
9598
addopts = ["-ra", "-v", "--color=yes"]
9699
testpaths = ["tests"]
97-
required_plugins = "pytest-mock"
98100

99101
[tool.mypy]
100102
strict = true

src/instrumentman/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from . import terminal
1010
from . import setup
1111
from . import setmeasurement
12+
from . import station
1213
from . import protocoltest
1314
from . import inclination
1415
from . import filetransfer
@@ -77,6 +78,7 @@ def cli_upload() -> None:
7778
cli_measure.add_command(inclination.cli_measure)
7879
cli_calc.add_command(setmeasurement.cli_calc)
7980
cli_calc.add_command(inclination.cli_calc)
81+
cli_calc.add_command(station.cli_calc)
8082
cli_test.add_command(protocoltest.cli_geocom)
8183
cli_test.add_command(protocoltest.cli_gsidna)
8284
cli_merge.add_command(setmeasurement.cli_merge)
@@ -91,3 +93,4 @@ def cli_upload() -> None:
9193
cli_download.add_command(settings.cli_download)
9294
cli_upload.add_command(datatransfer.cli_upload)
9395
cli_upload.add_command(settings.cli_upload)
96+
cli_upload.add_command(station.cli_upload)

0 commit comments

Comments
 (0)