Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions sentio_prober_control/Sentio/CommandGroups/ProbeCommandGroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,27 @@ def move_probe_separation(self, probe: ProbePosition) -> float:
resp = Response.check_resp(self.comm.read_line())
return float(resp.message())

def move_probe_lift(self, stage: Stage, probe: ProbePosition) -> float:
"""Move a probe to its lift position.

Args:
stage: The probe stage (TopProbe/BottomProbe).
probe: The probe position.

Returns:
The z position after the move in micrometer (from zero).
"""
if stage == Stage.TopProbe:
pos = 'top'
elif stage == Stage.BottomProbe:
pos = 'bottom'
else:
raise ValueError("Stage must be a probe stage")

self.comm.send(f"probe:{pos}:{probe.to_string().lower()}:move_lift")
resp = Response.check_resp(self.comm.read_line())
return float(resp.message())


def move_probe_home(self, probe: ProbePosition) -> Tuple[float, float]:
"""Move probe to its home position.
Expand Down
43 changes: 42 additions & 1 deletion sentio_prober_control/Sentio/CommandGroups/SiPHCommandGroup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Tuple

from sentio_prober_control.Sentio.Compatibility import Compatibility, CompatibilityLevel
from sentio_prober_control.Sentio.Enumerations import ProbePosition, UvwAxis, FiberType, CompatibilityLevel
from sentio_prober_control.Sentio.Enumerations import ProbePosition, UvwAxis, FiberType, CompatibilityLevel, Stage
from sentio_prober_control.Sentio.Response import Response
from sentio_prober_control.Sentio.CommandGroups.CommandGroupBase import CommandGroupBase

Expand Down Expand Up @@ -33,6 +33,27 @@ def get_cap_sensor(self) -> Tuple[float, float]:
tok = resp.message().split(",")
return float(tok[0]), float(tok[1])

def get_fiber_length(self, stage: Stage, probe: ProbePosition) -> float:
"""Retrieves the fiber length of an SiPH positioner.

Args:
stage: The probe stage (TopProbe/BottomProbe).
probe: The probe position.

Returns:
The fiber length in micrometer.
"""
if stage == Stage.TopProbe:
pos = 'top'
elif stage == Stage.BottomProbe:
pos = 'bottom'
else:
raise ValueError("Stage must be a probe stage")

self.comm.send(f"siph:{pos}:{probe.to_string().lower()}:get_fiber_length")
resp = Response.check_resp(self.comm.read_line())
return float(resp.message())


def get_intensity(self, channel : int = 1) -> float:
"""Get the current intensity value.
Expand Down Expand Up @@ -201,6 +222,26 @@ def set_alignment(self, probe: ProbePosition, fiber_type: FiberType, coarse: boo
self.comm.send(f"siph:set_alignment {probe.to_string()},{fiber_type},{coarse_str},{fine_str},{gradient_str},{rotary_str}")
Response.check_resp(self.comm.read_line())

def set_hover(self, stage: Stage, probe: ProbePosition, gap: float) -> None:
"""Sets the hover gap of an SiPH positioner.

Args:
stage: The probe stage (TopProbe/BottomProbe).
probe: The probe position.

Returns:
A Response object containing the command execution status.
"""
if stage == Stage.TopProbe:
pos = 'top'
elif stage == Stage.BottomProbe:
pos = 'bottom'
else:
raise ValueError("Stage must be a probe stage")

self.comm.send(f"siph:{pos}:{probe.to_string().lower()}:set_hover {gap}")
Response.check_resp(self.comm.read_line())


def set_pivot_point(self, rotary_angle_1: float, rotary_angle_2: float, leveling_angle: float, repeats: int) -> None:
"""Set the parameters for the pivot point function.
Expand Down