Skip to content

Commit

Permalink
Add systray management.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
manoukianv authored and Ultrawipf committed Aug 27, 2022
1 parent 73820ed commit 17684bc
Show file tree
Hide file tree
Showing 48 changed files with 5,337 additions and 1,503 deletions.
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
max-line-length = 160
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
__pycache__/*
.vscode/*
.vscode/*
.qt_for_python/*
profiles.json
3 changes: 3 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[MASTER]

extension-pkg-allow-list=PyQt6
40 changes: 14 additions & 26 deletions activelist.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
from base_ui import WidgetUI,CommunicationHandler
from PyQt6.QtWidgets import QDialog,QTableWidgetItem ,QHeaderView
from PyQt6.QtWidgets import QMessageBox,QVBoxLayout,QCheckBox,QButtonGroup,QPushButton,QLabel,QSpinBox,QComboBox
import PyQt6.QtWidgets
from PyQt6.QtCore import QAbstractTableModel,Qt,QModelIndex



class ActiveClassModel(QAbstractTableModel):
def __init__(self,parent):
def __init__(self):
super(ActiveClassModel, self).__init__()
self.parent = parent
self.items = []
self.header = ["Name", "Class","Instance","Class ID","Handler ID"]

Expand Down Expand Up @@ -66,38 +64,33 @@ def setItems(self,items):
self.items = items
self.endResetModel()

class ActiveClassDialog(QDialog):
def __init__(self,main=None):
QDialog.__init__(self, main)
self.main = main
self.ui = ActiveClassUI(main,self)
self.layout = QVBoxLayout()
class ActiveClassDialog(PyQt6.QtWidgets.QDialog):
def __init__(self, parent = None):
PyQt6.QtWidgets.QDialog.__init__(self, parent)
self.active_class_ui = ActiveClassUI(parent)
self.layout = PyQt6.QtWidgets.QVBoxLayout()
self.layout.setContentsMargins(0,0,0,0)
self.layout.addWidget(self.ui)
self.layout.addWidget(self.active_class_ui)
self.setLayout(self.layout)
self.setWindowTitle("Active modules")

class ActiveClassUI(WidgetUI,CommunicationHandler):

def __init__(self, main=None,parent = None):
WidgetUI.__init__(self, parent,'activelist.ui')
class ActiveClassUI(WidgetUI, CommunicationHandler):
def __init__(self, parent = None):
WidgetUI.__init__(self, parent, 'activelist.ui')
CommunicationHandler.__init__(self)
self.main = main
self.parent = parent
self.pushButton_refresh.clicked.connect(self.read)
self.items = ActiveClassModel(self.tableView)
self.items = ActiveClassModel()
self.tableView.setModel(self.items)
header = self.tableView.horizontalHeader()
header.setSectionResizeMode(0,QHeaderView.ResizeMode.Stretch)# Stretch first section


header.setSectionResizeMode(0,PyQt6.QtWidgets.QHeaderView.ResizeMode.Stretch) # Stretch first section

def showEvent(self, a0):
self.tableView.resizeColumnsToContents()
self.read()

def read(self):
self.getValueAsync("sys","lsactive",self.updateCb)
self.get_value_async("sys","lsactive",self.updateCb)

def updateCb(self,string):
self.parent.show()
Expand All @@ -110,8 +103,3 @@ def updateCb(self,string):
items.append(item)
self.items.setItems(items)
self.tableView.resizeColumnsToContents()





26 changes: 14 additions & 12 deletions analogconf_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,19 @@ def __init__(self,name,id, main):


class AnalogInputConf(OptionsDialogGroupBox,CommunicationHandler):
analogbtns = QButtonGroup()
axes = 0

def __init__(self,name,main):
self.main = main
OptionsDialogGroupBox.__init__(self,name,main)
CommunicationHandler.__init__(self)
self.analogbtns = QButtonGroup()
self.analogbtns.setExclusive(False)
self.buttonBox = QGroupBox("Pins")
self.buttonBoxLayout = QVBoxLayout()
self.buttonBox.setLayout(self.buttonBoxLayout)

self.axes = 0

self.pgb_list=[]
self.axismask=0
self.prefix=0
Expand All @@ -61,7 +63,7 @@ def hideEvent(self,event):
self.timer.stop()

def updateTimer(self):
self.sendCommands("apin",["values"],self.prefix)
self.send_commands("apin",["values"],self.prefix)

def readValues(self):
self.getValueAsync("apin","pins",self.createAinButtons,0,conversion=int)
Expand Down Expand Up @@ -96,7 +98,7 @@ def f(axismask):
self.axismask = axismask
for i in range(self.axes):
self.analogbtns.button(i).setChecked(axismask & (1 << i))
self.getValueAsync("apin","mask",f,0,conversion=int)
self.get_value_async("apin","mask",f,0,conversion=int)

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

def onshown(self):
self.registerCallback("apin","values",self.valueCb,self.prefix,str)
self.register_callback("apin","values",self.valueCb,self.prefix,str)

def onclose(self):
self.removeCallbacks()
self.remove_callbacks()


class CANAnalogConf(OptionsDialogGroupBox,CommunicationHandler):
Expand Down Expand Up @@ -162,7 +164,7 @@ def initUI(self):
self.setLayout(vbox)

def onclose(self):
self.removeCallbacks()
self.remove_callbacks()

def amountChanged(self,_):
amount = self.numAinBox.value()
Expand All @@ -179,17 +181,17 @@ def amountChanged(self,_):
self.infoLabel.setText(text)

def apply(self):
self.sendValue("cananalog","canid",self.canIdBox.value())
self.sendValue("cananalog","amount",self.numAinBox.value())
self.send_value("cananalog","canid",self.canIdBox.value())
self.send_value("cananalog","amount",self.numAinBox.value())

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

def readValues(self):
self.getValueAsync("cananalog","amount",self.numAinBox.setValue,0,conversion=int)
self.getValueAsync("cananalog","maxamount",self.maximumCb,0,conversion=int)
self.getValueAsync("cananalog","canid",self.canIdBox.setValue,0,conversion=int)
self.get_value_async("cananalog","amount",self.numAinBox.setValue,0,conversion=int)
self.get_value_async("cananalog","maxamount",self.maximumCb,0,conversion=int)
self.get_value_async("cananalog","canid",self.canIdBox.setValue,0,conversion=int)



Expand Down
Binary file added app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 17684bc

Please sign in to comment.