moteus-gui 0.3.93__tar.gz → 0.3.95__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
- Name: moteus-gui
3
- Version: 0.3.93
2
+ Name: moteus_gui
3
+ Version: 0.3.95
4
4
  Summary: moteus brushless controller graphical user interfaces
5
5
  Home-page: https://github.com/mjbots/moteus
6
6
  Author: mjbots Robotic Systems
@@ -2469,40 +2469,60 @@ class TviewMainWindow():
2469
2469
 
2470
2470
  def _handle_telemetry_context_menu(self, pos):
2471
2471
  item = self.ui.telemetryTreeWidget.itemAt(pos)
2472
- if item.childCount() > 0:
2473
- return
2472
+
2473
+ # Determine if this is a leaf item (field) or a channel item
2474
+ is_leaf = item.childCount() == 0
2475
+
2476
+ is_controller = item.parent() is None
2474
2477
 
2475
2478
  menu = QtWidgets.QMenu(self.ui)
2476
- left_action = menu.addAction('Plot Left')
2477
- right_action = menu.addAction('Plot Right')
2478
- left_std_action = menu.addAction('Plot StdDev Left')
2479
- right_std_action = menu.addAction('Plot StdDev Right')
2480
- left_mean_action = menu.addAction('Plot Mean Left')
2481
- right_mean_action = menu.addAction('Plot Mean Right')
2482
-
2483
- plot_actions = [
2484
- left_action,
2485
- right_action,
2486
- left_std_action,
2487
- right_std_action,
2488
- left_mean_action,
2489
- right_mean_action,
2490
- ]
2491
-
2492
- right_actions = [right_action, right_std_action, right_mean_action]
2493
- std_actions = [left_std_action, right_std_action]
2494
- mean_actions = [left_mean_action, right_mean_action]
2495
-
2496
- menu.addSeparator()
2497
- copy_name = menu.addAction('Copy Name')
2498
- copy_value = menu.addAction('Copy Value')
2499
2479
 
2500
- menu.addSeparator()
2501
- fmt_standard_action = menu.addAction('Standard Format')
2502
- fmt_hex_action = menu.addAction('Hex Format')
2480
+ # Plot actions only make sense for leaf items
2481
+ plot_actions = []
2482
+ if is_leaf:
2483
+ left_action = menu.addAction('Plot Left')
2484
+ right_action = menu.addAction('Plot Right')
2485
+ left_std_action = menu.addAction('Plot StdDev Left')
2486
+ right_std_action = menu.addAction('Plot StdDev Right')
2487
+ left_mean_action = menu.addAction('Plot Mean Left')
2488
+ right_mean_action = menu.addAction('Plot Mean Right')
2489
+
2490
+ plot_actions = [
2491
+ left_action,
2492
+ right_action,
2493
+ left_std_action,
2494
+ right_std_action,
2495
+ left_mean_action,
2496
+ right_mean_action,
2497
+ ]
2498
+
2499
+ right_actions = [right_action, right_std_action, right_mean_action]
2500
+ std_actions = [left_std_action, right_std_action]
2501
+ mean_actions = [left_mean_action, right_mean_action]
2503
2502
 
2504
- menu.addSeparator()
2505
- log_channel_action = menu.addAction('Log this channel')
2503
+ menu.addSeparator()
2504
+
2505
+ copy_name = menu.addAction('Copy Name')
2506
+ if is_leaf:
2507
+ copy_value = menu.addAction('Copy Value')
2508
+
2509
+ if is_leaf:
2510
+ menu.addSeparator()
2511
+ fmt_standard_action = menu.addAction('Standard Format')
2512
+ fmt_hex_action = menu.addAction('Hex Format')
2513
+
2514
+ menu.addSeparator()
2515
+ log_channel_action = menu.addAction('Log this channel')
2516
+
2517
+ # Sample rate menu items - available for both channels and
2518
+ # fields, but not controllers.
2519
+ if not is_controller:
2520
+ menu.addSeparator()
2521
+ rate_10hz_action = menu.addAction('Set Rate: 10Hz')
2522
+ rate_100hz_action = menu.addAction('Set Rate: 100Hz')
2523
+ else:
2524
+ rate_10hz_action = None
2525
+ rate_100hz_action = None
2506
2526
 
