Пример #1
0
                        "level":
                        2
                    })
                if Logging.debug:
                    raise e
                self.compressor.close_port()
                time.sleep(4)


if __name__ == '__main__':
    # adding debug info
    if (len(sys.argv) > 1):
        for arg in sys.argv:
            if arg.startswith("-v"):
                Logging.verbos = arg.count("v")
    Logging.logEvent("Debug", "Status Update", {
        "message": "Debug on: Level {}".format(Logging.verbos),
        "level": 1
    })

    hw_status = HardwareStatusInstance.getInstance()
    hw_status.PC_104.digital_out.update({'CryoP Pwr Relay 1': True})

    thread = ShiCompressorUpdater()
    thread.daemon = True
    thread.start()

    while True:
        time.sleep(5)
        print(hw_status.ShiCryopump.getJson())
Пример #2
0
            if arg.startswith("-v"):
                Logging.verbos = arg.count("v")
    if(len(sys.argv)>2):
        for arg in sys.argv:
            if "--debug" in arg:
                Logging.debug = True
    Logging.logEvent("Debug","Status Update",
        {"message": "Verbos on: Level {}".format(Logging.verbos),
         "level":1})
    PORT = 8000

    Logging.logEvent("Debug","Status Update",
        {"message": "Starting initializing threads and drivers",
         "level":1})

    hardwareStatusInstance = HardwareStatusInstance.getInstance()
    profileInstance = ProfileInstance.getInstance()
    threadInstance = ThreadCollectionInstance.getInstance()

    Logging.logEvent("Event","System",
        {"message": "Server is fully booted",
        "ProfileInstance": profileInstance.getInstance()})
    Logging.logEvent("Debug","Status Update",
        {"message": "Finished initializing threads and drivers",
         "level":1})

    httpd = ReuseAddrTCPServer(("", PORT), VerbHandler)

    Logging.logEvent("Debug","Status Update",
        {"message": "Start Up Complete, Server is listening for request...",
         "level":1})
Пример #3
0
            'CC Correction': self.Pgauge.GetCorrCC(2)
        }, {
            'addr': 3,
            'Model Name': self.Pgauge.GetModelName(3),
            'Software Vir': self.Pgauge.GetSofwareV(3),
            'Pressure SP 1': self.Pgauge.GetSwPressure(3, True),
            'Pressure SP 2': self.Pgauge.GetSwPressure(3, False),
            'Pirani Correction': self.Pgauge.GetCorrPir(3)
        }]
        self.gauges.update(paramslist)


if __name__ == '__main__':
    # adding debug info
    if (len(sys.argv) > 1):
        for arg in sys.argv:
            if arg.startswith("-v"):
                Logging.verbos = arg.count("v")
    Logging.logEvent("Debug", "Status Update", {
        "message": "Debug on: Level {}".format(Logging.verbos),
        "level": 1
    })
    thread = PfeifferGaugeUpdater()
    thread.daemon = True
    thread.start()

    p = HardwareStatusInstance.getInstance().PfeifferGuages
    while True:
        time.sleep(5)
        print(p.getJson())
