moteus-gui 0.3.87__tar.gz → 0.3.89__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: moteus-gui
3
- Version: 0.3.87
3
+ Version: 0.3.89
4
4
  Summary: moteus brushless controller graphical user interfaces
5
5
  Home-page: https://github.com/mjbots/moteus
6
6
  Author: mjbots Robotic Systems
@@ -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)
@@ -12,4 +12,4 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- VERSION="0.3.87"
15
+ VERSION="0.3.89"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: moteus-gui
3
- Version: 0.3.87
3
+ Version: 0.3.89
4
4
  Summary: moteus brushless controller graphical user interfaces
5
5
  Home-page: https://github.com/mjbots/moteus
6
6
  Author: mjbots Robotic Systems
@@ -24,7 +24,7 @@ long_description = (here / 'README.md').read_text(encoding='utf-8')
24
24
 
25
25
  setuptools.setup(
26
26
  name = 'moteus-gui',
27
- version = "0.3.87",
27
+ version = "0.3.89",
28
28
  description = 'moteus brushless controller graphical user interfaces',
29
29
  long_description = long_description,
30
30
  long_description_content_type = 'text/markdown',
File without changes
File without changes