Skip to content

Commit 17684bc

Browse files
manoukianvUltrawipf
authored andcommitted
Add systray management.
Add profil switch into systray. Move systray manager in a wrapper. Add signal to soft link systray/profilemanager/base-ui. Add security on Fullclassname during save process. This allow to extract only the setting of specific class name. Add a security on send data profile. Filter only running class to not setup class with a mistmatch class name Profile manager clean code. Fix bug on connection. fixed the default format of file. Unregister the callback on the closure. Fix the event on loading page Temporary fix the refresh issue. Call the processMatchedReply to simulate we received an answer. Enable the DFU. Move the profile config in res. Added profiles to gitignore Add the effects statistics UI. fix effects range, and first value. rename file ui Add realtime effect monitoring Adding advanced_tweak. add the tweak speed panel. add effect visualize. remove simulate button, and upgrade on button. adding legends to graph. remove the timer. fix layout and add rps as min value. Adding panel encoder tune in axis. Add multi-axis. reduce speedscaler range to fit in 16b. Fix the last UI update. Fix the parameter renamed. Fix all the instance and class member. Clean python code. FIx the main module python code style. Rename de system_ui in profile_ui. Regroup profile manager in one module and rewords. update creator First launchable project. Fix profile manager UI. Remove reference circular between UI and systray. Move the log in the errors dlg and manage move. Add the last log message in status bar. Fix the base_ui typo. Fix the graph dark theme display. Fix the crash on encoder change. Fix the encoder_tuning issue with dark theme. Split the clear button on 2 sub button. Migrate to a .ui foor status bar. Add None and Flash profiles. Add except on serial. Split the encoder settings in 2 differents UI.
1 parent 73820ed commit 17684bc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+5337
-1503
lines changed

