Skip to content

Commit 822c71b

Browse files
committed
Added PWM direction toggle
1 parent cbd595e commit 822c71b

File tree

4 files changed

+25
-5
lines changed

4 files changed

+25
-5
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
### Changes this version:
2+
- Added PWM direction checkbox
3+
4+
### Changes in 1.13.x:
25
- Fixed issue in encoder tuning UI
36
- Added SSI encoder ui
47

main.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@
5050
import simplemotion_ui
5151

5252
# This GUIs version
53-
VERSION = "1.13.0"
53+
VERSION = "1.13.1"
5454

5555
# Minimal supported firmware version.
5656
# Major version of firmware must match firmware. Minor versions must be higher or equal
57-
MIN_FW = "1.13.0"
57+
MIN_FW = "1.13.1"
5858

5959
class MainUi(PyQt6.QtWidgets.QMainWindow, base_ui.WidgetUI, base_ui.CommunicationHandler):
6060
"""Display and manage the main UI."""

pwmdriver_ui.py

+3
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,15 @@ def __init__(self, main=None, unique=1):
2323

2424
self.register_callback("pwmdrv","mode",self.pwmmode_cb,0,str,typechar='!')
2525
self.register_callback("pwmdrv","mode",self.comboBox_mode.setCurrentIndex,0,int,typechar='?')
26+
self.register_callback("pwmdrv","dir",self.checkBox_invert.setChecked,0,int,typechar='?')
2627

2728
self.init_ui()
2829

2930
def init_ui(self):
3031
# Fill menus
3132
self.send_command("pwmdrv","freq",0,'!')
3233
self.send_command("pwmdrv","mode",0,'!')
34+
self.send_command("pwmdrv","dir",0,'?')
3335

3436
def freq_cb(self,modes):
3537
self.comboBox_freq.clear()
@@ -49,5 +51,6 @@ def pwmmode_cb(self,modes):
4951
def apply(self):
5052
self.send_value("pwmdrv","mode",self.comboBox_mode.currentData())
5153
self.send_value("pwmdrv","freq",self.comboBox_freq.currentData())
54+
self.send_value("pwmdrv","dir",1 if self.checkBox_invert.isChecked() else 0)
5255
self.init_ui() # Update UI
5356

res/pwmdriver_ui.ui

+17-3
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,37 @@
3030
<item row="0" column="1">
3131
<widget class="QComboBox" name="comboBox_mode"/>
3232
</item>
33-
<item row="1" column="0">
33+
<item row="3" column="0">
3434
<widget class="QLabel" name="label_2">
3535
<property name="text">
3636
<string>Frequency Preset:</string>
3737
</property>
3838
</widget>
3939
</item>
40-
<item row="1" column="1">
40+
<item row="3" column="1">
4141
<widget class="QComboBox" name="comboBox_freq"/>
4242
</item>
43-
<item row="2" column="0">
43+
<item row="5" column="0">
4444
<widget class="QPushButton" name="pushButton_apply">
4545
<property name="text">
4646
<string>Apply</string>
4747
</property>
4848
</widget>
4949
</item>
50+
<item row="4" column="1">
51+
<widget class="QCheckBox" name="checkBox_invert">
52+
<property name="text">
53+
<string>Invert direction</string>
54+
</property>
55+
</widget>
56+
</item>
57+
<item row="4" column="0">
58+
<widget class="QLabel" name="label_4">
59+
<property name="text">
60+
<string>Other settings:</string>
61+
</property>
62+
</widget>
63+
</item>
5064
</layout>
5165
</widget>
5266
</item>

0 commit comments

Comments
 (0)