Пример #4
0
    def run(self):
        # While true to restart the thread if it errors out
        while True:
            # Check to make sure there is an active profile
            # and that we are sitting in an operational vacuum
            # and that all drivers and updaters are running
            if ProfileInstance.getInstance().activeProfile and \
                HardwareStatusInstance.getInstance().OperationalVacuum and \
                ProfileInstance.getInstance().zoneProfiles.getActiveProfileStatus():
                try:
                    Logging.logEvent("Debug", "Status Update", {
                        "message": "DCCS: Starting Duty Cycle thread",
                        "level": 2
                    })

                    Logging.logEvent(
                        "Event", "Start Profile", {
                            'time': datetime.time(),
                            "message": ProfileInstance.getInstance().
                            zoneProfiles.profileName,
                            "ProfileInstance": ProfileInstance.getInstance()
                        })

                    ProfileInstance.getInstance(
                    ).zoneProfiles.updateThermalStartTime(time.time())

                    # local temp variables for checking state
                    #TODO: Start time should gotten somewhere else, not made here
                    if self.zoneProfiles.thermalStartTime:
                        self.startTime = self.zoneProfiles.thermalStartTime
                    else:
                        self.startTime = int(time.time())
                    currentSetpointTemporary = 1
                    rampTemporary = False
                    soakTemporary = True

                    Logging.logEvent("Debug", "Status Update", {
                        "message": "DCCS: Setting up Platen",
                        "level": 2
                    })
                    HardwareStatusInstance.getInstance().TdkLambda_Cmds.append(
                        ['Setup Platen', ''])

                    for zone in self.zones:
                        if self.zones[zone].zoneProfile.activeZoneProfile:
                            self.zones[zone].maxTempRisePerMin = self.zones[
                                zone].zoneProfile.maxHeatPerMin
                            self.zones[zone].maxTempRisePerUpdate = (
                                self.zones[zone].maxTempRisePerMin /
                                60) * self.updatePeriod
                            self.zones[
                                zone].expected_temp_values, self.expected_time_values = self.zones[
                                    zone].createExpectedValues(
                                        self.zones[zone].zoneProfile.
                                        thermalProfiles,
                                        startTime=self.zoneProfiles.
                                        thermalStartTime)
                    # Program loop is here
                    while ProfileInstance.getInstance().activeProfile:

                        Logging.logEvent(
                            "Debug", "Status Update", {
                                "message": "DCCS: Running Duty Cycle Thread",
                                "level": 3
                            })

                        # You might need to stay is pause

                        # get current time
                        currentTime = time.time()

                        # if there is no more expected time values, break out of while True loop
                        if len(self.expected_time_values) <= 0:
                            break

                        # this will find the time value matching the current time
                        # and give us the temp value it should be at that time.
                        # print("currentTime: {}".format(currentTime))
                        # print("expected_time_values: {}".format(self.expected_time_values))
                        while currentTime > self.expected_time_values[0]:

                            for zone in self.zones:
                                if self.zones[
                                        zone].zoneProfile.activeZoneProfile:
                                    self.zones[
                                        zone].temp_temperature = self.zones[
                                            zone].expected_temp_values[0]
                                    self.zones[
                                        zone].expected_temp_values = self.zones[
                                            zone].expected_temp_values[1:]
                            self.expected_time_values = self.expected_time_values[
                                1:]
                            if len(self.setpoint_start_time) > 0:
                                if currentTime > self.setpoint_start_time[0][0]:
                                    rampTemporary = True
                                    soakTemporary = False
                                    if currentTime > self.setpoint_start_time[
                                            0][1]:
                                        rampTemporary = False
                                        soakTemporary = True
                                        self.setpoint_start_time = self.setpoint_start_time[
                                            1:]
                                        currentSetpointTemporary += 1
                                    if len(self.setpoint_start_time) <= 0:
                                        break

                            if len(self.expected_time_values) <= 0:
                                break

                        self.checkPause()
                        self.checkHold()
                        # compare the temps just made with the values in self.
                        # if they are different, or important log it
                        if rampTemporary == True and self.ramp == False:
                            ProfileInstance.getInstance(
                            ).currentSetpoint = currentSetpointTemporary
                            Logging.logEvent(
                                "Event", "Profile", {
                                    "message":
                                    "Profile {} has entered setpoint {} Ramp".
                                    format(
                                        ProfileInstance.getInstance(
                                        ).zoneProfiles.profileName,
                                        currentSetpointTemporary),
                                    "ProfileInstance":
                                    ProfileInstance.getInstance()
                                })
                        if soakTemporary == True and self.soak == False:
                            if currentSetpointTemporary > 1:
                                Logging.logEvent(
                                    "Event", "Profile", {
                                        "message":
                                        "Profile {} has entered setpoint {} Soak"
                                        .format(
                                            ProfileInstance.getInstance(
                                            ).zoneProfiles.profileName,
                                            currentSetpointTemporary - 1),
                                        "ProfileInstance":
                                        ProfileInstance.getInstance()
                                    })
                                ProfileInstance.getInstance.inRamp = False
                        self.ramp = rampTemporary
                        self.soak = soakTemporary
                        # With the temp goal tempurture picked, make the duty cycle
                        for zone in self.zones:
                            if self.zones[zone].zoneProfile.activeZoneProfile:
                                # This checks to see if a current temp has been made...
                                if self.zones[zone].temp_temperature:
                                    self.zones[zone].updateDutyCycle()
                                else:
                                    print("Waiting...")

                            if len(self.expected_time_values) <= 0:
                                break
                        # sleep until the next time around
                        time.sleep(self.updatePeriod)
                    # end of inner while True
                    # end of test

                    # turning off lamps at the end of test

                    for zone in self.zones:
                        if self.zones[zone].zoneProfile.activeZoneProfile:

                            zone = self.zones[zone]
                            if zone.lamps:
                                self.d_out.update(
                                    {zone.lamps[1] + " PWM DC": 0})
                                self.d_out.update(
                                    {zone.lamps[0] + " PWM DC": 0})
                            else:
                                HardwareStatusInstance.getInstance(
                                ).TdkLambda_Cmds.append(
                                    ['Platen Duty Cycle', 0])
                    #TODO: Turn off the heaters here

                    Logging.logEvent(
                        "Event", "End Profile", {
                            'time': datetime.time(),
                            "message": ProfileInstance.getInstance().
                            zoneProfiles.profileName,
                            "ProfileInstance": ProfileInstance.getInstance()
                        })

                    HardwareStatusInstance.getInstance().TdkLambda_Cmds.append(
                        ['Disable Platen Output', ''])

                    self.updateDBwithEndTime()
                    self.running = False
                    tcList = HardwareStatusInstance.getInstance(
                    ).Thermocouples.tcList
                    for tc in tcList:
                        tc.update({"zone": 0, "userDefined": False})

                    # self.zoneProfile.activeZoneProfile = False
                    # This assumes all zones have the same end time
                    ProfileInstance.getInstance().activeProfile = False
                    ProfileInstance.getInstance().vacuumWanted = False
                except Exception as e:
                    exc_type, exc_obj, exc_tb = sys.exc_info()
                    fname = os.path.split(
                        exc_tb.tb_frame.f_code.co_filename)[1]
                    print("Error: {} in file {}:{}".format(
                        exc_type, fname, exc_tb.tb_lineno))

                    self.running = False
                    ProfileInstance.getInstance(
                    ).zoneProfiles.activeProfile = False
                    Logging.debugPrint(
                        1, "DCCS: Error in run, Duty Cycle: {}".format(str(e)))
                    Logging.logEvent(
                        "Error", "Duty Cycle Control Stub Thread", {
                            "type": exc_type,
                            "filename": fname,
                            "line": exc_tb.tb_lineno,
                            "thread": "DutyCycleControlStub",
                            "ThreadCollection": self.parent,
                            "item": "Duty Cycle Control Stub",
                            "itemID": -1,
                            "details":
                            "There is a software error ({})".format(e)
                        })

                    if Logging.debug:
                        raise e
                # end of try, catch
            else:
                Logging.debugPrint(
                    4, "DCCS: activeProfile: {}".format(
                        ProfileInstance.getInstance().activeProfile))
                Logging.debugPrint(
                    4, "DCCS: OperationalVacuum: {}".format(
                        HardwareStatusInstance.getInstance().OperationalVacuum)
                )
                Logging.debugPrint(
                    4, "DCCS: getActiveProfileStatus: {}".format(
                        ProfileInstance.getInstance(
                        ).zoneProfiles.getActiveProfileStatus()))
            # Sleeping so it doesn't busy wait
            time.sleep(1)
