cgse 2023.38.0__py3-none-any.whl → 2024.1.3__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.
Files changed (653) hide show
  1. README.md +27 -0
  2. bump.py +77 -0
  3. cgse-2024.1.3.dist-info/METADATA +41 -0
  4. cgse-2024.1.3.dist-info/RECORD +5 -0
  5. {cgse-2023.38.0.dist-info → cgse-2024.1.3.dist-info}/WHEEL +1 -2
  6. cgse-2023.38.0.dist-info/COPYING +0 -674
  7. cgse-2023.38.0.dist-info/COPYING.LESSER +0 -165
  8. cgse-2023.38.0.dist-info/METADATA +0 -144
  9. cgse-2023.38.0.dist-info/RECORD +0 -649
  10. cgse-2023.38.0.dist-info/entry_points.txt +0 -75
  11. cgse-2023.38.0.dist-info/top_level.txt +0 -2
  12. egse/__init__.py +0 -12
  13. egse/__main__.py +0 -32
  14. egse/aeu/aeu.py +0 -5235
  15. egse/aeu/aeu_awg.yaml +0 -265
  16. egse/aeu/aeu_crio.yaml +0 -273
  17. egse/aeu/aeu_cs.py +0 -626
  18. egse/aeu/aeu_devif.py +0 -321
  19. egse/aeu/aeu_main_ui.py +0 -912
  20. egse/aeu/aeu_metrics.py +0 -131
  21. egse/aeu/aeu_protocol.py +0 -463
  22. egse/aeu/aeu_psu.yaml +0 -204
  23. egse/aeu/aeu_ui.py +0 -873
  24. egse/aeu/arbdata/FccdRead.arb +0 -2
  25. egse/aeu/arbdata/FccdRead_min_points.arb +0 -2
  26. egse/aeu/arbdata/HeaterSync_FccdRead.arb +0 -2
  27. egse/aeu/arbdata/HeaterSync_ccdRead25.arb +0 -2
  28. egse/aeu/arbdata/HeaterSync_ccdRead31_25.arb +0 -2
  29. egse/aeu/arbdata/HeaterSync_ccdRead37_50.arb +0 -2
  30. egse/aeu/arbdata/HeaterSync_ccdRead43_75.arb +0 -2
  31. egse/aeu/arbdata/HeaterSync_ccdRead50.arb +0 -2
  32. egse/aeu/arbdata/Heater_FccdRead_min_points.arb +0 -2
  33. egse/aeu/arbdata/ccdRead25.arb +0 -2
  34. egse/aeu/arbdata/ccdRead25_150ms.arb +0 -2
  35. egse/aeu/arbdata/ccdRead31_25.arb +0 -2
  36. egse/aeu/arbdata/ccdRead31_25_150ms.arb +0 -2
  37. egse/aeu/arbdata/ccdRead37_50.arb +0 -2
  38. egse/aeu/arbdata/ccdRead37_50_150ms.arb +0 -2
  39. egse/aeu/arbdata/ccdRead43_75.arb +0 -2
  40. egse/aeu/arbdata/ccdRead43_75_150ms.arb +0 -2
  41. egse/aeu/arbdata/ccdRead50.arb +0 -2
  42. egse/aeu/arbdata/ccdRead50_150ms.arb +0 -2
  43. egse/alert/__init__.py +0 -1049
  44. egse/alert/alertman.yaml +0 -37
  45. egse/alert/alertman_cs.py +0 -234
  46. egse/alert/alertman_ui.py +0 -603
  47. egse/alert/gsm/beaglebone.py +0 -138
  48. egse/alert/gsm/beaglebone.yaml +0 -51
  49. egse/alert/gsm/beaglebone_cs.py +0 -108
  50. egse/alert/gsm/beaglebone_devif.py +0 -130
  51. egse/alert/gsm/beaglebone_protocol.py +0 -48
  52. egse/bits.py +0 -318
  53. egse/camera.py +0 -44
  54. egse/collimator/__init__.py +0 -0
  55. egse/collimator/fcul/__init__.py +0 -0
  56. egse/collimator/fcul/ogse.py +0 -1077
  57. egse/collimator/fcul/ogse.yaml +0 -14
  58. egse/collimator/fcul/ogse_cs.py +0 -154
  59. egse/collimator/fcul/ogse_devif.py +0 -358
  60. egse/collimator/fcul/ogse_protocol.py +0 -129
  61. egse/collimator/fcul/ogse_sim.py +0 -431
  62. egse/collimator/fcul/ogse_ui.py +0 -1108
  63. egse/command.py +0 -699
  64. egse/config.py +0 -410
  65. egse/confman/__init__.py +0 -1015
  66. egse/confman/confman.yaml +0 -67
  67. egse/confman/confman_cs.py +0 -239
  68. egse/confman/confman_ui.py +0 -381
  69. egse/confman/setup_ui.py +0 -565
  70. egse/control.py +0 -442
  71. egse/coordinates/__init__.py +0 -531
  72. egse/coordinates/avoidance.py +0 -103
  73. egse/coordinates/cslmodel.py +0 -127
  74. egse/coordinates/laser_tracker_to_dict.py +0 -120
  75. egse/coordinates/point.py +0 -707
  76. egse/coordinates/pyplot.py +0 -195
  77. egse/coordinates/referenceFrame.py +0 -1279
  78. egse/coordinates/refmodel.py +0 -737
  79. egse/coordinates/rotationMatrix.py +0 -85
  80. egse/coordinates/transform3d_addon.py +0 -419
  81. egse/csl/__init__.py +0 -50
  82. egse/csl/commanding.py +0 -78
  83. egse/csl/icons/hexapod-connected-selected.svg +0 -30
  84. egse/csl/icons/hexapod-connected.svg +0 -30
  85. egse/csl/icons/hexapod-homing-selected.svg +0 -68
  86. egse/csl/icons/hexapod-homing.svg +0 -68
  87. egse/csl/icons/hexapod-retract-selected.svg +0 -56
  88. egse/csl/icons/hexapod-retract.svg +0 -51
  89. egse/csl/icons/hexapod-zero-selected.svg +0 -56
  90. egse/csl/icons/hexapod-zero.svg +0 -56
  91. egse/csl/icons/logo-puna.svg +0 -92
  92. egse/csl/icons/stop.svg +0 -1
  93. egse/csl/initialisation.py +0 -102
  94. egse/csl/mech_pos_settings.yaml +0 -18
  95. egse/das.py +0 -1247
  96. egse/das.yaml +0 -7
  97. egse/data/conf/SETUP_CSL_00000_170620_150000.yaml +0 -5
  98. egse/data/conf/SETUP_CSL_00001_170620_151010.yaml +0 -69
  99. egse/data/conf/SETUP_CSL_00002_170620_151020.yaml +0 -69
  100. egse/data/conf/SETUP_CSL_00003_170620_151030.yaml +0 -69
  101. egse/data/conf/SETUP_CSL_00004_170620_151040.yaml +0 -69
  102. egse/data/conf/SETUP_CSL_00005_170620_151050.yaml +0 -69
  103. egse/data/conf/SETUP_CSL_00006_170620_151060.yaml +0 -69
  104. egse/data/conf/SETUP_CSL_00007_170620_151070.yaml +0 -69
  105. egse/data/conf/SETUP_CSL_00008_170620_151080.yaml +0 -75
  106. egse/data/conf/SETUP_CSL_00010_210308_083016.yaml +0 -138
  107. egse/data/conf/SETUP_INTA_00000_170620_150000.yaml +0 -4
  108. egse/data/conf/SETUP_SRON_00000_170620_150000.yaml +0 -4
  109. egse/decorators.py +0 -415
  110. egse/device.py +0 -269
  111. egse/dpu/__init__.py +0 -2681
  112. egse/dpu/ccd_ui.py +0 -508
  113. egse/dpu/dpu.py +0 -786
  114. egse/dpu/dpu.yaml +0 -153
  115. egse/dpu/dpu_cs.py +0 -272
  116. egse/dpu/dpu_ui.py +0 -668
  117. egse/dpu/fitsgen.py +0 -2077
  118. egse/dpu/fitsgen_test.py +0 -752
  119. egse/dpu/fitsgen_ui.py +0 -399
  120. egse/dpu/hdf5_model.py +0 -332
  121. egse/dpu/hdf5_ui.py +0 -277
  122. egse/dpu/hdf5_viewer.py +0 -506
  123. egse/dpu/hk_ui.py +0 -468
  124. egse/dpu_commands.py +0 -81
  125. egse/dsi/constants.py +0 -220
  126. egse/dsi/esl.py +0 -870
  127. egse/dsi/rmap.py +0 -1042
  128. egse/dsi/rmapci.py +0 -37
  129. egse/dsi/spw.py +0 -154
  130. egse/dsi/spw_state.py +0 -29
  131. egse/dummy.py +0 -258
  132. egse/dyndummy.py +0 -179
  133. egse/env.py +0 -278
  134. egse/exceptions.py +0 -88
  135. egse/fdir/__init__.py +0 -28
  136. egse/fdir/fdir_manager.py +0 -85
  137. egse/fdir/fdir_manager.yaml +0 -51
  138. egse/fdir/fdir_manager_controller.py +0 -228
  139. egse/fdir/fdir_manager_cs.py +0 -164
  140. egse/fdir/fdir_manager_interface.py +0 -25
  141. egse/fdir/fdir_remote.py +0 -73
  142. egse/fdir/fdir_remote.yaml +0 -37
  143. egse/fdir/fdir_remote_controller.py +0 -50
  144. egse/fdir/fdir_remote_cs.py +0 -97
  145. egse/fdir/fdir_remote_interface.py +0 -14
  146. egse/fdir/fdir_remote_popup.py +0 -31
  147. egse/fee/__init__.py +0 -114
  148. egse/fee/f_fee_register.yaml +0 -43
  149. egse/fee/fee.py +0 -631
  150. egse/fee/feesim.py +0 -750
  151. egse/fee/n_fee_hk.py +0 -761
  152. egse/fee/nfee.py +0 -187
  153. egse/filterwheel/__init__.py +0 -4
  154. egse/filterwheel/eksma/__init__.py +0 -24
  155. egse/filterwheel/eksma/fw8smc4.py +0 -661
  156. egse/filterwheel/eksma/fw8smc4.yaml +0 -121
  157. egse/filterwheel/eksma/fw8smc4_cs.py +0 -144
  158. egse/filterwheel/eksma/fw8smc4_devif.py +0 -473
  159. egse/filterwheel/eksma/fw8smc4_protocol.py +0 -81
  160. egse/filterwheel/eksma/fw8smc4_ui.py +0 -940
  161. egse/filterwheel/eksma/fw8smc5.py +0 -111
  162. egse/filterwheel/eksma/fw8smc5.yaml +0 -105
  163. egse/filterwheel/eksma/fw8smc5_controller.py +0 -307
  164. egse/filterwheel/eksma/fw8smc5_cs.py +0 -141
  165. egse/filterwheel/eksma/fw8smc5_interface.py +0 -65
  166. egse/filterwheel/eksma/fw8smc5_simulator.py +0 -29
  167. egse/filterwheel/eksma/fw8smc5_ui.py +0 -1068
  168. egse/filterwheel/eksma/testpythonfw.py +0 -215
  169. egse/fov/__init__.py +0 -65
  170. egse/fov/fov_hk.py +0 -712
  171. egse/fov/fov_ui.py +0 -861
  172. egse/fov/fov_ui_controller.py +0 -140
  173. egse/fov/fov_ui_model.py +0 -200
  174. egse/fov/fov_ui_view.py +0 -345
  175. egse/gimbal/__init__.py +0 -32
  176. egse/gimbal/symetrie/__init__.py +0 -26
  177. egse/gimbal/symetrie/alpha.py +0 -586
  178. egse/gimbal/symetrie/generic_gimbal_ui.py +0 -1521
  179. egse/gimbal/symetrie/gimbal.py +0 -877
  180. egse/gimbal/symetrie/gimbal.yaml +0 -168
  181. egse/gimbal/symetrie/gimbal_cs.py +0 -183
  182. egse/gimbal/symetrie/gimbal_protocol.py +0 -135
  183. egse/gimbal/symetrie/gimbal_ui.py +0 -361
  184. egse/gimbal/symetrie/pmac.py +0 -1006
  185. egse/gimbal/symetrie/pmac_regex.py +0 -83
  186. egse/graph.py +0 -132
  187. egse/gui/__init__.py +0 -47
  188. egse/gui/buttons.py +0 -378
  189. egse/gui/focalplane.py +0 -1281
  190. egse/gui/formatter.py +0 -10
  191. egse/gui/led.py +0 -162
  192. egse/gui/limitswitch.py +0 -143
  193. egse/gui/mechanisms.py +0 -588
  194. egse/gui/states.py +0 -148
  195. egse/gui/stripchart.py +0 -729
  196. egse/gui/switch.py +0 -112
  197. egse/h5.py +0 -274
  198. egse/help/__init__.py +0 -0
  199. egse/help/help_ui.py +0 -126
  200. egse/hexapod/__init__.py +0 -32
  201. egse/hexapod/symetrie/__init__.py +0 -138
  202. egse/hexapod/symetrie/alpha.py +0 -874
  203. egse/hexapod/symetrie/dynalpha.py +0 -1387
  204. egse/hexapod/symetrie/hexapod_ui.py +0 -1516
  205. egse/hexapod/symetrie/pmac.py +0 -1010
  206. egse/hexapod/symetrie/pmac_regex.py +0 -83
  207. egse/hexapod/symetrie/puna.py +0 -1167
  208. egse/hexapod/symetrie/puna.yaml +0 -193
  209. egse/hexapod/symetrie/puna_cs.py +0 -196
  210. egse/hexapod/symetrie/puna_protocol.py +0 -131
  211. egse/hexapod/symetrie/puna_ui.py +0 -434
  212. egse/hexapod/symetrie/punaplus.py +0 -107
  213. egse/hexapod/symetrie/zonda.py +0 -872
  214. egse/hexapod/symetrie/zonda.yaml +0 -337
  215. egse/hexapod/symetrie/zonda_cs.py +0 -172
  216. egse/hexapod/symetrie/zonda_devif.py +0 -415
  217. egse/hexapod/symetrie/zonda_protocol.py +0 -119
  218. egse/hexapod/symetrie/zonda_ui.py +0 -449
  219. egse/hk.py +0 -765
  220. egse/icons/aeu-cs-start.svg +0 -117
  221. egse/icons/aeu-cs-stop.svg +0 -118
  222. egse/icons/aeu-cs.svg +0 -107
  223. egse/icons/aeu_cs-started.svg +0 -112
  224. egse/icons/aeu_cs-stopped.svg +0 -112
  225. egse/icons/aeu_cs.svg +0 -55
  226. egse/icons/alert.svg +0 -1
  227. egse/icons/arrow-double-left.png +0 -0
  228. egse/icons/arrow-double-right.png +0 -0
  229. egse/icons/arrow-up.svg +0 -11
  230. egse/icons/backward.svg +0 -1
  231. egse/icons/busy.svg +0 -1
  232. egse/icons/cleaning.svg +0 -115
  233. egse/icons/color-scheme.svg +0 -1
  234. egse/icons/cs-connected-alert.svg +0 -91
  235. egse/icons/cs-connected-disabled.svg +0 -43
  236. egse/icons/cs-connected.svg +0 -89
  237. egse/icons/cs-not-connected.svg +0 -44
  238. egse/icons/double-left-arrow.svg +0 -1
  239. egse/icons/double-right-arrow.svg +0 -1
  240. egse/icons/erase-disabled.svg +0 -19
  241. egse/icons/erase.svg +0 -59
  242. egse/icons/fitsgen-start.svg +0 -47
  243. egse/icons/fitsgen-stop.svg +0 -48
  244. egse/icons/fitsgen.svg +0 -1
  245. egse/icons/forward.svg +0 -1
  246. egse/icons/fov-hk-start.svg +0 -33
  247. egse/icons/fov-hk-stop.svg +0 -37
  248. egse/icons/fov-hk.svg +0 -1
  249. egse/icons/front-desk.svg +0 -1
  250. egse/icons/home-actioned.svg +0 -15
  251. egse/icons/home-disabled.svg +0 -15
  252. egse/icons/home.svg +0 -13
  253. egse/icons/info.svg +0 -1
  254. egse/icons/invalid.png +0 -0
  255. egse/icons/led-green.svg +0 -20
  256. egse/icons/led-grey.svg +0 -20
  257. egse/icons/led-orange.svg +0 -20
  258. egse/icons/led-red.svg +0 -20
  259. egse/icons/led-square-green.svg +0 -134
  260. egse/icons/led-square-grey.svg +0 -134
  261. egse/icons/led-square-orange.svg +0 -134
  262. egse/icons/led-square-red.svg +0 -134
  263. egse/icons/limit-switch-all-green.svg +0 -115
  264. egse/icons/limit-switch-all-red.svg +0 -117
  265. egse/icons/limit-switch-el+.svg +0 -116
  266. egse/icons/limit-switch-el-.svg +0 -117
  267. egse/icons/location-marker.svg +0 -1
  268. egse/icons/logo-dpu.svg +0 -48
  269. egse/icons/logo-gimbal.svg +0 -112
  270. egse/icons/logo-huber.svg +0 -23
  271. egse/icons/logo-ogse.svg +0 -31
  272. egse/icons/logo-puna.svg +0 -92
  273. egse/icons/logo-tcs.svg +0 -29
  274. egse/icons/logo-zonda.svg +0 -66
  275. egse/icons/maximize.svg +0 -1
  276. egse/icons/meter.svg +0 -1
  277. egse/icons/more.svg +0 -45
  278. egse/icons/n-fee-hk-start.svg +0 -24
  279. egse/icons/n-fee-hk-stop.svg +0 -25
  280. egse/icons/n-fee-hk.svg +0 -83
  281. egse/icons/observing-off.svg +0 -46
  282. egse/icons/observing-on.svg +0 -46
  283. egse/icons/open-document-hdf5.png +0 -0
  284. egse/icons/open-document-hdf5.svg +0 -21
  285. egse/icons/ops-mode.svg +0 -1
  286. egse/icons/play-green.svg +0 -17
  287. egse/icons/plugged-disabled.svg +0 -27
  288. egse/icons/plugged.svg +0 -21
  289. egse/icons/pm_ui.svg +0 -1
  290. egse/icons/power-button-green.svg +0 -27
  291. egse/icons/power-button-red.svg +0 -27
  292. egse/icons/power-button.svg +0 -27
  293. egse/icons/radar.svg +0 -1
  294. egse/icons/radioactive.svg +0 -2
  295. egse/icons/reload.svg +0 -1
  296. egse/icons/remote-control-off.svg +0 -28
  297. egse/icons/remote-control-on.svg +0 -28
  298. egse/icons/repeat-blue.svg +0 -15
  299. egse/icons/repeat.svg +0 -1
  300. egse/icons/settings.svg +0 -1
  301. egse/icons/shrink.svg +0 -1
  302. egse/icons/shutter.svg +0 -1
  303. egse/icons/sign-off.svg +0 -1
  304. egse/icons/sign-on.svg +0 -1
  305. egse/icons/sim-mode.svg +0 -1
  306. egse/icons/small-buttons-go.svg +0 -20
  307. egse/icons/small-buttons-minus.svg +0 -51
  308. egse/icons/small-buttons-plus.svg +0 -51
  309. egse/icons/sponge.svg +0 -220
  310. egse/icons/start-button-disabled.svg +0 -84
  311. egse/icons/start-button.svg +0 -50
  312. egse/icons/stop-button-disabled.svg +0 -84
  313. egse/icons/stop-button.svg +0 -50
  314. egse/icons/stop-red.svg +0 -17
  315. egse/icons/stop.svg +0 -1
  316. egse/icons/switch-disabled-square.svg +0 -87
  317. egse/icons/switch-disabled.svg +0 -15
  318. egse/icons/switch-off-square.svg +0 -87
  319. egse/icons/switch-off.svg +0 -72
  320. egse/icons/switch-on-square.svg +0 -87
  321. egse/icons/switch-on.svg +0 -61
  322. egse/icons/temperature-control.svg +0 -44
  323. egse/icons/th_ui_logo.svg +0 -1
  324. egse/icons/unplugged.svg +0 -23
  325. egse/icons/unvalid.png +0 -0
  326. egse/icons/user-interface.svg +0 -1
  327. egse/icons/vacuum.svg +0 -1
  328. egse/icons/valid.png +0 -0
  329. egse/icons/zoom-to-pixel-dark.svg +0 -64
  330. egse/icons/zoom-to-pixel-white.svg +0 -36
  331. egse/images/big-rotation-stage.png +0 -0
  332. egse/images/connected-100.png +0 -0
  333. egse/images/cross.svg +0 -6
  334. egse/images/disconnected-100.png +0 -0
  335. egse/images/gui-icon.png +0 -0
  336. egse/images/home.svg +0 -6
  337. egse/images/info-icon.png +0 -0
  338. egse/images/led-black.svg +0 -89
  339. egse/images/led-green.svg +0 -85
  340. egse/images/led-orange.svg +0 -85
  341. egse/images/led-red.svg +0 -85
  342. egse/images/load-icon.png +0 -0
  343. egse/images/load-setup.png +0 -0
  344. egse/images/load.png +0 -0
  345. egse/images/pause.png +0 -0
  346. egse/images/play-button.svg +0 -8
  347. egse/images/play.png +0 -0
  348. egse/images/process-status.png +0 -0
  349. egse/images/restart.png +0 -0
  350. egse/images/search.png +0 -0
  351. egse/images/sma.png +0 -0
  352. egse/images/start.png +0 -0
  353. egse/images/stop-button.svg +0 -8
  354. egse/images/stop.png +0 -0
  355. egse/images/switch-off.svg +0 -48
  356. egse/images/switch-on.svg +0 -48
  357. egse/images/undo.png +0 -0
  358. egse/images/update-button.svg +0 -11
  359. egse/imageviewer/exposureselection.py +0 -475
  360. egse/imageviewer/imageviewer.py +0 -198
  361. egse/imageviewer/matchfocalplane.py +0 -179
  362. egse/imageviewer/subfieldposition.py +0 -133
  363. egse/lampcontrol/__init__.py +0 -4
  364. egse/lampcontrol/beaglebone/beaglebone.py +0 -178
  365. egse/lampcontrol/beaglebone/beaglebone.yaml +0 -62
  366. egse/lampcontrol/beaglebone/beaglebone_cs.py +0 -106
  367. egse/lampcontrol/beaglebone/beaglebone_devif.py +0 -150
  368. egse/lampcontrol/beaglebone/beaglebone_protocol.py +0 -73
  369. egse/lampcontrol/energetiq/__init__.py +0 -22
  370. egse/lampcontrol/energetiq/eq99.yaml +0 -98
  371. egse/lampcontrol/energetiq/lampEQ99.py +0 -283
  372. egse/lampcontrol/energetiq/lampEQ99_cs.py +0 -128
  373. egse/lampcontrol/energetiq/lampEQ99_devif.py +0 -158
  374. egse/lampcontrol/energetiq/lampEQ99_encode_decode_errors.py +0 -73
  375. egse/lampcontrol/energetiq/lampEQ99_protocol.py +0 -69
  376. egse/lampcontrol/energetiq/lampEQ99_ui.py +0 -465
  377. egse/lib/CentOS-7/EtherSpaceLink_v34_86.dylib +0 -0
  378. egse/lib/CentOS-8/ESL-RMAP_v34_86.dylib +0 -0
  379. egse/lib/CentOS-8/EtherSpaceLink_v34_86.dylib +0 -0
  380. egse/lib/Debian/ESL-RMAP_v34_86.dylib +0 -0
  381. egse/lib/Debian/EtherSpaceLink_v34_86.dylib +0 -0
  382. egse/lib/Debian/libetherspacelink_v35_21.dylib +0 -0
  383. egse/lib/Linux/ESL-RMAP_v34_86.dylib +0 -0
  384. egse/lib/Linux/EtherSpaceLink_v34_86.dylib +0 -0
  385. egse/lib/Ubuntu-20/ESL-RMAP_v34_86.dylib +0 -0
  386. egse/lib/Ubuntu-20/EtherSpaceLink_v34_86.dylib +0 -0
  387. egse/lib/gssw/python3-gssw_2.2.3+31f63c9f-1_all.deb +0 -0
  388. egse/lib/macOS/ESL-RMAP_v34_86.dylib +0 -0
  389. egse/lib/macOS/EtherSpaceLink_v34_86.dylib +0 -0
  390. egse/lib/ximc/__pycache__/pyximc.cpython-38 2.pyc +0 -0
  391. egse/lib/ximc/__pycache__/pyximc.cpython-38.pyc +0 -0
  392. egse/lib/ximc/libximc.framework/Frameworks/libbindy.dylib +0 -0
  393. egse/lib/ximc/libximc.framework/Frameworks/libxiwrapper.dylib +0 -0
  394. egse/lib/ximc/libximc.framework/Headers/ximc.h +0 -5510
  395. egse/lib/ximc/libximc.framework/Resources/Info.plist +0 -42
  396. egse/lib/ximc/libximc.framework/Resources/keyfile.sqlite +0 -0
  397. egse/lib/ximc/libximc.framework/libbindy.so +0 -0
  398. egse/lib/ximc/libximc.framework/libximc +0 -0
  399. egse/lib/ximc/libximc.framework/libximc.so +0 -0
  400. egse/lib/ximc/libximc.framework/libximc.so.7.0.0 +0 -0
  401. egse/lib/ximc/libximc.framework/libxiwrapper.so +0 -0
  402. egse/lib/ximc/pyximc.py +0 -922
  403. egse/listener.py +0 -73
  404. egse/logger/__init__.py +0 -243
  405. egse/logger/log_cs.py +0 -321
  406. egse/metrics.py +0 -98
  407. egse/mixin.py +0 -464
  408. egse/monitoring.py +0 -95
  409. egse/ni/alarms/__init__.py +0 -26
  410. egse/ni/alarms/cdaq9375.py +0 -300
  411. egse/ni/alarms/cdaq9375.yaml +0 -89
  412. egse/ni/alarms/cdaq9375_cs.py +0 -130
  413. egse/ni/alarms/cdaq9375_devif.py +0 -183
  414. egse/ni/alarms/cdaq9375_protocol.py +0 -48
  415. egse/obs_inspection.py +0 -163
  416. egse/observer.py +0 -41
  417. egse/obsid.py +0 -163
  418. egse/powermeter/__init__.py +0 -0
  419. egse/powermeter/ni/__init__.py +0 -38
  420. egse/powermeter/ni/cdaq9184.py +0 -224
  421. egse/powermeter/ni/cdaq9184.yaml +0 -73
  422. egse/powermeter/ni/cdaq9184_cs.py +0 -130
  423. egse/powermeter/ni/cdaq9184_devif.py +0 -201
  424. egse/powermeter/ni/cdaq9184_protocol.py +0 -48
  425. egse/powermeter/ni/cdaq9184_ui.py +0 -544
  426. egse/powermeter/thorlabs/__init__.py +0 -25
  427. egse/powermeter/thorlabs/pm100a.py +0 -380
  428. egse/powermeter/thorlabs/pm100a.yaml +0 -132
  429. egse/powermeter/thorlabs/pm100a_cs.py +0 -136
  430. egse/powermeter/thorlabs/pm100a_devif.py +0 -127
  431. egse/powermeter/thorlabs/pm100a_protocol.py +0 -80
  432. egse/powermeter/thorlabs/pm100a_ui.py +0 -725
  433. egse/process.py +0 -451
  434. egse/procman/__init__.py +0 -811
  435. egse/procman/cannot_start_process_popup.py +0 -43
  436. egse/procman/procman.yaml +0 -49
  437. egse/procman/procman_cs.py +0 -201
  438. egse/procman/procman_ui.py +0 -2081
  439. egse/protocol.py +0 -603
  440. egse/proxy.py +0 -522
  441. egse/randomwalk.py +0 -140
  442. egse/reg.py +0 -585
  443. egse/reload.py +0 -122
  444. egse/reprocess.py +0 -675
  445. egse/resource.py +0 -333
  446. egse/rst.py +0 -135
  447. egse/search.py +0 -182
  448. egse/serialdevice.py +0 -190
  449. egse/services.py +0 -212
  450. egse/services.yaml +0 -51
  451. egse/settings.py +0 -379
  452. egse/settings.yaml +0 -980
  453. egse/setup.py +0 -1180
  454. egse/shutter/__init__.py +0 -0
  455. egse/shutter/thorlabs/__init__.py +0 -19
  456. egse/shutter/thorlabs/ksc101.py +0 -205
  457. egse/shutter/thorlabs/ksc101.yaml +0 -105
  458. egse/shutter/thorlabs/ksc101_cs.py +0 -136
  459. egse/shutter/thorlabs/ksc101_devif.py +0 -201
  460. egse/shutter/thorlabs/ksc101_protocol.py +0 -69
  461. egse/shutter/thorlabs/ksc101_ui.py +0 -548
  462. egse/shutter/thorlabs/sc10.py +0 -82
  463. egse/shutter/thorlabs/sc10.yaml +0 -52
  464. egse/shutter/thorlabs/sc10_controller.py +0 -81
  465. egse/shutter/thorlabs/sc10_cs.py +0 -108
  466. egse/shutter/thorlabs/sc10_interface.py +0 -25
  467. egse/shutter/thorlabs/sc10_simulator.py +0 -30
  468. egse/simulator.py +0 -41
  469. egse/slack.py +0 -61
  470. egse/socketdevice.py +0 -218
  471. egse/sockets.py +0 -218
  472. egse/spw.py +0 -1479
  473. egse/stages/__init__.py +0 -12
  474. egse/stages/aerotech/ensemble.py +0 -247
  475. egse/stages/aerotech/ensemble.yaml +0 -205
  476. egse/stages/aerotech/ensemble_controller.py +0 -275
  477. egse/stages/aerotech/ensemble_cs.py +0 -110
  478. egse/stages/aerotech/ensemble_interface.py +0 -132
  479. egse/stages/aerotech/ensemble_parameters.py +0 -433
  480. egse/stages/aerotech/ensemble_simulator.py +0 -27
  481. egse/stages/aerotech/mgse_sim.py +0 -193
  482. egse/stages/arun/smd3.py +0 -111
  483. egse/stages/arun/smd3.yaml +0 -68
  484. egse/stages/arun/smd3_controller.py +0 -472
  485. egse/stages/arun/smd3_cs.py +0 -112
  486. egse/stages/arun/smd3_interface.py +0 -53
  487. egse/stages/arun/smd3_simulator.py +0 -27
  488. egse/stages/arun/smd3_stop.py +0 -16
  489. egse/stages/huber/__init__.py +0 -49
  490. egse/stages/huber/smc9300.py +0 -904
  491. egse/stages/huber/smc9300.yaml +0 -63
  492. egse/stages/huber/smc9300_cs.py +0 -178
  493. egse/stages/huber/smc9300_devif.py +0 -345
  494. egse/stages/huber/smc9300_protocol.py +0 -111
  495. egse/stages/huber/smc9300_sim.py +0 -547
  496. egse/stages/huber/smc9300_ui.py +0 -973
  497. egse/state.py +0 -173
  498. egse/statemachine.py +0 -274
  499. egse/storage/__init__.py +0 -1004
  500. egse/storage/persistence.py +0 -2295
  501. egse/storage/storage.yaml +0 -72
  502. egse/storage/storage_cs.py +0 -214
  503. egse/styles/dark.qss +0 -343
  504. egse/styles/default.qss +0 -48
  505. egse/synoptics/__init__.py +0 -412
  506. egse/synoptics/syn.yaml +0 -9
  507. egse/synoptics/syn_cs.py +0 -195
  508. egse/system.py +0 -1408
  509. egse/tcs/__init__.py +0 -14
  510. egse/tcs/tcs.py +0 -874
  511. egse/tcs/tcs.yaml +0 -14
  512. egse/tcs/tcs_cs.py +0 -202
  513. egse/tcs/tcs_devif.py +0 -292
  514. egse/tcs/tcs_protocol.py +0 -177
  515. egse/tcs/tcs_sim.py +0 -177
  516. egse/tcs/tcs_ui.py +0 -543
  517. egse/tdms.py +0 -171
  518. egse/tempcontrol/__init__.py +0 -23
  519. egse/tempcontrol/agilent/agilent34970.py +0 -109
  520. egse/tempcontrol/agilent/agilent34970.yaml +0 -44
  521. egse/tempcontrol/agilent/agilent34970_cs.py +0 -116
  522. egse/tempcontrol/agilent/agilent34970_devif.py +0 -182
  523. egse/tempcontrol/agilent/agilent34970_protocol.py +0 -99
  524. egse/tempcontrol/agilent/agilent34972.py +0 -111
  525. egse/tempcontrol/agilent/agilent34972.yaml +0 -44
  526. egse/tempcontrol/agilent/agilent34972_cs.py +0 -117
  527. egse/tempcontrol/agilent/agilent34972_devif.py +0 -189
  528. egse/tempcontrol/agilent/agilent34972_protocol.py +0 -101
  529. egse/tempcontrol/beaglebone/beaglebone.py +0 -342
  530. egse/tempcontrol/beaglebone/beaglebone.yaml +0 -110
  531. egse/tempcontrol/beaglebone/beaglebone_cs.py +0 -117
  532. egse/tempcontrol/beaglebone/beaglebone_protocol.py +0 -135
  533. egse/tempcontrol/beaglebone/beaglebone_ui.py +0 -681
  534. egse/tempcontrol/digalox/digalox.py +0 -107
  535. egse/tempcontrol/digalox/digalox.yaml +0 -36
  536. egse/tempcontrol/digalox/digalox_cs.py +0 -112
  537. egse/tempcontrol/digalox/digalox_protocol.py +0 -55
  538. egse/tempcontrol/keithley/__init__.py +0 -33
  539. egse/tempcontrol/keithley/daq6510.py +0 -662
  540. egse/tempcontrol/keithley/daq6510.yaml +0 -105
  541. egse/tempcontrol/keithley/daq6510_cs.py +0 -163
  542. egse/tempcontrol/keithley/daq6510_devif.py +0 -343
  543. egse/tempcontrol/keithley/daq6510_protocol.py +0 -78
  544. egse/tempcontrol/keithley/daq6510_sim.py +0 -186
  545. egse/tempcontrol/lakeshore/__init__.py +0 -33
  546. egse/tempcontrol/lakeshore/lsci.py +0 -361
  547. egse/tempcontrol/lakeshore/lsci.yaml +0 -162
  548. egse/tempcontrol/lakeshore/lsci_cs.py +0 -174
  549. egse/tempcontrol/lakeshore/lsci_devif.py +0 -292
  550. egse/tempcontrol/lakeshore/lsci_protocol.py +0 -73
  551. egse/tempcontrol/lakeshore/lsci_ui.py +0 -389
  552. egse/tempcontrol/ni/__init__.py +0 -0
  553. egse/tempcontrol/spid/spid.py +0 -109
  554. egse/tempcontrol/spid/spid.yaml +0 -81
  555. egse/tempcontrol/spid/spid_controller.py +0 -279
  556. egse/tempcontrol/spid/spid_cs.py +0 -136
  557. egse/tempcontrol/spid/spid_protocol.py +0 -107
  558. egse/tempcontrol/spid/spid_ui.py +0 -727
  559. egse/tempcontrol/srs/__init__.py +0 -22
  560. egse/tempcontrol/srs/ptc10.py +0 -875
  561. egse/tempcontrol/srs/ptc10.yaml +0 -227
  562. egse/tempcontrol/srs/ptc10_cs.py +0 -128
  563. egse/tempcontrol/srs/ptc10_devif.py +0 -118
  564. egse/tempcontrol/srs/ptc10_protocol.py +0 -42
  565. egse/tempcontrol/srs/ptc10_ui.py +0 -906
  566. egse/ups/apc/apc.py +0 -236
  567. egse/ups/apc/apc.yaml +0 -45
  568. egse/ups/apc/apc_cs.py +0 -101
  569. egse/ups/apc/apc_protocol.py +0 -125
  570. egse/user.yaml +0 -7
  571. egse/vacuum/beaglebone/beaglebone.py +0 -149
  572. egse/vacuum/beaglebone/beaglebone.yaml +0 -44
  573. egse/vacuum/beaglebone/beaglebone_cs.py +0 -108
  574. egse/vacuum/beaglebone/beaglebone_devif.py +0 -164
  575. egse/vacuum/beaglebone/beaglebone_protocol.py +0 -193
  576. egse/vacuum/beaglebone/beaglebone_ui.py +0 -638
  577. egse/vacuum/instrutech/igm402.py +0 -92
  578. egse/vacuum/instrutech/igm402.yaml +0 -90
  579. egse/vacuum/instrutech/igm402_controller.py +0 -128
  580. egse/vacuum/instrutech/igm402_cs.py +0 -108
  581. egse/vacuum/instrutech/igm402_interface.py +0 -49
  582. egse/vacuum/instrutech/igm402_simulator.py +0 -36
  583. egse/vacuum/keller/kellerBus.py +0 -256
  584. egse/vacuum/keller/leo3.py +0 -102
  585. egse/vacuum/keller/leo3.yaml +0 -38
  586. egse/vacuum/keller/leo3_controller.py +0 -83
  587. egse/vacuum/keller/leo3_cs.py +0 -101
  588. egse/vacuum/keller/leo3_interface.py +0 -33
  589. egse/vacuum/mks/evision.py +0 -86
  590. egse/vacuum/mks/evision.yaml +0 -75
  591. egse/vacuum/mks/evision_cs.py +0 -101
  592. egse/vacuum/mks/evision_devif.py +0 -316
  593. egse/vacuum/mks/evision_interface.py +0 -60
  594. egse/vacuum/mks/evision_simulator.py +0 -24
  595. egse/vacuum/mks/evision_ui.py +0 -704
  596. egse/vacuum/pfeiffer/acp40.py +0 -87
  597. egse/vacuum/pfeiffer/acp40.yaml +0 -60
  598. egse/vacuum/pfeiffer/acp40_controller.py +0 -117
  599. egse/vacuum/pfeiffer/acp40_cs.py +0 -109
  600. egse/vacuum/pfeiffer/acp40_interface.py +0 -40
  601. egse/vacuum/pfeiffer/acp40_simulator.py +0 -39
  602. egse/vacuum/pfeiffer/tc400.py +0 -113
  603. egse/vacuum/pfeiffer/tc400.yaml +0 -83
  604. egse/vacuum/pfeiffer/tc400_controller.py +0 -140
  605. egse/vacuum/pfeiffer/tc400_cs.py +0 -109
  606. egse/vacuum/pfeiffer/tc400_interface.py +0 -70
  607. egse/vacuum/pfeiffer/tc400_simulator.py +0 -24
  608. egse/vacuum/pfeiffer/tpg261.py +0 -81
  609. egse/vacuum/pfeiffer/tpg261.yaml +0 -66
  610. egse/vacuum/pfeiffer/tpg261_controller.py +0 -150
  611. egse/vacuum/pfeiffer/tpg261_cs.py +0 -109
  612. egse/vacuum/pfeiffer/tpg261_interface.py +0 -60
  613. egse/vacuum/pfeiffer/tpg261_simulator.py +0 -24
  614. egse/version.py +0 -174
  615. egse/visitedpositions.py +0 -398
  616. egse/windowing.py +0 -213
  617. egse/zmq/__init__.py +0 -28
  618. egse/zmq/spw.py +0 -160
  619. egse/zmq_ser.py +0 -41
  620. scripts/alerts/cold.yaml +0 -278
  621. scripts/alerts/example_alerts.yaml +0 -54
  622. scripts/alerts/transition.yaml +0 -14
  623. scripts/alerts/warm.yaml +0 -49
  624. scripts/analyse_n_fee_hk_data.py +0 -44
  625. scripts/check_hdf5_files.py +0 -192
  626. scripts/check_register_sync.py +0 -47
  627. scripts/create_hdf5_report.py +0 -295
  628. scripts/csl_model.py +0 -436
  629. scripts/csl_restore_setup.py +0 -230
  630. scripts/export-grafana-dashboards.py +0 -50
  631. scripts/fdir/cs_recovery/fdir_cs_recovery.py +0 -59
  632. scripts/fdir/fdir_table.yaml +0 -70
  633. scripts/fdir/fdir_test_recovery.py +0 -11
  634. scripts/fdir/hw_recovery/fdir_agilent_hw_recovery.py +0 -73
  635. scripts/fdir/limit_recovery/fdir_agilent_limit.py +0 -64
  636. scripts/fdir/limit_recovery/fdir_bb_heater_limit.py +0 -61
  637. scripts/fdir/limit_recovery/fdir_ensemble_limit.py +0 -33
  638. scripts/fdir/limit_recovery/fdir_pressure_limit_recovery.py +0 -71
  639. scripts/fix_csv.py +0 -80
  640. scripts/n_fee_supply_voltage_calculation.py +0 -92
  641. scripts/playground.py +0 -30
  642. scripts/print_hdf5_hk_data.py +0 -68
  643. scripts/print_register_map.py +0 -43
  644. scripts/sron/commanding/control_heaters.py +0 -44
  645. scripts/sron/commanding/pumpdown.py +0 -46
  646. scripts/sron/commanding/set_pid_setpoint.py +0 -19
  647. scripts/sron/commanding/shutdown_bbb_heaters.py +0 -10
  648. scripts/sron/commanding/shutdown_pumps.py +0 -33
  649. scripts/sron/tm_gen/tm_gen_agilent.py +0 -38
  650. scripts/sron/tm_gen/tm_gen_heaters.py +0 -4
  651. scripts/sron/tm_gen/tm_gen_spid.py +0 -13
  652. scripts/update_operational_cgse.py +0 -268
  653. scripts/update_operational_cgse_old.py +0 -273
