예제 #1
0
from os import path

import tester
import mpm_tests
import cold_tests
from mapping_parser import import_mappings
import logging
import time

plutoGateway_mapping_path = path.join(path.dirname(path.realpath(__file__)),
                                      "mapping", "cold_modbus_mapping.csv")
testbox_mapping_path = path.join(path.dirname(path.realpath(__file__)),
                                 "mapping", "PLC_Certification_Chassis.xlsx")

testBox, plutoGateway = import_mappings(plutoGateway_mapping_path,
                                        testbox_mapping_path,
                                        'ColdCryo Cables')

mpm_tester = tester.Tester(testBox, plutoGateway)
mpm_tester.connectTestBox()
mpm_tester.connectGateway(timeout=30)

#asdas

#a= mpm_tests.TestPlutoConnect(mpm_tester, -1)
#a.run()
#a= mpm_tests.TestTestBoxConnect(mpm_tester, -1)
#a.run()

a = cold_tests.TestDigitalInputs(mpm_tester, 1)
a.button_run()
예제 #2
0
    def __init__(self, parent=None, args=None, macros=None):
        super(VaccumTests, self).__init__(parent=parent, macros=macros)

        #logging.basicConfig(filename=path.join(path.dirname(path.realpath(__file__)), "logs",'vaccumTests.log'), level=logging.DEBUG)
        logging.basicConfig(filename='C:\\Users\\joaoprod\\Documents\\GitHub\\lsstPLCsTestBox\\logs\\vaccumTests2.log',
                            level=logging.DEBUG)
        logging.debug('This message should go to the log file')
        logging.info('So should this')
        logging.warning('And this, too')
        print(path.join(path.dirname(path.realpath(__file__)), "logs",'vaccumTests.log'))

        plutoGateway_mapping_path = path.join(path.dirname(path.realpath(__file__)), "mapping", "vac_modbus_mapping.csv")
        testbox_mapping_path = path.join(path.dirname(path.realpath(__file__)), "mapping", "PLC_Certification_Chassis.xlsx")

        testbox , plutoGateway = import_mappings(plutoGateway_mapping_path,testbox_mapping_path,'Vaccum cables')

        self.vac_tester = tester.Tester(testbox , plutoGateway)


        self.vac_tester.tests.append(vac_tests.TestPlutoGatewayConfig(self.vac_tester, -1))
        self.vac_tester.tests.append(vac_tests.TestPlutoPLCsPresent(self.vac_tester, -1))

        self.vac_tester.tests.append(vac_tests.TestChannelsBootDefault(self.vac_tester, -1))

        self.vac_tester.tests.append(vac_tests.TestPlutoWriteReadback(self.vac_tester, -1))

        #self.vac_tester.tests.append(vac_tests.TestAnalogScaling(self.vac_tester, -1))

        #self.vac_tester.tests.append(vac_tests.TestHvCvDifferences(self.vac_tester, -1))

        self.vac_tester.tests.append(vac_tests.TestCvValves(self.vac_tester, -1))
        self.vac_tester.tests.append(vac_tests.TestValveMonitors(self.vac_tester, -1))

        self.vac_tester.tests.append(vac_tests.TestHvStat(self.vac_tester, -1))
        #self.vac_tester.tests.append(vac_tests.TestHvTurboOnOfflogic(self.vac_tester, -1))
        self.vac_tester.tests.append(vac_tests.TestHvTurboPermitBlock(self.vac_tester, -1))
        self.vac_tester.tests.append(vac_tests.TestHvTurboPermitAuto(self.vac_tester, -1))

        self.vac_tester.tests.append(vac_tests.TestCvStat(self.vac_tester, -1))
        #self.vac_tester.tests.append(vac_tests.TestCvTurboOnOfflogic(self.vac_tester, -1))
        self.vac_tester.tests.append(vac_tests.TestCvTurboPermitBlock(self.vac_tester, -1))
        self.vac_tester.tests.append(vac_tests.TestCvTurboPermitAuto(self.vac_tester, -1))


        for i, test in enumerate( self.vac_tester.tests):
            test.id=i



        self.table = self.ui.tableWidget

        headers= ["Test","Description","","Step","Details"]

        self.table.setRowCount(len(self.vac_tester.tests))
        self.table.setColumnCount(len(headers))

        self.table.setHorizontalHeaderLabels(headers)
        self.table.setVerticalHeaderLabels([str(e)  for e in list(range(1,len(self.vac_tester.tests)+1))])

        for i, test in enumerate(self.vac_tester.tests):
            self.update_table_line(i)
        self.table.setCurrentCell(0, 0 ,QItemSelectionModel.Rows)

        self.table.itemChanged.connect(self.item_changed)

        self.table.setColumnWidth(0, 160)
        self.table.setColumnWidth(1, 300)
        self.table.setColumnWidth(2, 50)
        self.table.setColumnWidth(3, 250)

        self.vac_tester.test_line_update.connect(self.update_table_line)
        self.vac_tester.monitor_update.connect(self.update_monitor_menu)

        self.ui.runAllButton.clicked.connect(self.vac_tester.run_all)
        self.ui.abortButton.clicked.connect(self.vac_tester.abort)
