|
3 | 3 | from math import tan, atan, degrees |
4 | 4 | from re import compile |
5 | 5 |
|
6 | | -from click_extra import echo, progressbar |
| 6 | +from rich.progress import track |
| 7 | +from click_extra import echo |
7 | 8 | from geocompy.data import Angle, Coordinate |
8 | 9 | from geocompy.geo import GeoCom |
9 | 10 | from geocompy.communication import open_serial |
@@ -36,30 +37,28 @@ def run_measure( |
36 | 37 | output |
37 | 38 | ) |
38 | 39 |
|
39 | | - with progressbar( |
| 40 | + for a in track( |
40 | 41 | range(start, start + cycles * 360, turn), |
41 | | - label="Measuring", |
42 | | - hidden=output is None |
43 | | - ) as bar: |
44 | | - for a in bar: |
45 | | - hz = Angle(a, 'deg').normalized() |
46 | | - tps.aut.turn_to(hz, v) |
47 | | - |
48 | | - sleep(1) |
49 | | - fullangles = tps.tmc.get_angle_inclination('MEASURE') |
50 | | - if fullangles.params is None: |
51 | | - continue |
| 42 | + description="Measuring" |
| 43 | + ): |
| 44 | + hz = Angle(a, 'deg').normalized() |
| 45 | + tps.aut.turn_to(hz, v) |
| 46 | + |
| 47 | + sleep(1) |
| 48 | + fullangles = tps.tmc.get_angle_inclination('MEASURE') |
| 49 | + if fullangles.params is None: |
| 50 | + continue |
52 | 51 |
|
53 | | - az = fullangles.params[0] |
54 | | - cross = fullangles.params[4] |
55 | | - length = fullangles.params[5] |
| 52 | + az = fullangles.params[0] |
| 53 | + cross = fullangles.params[4] |
| 54 | + length = fullangles.params[5] |
56 | 55 |
|
57 | | - echo( |
58 | | - f"{az.asunit('deg'):.4f}," |
59 | | - f"{cross.asunit('deg') * 3600:.2f}," |
60 | | - f"{length.asunit('deg') * 3600:.2f}", |
61 | | - output |
62 | | - ) |
| 56 | + echo( |
| 57 | + f"{az.asunit('deg'):.4f}," |
| 58 | + f"{cross.asunit('deg') * 3600:.2f}," |
| 59 | + f"{length.asunit('deg') * 3600:.2f}", |
| 60 | + output |
| 61 | + ) |
63 | 62 |
|
64 | 63 |
|
65 | 64 | def main_measure( |
|
0 commit comments