Ejemplo n.º 1
0
    def set_up(self):
        #self.voltmeter = devices.YoctoVoltageMeter("VOLTAGE1-10B5AF.voltage1", 0.16)
        self.voltmeter = devices.YoctoVoltageMeter("VOLTAGE1-10B59C.voltage1",
                                                   0.1)
        self.ammeter = devices.YoctoVoltageMeter("YAMPMK01-110B4A.current1",
                                                 0.1)

        self.selected_voltage = 24
Ejemplo n.º 2
0
    def set_up(self):
        self.voltmeter = devices.YoctoVoltageMeter("VOLTAGE1-10B5BE.voltage1",
                                                   0.1)  # DC Voltage
        self.voltmeterAC = devices.YoctoVoltageMeter(
            "VOLTAGE1-10B5BE.voltage2", 0.1)  # AC Voltage
        self.relay = RelayBoard(
            [7, 5, 3, 1, 9, 11, 13, 15, 10, 12, 14, 16, 8, 6, 4, 2], False)

        #self.servo = GPIO.PWM(gpios['SERVO'], 50)
        #self.servo.start(4)

        self.pi = pigpio.pi()
Ejemplo n.º 3
0
 def set_up(self):
     self.voltmeter = devices.YoctoVoltageMeter("VOLTAGE1-10B5AF.voltage1",
                                                0.16)
     self.relay = RelayBoard([
         9, 11, 13, 15, 16, 14, 12, 10, 1, 3, 5, 7, 8, 6, 4, 2, 24, 22, 20,
         18, 17, 19, 21, 23, 32, 30, 28, 26, 25, 27, 29, 31
     ], False)
Ejemplo n.º 4
0
    def set_up(self):
        self.disharge_time = 12
        self.rc_time = 5
        self.rc_voltage = 6

        self.relay_board = devices.SainBoard16(vid=0x0416, pid=0x5020, initial_status=None, number_of_relays=16,ribbon=True)
        self.voltmeter = devices.YoctoVoltageMeter("VOLTAGE1-A955C.voltage1", 0.16)
Ejemplo n.º 5
0
    def set_up(self):
        self.relay_board = devices.SainBoard16(vid=0x0416, pid=0x5020, initial_status=None, number_of_relays=16,ribbon=True)
        self.voltmeter = devices.YoctoVoltageMeter("VOLTAGE1-A955C.voltage1", 0.16)
        self.camera = cv2.VideoCapture('/dev/microsoft')  # video capture source camera
        #self.camera.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc('M', 'J', 'P', 'G'))

        gui_web.send({"command": "status", "value": "Vizualni pregled LED diod"})
        while not self.camera.isOpened():  # try to get the first frame of camera
            self.camera = cv2.VideoCapture('/dev/microsoft')
            #self.camera.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc('M', 'J', 'P', 'G'))
            time.sleep(0.1)

        # First picture is corrupted, so we leave it here.
        rval, frame = self.camera.read()

        self.led = []

        self.led.append({"x": 138,"y": 111}) # Append dictionary
        self.led.append({"x": 369,"y": 110}) # Append dictionary
        self.led.append({"x": 182,"y": 110}) # Append dictionary
        self.led.append({"x": 320,"y": 106}) # Append dictionary

        self.roi_x = 80
        self.roi_y = 200
        self.roi_width = 440
        self.roi_height = 180

        self.relay_board.close_relay(relays["Power"])
Ejemplo n.º 6
0
    def set_up(self):
        self.charging_time = 15

        self.relay_board = devices.SainBoard16(vid=0x0416, pid=0x5020, initial_status=None, number_of_relays=16,ribbon=True)
        self.voltmeter = devices.YoctoVoltageMeter("VOLTAGE1-A955C.voltage1", 0.16)

        self.relay_board.close_relay(relays["Power"])
Ejemplo n.º 7
0
 def set_up(self):
     self.relays = devices.SainBoard16(vid=0x0416,
                                       pid=0x5020,
                                       initial_status=None,
                                       number_of_relays=16)
     self.voltmeter = devices.YoctoVoltageMeter("VOLTAGE1-DEE80.voltage1",
                                                0.16)
