Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1768 commits
Select commit Hold shift + click to select a range
20e29b8
Merge pull request #107 from ISISComputingGroup/fix_keithley_2700
Tom-Willemsen Mar 9, 2021
8c424d7
Add new emulator hlx503 based on itc503 but with a magic box that all…
JamesKingWork Mar 10, 2021
eb7dc74
Merge pull request #106 from ISISComputingGroup/Ticket5990_slew_rate
Tom-Willemsen Mar 11, 2021
3588731
Add template emulator
John-Holt-Tessella Mar 12, 2021
d647684
Add initial emmulator
John-Holt-Tessella Mar 12, 2021
1771a67
Move logic into device; Add states to correctly react to temperature …
JamesKingWork Mar 16, 2021
a676ea5
Merge branch 'master' into Ticket6202_Add_IOC_AFG3021B
rerpha Mar 18, 2021
e1107fe
Merge pull request #109 from ISISComputingGroup/Ticket6202_Add_IOC_AF…
rerpha Mar 18, 2021
85c07b6
removing icefrdge
rerpha Mar 22, 2021
520d900
Merge pull request #110 from ISISComputingGroup/Ticket6318_remove_ice…
Tom-Willemsen Mar 22, 2021
ffd6c7a
small changes from testing
LilithCole Mar 22, 2021
ea91f76
Merge branch 'master' into Ticket5993_Setup_correctly
LilithCole Mar 22, 2021
83c4198
Merge pull request #108 from ISISComputingGroup/Ticket6294_3He_Fridge…
rerpha Mar 23, 2021
a8583b7
fix backdoor issue with afg3xxx
rerpha Mar 23, 2021
9ec4636
Merge pull request #112 from ISISComputingGroup/flash_fix_tekafg3xxx_…
DominicOram Mar 23, 2021
097d762
ttiex355p: Add minimum to current and voltage range
JamesKingWork Apr 15, 2021
289e3f8
Refactor to use ttiex355p emulator - which is mostly subclassing the …
JamesKingWork May 19, 2021
a798679
making mezei flipper v1 tests work in python 3
rerpha May 19, 2021
2a86cf0
starting to write emulator for tektronix afg3021b
rerpha May 24, 2021
1d4d691
Merge pull request #114 from ISISComputingGroup/Ticket6397_thurlby_range
DominicOram May 24, 2021
1c25f5b
adding more fields and separating into output channels
rerpha May 25, 2021
76079e6
added function
rerpha May 25, 2021
78bfcb8
Added basic mclennan emulator
DominicOram May 26, 2021
8d2aca6
adding more fields into stream interface
rerpha May 27, 2021
0c46583
adding properties for channels
rerpha May 27, 2021
9e529d7
removing @property as not supported by lewi
rerpha Jun 1, 2021
436ff06
Merge pull request #115 from ISISComputingGroup/Ticket6132_remove_pyt…
aaron-long Jun 2, 2021
d3f7303
finishing off emulator
rerpha Jun 2, 2021
482367a
typos
rerpha Jun 2, 2021
8fc32d8
Newline
JamesKingWork Jun 2, 2021
1a8914c
Merge pull request #117 from ISISComputingGroup/Ticket5739_mclennan_e…
JamesKingWork Jun 2, 2021
ab0f213
add trigger
rerpha Jun 9, 2021
3359e9d
Moved utils into lewis itself
DominicOram Jun 10, 2021
a9b62e7
Removed CCD100 as it's now in the support directory
DominicOram Jun 10, 2021
bb08273
Correct emulator protocol to match manual
JamesKingWork Jun 15, 2021
7200a4d
Merge pull request #116 from ISISComputingGroup/Ticket6202_afg3021b
JamesKingWork Jun 15, 2021
3b74f7f
Merge pull request #118 from ISISComputingGroup/Ticket6555_move_ioc_a…
aaron-long Jul 13, 2021
2889da8
add ID for mclennan for both devices, add creep speed
rerpha Jul 26, 2021
64e685b
Added emulator for danfysik9100
Jun 28, 2021
d28ed02
Renamed 9100 to 9X00 to match naming scheme elsewhere, Moved Bit and …
Jul 28, 2021
7d4afef
Merge pull request #119 from ISISComputingGroup/Ticket_6543_Add_danfy…
JamesKingWork Aug 2, 2021
e872319
removing rknps emulator
rerpha Aug 5, 2021
79df785
Merge pull request #121 from ISISComputingGroup/Ticket6700_remove_rknps
JamesKingWork Aug 6, 2021
3bac4c9
Use the correct import of lewis utils
JamesKingWork Aug 10, 2021
4197769
Merge pull request #122 from ISISComputingGroup/FixDanfysikErrors
rerpha Aug 10, 2021
2dc9a3e
change to pm600 by default
rerpha Sep 23, 2021
1c69cf5
Delete lewis_emulators/ilm200 directory
rerpha Oct 5, 2021
f7d1d77
Merge pull request #124 from ISISComputingGroup/Ticket6804
DominicOram Oct 5, 2021
026c2a1
Merge pull request #120 from ISISComputingGroup/Ticket4815_set_creep_…
FreddieAkeroyd Oct 21, 2021
f39bc0b
removed old emulator
aaron-long Oct 28, 2021
afe9fec
Merge pull request #125 from ISISComputingGroup/WBVALVE_convert
DominicOram Oct 28, 2021
271e64d
removed old emulator
aaron-long Oct 28, 2021
4864f3c
removed old tests
aaron-long Oct 28, 2021
625336a
Merge pull request #126 from ISISComputingGroup/KNRK6_convert
DominicOram Oct 28, 2021
8f3f70f
changes observed from hardware tests
LilithCole Nov 30, 2021
603ec2e
Merge branch 'master' into Ticket5993_Setup_correctly
LilithCole Dec 13, 2021
ab87a25
Add .gitattributes
FreddieAkeroyd Jan 6, 2022
a00aa1f
Merge pull request #127 from ISISComputingGroup/ALDN1000_convert
FreddieAkeroyd Feb 6, 2022
406d4c4
removed unused emulator
aaron-long Apr 4, 2022
982d857
Extended the emulator for new functionality. Reworked some of the old…
Adam-Szw Apr 6, 2022
dea960e
Merge pull request #138 from ISISComputingGroup/Ticket6556_gemorc_mov…
FreddieAkeroyd Apr 8, 2022
77aaf28
removed old emulator
Adam-Szw Apr 22, 2022
2132658
Merge pull request #144 from ISISComputingGroup/ticket_6556_khly2700
JackEAllen Apr 26, 2022
9e263cb
Implementing review requested changes
Adam-Szw Jun 21, 2022
a88218f
rework
Adam-Szw Jun 29, 2022
50f2a14
Merge pull request #137 from ISISComputingGroup/RIKEN_Extend_TPG300_I…
Tom-Willemsen Jun 29, 2022
46c55e6
Implement OCP and OVP trip protection into emulator
Jul 22, 2022
2904756
Add trip reset functionality
Jul 22, 2022
fdc8029
changes from tests
LilithCole Jul 27, 2022
8a66c53
changes from tests
LilithCole Jul 29, 2022
93da014
Fix line endings
FreddieAkeroyd Jul 29, 2022
bb8352f
Merge pull request #148 from ISISComputingGroup/fix_line_endings
LilithCole Aug 2, 2022
150994d
Match stream interface to protocol file
Aug 8, 2022
afa6bc1
Add emulation for trip requiring manual reset
Aug 8, 2022
234aae8
Add volt and current limit tracking
Aug 9, 2022
d944bd5
specify datatype as float
LilithCole Aug 9, 2022
0cc6e71
Begin implementing eurotherm modbus emulator
Tom-Willemsen Aug 9, 2022
45d8af2
Fix emulator
Tom-Willemsen Aug 11, 2022
e5cfd33
Merge pull request #149 from ISISComputingGroup/TICKET7213_ocp_ovp_trip
LilithCole Aug 12, 2022
2623482
Update lewis_emulators/cryogenic_sms/interfaces/stream_interface.py
LilithCole Aug 12, 2022
0e6903e
Update lewis_emulators/cryogenic_sms/interfaces/stream_interface.py
LilithCole Aug 12, 2022
dcacf86
make logic neater
LilithCole Aug 12, 2022
c65c437
merged from github
LilithCole Aug 12, 2022
5796f91
merge master
LilithCole Aug 12, 2022
284122b
Merge pull request #111 from ISISComputingGroup/Ticket5993_Setup_corr…
LowriJenkins Aug 12, 2022
7a6eda8
Implement more behaviour in emulator
Tom-Willemsen Aug 12, 2022
0c4c760
line separators
LilithCole Aug 12, 2022
b834097
merge master
LilithCole Aug 12, 2022
95abc47
Rename a property
boeuf-codes Aug 16, 2022
b61138f
Rename a property and fix some logic
boeuf-codes Aug 16, 2022
8fa64e1
Rename a property
boeuf-codes Aug 16, 2022
a934f00
Fix some refactoring
boeuf-codes Aug 17, 2022
91beccd
make input as specific about formatting as real device, auto-formatting
LilithCole Aug 23, 2022
b019be2
change set to get for refactored test
LilithCole Aug 23, 2022
6f6899d
Add emulator property 'connected' to fix refactoring
boeuf-codes Aug 24, 2022
a702b9a
Rework: tidying
boeuf-codes Aug 24, 2022
50ce12f
Add second pressure card for concurrent spc tests
Sep 1, 2022
6274f1d
Merge pull request #152 from ISISComputingGroup/Ticket7255_fix_switching
Tom-Willemsen Sep 9, 2022
f1baa5f
Merge pull request #151 from ISISComputingGroup/Ticket_7266
JackEAllen Sep 20, 2022
dc45b75
Fix phase returning frequency
Sep 22, 2022
7707e56
Fix emulator bug
Tom-Willemsen Sep 23, 2022
8b8081b
Merge pull request #154 from ISISComputingGroup/TICKET7352_tekafg_res…
Tom-Willemsen Sep 23, 2022
38b5cdf
Merge pull request #153 from ISISComputingGroup/TICKET6947_auto_cryo_…
LilithCole Sep 23, 2022
93e001d
Make emulator match device
Tom-Willemsen Sep 28, 2022
67973a7
Merge pull request #155 from ISISComputingGroup/Ticket7397_hts_niggles
rerpha Oct 5, 2022
d99887c
Merge pull request #150 from ISISComputingGroup/Ticket4240_eurotherm_…
LilithCole Oct 12, 2022
fca8411
Instron
Tom-Willemsen Dec 2, 2022
bdcb0c8
Moved Superlogics emulator to its repo.
Dec 6, 2022
d288b3a
Initial commit
davidkeymer Dec 8, 2022
2c7412e
Fix reading of floats
FreddieAkeroyd Dec 16, 2022
602ff2f
Really fix float reading
FreddieAkeroyd Dec 16, 2022
acf6d4b
as_float -> is_float
FreddieAkeroyd Dec 18, 2022
d701fb3
Added capability to set and get the output_rate.
pheest Dec 23, 2022
29da0ec
Merge pull request #160 from ISISComputingGroup/free_via_queuerequest
Tom-Willemsen Jan 3, 2023
732bcd6
corrected code so that only one stream interface loads
davidkeymer Jan 9, 2023
5ccf9c9
Merge pull request #159 from ISISComputingGroup/Ticket7058_fix_superl…
rerpha Jan 12, 2023
dba1328
Merge pull request #158 from ISISComputingGroup/Ticket7327_instron
pheest Jan 13, 2023
b8938be
Merge pull request #161 from ISISComputingGroup/RIKENFE_RB2_Protocol
Tom-Willemsen Jan 25, 2023
3e1ee29
Merge pull request #162 from ISISComputingGroup/Ticket6931_Eurotherm_…
LowriJenkins Feb 8, 2023
4a8c0a6
Add some properties for needle valve
boeuf-codes Feb 13, 2023
ec6769e
Add flow hi lim property
boeuf-codes Feb 21, 2023
3e09c80
Add 'needle valve stop' property, tidy, and add setters for lewis bac…
boeuf-codes Mar 14, 2023
c008c9c
add skeleton modbus skf chopper emulator
rerpha Mar 31, 2023
674165f
not working just yet, but getting the hang of modbus tcp
rerpha Apr 13, 2023
a6b5742
getting somewhere, but lock timeouts
rerpha Apr 17, 2023
0c3b2cc
Update mclennan emulator
FreddieAkeroyd Apr 18, 2023
f119a2a
working but only with 40.00
rerpha Apr 18, 2023
6e4ed84
fix transaction id setting thru backdoor, switch endianness for floats
rerpha Apr 18, 2023
05282ed
remove debugging prints
rerpha Apr 18, 2023
1c6c92c
strip down emulator to only bits that are working
rerpha Apr 18, 2023
62d8656
data missing from write
rerpha Apr 18, 2023
ddfa5e5
return 0 if not found in keys - this seeemed to stop freq from worki…
rerpha Apr 20, 2023
135b79b
use raw_bytes_to_int
rerpha Apr 20, 2023
f073c36
add comment for confusing float32 behaviour
rerpha Apr 20, 2023
ab55be5
Update for correct format
FreddieAkeroyd Apr 21, 2023
491f1ae
CP is target_position
FreddieAkeroyd Apr 21, 2023
0d8a3e2
use isinstance rather than type()==type
rerpha Apr 25, 2023
38a4ea8
use random transaction id if not sending correctly and remove readtim…
rerpha Apr 25, 2023
2e8e35e
Merge pull request #164 from ISISComputingGroup/Ticket7606_transactio…
Tom-Willemsen Apr 25, 2023
dd70908
Rename to tpgx00 and add protocols for 300/500
boeuf-codes May 2, 2023
c16b244
Fix some docstrings and refactor various logic to make more generic
boeuf-codes May 4, 2023
5139a51
Add simulated delay.
May 5, 2023
2bc50a3
Add QA command output
FreddieAkeroyd May 12, 2023
096a493
Add missing pressure status property to emulator
boeuf-codes May 17, 2023
9f22df7
Add switching f-n assignment property & refactor switching f-n status…
boeuf-codes May 18, 2023
35585f3
Add delay and error command.
May 18, 2023
c4cdd36
Add missing commands and fix terminating characters.
May 18, 2023
a211a2c
Return QA with correct terminator
FreddieAkeroyd May 18, 2023
518604b
Merge pull request #165 from ISISComputingGroup/update_mclennan
rerpha May 19, 2023
714663a
Add peak positions.
May 19, 2023
c96e5a0
Allow for 1 word as well as 2 word integer reads
FreddieAkeroyd May 22, 2023
d69151f
Merge pull request #167 from ISISComputingGroup/Ticket7658_add_diagno…
FreddieAkeroyd May 22, 2023
393116f
Refactor emulator so enum values only stored in stream interface
boeuf-codes May 23, 2023
9539f0f
Refactor CircuitAssignment class to use enum instead of int
boeuf-codes May 23, 2023
dd60e7f
Add clear_datum command
FreddieAkeroyd May 30, 2023
d994c4d
Expand UNI command to include TPG500 units
boeuf-codes May 31, 2023
6aa9aac
Return checksum and add additional checks on incoming data
FreddieAkeroyd May 31, 2023
73e533e
Merge pull request #166 from ISISComputingGroup/Ticket7697_eurotherm_…
FreddieAkeroyd Jun 1, 2023
4792c32
Merge pull request #168 from ISISComputingGroup/Ticket7821_mclennan_a…
rerpha Jun 6, 2023
56e6561
Implement on-timer property for 500 and fix/update docstrings
boeuf-codes Jun 14, 2023
7f885f8
Add emulator support for tpg ERR command
boeuf-codes Jun 20, 2023
b30c34e
Fix docstrings
boeuf-codes Jul 6, 2023
61db831
Refacor needle valve properties with better names
boeuf-codes Jul 14, 2023
7c0c597
Merge remote-tracking branch 'origin/master' into Ticket6777
FreddieAkeroyd Jul 28, 2023
f0471b3
Made exception in the handles_write() method return None if write fails
esmith1729 Aug 1, 2023
3ae45b2
Merge pull request #163 from ISISComputingGroup/Ticket6777
esmith1729 Aug 2, 2023
6c9ad9d
Add kepco range
FreddieAkeroyd Aug 4, 2023
fca092f
Adapt cmd builders to exclude terminator on <ENQ> command in line wit…
zsoltkebel Aug 4, 2023
132ead7
Override readtimeout to 1 msec
zsoltkebel Aug 8, 2023
bcce389
Merge pull request #170 from ISISComputingGroup/Ticket7945_kepco_range
zsoltkebel Aug 14, 2023
63c3456
Emulator changes required to integrate needlevalve test functionality…
esmith1729 Aug 17, 2023
dd2cf02
Adding the modbus interface for the 1242
KathrynBaker Aug 18, 2023
38b4fa9
Merge pull request #171 from ISISComputingGroup/Ticket6777_more_emu_c…
zsoltkebel Aug 21, 2023
5c21603
Merge pull request #172 from ISISComputingGroup/Ticket7875_Add_IOLOGI…
esmith1729 Aug 22, 2023
a2d33c7
Merge pull request #169 from ISISComputingGroup/Ticket7458
esmith1729 Aug 22, 2023
83f2104
Use just LF for in terminator
FreddieAkeroyd Sep 4, 2023
9574dd8
Merge branch 'master' into Ticket6341_cryosms_periodic_checks
LilithCole Oct 3, 2023
68f5747
moved to support
LilithCole Oct 3, 2023
8679976
Merge pull request #174 from ISISComputingGroup/Ticket6341_cryosms_pe…
KathrynBaker Oct 10, 2023
637eeb5
Add additional modbus values
FreddieAkeroyd Feb 17, 2024
76a2161
Add has_sent_ba variable
May 2, 2024
679c919
Merge pull request #175 from ISISComputingGroup/Ticket8253_make_IOC_w…
LowriJenkins May 13, 2024
5162b91
Remove usage of six
LowriJenkins May 17, 2024
5bac659
Merge pull request #176 from ISISComputingGroup/Ticket8297_remove_six…
Chsudeepta May 22, 2024
52969d3
Merge pull request #173 from ISISComputingGroup/Ticket7778_zerofield_…
rerpha May 28, 2024
d06c668
Add eurotherm sensor class to handle multiple sensors and instances o…
esmith1729 May 30, 2024
87cc85d
further refactoring
esmith1729 May 30, 2024
597de02
refactor and include missing attribute get and sets
esmith1729 May 30, 2024
45fe3ed
Add more get and set to simulated eurotherm for eurothermsensor attri…
esmith1729 May 31, 2024
c9a309e
Remove all "_" attributes, add get and set for all attributes of Euro…
esmith1729 Jun 4, 2024
15b0f46
Add addr params to methods, and add new methods for output_rate and o…
esmith1729 Jun 5, 2024
48e4f4e
Change regex to escape to ensure strings aren't passed or modified
esmith1729 Jun 5, 2024
593eeda
Change eurothermSensor's initialize data to __init__, renumber and re…
esmith1729 Jun 5, 2024
4de8317
add delay_time to initialize data to fix delay not being attribute error
esmith1729 Jun 5, 2024
aff1c62
made value a string to avoid concatenation error
esmith1729 Jun 5, 2024
245854a
Use cd /d
FreddieAkeroyd Jun 8, 2024
0c7c081
rename connected to avoid uncallable being exposed; add type conversi…
esmith1729 Jun 10, 2024
a0bffe8
add bool value
esmith1729 Jun 25, 2024
bc3a3ea
Ticket8378_add_linting_action
LowriJenkins Jul 12, 2024
7d074d1
Ran ruff formatter
LowriJenkins Jul 12, 2024
3c5addd
Ran safe fixes
LowriJenkins Jul 12, 2024
01c2f09
Ignore revs for ruff format and ruff --fix
LowriJenkins Jul 12, 2024
c39296a
Added NL
Aug 2, 2024
f1368a4
Merge pull request #178 from ISISComputingGroup/Ticket8378_add_lintin…
jackbdoughty Aug 5, 2024
f0c22fd
ramp symmetry
Tom-Willemsen Sep 11, 2024
c774041
Use WA
Tom-Willemsen Sep 18, 2024
5879c87
Ruff
Tom-Willemsen Sep 18, 2024
7cf0fe8
Merge pull request #180 from ISISComputingGroup/Ticket8502
rerpha Sep 19, 2024
60109ab
Merge pull request #179 from ISISComputingGroup/ramp_symm
rerpha Sep 26, 2024
f43b839
Ruff/Pyright changes
Oct 17, 2024
e849588
ruff
Oct 17, 2024
41cff8b
Update com2tcp.py
jackbdoughty Oct 17, 2024
f9a8d98
Merge pull request #181 from ISISComputingGroup/ruff_pyright_day
Tom-Willemsen Oct 17, 2024
2e763f0
change cmds to not cast to int
esmith1729 Oct 30, 2024
585f619
create set_delay_time to allow for some tests to change it
esmith1729 Nov 1, 2024
cc46a45
Change some typos, remove print statements
esmith1729 Nov 4, 2024
b76dca4
remove print statement
esmith1729 Nov 4, 2024
5e5fe40
Change all set functions to use the set method in device.py, and all …
esmith1729 Nov 4, 2024
d61babe
Change modbus values from int to string
esmith1729 Nov 4, 2024
1a8650b
Ammend data types for needlevalve attributes
esmith1729 Nov 5, 2024
fc3d96c
Add reference to sensor, since device.py now handles attributes with …
esmith1729 Nov 5, 2024
66b7ba4
Revert changes of type float back to int, as modbus interface can onl…
esmith1729 Nov 7, 2024
17351bf
Change type from int to float
esmith1729 Nov 7, 2024
ee81bac
return output_rate to int
esmith1729 Nov 7, 2024
c8828f7
Add type hints and init method, formatting for ruff and pyright changes
esmith1729 Nov 7, 2024
95be48d
Refactor for ruff/pyright
esmith1729 Nov 11, 2024
add8d44
output_rate needs to be int for modbus_interface
esmith1729 Nov 11, 2024
1f337a1
Ruff change
esmith1729 Nov 11, 2024
f500f89
Merge origin master into Ticket8310_eurotherm_disconnected_sensor
esmith1729 Nov 29, 2024
77f6eae
Ruff formatting
esmith1729 Nov 29, 2024
08f9013
ruff changes import block
esmith1729 Nov 29, 2024
8506257
Merge pull request #177 from ISISComputingGroup/Ticket8310_eurothrm_d…
Chsudeepta Nov 29, 2024
d0c6df7
Revert "moved to support"
Tom-Willemsen Jan 2, 2025
3f0567b
Make emulator reply using protocol that device expects
Tom-Willemsen Jan 6, 2025
8d710d4
Hifi ZF / group3hallprobe changes after hardware testing
Tom-Willemsen Jan 7, 2025
b8332af
Ruff/pyright
Tom-Willemsen Jan 13, 2025
bb0884c
Merge pull request #182 from ISISComputingGroup/Ticket8401_hifi_zf
rerpha Jan 14, 2025
6f5a34d
Cryosms emulator
Tom-Willemsen Mar 3, 2025
fb81853
ruff
Tom-Willemsen Mar 3, 2025
8230ee3
Merge pull request #183 from ISISComputingGroup/cryosms
FreddieAkeroyd Mar 3, 2025
d17f420
Remove SM300 emulator
rerpha Jul 28, 2025
2093bf9
Merge pull request #185 from ISISComputingGroup/remove_sm300
Tom-Willemsen Jul 28, 2025
69c65e6
Move emulators to match lewis structure and delete unused files
rerpha Oct 28, 2025
50d3873
Merge branch 'temp_branch' into add_isis_devices_2
rerpha Oct 28, 2025
777935f
remove old license comments, add group 3 hall probe emulator, ruff fo…
rerpha Oct 28, 2025
65c7042
ruff format
rerpha Oct 28, 2025
75be53c
add format after deviceemulator merge to git blame ignore revs file
rerpha Oct 28, 2025
0c2c868
removed isis specific lewis_version
rerpha Oct 28, 2025
e6a655b
ruff check --fix fixes
rerpha Oct 28, 2025
745a15a
move facility specific emulators into devices.facility_specific.[ess,…
rerpha Oct 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# ignore ruff format and --fix
7d074d129ef30f64dee361531fe3d6a020cdff98
3c5addd30d6e6f6ae34b02333d34360d773ed3bf
65c70425a7597cd372cfe9a331af6123e6ddfdd0
3 changes: 3 additions & 0 deletions lewis/devices/Lksh218/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .device import SimulatedLakeshore218

__all__ = ["SimulatedLakeshore218"]
81 changes: 81 additions & 0 deletions lewis/devices/Lksh218/device.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
from collections import OrderedDict

from lewis.devices import StateMachineDevice

from .states import DefaultState

NUMBER_OF_TEMP_CHANNELS = 8
NUMBER_OF_SENSOR_CHANNELS = 8


class SimulatedLakeshore218(StateMachineDevice):
"""Simulated Lakeshore 218"""

def _initialize_data(self):

Check failure on line 14 in lewis/devices/Lksh218/device.py

View workflow job for this annotation

GitHub Actions / call-linter-workflow / ruff

Ruff (ANN202)

lewis/devices/Lksh218/device.py:14:9: ANN202 Missing return type annotation for private function `_initialize_data`
"""Sets the initial state of the device."""
self._temps = [1.0] * NUMBER_OF_TEMP_CHANNELS
self._sensors = [0.5] * NUMBER_OF_SENSOR_CHANNELS
self.temp_all = ""
self.sensor_all = ""
self.connected = True

@staticmethod
def _get_state_handlers():

Check failure on line 23 in lewis/devices/Lksh218/device.py

View workflow job for this annotation

GitHub Actions / call-linter-workflow / ruff

Ruff (ANN205)

lewis/devices/Lksh218/device.py:23:9: ANN205 Missing return type annotation for staticmethod `_get_state_handlers`
"""Returns: States and their names."""
return {DefaultState.NAME: DefaultState()}

@staticmethod
def _get_initial_state():

Check failure on line 28 in lewis/devices/Lksh218/device.py

View workflow job for this annotation

GitHub Actions / call-linter-workflow / ruff

Ruff (ANN205)

lewis/devices/Lksh218/device.py:28:9: ANN205 Missing return type annotation for staticmethod `_get_initial_state`
"""Returns: The name of the initial state."""
return DefaultState.NAME

@staticmethod
def _get_transition_handlers():

Check failure on line 33 in lewis/devices/Lksh218/device.py

View workflow job for this annotation

GitHub Actions / call-linter-workflow / ruff

Ruff (ANN205)

lewis/devices/Lksh218/device.py:33:9: ANN205 Missing return type annotation for staticmethod `_get_transition_handlers`
"""Returns: The state transitions."""
return OrderedDict()

def get_temp(self, number):

Check failure on line 37 in lewis/devices/Lksh218/device.py

View workflow job for this annotation

GitHub Actions / call-linter-workflow / ruff

Ruff (ANN001)

lewis/devices/Lksh218/device.py:37:24: ANN001 Missing type annotation for function argument `number`

Check failure on line 37 in lewis/devices/Lksh218/device.py

View workflow job for this annotation

GitHub Actions / call-linter-workflow / ruff

Ruff (ANN201)

lewis/devices/Lksh218/device.py:37:9: ANN201 Missing return type annotation for public function `get_temp`
"""Gets the temperature of a specific temperature sensor.

Args:
number: Integer between 1 and 8.

Returns:
float: Temperature value at position (number - 1) in temps.
"""
return self._temps[number - 1]

def set_temp(self, number, temperature):

Check failure on line 48 in lewis/devices/Lksh218/device.py

View workflow job for this annotation

GitHub Actions / call-linter-workflow / ruff

Ruff (ANN001)

lewis/devices/Lksh218/device.py:48:32: ANN001 Missing type annotation for function argument `temperature`

Check failure on line 48 in lewis/devices/Lksh218/device.py

View workflow job for this annotation

GitHub Actions / call-linter-workflow / ruff

Ruff (ANN001)

lewis/devices/Lksh218/device.py:48:24: ANN001 Missing type annotation for function argument `number`

Check failure on line 48 in lewis/devices/Lksh218/device.py

View workflow job for this annotation

GitHub Actions / call-linter-workflow / ruff

Ruff (ANN201)

lewis/devices/Lksh218/device.py:48:9: ANN201 Missing return type annotation for public function `set_temp`
"""Sets the (number - 1) temp pv to temperature.

Args:
number: Integer between 1 and 8.
temperature: Temperature reading to set.

Returns:
None
"""
self._temps[number - 1] = temperature

def get_sensor(self, number):

Check failure on line 60 in lewis/devices/Lksh218/device.py

View workflow job for this annotation

GitHub Actions / call-linter-workflow / ruff

Ruff (ANN201)

lewis/devices/Lksh218/device.py:60:9: ANN201 Missing return type annotation for public function `get_sensor`
"""Gets the sensor reading of a specific sensor.

Args:
number: Integer between 1 and 8.

Returns:
float: Value of sensor at position (number - 1) in sensors.
"""
return self._sensors[number - 1]

def set_sensor(self, number, value):
"""Sets the (number - 1) sensor pv to value.

Args:
number: Integer between 1 and 8.
value: Sensor reading to set.

Returns:
None
"""
self._sensors[number - 1] = value
3 changes: 3 additions & 0 deletions lewis/devices/Lksh218/interfaces/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .stream_interface import Lakeshore218StreamInterface

__all__ = ["Lakeshore218StreamInterface"]
83 changes: 83 additions & 0 deletions lewis/devices/Lksh218/interfaces/stream_interface.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
from lewis.adapters.stream import StreamInterface
from lewis.utils.command_builder import CmdBuilder


def if_connected(f):
"""Decorator that executes f if the device is connected and returns None otherwise.

Args:
f: function to be executed if the device is connected.

Returns:
The value of f(*args) if the device is connected and None otherwise.
"""

def wrapper(*args):
connected = getattr(args[0], "_device").connected
if connected:
result = f(*args)
else:
result = None
return result

return wrapper


class Lakeshore218StreamInterface(StreamInterface):
"""Stream interface for the serial port"""

in_terminator = "\r\n"
out_terminator = "\r\n"

commands = {
CmdBuilder("get_temp").escape("KRDG? ").arg("[1-8]").build(),
CmdBuilder("get_sensor").escape("SRDG? ").arg("[1-8]").build(),
CmdBuilder("get_temp_all").escape("KRDG? 0").build(),
CmdBuilder("get_sensor_all").escape("SRDG? 0").build(),
}

@if_connected
def get_temp(self, number):
"""Returns the temperature of a TEMP pv.

Args:
number: integer between 1 and 8

Returns:
float: temperature
"""
number = int(number)
temperature = self._device.get_temp(number)
return temperature

@if_connected
def get_sensor(self, number):
"""Returns the temperature of a SENSOR pv.

Args:
number: integer between 1 and 8

Returns:
float: sensor_reading
"""
number = int(number)
sensor_reading = self._device.get_sensor(number)
return sensor_reading

@if_connected
def get_temp_all(self):
"""Returns a string from TEMPALL pv.

Returns:
string: value of TEMPALL pv.
"""
return self._device.temp_all

@if_connected
def get_sensor_all(self):
"""Returns a string from SENSORALL pv.

Returns:
string: value of SENSORALL pv.
"""
return self._device.sensor_all
7 changes: 7 additions & 0 deletions lewis/devices/Lksh218/states.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from lewis.core.statemachine import State


class DefaultState(State):
"""Device is in default state."""

NAME = "Default"
3 changes: 3 additions & 0 deletions lewis/devices/ag33220a/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .device import SimulatedAG33220A

__all__ = ["SimulatedAG33220A"]
168 changes: 168 additions & 0 deletions lewis/devices/ag33220a/device.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
from lewis.devices import Device


class SimulatedAG33220A(Device):
"""Simulated AG33220A"""

connected = True

# Constants
AMP_MIN = 0.01
AMP_MAX = 10
OFF_MAX = 4.995
VOLT_MAX = 5
VOLT_MIN = -5
VOLT_LOW_MAX = 4.99
VOLT_HIGH_MIN = -4.99
VOLT_PRECISION = 0.01
FREQ_MINS = {
"SIN": 10**-6,
"SQU": 10**-6,
"RAMP": 10**-6,
"PULS": 5 * 10**-4,
"NOIS": 10**-6,
"USER": 10**-6,
}
FREQ_MAXS = {
"SIN": 2 * 10**7,
"SQU": 2 * 10**7,
"RAMP": 2 * 10**5,
"PULS": 5 * 10**6,
"NOIS": 2 * 10**7,
"USER": 6 * 10**6,
}

# Device variables
idn = "Agilent Technologies,33220A-MY44033103,2.02-2.02-22-2"
amplitude = 0.1
frequency = 1000
offset = 0
units = "VPP"
function = "SIN"
output = "ON"
voltage_high = 0.05
voltage_low = -0.05
range_auto = "OFF"

def limit(self, value, minimum, maximum):
"""Limits an input number between two given numbers or sets the value to the maximum or minimum.

:param value: the value to be limited
:param minimum: the smallest that the value can be
:param maximum: the largest that the value can be

:return: the value after it has been limited
"""
if type(value) is str:
try:
value = float(value)
except ValueError:
return {"MIN": minimum, "MAX": maximum}[value]

return max(min(value, maximum), minimum)

def set_new_amplitude(self, new_amplitude):
"""Changing the amplitude to the new amplitude whilst also changing the offset if voltage high or low is
outside the boundary. The volt high and low are then updated.

:param new_amplitude: the amplitude to set the devices amplitude to
"""
new_amplitude = self.limit(new_amplitude, self.AMP_MIN, self.AMP_MAX)

peak_amp = 0.5 * new_amplitude
if self.offset + peak_amp > self.VOLT_MAX:
self.offset = self.VOLT_MAX - peak_amp
elif self.offset - peak_amp < self.VOLT_MIN:
self.offset = self.VOLT_MIN + peak_amp

self.amplitude = new_amplitude

self._update_volt_high_and_low(self.amplitude, self.offset)

def set_new_frequency(self, new_frequency):
"""Sets the frequency within limits between upper and lower bound (depends on the function).

:param new_frequency: the frequency to set to
"""
self.frequency = self.limit(
new_frequency, self.FREQ_MINS[self.function], self.FREQ_MAXS[self.function]
)

def set_new_voltage_high(self, new_voltage_high):
"""Sets a new voltage high which then changes the voltage low to keep it lower.
The voltage offset and amplitude are then updated.

:param new_voltage_high: the value of voltage high to set to
"""
new_voltage_high = self.limit(new_voltage_high, self.VOLT_HIGH_MIN, self.VOLT_MAX)
if new_voltage_high <= self.voltage_low:
self.voltage_low = self.limit(
new_voltage_high - self.VOLT_PRECISION, self.VOLT_MIN, new_voltage_high
)
self._update_volt_and_offs(self.voltage_low, new_voltage_high)

def set_new_voltage_low(self, new_voltage_low):
"""Sets a new voltage high which then changes the voltage low to keep it higher.
The voltage offset and amplitude are then updated.

:param new_voltage_low: the value of voltage low which is to be set
"""
new_voltage_low = self.limit(new_voltage_low, self.VOLT_MIN, self.VOLT_LOW_MAX)
if new_voltage_low >= self.voltage_high:
self.voltage_high = self.limit(
new_voltage_low + self.VOLT_PRECISION, new_voltage_low, self.VOLT_MAX
)
self._update_volt_and_offs(new_voltage_low, self.voltage_high)

def _update_volt_and_offs(self, new_low, new_high):
"""Updates the value of amplitude and offset if there is a change in voltage low or voltage high.

:param new_low: the value of voltage low
:param new_high: the value of voltage high
"""
self.voltage_high = new_high
self.voltage_low = new_low
self.amplitude = self.voltage_high - self.voltage_low
self.offset = (self.voltage_high + self.voltage_low) / 2

def set_offs_and_update_voltage(self, new_offset):
"""Sets the value of offset and updates the amplitude, voltage low and voltage high for a new value of the offset.

:param new_offset: the new offset to be set
"""
new_offset = self.limit(new_offset, -self.OFF_MAX, self.OFF_MAX)
if new_offset + self.voltage_high > self.VOLT_MAX:
self.amplitude = 2 * (self.VOLT_MAX - new_offset)
self.voltage_high = self.VOLT_MAX
self.voltage_low = self.VOLT_MAX - self.amplitude
elif new_offset + self.voltage_low < self.VOLT_MIN:
self.amplitude = 2 * (self.VOLT_MIN - new_offset)
self.voltage_low = self.VOLT_MIN
self.voltage_high = self.VOLT_MIN + self.amplitude
else:
self._update_volt_high_and_low(self.amplitude, new_offset)
self.offset = new_offset

def _update_volt_high_and_low(self, new_volt, new_offs):
"""Updates the value of voltage high and low for a given value of amplitude and offset.

:param new_volt: the value of the amplitude
:param new_offs: the value of the offset
"""
self.offset = new_offs
self.amplitude = new_volt
self.voltage_high = new_offs + new_volt / 2
self.voltage_low = new_offs - new_volt / 2

def get_output(self):
return ["OFF", "ON"].index(self.output)

def get_range_auto(self):
possible_ranges = ["OFF", "ON", "ONCE"]
return possible_ranges.index(self.range_auto)

def set_function(self, new_function):
self.function = new_function
self.frequency = self.limit(
self.frequency, self.FREQ_MINS[new_function], self.FREQ_MAXS[new_function]
)
3 changes: 3 additions & 0 deletions lewis/devices/ag33220a/interfaces/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .stream_interface import AG33220AStreamInterface

__all__ = ["AG33220AStreamInterface"]
Loading
Loading