-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 493-v2-lakeshore
- Loading branch information
Showing
43 changed files
with
1,547 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# local developer code | ||
dev_*.py | ||
|
||
db/ | ||
log/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
""" | ||
Eurotherm 2216e Temperature Controller | ||
++++++++++++++++++++++++++++++++++++++ | ||
The 2216e is a temperature controller from Eurotherm. | ||
.. autosummary:: | ||
~Eurotherm2216e | ||
According to their website, the [Eurotherm 2216e Temperature | ||
Controller](https://www.eurothermcontrollers.com/eurotherm-2216e-series-controller-now-obsolete/) | ||
is obsolete. Please see replacement | ||
[EPC3016](https://www.eurothermcontrollers.com/eurotherm-epc3016-1-16-din-process-and-temperature-controller/) | ||
in our [EPC3000 Series](https://www.eurothermcontrollers.com/epc3000-series). | ||
New in apstools 1.6.0. | ||
""" | ||
|
||
import logging | ||
|
||
from ophyd import Component | ||
from ophyd import EpicsSignal | ||
from ophyd import EpicsSignalRO | ||
from ophyd import Signal | ||
|
||
from .positioner_soft_done import PVPositionerSoftDoneWithStop | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
class Eurotherm2216e(PVPositionerSoftDoneWithStop): | ||
""" | ||
Eurotherm 2216e Temperature Controller | ||
""" | ||
|
||
# temperature value in dC, needs conversion: readback = 0.1 * sensor | ||
sensor = Component(EpicsSignalRO, "SetPointSensor", kind="omitted") | ||
readback = Component(Signal, value=0, kind="hinted") | ||
setpoint = Component( | ||
EpicsSignal, | ||
"SetPointTemp", | ||
kind="hinted", | ||
write_pv="SetPointTempWrite", | ||
put_complete=True, | ||
) | ||
# temp1 & temp2 PVs have no useful values : ignore here | ||
# temp1 = Component(EpicsSignalRO, "Temp1", kind="hinted") | ||
# temp2 = Component(EpicsSignalRO, "Temp2", kind="hinted") | ||
power = Component( | ||
EpicsSignal, | ||
"SetPointPower", | ||
kind="config", | ||
write_pv="SetPointPowerWrite", | ||
put_complete=True, | ||
) | ||
|
||
mode = Component( | ||
EpicsSignal, | ||
"SetPointSensor", | ||
kind="config", | ||
write_pv="ModeWrite", | ||
string=True, | ||
) | ||
program_number = Component(EpicsSignalRO, "ProgramNumber", kind="config") | ||
# program_status = Component( | ||
# EpicsSignalRO, | ||
# "ProgramStatus", | ||
# kind="config", | ||
# string=True | ||
# ) | ||
|
||
target = None # remove from PVPositionerSoftDoneWithStop | ||
|
||
def cb_sensor(self, *args, **kwargs): | ||
"units: Convert dC from sensor to C" | ||
self.readback.put(0.1 * self.sensor.get()) | ||
|
||
def __init__(self, prefix="", *, tolerance=1, **kwargs): | ||
super().__init__( | ||
prefix=prefix, | ||
readback_pv="ignoreRBV", | ||
setpoint_pv="ignore", | ||
tolerance=tolerance, | ||
update_target=False, | ||
**kwargs | ||
) | ||
self.sensor.subscribe(self.cb_sensor) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
""" | ||
test the Eurotherm 2216e device support | ||
Hardware is not available so test with best efforts | ||
""" | ||
|
||
from .. import eurotherm_2216e | ||
|
||
IOC = "gp:" | ||
PV_PREFIX = f"phony:{IOC}2216e:" | ||
|
||
|
||
def test_device(): | ||
euro = eurotherm_2216e.Eurotherm2216e(PV_PREFIX, name="controller") | ||
assert not euro.connected | ||
|
||
assert euro.tolerance.get() == 1 | ||
assert euro.update_target is False | ||
assert euro.target is None | ||
|
||
cns = """ | ||
readback setpoint | ||
""".split() | ||
assert sorted(euro.read_attrs) == sorted(cns) | ||
|
||
cns += """ | ||
sensor | ||
done tolerance report_dmov_changes | ||
mode power program_number | ||
""".split() | ||
assert sorted(euro.component_names) == sorted(cns) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
from ..xia_slit import XiaSlit2D | ||
from ...utils import SlitGeometry | ||
|
||
import pytest | ||
|
||
IOC = "gp:" | ||
PV_PREFIX = f"{IOC}phony_hsc1:" | ||
|
||
# Full testing requires two XIA Slit controllers (a 2D H & V set) | ||
# We don't have that for unit testing. Proceed with best efforts. | ||
|
||
|
||
def test_XiaSlit_not_connected(): | ||
slit1 = XiaSlit2D(PV_PREFIX, name="slit1") | ||
assert slit1 is not None | ||
|
||
# slit1.wait_for_connection() | ||
assert not slit1.connected | ||
|
||
|
||
def test_XiaSlit_geometry(capsys): | ||
slit1 = XiaSlit2D(PV_PREFIX, name="slit1") | ||
|
||
g = None | ||
with pytest.raises(TypeError): | ||
g = slit1.geometry | ||
assert not isinstance(g, SlitGeometry) | ||
|
||
captured = capsys.readouterr() | ||
assert captured.out.split("\n") == [""] | ||
assert captured.err.split("\n") == [""] | ||
|
||
|
||
def test_XiaSlit_components(): | ||
slit1 = XiaSlit2D(PV_PREFIX, name="slit1") | ||
cns = """ | ||
inb out bot top | ||
hsize vsize hcenter vcenter | ||
hID horientation hbusy | ||
vID vorientation vbusy | ||
enable | ||
error_code error_message message1 message2 message3 | ||
calibrate initialize locate stop_button | ||
precision | ||
""".split() | ||
assert sorted(slit1.component_names) == sorted(cns) |
Oops, something went wrong.