示例#1
0
    def release(self, synch=True):
        if not synch:
            try:
                self.command_inout("ReleaseMacro")
            except PyTango.DevFailed as df:
                # Macro already finished - no need to release
                if df.args[0].reason == "API_CommandNotAllowed":
                    pass
            return

        evt_wait = AttributeEventWait(self.getAttribute("state"))
        evt_wait.lock()
        try:
            time_stamp = time.time()
            try:
                self.command_inout("ReleaseMacro")
            except PyTango.DevFailed as df:
                # Macro already finished - no need to release
                if df.args[0].reason == "API_CommandNotAllowed":
                    return
            evt_wait.waitEvent(self.Running,
                               equal=False,
                               after=time_stamp,
                               timeout=self.InteractiveTimeout)
        finally:
            evt_wait.unlock()
            evt_wait.disconnect()
示例#2
0
    def stop(self, synch=True):
        if not synch:
            self.command_inout("StopMacro")
            return

        evt_wait = AttributeEventWait(self.getAttribute("state"))
        evt_wait.lock()
        try:
            time_stamp = time.time()
            self.command_inout("StopMacro")
            evt_wait.waitEvent(self.Running, equal=False, after=time_stamp,
                               timeout=self.InteractiveTimeout)
        finally:
            evt_wait.unlock()
            evt_wait.disconnect()
示例#3
0
    def stop(self, synch=True):
        if not synch:
            self.command_inout("StopMacro")
            return

        evt_wait = AttributeEventWait(self.getAttribute("state"))
        evt_wait.lock()
        try:
            time_stamp = time.time()
            self.command_inout("StopMacro")
            evt_wait.waitEvent(self.Running,
                               equal=False,
                               after=time_stamp,
                               timeout=self.InteractiveTimeout)
        finally:
            evt_wait.unlock()
            evt_wait.disconnect()