Пример #1
0
 def update_code_box(self):
     mapping = {'SERIAL_ID': self.ui.lineEdit_serialId.text(),
                'R':self.rgb.red(),
                'G':self.rgb.green(),
                'B':self.rgb.blue(),
                }
     code = util.translate_file('led_demo.template.py', mapping)
     self.ui.textEdit.setText(code)
Пример #2
0
 def update_code_box(self, *args, **kwargs):
     mapping = {
         "SERIAL_ID": self.ui.lineEdit_serialId.text(),
         "distance": self.ui.doubleSpinBox_distance.value(),
         "diameter": self.ui.doubleSpinBox_radius.value(),
         "speed": self.ui.doubleSpinBox_speed.value(),
     }
     code = util.translate_file("move_demo.template.py", mapping)
     self.ui.textEdit.setText(code)
Пример #3
0
 def update_code_box(self, *args, **kwargs):
     mapping = {'SERIAL_ID': self.ui.lineEdit_serialId.text(),
                'frequency':self.ui.spinBox_frequency.value(),
                }
     code = util.translate_file('buzzer_demo.template.py', mapping)
     self.ui.textEdit.setText(code)