Ejemplo n.º 8
0
 def set_up(self):
     self.relay_board = devices.SainBoard16(vid=0x0416,
                                            pid=0x5020,
                                            initial_status=None,
                                            number_of_relays=16)
     self.mesurement_delay = 0.16
     self.measurement_results = {}
     self.voltmeter = devices.YoctoVoltageMeter("VOLTAGE1-A08C8.voltage1",
                                                self.mesurement_delay)
Ejemplo n.º 9
0
    def set_up(self):
        try:
            strips_tester.data['device_yocto']
        except KeyError:  # Ammeter not initialized yet
            strips_tester.data['device_yocto'] = devices.YoctoVoltageMeter(
                "YAMPMK01-EC277.current1", 0.1)

        self.ammeter = strips_tester.data['device_yocto']
        return
Ejemplo n.º 10
0
    def set_up(self):
        self.relays = devices.SainBoard16(vid=0x0416,
                                          pid=0x5020,
                                          initial_status=None,
                                          number_of_relays=16)
        self.voltmeter = devices.YoctoVoltageMeter("VOLTAGE1-DEE80.voltage1",
                                                   0.16)

        self.flasher = devices.STLink()
        self.flasher.set_binary(strips_tester.settings.test_dir + "/bin/" +
                                strips_tester.data['program'] + ".bin")
Ejemplo n.º 11
0
    def set_up(self):  # Prepare FTDI USB-to-serial devices
        self.voltmeter = devices.YoctoVoltageMeter("VOLTAGE1-10B5AF.voltage2",
                                                   0.5)
        self.relay = RelayBoard([
            9, 11, 13, 15, 16, 14, 12, 10, 1, 3, 5, 7, 8, 6, 4, 2, 24, 22, 20,
            18, 17, 19, 21, 23, 32, 30, 28, 26, 25, 27, 29, 31
        ], False)
        self.ftdi = devices.ArduinoSerial('/dev/ftdi',
                                          baudrate=57600,
                                          mode="hex")

        self.ftdi.ser.flushInput()
        self.ftdi.ser.flushOutput()
Ejemplo n.º 12
0
    def set_up(self):
        self.relay_board = devices.SainBoard16(vid=0x0416, pid=0x5020, initial_status=None, number_of_relays=16,ribbon=True)
        self.voltmeter = devices.YoctoVoltageMeter("VOLTAGE1-A955C.voltage1", 0.16)

        # Measure order: lednum,color_I_def,toleranca_I_def,
        self.measure_order = [
            (0, "blue left", 40.0, 20.0),
            (1, "green left", 40.0, 30.0),
            (2, "red left", 40.0, 20.0),
            (3, "blue right", 40.0, 20.0),
            (4, "green right", 40.0, 30.0),
            (5, "red right", 40.0, 20.0),
            (6, "white", 120.0, 20.0)
        ]

        self.relay_board.close_relay(relays["Power"])
Ejemplo n.º 13
0
    def set_up(self):
        self.relays = devices.SainBoard16(vid=0x0416,
                                          pid=0x5020,
                                          initial_status=None,
                                          number_of_relays=16)
        self.voltmeter = devices.YoctoVoltageMeter("VOLTAGE1-DEE80.voltage1",
                                                   0.16)

        self.serial = serial.Serial(port="/dev/serial0",
                                    baudrate=115200,
                                    bytesize=serial.EIGHTBITS,
                                    parity=serial.PARITY_NONE,
                                    stopbits=serial.STOPBITS_ONE,
                                    xonxoff=0,
                                    rtscts=0,
                                    timeout=0.5,
                                    dsrdtr=0)

        self.temp_sensor = devices.IRTemperatureSensor(0)  # meas delay = 0