예제 #3
0
    def __init__(self, parent=None, args=None, macros=None):
        super(ComMpmTests, self).__init__(parent=parent, macros=macros)

        logging.basicConfig(filename='comMpmTests%s.log', level=logging.DEBUG)

        plutoGateway_mapping_path = path.join(
            path.dirname(path.realpath(__file__)), "mapping",
            "com_mpm_modbus_mapping.csv")
        testbox_mapping_path = path.join(path.dirname(path.realpath(__file__)),
                                         "mapping",
                                         "PLC_Certification_Chassis.xlsx")

        testBox, plutoGateway = import_mappings(plutoGateway_mapping_path,
                                                testbox_mapping_path,
                                                'COM MPM Cables')

        print('ola')

        self.mpm_tester = tester.Tester(testBox, plutoGateway)
        #self.mpm_tester.connectTestBox()
        #self.mpm_tester.connectGateway(timeout=30)

        self.mpm_tester.tests.append(
            com_mpm_tests.TestPlutoGatewayConfig(self.mpm_tester, -1))
        self.mpm_tester.tests.append(
            com_mpm_tests.TestPlutoPLCsPresent(self.mpm_tester, -1))

        self.mpm_tester.tests.append(
            com_mpm_tests.TestChannelsBootDefault(self.mpm_tester, -1))

        self.mpm_tester.tests.append(
            com_mpm_tests.TestPlutoWriteReadback(self.mpm_tester, -1))

        self.mpm_tester.tests.append(
            com_mpm_tests.TestPermitsBlock(self.mpm_tester, -1))
        self.mpm_tester.tests.append(
            com_mpm_tests.TestAcPermitCoolantValve(self.mpm_tester, -1))

        self.mpm_tester.tests.append(
            com_mpm_tests.TestVacuumToRefPermits(self.mpm_tester, -1))
        #self.mpm_tester.tests.append(com_mpm_tests.TestColdCryoPermits(self.mpm_tester, -1))

        for i, test in enumerate(self.mpm_tester.tests):
            test.id = i

        self.table = self.ui.tableWidget

        headers = ["Test", "Description", "", "Step", "Details"]

        self.table.setRowCount(len(self.mpm_tester.tests))
        self.table.setColumnCount(len(headers))

        self.table.setHorizontalHeaderLabels(headers)
        self.table.setVerticalHeaderLabels(
            [str(e) for e in list(range(1,
                                        len(self.mpm_tester.tests) + 1))])

        for i, test in enumerate(self.mpm_tester.tests):
            self.update_table_line(i)
        self.table.setCurrentCell(0, 0, QItemSelectionModel.Rows)

        self.table.itemChanged.connect(self.item_changed)

        self.table.setColumnWidth(0, 160)
        self.table.setColumnWidth(1, 300)
        self.table.setColumnWidth(2, 50)
        self.table.setColumnWidth(3, 250)

        self.mpm_tester.test_line_update.connect(self.update_table_line)
        self.mpm_tester.monitor_update.connect(self.update_monitor_menu)

        self.ui.runAllButton.clicked.connect(self.mpm_tester.run_all)
        self.ui.abortButton.clicked.connect(self.mpm_tester.abort)
