moteus-gui 0.3.87__py3-none-any.whl → 0.3.89__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- moteus_gui/tview.py +24 -7
- moteus_gui/version.py +1 -1
- {moteus_gui-0.3.87.dist-info → moteus_gui-0.3.89.dist-info}/METADATA +1 -1
- moteus_gui-0.3.89.dist-info/RECORD +9 -0
- moteus_gui-0.3.87.dist-info/RECORD +0 -9
- {moteus_gui-0.3.87.dist-info → moteus_gui-0.3.89.dist-info}/WHEEL +0 -0
- {moteus_gui-0.3.87.dist-info → moteus_gui-0.3.89.dist-info}/entry_points.txt +0 -0
- {moteus_gui-0.3.87.dist-info → moteus_gui-0.3.89.dist-info}/top_level.txt +0 -0
moteus_gui/tview.py
CHANGED
@@ -25,6 +25,7 @@ import moteus.moteus_tool
|
|
25
25
|
import numpy
|
26
26
|
import os
|
27
27
|
import re
|
28
|
+
import signal
|
28
29
|
import struct
|
29
30
|
import sys
|
30
31
|
import time
|
@@ -74,6 +75,14 @@ import asyncqt
|
|
74
75
|
import moteus.reader as reader
|
75
76
|
|
76
77
|
|
78
|
+
try:
|
79
|
+
from . import version
|
80
|
+
except ImportError:
|
81
|
+
class Version:
|
82
|
+
VERSION = 'dev'
|
83
|
+
version = Version()
|
84
|
+
|
85
|
+
|
77
86
|
LEFT_LEGEND_LOC = 3
|
78
87
|
RIGHT_LEGEND_LOC = 2
|
79
88
|
|
@@ -184,9 +193,9 @@ class RecordSignal(object):
|
|
184
193
|
|
185
194
|
return Connection(self, result)
|
186
195
|
|
187
|
-
def update(self, value):
|
196
|
+
def update(self, value, now):
|
188
197
|
for handler in self._callbacks.values():
|
189
|
-
handler(value)
|
198
|
+
handler(value, now)
|
190
199
|
return len(self._callbacks) != 0
|
191
200
|
|
192
201
|
|
@@ -225,14 +234,13 @@ class PlotItem(object):
|
|
225
234
|
self.axis.legend(loc=self.axis.legend_loc)
|
226
235
|
self.plot_widget.canvas.draw()
|
227
236
|
|
228
|
-
def _handle_update(self, value):
|
237
|
+
def _handle_update(self, value, now):
|
229
238
|
if self.plot_widget.paused:
|
230
239
|
return
|
231
240
|
|
232
241
|
if self.line is None:
|
233
242
|
self._make_line()
|
234
243
|
|
235
|
-
now = time.time()
|
236
244
|
self.xdata.append(now)
|
237
245
|
self.ydata.append(value)
|
238
246
|
|
@@ -403,7 +411,7 @@ class Record:
|
|
403
411
|
|
404
412
|
return self.signals[name]
|
405
413
|
|
406
|
-
def update(self, struct):
|
414
|
+
def update(self, struct, now):
|
407
415
|
count = 0
|
408
416
|
self.history.append(struct)
|
409
417
|
if len(self.history) > MAX_HISTORY_SIZE:
|
@@ -420,7 +428,7 @@ class Record:
|
|
420
428
|
value = numpy.mean(values)
|
421
429
|
else:
|
422
430
|
value = _get_data(struct, key)
|
423
|
-
if signal.update(value):
|
431
|
+
if signal.update(value, now):
|
424
432
|
count += 1
|
425
433
|
return count != 0
|
426
434
|
|
@@ -754,6 +762,8 @@ class Device:
|
|
754
762
|
return await self.read_sized_block()
|
755
763
|
|
756
764
|
async def do_data(self, name):
|
765
|
+
now = time.time()
|
766
|
+
|
757
767
|
data = await self.read_sized_block()
|
758
768
|
if not data:
|
759
769
|
return
|
@@ -764,7 +774,7 @@ class Device:
|
|
764
774
|
record = self._telemetry_records[name]
|
765
775
|
if record:
|
766
776
|
struct = record.archive.read(reader.Stream(io.BytesIO(data)))
|
767
|
-
record.update(struct)
|
777
|
+
record.update(struct, now)
|
768
778
|
_set_tree_widget_data(record.tree_item, struct, record.archive)
|
769
779
|
|
770
780
|
self._data[name] = struct
|
@@ -1269,8 +1279,11 @@ class TviewMainWindow():
|
|
1269
1279
|
|
1270
1280
|
|
1271
1281
|
def main():
|
1282
|
+
signal.signal(signal.SIGINT, signal.SIG_DFL)
|
1272
1283
|
parser = argparse.ArgumentParser(description=__doc__)
|
1273
1284
|
|
1285
|
+
parser.add_argument('--version', action='store_true')
|
1286
|
+
|
1274
1287
|
# These two commands are aliases.
|
1275
1288
|
parser.add_argument('-d', '--devices', '-t', '--target',
|
1276
1289
|
action='append', type=str, default=[])
|
@@ -1282,6 +1295,10 @@ def main():
|
|
1282
1295
|
|
1283
1296
|
args = parser.parse_args()
|
1284
1297
|
|
1298
|
+
if args.version:
|
1299
|
+
print(f"tview version '{version.VERSION}'")
|
1300
|
+
sys.exit(0)
|
1301
|
+
|
1285
1302
|
app = QtWidgets.QApplication(sys.argv)
|
1286
1303
|
loop = asyncqt.QEventLoop(app)
|
1287
1304
|
asyncio.set_event_loop(loop)
|
moteus_gui/version.py
CHANGED
@@ -0,0 +1,9 @@
|
|
1
|
+
moteus_gui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
moteus_gui/tview.py,sha256=OHpdvy3wdPYzmIMU0zRx4e7rjMRru__JEaOkD9djH7Q,42379
|
3
|
+
moteus_gui/tview_main_window.ui,sha256=q_qA1sooIWzprVT8eYAe0EH9lfu7zg-QP1diETCNFh8,5556
|
4
|
+
moteus_gui/version.py,sha256=awY4LvZ9OK5lPoCwGam-n3a3hS_9hqodOOLIH3OHQCw,627
|
5
|
+
moteus_gui-0.3.89.dist-info/METADATA,sha256=fNJiyXORfbOvdBmtWIaR-L7ux6nKzIlpCb1ICNrdh2M,996
|
6
|
+
moteus_gui-0.3.89.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
7
|
+
moteus_gui-0.3.89.dist-info/entry_points.txt,sha256=Y9PnhK_gNxr8CO7_POHieVaK1U_4fgu2EYoS6TyzSgk,48
|
8
|
+
moteus_gui-0.3.89.dist-info/top_level.txt,sha256=oPOkXR-zpPFhGiDcbnDY6scvNqQQAXWzV7oPD_GHMns,11
|
9
|
+
moteus_gui-0.3.89.dist-info/RECORD,,
|
@@ -1,9 +0,0 @@
|
|
1
|
-
moteus_gui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
moteus_gui/tview.py,sha256=DANIKJVpSC893A1reUb6a144dVrjo6okaRvN-L46BEA,42012
|
3
|
-
moteus_gui/tview_main_window.ui,sha256=q_qA1sooIWzprVT8eYAe0EH9lfu7zg-QP1diETCNFh8,5556
|
4
|
-
moteus_gui/version.py,sha256=0H-9-BkLhMrpt7WebRlIy2uP-2RmS0Y-oPCO-T9QBJY,627
|
5
|
-
moteus_gui-0.3.87.dist-info/METADATA,sha256=q6P8h11Vhi-0BsDPGycKdf55KI_VPzxZrW8r7LgDuow,996
|
6
|
-
moteus_gui-0.3.87.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
7
|
-
moteus_gui-0.3.87.dist-info/entry_points.txt,sha256=Y9PnhK_gNxr8CO7_POHieVaK1U_4fgu2EYoS6TyzSgk,48
|
8
|
-
moteus_gui-0.3.87.dist-info/top_level.txt,sha256=oPOkXR-zpPFhGiDcbnDY6scvNqQQAXWzV7oPD_GHMns,11
|
9
|
-
moteus_gui-0.3.87.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|