示例#1
0
    def run(self):
        """ Execute method in a loop.
        """

        # check if not external alert
        exttrig_alert_time = injtools.check_exttrig_alert(
            exttrig_channel_name, exttrig_wait_seconds)
        if not exttrig_alert_time:
            return True

        return False
示例#2
0
    def run(self):
        """ Execute method in a loop.
        """

        # check if not external alert
        exttrig_alert_time = injtools.check_exttrig_alert(exttrig_channel_name,
                                                 exttrig_wait_seconds)
        if not exttrig_alert_time:
            return True

        return False
示例#3
0
        def pre_exec(self):
            """ Do this before entering the GuardState.
            """

            # check if external alert within exttrig_wait_seconds seconds
            # in the past
            exttrig_alert_time = injtools.check_exttrig_alert(exttrig_channel_name,
                                                     exttrig_wait_seconds)
            if exttrig_alert_time:

                # if there is an external alert then close all streams
                try:
                    injtools.close_all_streams(hwinj_list)
                except:
                    etype, val, tb = sys.exc_info()
                    ftb = traceback.format_tb(tb)
                    for line in ftb: log(line)
                    log(str(etype) + " " + str(val))
                    return "FAILURE_TO_KILL_STREAM"

                return failure_state
示例#4
0
        def pre_exec(self):
            """ Do this before entering the GuardState.
            """

            # check if external alert within exttrig_wait_seconds seconds
            # in the past
            exttrig_alert_time = injtools.check_exttrig_alert(
                exttrig_channel_name, exttrig_wait_seconds)
            if exttrig_alert_time:

                # if there is an external alert then close all streams
                try:
                    injtools.close_all_streams(hwinj_list)
                except:
                    etype, val, tb = sys.exc_info()
                    ftb = traceback.format_tb(tb)
                    for line in ftb:
                        log(line)
                    log(str(etype) + " " + str(val))
                    return "FAILURE_TO_KILL_STREAM"

                return failure_state