From b7c4422453828ed7482932848e5cfd3dc74735d9 Mon Sep 17 00:00:00 2001 From: Ingo Berg Date: Thu, 8 May 2025 15:39:42 +0200 Subject: [PATCH 1/2] Return of response objects removed --- .../CommandGroups/StatusCommandGroup.py | 23 ++------- .../WafermapCompensationCommandGroup.py | 6 +-- sentio_prober_control/Sentio/Enumerations.py | 27 ++++++++++ sentio_prober_control/Sentio/ProberSentio.py | 50 +++++++++---------- 4 files changed, 57 insertions(+), 49 deletions(-) diff --git a/sentio_prober_control/Sentio/CommandGroups/StatusCommandGroup.py b/sentio_prober_control/Sentio/CommandGroups/StatusCommandGroup.py index 86515e5..c0f1ab5 100644 --- a/sentio_prober_control/Sentio/CommandGroups/StatusCommandGroup.py +++ b/sentio_prober_control/Sentio/CommandGroups/StatusCommandGroup.py @@ -57,6 +57,7 @@ def get_chuck_temp_setpoint(self) -> float: def get_chuck_thermo_energy_mode(self) -> str: """Get the current chuck thermo energy mode. + Returns: The current energy mode as a string. Possible values: Fast, Optimal, HighPower, Customized. """ @@ -75,7 +76,6 @@ def get_chuck_thermo_hold_mode(self) -> str: resp = Response.check_resp(self.comm.read_line()) return resp.message() - def get_chuck_thermo_state(self) -> ThermoChuckState: """Return thermo chuck state. @@ -85,25 +85,8 @@ def get_chuck_thermo_state(self) -> ThermoChuckState: """ self.comm.send("status:get_chuck_thermo_state") - resp = Response.check_resp(self.comm.read_line()) - - if "soaking" in resp.message().lower(): - return ThermoChuckState.Soaking - elif "cooling" in resp.message().lower(): - return ThermoChuckState.Cooling - elif "heating" in resp.message().lower(): - return ThermoChuckState.Heating - elif "controlling" in resp.message().lower(): - return ThermoChuckState.Controlling - elif "standby" in resp.message().lower(): - return ThermoChuckState.Standby - elif "error" in resp.message().lower(): - return ThermoChuckState.Error - elif "uncontrolled" in resp.message().lower(): - return ThermoChuckState.Uncontrolled - else: - return ThermoChuckState.Unknown - + state : ThermoChuckState = ThermoChuckState.fromSentioAbbr(Response.check_resp(self.comm.read_line()).message()) + return state def get_high_purge_state(self) -> str: """Get thermo chuck high purge state. diff --git a/sentio_prober_control/Sentio/CommandGroups/WafermapCompensationCommandGroup.py b/sentio_prober_control/Sentio/CommandGroups/WafermapCompensationCommandGroup.py index a873a89..f07a25f 100644 --- a/sentio_prober_control/Sentio/CommandGroups/WafermapCompensationCommandGroup.py +++ b/sentio_prober_control/Sentio/CommandGroups/WafermapCompensationCommandGroup.py @@ -36,13 +36,11 @@ def set_xy(self, comp_type: XyCompensationType) -> None: self.comm.send(f"map:compensation:set_xy {comp_type.toSentioAbbr()}") Response.check_resp(self.comm.read_line()) - def set_z(self, comp_type: ZCompensationType) -> Response: + def set_z(self, comp_type: ZCompensationType) -> None: """Enable the Z Stepping Compensation. Args: comp_type: The type of Z Stepping Compensation. """ self.comm.send(f"map:compensation:set_z {comp_type.toSentioAbbr()}") - resp = Response.check_resp(self.comm.read_line()) - - return resp + Response.check_resp(self.comm.read_line()) diff --git a/sentio_prober_control/Sentio/Enumerations.py b/sentio_prober_control/Sentio/Enumerations.py index b9e791d..fe832af 100644 --- a/sentio_prober_control/Sentio/Enumerations.py +++ b/sentio_prober_control/Sentio/Enumerations.py @@ -1750,6 +1750,33 @@ class ThermoChuckState(Enum): Controlling = 6 Unknown = 7 + @staticmethod + def fromSentioAbbr(abbr: str) -> "ThermoChuckState": + """Convert a SENTIO abbreviation to a ThermoChuckState. + + Args: + abbr (str): The SENTIO abbreviation. + + Returns: + ThermoChuckState: The corresponding ThermoChuckState. + + Raises: + ValueError: If the abbreviation is not recognized. + """ + mapping = { + "soaking": ThermoChuckState.Soaking, + "cooling": ThermoChuckState.Cooling, + "heating": ThermoChuckState.Heating, + "uncontrolled": ThermoChuckState.Uncontrolled, + "standby": ThermoChuckState.Standby, + "error": ThermoChuckState.Error, + "controlling": ThermoChuckState.Controlling, + } + try: + return mapping[abbr] + except KeyError: + raise ValueError(f"Unknown ThermoChuckState abbreviation: {abbr}") + class UserCoordState(Enum): Chuck = 0 diff --git a/sentio_prober_control/Sentio/ProberSentio.py b/sentio_prober_control/Sentio/ProberSentio.py index d865e92..0596d70 100644 --- a/sentio_prober_control/Sentio/ProberSentio.py +++ b/sentio_prober_control/Sentio/ProberSentio.py @@ -112,11 +112,11 @@ def abort_command(self, cmd_id: int) -> Response: Returns: A response object with the result of the command. """ - self.comm.send("abort_command {0}".format(cmd_id)) + self.comm.send(f"abort_command {cmd_id}") return Response.check_resp(self.comm.read_line()) - def clear_contact(self, site: ChuckSite | None = None) -> Response: + def clear_contact(self, site: ChuckSite | None = None) -> None: """Clear contact positions. Args: @@ -131,7 +131,7 @@ def clear_contact(self, site: ChuckSite | None = None) -> Response: else: self.comm.send(f"clear_contact {site.toSentioAbbr()}") - return Response.check_resp(self.comm.read_line()) + Response.check_resp(self.comm.read_line()) @staticmethod @@ -166,7 +166,7 @@ def create_prober(comm_type : str | SentioCommunicationType, arg1 : str | GpibCa raise ValueError(f'Unknown prober type: "{comm_type}"') - def enable_chuck_overtravel(self, stat: bool) -> Response: + def enable_chuck_overtravel(self, stat: bool) -> None: """Enable chuck overtravel. @@ -176,14 +176,14 @@ def enable_chuck_overtravel(self, stat: bool) -> Response: stat (bool): True to enable, False to disable. Returns: - A response object with the result of the command. + None """ self.comm.send(f"enable_chuck_overtravel {stat}") - return Response.check_resp(self.comm.read_line()) + Response.check_resp(self.comm.read_line()) - def enable_chuck_hover(self, stat: bool) -> Response: + def enable_chuck_hover(self, stat: bool) -> None: """Enable chuck hover height. @@ -197,14 +197,14 @@ def enable_chuck_hover(self, stat: bool) -> Response: stat (bool): True to enable, False to disable. Returns: - A response object with the result of the command. + None """ self.comm.send(f"enable_chuck_hover {stat}") - return Response.check_resp(self.comm.read_line()) + Response.check_resp(self.comm.read_line()) - def enable_chuck_site_hover(self, site: ChuckSite, stat: bool) -> Response: + def enable_chuck_site_hover(self, site: ChuckSite, stat: bool) -> None: """Enable chuck site hover height. @@ -217,14 +217,14 @@ def enable_chuck_site_hover(self, site: ChuckSite, stat: bool) -> Response: stat (bool): True to enable, False to disable. Returns: - A response object with the result of the command. + None """ self.comm.send(f"enable_chuck_site_hover {site.toSentioAbbr()}, {stat}") - return Response.check_resp(self.comm.read_line()) + Response.check_resp(self.comm.read_line()) - def enable_chuck_site_overtravel(self, site: ChuckSite, stat: bool) -> Response: + def enable_chuck_site_overtravel(self, site: ChuckSite, stat: bool) -> None: """Enable overtravel distance for a specific chuck site. @@ -233,14 +233,14 @@ def enable_chuck_site_overtravel(self, site: ChuckSite, stat: bool) -> Response: stat (bool): True to enable, False to disable. Returns: - A response object with the result of the command. + None """ self.comm.send(f"enable_chuck_site_hover {site.toSentioAbbr()}, {stat}") - return Response.check_resp(self.comm.read_line()) + Response.check_resp(self.comm.read_line()) - def file_transfer(self, source: str, dest: str) -> Response: + def file_transfer(self, source: str, dest: str) -> None: """Transfer a file to the prober. @@ -260,7 +260,7 @@ def file_transfer(self, source: str, dest: str) -> Response: encoded = base64.b64encode(file_bytes).decode("ascii") self.comm.send(f"file_transfer {dest}, {encoded}") - return Response.check_resp(self.comm.read_line()) + Response.check_resp(self.comm.read_line()) def get_chuck_site_height(self, site: ChuckSite) -> Tuple[float, float, float, float]: @@ -575,7 +575,7 @@ def move_chuck_home(self) -> Tuple[float, float]: return float(tok[0]), float(tok[1]) - def move_chuck_load(self, pos: LoadPosition) -> Response: + def move_chuck_load(self, pos: LoadPosition) -> None: """Move chuck to load position. Wraps SENTIO's "move_chuck_load" remote command. @@ -584,10 +584,10 @@ def move_chuck_load(self, pos: LoadPosition) -> Response: pos (LoadPosition): The position to move the chuck to. This can either be a load position or the center position of the chuck. Returns: - A response object with the result of the command. + None """ self.comm.send(f"move_chuck_load {pos.toSentioAbbr()}") - return Response.check_resp(self.comm.read_line()) + Response.check_resp(self.comm.read_line()) def move_chuck_separation(self) -> float: @@ -668,7 +668,7 @@ def move_chuck_z(self, ref: ChuckZReference, z: float) -> float: resp = Response.check_resp(self.comm.read_line()) return float(resp.message()) - def move_chuck_work_area(self, area: WorkArea) -> Response: + def move_chuck_work_area(self, area: WorkArea) -> None: """Move the chuck to a given work area. A SENTIO probe station can have different work areas. One area is for probing. This is the default @@ -684,10 +684,10 @@ def move_chuck_work_area(self, area: WorkArea) -> Response: area: The work area to move to. Returns: - A response object with the result of the command. + None """ self.comm.send(f"move_chuck_work_area {area.toSentioAbbr()}") - return Response.check_resp(self.comm.read_line()) + Response.check_resp(self.comm.read_line()) def move_scope_xy( self, ref: ScopeXYReference, x: float, y: float @@ -1554,7 +1554,7 @@ def get_indexer_pos(self) -> Tuple[int, str]: location, position = resp.message().split(",") return int(location), position - def indexer_cda(self, on: bool) -> Response: + def indexer_cda(self, on: bool) -> None: """Turn indexer CDA on or off. Args: @@ -1565,7 +1565,7 @@ def indexer_cda(self, on: bool) -> Response: """ state = "on" if on else "off" self.comm.send(f"indexer_cda {state}") - return Response.check_resp(self.comm.read_line()) + Response.check_resp(self.comm.read_line()) def move_bottom_platen_contact(self) -> float: """Move bottom platen to contact height. From 85829794c5b71376b1da83c27035c784b93d6b62 Mon Sep 17 00:00:00 2001 From: Ingo Berg Date: Thu, 8 May 2025 16:14:54 +0200 Subject: [PATCH 2/2] Update Enumerations.py DriftType enum was missing --- sentio_prober_control/Sentio/Enumerations.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sentio_prober_control/Sentio/Enumerations.py b/sentio_prober_control/Sentio/Enumerations.py index fe832af..f456914 100644 --- a/sentio_prober_control/Sentio/Enumerations.py +++ b/sentio_prober_control/Sentio/Enumerations.py @@ -783,6 +783,10 @@ class DieNumber(Enum): Selected = 2 Total = 3 +class DriftType(Enum): + """Specifies the type of drift.""" + DriftRef = "DriftRef" + Drift = "Drift" @deprecated("ExecuteAction is deprecated.") class ExecuteAction(Enum): @@ -1773,7 +1777,7 @@ def fromSentioAbbr(abbr: str) -> "ThermoChuckState": "controlling": ThermoChuckState.Controlling, } try: - return mapping[abbr] + return mapping[abbr.lower()] except KeyError: raise ValueError(f"Unknown ThermoChuckState abbreviation: {abbr}")