Ejemplo n.º 1
0
 def updateFio(self, serial, inputConnection):
     dev = self.getDevice(serial)
     try:
         self.scanEvent.clear()
         if dev.devType == 9:
             UE9FIO.updateFIO(dev, inputConnection)
         else:
             current = dev.fioList[inputConnection.fioNumber]
             current.transform(dev, inputConnection)
             self.remakeFioList(dev)
     finally:
         self.scanEvent.set()
Ejemplo n.º 2
0
    def getFioInfo(self, serial, inputNumber):
        dev = self.getDevice(serial)

        if inputNumber in DAC_DICT.keys():
            returnDict = {
                "state": dev.readRegister(inputNumber),
                "label": DAC_DICT[inputNumber],
                "connectionNumber": inputNumber,
                "chType": "DAC",
            }
        elif dev.devType == 9:
            returnDict = UE9FIO.getFioInfo(dev, inputNumber)
        else:
            returnDict = dev.fioList[inputNumber].asDict()

        # devType, productName
        returnDict["device"] = deviceAsDict(dev)

        return returnDict
Ejemplo n.º 3
0
                        print "In opening a U6: %s" % e

                elif dev["prodId"] == 9:
                    d = ue9.UE9(LJSocket=ljsocketAddress, serial=dev["serial"])
                    d.commConfig()
                    d.controlConfig()

                    d.meetsFirmwareRequirements = True
                    if float(d.controlFWVersion) < UE9_MIN_FIRMWARE_VERSION[0]:
                        d.meetsFirmwareRequirements = False
                    elif float(d.commFWVersion) < UE9_MIN_FIRMWARE_VERSION[1]:
                        d.meetsFirmwareRequirements = False

                    self._addTimerModesToDevice(d, 6)

                    UE9FIO.setupNewDevice(d)
                elif dev["prodId"] == 0x501:
                    continue
                else:
                    raise Exception("Unknown device type")

                d.scanCache = (0, None)
                d.timerCounterCache = None
                self.devices["%s" % dev["serial"]] = d

            # Remove the disconnected devices
            for serial in self.devices.keys():
                if serial not in serials:
                    print "Removing device with serial = %s" % serial
                    self.devices[str(serial)].close()
                    self.devices.pop(str(serial))