Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prototype cryostat auto #4

Open
wants to merge 4 commits into
base: deprecated-master
Choose a base branch
from
Open
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
7 changes: 7 additions & 0 deletions startup/11-temperature-controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def set(self, *args, **kwargs):
write_pv='XF:28IDC-ES:1{Env:04}T-SP',
tolerance= 3, name='eurotherm')
"""
heater_dict = {(4, 30): 1, (30, 80): 2, (80, 600): 3}

class CryoStream(Device):
# readback
Expand Down Expand Up @@ -135,6 +136,8 @@ class CryoStat1(Device):
# trigger signal
trig = Cpt(EpicsSignal, ':read.PROC')

auto=True

def trigger(self):
self.trig.put(1, wait=True)
return DeviceStatus(self, done=True, success=True)
Expand Down Expand Up @@ -165,6 +168,10 @@ def _sts_mon(self, value, **kwargs):

def set(self, val):
self._target = val
if self.auto:
for (low, hi), heater_pos in heater_dict.items():
if low < pos <= hi:
self.heater.set(heater_pos)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should wait on the status object returned here, or AND it with the returned status object

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feel free to push to this branch. I've already exceeded my knowledge of how things work!

self.setpoint.put(val, wait=True)
sts = self._sts = DeviceStatus(self)
self.scan.put('.2 second')
Expand Down