Пример #5
0
    def run(self):
        # While true to restart the thread if it errors out
        while True:
            # Check to make sure there is an active profile
            # and that we are sitting in an operational vacuum
            # and that all drivers and updaters are running
            a_out = self.hardwareStatus.getInstance().PC_104.analog_out  # todo: better variable name?
            d_out = self.hardwareStatus.getInstance().PC_104.digital_out
            a_out.update({'LN2 Shroud': 0,'LN2 Platen': 0})
            d_out.update({'LN2-S Sol': False, 'LN2-P Sol': False, })
            if ProfileInstance.getInstance().activeProfile and HardwareStatusInstance.getInstance().OperationalVacuum:
                # try and catch anything that might go wrong
                try:
                    # some start up stuff here
                    ln2_max = 0.1
                    ln2_min = -0.2 
                    valveMax = 4095/2
                    time.sleep(self.SLEEP_TIME)
                    # hwStatus = self.hardwareStatus.getInstance()
                    if os.name == "posix":
                        userName = os.environ['LOGNAME']
                    else:
                        userName = "******" 

                    # Normal program loop
                    while ProfileInstance.getInstance().activeProfile and HardwareStatusInstance.getInstance().OperationalVacuum:
                        dutycyclelist = []
                        platenDuty = None
                        for zoneStr in self.ThreadCollection.dutyCycleThread.zones:
                            
                            zone = self.ThreadCollection.dutyCycleThread.zones[zoneStr]
                            # If a zone doesn't have a dutyCycle, they aren't running, so we can safely ignore them
                            try:
                                if zoneStr != "zone9":
                                    dutycyclelist.append(zone.dutyCycle)
                                else:
                                    platenDuty = zone.dutyCycle
                            except Exception as e:
                                pass
                        if dutycyclelist:
                            dutycyclemin = min(dutycyclelist)
                            Logging.debugPrint(3,"Min Duty Cycle: {}".format(dutycyclemin))

                            if dutycyclemin < ln2_max: # todo: arb_value to be determined
                                # throw safety up
                                d_out.update({'LN2-S Sol': True})
                                # 2500 is the point the valve should be opened too
                                #a_out.update({'LN2 Shroud': 4095, 'LN2 Platen': 4095})
                                PercentVavleopen = valveMax*(dutycyclemin-ln2_max)/(ln2_min-ln2_max)
                                if dutycyclemin < ln2_min:
                                    PercentVavleopen = valveMax
                                a_out.update({'LN2 Shroud': PercentVavleopen})
                                Logging.debugPrint(3,"The Shroud LN2 should be on {}".format(PercentVavleopen))
                            else:
                                Logging.debugPrint(3,"The Shroud LN2 should be off")
                                # What's the difference between this and...
                                d_out.update({'LN2-S Sol': False})
                                a_out.update({'LN2 Shroud': 0})
                            # end of if/else
                        # end of if DutycycleList
                        if platenDuty:
                            if platenDuty < ln2_max: # todo: arb_value to be determined
                                # throw safety up
                                d_out.update({'LN2-P Sol': True})
                                # 2500 is the point the valve should be opened too
                                #a_out.update({'LN2 Shroud': 4095, 'LN2 Platen': 4095})
                                PercentVavleopen = valveMax*(platenDuty-ln2_max)/(ln2_min-ln2_max)
                                if platenDuty < ln2_min:
                                    PercentVavleopen = valveMax
                                a_out.update({'LN2 Platen': PercentVavleopen})
                                Logging.debugPrint(3,"The Platen LN2 should be on {}".format(PercentVavleopen))
                            else:
                                Logging.debugPrint(3,"The Platen LN2 should be off")
                                # What's the difference between this and...
                                d_out.update({'LN2-P Sol': False, })
                                a_out.update({'LN2 Platen': 0})
                        time.sleep(self.SLEEP_TIME)
                    # end of Inner While True
                except Exception as e:
                    Logging.debugPrint(1, "Error in run, LN2 Control Stub: {}".format(str(e)))
                    if Logging.debug:
                        raise e
                # end of try catch
            else:
                Logging.debugPrint(4,"LN2: AP: {}, Vacuum: {}".format(ProfileInstance.getInstance().activeProfile,HardwareStatusInstance.getInstance().OperationalVacuum))
            # end of If should be running
            time.sleep(self.SLEEP_TIME)
