Skip to content

Commit

Permalink
Removed SR-570 gain mixin class and just rolled everything up into Ga…
Browse files Browse the repository at this point in the history
…inSignal.
  • Loading branch information
canismarko committed Jan 23, 2024
1 parent b26b8a1 commit dc5bdc2
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions apstools/devices/srs570_preamplifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,14 @@ def calculate_settle_time(gain_value: int, gain_unit: int, gain_mode: str):
return settling_times.get((gain_value, gain_unit, gain_mode))


class GainMixin:
class GainSignal(EpicsSignal):
"""A signal where the settling time depends on the pre-amp gain.
Used to introduce a specific settle time when setting to account
for the amp's R–C relaxation time when changing gain.
"""

_settle_time = staticmethod(calculate_settle_time)

def set(self, value, *, timeout=DEFAULT_WRITE_TIMEOUT, settle_time="auto"):
"""Set the value of the Signal and return a Status object.
Expand Down Expand Up @@ -169,21 +167,12 @@ def set(self, value, *, timeout=DEFAULT_WRITE_TIMEOUT, settle_time="auto"):
if mode == "LOW DRIFT":
mode = "LOW NOISE"
# Calculate settling time
_settle_time = self._settle_time(gain_value=val, gain_unit=unit, gain_mode=mode)
_settle_time = calculate_settle_time(gain_value=val, gain_unit=unit, gain_mode=mode)
else:
_settle_time = settle_time
return super().set(value, timeout=timeout, settle_time=_settle_time)


class GainSignal(GainMixin, EpicsSignal):
"""A signal where the settling time depends on the pre-amp gain.
Used to introduce a specific settle time when setting to account
for the amp's R–C relaxation time when changing gain.
"""


class SRS570_PreAmplifier(PreamplifierBaseDevice):
"""
Ophyd support for Stanford Research Systems 570 preamplifier from synApps.
Expand Down

0 comments on commit dc5bdc2

Please sign in to comment.