-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
93 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from dataclasses import dataclass | ||
|
||
from ophyd_async.core import SignalR, StandardReadable | ||
from ophyd_async.epics.signal import epics_signal_r | ||
|
||
|
||
@dataclass | ||
class DaePeriodSettingsData: | ||
|
||
periods_soft_num = None | ||
periods_type = None | ||
periods_src = None | ||
periods_file = None | ||
periods_seq = None | ||
periods_delay = None | ||
periods_settings = [] | ||
|
||
|
||
class DaePeriodSettings(StandardReadable): | ||
def __init__(self, dae_prefix, name=""): | ||
|
||
|
||
super().__init__(name=name) |
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 @@ | ||
from dataclasses import dataclass | ||
|
||
from ophyd_async.core import SignalR, StandardReadable | ||
from ophyd_async.epics.signal import epics_signal_r | ||
|
||
@dataclass | ||
class DaeSettingsData: | ||
wiring = None | ||
detector = None | ||
spectra = None | ||
mon_spect = None | ||
mon_from = None | ||
mon_to = None | ||
dae_sync = None | ||
smp_veto = None | ||
ts2_veto = None | ||
hz50_veto = None | ||
ext0_veto = None | ||
ext1_veto = None | ||
ext2_veto = None | ||
ext3_veto = None | ||
fermi_veto = None | ||
fermi_delay = None | ||
fermi_width = None | ||
|
||
|
||
class DaeSettings(StandardReadable): | ||
def __init__(self, dae_prefix, name=""): | ||
|
||
|
||
super().__init__(name=name) |
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,16 @@ | ||
from dataclasses import dataclass | ||
|
||
from ophyd_async.core import SignalR, StandardReadable | ||
from ophyd_async.epics.signal import epics_signal_r | ||
|
||
|
||
@dataclass | ||
class DaeTCBSettingsData: | ||
tcb_file = None | ||
tcb_tables = [] | ||
tcb_calculation_method = None | ||
|
||
|
||
class DaeTCBSettings(StandardReadable): | ||
def __init__(self, dae_prefix, name=""): | ||
super().__init__(name=name) |
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,13 @@ | ||
import zlib | ||
import binascii | ||
|
||
|
||
def dehex_and_decompress(value: bytes) -> bytes: | ||
"""Decompresses the inputted string, assuming it is in hex encoding. | ||
Args: | ||
value: The string to be decompressed, encoded in hex | ||
Returns A decompressed version of the inputted string | ||
""" | ||
return zlib.decompress(binascii.unhexlify(value)) |
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,9 @@ | ||
import pytest | ||
from ibex_bluesky_core.utils.dehex_and_decompress import dehex_and_decompress | ||
|
||
|
||
def test_can_dehex_and_decompress(): | ||
expected = b"test123" | ||
hexed_and_compressed = b"789c2b492d2e31343206000aca0257" | ||
result = dehex_and_decompress(hexed_and_compressed) | ||
assert result == expected |