Пример #6
0
    def run(self):
        # This should always stay on
        while True:
            # initialization of the safety Thread
            try:
                # Temps are in Kelvin
                MAX_OPERATING_TEMP = 437
                # safe at all lower bounds
                # MIN_OPERATING_TEMP

                MAX_TOUCH_TEMP = 318.15
                MIN_TOUCH_TEMP = 269.15

                # TODO, make this user defined
                # These are test values, they will change when the code is written to change them
                self.MAX_UUT_TEMP = {}
                self.MIN_UUT_TEMP = {}

                SLEEP_TIME = 1  # in seconds

                # Used to keep track of the first time through a loop
                vacuum = False

                hardwareStatusInstance = HardwareStatusInstance.getInstance()

                Logging.logEvent("Debug", "Status Update", {
                    "message": "Starting Safety Checker Thread",
                    "level": 3
                })
                # stop when the program ends
                while True:
                    Logging.logEvent("Debug", "Status Update", {
                        "message": "Running Safety Checker Thread",
                        "level": 4
                    })

                    tempErrorDict = {
                        "System Alarm: High Temperature": False,
                        "Product Saver Alarm: High Temperature": False,
                        "Product Saver Alarm: Low Temperature": False,
                        "Human Touch Alarm: High Temperature": False,
                        "Human Touch Alarm: Low Temperature": False,
                        "Pressure Loss In Profile": False,
                    }
                    TCs = hardwareStatusInstance.Thermocouples.ValidTCs
                    for tc in TCs:
                        # if there are any TC's higher than max temp
                        if tc.temp > MAX_OPERATING_TEMP:
                            # print("{}-> {}".format(tc.Thermocouple, tc.temp))
                            errorDetail = "TC # {} is above MAX_OPERATING_TEMP ({}). Currently {}c".format(
                                tc.Thermocouple, MAX_OPERATING_TEMP, tc.temp)
                            error = {
                                "time": str(datetime.now()),
                                "event": "System Alarm: High Temperature",
                                "item": "Thermocouple",
                                "itemID": tc.Thermocouple,
                                "details": errorDetail,
                                "actions": ["Turned off heater", "Log Event"]
                            }
                            self.logEvent(error)
                            tempErrorDict[error['event']] = True

                            d_out = HardwareStatusInstance.getInstance(
                            ).PC_104.digital_out
                            ProfileInstance.getInstance().activeProfile = False
                            Logging.debugPrint(
                                1,
                                "ERROR Heat was above max operating temperature ({})"
                                .format(tc.temp))
                            vacuum = False
                            d_out.update({"IR Lamp 1 PWM DC": 0})
                            d_out.update({"IR Lamp 2 PWM DC": 0})
                            d_out.update({"IR Lamp 3 PWM DC": 0})
                            d_out.update({"IR Lamp 4 PWM DC": 0})
                            d_out.update({"IR Lamp 5 PWM DC": 0})
                            d_out.update({"IR Lamp 6 PWM DC": 0})
                            d_out.update({"IR Lamp 7 PWM DC": 0})
                            d_out.update({"IR Lamp 8 PWM DC": 0})
                            d_out.update({"IR Lamp 9 PWM DC": 0})
                            d_out.update({"IR Lamp 10 PWM DC": 0})
                            d_out.update({"IR Lamp 11 PWM DC": 0})
                            d_out.update({"IR Lamp 12 PWM DC": 0})
                            d_out.update({"IR Lamp 13 PWM DC": 0})
                            d_out.update({"IR Lamp 14 PWM DC": 0})
                            d_out.update({"IR Lamp 15 PWM DC": 0})
                            d_out.update({"IR Lamp 16 PWM DC": 0})

                            HardwareStatusInstance.getInstance(
                            ).TdkLambda_Cmds.append(['Shroud Duty Cycle', 0])
                            HardwareStatusInstance.getInstance(
                            ).TdkLambda_Cmds.append(['Platen Duty Cycle', 0])

                            releaseHoldThread()
                        # end of max operational test

                        if tc.userDefined:
                            # print("tc: {} zone: {}".format(tc.Thermocouple,tc.zone))
                            if tc.zone != 0:
                                if tc.temp > ProfileInstance.getInstance(
                                ).zoneProfiles.getZone(tc.zone).maxHeatError:
                                    errorDetail = "TC # {} is above MAX_UUT_TEMP ({}). Currently {}c".format(
                                        tc.Thermocouple,
                                        ProfileInstance.getInstance().
                                        zoneProfiles.getZone(
                                            tc.zone).maxHeatError, tc.temp)
                                    error = {
                                        "time":
                                        str(datetime.now()),
                                        "event":
                                        "Product Saver Alarm: High Temperature",
                                        "item":
                                        "Thermocouple",
                                        "itemID":
                                        tc.Thermocouple,
                                        "details":
                                        errorDetail,
                                        "actions":
                                        ["Turned off heater", "Log Event"]
                                    }
                                    self.logEvent(error)
                                    tempErrorDict[error['event']] = True
                                # end of max user test

                                if tc.temp < ProfileInstance.getInstance(
                                ).zoneProfiles.getZone(tc.zone).minHeatError:
                                    errorDetail = "TC # {} is below MIN_UUT_TEMP ({}). Currently {}c".format(
                                        tc.Thermocouple,
                                        ProfileInstance.getInstance().
                                        zoneProfiles.getZone(
                                            tc.zone).minHeatError, tc.temp)
                                    error = {
                                        "time":
                                        str(datetime.now()),
                                        "event":
                                        "Product Saver Alarm: Low Temperature",
                                        "item":
                                        "Thermocouple",
                                        "itemID":
                                        tc.Thermocouple,
                                        "details":
                                        errorDetail,
                                        "actions":
                                        ["Turned off LN flow", "Log Event"]
                                    }
                                    self.logEvent(error)
                                    tempErrorDict[error['event']] = True
                        # end of min user test
                        # end of user test

                        # Get the full list
                        OutsideThermoCouples = []
                        if tc.Thermocouple in OutsideThermoCouples:
                            if tc.temp > MAX_TOUCH_TEMP:
                                errorDetail = "TC # {} is above MAX_TOUCH_TEMP ({}). Currently {}c".format(
                                    tc.Thermocouple, MAX_TOUCH_TEMP, tc.temp)
                                error = {
                                    "time": str(datetime.now()),
                                    "event":
                                    "Human Touch Alarm: High Temperature",
                                    "item": "Thermocouple",
                                    "itemID": tc.Thermocouple,
                                    "details": errorDetail,
                                    "actions": ["Log Event"]
                                }
                                self.logEvent(error)
                                tempErrorDict[error['event']] = True
                            # end of max touch test

                            if tc.temp < MIN_TOUCH_TEMP:
                                errorDetail = "TC # {} is below MIN_TOUCH_TEMP ({}). Currently {}c".format(
                                    tc.Thermocouple, MIN_TOUCH_TEMP, tc.temp)
                                error = {
                                    "time": str(datetime.now()),
                                    "event":
                                    "Human Touch Alarm: Low Temperature",
                                    "item": "Thermocouple",
                                    "itemID": tc.Thermocouple,
                                    "details": errorDetail,
                                    "actions": ["Log Event"]
                                }
                                self.logEvent(error)
                                tempErrorDict[error['event']] = True
                    # end of min touch test
                    # if of outside thermaltest
                    # End of TC for loop

                    for errorType in self.errorDict:
                        # for every type of error
                        if self.errorDict[
                                errorType] and not tempErrorDict[errorType]:
                            # It was true and now is not, log it.

                            # make a event log
                            errorLog = {
                                "time": str(datetime.now()),
                                "event": errorType,
                                "item": "Thermocouple",
                                "itemID": tc.Thermocouple,
                                "details": "The current event has ended",
                                "actions": ["Log Event"]
                            }
                            self.logEvent(errorLog)

                    self.errorDict = tempErrorDict

                    # Logging if you've entered operational vacuum, and then left it
                    # TODO: OperationalVacuum can't be updated if there isn't an active profile...this needs to change
                    if HardwareStatusInstance.getInstance().OperationalVacuum:
                        vacuum = True

                    if os.name == "posix":
                        userName = os.environ['LOGNAME']
                    else:
                        userName = "******"
                    if "root" in userName:
                        if vacuum and HardwareStatusInstance.getInstance(
                        ).PfeifferGuages.get_chamber_pressure() > 1e-4:
                            d_out = HardwareStatusInstance.getInstance(
                            ).PC_104.digital_out
                            ProfileInstance.getInstance().activeProfile = False
                            Logging.debugPrint(
                                1,
                                "ERROR Pressure is above 10^-4. ({})".format(
                                    HardwareStatusInstance.getInstance(
                                    ).PfeifferGuages.get_chamber_pressure()))
                            vacuum = False
                            # TODO: Send Error
                            d_out.update({"IR Lamp 1 PWM DC": 0})
                            d_out.update({"IR Lamp 2 PWM DC": 0})
                            d_out.update({"IR Lamp 3 PWM DC": 0})
                            d_out.update({"IR Lamp 4 PWM DC": 0})
                            d_out.update({"IR Lamp 5 PWM DC": 0})
                            d_out.update({"IR Lamp 6 PWM DC": 0})
                            d_out.update({"IR Lamp 7 PWM DC": 0})
                            d_out.update({"IR Lamp 8 PWM DC": 0})
                            d_out.update({"IR Lamp 9 PWM DC": 0})
                            d_out.update({"IR Lamp 10 PWM DC": 0})
                            d_out.update({"IR Lamp 11 PWM DC": 0})
                            d_out.update({"IR Lamp 12 PWM DC": 0})
                            d_out.update({"IR Lamp 13 PWM DC": 0})
                            d_out.update({"IR Lamp 14 PWM DC": 0})
                            d_out.update({"IR Lamp 15 PWM DC": 0})
                            d_out.update({"IR Lamp 16 PWM DC": 0})

                            HardwareStatusInstance.getInstance(
                            ).TdkLambda_Cmds.append(['Shroud Duty Cycle', 0])
                            HardwareStatusInstance.getInstance(
                            ).TdkLambda_Cmds.append(['Platen Duty Cycle', 0])

                            releaseHoldThread()

                        # end if vacuum in bad condintion
                    # end if root
                    time.sleep(SLEEP_TIME)
            # end of inner while true loop
            except Exception as e:
                Logging.debugPrint(
                    1, "Error in Safety Checker: {}".format(str(e)))
                if Logging.debug:
                    raise e
                time.sleep(SLEEP_TIME)
Пример #7
0
 def setPC104_Analog(self, data):
     pins = HardwareStatusInstance.getInstance().PC_104
     pins.analog_out.update(data)
     return "{'result':'success'}"