cgse 2024.7.0__py3-none-any.whl → 2025.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- README.md +27 -0
- bump.py +85 -0
- cgse-2025.0.1.dist-info/METADATA +38 -0
- cgse-2025.0.1.dist-info/RECORD +5 -0
- {cgse-2024.7.0.dist-info → cgse-2025.0.1.dist-info}/WHEEL +1 -2
- cgse-2024.7.0.dist-info/COPYING +0 -674
- cgse-2024.7.0.dist-info/COPYING.LESSER +0 -165
- cgse-2024.7.0.dist-info/METADATA +0 -144
- cgse-2024.7.0.dist-info/RECORD +0 -660
- cgse-2024.7.0.dist-info/entry_points.txt +0 -75
- cgse-2024.7.0.dist-info/top_level.txt +0 -2
- egse/__init__.py +0 -12
- egse/__main__.py +0 -32
- egse/aeu/aeu.py +0 -5238
- egse/aeu/aeu_awg.yaml +0 -265
- egse/aeu/aeu_crio.yaml +0 -273
- egse/aeu/aeu_cs.py +0 -627
- egse/aeu/aeu_devif.py +0 -321
- egse/aeu/aeu_main_ui.py +0 -903
- egse/aeu/aeu_metrics.py +0 -131
- egse/aeu/aeu_protocol.py +0 -463
- egse/aeu/aeu_psu.yaml +0 -204
- egse/aeu/aeu_ui.py +0 -873
- egse/aeu/arbdata/FccdRead.arb +0 -2
- egse/aeu/arbdata/FccdRead_min_points.arb +0 -2
- egse/aeu/arbdata/HeaterSync_FccdRead.arb +0 -2
- egse/aeu/arbdata/HeaterSync_ccdRead25.arb +0 -2
- egse/aeu/arbdata/HeaterSync_ccdRead31_25.arb +0 -2
- egse/aeu/arbdata/HeaterSync_ccdRead37_50.arb +0 -2
- egse/aeu/arbdata/HeaterSync_ccdRead43_75.arb +0 -2
- egse/aeu/arbdata/HeaterSync_ccdRead50.arb +0 -2
- egse/aeu/arbdata/Heater_FccdRead_min_points.arb +0 -2
- egse/aeu/arbdata/ccdRead25.arb +0 -2
- egse/aeu/arbdata/ccdRead25_150ms.arb +0 -2
- egse/aeu/arbdata/ccdRead31_25.arb +0 -2
- egse/aeu/arbdata/ccdRead31_25_150ms.arb +0 -2
- egse/aeu/arbdata/ccdRead37_50.arb +0 -2
- egse/aeu/arbdata/ccdRead37_50_150ms.arb +0 -2
- egse/aeu/arbdata/ccdRead43_75.arb +0 -2
- egse/aeu/arbdata/ccdRead43_75_150ms.arb +0 -2
- egse/aeu/arbdata/ccdRead50.arb +0 -2
- egse/aeu/arbdata/ccdRead50_150ms.arb +0 -2
- egse/alert/__init__.py +0 -1049
- egse/alert/alertman.yaml +0 -37
- egse/alert/alertman_cs.py +0 -233
- egse/alert/alertman_ui.py +0 -600
- egse/alert/gsm/beaglebone.py +0 -138
- egse/alert/gsm/beaglebone.yaml +0 -51
- egse/alert/gsm/beaglebone_cs.py +0 -108
- egse/alert/gsm/beaglebone_devif.py +0 -122
- egse/alert/gsm/beaglebone_protocol.py +0 -46
- egse/bits.py +0 -318
- egse/camera.py +0 -44
- egse/collimator/__init__.py +0 -0
- egse/collimator/fcul/__init__.py +0 -0
- egse/collimator/fcul/ogse.py +0 -1077
- egse/collimator/fcul/ogse.yaml +0 -14
- egse/collimator/fcul/ogse_cs.py +0 -154
- egse/collimator/fcul/ogse_devif.py +0 -358
- egse/collimator/fcul/ogse_protocol.py +0 -132
- egse/collimator/fcul/ogse_sim.py +0 -431
- egse/collimator/fcul/ogse_ui.py +0 -1108
- egse/command.py +0 -699
- egse/config.py +0 -410
- egse/confman/__init__.py +0 -1058
- egse/confman/confman.yaml +0 -70
- egse/confman/confman_cs.py +0 -240
- egse/confman/confman_ui.py +0 -381
- egse/confman/setup_ui.py +0 -565
- egse/control.py +0 -632
- egse/coordinates/__init__.py +0 -534
- egse/coordinates/avoidance.py +0 -100
- egse/coordinates/cslmodel.py +0 -127
- egse/coordinates/laser_tracker_to_dict.py +0 -122
- egse/coordinates/point.py +0 -707
- egse/coordinates/pyplot.py +0 -194
- egse/coordinates/referenceFrame.py +0 -1279
- egse/coordinates/refmodel.py +0 -737
- egse/coordinates/rotationMatrix.py +0 -85
- egse/coordinates/transform3d_addon.py +0 -419
- egse/csl/__init__.py +0 -50
- egse/csl/commanding.py +0 -78
- egse/csl/icons/hexapod-connected-selected.svg +0 -30
- egse/csl/icons/hexapod-connected.svg +0 -30
- egse/csl/icons/hexapod-homing-selected.svg +0 -68
- egse/csl/icons/hexapod-homing.svg +0 -68
- egse/csl/icons/hexapod-retract-selected.svg +0 -56
- egse/csl/icons/hexapod-retract.svg +0 -51
- egse/csl/icons/hexapod-zero-selected.svg +0 -56
- egse/csl/icons/hexapod-zero.svg +0 -56
- egse/csl/icons/logo-puna.svg +0 -92
- egse/csl/icons/stop.svg +0 -1
- egse/csl/initialisation.py +0 -102
- egse/csl/mech_pos_settings.yaml +0 -18
- egse/das.py +0 -1240
- egse/das.yaml +0 -7
- egse/data/conf/SETUP_CSL_00000_170620_150000.yaml +0 -5
- egse/data/conf/SETUP_CSL_00001_170620_151010.yaml +0 -69
- egse/data/conf/SETUP_CSL_00002_170620_151020.yaml +0 -69
- egse/data/conf/SETUP_CSL_00003_170620_151030.yaml +0 -69
- egse/data/conf/SETUP_CSL_00004_170620_151040.yaml +0 -69
- egse/data/conf/SETUP_CSL_00005_170620_151050.yaml +0 -69
- egse/data/conf/SETUP_CSL_00006_170620_151060.yaml +0 -69
- egse/data/conf/SETUP_CSL_00007_170620_151070.yaml +0 -69
- egse/data/conf/SETUP_CSL_00008_170620_151080.yaml +0 -75
- egse/data/conf/SETUP_CSL_00010_210308_083016.yaml +0 -138
- egse/data/conf/SETUP_INTA_00000_170620_150000.yaml +0 -4
- egse/data/conf/SETUP_SRON_00000_170620_150000.yaml +0 -4
- egse/decorators.py +0 -514
- egse/device.py +0 -269
- egse/dpu/__init__.py +0 -2698
- egse/dpu/ccd_ui.py +0 -514
- egse/dpu/dpu.py +0 -783
- egse/dpu/dpu.yaml +0 -153
- egse/dpu/dpu_cs.py +0 -272
- egse/dpu/dpu_ui.py +0 -671
- egse/dpu/fitsgen.py +0 -2096
- egse/dpu/fitsgen_ui.py +0 -399
- egse/dpu/hdf5_model.py +0 -332
- egse/dpu/hdf5_ui.py +0 -277
- egse/dpu/hdf5_viewer.py +0 -506
- egse/dpu/hk_ui.py +0 -468
- egse/dpu_commands.py +0 -81
- egse/dsi/__init__.py +0 -33
- egse/dsi/_libesl.py +0 -232
- egse/dsi/constants.py +0 -296
- egse/dsi/esl.py +0 -630
- egse/dsi/rmap.py +0 -444
- egse/dsi/rmapci.py +0 -39
- egse/dsi/spw.py +0 -335
- egse/dsi/spw_state.py +0 -29
- egse/dummy.py +0 -318
- egse/dyndummy.py +0 -179
- egse/env.py +0 -278
- egse/exceptions.py +0 -88
- egse/fdir/__init__.py +0 -26
- egse/fdir/fdir_manager.py +0 -85
- egse/fdir/fdir_manager.yaml +0 -37
- egse/fdir/fdir_manager_controller.py +0 -136
- egse/fdir/fdir_manager_cs.py +0 -164
- egse/fdir/fdir_manager_interface.py +0 -15
- egse/fdir/fdir_remote.py +0 -73
- egse/fdir/fdir_remote.yaml +0 -30
- egse/fdir/fdir_remote_controller.py +0 -30
- egse/fdir/fdir_remote_cs.py +0 -94
- egse/fdir/fdir_remote_interface.py +0 -9
- egse/fdir/fdir_remote_popup.py +0 -26
- egse/fee/__init__.py +0 -106
- egse/fee/f_fee_register.yaml +0 -43
- egse/fee/feesim.py +0 -914
- egse/fee/n_fee_hk.py +0 -768
- egse/fee/nfee.py +0 -188
- egse/filterwheel/__init__.py +0 -4
- egse/filterwheel/eksma/__init__.py +0 -49
- egse/filterwheel/eksma/fw8smc4.py +0 -657
- egse/filterwheel/eksma/fw8smc4.yaml +0 -121
- egse/filterwheel/eksma/fw8smc4_cs.py +0 -144
- egse/filterwheel/eksma/fw8smc4_devif.py +0 -473
- egse/filterwheel/eksma/fw8smc4_protocol.py +0 -82
- egse/filterwheel/eksma/fw8smc4_ui.py +0 -940
- egse/filterwheel/eksma/fw8smc5.py +0 -115
- egse/filterwheel/eksma/fw8smc5.yaml +0 -105
- egse/filterwheel/eksma/fw8smc5_controller.py +0 -307
- egse/filterwheel/eksma/fw8smc5_cs.py +0 -141
- egse/filterwheel/eksma/fw8smc5_interface.py +0 -65
- egse/filterwheel/eksma/fw8smc5_simulator.py +0 -29
- egse/filterwheel/eksma/fw8smc5_ui.py +0 -1065
- egse/filterwheel/eksma/testpythonfw.py +0 -215
- egse/fov/__init__.py +0 -65
- egse/fov/fov_hk.py +0 -710
- egse/fov/fov_ui.py +0 -859
- egse/fov/fov_ui_controller.py +0 -140
- egse/fov/fov_ui_model.py +0 -200
- egse/fov/fov_ui_view.py +0 -345
- egse/gimbal/__init__.py +0 -32
- egse/gimbal/symetrie/__init__.py +0 -26
- egse/gimbal/symetrie/alpha.py +0 -586
- egse/gimbal/symetrie/generic_gimbal_ui.py +0 -1521
- egse/gimbal/symetrie/gimbal.py +0 -877
- egse/gimbal/symetrie/gimbal.yaml +0 -168
- egse/gimbal/symetrie/gimbal_cs.py +0 -183
- egse/gimbal/symetrie/gimbal_protocol.py +0 -138
- egse/gimbal/symetrie/gimbal_ui.py +0 -361
- egse/gimbal/symetrie/pmac.py +0 -1006
- egse/gimbal/symetrie/pmac_regex.py +0 -83
- egse/graph.py +0 -132
- egse/gui/__init__.py +0 -47
- egse/gui/buttons.py +0 -378
- egse/gui/focalplane.py +0 -1285
- egse/gui/formatter.py +0 -10
- egse/gui/led.py +0 -162
- egse/gui/limitswitch.py +0 -143
- egse/gui/mechanisms.py +0 -587
- egse/gui/states.py +0 -148
- egse/gui/stripchart.py +0 -729
- egse/gui/styles.qss +0 -48
- egse/gui/switch.py +0 -112
- egse/h5.py +0 -274
- egse/help/__init__.py +0 -0
- egse/help/help_ui.py +0 -126
- egse/hexapod/__init__.py +0 -32
- egse/hexapod/symetrie/__init__.py +0 -137
- egse/hexapod/symetrie/alpha.py +0 -874
- egse/hexapod/symetrie/dynalpha.py +0 -1387
- egse/hexapod/symetrie/hexapod_ui.py +0 -1516
- egse/hexapod/symetrie/pmac.py +0 -1010
- egse/hexapod/symetrie/pmac_regex.py +0 -83
- egse/hexapod/symetrie/puna.py +0 -1167
- egse/hexapod/symetrie/puna.yaml +0 -193
- egse/hexapod/symetrie/puna_cs.py +0 -195
- egse/hexapod/symetrie/puna_protocol.py +0 -134
- egse/hexapod/symetrie/puna_ui.py +0 -433
- egse/hexapod/symetrie/punaplus.py +0 -107
- egse/hexapod/symetrie/zonda.py +0 -872
- egse/hexapod/symetrie/zonda.yaml +0 -337
- egse/hexapod/symetrie/zonda_cs.py +0 -172
- egse/hexapod/symetrie/zonda_devif.py +0 -414
- egse/hexapod/symetrie/zonda_protocol.py +0 -123
- egse/hexapod/symetrie/zonda_ui.py +0 -449
- egse/hk.py +0 -791
- egse/icons/aeu-cs-start.svg +0 -117
- egse/icons/aeu-cs-stop.svg +0 -118
- egse/icons/aeu-cs.svg +0 -107
- egse/icons/aeu_cs-started.svg +0 -112
- egse/icons/aeu_cs-stopped.svg +0 -112
- egse/icons/aeu_cs.svg +0 -55
- egse/icons/alert.svg +0 -1
- egse/icons/arrow-double-left.png +0 -0
- egse/icons/arrow-double-right.png +0 -0
- egse/icons/arrow-up.svg +0 -11
- egse/icons/backward.svg +0 -1
- egse/icons/busy.svg +0 -1
- egse/icons/cleaning.svg +0 -115
- egse/icons/color-scheme.svg +0 -1
- egse/icons/cs-connected-alert.svg +0 -91
- egse/icons/cs-connected-disabled.svg +0 -43
- egse/icons/cs-connected.svg +0 -89
- egse/icons/cs-not-connected.svg +0 -44
- egse/icons/double-left-arrow.svg +0 -1
- egse/icons/double-right-arrow.svg +0 -1
- egse/icons/erase-disabled.svg +0 -19
- egse/icons/erase.svg +0 -59
- egse/icons/fitsgen-start.svg +0 -47
- egse/icons/fitsgen-stop.svg +0 -48
- egse/icons/fitsgen.svg +0 -1
- egse/icons/forward.svg +0 -1
- egse/icons/fov-hk-start.svg +0 -33
- egse/icons/fov-hk-stop.svg +0 -37
- egse/icons/fov-hk.svg +0 -1
- egse/icons/front-desk.svg +0 -1
- egse/icons/home-actioned.svg +0 -15
- egse/icons/home-disabled.svg +0 -15
- egse/icons/home.svg +0 -13
- egse/icons/info.svg +0 -1
- egse/icons/invalid.png +0 -0
- egse/icons/led-green.svg +0 -20
- egse/icons/led-grey.svg +0 -20
- egse/icons/led-orange.svg +0 -20
- egse/icons/led-red.svg +0 -20
- egse/icons/led-square-green.svg +0 -134
- egse/icons/led-square-grey.svg +0 -134
- egse/icons/led-square-orange.svg +0 -134
- egse/icons/led-square-red.svg +0 -134
- egse/icons/limit-switch-all-green.svg +0 -115
- egse/icons/limit-switch-all-red.svg +0 -117
- egse/icons/limit-switch-el+.svg +0 -116
- egse/icons/limit-switch-el-.svg +0 -117
- egse/icons/location-marker.svg +0 -1
- egse/icons/logo-dpu.svg +0 -48
- egse/icons/logo-gimbal.svg +0 -112
- egse/icons/logo-huber.svg +0 -23
- egse/icons/logo-ogse.svg +0 -31
- egse/icons/logo-puna.svg +0 -92
- egse/icons/logo-tcs.svg +0 -29
- egse/icons/logo-zonda.svg +0 -66
- egse/icons/maximize.svg +0 -1
- egse/icons/meter.svg +0 -1
- egse/icons/more.svg +0 -45
- egse/icons/n-fee-hk-start.svg +0 -24
- egse/icons/n-fee-hk-stop.svg +0 -25
- egse/icons/n-fee-hk.svg +0 -83
- egse/icons/observing-off.svg +0 -46
- egse/icons/observing-on.svg +0 -46
- egse/icons/open-document-hdf5.png +0 -0
- egse/icons/open-document-hdf5.svg +0 -21
- egse/icons/ops-mode.svg +0 -1
- egse/icons/play-green.svg +0 -17
- egse/icons/plugged-disabled.svg +0 -27
- egse/icons/plugged.svg +0 -21
- egse/icons/pm_ui.svg +0 -1
- egse/icons/power-button-green.svg +0 -27
- egse/icons/power-button-red.svg +0 -27
- egse/icons/power-button.svg +0 -27
- egse/icons/radar.svg +0 -1
- egse/icons/radioactive.svg +0 -2
- egse/icons/reload.svg +0 -1
- egse/icons/remote-control-off.svg +0 -28
- egse/icons/remote-control-on.svg +0 -28
- egse/icons/repeat-blue.svg +0 -15
- egse/icons/repeat.svg +0 -1
- egse/icons/settings.svg +0 -1
- egse/icons/shrink.svg +0 -1
- egse/icons/shutter.svg +0 -1
- egse/icons/sign-off.svg +0 -1
- egse/icons/sign-on.svg +0 -1
- egse/icons/sim-mode.svg +0 -1
- egse/icons/small-buttons-go.svg +0 -20
- egse/icons/small-buttons-minus.svg +0 -51
- egse/icons/small-buttons-plus.svg +0 -51
- egse/icons/sponge.svg +0 -220
- egse/icons/start-button-disabled.svg +0 -84
- egse/icons/start-button.svg +0 -50
- egse/icons/stop-button-disabled.svg +0 -84
- egse/icons/stop-button.svg +0 -50
- egse/icons/stop-red.svg +0 -17
- egse/icons/stop.svg +0 -1
- egse/icons/switch-disabled-square.svg +0 -87
- egse/icons/switch-disabled.svg +0 -15
- egse/icons/switch-off-square.svg +0 -87
- egse/icons/switch-off.svg +0 -72
- egse/icons/switch-on-square.svg +0 -87
- egse/icons/switch-on.svg +0 -61
- egse/icons/temperature-control.svg +0 -44
- egse/icons/th_ui_logo.svg +0 -1
- egse/icons/unplugged.svg +0 -23
- egse/icons/unvalid.png +0 -0
- egse/icons/user-interface.svg +0 -1
- egse/icons/vacuum.svg +0 -1
- egse/icons/valid.png +0 -0
- egse/icons/zoom-to-pixel-dark.svg +0 -64
- egse/icons/zoom-to-pixel-white.svg +0 -36
- egse/images/big-rotation-stage.png +0 -0
- egse/images/connected-100.png +0 -0
- egse/images/cross.svg +0 -6
- egse/images/disconnected-100.png +0 -0
- egse/images/gui-icon.png +0 -0
- egse/images/home.svg +0 -6
- egse/images/info-icon.png +0 -0
- egse/images/led-black.svg +0 -89
- egse/images/led-green.svg +0 -85
- egse/images/led-orange.svg +0 -85
- egse/images/led-red.svg +0 -85
- egse/images/load-icon.png +0 -0
- egse/images/load-setup.png +0 -0
- egse/images/load.png +0 -0
- egse/images/pause.png +0 -0
- egse/images/play-button.svg +0 -8
- egse/images/play.png +0 -0
- egse/images/process-status.png +0 -0
- egse/images/restart.png +0 -0
- egse/images/search.png +0 -0
- egse/images/sma.png +0 -0
- egse/images/start.png +0 -0
- egse/images/stop-button.svg +0 -8
- egse/images/stop.png +0 -0
- egse/images/switch-off.svg +0 -48
- egse/images/switch-on.svg +0 -48
- egse/images/undo.png +0 -0
- egse/images/update-button.svg +0 -11
- egse/imageviewer/exposureselection.py +0 -475
- egse/imageviewer/imageviewer.py +0 -198
- egse/imageviewer/matchfocalplane.py +0 -179
- egse/imageviewer/subfieldposition.py +0 -133
- egse/lampcontrol/__init__.py +0 -4
- egse/lampcontrol/beaglebone/beaglebone.py +0 -178
- egse/lampcontrol/beaglebone/beaglebone.yaml +0 -62
- egse/lampcontrol/beaglebone/beaglebone_cs.py +0 -106
- egse/lampcontrol/beaglebone/beaglebone_devif.py +0 -150
- egse/lampcontrol/beaglebone/beaglebone_protocol.py +0 -73
- egse/lampcontrol/energetiq/__init__.py +0 -22
- egse/lampcontrol/energetiq/eq99.yaml +0 -98
- egse/lampcontrol/energetiq/lampEQ99.py +0 -283
- egse/lampcontrol/energetiq/lampEQ99_cs.py +0 -128
- egse/lampcontrol/energetiq/lampEQ99_devif.py +0 -158
- egse/lampcontrol/energetiq/lampEQ99_encode_decode_errors.py +0 -73
- egse/lampcontrol/energetiq/lampEQ99_protocol.py +0 -71
- egse/lampcontrol/energetiq/lampEQ99_ui.py +0 -465
- egse/lib/CentOS-7/EtherSpaceLink_v34_86.dylib +0 -0
- egse/lib/CentOS-8/ESL-RMAP_v34_86.dylib +0 -0
- egse/lib/CentOS-8/EtherSpaceLink_v34_86.dylib +0 -0
- egse/lib/Debian/ESL-RMAP_v34_86.dylib +0 -0
- egse/lib/Debian/EtherSpaceLink_v34_86.dylib +0 -0
- egse/lib/Debian/libetherspacelink_v35_21.dylib +0 -0
- egse/lib/Linux/ESL-RMAP_v34_86.dylib +0 -0
- egse/lib/Linux/EtherSpaceLink_v34_86.dylib +0 -0
- egse/lib/Ubuntu-20/ESL-RMAP_v34_86.dylib +0 -0
- egse/lib/Ubuntu-20/EtherSpaceLink_v34_86.dylib +0 -0
- egse/lib/gssw/python3-gssw_2.2.3+31f63c9f-1_all.deb +0 -0
- egse/lib/ximc/__pycache__/pyximc.cpython-38 2.pyc +0 -0
- egse/lib/ximc/__pycache__/pyximc.cpython-38.pyc +0 -0
- egse/lib/ximc/libximc.framework/Frameworks/libbindy.dylib +0 -0
- egse/lib/ximc/libximc.framework/Frameworks/libxiwrapper.dylib +0 -0
- egse/lib/ximc/libximc.framework/Headers/ximc.h +0 -5510
- egse/lib/ximc/libximc.framework/Resources/Info.plist +0 -42
- egse/lib/ximc/libximc.framework/Resources/keyfile.sqlite +0 -0
- egse/lib/ximc/libximc.framework/libbindy.so +0 -0
- egse/lib/ximc/libximc.framework/libximc +0 -0
- egse/lib/ximc/libximc.framework/libximc.so +0 -0
- egse/lib/ximc/libximc.framework/libximc.so.7.0.0 +0 -0
- egse/lib/ximc/libximc.framework/libxiwrapper.so +0 -0
- egse/lib/ximc/pyximc.py +0 -922
- egse/listener.py +0 -179
- egse/logger/__init__.py +0 -243
- egse/logger/log_cs.py +0 -321
- egse/metrics.py +0 -102
- egse/mixin.py +0 -464
- egse/monitoring.py +0 -95
- egse/ni/alarms/__init__.py +0 -26
- egse/ni/alarms/cdaq9375.py +0 -300
- egse/ni/alarms/cdaq9375.yaml +0 -89
- egse/ni/alarms/cdaq9375_cs.py +0 -130
- egse/ni/alarms/cdaq9375_devif.py +0 -183
- egse/ni/alarms/cdaq9375_protocol.py +0 -48
- egse/obs_inspection.py +0 -165
- egse/observer.py +0 -41
- egse/obsid.py +0 -163
- egse/powermeter/__init__.py +0 -0
- egse/powermeter/ni/__init__.py +0 -38
- egse/powermeter/ni/cdaq9184.py +0 -224
- egse/powermeter/ni/cdaq9184.yaml +0 -73
- egse/powermeter/ni/cdaq9184_cs.py +0 -130
- egse/powermeter/ni/cdaq9184_devif.py +0 -201
- egse/powermeter/ni/cdaq9184_protocol.py +0 -48
- egse/powermeter/ni/cdaq9184_ui.py +0 -544
- egse/powermeter/thorlabs/__init__.py +0 -25
- egse/powermeter/thorlabs/pm100a.py +0 -380
- egse/powermeter/thorlabs/pm100a.yaml +0 -132
- egse/powermeter/thorlabs/pm100a_cs.py +0 -136
- egse/powermeter/thorlabs/pm100a_devif.py +0 -127
- egse/powermeter/thorlabs/pm100a_protocol.py +0 -80
- egse/powermeter/thorlabs/pm100a_ui.py +0 -725
- egse/process.py +0 -451
- egse/procman/__init__.py +0 -834
- egse/procman/cannot_start_process_popup.py +0 -43
- egse/procman/procman.yaml +0 -49
- egse/procman/procman_cs.py +0 -201
- egse/procman/procman_ui.py +0 -2081
- egse/protocol.py +0 -605
- egse/proxy.py +0 -531
- egse/randomwalk.py +0 -140
- egse/reg.py +0 -585
- egse/reload.py +0 -122
- egse/reprocess.py +0 -693
- egse/resource.py +0 -333
- egse/rmap.py +0 -406
- egse/rst.py +0 -135
- egse/search.py +0 -182
- egse/serialdevice.py +0 -190
- egse/services.py +0 -247
- egse/services.yaml +0 -68
- egse/settings.py +0 -379
- egse/settings.yaml +0 -980
- egse/setup.py +0 -1181
- egse/shutter/__init__.py +0 -0
- egse/shutter/thorlabs/__init__.py +0 -19
- egse/shutter/thorlabs/ksc101.py +0 -205
- egse/shutter/thorlabs/ksc101.yaml +0 -105
- egse/shutter/thorlabs/ksc101_cs.py +0 -136
- egse/shutter/thorlabs/ksc101_devif.py +0 -201
- egse/shutter/thorlabs/ksc101_protocol.py +0 -71
- egse/shutter/thorlabs/ksc101_ui.py +0 -548
- egse/shutter/thorlabs/sc10.py +0 -82
- egse/shutter/thorlabs/sc10.yaml +0 -52
- egse/shutter/thorlabs/sc10_controller.py +0 -81
- egse/shutter/thorlabs/sc10_cs.py +0 -108
- egse/shutter/thorlabs/sc10_interface.py +0 -25
- egse/shutter/thorlabs/sc10_simulator.py +0 -30
- egse/simulator.py +0 -41
- egse/slack.py +0 -61
- egse/socketdevice.py +0 -218
- egse/sockets.py +0 -218
- egse/spw.py +0 -1401
- egse/stages/__init__.py +0 -12
- egse/stages/aerotech/ensemble.py +0 -245
- egse/stages/aerotech/ensemble.yaml +0 -205
- egse/stages/aerotech/ensemble_controller.py +0 -275
- egse/stages/aerotech/ensemble_cs.py +0 -110
- egse/stages/aerotech/ensemble_interface.py +0 -132
- egse/stages/aerotech/ensemble_parameters.py +0 -433
- egse/stages/aerotech/ensemble_simulator.py +0 -27
- egse/stages/aerotech/mgse_sim.py +0 -188
- egse/stages/arun/smd3.py +0 -110
- egse/stages/arun/smd3.yaml +0 -68
- egse/stages/arun/smd3_controller.py +0 -470
- egse/stages/arun/smd3_cs.py +0 -112
- egse/stages/arun/smd3_interface.py +0 -53
- egse/stages/arun/smd3_simulator.py +0 -27
- egse/stages/arun/smd3_stop.py +0 -16
- egse/stages/huber/__init__.py +0 -49
- egse/stages/huber/smc9300.py +0 -920
- egse/stages/huber/smc9300.yaml +0 -63
- egse/stages/huber/smc9300_cs.py +0 -178
- egse/stages/huber/smc9300_devif.py +0 -345
- egse/stages/huber/smc9300_protocol.py +0 -113
- egse/stages/huber/smc9300_sim.py +0 -547
- egse/stages/huber/smc9300_ui.py +0 -973
- egse/state.py +0 -173
- egse/statemachine.py +0 -274
- egse/storage/__init__.py +0 -1067
- egse/storage/persistence.py +0 -2295
- egse/storage/storage.yaml +0 -79
- egse/storage/storage_cs.py +0 -231
- egse/styles/dark.qss +0 -343
- egse/styles/default.qss +0 -48
- egse/synoptics/__init__.py +0 -417
- egse/synoptics/syn.yaml +0 -9
- egse/synoptics/syn_cs.py +0 -195
- egse/system.py +0 -1611
- egse/tcs/__init__.py +0 -14
- egse/tcs/tcs.py +0 -879
- egse/tcs/tcs.yaml +0 -14
- egse/tcs/tcs_cs.py +0 -202
- egse/tcs/tcs_devif.py +0 -292
- egse/tcs/tcs_protocol.py +0 -180
- egse/tcs/tcs_sim.py +0 -177
- egse/tcs/tcs_ui.py +0 -543
- egse/tdms.py +0 -171
- egse/tempcontrol/__init__.py +0 -23
- egse/tempcontrol/agilent/agilent34970.py +0 -109
- egse/tempcontrol/agilent/agilent34970.yaml +0 -44
- egse/tempcontrol/agilent/agilent34970_cs.py +0 -114
- egse/tempcontrol/agilent/agilent34970_devif.py +0 -182
- egse/tempcontrol/agilent/agilent34970_protocol.py +0 -96
- egse/tempcontrol/agilent/agilent34972.py +0 -111
- egse/tempcontrol/agilent/agilent34972.yaml +0 -44
- egse/tempcontrol/agilent/agilent34972_cs.py +0 -115
- egse/tempcontrol/agilent/agilent34972_devif.py +0 -189
- egse/tempcontrol/agilent/agilent34972_protocol.py +0 -98
- egse/tempcontrol/beaglebone/beaglebone.py +0 -341
- egse/tempcontrol/beaglebone/beaglebone.yaml +0 -110
- egse/tempcontrol/beaglebone/beaglebone_cs.py +0 -117
- egse/tempcontrol/beaglebone/beaglebone_protocol.py +0 -134
- egse/tempcontrol/beaglebone/beaglebone_ui.py +0 -674
- egse/tempcontrol/digalox/digalox.py +0 -115
- egse/tempcontrol/digalox/digalox.yaml +0 -36
- egse/tempcontrol/digalox/digalox_cs.py +0 -108
- egse/tempcontrol/digalox/digalox_protocol.py +0 -56
- egse/tempcontrol/keithley/__init__.py +0 -33
- egse/tempcontrol/keithley/daq6510.py +0 -662
- egse/tempcontrol/keithley/daq6510.yaml +0 -105
- egse/tempcontrol/keithley/daq6510_cs.py +0 -163
- egse/tempcontrol/keithley/daq6510_devif.py +0 -343
- egse/tempcontrol/keithley/daq6510_protocol.py +0 -79
- egse/tempcontrol/keithley/daq6510_sim.py +0 -186
- egse/tempcontrol/lakeshore/__init__.py +0 -33
- egse/tempcontrol/lakeshore/lsci.py +0 -361
- egse/tempcontrol/lakeshore/lsci.yaml +0 -162
- egse/tempcontrol/lakeshore/lsci_cs.py +0 -174
- egse/tempcontrol/lakeshore/lsci_devif.py +0 -292
- egse/tempcontrol/lakeshore/lsci_protocol.py +0 -76
- egse/tempcontrol/lakeshore/lsci_ui.py +0 -387
- egse/tempcontrol/ni/__init__.py +0 -0
- egse/tempcontrol/spid/spid.py +0 -109
- egse/tempcontrol/spid/spid.yaml +0 -81
- egse/tempcontrol/spid/spid_controller.py +0 -279
- egse/tempcontrol/spid/spid_cs.py +0 -136
- egse/tempcontrol/spid/spid_protocol.py +0 -107
- egse/tempcontrol/spid/spid_ui.py +0 -723
- egse/tempcontrol/srs/__init__.py +0 -22
- egse/tempcontrol/srs/ptc10.py +0 -867
- egse/tempcontrol/srs/ptc10.yaml +0 -227
- egse/tempcontrol/srs/ptc10_cs.py +0 -128
- egse/tempcontrol/srs/ptc10_devif.py +0 -116
- egse/tempcontrol/srs/ptc10_protocol.py +0 -39
- egse/tempcontrol/srs/ptc10_ui.py +0 -906
- egse/ups/apc/apc.py +0 -236
- egse/ups/apc/apc.yaml +0 -45
- egse/ups/apc/apc_cs.py +0 -101
- egse/ups/apc/apc_protocol.py +0 -125
- egse/user.yaml +0 -7
- egse/vacuum/beaglebone/beaglebone.py +0 -149
- egse/vacuum/beaglebone/beaglebone.yaml +0 -44
- egse/vacuum/beaglebone/beaglebone_cs.py +0 -108
- egse/vacuum/beaglebone/beaglebone_devif.py +0 -159
- egse/vacuum/beaglebone/beaglebone_protocol.py +0 -192
- egse/vacuum/beaglebone/beaglebone_ui.py +0 -638
- egse/vacuum/instrutech/igm402.py +0 -91
- egse/vacuum/instrutech/igm402.yaml +0 -90
- egse/vacuum/instrutech/igm402_controller.py +0 -124
- egse/vacuum/instrutech/igm402_cs.py +0 -108
- egse/vacuum/instrutech/igm402_interface.py +0 -49
- egse/vacuum/instrutech/igm402_simulator.py +0 -36
- egse/vacuum/keller/kellerBus.py +0 -256
- egse/vacuum/keller/leo3.py +0 -100
- egse/vacuum/keller/leo3.yaml +0 -38
- egse/vacuum/keller/leo3_controller.py +0 -81
- egse/vacuum/keller/leo3_cs.py +0 -101
- egse/vacuum/keller/leo3_interface.py +0 -33
- egse/vacuum/mks/evision.py +0 -86
- egse/vacuum/mks/evision.yaml +0 -75
- egse/vacuum/mks/evision_cs.py +0 -101
- egse/vacuum/mks/evision_devif.py +0 -313
- egse/vacuum/mks/evision_interface.py +0 -60
- egse/vacuum/mks/evision_simulator.py +0 -24
- egse/vacuum/mks/evision_ui.py +0 -701
- egse/vacuum/pfeiffer/acp40.py +0 -87
- egse/vacuum/pfeiffer/acp40.yaml +0 -60
- egse/vacuum/pfeiffer/acp40_controller.py +0 -117
- egse/vacuum/pfeiffer/acp40_cs.py +0 -109
- egse/vacuum/pfeiffer/acp40_interface.py +0 -40
- egse/vacuum/pfeiffer/acp40_simulator.py +0 -37
- egse/vacuum/pfeiffer/tc400.py +0 -87
- egse/vacuum/pfeiffer/tc400.yaml +0 -83
- egse/vacuum/pfeiffer/tc400_controller.py +0 -136
- egse/vacuum/pfeiffer/tc400_cs.py +0 -109
- egse/vacuum/pfeiffer/tc400_interface.py +0 -70
- egse/vacuum/pfeiffer/tc400_simulator.py +0 -35
- egse/vacuum/pfeiffer/tpg261.py +0 -80
- egse/vacuum/pfeiffer/tpg261.yaml +0 -66
- egse/vacuum/pfeiffer/tpg261_controller.py +0 -150
- egse/vacuum/pfeiffer/tpg261_cs.py +0 -109
- egse/vacuum/pfeiffer/tpg261_interface.py +0 -59
- egse/vacuum/pfeiffer/tpg261_simulator.py +0 -23
- egse/version.py +0 -174
- egse/visitedpositions.py +0 -398
- egse/windowing.py +0 -213
- egse/zmq/__init__.py +0 -28
- egse/zmq/spw.py +0 -160
- egse/zmq_ser.py +0 -41
- scripts/alerts/cold.yaml +0 -278
- scripts/alerts/example_alerts.yaml +0 -54
- scripts/alerts/transition.yaml +0 -14
- scripts/alerts/warm.yaml +0 -49
- scripts/analyse_n_fee_hk_data.py +0 -52
- scripts/check_hdf5_files.py +0 -192
- scripts/check_register_sync.py +0 -47
- scripts/check_tcs_calib_coef.py +0 -90
- scripts/correct_ccd_cold_temperature_cal.py +0 -157
- scripts/create_hdf5_report.py +0 -293
- scripts/csl_model.py +0 -420
- scripts/csl_restore_setup.py +0 -229
- scripts/export-grafana-dashboards.py +0 -49
- scripts/fdir/cs_recovery/fdir_cs_recovery.py +0 -54
- scripts/fdir/fdir_table.yaml +0 -70
- scripts/fdir/fdir_test_recovery.py +0 -10
- scripts/fdir/hw_recovery/fdir_agilent_hw_recovery.py +0 -73
- scripts/fdir/limit_recovery/fdir_agilent_limit.py +0 -61
- scripts/fdir/limit_recovery/fdir_bb_heater_limit.py +0 -59
- scripts/fdir/limit_recovery/fdir_ensemble_limit.py +0 -33
- scripts/fdir/limit_recovery/fdir_pressure_limit_recovery.py +0 -71
- scripts/fix_csv.py +0 -80
- scripts/ias/correct_ccd_temp_cal_elfique.py +0 -43
- scripts/ias/correct_ccd_temp_cal_floreffe.py +0 -43
- scripts/ias/correct_trp_swap_achel.py +0 -199
- scripts/inta/correct_ccd_temp_cal_duvel.py +0 -43
- scripts/inta/correct_ccd_temp_cal_gueuze.py +0 -43
- scripts/n_fee_supply_voltage_calculation.py +0 -92
- scripts/playground.py +0 -30
- scripts/print_hdf5_hk_data.py +0 -68
- scripts/print_register_map.py +0 -43
- scripts/remove_lines_between_matches.py +0 -188
- scripts/sron/commanding/control_heaters.py +0 -44
- scripts/sron/commanding/pumpdown.py +0 -46
- scripts/sron/commanding/set_pid_setpoint.py +0 -19
- scripts/sron/commanding/shutdown_bbb_heaters.py +0 -10
- scripts/sron/commanding/shutdown_pumps.py +0 -33
- scripts/sron/correct_mgse_coordinates_brigand_chimay.py +0 -272
- scripts/sron/correct_trp_swap_brigand.py +0 -204
- scripts/sron/gimbal_conversions.py +0 -75
- scripts/sron/tm_gen/tm_gen_agilent.py +0 -37
- scripts/sron/tm_gen/tm_gen_heaters.py +0 -4
- scripts/sron/tm_gen/tm_gen_spid.py +0 -13
- scripts/update_operational_cgse.py +0 -268
- scripts/update_operational_cgse_old.py +0 -273
egse/collimator/fcul/ogse.py
DELETED
|
@@ -1,1077 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
This module defines the device classes to be used to connect to and control the OGSE.
|
|
3
|
-
"""
|
|
4
|
-
from __future__ import annotations
|
|
5
|
-
import logging
|
|
6
|
-
import math
|
|
7
|
-
import random
|
|
8
|
-
import re
|
|
9
|
-
import time
|
|
10
|
-
from enum import Enum
|
|
11
|
-
from typing import Union
|
|
12
|
-
|
|
13
|
-
import numpy as np
|
|
14
|
-
|
|
15
|
-
from egse.collimator.fcul.ogse_devif import OGSEEthernetInterface
|
|
16
|
-
from egse.command import ClientServerCommand
|
|
17
|
-
from egse.command import CommandError
|
|
18
|
-
from egse.control import Failure
|
|
19
|
-
from egse.control import is_control_server_active
|
|
20
|
-
from egse.device import DeviceConnectionState
|
|
21
|
-
from egse.device import DeviceInterface
|
|
22
|
-
from egse.mixin import DynamicCommandMixin
|
|
23
|
-
from egse.mixin import add_lf
|
|
24
|
-
from egse.mixin import dynamic_command
|
|
25
|
-
from egse.proxy import DynamicProxy
|
|
26
|
-
from egse.settings import Settings
|
|
27
|
-
from egse.system import format_datetime
|
|
28
|
-
from egse.zmq_ser import connect_address
|
|
29
|
-
|
|
30
|
-
logger = logging.getLogger(__name__)
|
|
31
|
-
|
|
32
|
-
OGSE_SETTINGS = Settings.load("OGSE Controller")
|
|
33
|
-
CTRL_SETTINGS = Settings.load("OGSE Control Server")
|
|
34
|
-
DEVICE_SETTINGS = Settings.load(filename="ogse.yaml")
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
def is_ogse_cs_active(timeout: float = 2.0):
|
|
38
|
-
"""
|
|
39
|
-
Checks whether the OGSE Control Server is running.
|
|
40
|
-
|
|
41
|
-
Args:
|
|
42
|
-
timeout (float): Timeout when waiting for a reply [seconds, default=2.0]
|
|
43
|
-
|
|
44
|
-
Returns:
|
|
45
|
-
True if the OGSE CS is running and replied with the expected answer.
|
|
46
|
-
"""
|
|
47
|
-
|
|
48
|
-
endpoint = connect_address(
|
|
49
|
-
CTRL_SETTINGS.PROTOCOL, CTRL_SETTINGS.HOSTNAME, CTRL_SETTINGS.COMMANDING_PORT
|
|
50
|
-
)
|
|
51
|
-
|
|
52
|
-
return is_control_server_active(endpoint, timeout)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
def decode_response(response: bytes) -> str:
|
|
56
|
-
"""Decodes the bytes object and strips off the newline."""
|
|
57
|
-
return response.decode().rstrip()
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
def _convert_to_float(value: str) -> float:
|
|
61
|
-
try:
|
|
62
|
-
return float(value)
|
|
63
|
-
except ValueError:
|
|
64
|
-
return math.nan
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
def check_cmd_att_index(cmd_string: str):
|
|
68
|
-
"""Check if the 'level #<index>' command has a correct index."""
|
|
69
|
-
|
|
70
|
-
# index is expected to be in the range [0-46] (inclusive)
|
|
71
|
-
|
|
72
|
-
index = int(cmd_string.split()[-1][1:])
|
|
73
|
-
|
|
74
|
-
if not (0 <= index <= 46):
|
|
75
|
-
raise CommandError("ERROR: usage: attenuator level #index -- index goes from 0 to 46")
|
|
76
|
-
|
|
77
|
-
return add_lf(cmd_string)
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
def decode_pm_status_response(response: bytes):
|
|
81
|
-
""" Decode the response from the OGSE 'pm status' command.
|
|
82
|
-
|
|
83
|
-
The command will return a bytes object of the following format:
|
|
84
|
-
|
|
85
|
-
b'pm1: OK, pm2: OK\n''
|
|
86
|
-
|
|
87
|
-
After processing, the function returns a dictionary with the following tpw entries:
|
|
88
|
-
|
|
89
|
-
* "pm1": power status of channel 1
|
|
90
|
-
* "pm2": power status of channel 2
|
|
91
|
-
|
|
92
|
-
Args:
|
|
93
|
-
response: the unprocessed response from the device.
|
|
94
|
-
|
|
95
|
-
Returns:
|
|
96
|
-
A dictionary containing the power status of channel 1 and 2. If the response can not
|
|
97
|
-
be processed, a Failure object will be returned.
|
|
98
|
-
"""
|
|
99
|
-
|
|
100
|
-
if not isinstance(response, bytes):
|
|
101
|
-
|
|
102
|
-
return Failure(f"The given argument is not a bytes object as expected: {response=}")
|
|
103
|
-
|
|
104
|
-
response = response.decode().rstrip()
|
|
105
|
-
|
|
106
|
-
try:
|
|
107
|
-
_, pm1, _, pm2 = re.split(', |: ', response)
|
|
108
|
-
|
|
109
|
-
except ValueError as exc:
|
|
110
|
-
|
|
111
|
-
logger.error(f"ValueError caught: {exc}")
|
|
112
|
-
return Failure(f"Unexpected response from the OGSE read command: {response=}", exc)
|
|
113
|
-
|
|
114
|
-
return {
|
|
115
|
-
"pm1": pm1,
|
|
116
|
-
"pm2": pm2
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
def decode_read_command(response: bytes) -> dict | Failure:
|
|
121
|
-
"""
|
|
122
|
-
Decode the response from the OGSE 'read' command.
|
|
123
|
-
|
|
124
|
-
The command will return a bytes object of the following format:
|
|
125
|
-
|
|
126
|
-
b'pm1: -2.323670e-14 W +21.6 \xc2\xbaC, pm2: +2.143803e-07 W +22.7 \xc2\xbaC\n'
|
|
127
|
-
|
|
128
|
-
After processing, the function returns a dictionary with the following four entries:
|
|
129
|
-
|
|
130
|
-
* "power1": power measure for power meter 1 in Watt
|
|
131
|
-
* "temp1": temperature of the power meter 1 in degrees Celsius
|
|
132
|
-
* "power2": power measure for power meter 2 in Watt
|
|
133
|
-
* "temp2": temperature of the power meter 2 in degrees Celsius
|
|
134
|
-
|
|
135
|
-
Args:
|
|
136
|
-
response: the unprocessed response from the device.
|
|
137
|
-
|
|
138
|
-
Returns:
|
|
139
|
-
A dictionary containing the power and temperature values as floats. If the response can not
|
|
140
|
-
be processed, a Failure object will be returned.
|
|
141
|
-
"""
|
|
142
|
-
|
|
143
|
-
# This function cannot raise exceptions, but should return a proper Failure method.
|
|
144
|
-
# The reason for this is that the result of this function will be returned to the Proxy object
|
|
145
|
-
# that issued the command.
|
|
146
|
-
|
|
147
|
-
if not isinstance(response, bytes):
|
|
148
|
-
|
|
149
|
-
return Failure(f"The given argument is not a bytes object as expected: {response=}")
|
|
150
|
-
|
|
151
|
-
response = response.decode().rstrip()
|
|
152
|
-
|
|
153
|
-
try:
|
|
154
|
-
_, power1, _, temp1, _, _, power2, _, temp2, _ = response.split()
|
|
155
|
-
except ValueError as exc:
|
|
156
|
-
logger.error(f"ValueError caught: {exc}")
|
|
157
|
-
return Failure(f"Unexpected response from the OGSE read command: {response=}", exc)
|
|
158
|
-
|
|
159
|
-
power1 = _convert_to_float(power1)
|
|
160
|
-
temp1 = _convert_to_float(temp1)
|
|
161
|
-
power2 = _convert_to_float(power2)
|
|
162
|
-
temp2 = _convert_to_float(temp2)
|
|
163
|
-
|
|
164
|
-
return {
|
|
165
|
-
"power1": power1,
|
|
166
|
-
"temp1": temp1,
|
|
167
|
-
"power2": power2,
|
|
168
|
-
"temp2": temp2
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
def decode_status_command(response: bytes) -> dict | Failure:
|
|
173
|
-
"""
|
|
174
|
-
Decode the response from the OGSE 'status' command.
|
|
175
|
-
|
|
176
|
-
The command will return a bytes object of the following format:
|
|
177
|
-
|
|
178
|
-
b'power: OFF, lamp: OFF, interlock: OFF, psu: OFF, att: 0E-9 #0, power-ch1: +3.185751e-11 W,
|
|
179
|
-
power-ch2: +2.068336e-07 W, temp-ch1: +21.5 \xc2\xbaC, temp-ch2: +22.6 \xc2\xbaC\n'
|
|
180
|
-
|
|
181
|
-
In the case the attenuator is still moving, an asterisk '*' will appear after 'att:' as in:
|
|
182
|
-
|
|
183
|
-
b'power: OFF, lamp: OFF, interlock: OFF, psu: OFF, att: * 280E-3 #39,
|
|
184
|
-
power-ch1: -6.378473e-11 W, power-ch2: +2.190483e-07 W,
|
|
185
|
-
temp-ch1: +21.5 \xc2\xbaC, temp-ch2: +22.6 \xc2\xbaC\n'
|
|
186
|
-
|
|
187
|
-
After processing, the function returns a dictionary with the following eleven (11) values:
|
|
188
|
-
|
|
189
|
-
* 'power': The status of the power
|
|
190
|
-
* 'lamp': The status of the lamp
|
|
191
|
-
* 'interlock': The status of the interlock
|
|
192
|
-
* 'psu': The status of the PSU
|
|
193
|
-
* 'att_moving':The status of the attenuator: True=Moving, False=Not Moving
|
|
194
|
-
* 'att_factor': The attenuation factor as a float
|
|
195
|
-
* 'att_index': The attenuation index as an int
|
|
196
|
-
* 'power1': The power measure for power meter 1 in Watt
|
|
197
|
-
* 'temp1': The temperature of the power meter 1 in degrees Celsius
|
|
198
|
-
* 'power2': The power measure for power meter 2 in Watt
|
|
199
|
-
* 'temp2': The temperature of the power meter 2 in degrees Celsius
|
|
200
|
-
|
|
201
|
-
Args:
|
|
202
|
-
response: the unprocessed response from the device.
|
|
203
|
-
|
|
204
|
-
Returns:
|
|
205
|
-
A dictionary containing the status and measures of most important parameters (see above).
|
|
206
|
-
If the response can not be processed, a Failure object will be returned.
|
|
207
|
-
|
|
208
|
-
"""
|
|
209
|
-
|
|
210
|
-
# This function cannot raise exceptions, but should return a proper Failure method.
|
|
211
|
-
# The reason for this is that the result of this function will be returned to the Proxy object
|
|
212
|
-
# that issued the command.
|
|
213
|
-
|
|
214
|
-
if not isinstance(response, bytes):
|
|
215
|
-
return Failure(f"The given argument is not a bytes object as expected: {response=}")
|
|
216
|
-
|
|
217
|
-
response = response.decode().rstrip()
|
|
218
|
-
|
|
219
|
-
try:
|
|
220
|
-
if '*' in response:
|
|
221
|
-
(_, power_status, _, lamp_status, _, interlock_status, _, psu_status,
|
|
222
|
-
_, att_moving, att_factor, att_index, _, power1, _, _, power2, _,
|
|
223
|
-
_, temp1, _, _, temp2, _) = response.split()
|
|
224
|
-
att_moving = True
|
|
225
|
-
else:
|
|
226
|
-
(_, power_status, _, lamp_status, _, interlock_status, _, psu_status,
|
|
227
|
-
_, att_factor, att_index, _, power1, _, _, power2, _,
|
|
228
|
-
_, temp1, _, _, temp2, _) = response.split()
|
|
229
|
-
att_moving = False
|
|
230
|
-
except ValueError as exc:
|
|
231
|
-
logger.error(f"ValueError caught: {exc}")
|
|
232
|
-
return Failure(f"Unexpected response from the OGSE status command: {response=}", exc)
|
|
233
|
-
|
|
234
|
-
# cut off the trailing comma
|
|
235
|
-
|
|
236
|
-
power_status, lamp_status, interlock_status, psu_status = [
|
|
237
|
-
x[:-1] for x in (power_status, lamp_status, interlock_status, psu_status)]
|
|
238
|
-
|
|
239
|
-
att_factor = _convert_to_float(att_factor)
|
|
240
|
-
att_index = int(att_index[1:-1]) # cut off the leading '#' and the trailing ','
|
|
241
|
-
power1 = _convert_to_float(power1)
|
|
242
|
-
temp1 = _convert_to_float(temp1)
|
|
243
|
-
power2 = _convert_to_float(power2)
|
|
244
|
-
temp2 = _convert_to_float(temp2)
|
|
245
|
-
|
|
246
|
-
return {
|
|
247
|
-
"power": power_status,
|
|
248
|
-
"lamp": lamp_status,
|
|
249
|
-
"interlock": interlock_status,
|
|
250
|
-
"psu": psu_status,
|
|
251
|
-
"att_moving": att_moving,
|
|
252
|
-
"att_factor": att_factor,
|
|
253
|
-
"att_index": att_index,
|
|
254
|
-
"power1": power1,
|
|
255
|
-
"temp1": temp1,
|
|
256
|
-
"power2": power2,
|
|
257
|
-
"temp2": temp2
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
def decode_att_get_level_command(response: bytes) -> dict | Failure:
|
|
262
|
-
"""
|
|
263
|
-
Decode the response from the OGSE 'level' command.
|
|
264
|
-
|
|
265
|
-
The command will return a bytes object of the following format:
|
|
266
|
-
|
|
267
|
-
b'att-level: 1E+0 #46\n'
|
|
268
|
-
b'att-level: * 1E+0 #46\n'
|
|
269
|
-
|
|
270
|
-
After processing, the function returns a tuple with the following eleven (11) values:
|
|
271
|
-
|
|
272
|
-
* The status of the attenuator: True=Moving, False=Not Moving
|
|
273
|
-
* The attenuation factor as a float
|
|
274
|
-
* The attenuation index as an int
|
|
275
|
-
|
|
276
|
-
Args:
|
|
277
|
-
response: the unprocessed response from the device.
|
|
278
|
-
|
|
279
|
-
Returns:
|
|
280
|
-
A dictionary containing the moving status of the attenuator, the level (factor)
|
|
281
|
-
and the index. If the response can not be processed, a Failure object will be returned.
|
|
282
|
-
|
|
283
|
-
"""
|
|
284
|
-
|
|
285
|
-
# This function cannot raise exceptions, but should return a proper Failure method.
|
|
286
|
-
# The reason for this is that the result of this function will be returned to the Proxy object
|
|
287
|
-
# that issued the command.
|
|
288
|
-
|
|
289
|
-
if not isinstance(response, bytes):
|
|
290
|
-
return Failure(f"The given argument is not a bytes object as expected: {response=}")
|
|
291
|
-
|
|
292
|
-
response = response.decode().rstrip()
|
|
293
|
-
|
|
294
|
-
try:
|
|
295
|
-
if '*' in response:
|
|
296
|
-
_, att_moving, att_factor, att_index = response.split()
|
|
297
|
-
att_moving = True
|
|
298
|
-
else:
|
|
299
|
-
_, att_factor, att_index = response.split()
|
|
300
|
-
att_moving = False
|
|
301
|
-
except ValueError as exc:
|
|
302
|
-
logger.error(f"ValueError caught: {exc}")
|
|
303
|
-
return Failure(f"Unexpected response from the OGSE level command: {response=}", exc)
|
|
304
|
-
|
|
305
|
-
try:
|
|
306
|
-
att_factor = _convert_to_float(att_factor)
|
|
307
|
-
att_index = int(att_index[1:]) # cut off the leading '#'
|
|
308
|
-
except Exception as exc:
|
|
309
|
-
logger.error(f"Exception caught: {exc=}")
|
|
310
|
-
return Failure(f"Exception caught when converting values from "
|
|
311
|
-
f"the OGSE level command: {response=}", exc)
|
|
312
|
-
|
|
313
|
-
return {
|
|
314
|
-
"att_moving": att_moving,
|
|
315
|
-
"att_factor": att_factor,
|
|
316
|
-
"att_index": att_index
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
class OnOffSwitch(str, Enum):
|
|
321
|
-
on = "on"
|
|
322
|
-
off = "off"
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
class OGSECommand(ClientServerCommand):
|
|
326
|
-
def get_cmd_string(self, *args, **kwargs) -> str:
|
|
327
|
-
out = super().get_cmd_string(*args, **kwargs)
|
|
328
|
-
return out + "\n"
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
class OGSEInterface(DeviceInterface):
|
|
332
|
-
"""
|
|
333
|
-
Interface definition for the Controller, Simulator and Proxy classes for this device.
|
|
334
|
-
"""
|
|
335
|
-
|
|
336
|
-
@dynamic_command(cmd_type="query", cmd_string="version", process_cmd_string=add_lf,
|
|
337
|
-
process_response=decode_response)
|
|
338
|
-
def version(self) -> str:
|
|
339
|
-
"""Returns version information about the OGSE hardware controller."""
|
|
340
|
-
raise NotImplementedError
|
|
341
|
-
|
|
342
|
-
@dynamic_command(cmd_type="query", cmd_string="quit", process_cmd_string=add_lf,
|
|
343
|
-
process_response=decode_response)
|
|
344
|
-
def quit(self):
|
|
345
|
-
"""Disconnects client from the server."""
|
|
346
|
-
raise NotImplementedError
|
|
347
|
-
|
|
348
|
-
@dynamic_command(cmd_type="query", cmd_string="exit", process_cmd_string=add_lf,
|
|
349
|
-
process_response=decode_response)
|
|
350
|
-
def exit(self):
|
|
351
|
-
"""Disconnects client from the server."""
|
|
352
|
-
raise NotImplementedError
|
|
353
|
-
|
|
354
|
-
@dynamic_command(cmd_type="query", cmd_string="ldls status", process_cmd_string=add_lf,
|
|
355
|
-
process_response=decode_response)
|
|
356
|
-
def ldls_status(self) -> str:
|
|
357
|
-
"""
|
|
358
|
-
Returns the state of the connection to the LDLS device. The returned value is 'OK'
|
|
359
|
-
when the LDLS device is initialised and ready, 'ERROR' when the device failed to
|
|
360
|
-
initialise.
|
|
361
|
-
|
|
362
|
-
Returns:
|
|
363
|
-
'ldls: OK' or 'ldls: ERROR'
|
|
364
|
-
"""
|
|
365
|
-
raise NotImplementedError
|
|
366
|
-
|
|
367
|
-
@dynamic_command(cmd_type="query", cmd_string="pm status", process_cmd_string=add_lf,
|
|
368
|
-
process_response=decode_pm_status_response)
|
|
369
|
-
def pm_status(self) -> dict:
|
|
370
|
-
"""
|
|
371
|
-
Returns the state of the connection to the power-meter devices. The returned value is 'OK'
|
|
372
|
-
when the power-meter device is initialised and ready, 'ERROR' when the device failed to
|
|
373
|
-
initialise.
|
|
374
|
-
|
|
375
|
-
Returns:
|
|
376
|
-
A dictionary with keys: 'pm1', 'pm2' and values 'OK' or 'ERROR'.
|
|
377
|
-
"""
|
|
378
|
-
raise NotImplementedError
|
|
379
|
-
|
|
380
|
-
@dynamic_command(cmd_type="query", cmd_string="att status", process_cmd_string=add_lf,
|
|
381
|
-
process_response=decode_response)
|
|
382
|
-
def att_status(self) -> str:
|
|
383
|
-
"""
|
|
384
|
-
Returns the state of the connection to attenuator device. The returned value contains 'OK'
|
|
385
|
-
when the attenuator device is initialised and ready, 'ERROR' when the device failed to
|
|
386
|
-
initialise.
|
|
387
|
-
|
|
388
|
-
Returns:
|
|
389
|
-
A string containing 'OK' or 'ERROR', i.e. 'att: OK' or 'att: ERROR'.
|
|
390
|
-
"""
|
|
391
|
-
raise NotImplementedError
|
|
392
|
-
|
|
393
|
-
@dynamic_command(cmd_type="query", cmd_string="get interlock", process_cmd_string=add_lf,
|
|
394
|
-
process_response=decode_response)
|
|
395
|
-
def get_interlock(self) -> str:
|
|
396
|
-
"""Get the state of the interlock.
|
|
397
|
-
|
|
398
|
-
Returns:
|
|
399
|
-
A string containg 'OPEN' or 'CLOSE', i.e. 'interlock: OPEN' or 'interlock: CLOSE'.
|
|
400
|
-
"""
|
|
401
|
-
raise NotImplementedError
|
|
402
|
-
|
|
403
|
-
@dynamic_command(cmd_type="query", cmd_string="get power", process_cmd_string=add_lf,
|
|
404
|
-
process_response=decode_response)
|
|
405
|
-
def get_power(self) -> str:
|
|
406
|
-
"""Get the state of the power supply. Returns 'power: ON' or 'power: OFF'."""
|
|
407
|
-
raise NotImplementedError
|
|
408
|
-
|
|
409
|
-
@dynamic_command(cmd_type="query", cmd_string="get lamp", process_cmd_string=add_lf,
|
|
410
|
-
process_response=decode_response)
|
|
411
|
-
def get_lamp(self) -> str:
|
|
412
|
-
"""Get the state of the lamp. Returns 'lamp: ON' or 'lamp: OFF'."""
|
|
413
|
-
raise NotImplementedError
|
|
414
|
-
|
|
415
|
-
@dynamic_command(cmd_type="query", cmd_string="get laser", process_cmd_string=add_lf,
|
|
416
|
-
process_response=decode_response)
|
|
417
|
-
def get_laser(self) -> str:
|
|
418
|
-
"""Get the state of the laser. Returns 'laser: ON' or 'laser: OFF'."""
|
|
419
|
-
raise NotImplementedError
|
|
420
|
-
|
|
421
|
-
@dynamic_command(cmd_type="query", cmd_string="get lamp-fault", process_cmd_string=add_lf,
|
|
422
|
-
process_response=decode_response)
|
|
423
|
-
def get_lamp_fault(self) -> str:
|
|
424
|
-
"""
|
|
425
|
-
Returns if there was an error with the lamp.
|
|
426
|
-
Returned value is 'lamp-fault: ERROR' or 'lamp-fault: NO-ERROR'.
|
|
427
|
-
"""
|
|
428
|
-
raise NotImplementedError
|
|
429
|
-
|
|
430
|
-
@dynamic_command(cmd_type="query", cmd_string="get controller-fault", process_cmd_string=add_lf,
|
|
431
|
-
process_response=decode_response)
|
|
432
|
-
def get_controller_fault(self) -> str:
|
|
433
|
-
"""
|
|
434
|
-
Returns if there was an error with the controller.
|
|
435
|
-
The returned value is 'controller-fault: ERROR' or 'controller-fault: NO-ERROR'.
|
|
436
|
-
"""
|
|
437
|
-
raise NotImplementedError
|
|
438
|
-
|
|
439
|
-
@dynamic_command(cmd_type="query", cmd_string="get psu", process_cmd_string=add_lf,
|
|
440
|
-
process_response=decode_response)
|
|
441
|
-
def get_psu(self) -> str:
|
|
442
|
-
"""Get the state of the power supply unit. Returns 'psu: ON' or 'psu: OFF'."""
|
|
443
|
-
raise NotImplementedError
|
|
444
|
-
|
|
445
|
-
@dynamic_command(cmd_type="query", cmd_string="get operate", process_cmd_string=add_lf,
|
|
446
|
-
process_response=decode_response)
|
|
447
|
-
def get_operate(self) -> str:
|
|
448
|
-
"""Get the state of the laser (operate). Returns 'operate: ON' or 'operate: OFF'."""
|
|
449
|
-
raise NotImplementedError
|
|
450
|
-
|
|
451
|
-
@dynamic_command(cmd_type="query", cmd_string="get flags", process_cmd_string=add_lf,
|
|
452
|
-
process_response=decode_response)
|
|
453
|
-
def get_flags(self) -> str:
|
|
454
|
-
"""
|
|
455
|
-
Get the state of all parameters encoded in a single number formatted in hexadecimal
|
|
456
|
-
and binary. The bit order from msb to lsb is:
|
|
457
|
-
|
|
458
|
-
* bit 0 - interlock
|
|
459
|
-
* bit 1 - power
|
|
460
|
-
* bit 2 - lamp
|
|
461
|
-
* bit 3 - laser
|
|
462
|
-
* bit 4 - lamp-fault
|
|
463
|
-
* bit 5 - controller-fault
|
|
464
|
-
* bit 6 - psu
|
|
465
|
-
* bit 7 - operate
|
|
466
|
-
|
|
467
|
-
Returns:
|
|
468
|
-
flags: 0xhh bbbb bbbb.
|
|
469
|
-
"""
|
|
470
|
-
raise NotImplementedError
|
|
471
|
-
|
|
472
|
-
@dynamic_command(cmd_type="query", cmd_string="read", process_cmd_string=add_lf,
|
|
473
|
-
process_response=decode_read_command)
|
|
474
|
-
def get_power_and_temperature(self) -> dict | Failure:
|
|
475
|
-
"""
|
|
476
|
-
Gets a power and temperature reading of both power-meters. Units are in Watt and degrees
|
|
477
|
-
Celsius.
|
|
478
|
-
|
|
479
|
-
Returns:
|
|
480
|
-
A dictionary containing the power and temperature values as floats. If the response
|
|
481
|
-
can not be processed, a Failure object will be returned.
|
|
482
|
-
"""
|
|
483
|
-
raise NotImplementedError
|
|
484
|
-
|
|
485
|
-
@dynamic_command(cmd_type="query", cmd_string="status", process_cmd_string=add_lf,
|
|
486
|
-
process_response=decode_status_command)
|
|
487
|
-
def status(self) -> dict | Failure:
|
|
488
|
-
"""
|
|
489
|
-
Gets a global view of various relevant parameters. Returns a comma separated with the
|
|
490
|
-
current value of 9 parameters. Optionally, the attenuation shows an asterisk '*' when
|
|
491
|
-
the wheels are moving.
|
|
492
|
-
|
|
493
|
-
Returns:
|
|
494
|
-
power: <flag>, lamp: <flag>, interlock: <flag>, psu: <flag>, att: [*] <level> #index,
|
|
495
|
-
power-ch1: <value> W, power-ch2: <value> W, temp-ch1: <value> ºC, temp-ch2: <value> ºC.
|
|
496
|
-
"""
|
|
497
|
-
raise NotImplementedError
|
|
498
|
-
|
|
499
|
-
@dynamic_command(cmd_type="query", cmd_string="level", process_cmd_string=add_lf,
|
|
500
|
-
process_response=decode_att_get_level_command)
|
|
501
|
-
def att_get_level(self) -> dict | Failure:
|
|
502
|
-
"""
|
|
503
|
-
Returns a dictionary with the following keys: att_moving [bool], att_factor [float],
|
|
504
|
-
and att_index [int]. In case of an error a Failure object will be returned.
|
|
505
|
-
"""
|
|
506
|
-
raise NotImplementedError
|
|
507
|
-
|
|
508
|
-
@dynamic_command(cmd_type="transaction", cmd_string="level ${factor}",
|
|
509
|
-
process_cmd_string=add_lf,
|
|
510
|
-
process_response=decode_response)
|
|
511
|
-
def att_set_level_factor(self, factor: int | float) -> str:
|
|
512
|
-
"""
|
|
513
|
-
Sets attenuator to the level closest to <factor>. There are 47 levels of attenuation
|
|
514
|
-
available, from 0 to 1.
|
|
515
|
-
This command chooses the level closest to the requested value.
|
|
516
|
-
|
|
517
|
-
Args:
|
|
518
|
-
factor (float): value between 0.0 and 1.0, where 0.0 is opaque and 1.0 is transparant.
|
|
519
|
-
|
|
520
|
-
Returns:
|
|
521
|
-
The string 'OK' or 'ERROR' depending whether the command
|
|
522
|
-
was accepted or the attenuator device is not ready.
|
|
523
|
-
"""
|
|
524
|
-
raise NotImplementedError
|
|
525
|
-
|
|
526
|
-
@dynamic_command(cmd_type="transaction", cmd_string="level #${index}",
|
|
527
|
-
process_cmd_string=check_cmd_att_index,
|
|
528
|
-
process_response=decode_response)
|
|
529
|
-
def att_set_level_index(self, index: int) -> str:
|
|
530
|
-
"""
|
|
531
|
-
Sets attenuator to the level closest to <index>. There are 47 levels of attenuation
|
|
532
|
-
available, from 0 to 46. This command chooses the level closest to the requested value.
|
|
533
|
-
|
|
534
|
-
Args:
|
|
535
|
-
index (int): value between 0-46 (inclusive).
|
|
536
|
-
|
|
537
|
-
Returns:
|
|
538
|
-
The string 'OK' or 'ERROR' depending whether the command
|
|
539
|
-
was accepted or the attenuator device is not ready.
|
|
540
|
-
"""
|
|
541
|
-
raise NotImplementedError
|
|
542
|
-
|
|
543
|
-
@dynamic_command(cmd_type="transaction", cmd_string="level ${pos1} ${pos2}",
|
|
544
|
-
process_cmd_string=add_lf,
|
|
545
|
-
process_response=decode_response)
|
|
546
|
-
def att_set_level_position(self, pos1: int, pos2: int) -> str:
|
|
547
|
-
"""
|
|
548
|
-
Sets the two filter wheels to the given values (pos1 and pos2 must be between 1 and 8).
|
|
549
|
-
|
|
550
|
-
Args:
|
|
551
|
-
pos1: the requested position for wheel 1
|
|
552
|
-
pos2: the requested position for wheel 2
|
|
553
|
-
|
|
554
|
-
Returns:
|
|
555
|
-
The string 'OK' or 'ERROR' depending whether the command
|
|
556
|
-
was accepted or the attenuator device is not ready.
|
|
557
|
-
|
|
558
|
-
"""
|
|
559
|
-
raise NotImplementedError
|
|
560
|
-
|
|
561
|
-
@dynamic_command(cmd_type="transaction", cmd_string="level up", process_cmd_string=add_lf,
|
|
562
|
-
process_response=decode_response)
|
|
563
|
-
def att_level_up(self) -> str:
|
|
564
|
-
"""
|
|
565
|
-
Selects the attenuation one step higher than the current value.
|
|
566
|
-
It has no effect if the current level is already the highest value allowed.
|
|
567
|
-
|
|
568
|
-
Returns:
|
|
569
|
-
The string 'OK' or 'ERROR' depending whether the command
|
|
570
|
-
was accepted or the attenuator device is not ready.
|
|
571
|
-
"""
|
|
572
|
-
raise NotImplementedError
|
|
573
|
-
|
|
574
|
-
@dynamic_command(cmd_type="transaction", cmd_string="level down", process_cmd_string=add_lf,
|
|
575
|
-
process_response=decode_response)
|
|
576
|
-
def att_level_down(self) -> str:
|
|
577
|
-
"""
|
|
578
|
-
Selects the attenuation one step lower than the current value.
|
|
579
|
-
It has no effect if the current level is already the lowest value allowed.
|
|
580
|
-
|
|
581
|
-
Returns:
|
|
582
|
-
The string 'OK' or 'ERROR' depending whether the command
|
|
583
|
-
was accepted or the attenuator device is not ready.
|
|
584
|
-
"""
|
|
585
|
-
raise NotImplementedError
|
|
586
|
-
|
|
587
|
-
@dynamic_command(cmd_type="transaction", cmd_string="power on", process_cmd_string=add_lf,
|
|
588
|
-
process_response=decode_response)
|
|
589
|
-
def power_on(self) -> str:
|
|
590
|
-
"""Turns the power supply on, returns 'OK' or 'ERROR'."""
|
|
591
|
-
raise NotImplementedError
|
|
592
|
-
|
|
593
|
-
@dynamic_command(cmd_type="transaction", cmd_string="power off", process_cmd_string=add_lf,
|
|
594
|
-
process_response=decode_response)
|
|
595
|
-
def power_off(self) -> str:
|
|
596
|
-
"""Turns the power supply off, returns 'OK' or 'ERROR'."""
|
|
597
|
-
raise NotImplementedError
|
|
598
|
-
|
|
599
|
-
@dynamic_command(cmd_type="transaction", cmd_string="operate on", process_cmd_string=add_lf,
|
|
600
|
-
process_response=decode_response)
|
|
601
|
-
def operate_on(self) -> str:
|
|
602
|
-
"""Turns the laser on, returns 'OK' or 'ERROR'."""
|
|
603
|
-
raise NotImplementedError
|
|
604
|
-
|
|
605
|
-
@dynamic_command(cmd_type="transaction", cmd_string="operate off", process_cmd_string=add_lf,
|
|
606
|
-
process_response=decode_response)
|
|
607
|
-
def operate_off(self) -> str:
|
|
608
|
-
"""Turns the laser off, returns 'OK' or 'ERROR'."""
|
|
609
|
-
raise NotImplementedError
|
|
610
|
-
|
|
611
|
-
@dynamic_command(cmd_type="transaction", cmd_string="reset", process_cmd_string=add_lf,
|
|
612
|
-
process_response=decode_response)
|
|
613
|
-
def reset(self) -> str:
|
|
614
|
-
"""Performs a ‘reset’ cycle. This is sometimes needed to take LDLS out of a locked state.
|
|
615
|
-
Returns 'OK' or 'ERROR'.
|
|
616
|
-
"""
|
|
617
|
-
raise NotImplementedError
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
class OGSEController(OGSEInterface, DynamicCommandMixin):
|
|
621
|
-
"""
|
|
622
|
-
This is the class that talks directly to the OGSE device. It opens a TCP/IP socket
|
|
623
|
-
connection with the OGSE Hardware Controller and sends commands to the device.
|
|
624
|
-
"""
|
|
625
|
-
|
|
626
|
-
def __init__(self, hostname=OGSE_SETTINGS.HOSTNAME, port=OGSE_SETTINGS.PORT):
|
|
627
|
-
"""
|
|
628
|
-
Args:
|
|
629
|
-
hostname (str): the IP address or fully qualified hostname of the OGSE hardware
|
|
630
|
-
controller. The default is defined in the ``settings.yaml`` configuration file.
|
|
631
|
-
|
|
632
|
-
port (int): the IP port number to connect to, by default set in the `settings.yaml`
|
|
633
|
-
configuration file.
|
|
634
|
-
"""
|
|
635
|
-
|
|
636
|
-
super().__init__()
|
|
637
|
-
|
|
638
|
-
logger.debug(f"Initializing OGSEController with hostname={hostname} on port={port}")
|
|
639
|
-
|
|
640
|
-
self.transport = self.ogse = OGSEEthernetInterface(hostname, port)
|
|
641
|
-
|
|
642
|
-
def connect(self):
|
|
643
|
-
self.transport.connect()
|
|
644
|
-
self.notify_observers(DeviceConnectionState.DEVICE_CONNECTED)
|
|
645
|
-
|
|
646
|
-
def disconnect(self):
|
|
647
|
-
self.transport.disconnect()
|
|
648
|
-
self.notify_observers(DeviceConnectionState.DEVICE_NOT_CONNECTED)
|
|
649
|
-
|
|
650
|
-
def reconnect(self):
|
|
651
|
-
self.transport.reconnect()
|
|
652
|
-
|
|
653
|
-
def is_connected(self):
|
|
654
|
-
"""Check if the OGSE Controller is connected. """
|
|
655
|
-
return self.transport.is_connected()
|
|
656
|
-
|
|
657
|
-
def is_simulator(self):
|
|
658
|
-
return "sim" in self.version()
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
ATT_LEVELS_BY_WHEEL = {
|
|
662
|
-
(1, 1): 1E+0,
|
|
663
|
-
(1, 2): 0E-9,
|
|
664
|
-
(1, 3): 600E-3,
|
|
665
|
-
(1, 4): 350E-3,
|
|
666
|
-
(1, 5): 250E-3,
|
|
667
|
-
(1, 6): 90E-3,
|
|
668
|
-
(1, 7): 7.5E-3,
|
|
669
|
-
(1, 8): 900E-6,
|
|
670
|
-
(2, 1): 0E-9,
|
|
671
|
-
(2, 2): 0E-9,
|
|
672
|
-
(2, 3): 0E-9,
|
|
673
|
-
(2, 4): 0E-9,
|
|
674
|
-
(2, 5): 0E-9,
|
|
675
|
-
(2, 6): 0E-9,
|
|
676
|
-
(2, 7): 0E-9,
|
|
677
|
-
(2, 8): 0E-9,
|
|
678
|
-
(3, 1): 800E-3,
|
|
679
|
-
(3, 2): 0E-9,
|
|
680
|
-
(3, 3): 480E-3,
|
|
681
|
-
(3, 4): 280E-3,
|
|
682
|
-
(3, 5): 200E-3,
|
|
683
|
-
(3, 6): 72E-3,
|
|
684
|
-
(3, 7): 6E-3,
|
|
685
|
-
(3, 8): 720E-6,
|
|
686
|
-
(4, 1): 550E-3,
|
|
687
|
-
(4, 2): 0E-9,
|
|
688
|
-
(4, 3): 330E-3,
|
|
689
|
-
(4, 4): 192.5E-3,
|
|
690
|
-
(4, 5): 137.5E-3,
|
|
691
|
-
(4, 6): 49.5E-3,
|
|
692
|
-
(4, 7): 4.125E-3,
|
|
693
|
-
(4, 8): 495E-6,
|
|
694
|
-
(5, 1): 260E-3,
|
|
695
|
-
(5, 2): 0E-9,
|
|
696
|
-
(5, 3): 156E-3,
|
|
697
|
-
(5, 4): 91E-3,
|
|
698
|
-
(5, 5): 65E-3,
|
|
699
|
-
(5, 6): 23.4E-3,
|
|
700
|
-
(5, 7): 1.95E-3,
|
|
701
|
-
(5, 8): 234E-6,
|
|
702
|
-
(6, 1): 90E-3,
|
|
703
|
-
(6, 2): 0E-9,
|
|
704
|
-
(6, 3): 54E-3,
|
|
705
|
-
(6, 4): 31.5E-3,
|
|
706
|
-
(6, 5): 22.5E-3,
|
|
707
|
-
(6, 6): 8.1E-3,
|
|
708
|
-
(6, 7): 675E-6,
|
|
709
|
-
(6, 8): 81E-6,
|
|
710
|
-
(7, 1): 25E-3,
|
|
711
|
-
(7, 2): 0E-9,
|
|
712
|
-
(7, 3): 15E-3,
|
|
713
|
-
(7, 4): 8.75E-3,
|
|
714
|
-
(7, 5): 6.25E-3,
|
|
715
|
-
(7, 6): 2.25E-3,
|
|
716
|
-
(7, 7): 187.5E-6,
|
|
717
|
-
(7, 8): 22.5E-6,
|
|
718
|
-
(8, 1): 900E-6,
|
|
719
|
-
(8, 2): 0E-9,
|
|
720
|
-
(8, 3): 540E-6,
|
|
721
|
-
(8, 4): 315E-6,
|
|
722
|
-
(8, 5): 225E-6,
|
|
723
|
-
(8, 6): 81E-6,
|
|
724
|
-
(8, 7): 6.75E-6,
|
|
725
|
-
(8, 8): 810E-9,
|
|
726
|
-
}
|
|
727
|
-
|
|
728
|
-
ATT_LEVELS_BY_FACTOR = {
|
|
729
|
-
0: 0.0,
|
|
730
|
-
1: 8.10E-7,
|
|
731
|
-
2: 6.75E-6,
|
|
732
|
-
3: 2.25E-5,
|
|
733
|
-
4: 8.10E-5,
|
|
734
|
-
5: 1.88E-4,
|
|
735
|
-
6: 2.25E-4,
|
|
736
|
-
7: 2.34E-4,
|
|
737
|
-
8: 3.15E-4,
|
|
738
|
-
9: 4.95E-4,
|
|
739
|
-
10: 5.40E-4,
|
|
740
|
-
11: 6.75E-4,
|
|
741
|
-
12: 7.20E-4,
|
|
742
|
-
13: 9.00E-4,
|
|
743
|
-
14: 1.95E-3,
|
|
744
|
-
15: 2.25E-3,
|
|
745
|
-
16: 4.13E-3,
|
|
746
|
-
17: 6.00E-3,
|
|
747
|
-
18: 6.25E-3,
|
|
748
|
-
19: 7.50E-3,
|
|
749
|
-
20: 8.10E-3,
|
|
750
|
-
21: 8.75E-3,
|
|
751
|
-
22: 1.50E-2,
|
|
752
|
-
23: 2.25E-2,
|
|
753
|
-
24: 2.34E-2,
|
|
754
|
-
25: 2.50E-2,
|
|
755
|
-
26: 3.15E-2,
|
|
756
|
-
27: 4.95E-2,
|
|
757
|
-
28: 5.40E-2,
|
|
758
|
-
29: 6.50E-2,
|
|
759
|
-
30: 7.20E-2,
|
|
760
|
-
31: 9.00E-2,
|
|
761
|
-
32: 9.10E-2,
|
|
762
|
-
33: 1.38E-1,
|
|
763
|
-
34: 1.56E-1,
|
|
764
|
-
35: 1.93E-1,
|
|
765
|
-
36: 2.00E-1,
|
|
766
|
-
37: 2.50E-1,
|
|
767
|
-
38: 2.60E-1,
|
|
768
|
-
39: 2.80E-1,
|
|
769
|
-
40: 3.30E-1,
|
|
770
|
-
41: 3.50E-1,
|
|
771
|
-
42: 4.80E-1,
|
|
772
|
-
43: 5.50E-1,
|
|
773
|
-
44: 6.00E-1,
|
|
774
|
-
45: 8.00E-1,
|
|
775
|
-
46: 1.0,
|
|
776
|
-
}
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
def get_attenuation_index(attenuation_level: float):
|
|
780
|
-
"""
|
|
781
|
-
Determine the attenuation index corresponding to the given transmittance.
|
|
782
|
-
|
|
783
|
-
Args:
|
|
784
|
-
attenuation level: Transmittance.
|
|
785
|
-
|
|
786
|
-
Returns:
|
|
787
|
-
Attenuation index corresponding to the given transmittance.
|
|
788
|
-
"""
|
|
789
|
-
attenuation_levels = np.array([level for level in ATT_LEVELS_BY_FACTOR.values()])
|
|
790
|
-
|
|
791
|
-
return np.abs(attenuation_levels - attenuation_level).argmin()
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
class OGSESimulator(OGSEInterface):
|
|
795
|
-
|
|
796
|
-
def __init__(self):
|
|
797
|
-
|
|
798
|
-
super().__init__()
|
|
799
|
-
|
|
800
|
-
self._lamp = False
|
|
801
|
-
self._laser = False
|
|
802
|
-
self._psu = False
|
|
803
|
-
self._interlock = False
|
|
804
|
-
self._operate = False
|
|
805
|
-
self._power = False
|
|
806
|
-
self._att_level = 1.0
|
|
807
|
-
self._att_index = 46
|
|
808
|
-
self._att_position_1 = 1
|
|
809
|
-
self._att_position_2 = 1
|
|
810
|
-
self._connected = False
|
|
811
|
-
|
|
812
|
-
def is_simulator(self) -> bool:
|
|
813
|
-
return True
|
|
814
|
-
|
|
815
|
-
def connect(self):
|
|
816
|
-
self._connected = True
|
|
817
|
-
|
|
818
|
-
def disconnect(self):
|
|
819
|
-
self._connected = False
|
|
820
|
-
|
|
821
|
-
def reconnect(self):
|
|
822
|
-
self._connected = True
|
|
823
|
-
|
|
824
|
-
def is_connected(self) -> bool:
|
|
825
|
-
return self._connected
|
|
826
|
-
|
|
827
|
-
def version(self):
|
|
828
|
-
return "PLATO-RT-OGSE (v2.1)"
|
|
829
|
-
|
|
830
|
-
def get_flags(self):
|
|
831
|
-
|
|
832
|
-
return "flags: 0x00 0000 0000"
|
|
833
|
-
|
|
834
|
-
def get_interlock(self):
|
|
835
|
-
|
|
836
|
-
return "interlock: OPEN" if self._interlock else "interlock: CLOSED"
|
|
837
|
-
|
|
838
|
-
def get_power(self):
|
|
839
|
-
|
|
840
|
-
return "power: ON" if self._power else "power: OFF"
|
|
841
|
-
|
|
842
|
-
def get_lamp(self):
|
|
843
|
-
|
|
844
|
-
return "lamp: ON" if self._lamp else "lamp: OFF"
|
|
845
|
-
|
|
846
|
-
def get_laser(self):
|
|
847
|
-
|
|
848
|
-
return "laser: ON" if self._laser else "laser: OFF"
|
|
849
|
-
|
|
850
|
-
def quit(self):
|
|
851
|
-
pass
|
|
852
|
-
|
|
853
|
-
def exit(self):
|
|
854
|
-
pass
|
|
855
|
-
|
|
856
|
-
def ldls_status(self):
|
|
857
|
-
|
|
858
|
-
return "ldls: OK"
|
|
859
|
-
|
|
860
|
-
def get_lamp_fault(self):
|
|
861
|
-
|
|
862
|
-
return "lamp-fault: NO-ERROR"
|
|
863
|
-
|
|
864
|
-
def get_controller_fault(self):
|
|
865
|
-
|
|
866
|
-
return "controller-fault: NO-ERROR"
|
|
867
|
-
|
|
868
|
-
def get_psu(self):
|
|
869
|
-
|
|
870
|
-
return "psu: ON" if self._psu else "psu: OFF"
|
|
871
|
-
|
|
872
|
-
def get_operate(self):
|
|
873
|
-
|
|
874
|
-
return "operate: ON" if self._operate else "operate: OFF"
|
|
875
|
-
|
|
876
|
-
def att_status(self):
|
|
877
|
-
|
|
878
|
-
return "att: OK"
|
|
879
|
-
|
|
880
|
-
def att_get_level(self):
|
|
881
|
-
|
|
882
|
-
return {
|
|
883
|
-
"att_moving": False,
|
|
884
|
-
"att_factor": self._att_level,
|
|
885
|
-
"att_index": self._att_index
|
|
886
|
-
}
|
|
887
|
-
|
|
888
|
-
def att_set_level_factor(self, factor):
|
|
889
|
-
|
|
890
|
-
if 0 <= factor <= 1:
|
|
891
|
-
|
|
892
|
-
self._att_level = factor
|
|
893
|
-
self._att_index = get_attenuation_index(factor)
|
|
894
|
-
|
|
895
|
-
time.sleep(random.random() * 3 + 6) # wait between 6.0 and 9.0 seconds
|
|
896
|
-
|
|
897
|
-
return "OK"
|
|
898
|
-
|
|
899
|
-
else:
|
|
900
|
-
|
|
901
|
-
return "ERROR: usage: attenuator level <value> -- value must be in [0,1]"
|
|
902
|
-
|
|
903
|
-
def att_set_level_position(self, level1, level2):
|
|
904
|
-
|
|
905
|
-
if 1 <= level1 <= 8 and 1 <= level2 <= 8:
|
|
906
|
-
|
|
907
|
-
self._att_position_1 = level1
|
|
908
|
-
self._att_position_2 = level2
|
|
909
|
-
|
|
910
|
-
self._att_level = ATT_LEVELS_BY_WHEEL[(level1, level2)]
|
|
911
|
-
self._att_index = get_attenuation_index(self._att_level)
|
|
912
|
-
|
|
913
|
-
time.sleep(random.random() * 3 + 6) # wait between 6.0 and 9.0 seconds
|
|
914
|
-
|
|
915
|
-
return "OK"
|
|
916
|
-
|
|
917
|
-
else:
|
|
918
|
-
|
|
919
|
-
return (
|
|
920
|
-
"ERROR: usage: attenuator level <wheel_1> <wheel_2> -- "
|
|
921
|
-
"wheel positions must be integer = 1..8"
|
|
922
|
-
)
|
|
923
|
-
|
|
924
|
-
def att_level_up(self):
|
|
925
|
-
|
|
926
|
-
self.att_set_level_index(min(self._att_index + 1, len(ATT_LEVELS_BY_FACTOR) - 1))
|
|
927
|
-
|
|
928
|
-
return "OK"
|
|
929
|
-
|
|
930
|
-
def att_level_down(self):
|
|
931
|
-
|
|
932
|
-
self.att_set_level_index(max(self._att_index - 1, 0))
|
|
933
|
-
|
|
934
|
-
return "OK"
|
|
935
|
-
|
|
936
|
-
def pm_status(self):
|
|
937
|
-
|
|
938
|
-
return {
|
|
939
|
-
"pm1": "OK",
|
|
940
|
-
"pm2": "OK"
|
|
941
|
-
}
|
|
942
|
-
|
|
943
|
-
def get_power_and_temperature(self):
|
|
944
|
-
|
|
945
|
-
return {
|
|
946
|
-
"power1": 6.376149e-11,
|
|
947
|
-
"temp1": 21.3,
|
|
948
|
-
"power2": 1.484441e-07,
|
|
949
|
-
"temp2": 21.3
|
|
950
|
-
}
|
|
951
|
-
|
|
952
|
-
def status(self):
|
|
953
|
-
|
|
954
|
-
power_and_temp = self.get_power_and_temperature()
|
|
955
|
-
_, att_level, att_index = self.att_get_level()
|
|
956
|
-
|
|
957
|
-
# return self.get_power(), self.get_lamp(), self.get_interlock(), self.get_psu(), \
|
|
958
|
-
# f"att: {att_level} #{att_index}", f"power-ch1: {power_ch1} W", f"temp-ch1: {temp_ch1} °C", \
|
|
959
|
-
# f"power-ch2: {power_ch2} W", f"temp-ch2: {temp_ch2} °C",
|
|
960
|
-
#
|
|
961
|
-
status = {
|
|
962
|
-
"power": "ON" if self._power else "OFF",
|
|
963
|
-
"lamp": "ON" if self._lamp else "OFF",
|
|
964
|
-
"interlock": "ON" if self._interlock else "OFF",
|
|
965
|
-
"psu": "ON" if self._psu else "OFF",
|
|
966
|
-
"att_moving": False,
|
|
967
|
-
"att_factor": self._att_level,
|
|
968
|
-
"att_index": self._att_index
|
|
969
|
-
}
|
|
970
|
-
|
|
971
|
-
status.update(power_and_temp)
|
|
972
|
-
|
|
973
|
-
return status
|
|
974
|
-
|
|
975
|
-
def att_set_level_index(self, index: int):
|
|
976
|
-
|
|
977
|
-
if 0 <= factor < len(ATT_LEVELS_BY_FACTOR):
|
|
978
|
-
|
|
979
|
-
self._att_index = index
|
|
980
|
-
self._att_level = ATT_LEVELS_BY_FACTOR[index][0]
|
|
981
|
-
|
|
982
|
-
time.sleep(random.random() * 3 + 6) # wait between 6.0 and 9.0 seconds
|
|
983
|
-
|
|
984
|
-
return "OK"
|
|
985
|
-
|
|
986
|
-
else:
|
|
987
|
-
|
|
988
|
-
return "ERROR: usage: attenuator level #index -- index goes from 0 to 47"
|
|
989
|
-
|
|
990
|
-
def power_on(self):
|
|
991
|
-
|
|
992
|
-
self._power = True
|
|
993
|
-
|
|
994
|
-
return "OK"
|
|
995
|
-
|
|
996
|
-
def power_off(self):
|
|
997
|
-
|
|
998
|
-
self._power = False
|
|
999
|
-
|
|
1000
|
-
return "OK"
|
|
1001
|
-
|
|
1002
|
-
def operate_on(self):
|
|
1003
|
-
|
|
1004
|
-
self._operate = True
|
|
1005
|
-
|
|
1006
|
-
return "OK"
|
|
1007
|
-
|
|
1008
|
-
def operate_off(self):
|
|
1009
|
-
|
|
1010
|
-
self._operate = True
|
|
1011
|
-
|
|
1012
|
-
return "OK"
|
|
1013
|
-
|
|
1014
|
-
def reset(self):
|
|
1015
|
-
pass
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
REQUEST_TIMEOUT = 10_000 # setting the attenuator can take up to 10 seconds
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
class OGSEProxy(DynamicProxy, OGSEInterface):
|
|
1022
|
-
"""
|
|
1023
|
-
The OGSEProxy class is used to connect to the OGSE control server and send commands
|
|
1024
|
-
to the OGSE Hardware Controller remotely.
|
|
1025
|
-
"""
|
|
1026
|
-
|
|
1027
|
-
def __init__(
|
|
1028
|
-
self,
|
|
1029
|
-
protocol=CTRL_SETTINGS.PROTOCOL,
|
|
1030
|
-
hostname=CTRL_SETTINGS.HOSTNAME,
|
|
1031
|
-
port=CTRL_SETTINGS.COMMANDING_PORT,
|
|
1032
|
-
timeout=REQUEST_TIMEOUT
|
|
1033
|
-
):
|
|
1034
|
-
"""
|
|
1035
|
-
Args:
|
|
1036
|
-
protocol: the transport protocol
|
|
1037
|
-
[default is taken from settings file]
|
|
1038
|
-
hostname: location of the control server (IP address)
|
|
1039
|
-
[default is taken from settings file]
|
|
1040
|
-
port: TCP port on which the control server is listening for commands
|
|
1041
|
-
[default is taken from settings file]
|
|
1042
|
-
timeout: time out on the response from the control server [milliseconds]
|
|
1043
|
-
"""
|
|
1044
|
-
super().__init__(connect_address(protocol, hostname, port), timeout=timeout)
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
# commands = load_commands(CommandProtocol, COMMAND_SETTINGS.Commands, OGSECommand, OGSEController)
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
if __name__ == "__main__":
|
|
1051
|
-
import logging
|
|
1052
|
-
|
|
1053
|
-
logging.basicConfig(level=20)
|
|
1054
|
-
|
|
1055
|
-
from egse.collimator.fcul.ogse import OGSEController
|
|
1056
|
-
|
|
1057
|
-
ogse = OGSEController()
|
|
1058
|
-
ogse.connect()
|
|
1059
|
-
|
|
1060
|
-
print(ogse.version())
|
|
1061
|
-
print(ogse.status())
|
|
1062
|
-
|
|
1063
|
-
print("att level: ", ogse.att_get_level())
|
|
1064
|
-
|
|
1065
|
-
for factor in 1e-10, 1e-9, 1e-8, 1e-7, 1e-6, 1e-5, 1e-4, 1e-3, 1e-2, 1e-1, 1e-0:
|
|
1066
|
-
print(format_datetime(), end=" ")
|
|
1067
|
-
print(f"set att level: {factor:10e}", end=" ")
|
|
1068
|
-
print(ogse.att_set_level_factor(factor), end=" ")
|
|
1069
|
-
print(ogse.att_get_level())
|
|
1070
|
-
|
|
1071
|
-
for factor in 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0:
|
|
1072
|
-
print(format_datetime(), end=" ")
|
|
1073
|
-
print(f"set att level: {factor:10e}", end=" ")
|
|
1074
|
-
print(ogse.att_set_level_factor(factor), end=" ")
|
|
1075
|
-
print(ogse.att_get_level())
|
|
1076
|
-
|
|
1077
|
-
ogse.disconnect()
|