2507
2527
  requested = menu.exec_(self.ui.telemetryTreeWidget.mapToGlobal(pos))
2508
2528
 
@@ -2535,14 +2555,35 @@ class TviewMainWindow():
2535
2555
  self.ui.plotItemCombo.addItem(name, plot_item)
2536
2556
  elif requested == copy_name:
2537
2557
  QtWidgets.QApplication.clipboard().setText(item.text(0))
2538
- elif requested == copy_value:
2558
+ elif is_leaf and requested == copy_value:
2539
2559
  QtWidgets.QApplication.clipboard().setText(item.text(1))
2540
- elif requested == fmt_standard_action:
2560
+ elif is_leaf and requested == fmt_standard_action:
2541
2561
  item.setData(1, FORMAT_ROLE, FMT_STANDARD)
2542
- elif requested == fmt_hex_action:
2562
+ elif is_leaf and requested == fmt_hex_action:
2543
2563
  item.setData(1, FORMAT_ROLE, FMT_HEX)
2544
- elif requested == log_channel_action:
2564
+ elif is_leaf and requested == log_channel_action:
2545
2565
  self._start_channel_logging(item)
2566
+ elif (rate_10hz_action and requested == rate_10hz_action or
2567
+ rate_100hz_action and requested == rate_100hz_action):
2568
+ # Determine the channel schema and name
2569
+ if is_leaf:
2570
+ # For leaf items, find the parent channel item
2571
+ channel_item = item
2572
+ while channel_item.parent().parent():
2573
+ channel_item = channel_item.parent()
2574
+ schema = channel_item.data(0, QtCore.Qt.UserRole)
2575
+ else:
2576
+ # For channel items, use the item directly
2577
+ schema = item.data(0, QtCore.Qt.UserRole)
2578
+
2579
+ if schema and hasattr(schema, '_name') and hasattr(schema, '_parent'):
2580
+ channel_name = schema._name
2581
+ device = schema._parent
2582
+
2583
+ # 10Hz = 100ms, 100Hz = 10ms
2584
+ poll_rate_ms = 100 if requested == rate_10hz_action else 10
2585
+
2586
+ device.write_line(f'tel rate {channel_name} {poll_rate_ms}\r\n')
2546
2587
  else:
2547
2588
  # The user cancelled.
2548
2589
  pass
@@ -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.93"
15
+ VERSION="0.3.95"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: moteus-gui
3
- Version: 0.3.93
3
+ Version: 0.3.95
4
4
  Summary: moteus brushless controller graphical user interfaces
5
5
  Home-page: https://github.com/mjbots/moteus
6
6
  Author: mjbots Robotic Systems
@@ -1,4 +1,4 @@
1
- PySide6>=6.8
1
+ PySide6>=6.6
2
2
  asyncqt>=0.8
3
3
  matplotlib>=3.9
4
4
  moteus>=0.3.92
@@ -23,8 +23,8 @@ here = pathlib.Path(__file__).parent.resolve()
23
23
  long_description = (here / 'README.md').read_text(encoding='utf-8')
24
24
 
25
25
  setuptools.setup(
26
- name = 'moteus-gui',
27
- version = "0.3.93",
26
+ name = 'moteus_gui',
27
+ version = "0.3.95",
28
28
  description = 'moteus brushless controller graphical user interfaces',
29
29
  long_description = long_description,
30
30
  long_description_content_type = 'text/markdown',
@@ -56,10 +56,7 @@ setuptools.setup(
56
56
  # For some reason, matplotlib can barf without this, but
57
57
  # doesn't actually list it as a dependency on Windows.
58
58
  'msvc-runtime;platform_system=="Windows" and python_version<"3.12"',
59
- # At the time of this writing, 6.7.0 on Windows causes qtpy
60
- # and qtconsole to fail miserably, so we just stay with 6.6 or
61
- # earlier.
62
- 'PySide6>=6.8',
59
+ 'PySide6>=6.6',
63
60
  'qtconsole>=5.6',
64
61
  'qtpy>=2.0.1',
65
62
  'scipy>=1.14',
File without changes
File without changes