.flake8

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[flake8]
2+
max-line-length = 160

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
__pycache__/*
2-
.vscode/*
2+
.vscode/*
3+
.qt_for_python/*
4+
profiles.json

.pylintrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[MASTER]
2+
3+
extension-pkg-allow-list=PyQt6

activelist.py

+14-26
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
from base_ui import WidgetUI,CommunicationHandler
2-
from PyQt6.QtWidgets import QDialog,QTableWidgetItem ,QHeaderView
3-
from PyQt6.QtWidgets import QMessageBox,QVBoxLayout,QCheckBox,QButtonGroup,QPushButton,QLabel,QSpinBox,QComboBox
2+
import PyQt6.QtWidgets
43
from PyQt6.QtCore import QAbstractTableModel,Qt,QModelIndex
54

65

76

87
class ActiveClassModel(QAbstractTableModel):
9-
def __init__(self,parent):
8+
def __init__(self):
109
super(ActiveClassModel, self).__init__()
11-
self.parent = parent
1210
self.items = []
1311
self.header = ["Name", "Class","Instance","Class ID","Handler ID"]
1412

@@ -66,38 +64,33 @@ def setItems(self,items):
6664
self.items = items
6765
self.endResetModel()
6866

69-
class ActiveClassDialog(QDialog):
70-
def __init__(self,main=None):
71-
QDialog.__init__(self, main)
72-
self.main = main
73-
self.ui = ActiveClassUI(main,self)
74-
self.layout = QVBoxLayout()
67+
class ActiveClassDialog(PyQt6.QtWidgets.QDialog):
68+
def __init__(self, parent = None):
69+
PyQt6.QtWidgets.QDialog.__init__(self, parent)
70+
self.active_class_ui = ActiveClassUI(parent)
71+
self.layout = PyQt6.QtWidgets.QVBoxLayout()
7572
self.layout.setContentsMargins(0,0,0,0)
76-
self.layout.addWidget(self.ui)
73+
self.layout.addWidget(self.active_class_ui)
7774
self.setLayout(self.layout)
7875
self.setWindowTitle("Active modules")
7976

80-
class ActiveClassUI(WidgetUI,CommunicationHandler):
81-
82-
def __init__(self, main=None,parent = None):
83-
WidgetUI.__init__(self, parent,'activelist.ui')
77+
class ActiveClassUI(WidgetUI, CommunicationHandler):
78+
def __init__(self, parent = None):
79+
WidgetUI.__init__(self, parent, 'activelist.ui')
8480
CommunicationHandler.__init__(self)
85-
self.main = main
8681
self.parent = parent
8782
self.pushButton_refresh.clicked.connect(self.read)
88-
self.items = ActiveClassModel(self.tableView)
83+
self.items = ActiveClassModel()
8984
self.tableView.setModel(self.items)
9085
header = self.tableView.horizontalHeader()
91-
header.setSectionResizeMode(0,QHeaderView.ResizeMode.Stretch)# Stretch first section
92-
93-
86+
header.setSectionResizeMode(0,PyQt6.QtWidgets.QHeaderView.ResizeMode.Stretch) # Stretch first section
9487

9588
def showEvent(self, a0):
9689
self.tableView.resizeColumnsToContents()
9790
self.read()
9891

9992
def read(self):
100-
self.getValueAsync("sys","lsactive",self.updateCb)
93+
self.get_value_async("sys","lsactive",self.updateCb)
10194

10295
def updateCb(self,string):
10396
self.parent.show()
@@ -110,8 +103,3 @@ def updateCb(self,string):
110103
items.append(item)
111104
self.items.setItems(items)
112105
self.tableView.resizeColumnsToContents()
113-
114-
115-
116-
117-

analogconf_ui.py

+14-12
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,19 @@ def __init__(self,name,id, main):
2626

2727

2828
class AnalogInputConf(OptionsDialogGroupBox,CommunicationHandler):
29-
analogbtns = QButtonGroup()
30-
axes = 0
29+
3130
def __init__(self,name,main):
3231
self.main = main
3332
OptionsDialogGroupBox.__init__(self,name,main)
3433
CommunicationHandler.__init__(self)
34+
self.analogbtns = QButtonGroup()
3535
self.analogbtns.setExclusive(False)
3636
self.buttonBox = QGroupBox("Pins")
3737
self.buttonBoxLayout = QVBoxLayout()
3838
self.buttonBox.setLayout(self.buttonBoxLayout)
3939

40+
self.axes = 0
41+
4042
self.pgb_list=[]
4143
self.axismask=0
4244
self.prefix=0
@@ -61,7 +63,7 @@ def hideEvent(self,event):
6163
self.timer.stop()
6264

6365
def updateTimer(self):
64-
self.sendCommands("apin",["values"],self.prefix)
66+
self.send_commands("apin",["values"],self.prefix)
6567

6668
def readValues(self):
6769
self.getValueAsync("apin","pins",self.createAinButtons,0,conversion=int)
@@ -96,7 +98,7 @@ def f(axismask):
9698
self.axismask = axismask
9799
for i in range(self.axes):
98100
self.analogbtns.button(i).setChecked(axismask & (1 << i))
99-
self.getValueAsync("apin","mask",f,0,conversion=int)
101+
self.get_value_async("apin","mask",f,0,conversion=int)
100102

101103
def valueCb(self, str):
102104
val_list = str.split("\n")
@@ -120,10 +122,10 @@ def apply(self):
120122
self.sendValue("apin","filter",1 if self.filterBox.isChecked() else 0)
121123

122124
def onshown(self):
123-
self.registerCallback("apin","values",self.valueCb,self.prefix,str)
125+
self.register_callback("apin","values",self.valueCb,self.prefix,str)
124126

125127
def onclose(self):
126-
self.removeCallbacks()
128+
self.remove_callbacks()
127129

128130

129131
class CANAnalogConf(OptionsDialogGroupBox,CommunicationHandler):
@@ -162,7 +164,7 @@ def initUI(self):
162164
self.setLayout(vbox)
163165

164166
def onclose(self):
165-
self.removeCallbacks()
167+
self.remove_callbacks()
166168

167169
def amountChanged(self,_):
168170
amount = self.numAinBox.value()
@@ -179,17 +181,17 @@ def amountChanged(self,_):
179181
self.infoLabel.setText(text)
180182

181183
def apply(self):
182-
self.sendValue("cananalog","canid",self.canIdBox.value())
183-
self.sendValue("cananalog","amount",self.numAinBox.value())
184+
self.send_value("cananalog","canid",self.canIdBox.value())
185+
self.send_value("cananalog","amount",self.numAinBox.value())
184186

185187
def maximumCb(self,val):
186188
self.numAinBox.setMaximum(val)
187189
self.canIdBox.setMaximum(0x7ff - int((val-1)/4))
188190

189191
def readValues(self):
190-
self.getValueAsync("cananalog","amount",self.numAinBox.setValue,0,conversion=int)
191-
self.getValueAsync("cananalog","maxamount",self.maximumCb,0,conversion=int)
192-
self.getValueAsync("cananalog","canid",self.canIdBox.setValue,0,conversion=int)
192+
self.get_value_async("cananalog","amount",self.numAinBox.setValue,0,conversion=int)
193+
self.get_value_async("cananalog","maxamount",self.maximumCb,0,conversion=int)
194+
self.get_value_async("cananalog","canid",self.canIdBox.setValue,0,conversion=int)
193195

194196

195197

app.png

15.2 KB
Loading

0 commit comments

Comments
 (0)