예제 #4
0
    def __init__(self, parent=None, args=None, macros=None):
        super(ColdTests, self).__init__(parent=parent, macros=macros)

        logging.basicConfig(filename='vaccumTests%s.log', level=logging.DEBUG)

        plutoGateway_mapping_path = path.join(
            path.dirname(path.realpath(__file__)), "mapping",
            "cold_modbus_mapping.csv")
        testbox_mapping_path = path.join(path.dirname(path.realpath(__file__)),
                                         "mapping",
                                         "PLC_Certification_Chassis.xlsx")

        testBox, plutoGateway = import_mappings(plutoGateway_mapping_path,
                                                testbox_mapping_path,
                                                'ColdCryo Cables')

        self.cold_tester = tester.Tester(testBox, plutoGateway)
        self.cold_tester.connectTestBox()
        self.cold_tester.connectGateway(timeout=30)

        self.cold_tester.tests.append(
            cold_tests.TestPlutoGatewayConfig(self.cold_tester, -1))
        self.cold_tester.tests.append(
            cold_tests.TestPlutoPLCsPresent(self.cold_tester, -1))

        self.cold_tester.tests.append(
            cold_tests.TestChannelsBootDefault(self.cold_tester, -1))

        self.cold_tester.tests.append(
            cold_tests.TestPlutoWriteReadback(self.cold_tester, -1))

        self.cold_tester.tests.append(
            cold_tests.TestDigitalInputs(self.cold_tester, -1))
        self.cold_tester.tests.append(
            cold_tests.TestSensorsValid(self.cold_tester, -1))
        self.cold_tester.tests.append(
            cold_tests.TestImmediateTrips(self.cold_tester, -1))
        self.cold_tester.tests.append(
            cold_tests.TestImmediatePowerTrips(self.cold_tester, -1))

        self.cold_tester.tests.append(
            cold_tests.TestOilFailureWhileRunning(self.cold_tester, -1))

        self.cold_tester.tests.append(
            cold_tests.TestCurrentValid(self.cold_tester, -1))
        self.cold_tester.tests.append(
            cold_tests.TestDelayPowerTrip(self.cold_tester, -1))
        self.cold_tester.tests.append(
            cold_tests.TestDelayDisPressTrip(self.cold_tester, -1))
        self.cold_tester.tests.append(
            cold_tests.TestDelayDisTempTrip(self.cold_tester, -1))

        for i, test in enumerate(self.cold_tester.tests):
            test.id = i

        self.table = self.ui.tableWidget

        headers = ["Test", "Description", "", "Step", "Details"]

        self.table.setRowCount(len(self.cold_tester.tests))
        self.table.setColumnCount(len(headers))

        self.table.setHorizontalHeaderLabels(headers)
        self.table.setVerticalHeaderLabels(
            [str(e) for e in list(range(1,
                                        len(self.cold_tester.tests) + 1))])

        for i, test in enumerate(self.cold_tester.tests):
            self.update_table_line(i)
        self.table.setCurrentCell(0, 0, QItemSelectionModel.Rows)

        self.table.itemChanged.connect(self.item_changed)

        self.table.setColumnWidth(0, 160)
        self.table.setColumnWidth(1, 300)
        self.table.setColumnWidth(2, 50)
        self.table.setColumnWidth(3, 250)

        self.cold_tester.test_line_update.connect(self.update_table_line)
        self.cold_tester.monitor_update.connect(self.update_monitor_menu)

        self.ui.runAllButton.clicked.connect(self.cold_tester.run_all)
        self.ui.abortButton.clicked.connect(self.cold_tester.abort)