Ejemplo n.º 1
0
    def on(self):  #sets the settings and inv_enable to 1, then sends settings
        self.setcurrentcurve()
        self.setdirection()
        self.setmode()
        self.inv_enableon()

        test_python_fpga.send_settings(self.a_chosenCurve)
        test_python_fpga.send_enable(self.a_inv_enable)
Ejemplo n.º 2
0
    def on(self):
        self.setcurrentcurve()
        self.setdirection()
        self.setmode()
        self.inv_enableon()

        test_python_fpga.send_settings(self.a_chosenCurve)
        test_python_fpga.send_enable(self.a_inv_enable)
Ejemplo n.º 3
0
    def on(self):  #sets the settings and inv_enable to 1, then sends settings

        if (self.radioButtonSpeed.isChecked()
                or self.radioButtonTorque.isChecked()):
            self.setcurrentcurve()
            self.setmode()
            self.inv_enableon()
            test_python_fpga.send_settings(self.a_chosenCurve)
            test_python_fpga.send_enable(self.a_inv_enable)
        else:
            print("Check speed or torque mode")
            with open('DisplayConsole.txt', 'a') as display_console:
                display_console.write("Check speed or torque mode")
            self.updateconsole()
Ejemplo n.º 4
0
    def on(self): #sets the settings and inv_enable to 1, then sends settings

        if (self.radioButtonSpeed.isChecked() or self.radioButtonTorque.isChecked()):
            self.setcurrentcurve()
            self.setmode()
            self.inv_enableon()
            test_python_fpga.send_settings(self.a_chosenCurve)
            test_python_fpga.send_enable(self.a_inv_enable)

            self.writetolog("'on' function executed correctly.")
            self.writetoconsolelog("Turn on successful.\nCurve mode is: " + self.mirror_chosenCure + "\nMode is: " +
                                   self.mirror_targetMode)


        else:
            print("Check speed or torque mode")
            str1 = "hello my name is\n\n\n\n\n\n\n\n\n\n\n\ndf"
            self.writetolog(str1)
            self.updateconsole()
Ejemplo n.º 5
0
    def on(self):  #sets the settings and inv_enable to 1, then sends settings

        if (self.radioButtonSpeed.isChecked()
                or self.radioButtonTorque.isChecked()):

            error_handler1 = logging.FileHandler(
                'errorLog' + self.logname)  # errorHandler setup
            error_handler1.setLevel(logging.ERROR)
            error_handler1.setFormatter(self.errorFormatter)

            info_handler1 = logging.FileHandler(
                'infoLog' + self.logname)  # infoHandler setup
            info_handler1.setLevel(logging.INFO)
            info_handler1.setFormatter(self.infoFormatter)

            self.infoLogger.removeHandler(self.error_handler)
            self.errorLogger.removeHandler(self.info_handler)

            self.error_handler = error_handler1
            self.info_handler = info_handler1

            self.errorLogger.addHandler(
                self.error_handler)  # binds handler with the logger object
            self.infoLogger.addHandler(self.info_handler)

            self.infoLogger.info("On function start")

            self.writetoconsolelog("Turn on successful.\nCurve mode is: " +
                                   self.mirror_chosenCure + "\nMode is: " +
                                   self.mirror_targetMode)

            self.setcurrentcurve()
            self.setmode()
            self.inv_enableon()
            test_python_fpga.send_settings(self.a_chosenCurve)
            test_python_fpga.send_enable(self.a_inv_enable)

        else:
            self.writetoconsolelog("Check speed or torque mode")
Ejemplo n.º 6
0
    def pushbuttonsendcommand(self):
        preppedSpeed = int(self.labelPreppedTargetSpeed.text()
                           )  # NEED to make all labels 0 initially
        preppedTime = int(self.labelPreppedInTime.text())
        preppedSetting = int(self.labelPreppedCurveMode.text())
        if not self.checkBoxSendConfirm.isChecked():
            toBeSent = "Send Confirm is not checked."
            self.textBrowserDisplay.setText(toBeSent)
        if self.checkBoxSendConfirm.isChecked():

            self.setdirection()
            self.setmode()
            self.inv_enableon()

            test_python_fpga.send_settings(self.targetTorque, self.targetSpeed,
                                           self.direction, self.inv_enable,
                                           self.inv_discharge, self.targetMode,
                                           self.torqueLimit, self.targetTime)

            toBeSent = "Target speed of " + str(preppedSpeed) + " in " + str(
                preppedTime
            ) + " seconds using a " + preppedSetting + " command sent."
            self.textBrowserDisplay.setText(toBeSent)
            self.checkBoxSendConfirm.setChecked(False)