Exemple #1
0
    def init_edit_widget(self):

        """
        Constructs the GUI controls. Usually, you can omit this function
        altogether, but if you want to implement more advanced functionality,
        such as controls that are grayed out under certain conditions, you need
        to implement this here.
        """

        # First, call the parent constructor, which constructs the GUI controls
        # based on info.json.
        qtautoplugin.init_edit_widget(self)
        # If you specify a 'name' for a control in info.json, this control will
        # be available self.[name]. The type of the object depends on the
        # control. A checkbox will be a QCheckBox, a line_edit will be a
        # QLineEdit. Here we connect the stateChanged signal of the QCheckBox,
        # to the setEnabled() slot of the QLineEdit. This has the effect of
        # disabling the QLineEdit when the QCheckBox is uncheckhed. We also
        # explictly set the starting state.
        #self.line_edit_widget.setEnabled(self.checkbox_widget.isChecked())
        #self.checkbox_widget.stateChanged.connect(
        #    self.line_edit_widget.setEnabled)
        ELister = EvtExchanger()
        listofdevices = ELister.Attached()
        for i in listofdevices:
            self.VAS_ENCODERID_widget.addItem(i)
        self.VAS_TIMERNAME_widget.setEnabled(self.VAS_EXIT_METHOD_widget.currentText() == u'TIME')
        self.VAS_DURATION_widget.setEnabled(self.VAS_EXIT_METHOD_widget.currentText() == u'TIME')
        self.VAS_EXITKEY_widget.setEnabled(self.VAS_EXIT_METHOD_widget.currentText() == u'KEY')
        self.VAS_EXIT_METHOD_widget.currentTextChanged.connect(self.c)
Exemple #2
0
    def init_edit_widget(self):

        # Pass the word on to the parent
        qtautoplugin.init_edit_widget(self)

        EE = EvtExchanger()
        listofdevices = EE.Attached()
        for i in listofdevices:
            self.ProductName_widget.addItem(i)
Exemple #3
0
	def init_edit_widget(self):
	# Pass the word on to the parent
		qtautoplugin.init_edit_widget(self)

		EE = EvtExchanger()
		listOfDevices = EE.Attached(u"SHOCKER")
		# if there is no shocker attached, the selected name defaults to 'Dummy' again.
		if listOfDevices:
			for i in listOfDevices:
				self.ProductName_widget.addItem(i)
		else:
			self.var._productName = u"DUMMY"
		
		self.duration_widget.setEnabled(False)
		
		self.value_widget.returnPressed.connect(self.perc_check)
		self.Calibrate_widget.currentTextChanged.connect(self.type_check)
		self.value_widget.setEnabled(self.Calibrate_widget.currentText() == u'Shock')