egse/dsi/rmap.py DELETED
@@ -1,1042 +0,0 @@
1
- """
2
- This module provides Python wrapper functions to (most of) the library functions from the C library ESL-RMAP.c.
3
-
4
- We use one single Exception specific for these wrapper functions. An RMAPError is thrown whenever the C function
5
- returns an error from which we can not recover. This allows to cascade the python functions in a try: except: clause
6
- making the code much more readable.
7
-
8
- The C code depends heavily on a C structure which we had to re-define using the Structure class provided by ctypes.
9
-
10
- """
11
-
12
- import ctypes
13
- import logging
14
- import struct
15
- from contextlib import contextmanager
16
- from ctypes import POINTER
17
- from ctypes import Structure
18
- from ctypes import c_char_p
19
- from ctypes import c_int
20
- from ctypes import c_ubyte
21
- from ctypes import c_uint
22
- from ctypes import c_ulonglong
23
- from ctypes import c_void_p as c_int_p
24
- from ctypes import cdll
25
- from pathlib import Path
26
- from typing import Tuple
27
-
28
- import egse.dsi.constants as constants
29
- from egse.config import find_file
30
- from egse.dsi.constants import esl_rmap_error_codes
31
- from egse.dsi.esl import esl_flush
32
- from egse.dsi.esl import esl_get_product_string
33
- from egse.dsi.esl import esl_p
34
- from egse.dsi.esl import esl_read_packet
35
- from egse.dsi.esl import esl_write_packet
36
- from egse.dsi.esl import pretty_print_packet
37
- from egse.settings import Settings
38
- from egse.system import get_os_name
39
- from egse.system import get_os_version
40
-
41
- logger = logging.getLogger(__name__)
42
-
43
- dsi_settings = Settings.load("DSI")
44
-
45
- # Maintain a transmit and receive buffer
46
-
47
- rxbuf = ctypes.create_string_buffer(dsi_settings.RX_BUFFER_LENGTH)
48
- txbuf = ctypes.create_string_buffer(dsi_settings.TX_BUFFER_LENGTH)
49
-
50
- # Initialize the status variable which is a c pointer that is set by the library routines to
51
- # pass a status.
52
-
53
- status = c_int(0)
54
- status_p = ctypes.pointer(status)
55
-
56
- # NOTE: These memory areas are currently equal for N-FEE and F-FEE. Don't know if this will
57
- # change in the future.
58
-
59
- CRITICAL_AREA_START = 0x0000_0000
60
- CRITICAL_AREA_END = 0x0000_00FC
61
- GENERAL_AREA_START = 0x0000_0100
62
- GENERAL_AREA_END = 0x0000_06FC
63
- HK_AREA_START = 0x0000_0700
64
- HK_AREA_END = 0x0000_07FC
65
- WINDOWING_AREA_START = 0x0080_0000
66
- WINDOWING_AREA_END = 0x00FF_FFFC
67
-
68
-
69
- class ESL_RMAP(Structure):
70
- _fields_ = [
71
- ("spw_device", esl_p),
72
- ("target_key", c_ubyte),
73
- ("target_logical_address", c_ubyte),
74
- ("target_spw_address", c_ubyte * 12),
75
- ("target_spw_address_len", c_int),
76
- ("reply_spw_address", c_ubyte * 12),
77
- ("reply_spw_address_len", c_int),
78
- ("initiator_logical_address", c_ubyte),
79
- ("transaction_identifier", c_uint),
80
- ("ESL_RMAP_error", c_int)
81
- ]
82
-
83
-
84
- rmap_p = POINTER(ESL_RMAP)
85
-
86
-
87
- class RMAPError(Exception):
88
- pass
89
-
90
-
91
- # Depending on the OS, and the OS version, we load the dynamic library from a specific location
92
- # Only some OS/OS-version combinations are supported.
93
-
94
- if get_os_name() == 'macos':
95
- in_dir = 'lib/macOS'
96
- elif get_os_name() == 'debian':
97
- in_dir = 'lib/Debian'
98
- elif get_os_name() == 'centos':
99
- in_dir = 'lib/CentOS-7' if get_os_version().startswith('7') else 'lib/CentOS-8'
100
- elif get_os_name() == 'ubuntu':
101
- in_dir = 'lib/Ubuntu-20' if get_os_version().startswith('20') else 'lib/Linux'
102
- else:
103
- in_dir = None
104
-
105
- dylib_filename = Path(dsi_settings.RMAP_DYLIB_FILENAME)
106
-
107
- logger.debug(f"Locating shared library {dylib_filename} in dir '{in_dir}'")
108
-
109
- dylib_filename = find_file(dylib_filename, in_dir=in_dir)
110
-
111
- logger.debug(f"Loading shared library: {dylib_filename}")
112
-
113
- if not dylib_filename:
114
- raise FileNotFoundError(f"Could not find dynamic library: {dylib_filename}")
115
-
116
- librmap = cdll.LoadLibrary(dylib_filename)
117
-
118
- # Mapping of functions.
119
- # Please note that when there is no need to wrap the C library function, we do not take the burden
120
-
121
- librmap_open = librmap.ESL_RMAP_open
122
- librmap_open.argtypes = [esl_p]
123
- librmap_open.restype = rmap_p
124
-
125
- librmap_set_verbosity = librmap.ESL_RMAP_set_verbosity
126
- librmap_set_verbosity.argtypes = [c_int]
127
-
128
- librmap_get_target_key = librmap.ESL_RMAP_get_target_key
129
- librmap_get_target_key.argtypes = [rmap_p]
130
- librmap_get_target_key.restype = c_ubyte
131
-
132
- librmap_set_target_key = librmap.ESL_RMAP_set_target_key
133
- librmap_set_target_key.argtypes = [rmap_p, c_ubyte]
134
-
135
- librmap_get_target_logical_address = librmap.ESL_RMAP_get_target_logical_address
136
- librmap_get_target_logical_address.argtypes = [rmap_p]
137
- librmap_get_target_logical_address.restype = c_ubyte
138
-
139
- librmap_set_target_logical_address = librmap.ESL_RMAP_set_target_logical_address
140
- librmap_set_target_logical_address.argtypes = [rmap_p, c_ubyte]
141
-
142
- librmap_set_target_spw_address = librmap.ESL_RMAP_set_target_spw_address
143
- librmap_set_target_spw_address.argtypes = [rmap_p, c_char_p, c_int]
144
-
145
- librmap_get_initiator_logical_address = librmap.ESL_RMAP_get_initiator_logical_address
146
- librmap_get_initiator_logical_address.argtypes = [rmap_p]
147
- librmap_get_initiator_logical_address.restype = c_ubyte
148
-
149
- librmap_set_initiator_logical_address = librmap.ESL_RMAP_set_initiator_logical_address
150
- librmap_set_initiator_logical_address.argtypes = [rmap_p, c_ubyte]
151
-
152
- librmap_crc_check = librmap.RMAP_crc_check
153
- librmap_crc_check.argtypes = [c_char_p, c_uint, c_uint]
154
- librmap_crc_check.restype = c_uint
155
-
156
- librmap_read = librmap.ESL_RMAP_read
157
- librmap_read.argtypes = [rmap_p, c_ulonglong, c_char_p, c_uint, c_int_p]
158
- librmap_read.restype = c_int
159
-
160
- librmap_read_TO = librmap.ESL_RMAP_read_TO
161
- librmap_read_TO.argtypes = [rmap_p, c_ulonglong, c_char_p, c_uint, c_int_p, c_int]
162
- librmap_read_TO.restype = c_int
163
-
164
- librmap_write = librmap.ESL_RMAP_write
165
- librmap_write.argtypes = [rmap_p, c_ulonglong, c_char_p, c_uint, c_int_p]
166
- librmap_write.restype = c_int
167
-
168
-
169
- @contextmanager
170
- def rmap_connection(esl_link):
171
- """
172
- Context manager that opens an RMAP connection on the EtherSpaceLink ESL.
173
-
174
- Args:
175
- esl_link (ESL): the ESL structure that defines the connection to the DSI
176
-
177
- Returns:
178
- an RMAP link connection
179
- """
180
- yield rmap_open_connection(esl_link)
181
-
182
-
183
- def rmap_open_connection(esl_link):
184
-
185
- logger.info(f"Open and setup RMAP connection to {esl_get_product_string(esl_link)}")
186
-
187
- rmap_link = librmap_open(esl_link)
188
- if not rmap_link:
189
- raise RMAPError(f"Couldn't open RMAP connection to {esl_get_product_string(esl_link)}")
190
-
191
- rmap_set_verbosity(1) # 1=normal; 5 or 15 for lots of debugging
192
-
193
- logger.info("RMAP connection opened successfully.")
194
-
195
- return rmap_link
196
-
197
-
198
- def rmap_configure(rmap_link: ESL_RMAP, initiator_logical_address,
199
- target_key=constants.RMAP_TARGET_KEY,
200
- target_logical_address=constants.RMAP_TARGET_LOGICAL_ADDRESS_DEFAULT):
201
- """
202
- Configure the RMAP EtherSpaceWire link.
203
-
204
- Args:
205
- rmap_link: the RMAP link connection
206
- initiator_logical_address: logical address of the SpaceWire node that starts the transaction
207
- target_key: the key field used for command authorisation
208
- target_logical_address: logical address of the target node (default: 0xFE)
209
-
210
- Returns:
211
- Nothing
212
-
213
- """
214
- rmap_set_initiator_logical_address(rmap_link, initiator_logical_address)
215
- rmap_set_target_key(rmap_link, target_key)
216
- rmap_set_target_logical_address(rmap_link, target_logical_address)
217
- rmap_set_target_spw_address(rmap_link, b'\x00', 0)
218
-
219
-
220
- # FIXME: Is this code rmap_read() still needed? We now have rmap_read_request()
221
- # which handles everything this code does, except it doesn't use the ESL_RMAP
222
- # dynamic library!
223
-
224
- def rmap_read(rmap_link: ESL_RMAP, address: int, length: int, timeout: int = 1000):
225
- """
226
- Read `length` bytes from the remote memory starting at `address`. If there is no reply
227
- after the given `timeout`, TODO: WHAT WILL HAPPEN THEN?
228
-
229
- .. note:: We are using the global ``rxbuf`` read buffer here.
230
- The content of the buffer will be overwritten by the RMAP read request.
231
-
232
- Args:
233
- rmap_link: the RMAP link connection
234
- address: the start address (32-bit aligned) in the remote memory
235
- length: the number of bytes to read from the remote memory
236
- timeout: timeout in milli-seconds
237
-
238
- Returns:
239
- the buffer containing the data read from the remote memory.
240
-
241
- """
242
-
243
- data_length = librmap_read_TO(rmap_link, address, rxbuf, length, status_p, timeout)
244
-
245
- # If data_length < 0 it can have the following values:
246
- # -1 = status was != 0 indicating a read error, the packet was eaten...discarded?
247
- # -4 = wrong TLA field in header
248
- # -5 = wrong TID field in header
249
-
250
- # FIXME: Think about if we should raise an RMAPError here instead of returning None when result is negative.
251
- # I would go for an Exception, since we loose the information on the error anyway as code information (
252
- # None is returned, not data_length), and now the caller must check the return code from this read command.
253
-
254
- if data_length < 0:
255
- logger.warning(
256
- f"Couldn't read data within timeout of {timeout} ms, "
257
- f"ESL RMAP Error Code = {esl_rmap_error_codes[rmap_link.contents.ESL_RMAP_error]} "
258
- f"[{rmap_link.contents.ESL_RMAP_error}]"
259
- )
260
- return None
261
- else:
262
- return rxbuf[:data_length]
263
-
264
-
265
- def rmap_read_request(rmap_link: ESL_RMAP, address: int, length: int, timeout: int = 1000) -> Tuple[int, bytes]:
266
- """
267
- Read `length` bytes from the remote memory starting at `address`.
268
-
269
- .. todo:: the timeout parameter is currently not implemented
270
-
271
- Args:
272
- rmap_link: the RMAP link connection
273
- address: the start address (32-bit aligned) in the remote memory
274
- length: the number of bytes to read from the remote memory
275
- timeout: timeout in milli-seconds
276
-
277
- Returns:
278
- A tuple containing the terminator value and the RMAP Reply packet with the data read from the remote memory.
279
-
280
- """
281
- buffer = create_rmap_read_request_packet(rmap_link, address, length)
282
-
283
- logger.log(5, "Pretty Print Read Request Packet:\n" + pretty_print_packet(buffer))
284
-
285
- result = esl_write_packet(rmap_link.contents.spw_device, buffer, len(buffer), constants.ESL_EOP)
286
- if result:
287
- raise RMAPError(
288
- f"Couldn't send data within timeout of {timeout} ms, "
289
- f"ESL RMAP Error Code = {esl_rmap_error_codes[rmap_link.contents.ESL_RMAP_error]} ["
290
- f"{rmap_link.contents.ESL_RMAP_error}]")
291
-
292
- result = esl_flush(rmap_link.contents.spw_device)
293
- if result:
294
- raise RMAPError(
295
- f"Couldn't send data or clear buffers, "
296
- f"ESL RMAP Error Code = {esl_rmap_error_codes[rmap_link.contents.ESL_RMAP_error]} ["
297
- f"{rmap_link.contents.ESL_RMAP_error}]")
298
-
299
- # Read the read request reply
300
-
301
- terminator, rx_buffer = esl_read_packet(rmap_link.contents.spw_device)
302
-
303
- logger.log(5, "Pretty Print Read Request Reply Packet:\n" + pretty_print_packet(rx_buffer))
304
-
305
- return terminator, rx_buffer
306
-
307
-
308
- def rmap_write_request(rmap_link: ESL_RMAP,
309
- address: int, data: bytes, length: int = 4, timeout: int = 1000) -> Tuple[int, bytes]:
310
- """
311
- Sends an RMAP write command over the SpaceWire link.
312
-
313
- Based on the address this function will decided to send a verified or unverified write request.
314
-
315
- .. todo:: the timeout parameter is currently not implemented
316
-
317
- Args:
318
- rmap_link (ESL_RMAP): the RMAP link connection
319
- address: the starting memory address to which the data from buffer will be written
320
- data: the data that will be written into the targets memory
321
- length: the number of bytes to write (the buffer maybe longer) [default=4]
322
- timeout: timeout in milliseconds [default=1000]
323
-
324
- Returns:
325
- return_code: zero (0) on success.
326
-
327
- Raises:
328
- RMAPError: when data can not be written on the target.
329
-
330
- """
331
-
332
- if CRITICAL_AREA_START <= address <= CRITICAL_AREA_END:
333
- buffer = create_rmap_verified_write_packet(rmap_link, address, data)
334
- else:
335
- buffer = create_rmap_unverified_write_packet(rmap_link, address, data, length)
336
-
337
- logger.log(5, "Pretty Print Write Request Packet:\n" + pretty_print_packet(buffer))
338
-
339
- result = esl_write_packet(rmap_link.contents.spw_device, buffer, len(buffer), constants.ESL_EOP)
340
- if result:
341
- raise RMAPError(
342
- f"Couldn't send data within timeout of {timeout} ms, "
343
- f"ESL RMAP Error Code = {esl_rmap_error_codes[rmap_link.contents.ESL_RMAP_error]} ["
344
- f"{rmap_link.contents.ESL_RMAP_error}]")
345
-
346
- result = esl_flush(rmap_link.contents.spw_device)
347
- if result:
348
- raise RMAPError(
349
- f"Couldn't send data or clear buffers, "
350
- f"ESL RMAP Error Code = {esl_rmap_error_codes[rmap_link.contents.ESL_RMAP_error]} ["
351
- f"{rmap_link.contents.ESL_RMAP_error}]")
352
-
353
- # Read the write reply
354
-
355
- terminator, rx_buffer = esl_read_packet(rmap_link.contents.spw_device)
356
-
357
- logger.log(5, "Pretty Print Write Request Reply Packet:\n" + pretty_print_packet(rx_buffer))
358
-
359
- return terminator, rx_buffer
360
-
361
-
362
- def create_rmap_read_request_packet(rmap_link: ESL_RMAP, address: int, length: int) -> ctypes.Array:
363
- """
364
- Creates an RMAP Read Request SpaceWire packet.
365
-
366
- The read request is an RMAP command that read a number of bytes from the FEE register memory.
367
-
368
- The function returns a ``ctypes`` character array (which is basically a bytes array) that
369
- can be passed into the EtherSpaceLink library function ``esl_write_packet()``.
370
-
371
- Address shall be within the 0x0000_0000 and 0x00FF_FFFC. The memory map (register) is divided
372
- in the following areas:
373
-
374
- 0x0000_0000 - 0x0000_00FC Critical Configuration Area (verified write)
375
- 0x0000_0100 - 0x0000_06FC General Configuration Area (unverified write)
376
- 0x0000_0700 - 0x0000_07FC Housekeeping area
377
- 0x0000_0800 - 0x007F_FFFC Not Supported
378
- 0x0080_0000 - 0x00FF_FFFC Windowing Area (unverified write)
379
- 0x0010_0000 - 0xFFFF_FFFC Not Supported
380
-
381
- All read requests to the critical area shall have a fixed data length of 4 bytes.
382
- All read requests to a general area shall have a maximum data length of 256 bytes.
383
- All read requests to the housekeeping area shall have a maximum data length of 256 bytes.
384
- All read requests to the windowing area shall have a maximum data length of 4096 bytes.
385
-
386
- Args:
387
- rmap_link (ESL_RMAP): the RMAP link connection
388
- address (int): the FEE register memory address
389
- length (int): the data length
390
-
391
- Returns:
392
- a bytes array containing the full RMAP Read Request packet.
393
- """
394
-
395
- check_address_and_data_length(address, length)
396
-
397
- buf = ctypes.create_string_buffer(16)
398
-
399
- # The transaction identifier shall be incremented for each read request
400
-
401
- tid = update_transaction_identifier(rmap_link)
402
-
403
- # NOTE: The first bytes would each carry the target SpW address or a destination port,
404
- # but this is not used for point-to-point connections, so we're safe.
405
-
406
- buf[0] = 0x51 # Target N-FEE or F-FEE
407
- buf[1] = 0x01 # RMAP Protocol ID
408
- buf[2] = 0x4C # Instruction: 0b1001100, RMAP Request, Read, Incrementing address, reply address = 0
409
- buf[3] = 0xD1 # Destination Key
410
- buf[4] = 0x50 # Initiator is always the DPU
411
- buf[5] = (tid >> 8) & 0xFF # MSB of the Transition ID
412
- buf[6] = tid & 0xFF # LSB of the Transition ID
413
- buf[7] = 0x00 # Extended address is not used
414
- buf[8] = (address >> 24) & 0xFF # address (MSB)
415
- buf[9] = (address >> 16) & 0xFF # address
416
- buf[10] = (address >> 8) & 0xFF # address
417
- buf[11] = address & 0xFF # address (LSB)
418
- buf[12] = (length >> 16) & 0xFF # data length (MSB)
419
- buf[13] = (length >> 8) & 0xFF # data length
420
- buf[14] = length & 0xFF # data length (LSB)
421
- buf[15] = rmap_crc_check(buf, 0, 15) & 0xFF
422
- return buf
423
-
424
-
425
- def create_rmap_write_reply_packet(rmap_link: ESL_RMAP) -> ctypes.Array:
426
- pass
427
-
428
-
429
- def create_rmap_read_reply_packet(rmap_link: ESL_RMAP, instruction_field: int, tid: int, status: int,
430
- buffer: bytes, buffer_length: int) -> ctypes.Array:
431
- """
432
- Creates an RMAP Reply to a RMAP Read Request packet.
433
-
434
- The function returns a ``ctypes`` character array (which is basically a bytes array) that
435
- can be passed into the EtherSpaceLink library function ``esl_write_packet()``.
436
-
437
- Args:
438
- rmap_link (ESL_RMAP): the RMAP link connection
439
- instruction_field (int): the instruction field of the RMAP read request packet
440
- tid (int): the transaction identifier of the read request packet
441
- status (int): shall be 0 if the read request was successful, contain an error code otherwise.
442
- TODO: which error code?
443
- buffer (bytes): the data that was read as indicated by the read request
444
- buffer_length (int): the data length
445
-
446
- Returns:
447
- packet: a ctypes Array containing the full RMAP Reply packet.
448
- """
449
-
450
- buf = ctypes.create_string_buffer(12 + buffer_length + 1)
451
-
452
- buf[0] = 0x50 # Initiator address N-DPU or F-DPU
453
- buf[1] = 0x01 # RMAP Protocol ID
454
- buf[2] = instruction_field & 0x3F # Clear the command bit as this is a reply
455
- buf[3] = status & 0xFF # Status field: 0 on success
456
- buf[4] = 0x51 # Target address is always the N-FEE or F-FEE
457
- buf[5] = (tid >> 8) & 0xFF # MSB of the Transition ID
458
- buf[6] = tid & 0xFF # LSB of the Transition ID
459
- buf[7] = 0x00 # Reserved
460
- buf[8] = (buffer_length >> 16) & 0xFF # data length (MSB)
461
- buf[9] = (buffer_length >> 8) & 0xFF # data length
462
- buf[10] = buffer_length & 0xFF # data length (LSB)
463
- buf[11] = rmap_crc_check(buf, 0, 11) & 0xFF # Header CRC
464
-
465
- # Note that we assume here that len(buffer) == buffer_length.
466
-
467
- if len(buffer) != buffer_length:
468
- logger.warning(
469
- f"While creating an RMAP read reply packet, the length of the buffer ({len(buffer)}) not equals "
470
- f"the buffer_length ({buffer_length})"
471
- )
472
-
473
- for idx, value in enumerate(buffer):
474
- buf[12+idx] = value
475
-
476
- buf[12 + buffer_length] = rmap_crc_check(buf, 12, 12 + buffer_length) & 0xFF # data CRC
477
-
478
- return buf
479
-
480
-
481
- def create_rmap_verified_write_packet(rmap_link: ESL_RMAP, address: int, data: bytes) -> ctypes.Array:
482
- """
483
- Create an RMAP packet for a verified write request on the FEE. The length of the data is by convention always 4
484
- bytes and therefore not passed as an argument.
485
-
486
- Args:
487
- rmap_link: the RMAP link structure
488
- address: the start memory address on the FEE register map
489
- data: the data to be written in the register map at address [4 bytes]
490
-
491
- Returns:
492
- packet: a bytes object containing the SpaceWire packet.
493
- """
494
-
495
- if len(data) < 4:
496
- raise ValueError(f"The data argument should be at least 4 bytes, but it is only {len(data)} bytes.")
497
-
498
- if address > CRITICAL_AREA_END:
499
- raise ValueError(f"The address range for critical configuration is [0x00 - 0xFC].")
500
-
501
- tid = update_transaction_identifier(rmap_link)
502
-
503
- # Buffer length is fixed at 24 bytes since the data length is fixed at 4 bytes (32 bit addressing)
504
-
505
- buf = ctypes.create_string_buffer(21)
506
- offset = 0
507
-
508
- # The values below are taken from the PLATO N-FEE to N-DPU Interface Requirements Document [PLATO-DLR-PL-ICD-0010]
509
-
510
- buf[offset+0] = 0x51 # Logical Address
511
- buf[offset+1] = 0x01 # Protocol ID
512
- buf[offset+2] = 0x7C # Instruction
513
- buf[offset+3] = 0xD1 # Key
514
- buf[offset+4] = 0x50 # Initiator Address
515
- buf[offset+5] = (tid >> 8) & 0xFF # MSB of the Transition ID
516
- buf[offset+6] = tid & 0xFF # LSB of the Transition ID
517
- buf[offset+7] = 0x00 # Extended address
518
- buf[offset+8] = (address >> 24) & 0xFF # address (MSB)
519
- buf[offset+9] = (address >> 16) & 0xFF # address
520
- buf[offset+10] = (address >> 8) & 0xFF # address
521
- buf[offset+11] = address & 0xFF # address (LSB)
522
- buf[offset+12] = 0x00 # data length (MSB)
523
- buf[offset+13] = 0x00 # data length
524
- buf[offset+14] = 0x04 # data length (LSB)
525
- buf[offset+15] = rmap_crc_check(buf, 0, 15) & 0xFF # header CRC
526
- buf[offset+16] = data[0]
527
- buf[offset+17] = data[1]
528
- buf[offset+18] = data[2]
529
- buf[offset+19] = data[3]
530
- buf[offset+20] = rmap_crc_check(buf, 16, 4) & 0xFF # data CRC
531
-
532
- return buf
533
-
534
-
535
- def create_rmap_unverified_write_packet(rmap_link: ESL_RMAP, address: int, data: bytes, length: int) -> ctypes.Array:
536
- """
537
- Create an RMAP packet for a unverified write request on the FEE.
538
-
539
- Args:
540
- rmap_link: the RMAP link structure
541
- address: the start memory address on the FEE register map
542
- data: the data to be written in the register map at address
543
- length: the length of the data
544
-
545
- Returns:
546
- packet: a bytes object containing the SpaceWire packet.
547
- """
548
-
549
- # We can only handle data for which the length >= the given length argument.
550
-
551
- if len(data) < length:
552
- raise ValueError(
553
- f"The length of the data argument ({len(data)}) is smaller than "
554
- f"the given length argument ({length})."
555
- )
556
-
557
- if len(data) > length:
558
- logger.warning(
559
- f"The length of the data argument ({len(data)}) is larger than "
560
- f"the given length argument ({length}). The data will be truncated "
561
- f"when copied into the packet."
562
- )
563
-
564
- if address <= CRITICAL_AREA_END:
565
- raise ValueError(f"The given address (0x{address:08X}) is in the range for critical configuration is [0x00 - "
566
- f"0xFC]. Use the verified write function for this.")
567
-
568
- tid = update_transaction_identifier(rmap_link)
569
-
570
- # Buffer length is fixed at 24 bytes since the data length is fixed at 4 bytes (32 bit addressing)
571
-
572
- buf = ctypes.create_string_buffer(16 + length + 1)
573
- offset = 0
574
-
575
- buf[offset+0] = 0x51 # Logical Address
576
- buf[offset+1] = 0x01 # Protocol ID
577
- buf[offset+2] = 0x6C # Instruction
578
- buf[offset+3] = 0xD1 # Key
579
- buf[offset+4] = 0x50 # Initiator Address
580
- buf[offset+5] = (tid >> 8) & 0xFF # MSB of the Transition ID
581
- buf[offset+6] = tid & 0xFF # LSB of the Transition ID
582
- buf[offset+7] = 0x00 # Extended address
583
- buf[offset+8] = (address >> 24) & 0xFF # address (MSB)
584
- buf[offset+9] = (address >> 16) & 0xFF # address
585
- buf[offset+10] = (address >> 8) & 0xFF # address
586
- buf[offset+11] = address & 0xFF # address (LSB)
587
- buf[offset+12] = (length >> 16) & 0xFF # data length (MSB)
588
- buf[offset+13] = (length >> 8) & 0xFF # data length
589
- buf[offset+14] = length & 0xFF # data length (LSB)
590
- buf[offset+15] = rmap_crc_check(buf, 0, 15) & 0xFF # header CRC
591
-
592
- offset = offset + 16
593
-
594
- for idx, value in enumerate(data):
595
- buf[offset+idx] = value
596
-
597
- buf[offset + length] = rmap_crc_check(buf, offset, length) & 0xFF # data CRC
598
-
599
- return buf
600
-
601
-
602
- def rmap_set_verbosity(flags):
603
- """
604
- Set vebosity of the RMAP API.
605
-
606
- Report errors by default:
607
-
608
- * bitval 1 : output textual error messages
609
- * bitval 2 : output SpaceWire read/write packet tracing
610
- * bitval 4 : output API function call tracing
611
- * bitval 8 : output API parameter / data packet tracing
612
- * bitval 16 : output API data packet tracing
613
-
614
- Args:
615
- flags (int): verbosy level
616
-
617
- Returns:
618
- None
619
-
620
- """
621
- librmap_set_verbosity(flags)
622
-
623
-
624
- def rmap_get_target_key(rmap_link):
625
- logger.debug("Calling rmap_get_target_key(rmap_link)")
626
- return librmap_get_target_key(rmap_link)
627
-
628
-
629
- def rmap_set_target_key(rmap_link, key):
630
- logger.debug(f"Calling rmap_set_target_key({key})")
631
- librmap_set_target_key(rmap_link, key)
632
-
633
-
634
- def rmap_get_target_logical_address(rmap_link):
635
- logger.debug("Calling rmap_get_target_logical_address(rmap_link)")
636
- return librmap_get_target_logical_address(rmap_link)
637
-
638
-
639
- def rmap_set_target_logical_address(rmap_link, address):
640
- logger.debug(f"Calling rmap_set_target_logical_address(rmap_link, 0x{address:02X})")
641
- librmap_set_target_logical_address(rmap_link, address)
642
-
643
-
644
- def rmap_set_target_spw_address(rmap_link, spw_address, spw_address_length):
645
- logger.debug(f"Calling rmap_set_target_spw_address(rmap_link, spw_address, {spw_address_length})")
646
- librmap_set_target_spw_address(rmap_link, spw_address, spw_address_length)
647
-
648
-
649
- def rmap_get_initiator_logical_address(rmap_link):
650
- # logger.debug("Calling rmap_get_initiator_logical_address(rmap_link)")
651
- return librmap_get_initiator_logical_address(rmap_link)
652
-
653
-
654
- def rmap_set_initiator_logical_address(rmap_link, address):
655
- # logger.debug(f"Calling rmap_set_initiator_logical_address(rmap_link, 0x{address:02X})")
656
- librmap_set_initiator_logical_address(rmap_link, address)
657
-
658
-
659
- def rmap_crc_check(data, start, length):
660
- # logger.debug(f"Calling rmap_crc_check(data, {start}, {length})")
661
- return librmap_crc_check(data, start, length)
662
-
663
-
664
- class CheckError(RMAPError):
665
- """
666
- Raised when a check fails and you want to pass a status values along with the message.
667
- """
668
-
669
- def __init__(self, message, status):
670
- self.message = message
671
- self.status = status
672
-
673
-
674
- def is_rmap(rx_buffer):
675
- return get_protocol_id(rx_buffer) == constants.RMAP_PROTOCOL_ID
676
-
677
-
678
- # Functions to interpret the Instrument Field
679
-
680
- def is_reserved(instruction):
681
- """The reserved bit of the 2-bit packet type field from the instruction field.
682
-
683
- For PLATO this bit shall be zero as the 0b10 and 0b11 packet field values are reserved.
684
-
685
- Returns:
686
- bit value: 1 or 0.
687
- """
688
- return (instruction & 0b10000000) >> 7
689
-
690
-
691
- def is_command(instruction):
692
- """Returns True if the RMAP packet is a command packet."""
693
- return (instruction & 0b01000000) >> 6
694
-
695
-
696
- def is_reply(instruction):
697
- """Returns True if the RMAP packet is a reply to a previous command packet."""
698
- return not is_command(instruction)
699
-
700
-
701
- def is_write(instruction):
702
- """Returns True if the RMAP packet is a write request command packet."""
703
- return (instruction & 0b00100000) >> 5
704
-
705
-
706
- def is_read(instruction):
707
- """Returns True if the RMAP packet is a read request command packet."""
708
- return not is_write(instruction)
709
-
710
-
711
- def is_verify(instruction):
712
- """Returns True if the RMAP packet needs to do a verify before write."""
713
- return (instruction & 0b00010000) >> 4
714
-
715
-
716
- def is_reply_required(instruction):
717
- """Returns True if the reply bit is set in the instruction field.
718
-
719
- Args:
720
- instruction (int): the instruction field of an RMAP packet
721
-
722
- .. note:: the name of this function might be confusing.
723
-
724
- This function does **not** test if the packet is a reply packet, but it checks
725
- if the command requests a reply from the target. If you need to test if the
726
- packet is a command or a reply, use the is_command() or is_reply() function.
727
-
728
- """
729
- return (instruction & 0b00001000) >> 3
730
-
731
-
732
- def is_increment(instruction):
733
- """Returns True if the data is written to sequential memory addresses."""
734
- return (instruction & 0b00000100) >> 2
735
-
736
-
737
- def reply_address_length(instruction):
738
- """Returns the content of the replay address length field.
739
-
740
- The size of the replay address field is then decoded from the following table:
741
-
742
- Address Field Length | Size of Address Field
743
- ----------------------+-----------------------
744
- 0b00 | 0 bytes
745
- 0b01 | 4 bytes
746
- 0b10 | 8 bytes
747
- 0b11 | 12 bytes
748
-
749
- """
750
- return (instruction & 0b00000011) << 2
751
-
752
- # Helper Functions ---------------------------------------------------------------------------------
753
-
754
-
755
- def get_protocol_id(rx_buffer):
756
- return rx_buffer[1]
757
-
758
-
759
- def get_reply_address_field_length(rx_buffer) -> int:
760
- """Returns the size of reply address field.
761
-
762
- This function returns the actual size of the reply address field. It doesn't return the content of the
763
- reply address length field. If you need that information, use the reply_address_length() function that work on
764
- the instruction field.
765
-
766
- Returns:
767
- length: the size of the reply address field.
768
- """
769
- instruction = get_instruction_field(rx_buffer)
770
- return reply_address_length(instruction) * 4
771
-
772
-
773
- def get_data(rxbuf) -> bytes:
774
- """Return the data from the RMAP packet.
775
-
776
- Raises:
777
- ValueError: if there is no data section in the packet (TODO: not yet implemented)
778
- """
779
- instruction_field = get_instruction_field(rxbuf)
780
- address_length = get_reply_address_field_length(rxbuf)
781
- data_length = get_data_length(rxbuf)
782
-
783
- offset = 12 if is_read(instruction_field) else 16
784
-
785
- return rxbuf[offset + address_length:offset + address_length + data_length]
786
-
787
-
788
- def check_data_crc(rxbuf):
789
- instruction_field = get_instruction_field(rxbuf)
790
- address_length = get_reply_address_field_length(rxbuf)
791
- data_length = get_data_length(rxbuf)
792
-
793
- offset = 12 if is_read(instruction_field) else 16
794
- idx = offset + address_length
795
-
796
- d_crc = rxbuf[idx + data_length]
797
- c_crc = rmap_crc_check(rxbuf, idx, data_length) & 0xFF
798
- if d_crc != c_crc:
799
- raise CheckError(
800
- f"Data CRC doesn't match calculated CRC, d_crc=0x{d_crc:02X} & c_crc=0x{c_crc:02X}",
801
- constants.RMAP_GENERAL_ERROR
802
- )
803
-
804
-
805
- def check_header_crc(rxbuf):
806
- instruction_field = get_instruction_field(rxbuf)
807
- if is_command(instruction_field):
808
- offset = 15
809
- elif is_write(instruction_field):
810
- offset = 7
811
- else:
812
- offset = 11
813
-
814
- idx = offset + get_reply_address_field_length(rxbuf)
815
- h_crc = rxbuf[idx]
816
- c_crc = rmap_crc_check(rxbuf, 0, idx)
817
- if h_crc != c_crc:
818
- raise CheckError("Header CRC doesn't match calculated CRC, h_crc=0x{:X} & c_crc=0x{:X}"
819
- .format(h_crc, c_crc), constants.RMAP_GENERAL_ERROR)
820
-
821
-
822
- def get_data_length(rxbuf) -> int:
823
- """Returns the length of the data in bytes.
824
-
825
- Raises:
826
- TypeError: when this method is used on a Write Request Reply packet (which has no
827
- data length).
828
- """
829
- instruction_field = get_instruction_field(rxbuf)
830
-
831
- if not is_command(instruction_field) and is_write(instruction_field):
832
- raise TypeError("There is no data length field for Write Request Reply packets, "
833
- "asking for the data length is an invalid operation.")
834
-
835
- offset = 12 if is_command(instruction_field) else 8
836
- idx = offset + get_reply_address_field_length(rxbuf)
837
-
838
- # We could use two alternative decoding methods here:
839
- # int.from_bytes(rxbuf[idx:idx+3], byteorder='big') (timeit=1.166s)
840
- # struct.unpack('>L', b'\x00' + rxbuf[idx:idx+3])[0] (timeit=0.670s)
841
- data_length = struct.unpack('>L', b'\x00' + rxbuf[idx:idx + 3])[0]
842
- return data_length
843
-
844
-
845
- def get_address(rxbuf) -> int:
846
- """Returns the address field (including the extended address field if the address is 40-bits).
847
-
848
- Raises:
849
- TypeError: when this method is used on a Reply packet (which has no address field).
850
- """
851
- instruction_field = get_instruction_field(rxbuf)
852
-
853
- if not is_command(instruction_field):
854
- raise TypeError("There is no address field for Reply packets, asking for the address is "
855
- "an invalid operation.")
856
-
857
- idx = 7 + get_reply_address_field_length(rxbuf)
858
- extended_address = rxbuf[idx]
859
- idx += 1
860
- address = struct.unpack('>L', rxbuf[idx:idx + 4])[0]
861
- if extended_address:
862
- address = address + (extended_address << 32)
863
- return address
864
-
865
-
866
- def get_transaction_identifier(rxbuf):
867
- idx = 5 + get_reply_address_field_length(rxbuf)
868
- tid = struct.unpack('>h', rxbuf[idx:idx + 2])[0]
869
- return tid
870
-
871
-
872
- def get_initiator_logical_address(rxbuf):
873
- idx = 4 + get_reply_address_field_length(rxbuf)
874
- ila_rxbuf = rxbuf[idx]
875
- return ila_rxbuf
876
-
877
-
878
- def check_initiator_logical_address(rxbuf, ila):
879
- ila_rxbuf = get_initiator_logical_address(rxbuf)
880
- if ila != ila_rxbuf:
881
- raise CheckError(
882
- f"Initiator Logical Address doesn't match, ila=0x{ila:02X} & ila_rxbuf=0x{ila_rxbuf:02X}",
883
- constants.RMAP_GENERAL_ERROR
884
- )
885
-
886
-
887
- def check_key(rmap_link, rxbuf):
888
- idx = 3
889
- key = rmap_get_target_key(rmap_link)
890
- key_rxbuf = rxbuf[idx]
891
- if key != key_rxbuf:
892
- raise CheckError(
893
- f"Key doesn't match, key={key} & key_rxbuf={key_rxbuf}", constants.RMAP_INVALID_KEY
894
- )
895
-
896
-
897
- def get_instruction_field(rxbuf):
898
- idx = 2
899
- return rxbuf[idx]
900
-
901
-
902
- def check_instruction(rx_buffer) -> None:
903
- """
904
- Check the instruction field for inconsistencies and report the values in the logger at DEBUG level.
905
-
906
-
907
- Args:
908
- rx_buffer (bytes): The read buffer which contains the SpW packet
909
-
910
- Raises:
911
- CheckError: when the reserved bit is not zero,
912
-
913
- Returns:
914
- None.
915
- """
916
- # The Instruction Field is the third byte (base=0) of the packet buffer.
917
- # Description of the Instruction Field can be found in ECSS-E-ST-50-52C.
918
-
919
- instruction = get_instruction_field(rx_buffer)
920
- if is_reserved(instruction):
921
- raise CheckError(
922
- f"Instruction field [{instruction:08b}] reserved bit is not 0x00",
923
- constants.RMAP_NOT_IMPLEMENTED_AUTHORISED
924
- )
925
-
926
- msg = "RMAP Instruction Field: "
927
- msg += "Command; " if is_command(instruction) else "Reply; "
928
- msg += "write; " if is_write(instruction) else "read; "
929
- msg += "verify; " if is_verify(instruction) else "don't verify; "
930
- msg += "reply; " if is_reply_required(instruction) else "don't reply; "
931
- msg += "increment; " if is_increment(instruction) else "no increment; "
932
-
933
- logger.debug(msg)
934
- if reply_address_length(instruction):
935
- logger.debug(f"Reply address length = {reply_address_length(instruction)} bytes.")
936
-
937
-
938
- def check_protocol_id(rxbuf):
939
- idx = 1
940
- protocol_id = rxbuf[idx]
941
- if protocol_id != constants.RMAP_PROTOCOL_ID:
942
- raise CheckError(
943
- f"Protocol id is not the expected value {protocol_id}, expected {constants.RMAP_PROTOCOL_ID}",
944
- constants.RMAP_GENERAL_ERROR)
945
-
946
-
947
- def get_target_logical_address(rmap_link: ESL_RMAP, rxbuf: bytes) -> int:
948
- tla_idx = 0
949
- tla_rxbuf = rxbuf[tla_idx]
950
- return tla_rxbuf
951
-
952
-
953
- def check_target_logical_address(rmap_link, rxbuf, tla):
954
- tla_rxbuf = get_target_logical_address(rmap_link, rxbuf)
955
- if tla != tla_rxbuf:
956
- raise CheckError(
957
- f"Target Logical Address doesn't match, tla=0x{tla:02X} & rxbuf[0]=0x{tla_rxbuf:02X}",
958
- constants.RMAP_GENERAL_ERROR
959
- )
960
-
961
-
962
- def update_transaction_identifier(rmap_link) -> int:
963
- """
964
- Updates the transaction identifier and returns the new value.
965
-
966
- Args:
967
- rmap_link (ESL_RMAP): the RMAP link connection
968
-
969
- Returns:
970
- the updated transaction identifier (int).
971
- """
972
- tid = rmap_link.contents.transaction_identifier
973
- tid = (tid + 1) & 0xFFFF
974
- rmap_link.contents.transaction_identifier = tid
975
- return tid
976
-
977
-
978
- def check_address_and_data_length(address: int, length: int) -> None:
979
- """
980
- Checks the address and length in the range of memory areas used by the FEE.
981
-
982
- The ranges are taken from the PLATO-DLR-PL-ICD-0010 N-FEE to N-DPU IRD.
983
-
984
- Args:
985
- address (int): the memory address of the FEE Register
986
- length (int): the number of bytes requested
987
-
988
- Raises:
989
- RMAPError: when address + length fall outside any specified area.
990
- """
991
-
992
- # All these restrictions have been relaxed on the N-FEE.
993
- # We are returning here immediately instead of removing or commenting out the code.
994
- # These reason is that we can then bring back restriction easier and gradually.
995
-
996
- return
997
-
998
- if length % 4:
999
- raise RMAPError("The requested data length shall be a multiple of 4 bytes.", address, length)
1000
-
1001
- if address % 4:
1002
- raise RMAPError("The address shall be a multiple of 4 bytes.", address, length)
1003
-
1004
- # Note that when checking the given data length, at the defined area end, we can still read 4 bytes.
1005
-
1006
- if CRITICAL_AREA_START <= address <= CRITICAL_AREA_END:
1007
- if length != 4:
1008
- raise RMAPError("Read requests to the critical area have a fixed data length of 4 bytes.",
1009
- address, length)
1010
-
1011
- elif GENERAL_AREA_START <= address <= GENERAL_AREA_END:
1012
- if length > 256:
1013
- raise RMAPError(f"Read requests to the general area have a maximum data length of 256 bytes.",
1014
- address, length)
1015
- if address + length > GENERAL_AREA_END + 4:
1016
- raise RMAPError(
1017
- f"The requested data length for the general area is too large.\n"
1018
- f"The address + length exceeds the general area boundaries.\n", address, length
1019
- )
1020
-
1021
- elif HK_AREA_START <= address <= HK_AREA_END:
1022
- if length > 256:
1023
- raise RMAPError(f"Read requests to the housekeeping area have a maximum data length of 256 bytes.",
1024
- address, length)
1025
- if address + length > HK_AREA_END + 4:
1026
- raise RMAPError(
1027
- f"The requested data length for the housekeeping area is too large.\n"
1028
- f"The address + length exceeds the housekeeping area boundaries.\n", address, length
1029
- )
1030
-
1031
- elif WINDOWING_AREA_START <= address <= WINDOWING_AREA_END:
1032
- if length > 4096:
1033
- raise RMAPError(f"Read requests to the windowing area have a maximum data length of 4096 bytes.",
1034
- address, length)
1035
- if address + length > WINDOWING_AREA_END + 4:
1036
- raise RMAPError(
1037
- f"The requested data length for the windowing area is too large.\n"
1038
- f"The address + length exceeds the windowing area boundaries.\n", address, length
1039
- )
1040
-
1041
- else:
1042
- raise RMAPError(f"Register address for RMAP read requests is invalid.", address, length)