From b25f10620de75ac452dc475da81cceb3f8cc701e Mon Sep 17 00:00:00 2001 From: MPIDavidLiu Date: Fri, 16 May 2025 14:56:09 +0800 Subject: [PATCH] Update Bug#18392 --- sentio_prober_control/Sentio/Enumerations.py | 41 +++++++++++++++++++- sentio_prober_control/Sentio/ProberSentio.py | 11 ++++-- 2 files changed, 47 insertions(+), 5 deletions(-) diff --git a/sentio_prober_control/Sentio/Enumerations.py b/sentio_prober_control/Sentio/Enumerations.py index f456914..9aba8ac 100644 --- a/sentio_prober_control/Sentio/Enumerations.py +++ b/sentio_prober_control/Sentio/Enumerations.py @@ -2008,4 +2008,43 @@ def toSentioAbbr(self): ZPositionHint.Lift: "Lift", ZPositionHint.Transfer: "Transfer", } - return switcher.get(self, "Invalid ZPositionHint") \ No newline at end of file + return switcher.get(self, "Invalid ZPositionHint") + +class SwapBridgeSide(Enum): + """Control swap bridge move to right or left side. + + Attributes: + Right (0): Move swap bridge to right side. + Left (1): Move swap bridge to left side. + Current (2): Keep bridge at current side. + """ + + Right = 0 + Left = 1 + Current = 2 + + def toSentioAbbr(self): + switcher = { + SwapBridgeSide.Right: "Right", + SwapBridgeSide.Left: "Left", + SwapBridgeSide.Current: "Current", + } + return switcher.get(self, "Invalid swap bridge side.") + +class DevicePosition(Enum): + """Control swap bridge move to up or down side. + + Attributes: + Up (0): Move device to up position. + Down (1): Move device to down position. + """ + + Up = 0 + Down = 1 + + def toSentioAbbr(self): + switcher = { + DevicePosition.Up: "Up", + DevicePosition.Down: "Down", + } + return switcher.get(self, "Invalid device position.") \ No newline at end of file diff --git a/sentio_prober_control/Sentio/ProberSentio.py b/sentio_prober_control/Sentio/ProberSentio.py index 8fe8ee8..f652563 100644 --- a/sentio_prober_control/Sentio/ProberSentio.py +++ b/sentio_prober_control/Sentio/ProberSentio.py @@ -25,7 +25,9 @@ VacuumState, HighPowerAirState, SoftContactState, - UserCoordState + UserCoordState, + SwapBridgeSide, + DevicePosition ) from sentio_prober_control.Sentio.ProberBase import ProberBase, ProberException @@ -1663,19 +1665,20 @@ def start_move_indexer_pos(self, pos: int) -> None: self.comm.send(f"start_move_indexer_pos {pos}") Response.check_resp(self.comm.read_line()) - def swap_bridge(self, side: str, device_position: str | None = None) -> None: - """Control swap bridge side and position. + def swap_bridge(self, side: SwapBridgeSide, device_position: DevicePosition, delaytime: int = 8) -> None: + """Control swap bridge side,position and delay time. Args: side (str): right/left/current device_position (str, optional): up/down - + delaytime (int) : 8 Returns: None """ cmd = f"swap_bridge {side}" if device_position: cmd += f",{device_position}" + cmd += f",{delaytime}" self.comm.send(cmd) Response.check_resp(self.comm.read_line())