@@ -126,20 +126,33 @@ def initUI(self):
126126
127127 self .comboBox_mode = QComboBox ()
128128 layout .addRow (QLabel ("Type" ),self .comboBox_mode )
129+
130+ self .comboBox_spispeed = QComboBox ()
131+ layout .addRow (QLabel ("SPI speed" ),self .comboBox_spispeed )
132+
129133 self .setLayout (layout )
130134
131135 def updateModes (self ,reply ):
132136 updateListComboBox (self .comboBox_mode ,reply ,entrySep = '\n ' )
133137
138+ def updateSpeeds (self ,reply ):
139+ def f (data ):
140+ data = str (f"{ float (data )/ 1000000 :.5g} MHz" )
141+ return data
142+ updateListComboBox (self .comboBox_spispeed ,reply ,entrySep = '\n ' ,labelconv = f )
143+
134144 def onshown (self ):
135145 self .get_value_async ("mtenc" ,"mode" ,self .updateModes ,typechar = '!' )
146+ self .get_value_async ("mtenc" ,"speed" ,self .updateSpeeds ,typechar = '!' )
136147 self .get_value_async ("mtenc" ,"cs" ,self .spinBox_cs .setValue ,0 ,int )
137148 self .get_value_async ("mtenc" ,"mode" ,self .comboBox_mode .setCurrentIndex ,0 ,int )
149+ self .get_value_async ("mtenc" ,"speed" ,self .comboBox_spispeed .setCurrentIndex ,0 ,int )
138150
139151 def apply (self ):
140152 val = self .spinBox_cs .value ()
141153 self .send_value ("mtenc" ,"cs" ,val = val )
142154 self .send_value ("mtenc" ,"mode" ,val = self .comboBox_mode .currentData ())
155+ self .send_value ("mtenc" ,"speed" ,val = self .comboBox_spispeed .currentData ())
143156
144157class BissEncoderConf (EncoderOption ,CommunicationHandler ):
145158 def __init__ (self ,parent ,main ):
0 commit comments