def __init__(self, widget, ardXMLconfig, actionSave):
     super(self.__class__, self).__init__(widget)
     self.lastTimeCompStateWidgetUpdated = time.time()
     self.repopulating = False
     self.setupUi(self)  # This is defined in design.py file automatically
     # It sets up layout and widgets that are defined
     self.actionSave = actionSave
     self.componentID = ''
     self.componentType = "potentiometer"
     self.ardXMLconfig = ardXMLconfig
     self.ardXMLconfig.registerComponentAttributeChangedCallback(
         self.updateStateWidget)
     self.pickXPCommandDialog = pyXPpickXPCommandDialog.pyXPpickXPCommandDialog(
     )
     self.pickXPDatarefDialog = pyXPpickXPDatarefDialog.pyXPpickXPDatarefDialog(
     )
     self.PIN_comboBox.addItems(lib.arduinoXMLconfig.POT_PINS)
     self.DREFCMD_COLSIZE = 300
    def __init__(self, widget, ardXMLconfig, actionSave):
        super(self.__class__, self).__init__(widget)
        self.repopulating = False
        self.lastTimeCompStateWidgetUpdated = time.time()
        self.setupUi(self)  # This is defined in design.py file automatically
        # It sets up layout and widgets that are defined
        self.actionSave = actionSave
        self.componentID = ''
        self.componentType = "dig_output"
        self.ardXMLconfig = ardXMLconfig
        self.ardXMLconfig.registerComponentAttributeChangedCallback(
            self.updateStateWidget)
        self.pickXPCommandDialog = pyXPpickXPCommandDialog.pyXPpickXPCommandDialog(
        )
        self.pickXPDatarefDialog = pyXPpickXPDatarefDialog.pyXPpickXPDatarefDialog(
        )
        self.PIN_comboBox.addItems(lib.arduinoXMLconfig.DIG_IO_PINS)

        self.timer = QtCore.QTimer()
        self.timer.timeout.connect(self.updateStateWidget)
        self.timer.start(50)
Beispiel #3
0
    def __init__(self, widget, ardXMLconfig, actionSave):
        super(self.__class__, self).__init__(widget)
        self.repopulating = False
        self.setupUi(self)  # This is defined in design.py file automatically
        # It sets up layout and widgets that are defined
        self.actionSave = actionSave
        self.componentID = ''
        self.componentType = "rot_encoder"
        self.ardXMLconfig = ardXMLconfig
        self.ardXMLconfig.registerComponentAttributeChangedCallback(
            self.updateStateWidget)
        self.pickXPCommandDialog = pyXPpickXPCommandDialog.pyXPpickXPCommandDialog(
        )
        self.pickXPDatarefDialog = pyXPpickXPDatarefDialog.pyXPpickXPDatarefDialog(
        )
        self.PINA_comboBox.addItems(lib.arduinoXMLconfig.DIG_IO_PINS)
        self.PINB_comboBox.addItems(lib.arduinoXMLconfig.DIG_IO_PINS)
        self.steps_comboBox.addItems(['1', '2', '4'])
        self.DREFCMD_COLSIZE = 300

        self._hideDrefTables()
        self.testUP_CMDS_button.hide()
        self.testDOWN_CMDS_button.hide()
Beispiel #4
0
	def initialise(self):
		logging.debug("Running as user: "+getpass.getuser())
		self.loadConfig()
		XPrefData.loadXPReferenceFiles()

		XPUDP.pyXPUDPServer.initialiseUDPXMLConfig(UDPconfigFile)

		XPUDP.pyXPUDPServer.start()

		self.updatingCompPanel = True
		self._refreshingArduinoTree = False

		self.ardXMLconfig = lib.arduinoXMLconfig.arduinoConfig()
		self.ardXMLconfig.registerFileLoadedStatusCallback(self.handleArdFileLoadedStatusChanged)
		self.ardXMLconfig.loadConfigFile(self.ardConfigFile)
		self.ardXMLconfig.registerArduinoAttributeChangedCallback(self.handleArduinoAttributeChange)

		self.arduinoList = []

		self.refreshArduinoList()

		self.deleteConfirmDialog = deleteConfirmationDialog.DeleteConfirmationDialog()
		self.unsavedChangesConfirmationDialog = unsavedChangesConfirmationDialog.unsavedChangesConfirmationDialog()

		self.addArduinoDialog = pyXPaddArduinoDialog.pyXPAddArduinoDialog()
		self.pickXPCommandDialog = pyXPpickXPCommandDialog.pyXPpickXPCommandDialog()
		self.pickXPCommandDialog.refreshCommandList()
		self.editXPUDPConfigDialog = pyXPUDPConfigDialog.pyXPUDPConfigDialog(UDPconfigFile)
		#switch edit form
		self.ardSwitchEditForm = pyXPswitchEditForm.pyXPswitchEditForm(self.editPaneWidget, self.ardXMLconfig, self.actionSave)
		self.horizontalLayoutEditPane.addWidget(self.ardSwitchEditForm)
		self.ardSwitchEditForm.nameUpdated.connect(self.updateComponentName)

		#rot encoder edit form
		self.ardRotencoderEditForm = pyXProtencoderEditForm.pyXProtencoderEditForm(self.editPaneWidget, self.ardXMLconfig, self.actionSave)
		self.horizontalLayoutEditPane.addWidget(self.ardRotencoderEditForm)
		self.ardRotencoderEditForm.nameUpdated.connect(self.updateComponentName)

		#potentiometer edit form
		self.ardPotentiometerEditForm = pyXPpotentiometerEditForm.pyXPpotentiometerEditForm(self.editPaneWidget, self.ardXMLconfig, self.actionSave)
		self.horizontalLayoutEditPane.addWidget(self.ardPotentiometerEditForm)
		self.ardPotentiometerEditForm.nameUpdated.connect(self.updateComponentName)

		#PWM edit form
		self.ardPWMEditForm = pyXPpwmEditForm.pyXPpwmEditForm(self.editPaneWidget, self.ardXMLconfig, self.actionSave)
		self.horizontalLayoutEditPane.addWidget(self.ardPWMEditForm)
		self.ardPWMEditForm.nameUpdated.connect(self.updateComponentName)

		#Digital output edit form
		self.ardDigOutputEditForm = pyXPdigOutputEditForm.pyXPdigOutputEditForm(self.editPaneWidget, self.ardXMLconfig, self.actionSave)
		self.horizontalLayoutEditPane.addWidget(self.ardDigOutputEditForm)
		self.ardDigOutputEditForm.nameUpdated.connect(self.updateComponentName)

		#Servo edit form
		self.ardServoEditForm = pyXPservoEditForm.pyXPservoEditForm(self.editPaneWidget, self.ardXMLconfig, self.actionSave)
		self.horizontalLayoutEditPane.addWidget(self.ardServoEditForm)
		self.ardServoEditForm.nameUpdated.connect(self.updateComponentName)

		self.ardBaudComboBox.addItems(lib.arduinoXMLconfig.ARD_BAUD)

		self.refreshArduinoTree()
		self.ardSwitchEditForm.hide()
		self.arduinoEditForm.hide()
		self.ardPotentiometerEditForm.hide()
		self.ardPWMEditForm.hide()
		self.ardDigOutputEditForm.hide()
		self.ardServoEditForm.hide()
		self.ardRotencoderEditForm.hide()

		self.actionSave.setEnabled(False)
		self.updatingCompPanel = False