Skip to content

Commit

Permalink
Added the camera zoom control, and the backlight On/Off PVs #26
Browse files Browse the repository at this point in the history
  • Loading branch information
evalott100 committed Nov 2, 2022
1 parent 2273d58 commit 6e06327
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 1 deletion.
12 changes: 11 additions & 1 deletion s03_configs/oav.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,14 @@
- tickit_devices.oav.oav_edge_detection.OAV_EA_FSCN:
name: oav_ea_fscn
inputs: {}
port: 25563
port: 25563
- tickit_devices.oav.oav_edge_detection.OAV_EA_OAV:
name: oav_ea_oav
inputs: {}
port: 25562


- tickit_devices.oav.oav_edge_detection.OAV_MO_MD2:
name: oav_mo_md2
inputs: {}
port: 25561
8 changes: 8 additions & 0 deletions tickit_devices/oav/db_files/EA-OAV.db
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
record(stringout, "S03SIM-EA-OAV-01:FZOOM:ZOOMPOSCMD")
{
field(PINI, "YES")
field(DTYP, "asynOctetWrite")
field(OUT, "@asyn(OAV.MXSC,0,1)NDARRAY_PORT")
field(VAL, "1.0x")
info(autosaveFields, "VAL")
}
9 changes: 9 additions & 0 deletions tickit_devices/oav/db_files/MO-MD2.db
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

record(stringout, "S03SIM-MO-MD2-01:CTRL")
{
field(PINI, "YES")
field(DTYP, "asynOctetWrite")
field(OUT, "@asyn(OAV.MXSC,0,1)NDARRAY_PORT")
field(VAL, "Out")
info(autosaveFields, "VAL")
}
50 changes: 50 additions & 0 deletions tickit_devices/oav/oav_edge_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,53 @@ def __call__(self) -> Component: # noqa: D102
OAVEpicsAdapter(self.db_file, self.ioc_name),
],
)


@dataclass
class OAV_EA_OAV(ComponentConfig):
"""To hold EA-OAV PVs."""

waveforms_file: str = "tickit_devices/oav/db_files/edge_waveforms.npy"
host: str = "localhost"
port: int = 25565
format: ByteFormat = ByteFormat(b"%b\r\n")
db_file: str = "tickit_devices/oav/db_files/EA-OAV.db"
ioc_name: str = "S03SIM-EA-OAV-01"

def __call__(self) -> Component: # noqa: D102
with open(self.waveforms_file, "rb") as f:
self.initial_edgeTop = np.load(f)
self.initial_edgeBottom = np.load(f)
return DeviceSimulation(
name=self.name,
device=OAVDevice(),
adapters=[
OAVTCPAdapter(TcpServer(self.host, self.port, self.format)),
OAVEpicsAdapter(self.db_file, self.ioc_name),
],
)


@dataclass
class OAV_MO_MD2(ComponentConfig):
"""To hold EA-OAV PVs."""

waveforms_file: str = "tickit_devices/oav/db_files/edge_waveforms.npy"
host: str = "localhost"
port: int = 25565
format: ByteFormat = ByteFormat(b"%b\r\n")
db_file: str = "tickit_devices/oav/db_files/MO-MD2.db"
ioc_name: str = "S03SIM-MO-MD2-01"

def __call__(self) -> Component: # noqa: D102
with open(self.waveforms_file, "rb") as f:
self.initial_edgeTop = np.load(f)
self.initial_edgeBottom = np.load(f)
return DeviceSimulation(
name=self.name,
device=OAVDevice(),
adapters=[
OAVTCPAdapter(TcpServer(self.host, self.port, self.format)),
OAVEpicsAdapter(self.db_file, self.ioc_name),
],
)

0 comments on commit 6e06327

Please sign in to comment.