Ejemplo n.º 14
0
    def test_relays(self, queue):
        #module_logger.info("Testing_relays...")
        module_logger.info("Testiranje relejev...")
        relay_tests = []
        self.relay_board.open()
        self.mesurement_delay = 0.0
        self.voltmeter = devices.YoctoVoltageMeter("VOLTAGE1-A08C8.voltage1",
                                                   self.mesurement_delay)
        ''' | delay_R1 delay_R2  sum_delay
            |     |      |     |  ...
            |-----------------------
            |     0.3   0.7    1.0
        '''
        delay_R1 = 0.3
        delay_R2 = 0.7
        sum_delay = 1.0
        R2_voltage = [14.5, 0.0, 0.0]
        R1_voltage = [0.0, 0.0, 14.5]

        # time.sleep(1.0)  # relay board open time
        # # before test, both open
        # # RE1
        # self.relay_board.close_relay(relays["RE1"])
        # time.sleep(0.250)
        # if not self.voltmeter.in_range(14.5 - 1.0, 14.5 + 1.0):
        #     self.relay_exit(queue)
        #     return False
        # else:
        #     relay_tests.append(True)
        # self.relay_board.open_relay(relays["RE1"])
        # # RE2
        # time.sleep(0.5)
        # self.relay_board.close_relay(relays["RE2"])
        # time.sleep(0.250)
        # if not self.voltmeter.in_range(14.5 - 1.0, 14.5 + 1.0):
        #     self.relay_exit(queue)
        #     return False
        # else:
        #     relay_tests.append(True)
        # self.relay_board.open_relay(relays["RE2"])

        #print(time.time())
        start_time = queue.get(block=True, timeout=10)
        #print('s',start_time)
        for i in range(len(R1_voltage)):
            # RE1
            self.relay_board.close_relay(relays["RE1"])
            dt = (start_time + i * (sum_delay) + delay_R1) - time.time()
            while 0.0 < dt:
                time.sleep(0.5 * dt)
                dt = (start_time + i * (sum_delay) + delay_R1) - time.time()
            # relay_tests.append(self.voltmeter.in_range(R1_voltage[i] - 1.0, R1_voltage[i] + 1.0))
            #print(time.time())
            #module_logger.info('Voltage %s', self.voltmeter.read())
            if not self.voltmeter.in_range(R1_voltage[i] - 1.0,
                                           R1_voltage[i] + 1.0):
                #print(time.time())
                module_logger.error("Releji ne delujejo1." + str(i))
                self.relay_exit(queue)
                return False
            else:
                relay_tests.append(True)
            #print(time.time())
            self.relay_board.open_relay(relays["RE1"])
            # RE2
            self.relay_board.close_relay(relays["RE2"])
            dt = (start_time + i * (sum_delay) + delay_R2) - time.time()
            while 0.0 < dt:
                time.sleep(0.5 * dt)
                dt = (start_time + i * (sum_delay) + delay_R2) - time.time()
            # relay_tests.append(self.voltmeter.in_range(R2_voltage[i] - 1.0, R2_voltage[i] + 1.0))
            #print(time.time())
            if not self.voltmeter.in_range(R2_voltage[i] - 1.0,
                                           R2_voltage[i] + 1.0):
                #print(time.time())
                module_logger.error("Releji ne delujejo2." + str(i))
                self.relay_exit(queue)
                return False
            else:
                relay_tests.append(True)
            #print(time.time())
            self.relay_board.open_relay(relays["RE2"])
            #print('\n\n\n')

        self.relay_board.close()
        self.voltmeter.close()
        result = all(relay_tests)
        queue.put(result)
        return all(relay_tests)
Ejemplo n.º 15
0
 def set_up(self):
     self.voltmeter = devices.YoctoVoltageMeter("VOLTAGE1-10B572.voltage1",
                                                0.1)
     self.ammeter = devices.YoctoVoltageMeter("YAMPMK01-EC255.current1",
                                              0.1)
     self.selected_voltage = 48
Ejemplo n.º 16
0
 def set_up(self):
     self.voltmeter = devices.YoctoVoltageMeter("VOLTAGE1-12AD89.voltage1",
                                                0.1)
     self.ammeter = devices.YoctoVoltageMeter("YAMPMK01-126A7B.current1",
                                              0.1)