class Ventana(QtGui.QMainWindow):

    def __init__(self):
        QtGui.QMainWindow.__init__(self)
        self.ventanita = Ui_MainWindow()
        self.ventanita.setupUi(self)
        self.connect(self.ventanita.radioManual, QtCore.SIGNAL('clicked()'), self.enableButtons)
        self.connect(self.ventanita.radioAuto, QtCore.SIGNAL('clicked()'), self.disableButtons)
        self.timer = QtCore.QTimer()
        self.connect(self.ventanita.BtnSpd1, QtCore.SIGNAL('clicked()'), self.speedOne)
        self.connect(self.ventanita.BtnSpd2, QtCore.SIGNAL('clicked()'), self.speedTwo)
        self.connect(self.ventanita.BtnSpd3, QtCore.SIGNAL('clicked()'), self.speedThree)

    def enableButtons(self):
        self.ventanita.BtnSpd1.setEnabled(True)
        self.ventanita.BtnSpd2.setEnabled(True)
        self.ventanita.BtnSpd3.setEnabled(True)

    def disableButtons(self):
        self.ventanita.BtnSpd1.setEnabled(False)
        self.ventanita.BtnSpd2.setEnabled(False)
        self.ventanita.BtnSpd3.setEnabled(False)

    def speedOne(self):
        #        arduino.Write('1')
        print("Velocidad 1")

    def speedTwo(self):
        #        arduino.Write('2')
        print("Velocidad 2")

    def speedThree(self):
        #        arduino.Write('3')
        print("Velocidad 3")
 def __init__(self):
     QtGui.QMainWindow.__init__(self)
     self.ventanita = Ui_MainWindow()
     self.ventanita.setupUi(self)
     self.connect(self.ventanita.radioManual, QtCore.SIGNAL('clicked()'), self.enableButtons)
     self.connect(self.ventanita.radioAuto, QtCore.SIGNAL('clicked()'), self.disableButtons)
     self.timer = QtCore.QTimer()
     self.connect(self.ventanita.BtnSpd1, QtCore.SIGNAL('clicked()'), self.speedOne)
     self.connect(self.ventanita.BtnSpd2, QtCore.SIGNAL('clicked()'), self.speedTwo)
     self.connect(self.ventanita.BtnSpd3, QtCore.SIGNAL('clicked()'), self.speedThree)
Exemple #3
0
class Ventana(QMainWindow):
    def __init__(self):
        QMainWindow.__init__(self)
        self.ventanita = Ui_MainWindow()
        self.ventanita.setupUi(self)
        self.connect(self.ventanita.radioManual, SIGNAL('clicked()'),
                     self.enableButtons)
        self.connect(self.ventanita.radioAuto, SIGNAL('clicked()'),
                     self.disableButtons)
        self.timer = QTimer()
        self.connect(self.ventanita.BtnSpd1, SIGNAL('clicked()'),
                     self.speedOne)
        self.connect(self.ventanita.BtnSpd2, SIGNAL('clicked()'),
                     self.speedTwo)
        self.connect(self.ventanita.BtnSpd3, SIGNAL('clicked()'),
                     self.speedThree)
        self.ventanita.radioManual.setChecked(True)
        self.arduino = ArduinoSerial()
        self.database = SQL()

    def enableButtons(self):
        self.ventanita.BtnSpd1.setEnabled(True)
        self.ventanita.BtnSpd2.setEnabled(True)
        self.ventanita.BtnSpd3.setEnabled(True)

    def disableButtons(self):
        self.ventanita.BtnSpd1.setEnabled(False)
        self.ventanita.BtnSpd2.setEnabled(False)
        self.ventanita.BtnSpd3.setEnabled(False)

    def speedOne(self):
        try:
            self.arduino.Write('1')
            print("Velocidad 1")
        except:
            print("Arduino no está conectado")

    def speedTwo(self):
        try:
            self.arduino.Write('2')
            print("Velocidad 2")
        except:
            print("Arduino no está conectado")

    def speedThree(self):
        try:
            self.arduino.Write('3')
            print("Velocidad 3")
        except:
            print("Arduino no está conectado")
class Ventana(QMainWindow):

    def __init__(self):
        QMainWindow.__init__(self)
        self.ventanita = Ui_MainWindow()
        self.ventanita.setupUi(self)
        self.connect(self.ventanita.radioManual, SIGNAL('clicked()'), self.enableButtons)
        self.connect(self.ventanita.radioAuto, SIGNAL('clicked()'), self.disableButtons)
        self.timer = QTimer()
        self.connect(self.ventanita.BtnSpd1, SIGNAL('clicked()'), self.speedOne)
        self.connect(self.ventanita.BtnSpd2, SIGNAL('clicked()'), self.speedTwo)
        self.connect(self.ventanita.BtnSpd3, SIGNAL('clicked()'), self.speedThree)
        self.ventanita.radioManual.setChecked(True)
        self.arduino = ArduinoSerial()
        self.database = SQL()

    def enableButtons(self):
        self.ventanita.BtnSpd1.setEnabled(True)
        self.ventanita.BtnSpd2.setEnabled(True)
        self.ventanita.BtnSpd3.setEnabled(True)

    def disableButtons(self):
        self.ventanita.BtnSpd1.setEnabled(False)
        self.ventanita.BtnSpd2.setEnabled(False)
        self.ventanita.BtnSpd3.setEnabled(False)

    def speedOne(self):
        try:
            self.arduino.Write('1')
            print("Velocidad 1")
        except:
            print("Arduino no está conectado")

    def speedTwo(self):
        try:
            self.arduino.Write('2')
            print("Velocidad 2")
        except:
            print("Arduino no está conectado")

    def speedThree(self):
        try:
            self.arduino.Write('3')
            print("Velocidad 3")
        except:
            print("Arduino no está conectado")
Exemple #5
0
 def __init__(self):
     QMainWindow.__init__(self)
     self.ventanita = Ui_MainWindow()
     self.ventanita.setupUi(self)
     self.connect(self.ventanita.radioManual, SIGNAL('clicked()'),
                  self.enableButtons)
     self.connect(self.ventanita.radioAuto, SIGNAL('clicked()'),
                  self.disableButtons)
     self.timer = QTimer()
     self.connect(self.ventanita.BtnSpd1, SIGNAL('clicked()'),
                  self.speedOne)
     self.connect(self.ventanita.BtnSpd2, SIGNAL('clicked()'),
                  self.speedTwo)
     self.connect(self.ventanita.BtnSpd3, SIGNAL('clicked()'),
                  self.speedThree)
     self.ventanita.radioManual.setChecked(True)
     self.arduino = ArduinoSerial()
     self.database = SQL()
 def __init__(self):
     QMainWindow.__init__(self)
     self.ventanita = Ui_MainWindow()
     self.ventanita.setupUi(self)
     self.connect(self.ventanita.radioManual, SIGNAL('clicked()'), self.enableButtons)
     self.connect(self.ventanita.radioAuto, SIGNAL('clicked()'), self.disableButtons)
     self.timer = QTimer()
     self.connect(self.ventanita.BtnSpd1, SIGNAL('clicked()'), self.speedOne)
     self.connect(self.ventanita.BtnSpd2, SIGNAL('clicked()'), self.speedTwo)
     self.connect(self.ventanita.BtnSpd3, SIGNAL('clicked()'), self.speedThree)
     self.ventanita.radioManual.setChecked(True)
     self.arduino = ArduinoSerial()
     self.database = SQL()