Compare commits

...

367 Commits

Author SHA1 Message Date
f85694de02 make log interval configurable at the top 2022-08-16 16:17:36 +02:00
19b35f7e18 printout improvements 2022-08-16 12:53:05 +02:00
be1cbfad8d format 2022-08-16 12:51:31 +02:00
9de4cabcd9 can request mgm hk now 2022-08-16 11:56:06 +02:00
9d4eab39e7 dummy acs ctrl hk handler 2022-08-16 11:48:53 +02:00
2165f376fb now it works 2022-08-16 11:44:49 +02:00
37806e428f added command to request one MGM hk packet 2022-08-16 11:35:57 +02:00
b9cdfdf6c8 trying new tc service decorator 2022-08-12 22:33:16 +02:00
3fa700804e re-run generator scripts 2022-08-12 12:31:00 +02:00
e383263d2f automatically pack time tagged commands
to disable HK generation
2022-08-12 12:10:50 +02:00
2da9f13bd7 bump dependency 2022-08-12 12:01:15 +02:00
9df47c2067 remove unused includes 2022-08-12 10:22:33 +02:00
70bafa64ca more docs2 2022-08-12 10:20:01 +02:00
236e9c9b60 informative docs 2022-08-12 10:19:07 +02:00
8625a98eb9 use new decorator to add tmtc definitions now 2022-08-12 10:18:21 +02:00
26a886b5a2 experimenting with new decorator 2022-08-12 10:04:08 +02:00
0af9d52283 added new tcs commands 2022-08-12 08:45:51 +02:00
81674ca082 add command to request TCS HK set 2022-08-11 19:18:01 +02:00
1a27ea9674 add controller obj IDs 2022-08-11 19:12:27 +02:00
65414bc87f bump dependency 2022-08-11 18:44:54 +02:00
57d817ec84 bump dependencies 2022-08-11 18:26:30 +02:00
8b275bdca8 a lot of improvements 2022-08-11 18:10:15 +02:00
dc07dd8c6d common_power module 2022-08-11 15:40:38 +02:00
7399a8fa97 add named pdu1/pdu2 cmds 2022-08-11 14:45:24 +02:00
811a553ebe using correct retval.csv now 2022-08-09 10:38:33 +02:00
df4824af8d re-run generators 2022-08-08 17:07:20 +02:00
7dccd661a5 Merge pull request 'Smaller update' (#106) from mueller/bump-deps into main
Reviewed-on: #106
2022-08-08 17:05:04 +02:00
e43e432392 Merge branch 'main' into mueller/bump-deps 2022-08-08 17:04:54 +02:00
95d17481c1 bump tmtccmd 2022-08-08 16:59:59 +02:00
e08b927643 make TCP TM server obj singletons 2022-08-08 16:47:41 +02:00
00bf041e3f Merge pull request 'update dependencies' (#105) from mueller/bump-deps into main
Reviewed-on: #105
2022-08-08 16:35:01 +02:00
76da5753f6 update dependencies 2022-08-08 16:32:18 +02:00
6efd7a4ef1 Merge pull request 'update-main' (#104) from update-main into main
Reviewed-on: #104
Reviewed-by: Jakob Meier <meierj@irs.uni-stuttgart.de>
2022-07-15 08:56:53 +02:00
b7f2c96654 bump tmtccmd 2022-07-14 17:27:30 +02:00
2482a79db7 new send_cb argument 2022-07-14 15:45:57 +02:00
350afc7ee7 update dependencies and csv files 2022-07-14 14:25:18 +02:00
742a081a10 Merge pull request 'New SCEX commands' (#103) from irini into main
Reviewed-on: #103
2022-07-13 15:33:59 +02:00
0a655f51d4 bump spacepackets dependency 2022-07-13 11:25:38 +02:00
0fbe95b2b2 updated run configs 2022-07-13 10:53:29 +02:00
c35cbc37bd update run configs 2022-07-13 10:46:34 +02:00
2348c38305 Merge branch 'irini' of https://egit.irs.uni-stuttgart.de/eive/eive-tmtc into irini 2022-07-13 10:42:56 +02:00
dd1f296c04 move includes 2022-07-13 10:42:48 +02:00
ca0dd83df3 Merge branch 'irini' of https://egit.irs.uni-stuttgart.de/eive/eive-tmtc into irini 2022-07-13 10:41:21 +02:00
6a4d09d004 runconfigs 2022-07-13 10:40:34 +02:00
71bd2c9868 bump submodules 2022-07-13 10:37:20 +02:00
6769224307 make tmtcc.py executable 2022-07-13 10:33:37 +02:00
704357369e Merge branch 'main' into irini 2022-07-08 17:21:09 +02:00
1a73fa1ff1 re-generate csv files 2022-07-08 16:46:10 +02:00
370d6c2fa4 bump tmtccmd 2022-07-08 16:38:39 +02:00
a677620aae Merge pull request 'Major dependency update' (#102) from mueller/major-dependency-update into main
Reviewed-on: #102
Reviewed-by: Jakob Meier <meierj@irs.uni-stuttgart.de>
2022-07-08 16:30:41 +02:00
87d539d46e replaced includes 2022-07-08 16:25:46 +02:00
ebb1734ca7 Merge branch 'mueller/major-dependency-update' into irini 2022-07-08 16:21:01 +02:00
adf0127a21 bump depedency 2022-07-05 12:29:34 +02:00
6ca8a8f4e3 bump changelog 2022-07-05 11:19:30 +02:00
4ef3c40303 pass ObjectIdU32 instead of bytes 2022-07-05 02:18:30 +02:00
e009167784 api update done 2022-07-05 02:12:54 +02:00
4a654857ce only tmtc defs remaining 2022-07-04 18:14:51 +02:00
0a4cd5cfe2 tmtcc.py executable 2022-07-04 18:09:24 +02:00
2b285417a0 continued update to new API 2022-07-04 17:59:09 +02:00
27edcbd71d starting changing code to new API 2022-07-04 15:22:53 +02:00
fd5b946810 bump dependencies 2022-07-04 11:55:10 +02:00
db033edd23 move dependencies int deps folder 2022-07-04 11:52:47 +02:00
dbae41cb58 scex continued 2022-06-30 21:49:25 +02:00
1df9b0a91a continued scex.py 2022-06-27 20:18:26 +02:00
d7ee5a2229 tmtc scex continue 2022-06-21 18:15:17 +02:00
a1964f05ea update .gitignore 2022-06-21 17:57:16 +02:00
c2f597b671 basic scex_conf file 2022-06-21 17:56:31 +02:00
67500e88ed scex command init 2022-06-21 16:49:11 +02:00
7012a6c41f scex tmtc init 2022-06-21 15:21:55 +02:00
c29689cc0a Merge pull request 'Bump submodules' (#99) from mueller/bump-deps into develop
Reviewed-on: #99
2022-06-21 10:35:57 +02:00
be80758c71 Merge branch 'develop' into mueller/bump-deps 2022-06-21 10:35:49 +02:00
ee0baa15c2 Merge pull request 'New csv files' (#100) from mueller/gen-update into develop
Reviewed-on: #100
2022-06-21 10:33:26 +02:00
eced453886 add csv headers 2022-06-21 01:20:22 +02:00
e3b66d52e2 some csv sanitization 2022-06-21 01:15:09 +02:00
286ec25445 update all csvs 2022-06-21 00:58:41 +02:00
b4b3f9aaff new csv files 2022-06-20 18:04:34 +02:00
5f44fedc70 bump spacepackets 2022-06-20 09:47:48 +02:00
701f6efbee Merge remote-tracking branch 'origin/develop' into mueller/bump-deps 2022-06-20 09:47:27 +02:00
d6f9b269f8 Merge pull request 'Improvements for TVAC tests' (#98) from meier/tvac-tests into develop
Reviewed-on: #98
2022-06-15 11:30:58 +02:00
b8f95ac015 bump dependencies 2022-06-14 11:26:31 +02:00
c9d35df277 fixed type of pdu temperature 2022-06-10 11:25:27 +02:00
2a245b1714 commands to set and get pcdu parameters 2022-06-10 11:02:08 +02:00
bfc9b17f10 gps non diag hk 2022-06-07 17:49:16 +02:00
ce910ba63c typo 2022-06-04 16:32:12 +02:00
634b0c728d reset run configs 2022-06-04 16:29:00 +02:00
f7ec8754e0 tmtccmd update 2022-06-04 16:27:27 +02:00
00989a20e6 run generator scripts 2022-06-04 16:27:00 +02:00
58ed46e110 fixes in procedures and hk handling 2022-06-03 18:04:59 +02:00
ae0217066b bugfixes in procedures and hk parsing 2022-06-03 11:51:03 +02:00
6cae7f742c format string of device temperatures 2022-06-03 10:35:12 +02:00
46be9fa092 gomspace temperatures now float 2022-06-03 09:35:12 +02:00
64a1ffa1f3 gomspace temperatures now float 2022-06-03 09:33:34 +02:00
3ff95280e5 fixes in procedures 2022-06-02 18:51:40 +02:00
7259fc008a ru generator scripts 2022-06-01 18:47:37 +02:00
19a9faa443 tmtccmd update 2022-06-01 18:47:26 +02:00
e2de2e0212 tmtccmd update 2022-06-01 15:52:34 +02:00
8a23e8a96c added sus temeprature set parsing 2022-06-01 11:59:45 +02:00
38b8f2a02f device temperature set parsing 2022-06-01 10:47:57 +02:00
210ec8805c Merge branch 'develop' into meier/tvac-tests 2022-06-01 06:25:46 +02:00
37d3c44067 Merge pull request 'changed diagnostic handover' (#97) from kranz/master into develop
Reviewed-on: #97
2022-06-01 06:25:12 +02:00
351bb7c475 changed diagnostic handover 2022-05-31 17:55:53 +02:00
cba2055c59 some adaptions 2022-05-31 16:42:53 +02:00
a1cbc3bc13 debugging 2022-05-31 11:44:08 +02:00
c3012cd7a4 ip address localhost 2022-05-30 18:00:09 +02:00
048a0ea447 checked out tmtcgui from mohr/thermal 2022-05-30 13:31:11 +02:00
1bdfc40cdd tmtccli listner mode 2022-05-30 12:59:31 +02:00
b20921788e bug fixes 2022-05-30 11:58:57 +02:00
e4e0b882e5 Merge pull request 'GPS bug fix' (#96) from kranz/master into develop
Reviewed-on: #96
2022-05-30 11:24:18 +02:00
ec4b681b2e more 2022-05-30 09:25:57 +02:00
363c93a7d3 gps bug fix 2022-05-30 09:18:07 +02:00
5daf76d081 Merge pull request 'GPS HK Parsing' (#86) from mueller/gps-hk-parsing into develop
Reviewed-on: #86
2022-05-28 12:52:00 +02:00
5bde637dcc Merge branch 'mueller/gps-hk-parsing' of https://egit.irs.uni-stuttgart.de/eive/eive-tmtc into mueller/gps-hk-parsing 2022-05-28 12:51:20 +02:00
acd53c1337 resolve other merge conflict 2022-05-28 12:51:07 +02:00
59d4096327 Merge branch 'develop' into mueller/gps-hk-parsing 2022-05-28 12:49:46 +02:00
5df26aac0b Merge remote-tracking branch 'origin/develop' into mueller/gps-hk-parsing 2022-05-28 12:49:34 +02:00
b39f2851ca Merge pull request 'rw and mgt proc changes to adjust timing and sequence' (#95) from kranz/master into develop
Reviewed-on: #95
2022-05-28 12:48:40 +02:00
27b41c0a48 reduced code duplication 2022-05-27 19:32:02 +02:00
79e0838473 rw and mgt proc changes to adjust timing and sequence 2022-05-27 18:54:48 +02:00
5662c78f7a Merge pull request 'added PL PCDU HK parsing' (#87) from mueller/plpcdu-hk-parsing into develop
Reviewed-on: #87
2022-05-27 16:28:50 +02:00
ddc1becc66 Merge pull request 'TV Tests' (#94) from mueller/tv-tests into develop
Reviewed-on: #94
2022-05-27 16:26:07 +02:00
dbe3110a96 rename run config 2022-05-27 15:30:32 +02:00
04bbc45383 new run config for TV tests 2022-05-27 15:29:39 +02:00
0795e7c279 Merge remote-tracking branch 'origin/develop' into mueller/gps-hk-parsing 2022-05-27 14:32:58 +02:00
aa733ed5ed Merge pull request 'Procedure updates' (#93) from mueller/proc-updates into develop
Reviewed-on: #93
2022-05-27 14:20:19 +02:00
44adf6cf1e small fix 2022-05-27 14:16:47 +02:00
81501b4ae6 Merge branch 'kranz/master' of https://egit.irs.uni-stuttgart.de/eive/eive-tmtc into kranz/master 2022-05-27 11:54:05 +02:00
851593a7bf some improvements and updates 2022-05-27 11:53:57 +02:00
d85501f43e Merge remote-tracking branch 'origin/develop' into kranz/master 2022-05-27 11:06:20 +02:00
f4038f9f70 Merge branch 'kranz/master' of https://egit.irs.uni-stuttgart.de/eive/eive-tmtc into kranz/master 2022-05-27 11:06:03 +02:00
f7d843131f new cfg class for procedures 2022-05-27 10:50:44 +02:00
04fca35012 Merge remote-tracking branch 'origin/develop' into mueller/gps-hk-parsing 2022-05-27 10:19:29 +02:00
da544ccb13 Merge remote-tracking branch 'origin/develop' into mueller/plpcdu-hk-parsing 2022-05-27 10:18:35 +02:00
8b644ece5e Merge pull request 'SUS HK Parsing' (#92) from mueller/sus-hk-parsing into develop
Reviewed-on: #92
2022-05-27 10:11:40 +02:00
3e087dc803 complete sus hk parsing 2022-05-27 09:54:06 +02:00
da18ebab77 added sus hk parsing 2022-05-25 18:15:22 +02:00
ef349856d6 re-generate csvs 2022-05-25 18:14:52 +02:00
49bb59df7f Merge branch 'develop' into mueller/plpcdu-hk-parsing 2022-05-25 16:26:09 +02:00
e70480bc17 Merge remote-tracking branch 'origin/develop' into mueller/gps-hk-parsing 2022-05-25 16:25:54 +02:00
a257f2b707 Merge pull request 'Continue procedures' (#91) from kranz/master into develop
Reviewed-on: #91
2022-05-25 16:25:35 +02:00
74f639ab55 Merge branch 'develop' into kranz/master 2022-05-25 16:24:05 +02:00
be71cb792e some error checking for RWs 2022-05-25 15:31:45 +02:00
01e91bffcd kill all the duplication 2022-05-25 15:21:50 +02:00
708edeb458 Merge branch 'develop' into mueller/plpcdu-hk-parsing 2022-05-25 15:02:22 +02:00
c3c65d325e Merge remote-tracking branch 'origin/develop' into mueller/gps-hk-parsing 2022-05-25 15:02:06 +02:00
42aeb874c0 bump tmtccmd 2022-05-25 15:01:40 +02:00
3f813d9381 Merge remote-tracking branch 'origin/develop' into mueller/gps-hk-parsing 2022-05-25 15:01:26 +02:00
8a00855798 Merge pull request 'TV test procedures' (#89) from kranz/master into develop
Reviewed-on: #89
2022-05-25 15:01:09 +02:00
6db60f9238 Merge remote-tracking branch 'origin/develop' into kranz/master 2022-05-25 14:59:52 +02:00
ec13c20325 afmt 2022-05-25 14:59:30 +02:00
1790ac6329 bump required tmtccmd version 2022-05-25 14:59:06 +02:00
0131499a6a bump tmtccmd 2022-05-25 14:31:55 +02:00
7ec3c51cce updated gnss 2022-05-25 13:49:51 +02:00
44b673dd26 added cmd definitions 2022-05-25 13:32:18 +02:00
ef36e65223 proc update 2022-05-25 12:09:04 +02:00
a439a51842 bump tmtccmd and proc update 2022-05-25 12:08:37 +02:00
b0ab9cd79a Merge branch 'kranz/master' of https://egit.irs.uni-stuttgart.de/eive/eive-tmtc into kranz/master 2022-05-25 12:07:12 +02:00
1841dbd35d added set id for gnss hk 2022-05-25 12:06:17 +02:00
34e081f3c2 Merge branch 'kranz/master' of https://egit.irs.uni-stuttgart.de/eive/eive-tmtc into kranz/master 2022-05-25 11:54:02 +02:00
5b25f910ae RW update 2022-05-25 11:53:34 +02:00
55a6e98850 rw proc 2 to negative values and mgt wait duration changed 2022-05-25 11:35:11 +02:00
72e258308e made some code more brief 2022-05-25 11:16:24 +02:00
a107506b88 apply black and add sus set ID 2022-05-25 11:10:57 +02:00
ebf44e8b0e more missing flags and finalized rw proc 2022-05-25 10:53:39 +02:00
58b021c37f remove include 2022-05-25 10:39:17 +02:00
36695bbbb0 re-run black 2022-05-25 10:37:38 +02:00
6c7c8731ee Merge remote-tracking branch 'origin/develop' into mueller/gps-hk-parsing 2022-05-25 10:37:30 +02:00
7a92bde177 Merge remote-tracking branch 'origin/develop' into mueller/plpcdu-hk-parsing 2022-05-25 10:35:16 +02:00
aa01fe4401 more missing flags 2022-05-25 10:14:57 +02:00
81b3db694a added missing flags 2022-05-25 10:13:31 +02:00
b4604951b3 added preliminary rw proc 2022-05-25 10:03:47 +02:00
6a209e1a0b Merge pull request 'IMTQ HK Parsing' (#90) from meier/imtq into develop
Reviewed-on: #90
2022-05-25 09:55:32 +02:00
04ad0ec7d2 Merge branch 'meier/imtq' of https://egit.irs.uni-stuttgart.de/eive/eive-tmtc into meier/imtq 2022-05-25 09:55:03 +02:00
f42d9689e7 Merge remote-tracking branch 'origin/develop' into meier/imtq 2022-05-25 09:54:57 +02:00
b4ee30e41b Merge branch 'develop' into meier/imtq 2022-05-25 09:52:16 +02:00
c8ad4ca67a Merge remote-tracking branch 'origin/develop' into kranz/master 2022-05-25 08:30:50 +02:00
445a88741f Merge pull request 'PL PCDU HPA On Procedure' (#88) from mueller/pl-pcdu-proc into develop
Reviewed-on: #88
2022-05-24 19:04:35 +02:00
36fde832c8 reset tmtccli run config 2022-05-24 19:03:02 +02:00
86db4f5103 fixed conflicts 2022-05-24 19:01:43 +02:00
f5367ac381 imtq hk parsing 2022-05-24 18:57:52 +02:00
e88bf7e937 added str proc and str temperature set_id 2022-05-24 18:56:15 +02:00
1c3d67aa15 updated mgt proc 2022-05-24 18:34:25 +02:00
58a5c1850e added sus procedure 2022-05-24 18:13:17 +02:00
f7e7f731d5 Merge remote-tracking branch 'origin/develop' into mueller/plpcdu-hk-parsing 2022-05-24 17:43:40 +02:00
f12913d802 Merge branch 'develop' into mueller/pl-pcdu-proc 2022-05-24 17:41:56 +02:00
f75a1a13c9 added sus IDs 2022-05-24 17:36:07 +02:00
aa238dbabb Merge remote-tracking branch 'origin/develop' into mueller/pl-pcdu-proc 2022-05-24 17:27:56 +02:00
fbc755deda Merge pull request 'TV test procedures' (#83) from kranz/master into develop
Reviewed-on: #83
2022-05-24 17:24:39 +02:00
9c5d16fb7c apply black 2022-05-24 17:24:09 +02:00
83115d43af Merge remote-tracking branch 'origin/develop' into kranz/master 2022-05-24 17:23:50 +02:00
c37eb77da3 minor changes 2022-05-24 17:08:20 +02:00
e6eee0d518 some reordering 2022-05-24 17:07:13 +02:00
96c6feb746 cleaned up a bit 2022-05-24 17:04:03 +02:00
66c3942afb function "listen_to_hk_for_x_seconds" might be deleted 2022-05-24 17:03:32 +02:00
0c9547eb3a pl pcdu procedure 2022-05-24 17:01:35 +02:00
931cbe26e6 changes to imtq (added dipole command packing as PUS) and proc (added MGT proc) 2022-05-24 16:59:05 +02:00
095cf822ee cleaned new addition 2022-05-24 15:26:08 +02:00
1e44d81c47 Merge remote-tracking branch 'origin/develop' into mueller/gps-hk-parsing 2022-05-24 15:08:36 +02:00
1c0a8534f9 Merge remote-tracking branch 'origin/develop' into mueller/plpcdu-hk-parsing 2022-05-24 15:08:18 +02:00
4b902ce01b Merge branch 'develop' of https://egit.irs.uni-stuttgart.de/eive/eive-tmtc into develop 2022-05-24 15:06:34 +02:00
ccafa89a92 bump tmtccmd dependency 2022-05-24 15:06:26 +02:00
ec16af0724 Merge pull request 'Regular reboot command' (#85) from mueller/reboot-cmd into develop
Reviewed-on: #85
2022-05-24 15:00:58 +02:00
4b762328c5 changed to new procedure 2022-05-24 14:58:13 +02:00
3d939c42b6 update changelog 2022-05-24 02:18:37 +02:00
4d18ececa3 added PL PCDU HK parsing 2022-05-24 02:16:54 +02:00
b7a6291560 update gps hk parsing 2022-05-24 01:49:57 +02:00
9fc90ba487 update gps hk parsing 2022-05-24 01:34:33 +02:00
9edc21c674 Merge branch 'develop' into kranz/master 2022-05-24 01:16:37 +02:00
41f1f4c99a changelog 2022-05-24 01:13:43 +02:00
575932f646 new reboot command 2022-05-24 01:13:21 +02:00
51bbeaa693 transform into static method 2022-05-23 22:24:10 +02:00
f30913b24b Merge pull request 'ACU HK Parsing' (#80) from mueller/acu-hk into develop
Reviewed-on: #80
2022-05-23 18:59:56 +02:00
7f03dcb3a6 bugfix for acu hk parsing 2022-05-23 18:59:19 +02:00
3586b541c1 Merge remote-tracking branch 'origin/develop' into mueller/acu-hk 2022-05-23 18:34:44 +02:00
e7cb7ca096 run afmt 2022-05-23 18:34:28 +02:00
dd7a19d134 Merge branch 'kranz/master' of https://egit.irs.uni-stuttgart.de/eive/eive-tmtc into kranz/master 2022-05-23 18:33:41 +02:00
c9f5a5652e run afmt 2022-05-23 18:33:35 +02:00
45bee6429e Merge branch 'develop' into kranz/master 2022-05-23 18:33:13 +02:00
2698756b29 update changelog 2022-05-23 18:32:59 +02:00
d36799448c Merge remote-tracking branch 'origin/develop' into mueller/acu-hk 2022-05-23 18:32:32 +02:00
ba69be6296 Merge pull request 'add rtd cmds' (#84) from mueller/rtd-cmds into develop
Reviewed-on: #84
2022-05-23 18:31:39 +02:00
427efab44e Merge branch 'develop' into mueller/rtd-cmds 2022-05-23 18:30:29 +02:00
4aa89e42ee Merge pull request 'Rad Sensor HK parsing' (#81) from mueller/rad-sensor into develop
Reviewed-on: #81
2022-05-23 18:30:17 +02:00
ea1865bd45 update changelog 2022-05-23 18:29:50 +02:00
4de3e7d107 rad sensor reading works 2022-05-23 18:25:25 +02:00
4251b126b7 Merge remote-tracking branch 'origin/develop' into mueller/rad-sensor 2022-05-23 18:02:03 +02:00
fe36485e85 Merge remote-tracking branch 'origin/develop' into mueller/acu-hk 2022-05-23 18:01:25 +02:00
9332fb8690 Merge branch 'develop' into mueller/rtd-cmds 2022-05-23 18:00:10 +02:00
7186636d9c Merge pull request 'Supervisor command' (#82) from meier/ploc into develop
Reviewed-on: #82
2022-05-23 17:54:50 +02:00
b54ffcedff Merge branch 'develop' into meier/ploc 2022-05-23 17:54:19 +02:00
7e36b387fe add rtd cmds 2022-05-23 17:50:08 +02:00
15e0861c4d run generator script 2022-05-23 17:03:45 +02:00
623e1cc37e Merge remote-tracking branch 'origin/develop' into kranz/master 2022-05-23 16:44:11 +02:00
181e6d62ad n 2022-05-23 16:42:27 +02:00
8eae5a4278 command to continue failed mpsoc update 2022-05-23 16:38:44 +02:00
648e0b7814 bump tmtccmd 2022-05-23 16:11:55 +02:00
e884f397cd Merge remote-tracking branch 'origin/develop' into mueller/acu-hk 2022-05-23 15:50:45 +02:00
17a3ea24df Merge pull request 'GUI improvements' (#79) from mohr/looooop into develop
Reviewed-on: #79
2022-05-23 15:50:04 +02:00
2506d911de rad sensor HK parsing 2022-05-23 15:49:21 +02:00
314071de1c rad sensor data 2022-05-23 15:38:05 +02:00
bcaac870c1 changed tcs and acs tv test proc 2022-05-23 15:28:41 +02:00
b9de13ffe7 something not working 2022-05-23 14:04:34 +02:00
e033609177 run black 2022-05-23 13:47:01 +02:00
580b381848 completed ACU hk parsing 2022-05-23 12:38:50 +02:00
b3751004a6 added acs functional test 2022-05-23 11:53:31 +02:00
c01f1d0191 run black 2022-05-23 11:25:33 +02:00
ea1e440407 start acu hk handling 2022-05-23 11:24:55 +02:00
0943a7a998 Merge remote-tracking branch 'origin/develop' into kranz/master 2022-05-23 09:34:54 +02:00
85a3c936a4 tmtcgui -m7 is kinda working like I would expect it to 2022-05-23 00:20:06 +02:00
1f7faef083 Merge remote-tracking branch 'origin/develop' into mohr/looooop 2022-05-22 22:02:44 +02:00
4237ed0d29 working on gui 2022-05-22 21:35:51 +02:00
77f77489c2 using new prompt in controllers 2022-05-22 21:29:09 +02:00
2cb801dc97 added prompt that either uses cli or, if available qt 2022-05-22 21:28:34 +02:00
b8e61b38b0 extended tv test procedures 2022-05-20 16:40:58 +02:00
ff66dd5dd2 Merge pull request 'bump tmtccmd dependency' (#77) from mueller/bump-tmtccmd into develop
Reviewed-on: #77
2022-05-20 15:31:57 +02:00
9e8dc4f1e2 bump tmtccmd dependency 2022-05-20 15:30:11 +02:00
881baf7a82 Merge pull request 'HK Parsing and TC PROC Tests' (#76) from mueller/hk-parsing into develop
Reviewed-on: #76
2022-05-19 19:30:19 +02:00
022551139c some improvements 2022-05-19 19:24:57 +02:00
e15d3a0b7a continued procedures 2022-05-19 18:47:23 +02:00
da3f143a9b Merge remote-tracking branch 'origin/develop' into mueller/hk-parsing 2022-05-19 18:16:50 +02:00
d9abd03fa9 Merge pull request 'Init tv test procedure' (#74) from kranz/master into develop
Reviewed-on: #74
2022-05-19 18:16:42 +02:00
d53e26b589 switch to generic hk function 2022-05-19 18:14:38 +02:00
a6132dd4f8 some bugfixes 2022-05-19 17:52:01 +02:00
3caaffc151 Merge remote-tracking branch 'origin/develop' into mueller/hk-parsing 2022-05-19 17:37:41 +02:00
72de2d99ca Merge remote-tracking branch 'origin/develop' into kranz/master 2022-05-19 17:19:18 +02:00
ef4c0a9189 added mgm hk handling 2022-05-19 14:50:24 +02:00
730acf5ebe added gyros hk handling 2022-05-19 13:58:43 +02:00
ff651a7f7a Merge pull request 'continued hk parsing' (#75) from mueller/hk-parsing into develop
Reviewed-on: #75
2022-05-19 13:23:48 +02:00
fcb5e9b48c remove stray letter 2022-05-19 13:22:24 +02:00
260a083091 continued hk parsing 2022-05-19 13:20:22 +02:00
9bd0783c57 deleted bakcup files 2022-05-19 11:01:11 +02:00
2557662c4d Merge remote-tracking branch 'origin/develop' into kranz/master 2022-05-19 10:49:52 +02:00
Uli
084a51ee67 Merge remote-tracking branch 'origin/mohr/looooop' into mohr/looooop 2022-05-19 00:46:48 +02:00
8ca85d4474 updated tmtccmd 2022-05-19 00:46:21 +02:00
480e0f07e0 Merge pull request 'Improvements to Loop Mode and HK Parsing' (#73) from mohr/looooop into develop
Reviewed-on: #73
2022-05-18 22:29:43 +02:00
01337e38d6 Merge branch 'develop' into mohr/looooop 2022-05-18 22:29:33 +02:00
2ba33309a7 hk handling back to using a dict as I learned it is now ordered 2022-05-18 21:43:57 +02:00
817a89370a add battery tv test procedure 2022-05-18 20:00:59 +02:00
ca5fd6468c Merge remote-tracking branch 'origin/develop' into kranz/master 2022-05-18 18:42:18 +02:00
973bdeadd6 proc service added 2022-05-18 18:39:18 +02:00
b008cc8392 README fix 2022-05-18 18:32:20 +02:00
dff2c1b041 made parsed hk in json an array, so it can be iterated in order 2022-05-18 17:40:03 +02:00
b0bdb2208f using dle encoder in tm tcp server 2022-05-18 17:03:03 +02:00
bde8a29473 added TODO 2022-05-18 16:41:10 +02:00
437be64a28 move tcp server into own class and reverted hk handling back to functions from class 2022-05-18 16:02:23 +02:00
Uli
de50dcc7fc Merge branch 'develop' into mohr/looooop 2022-05-17 22:14:57 +02:00
963f48120e added sending of TM via TCP Port 2022-05-17 22:11:58 +02:00
476066a5ac changed controller commanding to allow more flexibility 2022-05-17 22:11:31 +02:00
73c8e95dce fixed looping mode 2022-05-17 22:10:53 +02:00
2beffdbb27 updated tmtccmd version 2022-05-17 22:04:56 +02:00
b185e94cb5 Merge remote-tracking branch 'origin/master' into develop 2022-05-17 17:49:42 +02:00
a6f669e974 cleaner TM handling 2022-05-17 17:21:03 +02:00
ccc0096aa5 Merge pull request 'v1.11.0' (#72) from develop into master
Reviewed-on: #72
2022-05-17 15:04:47 +02:00
1d6002abcf update changelog 2022-05-17 15:03:05 +02:00
79d900f57b bump version 2022-05-17 15:00:55 +02:00
66d788abf4 other small update for README 2022-05-17 14:57:54 +02:00
1272a5aa89 add back requirements.txt and update README 2022-05-17 14:55:23 +02:00
cff6661f5d update README 2022-05-17 14:46:23 +02:00
Uli
1cdc06c4d2 Merge branch 'mohr/looooop' into mohr/thermal 2022-05-17 14:45:46 +02:00
5ee77ae9b8 Merge pull request 'first version of continous operation' (#69) from mohr/looooop into develop
Reviewed-on: #69
2022-05-17 14:34:44 +02:00
8455490fe1 form improvements 2022-05-17 14:34:05 +02:00
963e9b7a5b Merge remote-tracking branch 'origin/develop' into mohr/looooop 2022-05-17 14:31:09 +02:00
8162cf1508 Merge pull request 'Package update' (#71) from mueller/package-update into develop
Reviewed-on: #71
2022-05-17 14:30:51 +02:00
a9efd5c86d delete requirements.txt 2022-05-17 14:28:36 +02:00
86395ac6e7 added setup.cfg and setup.py file 2022-05-17 14:28:17 +02:00
78996b2ef6 README fixes 2022-05-17 14:14:48 +02:00
85ed307b58 bump tmtccmd again 2022-05-17 14:11:20 +02:00
f89483e6ba Merge remote-tracking branch 'origin/develop' into mohr/looooop 2022-05-17 13:51:12 +02:00
0ebf044496 new run cfg 2022-05-17 13:20:30 +02:00
497cd16c81 bump tmtccmd dependency 2022-05-17 13:20:08 +02:00
893b1822e2 Merge pull request 'TMTC simplification' (#70) from mueller/tmtc-simplification into develop
Reviewed-on: #70
2022-05-17 12:53:10 +02:00
542e6ca48f Merge branch 'mueller/tmtc-simplification' of https://egit.irs.uni-stuttgart.de/eive/eive-tmtc into mueller/tmtc-simplification 2022-05-17 11:41:01 +02:00
b1f96d8a9d reduce comment block 2022-05-17 11:40:52 +02:00
Uli
a45aa3410b Merge remote-tracking branch 'origin/mohr/looooop' into mohr/looooop 2022-05-17 11:36:41 +02:00
619790e01a spelling 2022-05-17 11:33:40 +02:00
14c3f7acb4 Merge branch 'develop' into mohr/looooop 2022-05-17 11:25:48 +02:00
1a9b44711a Merge branch 'develop' into mueller/tmtc-simplification 2022-05-17 11:21:56 +02:00
a7080fa275 Merge pull request 'meier/ploc' (#68) from meier/ploc into develop
Reviewed-on: #68
2022-05-17 11:21:06 +02:00
1cd6f2a651 delete the daemon 2022-05-17 11:18:20 +02:00
4b7529d5b7 simplified cli and gui app 2022-05-17 11:13:32 +02:00
052af605fd first version of continous operation 2022-05-17 11:04:34 +02:00
05ca9e37c3 WIP: parsing Thermal Controller TM and sending it via TCP/IP 2022-05-17 10:43:59 +02:00
aadbfb2594 Added TCs to command Thermal Controller (to be continued) 2022-05-17 10:41:45 +02:00
1464b32e2d started new daemonic tmtc app 2022-05-16 18:35:36 +02:00
a125d502ec run generator scripts 2022-05-13 18:41:18 +02:00
31ab2c6ac2 new mpsoc update file 2022-05-13 18:40:24 +02:00
2c5bf6b378 Merge branch 'develop' of https://egit.irs.uni-stuttgart.de/eive/eive-tmtc into meier/ploc 2022-05-13 18:39:59 +02:00
b81f756e4b Merge pull request 'Heater Commands Update' (#67) from mueller/heater-health-if into develop
Reviewed-on: #67
2022-05-13 14:58:28 +02:00
bf64181826 update changelog 2022-05-12 20:51:25 +02:00
743670f656 update events and retvals 2022-05-12 20:45:43 +02:00
8e20c2ab08 added command parameter to identify extenral cmds 2022-05-12 20:07:31 +02:00
eb4143e6b5 update .csv files 2022-05-12 14:09:54 +02:00
a681850248 Merge pull request 'RW CMDs' (#61) from mueller/rw-cmds into develop
Reviewed-on: #61
2022-05-11 17:59:49 +02:00
325d06ee85 Merge remote-tracking branch 'origin/develop' into mueller/rw-cmds 2022-05-11 17:58:42 +02:00
bc02c9d607 seems to work now 2022-05-11 15:42:00 +02:00
fcce78b447 re-generate csv files from develop 2022-05-11 10:17:36 +02:00
a648b7f76f some fixes for rw ass commanding 2022-05-10 18:34:15 +02:00
8891908afa some include fixes 2022-05-10 18:00:56 +02:00
9d105ee97f Merge remote-tracking branch 'origin/develop' into mueller/rw-cmds 2022-05-10 17:57:29 +02:00
6b7b07c340 changelog update 2022-05-09 16:13:21 +02:00
dc7e6631f2 helper printout heater 2022-05-09 16:12:58 +02:00
1c5149c2b1 update csv files 2022-05-08 13:11:45 +02:00
1e25b08e40 removed empty line 2022-05-07 13:11:46 +02:00
fd6f366878 removed doubled command = 2022-05-07 12:00:36 +02:00
0584db4bb1 run generator 2022-05-06 19:52:26 +02:00
e62484ee80 Merge branch 'meier/ploc' of https://egit.irs.uni-stuttgart.de/eive/eive-tmtc into meier/ploc 2022-05-06 19:30:46 +02:00
91e11482f4 removed ploc updater 2022-05-06 19:30:38 +02:00
47a022b684 Merge remote-tracking branch 'origin/develop' into mueller/rw-cmds 2022-05-06 13:34:18 +02:00
50a20cfdc2 enbale nvm command 2022-05-05 19:20:59 +02:00
c586257934 Merge pull request 'update tmtccmd and spacepackets dependency' (#66) from mueller/update-dependencies into develop
Reviewed-on: #66
2022-05-05 16:40:13 +02:00
3bc19a387f added assembly mode commands 2022-05-05 16:23:17 +02:00
e616614a04 import fixes 2022-05-05 16:19:51 +02:00
bce981e1f3 Merge branch 'mueller/update-dependencies' into mueller/rw-cmds 2022-05-05 16:18:19 +02:00
985c032ebb update tmtccmd and spacepackets dependency 2022-05-05 16:15:53 +02:00
418b51b413 Merge remote-tracking branch 'origin/develop' into mueller/rw-cmds 2022-05-05 14:38:19 +02:00
7e460d05c3 complete RW HK handling 2022-05-05 13:39:20 +02:00
0be25b10f3 dedicated RW HK handler file 2022-05-05 13:36:51 +02:00
510ba82fef rw cmds cntd 2022-05-05 02:00:18 +02:00
bc4099c5bf added more rw cmds 2022-05-05 01:21:57 +02:00
dd34a049d3 Merge remote-tracking branch 'origin/develop' into mueller/rw-cmds 2022-05-05 00:40:11 +02:00
d7efe7d864 re-generate event list 2022-05-02 12:41:02 +02:00
f23ed26807 Merge remote-tracking branch 'origin/develop' into mueller/rw-cmds 2022-05-02 12:39:36 +02:00
2b8fa356c9 Merge branch 'meier/ploc' of https://egit.irs.uni-stuttgart.de/eive/eive-tmtc into meier/ploc 2022-04-29 23:35:41 +02:00
a0b398d214 commands to tritstate mpsoc uart tx line 2022-04-29 23:35:34 +02:00
e939f2b934 improved input request 2022-04-29 18:21:18 +02:00
ecd16da2f4 continued RW HK handling 2022-04-28 19:43:16 +02:00
3d1a4044fe run black afmt 2022-04-28 19:04:17 +02:00
981f4f0c3e add basic rw commanding framework 2022-04-28 18:59:15 +02:00
151 changed files with 7893 additions and 5623 deletions

5
.gitignore vendored
View File

@ -5,4 +5,7 @@ __pycache__
log
/gps_log.txt
/config/*.json
tmtc_conf.json
/scex_conf.json
/tmtc_conf.json
/seqcnt.txt

4
.gitmodules vendored
View File

@ -1,7 +1,7 @@
[submodule "tmtccmd"]
path = tmtccmd
path = deps/tmtccmd
url = https://github.com/robamu-org/tmtccmd.git
[submodule "spacepackets"]
path = spacepackets
path = deps/spacepackets
url = https://github.com/robamu-org/py-spacepackets.git

View File

@ -6,14 +6,14 @@
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="C:\Users\jakob\AppData\Local\Programs\Python\Python39\python.exe" />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="false" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-s acu -l -t 6" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s acu -l -d 6" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />

View File

@ -12,10 +12,10 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-s bpx -o hk -t 6 --hk" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s bpx -o hk -d 6" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />

View File

@ -12,8 +12,8 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-s bpx -t 6 --hk" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s bpx -d 6 --hk" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />

View File

@ -12,8 +12,8 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-s bpx -o rst_boot_cnt -t 6" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s bpx -o rst_boot_cnt -d 6" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />

View File

@ -12,7 +12,7 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s gps0 -l" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />

View File

@ -12,7 +12,7 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s gps1 -l" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />

View File

@ -12,7 +12,7 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s heater -o 0 -l" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />

View File

@ -12,8 +12,8 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-c udp -s imtq -o 8 -l -t 4 --hk" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-c udp -s imtq -o 8 -l -d 4 --hk" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />

View File

@ -12,8 +12,8 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-s imtq -o 2 -l -t 4 --hk" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s imtq -o 2 -l -d 4 --hk" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />

View File

@ -12,8 +12,8 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-c udp -s imtq -o 4 -l -t 4 --hk" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s imtq -o 4 -l -d 4 --hk" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />

View File

@ -12,8 +12,8 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-c udp -s imtq -o 6 -l -t 4 --hk" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s imtq -o 6 -l -d 4 --hk" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />

View File

@ -12,8 +12,8 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-c udp -s imtq -o 1 -l -t 4 --hk" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s imtq -o 1 -l -d 4 --hk" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />

View File

@ -12,8 +12,8 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-c udp -s imtq -o 3 -l -t 4 --hk" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s imtq -o 3 -l -d 4 --hk" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />

View File

@ -12,8 +12,8 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-c udp -s imtq -o 5 -l -t 4 --hk" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-c udp -s imtq -o 5 -l -d 4 --hk" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />

View File

@ -12,8 +12,8 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-m seqcmd -c udp -s imtq -l -t 4" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-m seqcmd -c udp -s imtq -l -d 4" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />

View File

@ -12,7 +12,7 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s p60dock -l" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />

View File

@ -12,8 +12,8 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-s pdu1 -t 6" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s pdu1 -d 6" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />

View File

@ -12,8 +12,8 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-s pdu2 -l -t 6" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s pdu2 -l -d 6" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />

View File

@ -12,8 +12,8 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-s ploc_mpsoc -t 6" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s ploc_mpsoc -d 6" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />

View File

@ -12,8 +12,8 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-s ploc_supv -t 6" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s ploc_supv -d 6" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />

View File

@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="tmtccmd Listener Mode" type="PythonConfigurationType" factoryName="Python">
<configuration default="false" name="Ping Command" type="PythonConfigurationType" factoryName="Python">
<module name="tmtc" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
@ -12,8 +12,8 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-m listener --hk" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s 17 -o 0 -d 3" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />

View File

@ -12,8 +12,8 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-s reaction_wheel_1 -l -t 8 --hk" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s reaction_wheel_1 -l -d 8 --hk" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />

View File

@ -12,8 +12,8 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-s reaction_wheel_2 -l -t 6 --hk" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s reaction_wheel_2 -l -d 6 --hk" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />

View File

@ -12,8 +12,8 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-s reaction_wheel_3 -l -t 6 --hk" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s reaction_wheel_3 -l -d 6 --hk" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />

View File

@ -12,8 +12,8 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-s reaction_wheel_4 -l -t 12 --hk" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s reaction_wheel_4 -l -d 12 --hk" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />

View File

@ -13,7 +13,7 @@
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-s core -o reboot_0_0 -t 4" />
<option name="PARAMETERS" value="-s core -o reboot_0_0 -d 4" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />

View File

@ -12,8 +12,8 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-s core -o reboot_0_1 -t 4" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s core -o reboot_0_1 -d 4" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />

View File

@ -12,8 +12,8 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-s core -o reboot_1_0 -t 4" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s core -o reboot_1_0 -d 4" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />

View File

@ -12,8 +12,8 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-s core -o reboot_1_1 -t 4" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s core -o reboot_1_1 -d 4" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />

View File

@ -12,8 +12,8 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-s core -o reboot -t 4" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s core -o reboot -d 4" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />

View File

@ -12,8 +12,8 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-s core -o reboot_self -t 4" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s core -o reboot_self -d 4" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />

24
.run/SCEX .run.xml Normal file
View File

@ -0,0 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="SCEX " type="PythonConfigurationType" factoryName="Python" folderName="Devices">
<module name="tmtc" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s scex" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
</component>

View File

@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Ping Command" type="PythonConfigurationType" factoryName="Python" folderName="PUS">
<configuration default="false" name="SCEX Ping" type="PythonConfigurationType" factoryName="Python" folderName="Devices">
<module name="tmtc" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
@ -13,7 +13,7 @@
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-s 17 -o 0 -t 3" />
<option name="PARAMETERS" value="-s scex -o ping" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />

24
.run/SCEX oneCell.run.xml Normal file
View File

@ -0,0 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="SCEX oneCell" type="PythonConfigurationType" factoryName="Python" folderName="Devices">
<module name="tmtc" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s scex -o 4 -d 4" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
</component>

View File

@ -12,7 +12,7 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s sa_depl -o 0 -l" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />

24
.run/Service 17.run.xml Normal file
View File

@ -0,0 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Service 17" type="PythonConfigurationType" factoryName="Python" folderName="PUS">
<module name="tmtc" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s 17" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
</component>

View File

@ -12,8 +12,8 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-s star_tracker -l -t 6" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s star_tracker -l -d 6" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />

View File

@ -12,8 +12,8 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-s syrlinks -t 6" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s syrlinks -d 6" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />

View File

@ -12,7 +12,7 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-m 3 -c 2 -s SYRLINKS -l --hk" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />

View File

@ -12,7 +12,7 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-m 3 -c 2 -s TMP1075_1 -l" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />

View File

@ -12,7 +12,7 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-m 1 -c 2 -s TMP1075_2 -l" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />

24
.run/TV Test.run.xml Normal file
View File

@ -0,0 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="TV Test Oneshot" type="PythonConfigurationType" factoryName="Python" folderName="TV">
<module name="tmtc" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s proc" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
</component>

View File

@ -1,18 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Unittests in spacepackets" type="tests" factoryName="Unittests">
<module name="tmtc" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/spacepackets/tests" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="_new_pattern" value="&quot;&quot;" />
<option name="_new_additionalArguments" value="&quot;&quot;" />
<option name="_new_target" value="&quot;$PROJECT_DIR$/spacepackets/tests&quot;" />
<option name="_new_targetType" value="&quot;PATH&quot;" />
<method v="2" />
</configuration>
</component>

View File

@ -1,18 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Unittests in tmtccmd" type="tests" factoryName="Unittests">
<module name="tmtc" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/tmtccmd/src/tests" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="_new_pattern" value="&quot;&quot;" />
<option name="_new_additionalArguments" value="&quot;&quot;" />
<option name="_new_target" value="&quot;$PROJECT_DIR$/tmtccmd/src/tests&quot;" />
<option name="_new_targetType" value="&quot;PATH&quot;" />
<method v="2" />
</configuration>
</component>

View File

@ -12,8 +12,8 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-c udp -s imtq -o 7 -l -t 4 --hk" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-c udp -s imtq -o 7 -l -d 4 --hk" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />

View File

@ -12,7 +12,7 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s ccsds_handler -l -t 8 --hk" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />

View File

@ -12,7 +12,7 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtc_client_cli.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s pdec_handler -l -t 8 --hk" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />

View File

@ -0,0 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="tmtc listener" type="PythonConfigurationType" factoryName="Python">
<module name="tmtc" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-l" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
</component>

View File

@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="tmtcc Service 17" type="PythonConfigurationType" factoryName="Python" folderName="PUS">
<configuration default="false" name="Service 17 w Listener" type="PythonConfigurationType" factoryName="Python" folderName="PUS">
<module name="tmtc" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
@ -12,7 +12,7 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s 17 -l" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />

View File

@ -12,8 +12,8 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-s 2 -t 4" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s 2 -d 4" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />

View File

@ -12,8 +12,8 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-s 200 -o 0 -t 4" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s 200 -o 0 -d 4" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />

View File

@ -12,7 +12,7 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s 3 --hk" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />

View File

@ -12,8 +12,8 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-s 8 -t 8" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-s 8 -d 8" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />

View File

@ -12,7 +12,7 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />

View File

@ -12,7 +12,7 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-h" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />

View File

@ -12,8 +12,8 @@
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcgui.py" />
<option name="PARAMETERS" value="" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
<option name="PARAMETERS" value="-g" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />

24
.run/tmtcloop.run.xml Normal file
View File

@ -0,0 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="tmtcloop" type="PythonConfigurationType" factoryName="Python" nameIsGenerated="true">
<module name="tmtc" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcloop.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
</component>

View File

@ -10,8 +10,45 @@ list yields a list of all related PRs for each release.
# [unreleased]
# [v1.13.0]
- Major Update for `tmtccmd` and `spacepackets` dependencies which improves user API significantly.
PR: https://egit.irs.uni-stuttgart.de/eive/eive-tmtc/pulls/102
# [v1.12.0] 05.07.2022
- Update GPS HK Parsing
PR: https://egit.irs.uni-stuttgart.de/eive/eive-tmtc/pulls/86
- PL PCDU HK Parsing
PR: https://egit.irs.uni-stuttgart.de/eive/eive-tmtc/pulls/87
- Add full regular reboot command
PR: https://egit.irs.uni-stuttgart.de/eive/eive-tmtc/pulls/85
- Add Rad Sensor HK parsing
PR: https://egit.irs.uni-stuttgart.de/eive/eive-tmtc/pulls/81
- Add procedures, parser functions and general application functionalities
for the thermal-vacuum test. This includes daemon functionality to poll
all Telemetry even when there is no operator present
PR: https://egit.irs.uni-stuttgart.de/eive/eive-tmtc/pulls/76
https://egit.irs.uni-stuttgart.de/eive/eive-tmtc/pulls/74
https://egit.irs.uni-stuttgart.de/eive/eive-tmtc/pulls/79
https://egit.irs.uni-stuttgart.de/eive/eive-tmtc/pulls/73
- Add ACU HK parsing
PR: https://egit.irs.uni-stuttgart.de/eive/eive-tmtc/pulls/80
# [v1.11.0]
- Add `setup.cfg` and `setup.py` file, allowing package installation
- New ploc commands
- Removed commands related to obsolete ploc updater component
- Adds `tmtcloop.py`, which allows receiving TMs continously while being able to send TCs at will.
- Added more RW HK handling and RW Assembly commands
- Pack additional parameter which identifiers whether heater is commanded externally or internally
PR: https://egit.irs.uni-stuttgart.de/eive/eive-tmtc/pulls/67
## Added
- Helper printout for heater commands
# [v1.10.0 and before]
- Add additional heater commands to command health states

130
README.md
View File

@ -1,5 +1,92 @@
# TMTC Commander EIVE
This application can be used to test the EIVE On-Board Software. Furthermore, it can
also be used to retrieve all sorts of telemetry data like housekeeping data.
It is recommended to use this application with a virtual environment.
The [virtual environemnt](#venv) chapter describes how to set one up. The [requirements](#reqs)
describes how to install all required packages.
The configuration file can currently be found at `tmtc_conf.json`. It caches settings
like the default communication interface or parameters like the TCP port when using the TCP
communication interface.
# Examples
Assuming you are running in a [virtual environment](#venv) and all [package requirements](#reqs)
were installed properly.
Run CLI mode
```sh
./tmtccli.py
```
Run GUI mode
```sh
./tmtcgui.py
```
# <a id="venv"></a> Set up virtual environment
## Linux
1. Create virtual environment
```sh
python3 -m venv venv
```
2. Activate virtual environment
```sh
. venv/bin/activate
```
## Windows
1. Create virtual environment
```sh
py -m venv venv
```
2. Activate virtual environment
```sh
venv\Scripts\activate.bat
```
# <a id="reqs"></a> Install requirements
There are two ways to install the requirements. One is to install the primary dependency
`tmtccmd` interactively. This is the recommended way
Assuming you are running in a virtual environment:
1. Install `tmtccmd` for virtual environment. `-e` for interactive installation.
```sh
cd tmtccmd
pip install -e .[gui]
```
2. You can also install the `spacepackets` package locally/interactively
Normally, it will be installed as a `tmtccmd` dependency.
```sh
cd spacepackets
pip install -e .
```
Alternatively you can also install the packages from PyPI completely, but the risk of
incompatibilities will be high there
```sh
pip install -r requirements.txt
```
# Run Linter
Can be used to quickly check validity of script. Install `flake8` first
@ -20,47 +107,10 @@ and then run the `lint.py` script
./lint.py
```
# Set up virtual environment
# Run Auto-Formatter
## Linux
1. Create virtual environment
This repo is auto-formatted using `black`. Assuming `black` is installed, you can simply run
```sh
python3 -m venv .
black .
```
2. Activate virtual environment
```sh
./Scripts/activate
```
3. Install `tmtccmd` for virtual environment. `-e` for interactive installation.
```sh
cd tmtccmd
python3 -m pip install -e .[gui]
```
## Windows
1. Create virtual environment
```sh
py -m venv .
```
2. Activate virtual environment
```sh
Scripts\activate.bat
```
3. Install `tmtccmd` for virtual environment. `-e` for interactive installation.
```sh
cd tmtccmd
py -m pip install -e .[gui]
```

View File

@ -0,0 +1,6 @@
SW_NAME = "eive"
VERSION_MAJOR = 1
VERSION_MINOR = 11
VERSION_SUBMINOR = 0
__version__ = "1.11.0"

View File

@ -1,14 +0,0 @@
"""
@brief This file exposes hook functions to the user.
@details Template configuration file. Copy this folder to the TMTC commander root and adapt
it to your needs.
"""
from spacepackets.ecss.tc import PusTelecommand
def command_preparation_hook() -> PusTelecommand:
"""
Can be used to pack user-defined commands by generating and returning a PusTelecommand
class instance
"""
return PusTelecommand(service=17, subservice=1, ssc=20)

View File

@ -5,7 +5,7 @@
"""
import enum
from tmtccmd.core.backend import TmTcHandler
from tmtccmd import CcsdsTmtcBackend
from tmtccmd.logging import get_console_logger
LOGGER = get_console_logger()
@ -15,5 +15,5 @@ class CustomModeList(enum.IntEnum):
pass
def custom_mode_operation(tmtc_backend: TmTcHandler, mode: int):
def custom_mode_operation(_tmtc_backend: CcsdsTmtcBackend, _mode: int):
pass

View File

@ -8,6 +8,7 @@ import enum
PUS_APID = 0x65
SPACE_PACKET_IDS = (0x08 << 8 | PUS_APID,)
class CustomServiceList(enum.Enum):
@ -15,6 +16,7 @@ class CustomServiceList(enum.Enum):
P60DOCK = "p60dock"
PDU1 = "pdu1"
PDU2 = "pdu2"
POWER = "power"
ACU = "acu"
ACS = "acs"
BPX_BATTERY = "bpx"
@ -27,14 +29,13 @@ class CustomServiceList(enum.Enum):
PCDU = "pcdu"
PL_PCDU = "plpcdu"
SA_DEPLYOMENT = "sa_depl"
REACTION_WHEEL_1 = "reaction_wheel_1"
REACTION_WHEEL_2 = "reaction_wheel_2"
REACTION_WHEEL_3 = "reaction_wheel_3"
REACTION_WHEEL_4 = "reaction_wheel_4"
REACTION_WHEEL_1 = "rw-1"
REACTION_WHEEL_2 = "rw-2"
REACTION_WHEEL_3 = "rw-3"
REACTION_WHEEL_4 = "rw-4"
RW_ASSEMBLY = "rw-ass"
RAD_SENSOR = "rad_sensor"
PLOC_UPDATER = "ploc_updater"
GPS_0 = "gps0"
GPS_1 = "gps1"
GPS_CTRL = "gnss-ctrl"
PLOC_MEMORY_DUMPER = "ploc_memory_dumper"
CORE = "core"
STAR_TRACKER = "star_tracker"
@ -42,7 +43,14 @@ class CustomServiceList(enum.Enum):
PDEC_HANDLER = "pdec_handler"
STR_IMG_HELPER = "str_img_helper"
SYRLINKS = "syrlinks"
ACS_CTRL = "acs-ctrl"
ACS_ASS = "acs-ass"
SUS_ASS = "sus-ass"
TCS = "tcs"
TCS_ASS = "tcs-ass"
TIME = "time"
PROCEDURE = "proc"
RTD = "rtd"
TVTTESTPROCEDURE = "tvtestproc"
CONTROLLERS = "controllers"
SCEX = "scex"

View File

@ -1,3 +1,4 @@
Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
2200;0x0898;STORE_SEND_WRITE_FAILED;LOW;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
2201;0x0899;STORE_WRITE_FAILED;LOW;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
2202;0x089a;STORE_SEND_READ_FAILED;LOW;;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
@ -75,10 +76,11 @@
7905;0x1ee1;FRAME_PROCESSING_FAILED;LOW;The CCSDS Board could not interpret a TC;fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
8900;0x22c4;CLOCK_SET;INFO;;fsfw/src/fsfw/pus/Service9TimeManagement.h
8901;0x22c5;CLOCK_SET_FAILURE;LOW;;fsfw/src/fsfw/pus/Service9TimeManagement.h
9100;0x238c;TC_DELETION_FAILED;MEDIUM;Deletion of a TC from the map failed. P1: First 32 bit of request ID, P2. Last 32 bit of Request ID;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
9700;0x25e4;TEST;INFO;;fsfw/src/fsfw/pus/Service17Test.h
10600;0x2968;CHANGE_OF_SETUP_PARAMETER;LOW;;fsfw/hal/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h
10600;0x2968;CHANGE_OF_SETUP_PARAMETER;LOW;;fsfw/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h
11300;0x2c24;SWITCH_CMD_SENT;INFO;Indicates that a FSFW object requested setting a switch P1: 1 if on was requested, 0 for off | P2: Switch Index;mission/devices/devicedefinitions/powerDefinitions.h
11301;0x2c25;SWITCH_HAS_CHANGED;INFO;Indicated that a swithc state has changed P1: New switch state, 1 for on, 0 for off | P2: Switch Index;mission/devices/devicedefinitions/powerDefinitions.h
11301;0x2c25;SWITCH_HAS_CHANGED;INFO;Indicated that a switch state has changed P1: New switch state, 1 for on, 0 for off | P2: Switch Index;mission/devices/devicedefinitions/powerDefinitions.h
11302;0x2c26;SWITCHING_Q7S_DENIED;MEDIUM;;mission/devices/devicedefinitions/powerDefinitions.h
11303;0x2c27;FDIR_REACTION_IGNORED;MEDIUM;;mission/devices/devicedefinitions/powerDefinitions.h
11400;0x2c88;GPIO_PULL_HIGH_FAILED;LOW;;mission/devices/HeaterHandler.h
@ -88,6 +90,7 @@
11404;0x2c8c;SWITCH_ALREADY_ON;LOW;;mission/devices/HeaterHandler.h
11405;0x2c8d;SWITCH_ALREADY_OFF;LOW;;mission/devices/HeaterHandler.h
11406;0x2c8e;MAIN_SWITCH_TIMEOUT;MEDIUM;;mission/devices/HeaterHandler.h
11407;0x2c8f;FAULTY_HEATER_WAS_ON;LOW;;mission/devices/HeaterHandler.h
11500;0x2cec;MAIN_SWITCH_ON_TIMEOUT;LOW;;mission/devices/SolarArrayDeploymentHandler.h
11501;0x2ced;MAIN_SWITCH_OFF_TIMEOUT;LOW;;mission/devices/SolarArrayDeploymentHandler.h
11502;0x2cee;DEPLOYMENT_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h
@ -97,7 +100,7 @@
11602;0x2d52;ACK_FAILURE;LOW;PLOC receive acknowledgment failure report P1: Command Id which leads the acknowledgment failure report P2: The status field inserted by the MPSoC into the data field;linux/devices/ploc/PlocMPSoCHandler.h
11603;0x2d53;EXE_FAILURE;LOW;PLOC receive execution failure report P1: Command Id which leads the execution failure report P2: The status field inserted by the MPSoC into the data field;linux/devices/ploc/PlocMPSoCHandler.h
11604;0x2d54;MPSOC_HANDLER_CRC_FAILURE;LOW;PLOC reply has invalid crc;linux/devices/ploc/PlocMPSoCHandler.h
11605;0x2d55;MPSOC_HANDLER_SEQ_CNT_MISMATCH;LOW;Packet sequence count in received space packet does not match expected count P1: Expected sequence count P2: Received sequence count;linux/devices/ploc/PlocMPSoCHandler.h
11605;0x2d55;MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH;LOW;Packet sequence count in received space packet does not match expected count P1: Expected sequence count P2: Received sequence count;linux/devices/ploc/PlocMPSoCHandler.h
11606;0x2d56;MPSOC_SHUTDOWN_FAILED;HIGH;Supervisor fails to shutdown MPSoC. Requires to power off the PLOC and thus also to shutdown the supervisor.;linux/devices/ploc/PlocMPSoCHandler.h
11701;0x2db5;SELF_TEST_I2C_FAILURE;LOW;Get self test result returns I2C failure P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/IMTQHandler.h
11702;0x2db6;SELF_TEST_SPI_FAILURE;LOW;Get self test result returns SPI failure. This concerns the MTM connectivity. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/IMTQHandler.h
@ -107,21 +110,17 @@
11706;0x2dba;SELF_TEST_MTM_RANGE_FAILURE;LOW;Get self test result returns failure that MTM values were outside of the expected range. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/IMTQHandler.h
11707;0x2dbb;SELF_TEST_COIL_CURRENT_FAILURE;LOW;Get self test result returns failure indicating that the coil current was outside of the expected range P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/IMTQHandler.h
11708;0x2dbc;INVALID_ERROR_BYTE;LOW;Received invalid error byte. This indicates an error of the communication link between IMTQ and OBC.;mission/devices/IMTQHandler.h
11801;0x2e19;ERROR_STATE;HIGH;Reaction wheel signals an error state;mission/devices/RwHandler.h
11801;0x2e19;ERROR_STATE;HIGH;Reaction wheel signals an error state;mission/devices/devicedefinitions/RwDefinitions.h
11802;0x2e1a;RESET_OCCURED;LOW;;mission/devices/devicedefinitions/RwDefinitions.h
11901;0x2e7d;BOOTING_FIRMWARE_FAILED;LOW;Failed to boot firmware;linux/devices/startracker/StarTrackerHandler.h
11902;0x2e7e;BOOTING_BOOTLOADER_FAILED;LOW;Failed to boot star tracker into bootloader mode;linux/devices/startracker/StarTrackerHandler.h
12001;0x2ee1;SUPV_MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC supervisor crc failure in telemetry packet;linux/devices/ploc/PlocSupervisorHandler.h
12002;0x2ee2;SUPV_ACK_FAILURE;LOW;PLOC supervisor received acknowledgment failure report;linux/devices/ploc/PlocSupervisorHandler.h
12003;0x2ee3;SUPV_EXE_FAILURE;LOW;PLOC received execution failure report;linux/devices/ploc/PlocSupervisorHandler.h
12003;0x2ee3;SUPV_EXE_FAILURE;LOW;PLOC received execution failure report P1: ID of command for which the execution failed P2: Status code sent by the supervisor handler;linux/devices/ploc/PlocSupervisorHandler.h
12004;0x2ee4;SUPV_CRC_FAILURE_EVENT;LOW;PLOC supervisor reply has invalid crc;linux/devices/ploc/PlocSupervisorHandler.h
12005;0x2ee5;SUPV_MPSOC_SHUWDOWN_BUILD_FAILED;LOW;Failed to build the command to shutdown the MPSoC;linux/devices/ploc/PlocSupervisorHandler.h
12100;0x2f44;SANITIZATION_FAILED;LOW;;bsp_q7s/memory/SdCardManager.h
12101;0x2f45;MOUNTED_SD_CARD;INFO;;bsp_q7s/memory/SdCardManager.h
12200;0x2fa8;UPDATE_FILE_NOT_EXISTS;LOW;;linux/devices/ploc/PlocUpdater.h
12201;0x2fa9;ACTION_COMMANDING_FAILED;LOW;Failed to send command to supervisor handler P1: Return value of CommandActionHelper::commandAction P2: Action ID of command to send;linux/devices/ploc/PlocUpdater.h
12202;0x2faa;UPDATE_AVAILABLE_FAILED;LOW;Supervisor handler replied action message indicating a command execution failure of the update available command;linux/devices/ploc/PlocUpdater.h
12203;0x2fab;UPDATE_TRANSFER_FAILED;LOW;Supervisor handler failed to transfer an update space packet. P1: Parameter holds the number of update packets already sent (inclusive the failed packet);linux/devices/ploc/PlocUpdater.h
12204;0x2fac;UPDATE_VERIFY_FAILED;LOW;Supervisor failed to execute the update verify command.;linux/devices/ploc/PlocUpdater.h
12205;0x2fad;UPDATE_FINISHED;INFO;MPSoC update successful completed;linux/devices/ploc/PlocUpdater.h
12300;0x300c;SEND_MRAM_DUMP_FAILED;LOW;Failed to send mram dump command to supervisor handler P1: Return value of commandAction function P2: Start address of MRAM to dump with this command;linux/devices/ploc/PlocMemoryDumper.h
12301;0x300d;MRAM_DUMP_FAILED;LOW;Received completion failure report form PLOC supervisor handler P1: MRAM start address of failing dump command;linux/devices/ploc/PlocMemoryDumper.h
12302;0x300e;MRAM_DUMP_FINISHED;LOW;MRAM dump finished successfully;linux/devices/ploc/PlocMemoryDumper.h
@ -129,6 +128,8 @@
12402;0x3072;INVALID_FAR;HIGH;Read invalid FAR from PDEC after startup;linux/obc/PdecHandler.h
12403;0x3073;CARRIER_LOCK;INFO;Carrier lock detected;linux/obc/PdecHandler.h
12404;0x3074;BIT_LOCK_PDEC;INFO;Bit lock detected (data valid);linux/obc/PdecHandler.h
12405;0x3075;LOST_CARRIER_LOCK_PDEC;INFO;Lost carrier lock;linux/obc/PdecHandler.h
12406;0x3076;LOST_BIT_LOCK_PDEC;INFO;Lost bit lock;linux/obc/PdecHandler.h
12500;0x30d4;IMAGE_UPLOAD_FAILED;LOW;Image upload failed;linux/devices/startracker/StrHelper.h
12501;0x30d5;IMAGE_DOWNLOAD_FAILED;LOW;Image download failed;linux/devices/startracker/StrHelper.h
12502;0x30d6;IMAGE_UPLOAD_SUCCESSFUL;LOW;Uploading image to star tracker was successfulop;linux/devices/startracker/StrHelper.h
@ -148,15 +149,15 @@
12516;0x30e4;STR_HELPER_REQUESTING_MSG_FAILED;LOW;;linux/devices/startracker/StrHelper.h
12600;0x3138;MPSOC_FLASH_WRITE_FAILED;LOW;Flash write fails;linux/devices/ploc/PlocMPSoCHelper.h
12601;0x3139;MPSOC_FLASH_WRITE_SUCCESSFUL;LOW;Flash write successful;linux/devices/ploc/PlocMPSoCHelper.h
12602;0x313a;SENDING_COMMAND_FAILED;LOW;;linux/devices/ploc/PlocMPSoCHelper.h
12602;0x313a;MPSOC_SENDING_COMMAND_FAILED;LOW;;linux/devices/ploc/PlocMPSoCHelper.h
12603;0x313b;MPSOC_HELPER_REQUESTING_REPLY_FAILED;LOW;Request receive message of communication interface failed P1: Return value returned by the communication interface requestReceiveMessage function P2: Internal state of MPSoC helper;linux/devices/ploc/PlocMPSoCHelper.h
12604;0x313c;MPSOC_HELPER_READING_REPLY_FAILED;LOW;Reading receive message of communication interface failed P1: Return value returned by the communication interface readingReceivedMessage function P2: Internal state of MPSoC helper;linux/devices/ploc/PlocMPSoCHelper.h
12605;0x313d;MISSING_ACK;LOW;Did not receive acknowledgement report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux/devices/ploc/PlocMPSoCHelper.h
12606;0x313e;MISSING_EXE;LOW;Did not receive execution report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux/devices/ploc/PlocMPSoCHelper.h
12607;0x313f;ACK_FAILURE_REPORT;LOW;Received acknowledgement failure report P1: Internal state of MPSoC;linux/devices/ploc/PlocMPSoCHelper.h
12608;0x3140;EXE_FAILURE_REPORT;LOW;Received execution failure report P1: Internal state of MPSoC;linux/devices/ploc/PlocMPSoCHelper.h
12609;0x3141;ACK_INVALID_APID;LOW;Expected acknowledgement report but received space packet with other apid P1: Apid of received space packet P2: Internal state of MPSoC;linux/devices/ploc/PlocMPSoCHelper.h
12610;0x3142;EXE_INVALID_APID;LOW;Expected execution report but received space packet with other apid P1: Apid of received space packet P2: Internal state of MPSoC;linux/devices/ploc/PlocMPSoCHelper.h
12605;0x313d;MPSOC_MISSING_ACK;LOW;Did not receive acknowledgment report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux/devices/ploc/PlocMPSoCHelper.h
12606;0x313e;MPSOC_MISSING_EXE;LOW;Did not receive execution report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux/devices/ploc/PlocMPSoCHelper.h
12607;0x313f;MPSOC_ACK_FAILURE_REPORT;LOW;Received acknowledgment failure report P1: Internal state of MPSoC;linux/devices/ploc/PlocMPSoCHelper.h
12608;0x3140;MPSOC_EXE_FAILURE_REPORT;LOW;Received execution failure report P1: Internal state of MPSoC;linux/devices/ploc/PlocMPSoCHelper.h
12609;0x3141;MPSOC_ACK_INVALID_APID;LOW;Expected acknowledgment report but received space packet with other apid P1: Apid of received space packet P2: Internal state of MPSoC;linux/devices/ploc/PlocMPSoCHelper.h
12610;0x3142;MPSOC_EXE_INVALID_APID;LOW;Expected execution report but received space packet with other apid P1: Apid of received space packet P2: Internal state of MPSoC;linux/devices/ploc/PlocMPSoCHelper.h
12611;0x3143;MPSOC_HELPER_SEQ_CNT_MISMATCH;LOW;Received sequence count does not match expected sequence count P1: Expected sequence count P2: Received sequence count;linux/devices/ploc/PlocMPSoCHelper.h
12700;0x319c;TRANSITION_BACK_TO_OFF;MEDIUM;Could not transition properly and went back to ALL OFF;mission/devices/PayloadPcduHandler.h
12701;0x319d;NEG_V_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
@ -183,7 +184,27 @@
13200;0x3390;P60_BOOT_COUNT;INFO;P60 boot count is broadcasted once at SW startup. P1: Boot count;mission/devices/P60DockHandler.h
13201;0x3391;BATT_MODE;INFO;Battery mode is broadcasted at startup. P1: Mode;mission/devices/P60DockHandler.h
13202;0x3392;BATT_MODE_CHANGED;MEDIUM;Battery mode has changed. P1: Old mode. P2: New mode;mission/devices/P60DockHandler.h
13600;0x3520;ALLOC_FAILURE;MEDIUM;;bsp_q7s/core/CoreController.h
13601;0x3521;REBOOT_SW;MEDIUM; Software reboot occured. Can also be a systemd reboot. P1: Current Chip, P2: Current Copy;bsp_q7s/core/CoreController.h
13602;0x3522;REBOOT_MECHANISM_TRIGGERED;MEDIUM;The reboot mechanism was triggered. P1: First 16 bits: Last Chip, Last 16 bits: Last Copy, P2: Each byte is the respective reboot count for the slots;bsp_q7s/core/CoreController.h
13603;0x3523;REBOOT_HW;MEDIUM;;bsp_q7s/core/CoreController.h
13600;0x3520;SUPV_UPDATE_FAILED;LOW;update failed;linux/devices/ploc/PlocSupvHelper.h
13601;0x3521;SUPV_UPDATE_SUCCESSFUL;LOW;update successful;linux/devices/ploc/PlocSupvHelper.h
13602;0x3522;SUPV_CONTINUE_UPDATE_FAILED;LOW;Continue update command failed;linux/devices/ploc/PlocSupvHelper.h
13603;0x3523;SUPV_CONTINUE_UPDATE_SUCCESSFUL;LOW;Continue update command successful;linux/devices/ploc/PlocSupvHelper.h
13604;0x3524;TERMINATED_UPDATE_PROCEDURE;LOW;Terminated update procedure by command;linux/devices/ploc/PlocSupvHelper.h
13605;0x3525;SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL;LOW;Requesting event buffer was successful;linux/devices/ploc/PlocSupvHelper.h
13606;0x3526;SUPV_EVENT_BUFFER_REQUEST_FAILED;LOW;Requesting event buffer failed;linux/devices/ploc/PlocSupvHelper.h
13607;0x3527;SUPV_EVENT_BUFFER_REQUEST_TERMINATED;LOW;Terminated event buffer request by command P1: Number of packets read before process was terminated;linux/devices/ploc/PlocSupvHelper.h
13608;0x3528;SUPV_SENDING_COMMAND_FAILED;LOW;;linux/devices/ploc/PlocSupvHelper.h
13609;0x3529;SUPV_HELPER_REQUESTING_REPLY_FAILED;LOW;Request receive message of communication interface failed P1: Return value returned by the communication interface requestReceiveMessage function P2: Internal state of supervisor helper;linux/devices/ploc/PlocSupvHelper.h
13610;0x352a;SUPV_HELPER_READING_REPLY_FAILED;LOW;Reading receive message of communication interface failed P1: Return value returned by the communication interface readingReceivedMessage function P2: Internal state of supervisor helper;linux/devices/ploc/PlocSupvHelper.h
13611;0x352b;SUPV_MISSING_ACK;LOW;Did not receive acknowledgement report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux/devices/ploc/PlocSupvHelper.h
13612;0x352c;SUPV_MISSING_EXE;LOW;Supervisor did not receive execution report P1: Number of bytes missing P2: Internal state of supervisor helper;linux/devices/ploc/PlocSupvHelper.h
13613;0x352d;SUPV_ACK_FAILURE_REPORT;LOW;Supervisor received acknowledgment failure report P1: Internal state of supervisor helper;linux/devices/ploc/PlocSupvHelper.h
13614;0x352e;SUPV_EXE_FAILURE_REPORT;LOW;Execution report failure P1:;linux/devices/ploc/PlocSupvHelper.h
13615;0x352f;SUPV_ACK_INVALID_APID;LOW;Supervisor expected acknowledgment report but received space packet with other apid P1: Apid of received space packet P2: Internal state of supervisor helper;linux/devices/ploc/PlocSupvHelper.h
13616;0x3530;SUPV_EXE_INVALID_APID;LOW;Supervisor helper expected execution report but received space packet with other apid P1: Apid of received space packet P2: Internal state of supervisor helper;linux/devices/ploc/PlocSupvHelper.h
13617;0x3531;ACK_RECEPTION_FAILURE;LOW;Failed to receive acknowledgment report P1: Return value P2: Apid of command for which the reception of the acknowledgment report failed;linux/devices/ploc/PlocSupvHelper.h
13618;0x3532;EXE_RECEPTION_FAILURE;LOW;Failed to receive execution report P1: Return value P2: Apid of command for which the reception of the execution report failed;linux/devices/ploc/PlocSupvHelper.h
13619;0x3533;WRITE_MEMORY_FAILED;LOW;Update procedure failed when sending packet with number P1 P1: Packet number for which the memory write command fails;linux/devices/ploc/PlocSupvHelper.h
13700;0x3584;ALLOC_FAILURE;MEDIUM;;bsp_q7s/core/CoreController.h
13701;0x3585;REBOOT_SW;MEDIUM; Software reboot occurred. Can also be a systemd reboot. P1: Current Chip, P2: Current Copy;bsp_q7s/core/CoreController.h
13702;0x3586;REBOOT_MECHANISM_TRIGGERED;MEDIUM;The reboot mechanism was triggered. P1: First 16 bits: Last Chip, Last 16 bits: Last Copy, P2: Each byte is the respective reboot count for the slots;bsp_q7s/core/CoreController.h
13703;0x3587;REBOOT_HW;MEDIUM;;bsp_q7s/core/CoreController.h

1 2200 Event ID (dec) 0x0898 Event ID (hex) STORE_SEND_WRITE_FAILED Name LOW Severity Description fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h File Path
1 Event ID (dec) Event ID (hex) Name Severity Description File Path
2 2200 2200 0x0898 0x0898 STORE_SEND_WRITE_FAILED STORE_SEND_WRITE_FAILED LOW LOW fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
3 2201 2201 0x0899 0x0899 STORE_WRITE_FAILED STORE_WRITE_FAILED LOW LOW fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
4 2202 2202 0x089a 0x089a STORE_SEND_READ_FAILED STORE_SEND_READ_FAILED LOW LOW fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
76 7905 7905 0x1ee1 0x1ee1 FRAME_PROCESSING_FAILED FRAME_PROCESSING_FAILED LOW LOW The CCSDS Board could not interpret a TC fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
77 8900 8900 0x22c4 0x22c4 CLOCK_SET CLOCK_SET INFO INFO fsfw/src/fsfw/pus/Service9TimeManagement.h
78 8901 8901 0x22c5 0x22c5 CLOCK_SET_FAILURE CLOCK_SET_FAILURE LOW LOW fsfw/src/fsfw/pus/Service9TimeManagement.h
79 9100 0x238c TC_DELETION_FAILED MEDIUM Deletion of a TC from the map failed. P1: First 32 bit of request ID, P2. Last 32 bit of Request ID fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
80 9700 9700 0x25e4 0x25e4 TEST TEST INFO INFO fsfw/src/fsfw/pus/Service17Test.h
81 10600 10600 0x2968 0x2968 CHANGE_OF_SETUP_PARAMETER CHANGE_OF_SETUP_PARAMETER LOW LOW fsfw/hal/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h fsfw/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h
82 11300 11300 0x2c24 0x2c24 SWITCH_CMD_SENT SWITCH_CMD_SENT INFO INFO Indicates that a FSFW object requested setting a switch P1: 1 if on was requested, 0 for off | P2: Switch Index mission/devices/devicedefinitions/powerDefinitions.h
83 11301 11301 0x2c25 0x2c25 SWITCH_HAS_CHANGED SWITCH_HAS_CHANGED INFO INFO Indicated that a swithc state has changed P1: New switch state, 1 for on, 0 for off | P2: Switch Index Indicated that a switch state has changed P1: New switch state, 1 for on, 0 for off | P2: Switch Index mission/devices/devicedefinitions/powerDefinitions.h
84 11302 11302 0x2c26 0x2c26 SWITCHING_Q7S_DENIED SWITCHING_Q7S_DENIED MEDIUM MEDIUM mission/devices/devicedefinitions/powerDefinitions.h
85 11303 11303 0x2c27 0x2c27 FDIR_REACTION_IGNORED FDIR_REACTION_IGNORED MEDIUM MEDIUM mission/devices/devicedefinitions/powerDefinitions.h
86 11400 11400 0x2c88 0x2c88 GPIO_PULL_HIGH_FAILED GPIO_PULL_HIGH_FAILED LOW LOW mission/devices/HeaterHandler.h
90 11404 11404 0x2c8c 0x2c8c SWITCH_ALREADY_ON SWITCH_ALREADY_ON LOW LOW mission/devices/HeaterHandler.h
91 11405 11405 0x2c8d 0x2c8d SWITCH_ALREADY_OFF SWITCH_ALREADY_OFF LOW LOW mission/devices/HeaterHandler.h
92 11406 11406 0x2c8e 0x2c8e MAIN_SWITCH_TIMEOUT MAIN_SWITCH_TIMEOUT MEDIUM MEDIUM mission/devices/HeaterHandler.h
93 11407 0x2c8f FAULTY_HEATER_WAS_ON LOW mission/devices/HeaterHandler.h
94 11500 11500 0x2cec 0x2cec MAIN_SWITCH_ON_TIMEOUT MAIN_SWITCH_ON_TIMEOUT LOW LOW mission/devices/SolarArrayDeploymentHandler.h
95 11501 11501 0x2ced 0x2ced MAIN_SWITCH_OFF_TIMEOUT MAIN_SWITCH_OFF_TIMEOUT LOW LOW mission/devices/SolarArrayDeploymentHandler.h
96 11502 11502 0x2cee 0x2cee DEPLOYMENT_FAILED DEPLOYMENT_FAILED HIGH HIGH mission/devices/SolarArrayDeploymentHandler.h
100 11602 11602 0x2d52 0x2d52 ACK_FAILURE ACK_FAILURE LOW LOW PLOC receive acknowledgment failure report P1: Command Id which leads the acknowledgment failure report P2: The status field inserted by the MPSoC into the data field linux/devices/ploc/PlocMPSoCHandler.h
101 11603 11603 0x2d53 0x2d53 EXE_FAILURE EXE_FAILURE LOW LOW PLOC receive execution failure report P1: Command Id which leads the execution failure report P2: The status field inserted by the MPSoC into the data field linux/devices/ploc/PlocMPSoCHandler.h
102 11604 11604 0x2d54 0x2d54 MPSOC_HANDLER_CRC_FAILURE MPSOC_HANDLER_CRC_FAILURE LOW LOW PLOC reply has invalid crc linux/devices/ploc/PlocMPSoCHandler.h
103 11605 11605 0x2d55 0x2d55 MPSOC_HANDLER_SEQ_CNT_MISMATCH MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH LOW LOW Packet sequence count in received space packet does not match expected count P1: Expected sequence count P2: Received sequence count linux/devices/ploc/PlocMPSoCHandler.h
104 11606 11606 0x2d56 0x2d56 MPSOC_SHUTDOWN_FAILED MPSOC_SHUTDOWN_FAILED HIGH HIGH Supervisor fails to shutdown MPSoC. Requires to power off the PLOC and thus also to shutdown the supervisor. linux/devices/ploc/PlocMPSoCHandler.h
105 11701 11701 0x2db5 0x2db5 SELF_TEST_I2C_FAILURE SELF_TEST_I2C_FAILURE LOW LOW Get self test result returns I2C failure P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA mission/devices/IMTQHandler.h
106 11702 11702 0x2db6 0x2db6 SELF_TEST_SPI_FAILURE SELF_TEST_SPI_FAILURE LOW LOW Get self test result returns SPI failure. This concerns the MTM connectivity. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA mission/devices/IMTQHandler.h
110 11706 11706 0x2dba 0x2dba SELF_TEST_MTM_RANGE_FAILURE SELF_TEST_MTM_RANGE_FAILURE LOW LOW Get self test result returns failure that MTM values were outside of the expected range. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA mission/devices/IMTQHandler.h
111 11707 11707 0x2dbb 0x2dbb SELF_TEST_COIL_CURRENT_FAILURE SELF_TEST_COIL_CURRENT_FAILURE LOW LOW Get self test result returns failure indicating that the coil current was outside of the expected range P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA mission/devices/IMTQHandler.h
112 11708 11708 0x2dbc 0x2dbc INVALID_ERROR_BYTE INVALID_ERROR_BYTE LOW LOW Received invalid error byte. This indicates an error of the communication link between IMTQ and OBC. mission/devices/IMTQHandler.h
113 11801 11801 0x2e19 0x2e19 ERROR_STATE ERROR_STATE HIGH HIGH Reaction wheel signals an error state mission/devices/RwHandler.h mission/devices/devicedefinitions/RwDefinitions.h
114 11802 0x2e1a RESET_OCCURED LOW mission/devices/devicedefinitions/RwDefinitions.h
115 11901 11901 0x2e7d 0x2e7d BOOTING_FIRMWARE_FAILED BOOTING_FIRMWARE_FAILED LOW LOW Failed to boot firmware linux/devices/startracker/StarTrackerHandler.h
116 11902 11902 0x2e7e 0x2e7e BOOTING_BOOTLOADER_FAILED BOOTING_BOOTLOADER_FAILED LOW LOW Failed to boot star tracker into bootloader mode linux/devices/startracker/StarTrackerHandler.h
117 12001 12001 0x2ee1 0x2ee1 SUPV_MEMORY_READ_RPT_CRC_FAILURE SUPV_MEMORY_READ_RPT_CRC_FAILURE LOW LOW PLOC supervisor crc failure in telemetry packet linux/devices/ploc/PlocSupervisorHandler.h
118 12002 12002 0x2ee2 0x2ee2 SUPV_ACK_FAILURE SUPV_ACK_FAILURE LOW LOW PLOC supervisor received acknowledgment failure report linux/devices/ploc/PlocSupervisorHandler.h
119 12003 12003 0x2ee3 0x2ee3 SUPV_EXE_FAILURE SUPV_EXE_FAILURE LOW LOW PLOC received execution failure report PLOC received execution failure report P1: ID of command for which the execution failed P2: Status code sent by the supervisor handler linux/devices/ploc/PlocSupervisorHandler.h
120 12004 12004 0x2ee4 0x2ee4 SUPV_CRC_FAILURE_EVENT SUPV_CRC_FAILURE_EVENT LOW LOW PLOC supervisor reply has invalid crc linux/devices/ploc/PlocSupervisorHandler.h
121 12005 0x2ee5 SUPV_MPSOC_SHUWDOWN_BUILD_FAILED LOW Failed to build the command to shutdown the MPSoC linux/devices/ploc/PlocSupervisorHandler.h
122 12100 12100 0x2f44 0x2f44 SANITIZATION_FAILED SANITIZATION_FAILED LOW LOW bsp_q7s/memory/SdCardManager.h
123 12101 12101 0x2f45 0x2f45 MOUNTED_SD_CARD MOUNTED_SD_CARD INFO INFO bsp_q7s/memory/SdCardManager.h
12200 0x2fa8 UPDATE_FILE_NOT_EXISTS LOW linux/devices/ploc/PlocUpdater.h
12201 0x2fa9 ACTION_COMMANDING_FAILED LOW Failed to send command to supervisor handler P1: Return value of CommandActionHelper::commandAction P2: Action ID of command to send linux/devices/ploc/PlocUpdater.h
12202 0x2faa UPDATE_AVAILABLE_FAILED LOW Supervisor handler replied action message indicating a command execution failure of the update available command linux/devices/ploc/PlocUpdater.h
12203 0x2fab UPDATE_TRANSFER_FAILED LOW Supervisor handler failed to transfer an update space packet. P1: Parameter holds the number of update packets already sent (inclusive the failed packet) linux/devices/ploc/PlocUpdater.h
12204 0x2fac UPDATE_VERIFY_FAILED LOW Supervisor failed to execute the update verify command. linux/devices/ploc/PlocUpdater.h
12205 0x2fad UPDATE_FINISHED INFO MPSoC update successful completed linux/devices/ploc/PlocUpdater.h
124 12300 12300 0x300c 0x300c SEND_MRAM_DUMP_FAILED SEND_MRAM_DUMP_FAILED LOW LOW Failed to send mram dump command to supervisor handler P1: Return value of commandAction function P2: Start address of MRAM to dump with this command linux/devices/ploc/PlocMemoryDumper.h
125 12301 12301 0x300d 0x300d MRAM_DUMP_FAILED MRAM_DUMP_FAILED LOW LOW Received completion failure report form PLOC supervisor handler P1: MRAM start address of failing dump command linux/devices/ploc/PlocMemoryDumper.h
126 12302 12302 0x300e 0x300e MRAM_DUMP_FINISHED MRAM_DUMP_FINISHED LOW LOW MRAM dump finished successfully linux/devices/ploc/PlocMemoryDumper.h
128 12402 12402 0x3072 0x3072 INVALID_FAR INVALID_FAR HIGH HIGH Read invalid FAR from PDEC after startup linux/obc/PdecHandler.h
129 12403 12403 0x3073 0x3073 CARRIER_LOCK CARRIER_LOCK INFO INFO Carrier lock detected linux/obc/PdecHandler.h
130 12404 12404 0x3074 0x3074 BIT_LOCK_PDEC BIT_LOCK_PDEC INFO INFO Bit lock detected (data valid) linux/obc/PdecHandler.h
131 12405 0x3075 LOST_CARRIER_LOCK_PDEC INFO Lost carrier lock linux/obc/PdecHandler.h
132 12406 0x3076 LOST_BIT_LOCK_PDEC INFO Lost bit lock linux/obc/PdecHandler.h
133 12500 12500 0x30d4 0x30d4 IMAGE_UPLOAD_FAILED IMAGE_UPLOAD_FAILED LOW LOW Image upload failed linux/devices/startracker/StrHelper.h
134 12501 12501 0x30d5 0x30d5 IMAGE_DOWNLOAD_FAILED IMAGE_DOWNLOAD_FAILED LOW LOW Image download failed linux/devices/startracker/StrHelper.h
135 12502 12502 0x30d6 0x30d6 IMAGE_UPLOAD_SUCCESSFUL IMAGE_UPLOAD_SUCCESSFUL LOW LOW Uploading image to star tracker was successfulop linux/devices/startracker/StrHelper.h
149 12516 12516 0x30e4 0x30e4 STR_HELPER_REQUESTING_MSG_FAILED STR_HELPER_REQUESTING_MSG_FAILED LOW LOW linux/devices/startracker/StrHelper.h
150 12600 12600 0x3138 0x3138 MPSOC_FLASH_WRITE_FAILED MPSOC_FLASH_WRITE_FAILED LOW LOW Flash write fails linux/devices/ploc/PlocMPSoCHelper.h
151 12601 12601 0x3139 0x3139 MPSOC_FLASH_WRITE_SUCCESSFUL MPSOC_FLASH_WRITE_SUCCESSFUL LOW LOW Flash write successful linux/devices/ploc/PlocMPSoCHelper.h
152 12602 12602 0x313a 0x313a SENDING_COMMAND_FAILED MPSOC_SENDING_COMMAND_FAILED LOW LOW linux/devices/ploc/PlocMPSoCHelper.h
153 12603 12603 0x313b 0x313b MPSOC_HELPER_REQUESTING_REPLY_FAILED MPSOC_HELPER_REQUESTING_REPLY_FAILED LOW LOW Request receive message of communication interface failed P1: Return value returned by the communication interface requestReceiveMessage function P2: Internal state of MPSoC helper linux/devices/ploc/PlocMPSoCHelper.h
154 12604 12604 0x313c 0x313c MPSOC_HELPER_READING_REPLY_FAILED MPSOC_HELPER_READING_REPLY_FAILED LOW LOW Reading receive message of communication interface failed P1: Return value returned by the communication interface readingReceivedMessage function P2: Internal state of MPSoC helper linux/devices/ploc/PlocMPSoCHelper.h
155 12605 12605 0x313d 0x313d MISSING_ACK MPSOC_MISSING_ACK LOW LOW Did not receive acknowledgement report P1: Number of bytes missing P2: Internal state of MPSoC helper Did not receive acknowledgment report P1: Number of bytes missing P2: Internal state of MPSoC helper linux/devices/ploc/PlocMPSoCHelper.h
156 12606 12606 0x313e 0x313e MISSING_EXE MPSOC_MISSING_EXE LOW LOW Did not receive execution report P1: Number of bytes missing P2: Internal state of MPSoC helper linux/devices/ploc/PlocMPSoCHelper.h
157 12607 12607 0x313f 0x313f ACK_FAILURE_REPORT MPSOC_ACK_FAILURE_REPORT LOW LOW Received acknowledgement failure report P1: Internal state of MPSoC Received acknowledgment failure report P1: Internal state of MPSoC linux/devices/ploc/PlocMPSoCHelper.h
158 12608 12608 0x3140 0x3140 EXE_FAILURE_REPORT MPSOC_EXE_FAILURE_REPORT LOW LOW Received execution failure report P1: Internal state of MPSoC linux/devices/ploc/PlocMPSoCHelper.h
159 12609 12609 0x3141 0x3141 ACK_INVALID_APID MPSOC_ACK_INVALID_APID LOW LOW Expected acknowledgement report but received space packet with other apid P1: Apid of received space packet P2: Internal state of MPSoC Expected acknowledgment report but received space packet with other apid P1: Apid of received space packet P2: Internal state of MPSoC linux/devices/ploc/PlocMPSoCHelper.h
160 12610 12610 0x3142 0x3142 EXE_INVALID_APID MPSOC_EXE_INVALID_APID LOW LOW Expected execution report but received space packet with other apid P1: Apid of received space packet P2: Internal state of MPSoC linux/devices/ploc/PlocMPSoCHelper.h
161 12611 12611 0x3143 0x3143 MPSOC_HELPER_SEQ_CNT_MISMATCH MPSOC_HELPER_SEQ_CNT_MISMATCH LOW LOW Received sequence count does not match expected sequence count P1: Expected sequence count P2: Received sequence count linux/devices/ploc/PlocMPSoCHelper.h
162 12700 12700 0x319c 0x319c TRANSITION_BACK_TO_OFF TRANSITION_BACK_TO_OFF MEDIUM MEDIUM Could not transition properly and went back to ALL OFF mission/devices/PayloadPcduHandler.h
163 12701 12701 0x319d 0x319d NEG_V_OUT_OF_BOUNDS NEG_V_OUT_OF_BOUNDS MEDIUM MEDIUM P1: 0 -> too low, 1 -> too high P2: Float value mission/devices/PayloadPcduHandler.h
184 13200 13200 0x3390 0x3390 P60_BOOT_COUNT P60_BOOT_COUNT INFO INFO P60 boot count is broadcasted once at SW startup. P1: Boot count mission/devices/P60DockHandler.h
185 13201 13201 0x3391 0x3391 BATT_MODE BATT_MODE INFO INFO Battery mode is broadcasted at startup. P1: Mode mission/devices/P60DockHandler.h
186 13202 13202 0x3392 0x3392 BATT_MODE_CHANGED BATT_MODE_CHANGED MEDIUM MEDIUM Battery mode has changed. P1: Old mode. P2: New mode mission/devices/P60DockHandler.h
187 13600 13600 0x3520 0x3520 ALLOC_FAILURE SUPV_UPDATE_FAILED MEDIUM LOW update failed bsp_q7s/core/CoreController.h linux/devices/ploc/PlocSupvHelper.h
188 13601 13601 0x3521 0x3521 REBOOT_SW SUPV_UPDATE_SUCCESSFUL MEDIUM LOW Software reboot occured. Can also be a systemd reboot. P1: Current Chip, P2: Current Copy update successful bsp_q7s/core/CoreController.h linux/devices/ploc/PlocSupvHelper.h
189 13602 13602 0x3522 0x3522 REBOOT_MECHANISM_TRIGGERED SUPV_CONTINUE_UPDATE_FAILED MEDIUM LOW The reboot mechanism was triggered. P1: First 16 bits: Last Chip, Last 16 bits: Last Copy, P2: Each byte is the respective reboot count for the slots Continue update command failed bsp_q7s/core/CoreController.h linux/devices/ploc/PlocSupvHelper.h
190 13603 13603 0x3523 0x3523 REBOOT_HW SUPV_CONTINUE_UPDATE_SUCCESSFUL MEDIUM LOW Continue update command successful bsp_q7s/core/CoreController.h linux/devices/ploc/PlocSupvHelper.h
191 13604 0x3524 TERMINATED_UPDATE_PROCEDURE LOW Terminated update procedure by command linux/devices/ploc/PlocSupvHelper.h
192 13605 0x3525 SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL LOW Requesting event buffer was successful linux/devices/ploc/PlocSupvHelper.h
193 13606 0x3526 SUPV_EVENT_BUFFER_REQUEST_FAILED LOW Requesting event buffer failed linux/devices/ploc/PlocSupvHelper.h
194 13607 0x3527 SUPV_EVENT_BUFFER_REQUEST_TERMINATED LOW Terminated event buffer request by command P1: Number of packets read before process was terminated linux/devices/ploc/PlocSupvHelper.h
195 13608 0x3528 SUPV_SENDING_COMMAND_FAILED LOW linux/devices/ploc/PlocSupvHelper.h
196 13609 0x3529 SUPV_HELPER_REQUESTING_REPLY_FAILED LOW Request receive message of communication interface failed P1: Return value returned by the communication interface requestReceiveMessage function P2: Internal state of supervisor helper linux/devices/ploc/PlocSupvHelper.h
197 13610 0x352a SUPV_HELPER_READING_REPLY_FAILED LOW Reading receive message of communication interface failed P1: Return value returned by the communication interface readingReceivedMessage function P2: Internal state of supervisor helper linux/devices/ploc/PlocSupvHelper.h
198 13611 0x352b SUPV_MISSING_ACK LOW Did not receive acknowledgement report P1: Number of bytes missing P2: Internal state of MPSoC helper linux/devices/ploc/PlocSupvHelper.h
199 13612 0x352c SUPV_MISSING_EXE LOW Supervisor did not receive execution report P1: Number of bytes missing P2: Internal state of supervisor helper linux/devices/ploc/PlocSupvHelper.h
200 13613 0x352d SUPV_ACK_FAILURE_REPORT LOW Supervisor received acknowledgment failure report P1: Internal state of supervisor helper linux/devices/ploc/PlocSupvHelper.h
201 13614 0x352e SUPV_EXE_FAILURE_REPORT LOW Execution report failure P1: linux/devices/ploc/PlocSupvHelper.h
202 13615 0x352f SUPV_ACK_INVALID_APID LOW Supervisor expected acknowledgment report but received space packet with other apid P1: Apid of received space packet P2: Internal state of supervisor helper linux/devices/ploc/PlocSupvHelper.h
203 13616 0x3530 SUPV_EXE_INVALID_APID LOW Supervisor helper expected execution report but received space packet with other apid P1: Apid of received space packet P2: Internal state of supervisor helper linux/devices/ploc/PlocSupvHelper.h
204 13617 0x3531 ACK_RECEPTION_FAILURE LOW Failed to receive acknowledgment report P1: Return value P2: Apid of command for which the reception of the acknowledgment report failed linux/devices/ploc/PlocSupvHelper.h
205 13618 0x3532 EXE_RECEPTION_FAILURE LOW Failed to receive execution report P1: Return value P2: Apid of command for which the reception of the execution report failed linux/devices/ploc/PlocSupvHelper.h
206 13619 0x3533 WRITE_MEMORY_FAILED LOW Update procedure failed when sending packet with number P1 P1: Packet number for which the memory write command fails linux/devices/ploc/PlocSupvHelper.h
207 13700 0x3584 ALLOC_FAILURE MEDIUM bsp_q7s/core/CoreController.h
208 13701 0x3585 REBOOT_SW MEDIUM Software reboot occurred. Can also be a systemd reboot. P1: Current Chip, P2: Current Copy bsp_q7s/core/CoreController.h
209 13702 0x3586 REBOOT_MECHANISM_TRIGGERED MEDIUM The reboot mechanism was triggered. P1: First 16 bits: Last Chip, Last 16 bits: Last Copy, P2: Each byte is the respective reboot count for the slots bsp_q7s/core/CoreController.h
210 13703 0x3587 REBOOT_HW MEDIUM bsp_q7s/core/CoreController.h

44
config/hook.py Normal file
View File

@ -0,0 +1,44 @@
from typing import Optional
from config.definitions import SPACE_PACKET_IDS
from tmtccmd import TmTcCfgHookBase, CcsdsTmtcBackend
from tmtccmd.com_if import ComInterface
from tmtccmd.config import TmtcDefinitionWrapper
from config.retvals import get_retval_dict
from pus_tc.cmd_definitions import get_eive_service_op_code_dict
from tmtccmd.util import ObjectIdDictT, RetvalDictT
class EiveHookObject(TmTcCfgHookBase):
def __init__(self, json_cfg_path: str):
super().__init__(json_cfg_path=json_cfg_path)
def get_tmtc_definitions(self) -> TmtcDefinitionWrapper:
return get_eive_service_op_code_dict()
def assign_communication_interface(self, com_if_key: str) -> Optional[ComInterface]:
from tmtccmd.config.com_if import (
create_com_interface_default,
create_com_interface_cfg_default,
)
cfg = create_com_interface_cfg_default(
com_if_key=com_if_key,
json_cfg_path=self.json_cfg_path,
space_packet_ids=SPACE_PACKET_IDS,
)
return create_com_interface_default(cfg)
def perform_mode_operation(self, tmtc_backend: CcsdsTmtcBackend, mode: int):
from config.custom_mode_op import custom_mode_operation
custom_mode_operation(tmtc_backend, mode)
def get_object_ids(self) -> ObjectIdDictT:
from config.object_ids import get_object_ids
return get_object_ids()
def get_retval_dict(self) -> RetvalDictT:
return get_retval_dict()

View File

@ -1,57 +0,0 @@
from typing import Union
from tmtccmd.config.definitions import (
ServiceOpCodeDictT,
)
from tmtccmd.tc.definitions import TcQueueT
from tmtccmd.utility.retval import RetvalDictT
from tmtccmd.pus.obj_id import ObjectIdDictT
from tmtccmd.com_if.com_interface_base import CommunicationInterface
from tmtccmd.core.backend import TmTcHandler
from tmtccmd.config.hook import TmTcHookBase
from config.retvals import get_retval_dict
from pus_tc.cmd_definitions import get_eive_service_op_code_dict
class EiveHookObject(TmTcHookBase):
def __init__(self, json_cfg_path: str):
super().__init__(json_cfg_path=json_cfg_path)
def get_service_op_code_dictionary(self) -> ServiceOpCodeDictT:
from tmtccmd.config.globals import get_default_service_op_code_dict
service_op_code_dict = get_default_service_op_code_dict()
get_eive_service_op_code_dict(service_op_code_dict=service_op_code_dict)
return service_op_code_dict
def assign_communication_interface(
self, com_if_key: str
) -> Union[CommunicationInterface, None]:
from tmtccmd.config.com_if import create_communication_interface_default
return create_communication_interface_default(
com_if_key=com_if_key,
json_cfg_path=self.json_cfg_path,
space_packet_ids=(0x0865,),
)
def perform_mode_operation(self, tmtc_backend: TmTcHandler, mode: int):
from config.custom_mode_op import custom_mode_operation
custom_mode_operation(mode=mode, tmtc_backend=tmtc_backend)
def pack_service_queue(self, service: int, op_code: str, service_queue: TcQueueT):
from pus_tc.tc_packer_hook import pack_service_queue_user
pack_service_queue_user(
service=service, op_code=op_code, service_queue=service_queue
)
def get_object_ids(self) -> ObjectIdDictT:
from config.object_ids import get_object_ids
return get_object_ids()
def get_retval_dict(self) -> RetvalDictT:
return get_retval_dict()

View File

@ -4,7 +4,7 @@
it to your needs.
"""
import os.path
from tmtccmd.pus.obj_id import ObjectIdDictT
from tmtccmd.util.obj_id import ObjectIdDictT
from tmtccmd.fsfw import parse_fsfw_objects_csv
from tmtccmd.logging import get_console_logger
@ -15,7 +15,6 @@ __OBJECT_ID_DICT = None
# Core Object IDs
CORE_CONTROLLER_ID = bytes([0x43, 0x00, 0x00, 0x03])
SOLAR_ARRAY_DEPLOYMENT_ID = bytes([0x44, 0x41, 0x00, 0xA2])
# Power Object IDs
@ -25,8 +24,10 @@ PDU_1_HANDLER_ID = bytes([0x44, 0x25, 0x00, 0x01])
PDU_2_HANDLER_ID = bytes([0x44, 0x25, 0x00, 0x02])
ACU_HANDLER_ID = bytes([0x44, 0x25, 0x00, 0x03])
BPX_HANDLER_ID = bytes([0x44, 0x26, 0x00, 0x00])
SCEX_HANDLER_ID = bytes([0x44, 0x33, 0x00, 0x32])
# Thermal Object IDs
THERMAL_CONTROLLER_ID = bytes([0x43, 0x40, 0x00, 0x01])
HEATER_ID = bytes([0x44, 0x41, 0x00, 0xA4])
TMP_1075_1_HANDLER_ID = bytes([0x44, 0x42, 0x00, 0x04])
TMP_1075_2_HANDLER_ID = bytes([0x44, 0x42, 0x00, 0x05])
@ -35,16 +36,15 @@ TMP_1075_2_HANDLER_ID = bytes([0x44, 0x42, 0x00, 0x05])
SYRLINKS_HANDLER_ID = bytes([0x44, 0x53, 0x00, 0xA3])
# ACS Object IDs
MGM_0_HANDLER_ID = bytes([0x44, 0x12, 0x00, 0x06])
MGM_1_HANDLER_ID = bytes([0x44, 0x12, 0x01, 0x07])
MGM_2_HANDLER_ID = bytes([0x44, 0x12, 0x02, 0x08])
MGM_3_HANDLER_ID = bytes([0x44, 0x12, 0x03, 0x09])
GYRO_0_HANDLER_ID = bytes([0x44, 0x12, 0x00, 0x10])
GYRO_1_HANDLER_ID = bytes([0x44, 0x12, 0x01, 0x11])
GYRO_2_HANDLER_ID = bytes([0x44, 0x12, 0x02, 0x12])
GYRO_3_HANDLER_ID = bytes([0x44, 0x12, 0x03, 0x13])
GPS_HANDLER_0_ID = bytes([0x44, 0x13, 0x00, 0x45])
GPS_HANDLER_1_ID = bytes([0x44, 0x13, 0x01, 0x46])
MGM_0_LIS3_HANDLER_ID = bytes([0x44, 0x12, 0x00, 0x06])
MGM_1_RM3100_HANDLER_ID = bytes([0x44, 0x12, 0x01, 0x07])
MGM_2_LIS3_HANDLER_ID = bytes([0x44, 0x12, 0x02, 0x08])
MGM_3_RM3100_HANDLER_ID = bytes([0x44, 0x12, 0x03, 0x09])
GYRO_0_ADIS_HANDLER_ID = bytes([0x44, 0x12, 0x00, 0x10])
GYRO_1_L3G_HANDLER_ID = bytes([0x44, 0x12, 0x01, 0x11])
GYRO_2_ADIS_HANDLER_ID = bytes([0x44, 0x12, 0x02, 0x12])
GYRO_3_L3G_HANDLER_ID = bytes([0x44, 0x12, 0x03, 0x13])
GPS_CONTROLLER = bytes([0x44, 0x13, 0x00, 0x45])
RW1_ID = bytes([0x44, 0x12, 0x00, 0x47])
RW2_ID = bytes([0x44, 0x12, 0x01, 0x48])
RW3_ID = bytes([0x44, 0x12, 0x02, 0x49])
@ -61,7 +61,6 @@ PDEC_HANDLER_ID = bytes([0x50, 0x00, 0x07, 0x00])
STAR_TRACKER_ID = bytes([0x44, 0x13, 0x00, 0x1])
RAD_SENSOR_ID = bytes([0x44, 0x32, 0x00, 0xA5])
PLOC_SUPV_ID = bytes([0x44, 0x33, 0x00, 0x16])
PLOC_UPDATER_ID = bytes([0x44, 0x33, 0x00, 0x00])
PLOC_MEMORY_DUMPER_ID = bytes([0x44, 0x33, 0x00, 0x01])
STR_IMG_HELPER_ID = bytes([0x44, 0x33, 0x00, 0x02])
PLOC_MPSOC_ID = bytes([0x44, 0x33, 0x00, 0x15])
@ -77,10 +76,61 @@ HEATER_5_STR = bytes([0x60, 0x00, 0x00, 0x05])
HEATER_6_DRO = bytes([0x60, 0x00, 0x00, 0x06])
HEATER_7_HPA = bytes([0x60, 0x00, 0x00, 0x07])
# RTDs
RTD_0_PLOC_HSPD = bytes([0x44, 0x42, 0x00, 0x16])
RTD_1_PLOC_MISSIONBRD = bytes([0x44, 0x42, 0x00, 0x17])
RTD_2_4K_CAM = bytes([0x44, 0x42, 0x00, 0x18])
RTD_3_DAC_HSPD = bytes([0x44, 0x42, 0x00, 0x19])
RTD_4_STR = bytes([0x44, 0x42, 0x00, 0x20])
RTD_5_RW1_MX_MY = bytes([0x44, 0x42, 0x00, 0x21])
RTD_6_DRO = bytes([0x44, 0x42, 0x00, 0x22])
RTD_7_SCEX = bytes([0x44, 0x42, 0x00, 0x23])
RTD_8_X8 = bytes([0x44, 0x42, 0x00, 0x24])
RTD_9_HPA = bytes([0x44, 0x42, 0x00, 0x25])
RTD_10_PL_TX = bytes([0x44, 0x42, 0x00, 0x26])
RTD_11_MPA = bytes([0x44, 0x42, 0x00, 0x27])
RTD_12_ACU = bytes([0x44, 0x42, 0x00, 0x28])
RTD_13_PLPCDU_HSPD = bytes([0x44, 0x42, 0x00, 0x29])
RTD_14_TCS_BRD = bytes([0x44, 0x42, 0x00, 0x30])
RTD_15_IMTQ = bytes([0x44, 0x42, 0x00, 0x31])
# SUS
"""
Name convention for SUS devices
SUS_<IDX>_<N/R>_LOC_X<F/M/B>Y<F/M/B>Z<F/M/B>_PT_<DIR><F/B>
LOC: Location
PT: Pointing
N/R: Nominal/Redundant
F/M/B: Forward/Middle/Backwards
"""
SUS_0_N_LOC_XFYFZM_PT_XF = bytes([0x44, 0x12, 0x00, 0x32])
SUS_6_R_LOC_XFYBZM_PT_XF = bytes([0x44, 0x12, 0x00, 0x38])
SUS_1_N_LOC_XBYFZM_PT_XB = bytes([0x44, 0x12, 0x00, 0x33])
SUS_7_R_LOC_XBYBZM_PT_XB = bytes([0x44, 0x12, 0x00, 0x39])
SUS_2_N_LOC_XFYBZB_PT_YB = bytes([0x44, 0x12, 0x00, 0x34])
SUS_8_R_LOC_XBYBZB_PT_YB = bytes([0x44, 0x12, 0x00, 0x40])
SUS_3_N_LOC_XFYBZF_PT_YF = bytes([0x44, 0x12, 0x00, 0x35])
SUS_9_R_LOC_XBYBZB_PT_YF = bytes([0x44, 0x12, 0x00, 0x41])
SUS_4_N_LOC_XMYFZF_PT_ZF = bytes([0x44, 0x12, 0x00, 0x36])
SUS_10_R_LOC_XMYBZF_PT_ZF = bytes([0x44, 0x12, 0x00, 0x42])
SUS_5_N_LOC_XFYMZB_PT_ZB = bytes([0x44, 0x12, 0x00, 0x37])
SUS_11_R_LOC_XBYMZB_PT_ZB = bytes([0x44, 0x12, 0x00, 0x43])
# System and Assembly Objects
ACS_BOARD_ASS_ID = bytes([0x73, 0x00, 0x00, 0x01])
SUS_BOARD_ASS_ID = bytes([0x73, 0x00, 0x00, 0x02])
TCS_BOARD_ASS_ID = bytes([0x73, 0x00, 0x00, 0x03])
RW_ASSEMBLY = bytes([0x73, 0x00, 0x00, 0x04])
# Controllers
TCS_CONTROLLER = bytes([0x43, 0x40, 0x00, 0x01])
ACS_CONTROLLER = bytes([0x43, 0x00, 0x00, 0x02])
CORE_CONTROLLER_ID = bytes([0x43, 0x00, 0x00, 0x03])
def get_object_ids() -> ObjectIdDictT:

View File

@ -4,18 +4,18 @@
0x43400001;THERMAL_CONTROLLER
0x44120006;MGM_0_LIS3_HANDLER
0x44120010;GYRO_0_ADIS_HANDLER
0x44120032;SUS_0
0x44120033;SUS_1
0x44120034;SUS_2
0x44120035;SUS_3
0x44120036;SUS_4
0x44120037;SUS_5
0x44120038;SUS_6
0x44120039;SUS_7
0x44120040;SUS_8
0x44120041;SUS_9
0x44120042;SUS_10
0x44120043;SUS_11
0x44120032;SUS_0_N_LOC_XFYFZM_PT_XF
0x44120033;SUS_1_N_LOC_XBYFZM_PT_XB
0x44120034;SUS_2_N_LOC_XFYBZB_PT_YB
0x44120035;SUS_3_N_LOC_XFYBZF_PT_YF
0x44120036;SUS_4_N_LOC_XMYFZF_PT_ZF
0x44120037;SUS_5_N_LOC_XFYMZB_PT_ZB
0x44120038;SUS_6_R_LOC_XFYBZM_PT_XF
0x44120039;SUS_7_R_LOC_XBYBZM_PT_XB
0x44120040;SUS_8_R_LOC_XBYBZB_PT_YB
0x44120041;SUS_9_R_LOC_XBYBZB_PT_YF
0x44120042;SUS_10_N_LOC_XMYBZF_PT_ZF
0x44120043;SUS_11_R_LOC_XBYMZB_PT_ZB
0x44120047;RW1
0x44120107;MGM_1_RM3100_HANDLER
0x44120111;GYRO_1_L3G_HANDLER
@ -41,6 +41,8 @@
0x44330001;PLOC_MEMORY_DUMPER
0x44330002;STR_HELPER
0x44330003;PLOC_MPSOC_HELPER
0x44330004;AXI_PTME_CONFIG
0x44330005;PTME_CONFIG
0x44330015;PLOC_MPSOC_HANDLER
0x44330016;PLOC_SUPERVISOR_HANDLER
0x44330017;PLOC_SUPERVISOR_HELPER
@ -48,26 +50,28 @@
0x444100A4;HEATER_HANDLER
0x44420004;TMP1075_HANDLER_1
0x44420005;TMP1075_HANDLER_2
0x44420016;RTD_IC_3
0x44420017;RTD_IC_4
0x44420018;RTD_IC_5
0x44420019;RTD_IC_6
0x44420020;RTD_IC_7
0x44420021;RTD_IC_8
0x44420022;RTD_IC_9
0x44420023;RTD_IC_10
0x44420024;RTD_IC_11
0x44420025;RTD_IC_12
0x44420026;RTD_IC_13
0x44420027;RTD_IC_14
0x44420028;RTD_IC_15
0x44420029;RTD_IC_16
0x44420030;RTD_IC_17
0x44420031;RTD_IC_18
0x44420016;RTD_0_IC3_PLOC_HEATSPREADER
0x44420017;RTD_1_IC4_PLOC_MISSIONBOARD
0x44420018;RTD_2_IC5_4K_CAMERA
0x44420019;RTD_3_IC6_DAC_HEATSPREADER
0x44420020;RTD_4_IC7_STARTRACKER
0x44420021;RTD_5_IC8_RW1_MX_MY
0x44420022;RTD_6_IC9_DRO
0x44420023;RTD_7_IC10_SCEX
0x44420024;RTD_8_IC11_X8
0x44420025;RTD_9_IC12_HPA
0x44420026;RTD_10_IC13_PL_TX
0x44420027;RTD_11_IC14_MPA
0x44420028;RTD_12_IC15_ACU
0x44420029;RTD_13_IC16_PLPCDU_HEATSPREADER
0x44420030;RTD_14_IC17_TCS_BOARD
0x44420031;RTD_15_IC18_IMTQ
0x445300A3;SYRLINKS_HK_HANDLER
0x49000000;ARDUINO_COM_IF
0x49010005;GPIO_IF
0x49020004;SPI_COM_IF
0x49020004;SPI_MAIN_COM_IF
0x49020005;SPI_RW_COM_IF
0x49020006;SPI_RTD_COM_IF
0x49030003;UART_COM_IF
0x49040002;I2C_COM_IF
0x49050001;CSP_COM_IF
@ -88,6 +92,7 @@
0x53000005;PUS_SERVICE_5_EVENT_REPORTING
0x53000008;PUS_SERVICE_8_FUNCTION_MGMT
0x53000009;PUS_SERVICE_9_TIME_MGMT
0x53000011;PUS_SERVICE_11_TC_SCHEDULER
0x53000017;PUS_SERVICE_17_TEST
0x53000020;PUS_SERVICE_20_PARAMETERS
0x53000200;PUS_SERVICE_200_MODE_MGMT
@ -105,21 +110,23 @@
0x54000010;SPI_TEST
0x54000020;UART_TEST
0x54000030;I2C_TEST
0x54000040;DUMMY_COM_IF
0x5400AFFE;DUMMY_HANDLER
0x5400CAFE;DUMMY_INTERFACE
0x54123456;LIBGPIOD_TEST
0x54694269;TEST_TASK
0x60000000;HEATER_0
0x60000001;HEATER_1
0x60000002;HEATER_2
0x60000003;HEATER_3
0x60000004;HEATER_4
0x60000005;HEATER_5
0x60000006;HEATER_6
0x60000007;HEATER_7
0x60000000;HEATER_0_PLOC_PROC_BRD
0x60000001;HEATER_1_PCDU_BRD
0x60000002;HEATER_2_ACS_BRD
0x60000003;HEATER_3_OBC_BRD
0x60000004;HEATER_4_CAMERA
0x60000005;HEATER_5_STR
0x60000006;HEATER_6_DRO
0x60000007;HEATER_7_HPA
0x73000001;ACS_BOARD_ASS
0x73000002;SUS_BOARD_ASS
0x73000003;TCS_BOARD_ASS
0x73000004;RW_ASS
0x73000100;TM_FUNNEL
0x73500000;CCSDS_IP_CORE_BRIDGE
0xFFFFFFFF;NO_OBJECT

1 0x00005060 P60DOCK_TEST_TASK
4 0x43400001 THERMAL_CONTROLLER
5 0x44120006 MGM_0_LIS3_HANDLER
6 0x44120010 GYRO_0_ADIS_HANDLER
7 0x44120032 SUS_0 SUS_0_N_LOC_XFYFZM_PT_XF
8 0x44120033 SUS_1 SUS_1_N_LOC_XBYFZM_PT_XB
9 0x44120034 SUS_2 SUS_2_N_LOC_XFYBZB_PT_YB
10 0x44120035 SUS_3 SUS_3_N_LOC_XFYBZF_PT_YF
11 0x44120036 SUS_4 SUS_4_N_LOC_XMYFZF_PT_ZF
12 0x44120037 SUS_5 SUS_5_N_LOC_XFYMZB_PT_ZB
13 0x44120038 SUS_6 SUS_6_R_LOC_XFYBZM_PT_XF
14 0x44120039 SUS_7 SUS_7_R_LOC_XBYBZM_PT_XB
15 0x44120040 SUS_8 SUS_8_R_LOC_XBYBZB_PT_YB
16 0x44120041 SUS_9 SUS_9_R_LOC_XBYBZB_PT_YF
17 0x44120042 SUS_10 SUS_10_N_LOC_XMYBZF_PT_ZF
18 0x44120043 SUS_11 SUS_11_R_LOC_XBYMZB_PT_ZB
19 0x44120047 RW1
20 0x44120107 MGM_1_RM3100_HANDLER
21 0x44120111 GYRO_1_L3G_HANDLER
41 0x44330001 PLOC_MEMORY_DUMPER
42 0x44330002 STR_HELPER
43 0x44330003 PLOC_MPSOC_HELPER
44 0x44330004 AXI_PTME_CONFIG
45 0x44330005 PTME_CONFIG
46 0x44330015 PLOC_MPSOC_HANDLER
47 0x44330016 PLOC_SUPERVISOR_HANDLER
48 0x44330017 PLOC_SUPERVISOR_HELPER
50 0x444100A4 HEATER_HANDLER
51 0x44420004 TMP1075_HANDLER_1
52 0x44420005 TMP1075_HANDLER_2
53 0x44420016 RTD_IC_3 RTD_0_IC3_PLOC_HEATSPREADER
54 0x44420017 RTD_IC_4 RTD_1_IC4_PLOC_MISSIONBOARD
55 0x44420018 RTD_IC_5 RTD_2_IC5_4K_CAMERA
56 0x44420019 RTD_IC_6 RTD_3_IC6_DAC_HEATSPREADER
57 0x44420020 RTD_IC_7 RTD_4_IC7_STARTRACKER
58 0x44420021 RTD_IC_8 RTD_5_IC8_RW1_MX_MY
59 0x44420022 RTD_IC_9 RTD_6_IC9_DRO
60 0x44420023 RTD_IC_10 RTD_7_IC10_SCEX
61 0x44420024 RTD_IC_11 RTD_8_IC11_X8
62 0x44420025 RTD_IC_12 RTD_9_IC12_HPA
63 0x44420026 RTD_IC_13 RTD_10_IC13_PL_TX
64 0x44420027 RTD_IC_14 RTD_11_IC14_MPA
65 0x44420028 RTD_IC_15 RTD_12_IC15_ACU
66 0x44420029 RTD_IC_16 RTD_13_IC16_PLPCDU_HEATSPREADER
67 0x44420030 RTD_IC_17 RTD_14_IC17_TCS_BOARD
68 0x44420031 RTD_IC_18 RTD_15_IC18_IMTQ
69 0x445300A3 SYRLINKS_HK_HANDLER
70 0x49000000 ARDUINO_COM_IF
71 0x49010005 GPIO_IF
72 0x49020004 SPI_COM_IF SPI_MAIN_COM_IF
73 0x49020005 SPI_RW_COM_IF
74 0x49020006 SPI_RTD_COM_IF
75 0x49030003 UART_COM_IF
76 0x49040002 I2C_COM_IF
77 0x49050001 CSP_COM_IF
92 0x53000005 PUS_SERVICE_5_EVENT_REPORTING
93 0x53000008 PUS_SERVICE_8_FUNCTION_MGMT
94 0x53000009 PUS_SERVICE_9_TIME_MGMT
95 0x53000011 PUS_SERVICE_11_TC_SCHEDULER
96 0x53000017 PUS_SERVICE_17_TEST
97 0x53000020 PUS_SERVICE_20_PARAMETERS
98 0x53000200 PUS_SERVICE_200_MODE_MGMT
110 0x54000010 SPI_TEST
111 0x54000020 UART_TEST
112 0x54000030 I2C_TEST
113 0x54000040 DUMMY_COM_IF
114 0x5400AFFE DUMMY_HANDLER
115 0x5400CAFE DUMMY_INTERFACE
116 0x54123456 LIBGPIOD_TEST
117 0x54694269 TEST_TASK
118 0x60000000 HEATER_0 HEATER_0_PLOC_PROC_BRD
119 0x60000001 HEATER_1 HEATER_1_PCDU_BRD
120 0x60000002 HEATER_2 HEATER_2_ACS_BRD
121 0x60000003 HEATER_3 HEATER_3_OBC_BRD
122 0x60000004 HEATER_4 HEATER_4_CAMERA
123 0x60000005 HEATER_5 HEATER_5_STR
124 0x60000006 HEATER_6 HEATER_6_DRO
125 0x60000007 HEATER_7 HEATER_7_HPA
126 0x73000001 ACS_BOARD_ASS
127 0x73000002 SUS_BOARD_ASS
128 0x73000003 TCS_BOARD_ASS
129 0x73000004 RW_ASS
130 0x73000100 TM_FUNNEL
131 0x73500000 CCSDS_IP_CORE_BRIDGE
132 0xFFFFFFFF NO_OBJECT

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +0,0 @@
SW_NAME = "eive"
VERSION_MAJOR = 1
VERSION_MINOR = 9
VERSION_SUBMINOR = 0
__version__ = "1.9.0"

1
deps/spacepackets vendored Submodule

Submodule deps/spacepackets added at 13a54713ae

1
deps/tmtccmd vendored Submodule

Submodule deps/tmtccmd added at 5e153e5567

View File

@ -7,9 +7,12 @@
@date 17.12.2020
"""
import enum
import struct
from typing import Union
from tmtccmd.tc.service_8_functional_cmd import generate_action_command
from tmtccmd.tc.definitions import PusTelecommand
from spacepackets.ecss import PusTelecommand
from tmtccmd.tc.pus_8_funccmd import generate_action_command
from tmtccmd.util import ObjectIdU32
class GomspaceDeviceActionIds(enum.IntEnum):
@ -29,11 +32,16 @@ class GomspaceOpCodes:
REQUEST_AUX_HK_ONCE = ["hk-aux", "129"]
PRINT_SWITCH_V_I = ["print-switch-vi", "130"]
PRINT_LATCHUPS = ["print-latchups", "131"]
GET_PARAM = ["get-param", "132"]
SET_PARAM = ["set-param", "133"]
class Info:
class GsInfo:
REQUEST_CORE_HK_ONCE = "Requesting Core HK once"
REQUEST_AUX_HK_ONCE = "Requesting Aux HK once"
PRINT_SWITCH_V_I = "Print Switch V I Info"
GET_PARAMETER = "Get parameter"
SET_PARAMETER = "Set parameter"
class SetIds:
@ -43,7 +51,8 @@ class SetIds:
PDU_2_AUX = 4
P60_CORE = 5
P60_AUX = 6
ACU = 7
ACU_CORE = 7
ACU_AUX = 8
class TableIds:
@ -67,19 +76,25 @@ class Channel:
def pack_get_param_command(
object_id: bytearray, table_id: int, memory_address: bytearray, parameter_size: int
object_id: bytes,
table_id: int,
memory_address: Union[int, bytes],
parameter_size: int,
) -> PusTelecommand:
"""Function to generate a command to retrieve parameters like the temperature from a gomspace device.
@param object_id: The object id of the gomspace device handler.
@param table_id: The table id of the gomspace device
@param memory_address: Address offset within table of the value to read.
@param parameter_size: Size of the value to read. E.g. temperature is uint16_t and thus parameter_size is 2
@param parameter_size: Size of the value to read. E.g. temperature is uint16_t and thus
parameter_size is 2
@return: The command as bytearray.
"""
app_data = bytearray()
app_data.append(table_id)
app_data.extend(memory_address)
app_data.append(parameter_size)
app_data = struct.pack("!B", table_id)
if isinstance(memory_address, int):
app_data += struct.pack("!H", memory_address)
else:
app_data += memory_address
app_data += struct.pack("!B", parameter_size)
return generate_action_command(
object_id=object_id,
action_id=GomspaceDeviceActionIds.PARAM_GET,
@ -88,8 +103,8 @@ def pack_get_param_command(
def pack_set_param_command(
object_id: bytearray,
memory_address: bytearray,
object_id: bytes,
memory_address: bytes,
parameter_size: int,
parameter: int,
ssc: int = 0,
@ -110,10 +125,7 @@ def pack_set_param_command(
if parameter_size == 1:
app_data.append(parameter)
elif parameter_size == 2:
byte_one = 0xFF00 & parameter >> 8
byte_two = 0xFF & parameter
app_data.append(byte_one)
app_data.append(byte_two)
app_data += struct.pack("!H", parameter)
elif parameter_size == 4:
byte_one = 0xFF000000 & parameter >> 24
byte_two = 0xFF0000 & parameter >> 16
@ -128,7 +140,7 @@ def pack_set_param_command(
)
def pack_ping_command(object_id: bytearray, data: bytearray) -> PusTelecommand:
def pack_ping_command(object_id: ObjectIdU32, data: bytearray) -> PusTelecommand:
""" " Function to generate the command to ping a gomspace device
@param object_id Object Id of the gomspace device handler.
@param data Bytearray containing the bytes to send to the gomspace device. For now the on board software
@ -137,33 +149,35 @@ def pack_ping_command(object_id: bytearray, data: bytearray) -> PusTelecommand:
data are simply copied by the device and then sent back.
"""
return generate_action_command(
object_id=object_id, action_id=GomspaceDeviceActionIds.PING, app_data=data
object_id=object_id.as_bytes,
action_id=GomspaceDeviceActionIds.PING,
app_data=data,
)
def pack_gnd_wdt_reset_command(object_id: bytearray) -> PusTelecommand:
def pack_gnd_wdt_reset_command(object_id: ObjectIdU32) -> PusTelecommand:
""" " Function to generate the command to reset the watchdog of a gomspace device.
@param object_id Object Id of the gomspace device handler.
"""
return generate_action_command(
object_id=object_id, action_id=GomspaceDeviceActionIds.WDT_RESET
object_id=object_id.as_bytes, action_id=GomspaceDeviceActionIds.WDT_RESET
)
def pack_reboot_command(object_id: bytearray) -> PusTelecommand:
def pack_reboot_command(object_id: ObjectIdU32) -> PusTelecommand:
"""Function to generate the command which triggers a reboot of a gomspace device
@param object_id The object id of the gomspace device handler.
"""
return generate_action_command(
object_id=object_id, action_id=GomspaceDeviceActionIds.REBOOT
object_id=object_id.as_bytes, action_id=GomspaceDeviceActionIds.REBOOT
)
def pack_request_full_hk_table_command(object_id: bytearray) -> PusTelecommand:
def pack_request_full_hk_table_command(object_id: ObjectIdU32) -> PusTelecommand:
"""Function to generate the command to request the full housekeeping table from a gomspace
device.
@param object_id The object id of the gomspace device handler.
"""
return generate_action_command(
object_id=object_id, action_id=GomspaceDeviceActionIds.REQUEST_HK_TABLE
object_id=object_id.as_bytes, action_id=GomspaceDeviceActionIds.REQUEST_HK_TABLE
)

View File

@ -1,7 +1,7 @@
from gomspace.gomspace_common import TableEntry
class PDUConfigTable:
class PduConfigTable:
out_en_0 = TableEntry(bytearray([0x00, 0x48]), TableEntry.uint8_size)
out_en_1 = TableEntry(bytearray([0x00, 0x49]), TableEntry.uint8_size)
out_en_2 = TableEntry(bytearray([0x00, 0x4A]), TableEntry.uint8_size)
@ -15,7 +15,20 @@ class PDUConfigTable:
cur_lu_lim_0 = TableEntry(bytearray([0x00, 0xB8]), TableEntry.uint16_size)
class PDUHkTable:
PDU_CONFIG_LIST = [
PduConfigTable.out_en_0,
PduConfigTable.out_en_1,
PduConfigTable.out_en_2,
PduConfigTable.out_en_3,
PduConfigTable.out_en_4,
PduConfigTable.out_en_5,
PduConfigTable.out_en_6,
PduConfigTable.out_en_7,
PduConfigTable.out_en_8,
]
class PduHkTable:
temperature = TableEntry(bytearray([0x00, 0x28]), TableEntry.uint16_size)
# Ground WDT value (remaining seconds until reboot)
wdt_gnd_left = TableEntry(bytearray([0x00, 0x80]), TableEntry.uint32_size)

File diff suppressed because it is too large Load Diff

View File

@ -1,15 +1,125 @@
# -*- coding: utf-8 -*-
"""
@file tmtcc_tc_acu.py
@brief ACU tests
@author J. Meier
"""ACU commands
@author J. Meier, R. Mueller
@date 21.12.2020
"""
import struct
from tmtccmd.tc.packer import TcQueueT
from tmtccmd.config.definitions import QueueCommands
from gomspace.gomspace_common import *
from config.definitions import CustomServiceList
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
from tmtccmd.config.tmtc import tmtc_definitions_provider
from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.tc.pus_3_fsfw_hk import (
make_sid,
generate_one_diag_command,
generate_one_hk_command,
)
import gomspace.gomspace_common as gs
from gomspace.gomspace_common import GomspaceOpCodes
from gomspace.gomspace_common import GsInfo as GsInfo
from config.object_ids import ACU_HANDLER_ID
from pus_tc.devs.p60dock import P60DockConfigTable
from tmtccmd.tc.pus_8_funccmd import generate_action_command
from tmtccmd.util import ObjectIdU32
class ACUConfigTable:
mppt_mode = gs.TableEntry(bytearray([0x00, 0x00]), gs.TableEntry.uint8_size)
mppt_d_mode = gs.TableEntry(bytearray([0x00, 0x01]), gs.TableEntry.uint8_size)
vboost = gs.TableEntry(bytearray([0x00, 0x02]), gs.TableEntry.uint16_size)
vbat_max_hi = gs.TableEntry(bytearray([0x00, 0x10]), gs.TableEntry.uint16_size)
vbat_max_lo = gs.TableEntry(bytearray([0x00, 0x12]), gs.TableEntry.uint16_size)
ov_mode = gs.TableEntry(bytearray([0x00, 0x1A]), gs.TableEntry.uint8_size)
class ACUHkTable:
temperature1 = gs.TableEntry(bytearray([0x00, 0x1C]), gs.TableEntry.uint16_size)
temperature2 = gs.TableEntry(bytearray([0x00, 0x1D]), gs.TableEntry.uint16_size)
temperature3 = gs.TableEntry(bytearray([0x00, 0x1E]), gs.TableEntry.uint16_size)
# Ground WDT value (remaining seconds until reboot)
wdt_gnd_left = gs.TableEntry(bytearray([0x00, 0x74]), gs.TableEntry.uint32_size)
class OpCodes:
TEST = ["0", "test"]
class Info:
TEST = "ACU Test"
@tmtc_definitions_provider
def add_acu_cmds(defs: TmtcDefinitionWrapper):
oce = OpCodeEntry()
oce.add(
keys=GomspaceOpCodes.REQUEST_CORE_HK_ONCE,
info=GsInfo.REQUEST_CORE_HK_ONCE,
)
oce.add(
keys=GomspaceOpCodes.REQUEST_AUX_HK_ONCE,
info=GsInfo.REQUEST_AUX_HK_ONCE,
)
oce.add(
keys=GomspaceOpCodes.REQUEST_AUX_HK_ONCE,
info=GsInfo.REQUEST_AUX_HK_ONCE,
)
oce.add(
keys=GomspaceOpCodes.GET_PARAM,
info=GsInfo.GET_PARAMETER,
)
oce.add(
keys=GomspaceOpCodes.SET_PARAM,
info=GsInfo.SET_PARAMETER,
)
oce.add(keys=OpCodes.TEST, info=Info.TEST)
defs.add_service(
name=CustomServiceList.ACU.value,
info="ACU Device",
op_code_entry=oce,
)
def pack_acu_commands(object_id: ObjectIdU32, q: DefaultPusQueueHelper, op_code: str):
q.add_log_cmd("Handling ACU command")
if op_code in GomspaceOpCodes.PRINT_SWITCH_V_I:
q.add_log_cmd("ACU: Print channel stats")
q.add_pus_tc(
generate_action_command(
object_id=object_id.as_bytes,
action_id=gs.GomspaceDeviceActionIds.PRINT_SWITCH_V_I,
)
)
if op_code in GomspaceOpCodes.REQUEST_CORE_HK_ONCE:
q.add_log_cmd(f"PDU1: {GsInfo.REQUEST_CORE_HK_ONCE}")
hk_sid = make_sid(object_id=object_id.as_bytes, set_id=gs.SetIds.ACU_CORE)
q.add_pus_tc(generate_one_diag_command(sid=hk_sid))
if op_code in GomspaceOpCodes.REQUEST_AUX_HK_ONCE:
q.add_log_cmd(f"PDU1: {GsInfo.REQUEST_AUX_HK_ONCE}")
hk_sid = make_sid(object_id=object_id.as_bytes, set_id=gs.SetIds.ACU_AUX)
q.add_pus_tc(generate_one_hk_command(sid=hk_sid))
if op_code in GomspaceOpCodes.GET_PARAM:
q.add_log_cmd(f"PDU1: {GsInfo.GET_PARAMETER}")
table_id = int(input("Specify table ID: "))
memory_address = int(input("Specify memory address: 0x"), 16)
parameter_size = int(input("Specify parameter size: "))
q.add_pus_tc(
gs.pack_get_param_command(
object_id.as_bytes, table_id, memory_address, parameter_size
)
)
if op_code in GomspaceOpCodes.SET_PARAM:
q.add_log_cmd(f"PDU1: {GsInfo.SET_PARAMETER}")
memory_address = int(input("Specify memory address: 0x"), 16)
memory_address = struct.pack("!H", memory_address)
parameter_size = int(input("Specify parameter size: "))
parameter = int(input("Specify parameter: "))
q.add_pus_tc(
gs.pack_set_param_command(
object_id.as_bytes, memory_address, parameter_size, parameter
)
)
pack_test_cmds(object_id=object_id, q=q)
class ACUTestProcedure:
@ -26,134 +136,93 @@ class ACUTestProcedure:
ping = False
read_temperature1 = False
read_temperature2 = False
read_temperature3 = True
read_mppt_mode = True
read_vboost = True
read_vbat_max_hi = True
read_vbat_max_lo = True
read_ov_mode = True
read_temperature3 = False
read_mppt_mode = False
read_vboost = False
read_vbat_max_hi = False
read_vbat_max_lo = False
read_ov_mode = False
off = False
class ACUConfigTable:
mppt_mode = TableEntry(bytearray([0x00, 0x00]), TableEntry.uint8_size)
mppt_d_mode = TableEntry(bytearray([0x00, 0x01]), TableEntry.uint8_size)
vboost = TableEntry(bytearray([0x00, 0x02]), TableEntry.uint16_size)
vbat_max_hi = TableEntry(bytearray([0x00, 0x10]), TableEntry.uint16_size)
vbat_max_lo = TableEntry(bytearray([0x00, 0x12]), TableEntry.uint16_size)
ov_mode = TableEntry(bytearray([0x00, 0x1A]), TableEntry.uint8_size)
class ACUHkTable:
temperature1 = TableEntry(bytearray([0x00, 0x1C]), TableEntry.uint16_size)
temperature2 = TableEntry(bytearray([0x00, 0x1D]), TableEntry.uint16_size)
temperature3 = TableEntry(bytearray([0x00, 0x1E]), TableEntry.uint16_size)
# Ground WDT value (remaining seconds until reboot)
wdt_gnd_left = TableEntry(bytearray([0x00, 0x74]), TableEntry.uint32_size)
class CommandId:
PRINT_CHANNEL_STATS = 51
def pack_acu_test_into(
object_id: bytearray, tc_queue: TcQueueT, op_code: str
) -> TcQueueT:
tc_queue.appendleft((QueueCommands.PRINT, "Testing ACU"))
if op_code == "51":
tc_queue.appendleft((QueueCommands.PRINT, "ACU: Print channel stats"))
command = object_id + struct.pack("!I", CommandId.PRINT_CHANNEL_STATS)
command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
return
def pack_test_cmds(object_id: ObjectIdU32, q: DefaultPusQueueHelper):
if ACUTestProcedure.all or ACUTestProcedure.reboot:
tc_queue.appendleft((QueueCommands.PRINT, "ACU: Reboot"))
command = pack_reboot_command(object_id)
# command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
q.add_log_cmd("ACU: Reboot")
q.add_pus_tc(gs.pack_reboot_command(object_id))
if ACUTestProcedure.all or ACUTestProcedure.read_gnd_wdt:
tc_queue.appendleft(
(QueueCommands.PRINT, "ACU: Reading ground watchdog timer value")
)
command = pack_get_param_command(
object_id,
TableIds.hk,
q.add_log_cmd("ACU: Reading ground watchdog timer value")
q.add_pus_tc(
gs.pack_get_param_command(
object_id.as_bytes,
gs.TableIds.hk,
ACUHkTable.wdt_gnd_left.parameter_address,
ACUHkTable.wdt_gnd_left.parameter_size,
)
# command = PusTelecommand(service=8, subservice=128, ssc=20, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
)
if ACUTestProcedure.all or ACUTestProcedure.gnd_wdt_reset:
tc_queue.appendleft((QueueCommands.PRINT, "ACU: Testing ground watchdog reset"))
command = pack_gnd_wdt_reset_command(object_id)
# command = PusTelecommand(service=8, subservice=128, ssc=21, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
q.add_log_cmd("ACU: Testing ground watchdog reset")
q.add_pus_tc(gs.pack_gnd_wdt_reset_command(object_id))
if ACUTestProcedure.all or ACUTestProcedure.ping:
tc_queue.appendleft((QueueCommands.PRINT, "ACU: Ping Test"))
q.add_log_cmd("ACU: Ping Test")
ping_data = bytearray([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
command = pack_ping_command(object_id, ping_data)
# command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
q.add_pus_tc(gs.pack_ping_command(object_id, ping_data))
if ACUTestProcedure.all or ACUTestProcedure.read_temperature3:
tc_queue.appendleft((QueueCommands.PRINT, "ACU: Reading temperature 3"))
command = pack_get_param_command(
object_id,
TableIds.hk,
q.add_log_cmd("ACU: Reading temperature 3")
q.add_pus_tc(
gs.pack_get_param_command(
object_id.as_bytes,
gs.TableIds.hk,
ACUHkTable.temperature3.parameter_address,
ACUHkTable.temperature3.parameter_size,
)
# command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
)
if ACUTestProcedure.all or ACUTestProcedure.read_vboost:
tc_queue.appendleft((QueueCommands.PRINT, "ACU: Reading vboost value"))
command = pack_get_param_command(
object_id,
TableIds.config,
q.add_log_cmd("ACU: Reading vboost value")
q.add_pus_tc(
gs.pack_get_param_command(
object_id.as_bytes,
gs.TableIds.config,
ACUConfigTable.vboost.parameter_address,
ACUConfigTable.vboost.parameter_size,
)
# command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
)
if ACUTestProcedure.all or ACUTestProcedure.read_vbat_max_hi:
tc_queue.appendleft((QueueCommands.PRINT, "ACU: Reading vbat_max_hi"))
command = pack_get_param_command(
object_id,
TableIds.config,
q.add_log_cmd("ACU: Reading vbat_max_hi")
q.add_pus_tc(
gs.pack_get_param_command(
object_id.as_bytes,
gs.TableIds.config,
ACUConfigTable.vbat_max_hi.parameter_address,
ACUConfigTable.vbat_max_hi.parameter_size,
)
# command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
)
if ACUTestProcedure.all or ACUTestProcedure.read_vbat_max_lo:
tc_queue.appendleft((QueueCommands.PRINT, "ACU: Reading vbat_max_lo"))
command = pack_get_param_command(
object_id,
TableIds.config,
q.add_log_cmd("ACU: Reading vbat_max_lo")
q.add_pus_tc(
gs.pack_get_param_command(
object_id.as_bytes,
gs.TableIds.config,
ACUConfigTable.vbat_max_lo.parameter_address,
ACUConfigTable.vbat_max_lo.parameter_size,
)
# command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
)
if ACUTestProcedure.all or ACUTestProcedure.read_ov_mode:
tc_queue.appendleft((QueueCommands.PRINT, "ACU: Reading ov_mode"))
command = pack_get_param_command(
object_id,
TableIds.config,
q.add_log_cmd("ACU: Reading ov_mode")
q.add_pus_tc(
gs.pack_get_param_command(
object_id.as_bytes,
gs.TableIds.config,
ACUConfigTable.ov_mode.parameter_address,
ACUConfigTable.ov_mode.parameter_size,
)
# command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Turning off ACU"))
command = pack_set_param_command(
p60dock_object_id,
)
if ACUTestProcedure.all or ACUTestProcedure.off:
q.add_log_cmd("P60 Dock: Turning off ACU")
q.add_pus_tc(
gs.pack_set_param_command(
ACU_HANDLER_ID,
P60DockConfigTable.out_en_0.parameter_address,
P60DockConfigTable.out_en_0.parameter_size,
Channel.off,
gs.Channel.off,
)
)
# command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
return tc_queue

View File

@ -1,7 +1,9 @@
from tmtccmd.tc.definitions import TcQueueT, QueueCommands
from config.definitions import CustomServiceList
from config.object_ids import BPX_HANDLER_ID
from tmtccmd.tc.service_8_functional_cmd import generate_action_command
from tmtccmd.tc.service_3_housekeeping import generate_one_hk_command, make_sid
from tmtccmd import DefaultProcedureInfo
from tmtccmd.tc import DefaultPusQueueHelper, service_provider
from tmtccmd.tc.pus_8_funccmd import generate_action_command
from tmtccmd.tc.pus_3_fsfw_hk import generate_one_hk_command, make_sid
class BpxSetIds:
@ -24,33 +26,36 @@ class BpxOpCodes:
REBOOT = ["4", "reboot"]
def pack_bpx_commands(tc_queue: TcQueueT, op_code: str):
@service_provider(CustomServiceList.BPX_BATTERY.value)
def pack_bpx_commands(
_info: DefaultProcedureInfo, q: DefaultPusQueueHelper, op_code: str
):
if op_code in BpxOpCodes.HK:
tc_queue.appendleft((QueueCommands.PRINT, "Requesting BPX battery HK set"))
q.add_log_cmd("Requesting BPX battery HK set")
sid = make_sid(object_id=BPX_HANDLER_ID, set_id=BpxSetIds.GET_HK_SET)
cmd = generate_one_hk_command(sid=sid, ssc=0)
tc_queue.appendleft(cmd.pack_command_tuple())
q.add_pus_tc(generate_one_hk_command(sid=sid))
if op_code in BpxOpCodes.RST_BOOT_CNT:
tc_queue.appendleft((QueueCommands.PRINT, "Resetting reboot counters"))
cmd = generate_action_command(
q.add_log_cmd("Resetting reboot counters")
q.add_pus_tc(
generate_action_command(
object_id=BPX_HANDLER_ID, action_id=BpxActionIds.RESET_COUNTERS
)
tc_queue.appendleft(cmd.pack_command_tuple())
)
if op_code in BpxOpCodes.REQUEST_CFG:
tc_queue.appendleft((QueueCommands.PRINT, "Requesting configuration struct"))
cmd = generate_action_command(
q.add_log_cmd("Requesting configuration struct")
q.add_pus_tc(
generate_action_command(
object_id=BPX_HANDLER_ID, action_id=BpxActionIds.GET_CFG
)
tc_queue.appendleft(cmd.pack_command_tuple())
)
if op_code in BpxOpCodes.REQUEST_CFG_HK:
tc_queue.appendleft((QueueCommands.PRINT, "Requesting configuration struct HK"))
q.add_log_cmd("Requesting configuration struct HK")
sid = make_sid(object_id=BPX_HANDLER_ID, set_id=BpxSetIds.GET_CFG_SET)
cmd = generate_one_hk_command(sid=sid, ssc=0)
tc_queue.appendleft(cmd.pack_command_tuple())
q.add_pus_tc(generate_one_hk_command(sid=sid))
if op_code in BpxOpCodes.REBOOT:
tc_queue.appendleft((QueueCommands.PRINT, "Rebooting BPX battery"))
cmd = generate_action_command(
q.add_log_cmd("Rebooting BPX battery")
q.add_pus_tc(
generate_action_command(
object_id=BPX_HANDLER_ID, action_id=BpxActionIds.REBOOT
)
tc_queue.appendleft(cmd.pack_command_tuple())
pass
)

View File

@ -7,9 +7,9 @@
"""
import struct
from tmtccmd.config.definitions import QueueCommands
from tmtccmd.tc.packer import TcQueueT
from spacepackets.ecss.tc import PusTelecommand
from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.util import ObjectIdU32
class CommandIds:
@ -33,83 +33,48 @@ class CommandIds:
def pack_ccsds_handler_test(
object_id: bytearray, tc_queue: TcQueueT, op_code: str
) -> TcQueueT:
tc_queue.appendleft(
(
QueueCommands.PRINT,
"Testing CCSDS handler with object id: 0x" + object_id.hex(),
)
)
object_id: ObjectIdU32, q: DefaultPusQueueHelper, op_code: str
):
obyt = object_id.as_bytes
q.add_log_cmd(f"Testing CCSDS handler with object id: {object_id.as_hex_string}")
if op_code == "0":
tc_queue.appendleft((QueueCommands.PRINT, "CCSDS Handler: Set low rate"))
command = object_id + struct.pack("!I", CommandIds.SET_LOW_RATE)
command = PusTelecommand(service=8, subservice=128, ssc=20, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
q.add_log_cmd("CCSDS Handler: Set low rate")
command = obyt + struct.pack("!I", CommandIds.SET_LOW_RATE)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "1":
tc_queue.appendleft((QueueCommands.PRINT, "CCSDS Handler: Set high rate"))
command = object_id + struct.pack("!I", CommandIds.SET_HIGH_RATE)
command = PusTelecommand(service=8, subservice=128, ssc=21, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
q.add_log_cmd("CCSDS Handler: Set high rate")
command = obyt + struct.pack("!I", CommandIds.SET_HIGH_RATE)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "2":
tc_queue.appendleft(
(QueueCommands.PRINT, "CCSDS Handler: Enables the transmitter")
)
command = object_id + struct.pack("!I", CommandIds.EN_TRANSMITTER)
command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
q.add_log_cmd("CCSDS Handler: Enables the transmitter")
command = obyt + struct.pack("!I", CommandIds.EN_TRANSMITTER)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "3":
tc_queue.appendleft(
(QueueCommands.PRINT, "CCSDS Handler: Disables the transmitter")
)
command = object_id + struct.pack("!I", CommandIds.DIS_TRANSMITTER)
command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
q.add_log_cmd("CCSDS Handler: Disables the transmitter")
command = obyt + struct.pack("!I", CommandIds.DIS_TRANSMITTER)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "4":
tc_queue.appendleft(
(QueueCommands.PRINT, "CCSDS Handler: Set arbitrary bitrate")
)
q.add_log_cmd("CCSDS Handler: Set arbitrary bitrate")
bitrate = int(input("Specify bit rate (bps): "))
command = (
object_id
obyt
+ struct.pack("!I", CommandIds.ARBITRARY_BITRATE)
+ struct.pack("!I", bitrate)
)
command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "5":
tc_queue.appendleft(
(QueueCommands.PRINT, "CCSDS Handler: Enable tx clock manipulator")
)
command = object_id + struct.pack("!I", CommandIds.ENABLE_TX_CLK_MANIPULATOR)
command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
q.add_log_cmd("CCSDS Handler: Enable tx clock manipulator")
command = obyt + struct.pack("!I", CommandIds.ENABLE_TX_CLK_MANIPULATOR)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "6":
tc_queue.appendleft(
(QueueCommands.PRINT, "CCSDS Handler: Disable tx clock manipulator")
)
command = object_id + struct.pack("!I", CommandIds.DISABLE_TX_CLK_MANIPULATOR)
command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
q.add_log_cmd("CCSDS Handler: Disable tx clock manipulator")
command = obyt + struct.pack("!I", CommandIds.DISABLE_TX_CLK_MANIPULATOR)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "7":
tc_queue.appendleft(
(
QueueCommands.PRINT,
"CCSDS Handler: Update tx data on rising edge of tx clock",
)
)
command = object_id + struct.pack("!I", CommandIds.UPDATE_ON_RISING_EDGE)
command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
q.add_log_cmd("CCSDS Handler: Update tx data on rising edge of tx clock")
command = obyt + struct.pack("!I", CommandIds.UPDATE_ON_RISING_EDGE)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "8":
tc_queue.appendleft(
(
QueueCommands.PRINT,
"CCSDS Handler: Update tx data on falling edge of tx clock",
)
)
command = object_id + struct.pack("!I", CommandIds.UPDATE_ON_FALLING_EDGE)
command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
return tc_queue
q.add_log_cmd("CCSDS Handler: Update tx data on falling edge of tx clock")
command = obyt + struct.pack("!I", CommandIds.UPDATE_ON_FALLING_EDGE)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))

461
pus_tc/devs/common_power.py Normal file
View File

@ -0,0 +1,461 @@
import enum
from config.object_ids import PDU_1_HANDLER_ID, PDU_2_HANDLER_ID
from gomspace.gomspace_common import (
pack_set_param_command,
Channel,
GomspaceOpCodes,
GsInfo,
SetIds,
)
from gomspace.gomspace_pdu_definitions import PDU_CONFIG_LIST
from tmtccmd.config import OpCodeEntry
from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.tc.pus_3_fsfw_hk import (
make_sid,
generate_one_diag_command,
generate_one_hk_command,
)
class Pdu1ChIndex(enum.IntEnum):
TCS = 0
SYRLINKS = 1
STR = 2
MGT = 3
SUS_N = 4
SCEX = 5
PLOC = 6
ACS_A = 7
class Pdu1InfoBase:
TCS = "Switch TCS Board"
SYRLINKS = "Switch Syrlinks (COM)"
STR = "Switch Startracker"
MGT = "Switch Magnetorquer"
SUS_N = "Switch Sun Sensor Board Nominal"
SCEX = "Switch Solar Cell Experiment"
PLOC = "Switch Payload On-Board Computer"
ACS_A = "Switch ACS Board A-Side"
class Pdu2InfoBase:
PL_PCDU_BAT_NOM = "Switch PL PCDU Nominal Battery Channel"
RW = "Switch Reaction Wheel"
HEATER = "Switch Heater"
SUS_R = "Switch Sun Sensor Board Redundant"
SOLAR_ARRAY_DEPL = "Switch Solar Array Deployment"
PL_PCDU_BAT_RED = "Switch PL PCDU Redundant Battery Channel"
ACS_B = "Switch ACS Board B-Side"
PL_CAM = "Switch Payload Camera"
class PowerInfo:
INFO_CORE = "Core Information"
INFO_AUX = "Auxiliary Information"
INFO_ALL = "All Information"
class Pdu2ChIndex(enum.IntEnum):
PL_PCDU_BAT_NOM = 1
RW = 2
HEATER = 3
SUS_R = 4
SOLAR_ARRAY_DEPL = 5
PL_PCDU_BAT_RED = 6
ACS_B = 7
PL_CAM = 8
class PowerOpCodes:
# PDU 1
TCS_ON = ["tcs-on"]
TCS_OFF = ["tcs-off"]
SYRLINKS_ON = ["syrlinks-on"]
SYRLINKS_OFF = ["syrlinks-off"]
STAR_TRACKER_ON = ["str-on"]
STAR_TRACKER_OFF = ["str-off"]
MGT_ON = ["mgt-on"]
MGT_OFF = ["mgt-off"]
SUS_N_ON = ["sus-nom-on"]
SUS_N_OFF = ["sus-nom-off"]
SCEX_ON = ["scex-on"]
SCEX_OFF = ["scex-off"]
PLOC_ON = ["ploc-on"]
PLOC_OFF = ["ploc-off"]
ACS_A_ON = ["acs-a-on"]
ACS_A_OFF = ["acs-a-off"]
# PDU 2
PL_PCDU_VBAT_NOM_ON = ["plpcdu-vbat-nom-on"]
PL_PCDU_VBAT_NOM_OFF = ["plpcdu-vbat-nom-off"]
RW_ON = ["rw-on"]
RW_OFF = ["rw-off"]
HEATER_ON = ["heater-on"]
HEATER_OFF = ["heater-off"]
SUS_R_ON = ["sus-red-on"]
SUS_R_OFF = ["sus-red-off"]
SOLAR_ARRAY_DEPL_ON = ["sa-depl-on"]
SOLAR_ARRAY_DEPL_OFF = ["sa-depl-off"]
PL_PCDU_VBAT_RED_ON = ["plpcdu-vbat-red-on"]
PL_PCDU_VBAT_RED_OFF = ["plpcdu-vbat-red-off"]
ACS_B_ON = ["acs-b-on"]
ACS_B_OFF = ["acs-b-off"]
PL_CAM_ON = ["cam-on"]
PL_CAM_OFF = ["cam-off"]
INFO_CORE = ["info"]
INFO_AUX = ["info-aux"]
INFO_ALL = ["info-all"]
def info_on_pdu1(base: str) -> str:
return "PDU1: " + base + " on"
def info_off_pdu1(base: str) -> str:
return "PDU1: " + base + " off"
def info_on_pdu2(base: str) -> str:
return "PDU2: " + base + " on"
def info_off_pdu2(base: str) -> str:
return "PDU2: " + base + " off"
def add_pdu1_common_defs(oce: OpCodeEntry):
oce.add(keys=PowerOpCodes.TCS_ON, info=info_on_pdu1(Pdu1InfoBase.TCS))
oce.add(keys=PowerOpCodes.TCS_OFF, info=info_off_pdu1(Pdu1InfoBase.TCS))
oce.add(keys=PowerOpCodes.STAR_TRACKER_ON, info=info_on_pdu1(Pdu1InfoBase.STR))
oce.add(keys=PowerOpCodes.STAR_TRACKER_OFF, info=info_off_pdu1(Pdu1InfoBase.STR))
oce.add(keys=PowerOpCodes.SUS_N_ON, info=info_on_pdu1(Pdu1InfoBase.SUS_N))
oce.add(keys=PowerOpCodes.SUS_N_OFF, info=info_off_pdu1(Pdu1InfoBase.SUS_N))
oce.add(keys=PowerOpCodes.ACS_A_ON, info=info_on_pdu1(Pdu1InfoBase.ACS_A))
oce.add(keys=PowerOpCodes.ACS_A_OFF, info=info_off_pdu1(Pdu1InfoBase.ACS_A))
oce.add(keys=PowerOpCodes.SYRLINKS_ON, info=info_on_pdu1(Pdu1InfoBase.SYRLINKS))
oce.add(keys=PowerOpCodes.SYRLINKS_OFF, info=info_off_pdu1(Pdu1InfoBase.SYRLINKS))
oce.add(keys=PowerOpCodes.MGT_ON, info=info_on_pdu1(Pdu1InfoBase.MGT))
oce.add(keys=PowerOpCodes.MGT_OFF, info=info_off_pdu1(Pdu1InfoBase.MGT))
oce.add(keys=PowerOpCodes.PLOC_ON, info=info_on_pdu1(Pdu1InfoBase.PLOC))
oce.add(keys=PowerOpCodes.PLOC_OFF, info=info_off_pdu1(Pdu1InfoBase.PLOC))
oce.add(keys=PowerOpCodes.SCEX_ON, info=info_on_pdu1(Pdu1InfoBase.SCEX))
oce.add(keys=PowerOpCodes.SCEX_OFF, info=info_off_pdu1(Pdu1InfoBase.SCEX))
def add_pdu2_common_defs(oce: OpCodeEntry):
oce.add(keys=PowerOpCodes.ACS_B_ON, info=info_on_pdu2(Pdu2InfoBase.ACS_B))
oce.add(keys=PowerOpCodes.ACS_B_OFF, info=info_off_pdu2(Pdu2InfoBase.ACS_B))
oce.add(keys=PowerOpCodes.SUS_R_ON, info=info_on_pdu2(Pdu2InfoBase.SUS_R))
oce.add(keys=PowerOpCodes.SUS_R_OFF, info=info_off_pdu2(Pdu2InfoBase.SUS_R))
oce.add(keys=PowerOpCodes.RW_ON, info=info_on_pdu2(Pdu2InfoBase.RW))
oce.add(keys=PowerOpCodes.RW_OFF, info=info_off_pdu2(Pdu2InfoBase.RW))
oce.add(
keys=PowerOpCodes.PL_PCDU_VBAT_NOM_ON,
info=info_on_pdu2(Pdu2InfoBase.PL_PCDU_BAT_NOM),
)
oce.add(
keys=PowerOpCodes.PL_PCDU_VBAT_NOM_OFF,
info=info_off_pdu2(Pdu2InfoBase.PL_PCDU_BAT_NOM),
)
oce.add(
keys=PowerOpCodes.PL_PCDU_VBAT_RED_ON,
info=info_on_pdu2(Pdu2InfoBase.PL_PCDU_BAT_RED),
)
oce.add(
keys=PowerOpCodes.PL_PCDU_VBAT_RED_OFF,
info=info_off_pdu2(Pdu2InfoBase.PL_PCDU_BAT_RED),
)
oce.add(keys=PowerOpCodes.HEATER_ON, info=info_on_pdu2(Pdu2InfoBase.HEATER))
oce.add(keys=PowerOpCodes.HEATER_OFF, info=info_off_pdu2(Pdu2InfoBase.HEATER))
oce.add(
keys=PowerOpCodes.SOLAR_ARRAY_DEPL_ON,
info=info_on_pdu2(Pdu2InfoBase.SOLAR_ARRAY_DEPL),
)
oce.add(
keys=PowerOpCodes.SOLAR_ARRAY_DEPL_OFF,
info=info_off_pdu2(Pdu2InfoBase.SOLAR_ARRAY_DEPL),
)
oce.add(keys=PowerOpCodes.PL_CAM_ON, info=info_on_pdu2(Pdu2InfoBase.PL_CAM))
oce.add(keys=PowerOpCodes.PL_CAM_OFF, info=info_off_pdu2(Pdu2InfoBase.PL_CAM))
def pdu1_cmds(q: DefaultPusQueueHelper, op_code: str):
if op_code in PowerOpCodes.TCS_ON:
tcs_on_cmd(q)
elif op_code in PowerOpCodes.TCS_OFF:
tcs_off_cmd(q)
elif op_code in PowerOpCodes.SYRLINKS_ON:
syrlinks_on_cmd(q)
elif op_code in PowerOpCodes.SYRLINKS_OFF:
syrlinks_off_cmd(q)
elif op_code in PowerOpCodes.STAR_TRACKER_ON:
startracker_on_cmd(q)
elif op_code in PowerOpCodes.STAR_TRACKER_OFF:
startracker_off_cmd(q)
elif op_code in PowerOpCodes.MGT_ON:
mgt_on_cmd(q)
elif op_code in PowerOpCodes.MGT_OFF:
mgt_off_cmd(q)
elif op_code in PowerOpCodes.SUS_N_ON:
sun_sensor_nominal_on_cmd(q)
elif op_code in PowerOpCodes.SUS_N_OFF:
sun_sensor_nominal_off_cmd(q)
elif op_code in PowerOpCodes.SCEX_ON:
solar_cell_experiment_on_cmd(q)
elif op_code in PowerOpCodes.SCEX_OFF:
solar_cell_experiment_off_cmd(q)
elif op_code in PowerOpCodes.PLOC_ON:
ploc_on_cmd(q)
elif op_code in PowerOpCodes.PLOC_OFF:
ploc_off_cmd(q)
elif op_code in PowerOpCodes.ACS_A_ON:
acs_board_a_on_cmd(q)
elif op_code in PowerOpCodes.ACS_A_OFF:
acs_board_a_off_cmd(q)
def pdu2_cmds(q: DefaultPusQueueHelper, op_code: str):
if op_code in PowerOpCodes.PL_PCDU_VBAT_NOM_ON:
pl_pcdu_bat_nom_on_cmd(q)
elif op_code in PowerOpCodes.PL_PCDU_VBAT_NOM_OFF:
pl_pcdu_bat_nom_off_cmd(q)
elif op_code in PowerOpCodes.RW_ON:
reaction_wheel_on_cmd(q)
elif op_code in PowerOpCodes.RW_OFF:
reaction_wheel_off_cmd(q)
elif op_code in PowerOpCodes.HEATER_ON:
heater_on_cmd(q)
elif op_code in PowerOpCodes.HEATER_OFF:
heater_off_cmd(q)
elif op_code in PowerOpCodes.SUS_R_ON:
sus_red_on_cmd(q)
elif op_code in PowerOpCodes.SUS_R_OFF:
sus_red_off_cmd(q)
elif op_code in PowerOpCodes.SOLAR_ARRAY_DEPL_ON:
solar_array_deployment_on_cmd(q)
elif op_code in PowerOpCodes.SOLAR_ARRAY_DEPL_OFF:
solar_array_deployment_off_cmd(q)
elif op_code in PowerOpCodes.PL_PCDU_VBAT_RED_ON:
pl_pcdu_bat_red_on_cmd(q)
elif op_code in PowerOpCodes.PL_PCDU_VBAT_RED_OFF:
pl_pcdu_bat_nom_off_cmd(q)
elif op_code in PowerOpCodes.ACS_B_ON:
acs_board_b_side_on_cmd(q)
elif op_code in PowerOpCodes.ACS_B_OFF:
acs_board_b_side_off_cmd(q)
elif op_code in PowerOpCodes.PL_CAM_ON:
payload_camera_on_cmd(q)
elif op_code in PowerOpCodes.PL_CAM_OFF:
payload_camera_off_cmd(q)
def pdu1_req_hk_cmds(q: DefaultPusQueueHelper, op_code: str):
if op_code in GomspaceOpCodes.REQUEST_CORE_HK_ONCE:
q.add_log_cmd(f"PDU1: {GsInfo.REQUEST_CORE_HK_ONCE}")
hk_sid = make_sid(object_id=PDU_1_HANDLER_ID, set_id=SetIds.PDU_1_CORE)
q.add_pus_tc(generate_one_diag_command(sid=hk_sid))
if op_code in GomspaceOpCodes.REQUEST_AUX_HK_ONCE:
q.add_log_cmd(f"PDU1: {GsInfo.REQUEST_AUX_HK_ONCE}")
hk_sid = make_sid(object_id=PDU_1_HANDLER_ID, set_id=SetIds.PDU_1_AUX)
q.add_pus_tc(generate_one_hk_command(sid=hk_sid))
def pdu2_req_hk_cmds(q: DefaultPusQueueHelper, op_code: str):
if op_code in GomspaceOpCodes.REQUEST_CORE_HK_ONCE:
q.add_log_cmd(f"PDU2: {GsInfo.REQUEST_CORE_HK_ONCE}")
hk_sid = make_sid(object_id=PDU_2_HANDLER_ID, set_id=SetIds.PDU_2_CORE)
q.add_pus_tc(generate_one_diag_command(sid=hk_sid))
if op_code in GomspaceOpCodes.REQUEST_AUX_HK_ONCE:
q.add_log_cmd(f"PDU2: {GsInfo.REQUEST_AUX_HK_ONCE}")
hk_sid = make_sid(object_id=PDU_2_HANDLER_ID, set_id=SetIds.PDU_2_AUX)
q.add_pus_tc(generate_one_hk_command(sid=hk_sid))
def pack_power_commands(q: DefaultPusQueueHelper, op_code: str):
pdu1_cmds(q, op_code)
pdu2_cmds(q, op_code)
if op_code in PowerOpCodes.INFO_CORE:
pdu1_req_hk_cmds(q, GomspaceOpCodes.REQUEST_CORE_HK_ONCE[0])
pdu2_req_hk_cmds(q, GomspaceOpCodes.REQUEST_CORE_HK_ONCE[0])
q.add_wait_seconds(3.0)
elif op_code in PowerOpCodes.INFO_AUX:
pdu1_req_hk_cmds(q, GomspaceOpCodes.REQUEST_AUX_HK_ONCE[0])
pdu2_req_hk_cmds(q, GomspaceOpCodes.REQUEST_AUX_HK_ONCE[0])
q.add_wait_seconds(3.0)
elif op_code in PowerOpCodes.INFO_ALL:
pdu1_req_hk_cmds(q, GomspaceOpCodes.REQUEST_CORE_HK_ONCE[0])
pdu2_req_hk_cmds(q, GomspaceOpCodes.REQUEST_CORE_HK_ONCE[0])
pdu1_req_hk_cmds(q, GomspaceOpCodes.REQUEST_AUX_HK_ONCE[0])
pdu2_req_hk_cmds(q, GomspaceOpCodes.REQUEST_AUX_HK_ONCE[0])
q.add_wait_seconds(3.0)
def tcs_on_cmd(q: DefaultPusQueueHelper):
generic_on_cmd(PDU_1_HANDLER_ID, q, Pdu1InfoBase.TCS, Pdu1ChIndex.TCS)
def tcs_off_cmd(q: DefaultPusQueueHelper):
generic_off_cmd(PDU_1_HANDLER_ID, q, Pdu1InfoBase.TCS, Pdu1ChIndex.TCS)
def syrlinks_on_cmd(q: DefaultPusQueueHelper):
generic_on_cmd(PDU_1_HANDLER_ID, q, Pdu1InfoBase.SYRLINKS, Pdu1ChIndex.SYRLINKS)
def syrlinks_off_cmd(q: DefaultPusQueueHelper):
generic_off_cmd(PDU_1_HANDLER_ID, q, Pdu1InfoBase.SYRLINKS, Pdu1ChIndex.SYRLINKS)
def startracker_on_cmd(q: DefaultPusQueueHelper):
generic_on_cmd(PDU_1_HANDLER_ID, q, Pdu1InfoBase.STR, Pdu1ChIndex.STR)
def startracker_off_cmd(q: DefaultPusQueueHelper):
generic_off_cmd(PDU_1_HANDLER_ID, q, Pdu1InfoBase.STR, Pdu1ChIndex.STR)
def mgt_on_cmd(q: DefaultPusQueueHelper):
generic_on_cmd(PDU_1_HANDLER_ID, q, Pdu1InfoBase.MGT, Pdu1ChIndex.MGT)
def mgt_off_cmd(q: DefaultPusQueueHelper):
generic_off_cmd(PDU_1_HANDLER_ID, q, Pdu1InfoBase.MGT, Pdu1ChIndex.MGT)
def sun_sensor_nominal_on_cmd(q: DefaultPusQueueHelper):
generic_on_cmd(PDU_1_HANDLER_ID, q, Pdu1InfoBase.SUS_N, Pdu1ChIndex.SUS_N)
def sun_sensor_nominal_off_cmd(q: DefaultPusQueueHelper):
generic_off_cmd(PDU_1_HANDLER_ID, q, Pdu1InfoBase.SUS_N, Pdu1ChIndex.SUS_N)
def solar_cell_experiment_on_cmd(q: DefaultPusQueueHelper):
generic_on_cmd(PDU_1_HANDLER_ID, q, Pdu1InfoBase.SCEX, Pdu1ChIndex.SCEX)
def solar_cell_experiment_off_cmd(q: DefaultPusQueueHelper):
generic_off_cmd(PDU_1_HANDLER_ID, q, Pdu1InfoBase.SCEX, Pdu1ChIndex.SCEX)
def ploc_on_cmd(q: DefaultPusQueueHelper):
generic_on_cmd(PDU_1_HANDLER_ID, q, Pdu1InfoBase.PLOC, Pdu1ChIndex.PLOC)
def ploc_off_cmd(q: DefaultPusQueueHelper):
generic_off_cmd(PDU_1_HANDLER_ID, q, Pdu1InfoBase.PLOC, Pdu1ChIndex.PLOC)
def acs_board_a_on_cmd(q: DefaultPusQueueHelper):
generic_on_cmd(PDU_1_HANDLER_ID, q, Pdu1InfoBase.ACS_A, Pdu1ChIndex.ACS_A)
def acs_board_a_off_cmd(q: DefaultPusQueueHelper):
generic_on_cmd(PDU_1_HANDLER_ID, q, Pdu1InfoBase.ACS_A, Pdu1ChIndex.ACS_A)
def pl_pcdu_bat_nom_on_cmd(q: DefaultPusQueueHelper):
generic_on_cmd(
PDU_2_HANDLER_ID, q, Pdu2InfoBase.PL_PCDU_BAT_NOM, Pdu2ChIndex.PL_PCDU_BAT_NOM
)
def pl_pcdu_bat_nom_off_cmd(q: DefaultPusQueueHelper):
generic_off_cmd(
PDU_2_HANDLER_ID, q, Pdu2InfoBase.PL_PCDU_BAT_NOM, Pdu2ChIndex.PL_PCDU_BAT_NOM
)
def reaction_wheel_on_cmd(q: DefaultPusQueueHelper):
generic_on_cmd(PDU_2_HANDLER_ID, q, Pdu2InfoBase.RW, Pdu2ChIndex.RW)
def reaction_wheel_off_cmd(q: DefaultPusQueueHelper):
generic_off_cmd(PDU_2_HANDLER_ID, q, Pdu2InfoBase.RW, Pdu2ChIndex.RW)
def heater_on_cmd(q: DefaultPusQueueHelper):
generic_on_cmd(PDU_2_HANDLER_ID, q, Pdu2InfoBase.HEATER, Pdu2ChIndex.HEATER)
def heater_off_cmd(q: DefaultPusQueueHelper):
generic_off_cmd(PDU_2_HANDLER_ID, q, Pdu2InfoBase.HEATER, Pdu2ChIndex.HEATER)
def sus_red_on_cmd(q: DefaultPusQueueHelper):
generic_on_cmd(PDU_2_HANDLER_ID, q, Pdu2InfoBase.SUS_R, Pdu2ChIndex.SUS_R)
def sus_red_off_cmd(q: DefaultPusQueueHelper):
generic_off_cmd(PDU_2_HANDLER_ID, q, Pdu2InfoBase.SUS_R, Pdu2ChIndex.SUS_R)
def solar_array_deployment_on_cmd(q: DefaultPusQueueHelper):
generic_on_cmd(
PDU_2_HANDLER_ID, q, Pdu2InfoBase.SOLAR_ARRAY_DEPL, Pdu2ChIndex.SOLAR_ARRAY_DEPL
)
def solar_array_deployment_off_cmd(q: DefaultPusQueueHelper):
generic_off_cmd(
PDU_2_HANDLER_ID, q, Pdu2InfoBase.SOLAR_ARRAY_DEPL, Pdu2ChIndex.SOLAR_ARRAY_DEPL
)
def pl_pcdu_bat_red_on_cmd(q: DefaultPusQueueHelper):
generic_on_cmd(
PDU_2_HANDLER_ID, q, Pdu2InfoBase.PL_PCDU_BAT_RED, Pdu2ChIndex.PL_PCDU_BAT_RED
)
def pl_pcdu_bat_red_off_cmd(q: DefaultPusQueueHelper):
generic_off_cmd(
PDU_2_HANDLER_ID, q, Pdu2InfoBase.PL_PCDU_BAT_RED, Pdu2ChIndex.PL_PCDU_BAT_RED
)
def acs_board_b_side_on_cmd(q: DefaultPusQueueHelper):
generic_on_cmd(PDU_2_HANDLER_ID, q, Pdu2InfoBase.ACS_B, Pdu2ChIndex.ACS_B)
def acs_board_b_side_off_cmd(q: DefaultPusQueueHelper):
generic_off_cmd(PDU_2_HANDLER_ID, q, Pdu2InfoBase.ACS_B, Pdu2ChIndex.ACS_B)
def payload_camera_on_cmd(q: DefaultPusQueueHelper):
generic_on_cmd(PDU_2_HANDLER_ID, q, Pdu2InfoBase.PL_CAM, Pdu2ChIndex.PL_CAM)
def payload_camera_off_cmd(q: DefaultPusQueueHelper):
generic_off_cmd(PDU_2_HANDLER_ID, q, Pdu2InfoBase.PL_CAM, Pdu2ChIndex.PL_CAM)
def generic_on_cmd(
object_id: bytes, q: DefaultPusQueueHelper, info_str: str, out_idx: int
):
q.add_log_cmd(info_str + " on")
q.add_pus_tc(
pack_set_param_command(
object_id,
PDU_CONFIG_LIST[out_idx].parameter_address,
PDU_CONFIG_LIST[out_idx].parameter_size,
Channel.on,
)
)
def generic_off_cmd(
object_id: bytes, q: DefaultPusQueueHelper, info_str: str, out_idx: int
):
q.add_log_cmd(info_str + " off")
q.add_pus_tc(
pack_set_param_command(
object_id,
PDU_CONFIG_LIST[out_idx].parameter_address,
PDU_CONFIG_LIST[out_idx].parameter_size,
Channel.off,
)
)

View File

@ -1,22 +1,48 @@
import enum
from tmtccmd.config.definitions import QueueCommands
from tmtccmd.tc.definitions import TcQueueT
from tmtccmd.tc.service_8_functional_cmd import generate_action_command
from config.definitions import CustomServiceList
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
from tmtccmd.config.tmtc import tmtc_definitions_provider
from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.tc.pus_3_fsfw_hk import make_sid, generate_one_hk_command
from tmtccmd.logging import get_console_logger
from config.object_ids import GPS_HANDLER_1_ID, GPS_HANDLER_0_ID
LOGGER = get_console_logger()
class GpsOpCodes(enum.Enum):
RESET_GNSS = "5"
class OpCodes:
REQ_OS_HK = ["0", "hk-os"]
RESET_GNSS = ["5", "reset"]
def pack_gps_command(object_id: bytes, tc_queue: TcQueueT, op_code: str):
if op_code == GpsOpCodes.RESET_GNSS.value:
if object_id == GPS_HANDLER_0_ID:
tc_queue.appendleft((QueueCommands.PRINT, "Resetting GPS device 0"))
elif object_id == GPS_HANDLER_1_ID:
tc_queue.appendleft((QueueCommands.PRINT, "Resetting GPS device 1"))
cmd = generate_action_command(object_id=object_id, action_id=int(op_code))
tc_queue.appendleft(cmd.pack_command_tuple())
class Info:
REQ_OS_HK = "Request One-Shot HK"
RESET_GNSS = "Reset GNSS using reset pin"
class SetIds:
HK = 0
@tmtc_definitions_provider
def add_gps_cmds(defs: TmtcDefinitionWrapper):
oce = OpCodeEntry()
oce.add(keys=OpCodes.RESET_GNSS, info=Info.RESET_GNSS)
oce.add(keys=OpCodes.REQ_OS_HK, info=Info.REQ_OS_HK)
defs.add_service(
name=CustomServiceList.GPS_CTRL.value,
info="GPS/GNSS Controller",
op_code_entry=oce,
)
def pack_gps_command(object_id: bytes, q: DefaultPusQueueHelper, op_code: str):
if op_code in OpCodes.RESET_GNSS:
# TODO: This needs to be re-implemented
LOGGER.warning("Reset pin handling needs to be re-implemented")
if op_code in OpCodes.REQ_OS_HK:
q.add_log_cmd(f"GMSS: {Info.REQ_OS_HK}")
q.add_pus_tc(
generate_one_hk_command(sid=make_sid(object_id=object_id, set_id=SetIds.HK))
)

10
pus_tc/devs/gyros.py Normal file
View File

@ -0,0 +1,10 @@
import enum
class AdisGyroSetIds(enum.IntEnum):
CORE_HK = 0
CFG_HK = 1
class L3gGyroSetIds(enum.IntEnum):
CORE_HK = 0

View File

@ -7,12 +7,16 @@ import enum
from config.definitions import CustomServiceList
from config.object_ids import get_object_ids
from tmtccmd.pus.obj_id import ObjectIdDictT, ObjectId
from tmtccmd.config.definitions import QueueCommands, ServiceOpCodeDictT
from tmtccmd.tc.pus_201_fsfw_health import pack_set_health_cmd_data, FsfwHealth, Subservices
from tmtccmd.tc.service_8_functional_cmd import generate_action_command
from tmtccmd.config.globals import add_service_op_code_entry, add_op_code_entry
from tmtccmd.tc.packer import TcQueueT
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
from tmtccmd.config.tmtc import tmtc_definitions_provider
from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.util.obj_id import ObjectIdU32
from tmtccmd.tc.pus_201_fsfw_health import (
pack_set_health_cmd_data,
FsfwHealth,
Subservices,
)
from tmtccmd.tc.pus_8_funccmd import generate_action_command
from spacepackets.ecss.tc import PusTelecommand
@ -42,41 +46,31 @@ class Info:
HEATER_HEALTHY_CMD = "Set to healthy"
# Needed in OBSW to differentiate between external and internal heater commands
COMMAND_SOURCE_PARAM_EXTERNAL = 1
class ActionIds(enum.IntEnum):
SWITCH_HEATER = 0
def add_heater_cmds(cmd_dict: ServiceOpCodeDictT):
op_code_dict = dict()
add_op_code_entry(
op_code_dict=op_code_dict, keys=OpCodes.HEATER_CMD, info=Info.HEATER_CMD
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=OpCodes.HEATER_HEALTHY_CMD,
info=Info.HEATER_HEALTHY_CMD,
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=OpCodes.HEATER_EXT_CTRL,
info=Info.HEATER_EXT_CTRL,
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=OpCodes.HEATER_FAULTY_CMD,
info=Info.HEATER_FAULTY_CMD,
)
add_service_op_code_entry(
srv_op_code_dict=cmd_dict,
@tmtc_definitions_provider
def add_heater_cmds(defs: TmtcDefinitionWrapper):
oce = OpCodeEntry()
oce.add(keys=OpCodes.HEATER_CMD, info=Info.HEATER_CMD)
oce.add(keys=OpCodes.HEATER_HEALTHY_CMD, info=Info.HEATER_HEALTHY_CMD)
oce.add(keys=OpCodes.HEATER_EXT_CTRL, info=Info.HEATER_EXT_CTRL)
oce.add(keys=OpCodes.HEATER_FAULTY_CMD, info=Info.HEATER_FAULTY_CMD)
defs.add_service(
name=CustomServiceList.HEATER.value,
info="Heater Device",
op_code_entry=op_code_dict,
op_code_entry=oce,
)
def pack_heater_cmds(object_id: bytearray, op_code: str, tc_queue: TcQueueT):
def pack_heater_cmds(object_id: bytearray, op_code: str, q: DefaultPusQueueHelper):
if op_code in OpCodes.HEATER_CMD:
tc_queue.appendleft((QueueCommands.PRINT, "Heater Switching"))
q.add_log_cmd("Heater Switching")
heater_number = prompt_heater()
while True:
action = input("Turn switch on or off? (0 - off, 1 - on): ")
@ -93,14 +87,13 @@ def pack_heater_cmds(object_id: bytearray, op_code: str, tc_queue: TcQueueT):
else:
act_str = "off"
debug_string = f"Switching heater {heater_number} {act_str}"
tc_queue.appendleft((QueueCommands.PRINT, debug_string))
command = pack_switch_heater_command(object_id, heater_number, action)
tc_queue.appendleft(command.pack_command_tuple())
q.add_log_cmd(debug_string)
q.add_pus_tc(pack_switch_heater_command(object_id, heater_number, action))
if op_code in OpCodes.HEATER_EXT_CTRL:
heater_number = prompt_heater()
obj_id = heater_idx_to_obj(heater_number)
health_cmd(
tc_queue=tc_queue,
q=q,
object_id=obj_id,
health=FsfwHealth.EXTERNAL_CTRL,
health_str="External Control",
@ -110,7 +103,7 @@ def pack_heater_cmds(object_id: bytearray, op_code: str, tc_queue: TcQueueT):
heater_number = prompt_heater()
obj_id = heater_idx_to_obj(heater_number)
health_cmd(
tc_queue=tc_queue,
q=q,
object_id=obj_id,
health=FsfwHealth.FAULTY,
health_str="Faulty",
@ -120,7 +113,7 @@ def pack_heater_cmds(object_id: bytearray, op_code: str, tc_queue: TcQueueT):
heater_number = prompt_heater()
obj_id = heater_idx_to_obj(heater_number)
health_cmd(
tc_queue=tc_queue,
q=q,
object_id=obj_id,
health=FsfwHealth.HEALTHY,
health_str="Healthy",
@ -128,7 +121,7 @@ def pack_heater_cmds(object_id: bytearray, op_code: str, tc_queue: TcQueueT):
)
def heater_idx_to_obj(heater: int) -> ObjectId:
def heater_idx_to_obj(heater: int) -> ObjectIdU32:
from config.object_ids import (
HEATER_0_OBC_BRD,
HEATER_1_PLOC_PROC_BRD,
@ -153,12 +146,20 @@ def heater_idx_to_obj(heater: int) -> ObjectId:
obj_dict = get_object_ids()
obj_id_obj = obj_dict.get(obj_id_array[heater])
if obj_id_obj is None:
return ObjectId.from_bytes(obj_id_array[heater])
return ObjectIdU32.from_bytes(obj_id_array[heater])
return obj_id_obj
def prompt_heater() -> int:
while True:
print("HEATER 0 | PLOC PROC Board")
print("HEATER 1 | PCDU Board")
print("HEATER 2 | ACS Board")
print("HEATER 3 | OBC Board")
print("HEATER 4 | CAMERA")
print("HEATER 5 | STR")
print("HEATER 6 | DRO")
print("HEATER 7 | HPA")
heater_number = input("Type number of heater to switch [0-7]: ")
if not heater_number.isdigit():
print("Heater number not a digit")
@ -172,23 +173,19 @@ def prompt_heater() -> int:
def health_cmd(
tc_queue: TcQueueT,
q: DefaultPusQueueHelper,
heater_idx: int,
object_id: ObjectId,
object_id: ObjectIdU32,
health: FsfwHealth,
health_str: str,
):
tc_queue.appendleft(
(
QueueCommands.PRINT,
f"Setting Heater {heater_idx} {object_id} to {health_str}",
)
)
q.add_log_cmd(f"Setting Heater {heater_idx} {object_id} to {health_str}")
app_data = pack_set_health_cmd_data(object_id=object_id.as_bytes, health=health)
cmd = PusTelecommand(
q.add_pus_tc(
PusTelecommand(
service=201, subservice=Subservices.TC_SET_HEALTH, app_data=app_data
)
tc_queue.appendleft(cmd.pack_command_tuple())
)
def pack_switch_heater_command(
@ -202,6 +199,7 @@ def pack_switch_heater_command(
command = bytearray()
command.append(switch_nr)
command.append(switch_action)
command.append(COMMAND_SOURCE_PARAM_EXTERNAL)
return generate_action_command(
object_id=object_id, action_id=ActionIds.SWITCH_HEATER, app_data=command
)

View File

@ -5,11 +5,17 @@
@author J. Meier
@date 25.03.2021
"""
from tmtccmd.config.definitions import QueueCommands
import struct
from tmtccmd.tc.packer import TcQueueT
from spacepackets.ecss.tc import PusTelecommand
from tmtccmd.tc.service_3_housekeeping import make_sid, generate_one_hk_command
from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.tc.pus_3_fsfw_hk import (
make_sid,
generate_one_diag_command,
generate_one_hk_command,
)
from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Modes
from tmtccmd.util import ObjectIdU32
class ImtqSetIds:
@ -33,199 +39,150 @@ class ImtqActionIds:
perform_negative_y_test = bytearray([0x0, 0x0, 0x0, 0x0A])
perform_positive_z_test = bytearray([0x0, 0x0, 0x0, 0x0B])
perform_negative_z_test = bytearray([0x0, 0x0, 0x0, 0x0C])
# Initiates the reading of the last performed self test. After sending this command the results can be downlinked
# via the housekeeping service by using the appropriate set ids listed above.
# Initiates the reading of the last performed self test. After sending this command the results
# can be downlinked via the housekeeping service by using the appropriate set ids listed above.
read_self_test_results = bytearray([0x0, 0x0, 0x0, 0x0D])
def pack_imtq_test_into(
object_id: bytearray, tc_queue: TcQueueT, op_code: str
) -> TcQueueT:
tc_queue.appendleft(
(
QueueCommands.PRINT,
"Testing ISIS IMTQ handler with object id: 0x" + object_id.hex(),
)
def pack_imtq_test_into(object_id: ObjectIdU32, q: DefaultPusQueueHelper, op_code: str):
q.add_log_cmd(
f"Testing ISIS IMTQ handler with object id: {object_id.as_hex_string}"
)
if op_code == "0" or op_code == "1":
tc_queue.appendleft((QueueCommands.PRINT, "IMTQ: Perform positive x self test"))
command = object_id + ImtqActionIds.perform_positive_x_test
command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "0":
q.add_log_cmd("IMTQ: Set mode off")
command = pack_mode_data(object_id.as_bytes, Modes.OFF, 0)
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=command))
if op_code == "1":
q.add_log_cmd("IMTQ: Set mode on")
command = pack_mode_data(object_id.as_bytes, Modes.ON, 0)
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=command))
if op_code == "2":
q.add_log_cmd("IMTQ: Mode Normal")
command = pack_mode_data(object_id.as_bytes, Modes.NORMAL, 0)
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=command))
if op_code == "3":
q.add_log_cmd("IMTQ: Perform positive x self test")
command = object_id.as_bytes + ImtqActionIds.perform_positive_x_test
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
tc_queue.appendleft(
(
QueueCommands.PRINT,
"IMTQ: Initiate reading of positive x self test results",
)
)
command = object_id + ImtqActionIds.read_self_test_results
command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
q.add_log_cmd("IMTQ: Initiate reading of positive x self test results")
command = object_id.as_bytes + ImtqActionIds.read_self_test_results
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
tc_queue.appendleft(
(
QueueCommands.PRINT,
"IMTQ: Request dataset with positive x self test results",
)
)
sid = make_sid(object_id, ImtqSetIds.POSITIVE_X_TEST)
command = generate_one_hk_command(sid, 24)
tc_queue.appendleft(command.pack_command_tuple())
q.add_log_cmd("IMTQ: Request dataset with positive x self test results")
sid = make_sid(object_id.as_bytes, ImtqSetIds.POSITIVE_X_TEST)
q.add_pus_tc(generate_one_hk_command(sid))
if op_code == "0" or op_code == "2":
tc_queue.appendleft((QueueCommands.PRINT, "IMTQ: Perform negative x self test"))
command = object_id + ImtqActionIds.perform_negative_x_test
command = PusTelecommand(service=8, subservice=128, ssc=25, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "4":
q.add_log_cmd("IMTQ: Perform negative x self test")
command = object_id.as_bytes + ImtqActionIds.perform_negative_x_test
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
q.add_log_cmd("IMTQ: Initiate reading of negative x self test results")
command = object_id.as_bytes + ImtqActionIds.read_self_test_results
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
q.add_log_cmd("IMTQ: Request dataset with negative x self test results")
sid = make_sid(object_id.as_bytes, ImtqSetIds.NEGATIVE_X_TEST)
q.add_pus_tc(generate_one_hk_command(sid))
tc_queue.appendleft(
(
QueueCommands.PRINT,
"IMTQ: Initiate reading of negative x self test results",
)
)
command = object_id + ImtqActionIds.read_self_test_results
command = PusTelecommand(service=8, subservice=128, ssc=26, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "5":
q.add_log_cmd("IMTQ: Perform positive y self test")
command = object_id.as_bytes + ImtqActionIds.perform_positive_y_test
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
q.add_log_cmd("IMTQ: Initiate reading of positive y self test results")
command = object_id.as_bytes + ImtqActionIds.read_self_test_results
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
tc_queue.appendleft(
(
QueueCommands.PRINT,
"IMTQ: Request dataset with negative x self test results",
)
)
sid = make_sid(object_id, ImtqSetIds.NEGATIVE_X_TEST)
command = generate_one_hk_command(sid, 27)
tc_queue.appendleft(command.pack_command_tuple())
q.add_log_cmd("IMTQ: Request dataset with positive y self test results")
sid = make_sid(object_id.as_bytes, ImtqSetIds.POSITIVE_Y_TEST)
q.add_pus_tc(generate_one_hk_command(sid))
if op_code == "0" or op_code == "3":
tc_queue.appendleft((QueueCommands.PRINT, "IMTQ: Perform positive y self test"))
command = object_id + ImtqActionIds.perform_positive_y_test
command = PusTelecommand(service=8, subservice=128, ssc=28, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "6":
q.add_log_cmd("IMTQ: Perform negative y self test")
command = object_id.as_bytes + ImtqActionIds.perform_negative_y_test
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
tc_queue.appendleft(
(
QueueCommands.PRINT,
"IMTQ: Initiate reading of positive y self test results",
)
)
command = object_id + ImtqActionIds.read_self_test_results
command = PusTelecommand(service=8, subservice=128, ssc=29, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
q.add_log_cmd("IMTQ: Initiate reading of negative y self test results")
command = object_id.as_bytes + ImtqActionIds.read_self_test_results
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
tc_queue.appendleft(
(
QueueCommands.PRINT,
"IMTQ: Request dataset with positive y self test results",
)
)
sid = make_sid(object_id, ImtqSetIds.POSITIVE_Y_TEST)
command = generate_one_hk_command(sid, 30)
tc_queue.appendleft(command.pack_command_tuple())
q.add_log_cmd("IMTQ: Request dataset with negative y self test results")
sid = make_sid(object_id.as_bytes, ImtqSetIds.NEGATIVE_Y_TEST)
q.add_pus_tc(generate_one_hk_command(sid))
if op_code == "0" or op_code == "4":
tc_queue.appendleft((QueueCommands.PRINT, "IMTQ: Perform negative y self test"))
command = object_id + ImtqActionIds.perform_negative_y_test
command = PusTelecommand(service=8, subservice=128, ssc=31, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "7":
q.add_log_cmd("IMTQ: Perform positive z self test")
command = object_id.as_bytes + ImtqActionIds.perform_positive_z_test
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
tc_queue.appendleft(
(
QueueCommands.PRINT,
"IMTQ: Initiate reading of negative y self test results",
)
)
command = object_id + ImtqActionIds.read_self_test_results
command = PusTelecommand(service=8, subservice=128, ssc=32, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
q.add_log_cmd("IMTQ: Initiate reading of positive z self test results")
command = object_id.as_bytes + ImtqActionIds.read_self_test_results
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
tc_queue.appendleft(
(
QueueCommands.PRINT,
"IMTQ: Request dataset with negative y self test results",
)
)
sid = make_sid(object_id, ImtqSetIds.NEGATIVE_Y_TEST)
command = generate_one_hk_command(sid, 33)
tc_queue.appendleft(command.pack_command_tuple())
q.add_log_cmd("IMTQ: Request dataset with positive z self test results")
sid = make_sid(object_id.as_bytes, ImtqSetIds.POSITIVE_Y_TEST)
q.add_pus_tc(generate_one_hk_command(sid))
if op_code == "0" or op_code == "5":
tc_queue.appendleft((QueueCommands.PRINT, "IMTQ: Perform positive z self test"))
command = object_id + ImtqActionIds.perform_positive_z_test
command = PusTelecommand(service=8, subservice=128, ssc=34, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "8":
q.add_log_cmd("IMTQ: Perform negative z self test")
command = object_id.as_bytes + ImtqActionIds.perform_negative_z_test
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
q.add_log_cmd("IMTQ: Initiate reading of negative z self test results")
command = object_id.as_bytes + ImtqActionIds.read_self_test_results
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
q.add_log_cmd("IMTQ: Request dataset with negative z self test results")
sid = make_sid(object_id.as_bytes, ImtqSetIds.NEGATIVE_Z_TEST)
q.add_pus_tc(generate_one_hk_command(sid))
tc_queue.appendleft(
(
QueueCommands.PRINT,
"IMTQ: Initiate reading of positive z self test results",
)
)
command = object_id + ImtqActionIds.read_self_test_results
command = PusTelecommand(service=8, subservice=128, ssc=35, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
tc_queue.appendleft(
(
QueueCommands.PRINT,
"IMTQ: Request dataset with positive z self test results",
)
)
sid = make_sid(object_id, ImtqSetIds.POSITIVE_Y_TEST)
command = generate_one_hk_command(sid, 36)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "0" or op_code == "6":
tc_queue.appendleft((QueueCommands.PRINT, "IMTQ: Perform negative z self test"))
command = object_id + ImtqActionIds.perform_negative_z_test
command = PusTelecommand(service=8, subservice=128, ssc=35, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
tc_queue.appendleft(
(
QueueCommands.PRINT,
"IMTQ: Initiate reading of negative z self test results",
)
)
command = object_id + ImtqActionIds.read_self_test_results
command = PusTelecommand(service=8, subservice=128, ssc=36, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
tc_queue.appendleft(
(
QueueCommands.PRINT,
"IMTQ: Request dataset with negative z self test results",
)
)
sid = make_sid(object_id, ImtqSetIds.NEGATIVE_Z_TEST)
command = generate_one_hk_command(sid, 37)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "0" or op_code == "7":
tc_queue.appendleft((QueueCommands.PRINT, "IMTQ: Commanding dipole"))
if op_code == "9":
q.add_log_cmd("IMTQ: Commanding dipole")
x_dipole = 0
y_dipole = 0
z_dipole = 0
duration = 0 # ms
command = pack_dipole_command(object_id, x_dipole, y_dipole, z_dipole, duration)
command = PusTelecommand(service=8, subservice=128, ssc=20, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
q.add_pus_tc(
pack_dipole_command(
object_id.as_bytes, x_dipole, y_dipole, z_dipole, duration
)
)
if op_code == "0" or op_code == "8":
tc_queue.appendleft((QueueCommands.PRINT, "IMTQ: Get commanded dipole"))
command = object_id + ImtqActionIds.get_commanded_dipole
command = PusTelecommand(service=8, subservice=128, ssc=21, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "10":
q.add_log_cmd("IMTQ: Get commanded dipole")
command = object_id.as_bytes + ImtqActionIds.get_commanded_dipole
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
return tc_queue
if op_code == "11":
q.add_log_cmd("IMTQ: Get engineering hk set")
q.add_pus_tc(
generate_one_diag_command(
sid=make_sid(object_id=object_id.as_bytes, set_id=ImtqSetIds.ENG_HK_SET)
)
)
if op_code == "12":
q.add_log_cmd("IMTQ: Get calibrated MTM hk set")
q.add_pus_tc(
generate_one_diag_command(
sid=make_sid(
object_id=object_id.as_bytes, set_id=ImtqSetIds.CAL_MTM_SET
)
)
)
if op_code == "13":
q.add_log_cmd("IMTQ: Get raw MTM hk set")
q.add_pus_tc(
generate_one_diag_command(
sid=make_sid(
object_id=object_id.as_bytes, set_id=ImtqSetIds.RAW_MTM_SET
)
)
)
def pack_dipole_command(
object_id: bytearray, x_dipole: int, y_dipole: int, z_dipole: int, duration: int
) -> bytearray:
object_id: bytes, x_dipole: int, y_dipole: int, z_dipole: int, duration: int
) -> PusTelecommand:
"""This function packs the command causing the ISIS IMTQ to generate a dipole.
@param object_id The object id of the IMTQ handler.
@param x_dipole The dipole of the x coil in 10^-4*Am^2 (max. 2000)
@ -236,10 +193,10 @@ def pack_dipole_command(
command is sent.
"""
action_id = ImtqActionIds.start_actuation_dipole
command = bytearray()
command = object_id + action_id
command.extend(x_dipole.to_bytes(length=2, byteorder="big"))
command.extend(y_dipole.to_bytes(length=2, byteorder="big"))
command.extend(z_dipole.to_bytes(length=2, byteorder="big"))
command.extend(duration.to_bytes(length=2, byteorder="big"))
command += struct.pack("!h", x_dipole)
command += struct.pack("!h", y_dipole)
command += struct.pack("!h", z_dipole)
command += struct.pack("!h", duration)
command = PusTelecommand(service=8, subservice=128, app_data=command)
return command

9
pus_tc/devs/mgms.py Normal file
View File

@ -0,0 +1,9 @@
import enum
class MgmLis3SetIds(enum.IntEnum):
CORE_HK = 0
class MgmRm3100SetIds(enum.IntEnum):
CORE_HK = 0

View File

@ -5,18 +5,25 @@
@author J. Meier
@date 13.12.2020
"""
from tmtccmd.config.definitions import QueueCommands
from tmtccmd.tc.packer import TcQueueT
from tmtccmd.tc.service_3_housekeeping import (
generate_one_hk_command,
make_sid,
generate_one_diag_command,
from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.tc.pus_3_fsfw_hk import generate_one_hk_command, make_sid
from gomspace.gomspace_common import (
GsInfo,
GomspaceOpCodes,
TableEntry,
Channel,
pack_set_param_command,
TableIds,
pack_get_param_command,
pack_gnd_wdt_reset_command,
pack_ping_command,
GomspaceDeviceActionIds,
pack_reboot_command,
SetIds,
)
from gomspace.gomspace_common import *
from config.object_ids import P60_DOCK_HANDLER
HK_SET_ID = 0x3
from tmtccmd.tc.pus_8_funccmd import generate_action_command
from tmtccmd.util import ObjectIdU32
class P60OpCodes:
@ -27,7 +34,7 @@ class P60OpCodes:
TEST = ["test", "0"]
class Info:
class P60Info:
PREFIX = "P60 Dock"
STACK_3V3_ON = f"{PREFIX}: Turn Stack 3V3 on"
STACK_3V3_OFF = f"{PREFIX}: Turn Stack 3V3 off"
@ -90,239 +97,193 @@ class P60DockHkTable:
wdt_gnd_left = TableEntry(bytearray([0x00, 0xA8]), TableEntry.uint32_size)
def pack_p60dock_cmds(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
def pack_p60dock_cmds(object_id: ObjectIdU32, q: DefaultPusQueueHelper, op_code: str):
objb = object_id.as_bytes
if op_code in P60OpCodes.STACK_3V3_ON:
tc_queue.appendleft((QueueCommands.PRINT, Info.STACK_3V3_ON))
command = pack_set_param_command(
object_id,
q.add_log_cmd(P60Info.STACK_3V3_ON)
q.add_pus_tc(
pack_set_param_command(
objb,
P60DockConfigTable.out_en_9.parameter_address,
P60DockConfigTable.out_en_9.parameter_size,
Channel.on,
)
tc_queue.appendleft(command.pack_command_tuple())
)
if op_code in P60OpCodes.STACK_3V3_OFF:
tc_queue.appendleft((QueueCommands.PRINT, Info.STACK_3V3_OFF))
command = pack_set_param_command(
object_id,
q.add_log_cmd(P60Info.STACK_3V3_OFF)
q.add_pus_tc(
pack_set_param_command(
objb,
P60DockConfigTable.out_en_9.parameter_address,
P60DockConfigTable.out_en_9.parameter_size,
Channel.off,
)
tc_queue.appendleft(command.pack_command_tuple())
)
if op_code in P60OpCodes.STACK_5V_ON:
tc_queue.appendleft((QueueCommands.PRINT, Info.STACK_5V_ON))
command = pack_set_param_command(
object_id,
q.add_log_cmd(P60Info.STACK_5V_ON)
q.add_pus_tc(
pack_set_param_command(
objb,
P60DockConfigTable.out_en_10.parameter_address,
P60DockConfigTable.out_en_10.parameter_size,
Channel.on,
)
tc_queue.appendleft(command.pack_command_tuple())
)
if op_code in P60OpCodes.STACK_5V_OFF:
tc_queue.appendleft((QueueCommands.PRINT, Info.STACK_5V_OFF))
command = pack_set_param_command(
object_id,
q.add_log_cmd(P60Info.STACK_5V_OFF)
q.add_pus_tc(
pack_set_param_command(
objb,
P60DockConfigTable.out_en_10.parameter_address,
P60DockConfigTable.out_en_10.parameter_size,
Channel.off,
)
tc_queue.appendleft(command.pack_command_tuple())
)
if op_code in GomspaceOpCodes.REQUEST_CORE_HK_ONCE:
tc_queue.appendleft(
(QueueCommands.PRINT, "P60 Dock: Requesting HK Core HK Once")
)
q.add_log_cmd("P60 Dock: Requesting HK Core HK Once")
hk_sid = make_sid(object_id=P60_DOCK_HANDLER, set_id=SetIds.P60_CORE)
command = generate_one_hk_command(sid=hk_sid, ssc=0)
tc_queue.appendleft(command.pack_command_tuple())
q.add_pus_tc(generate_one_hk_command(sid=hk_sid))
if op_code in GomspaceOpCodes.REQUEST_AUX_HK_ONCE:
tc_queue.appendleft(
(QueueCommands.PRINT, "P60 Dock: Requesting HK Aux HK Once")
)
q.add_log_cmd("P60 Dock: Requesting HK Aux HK Once")
hk_sid = make_sid(object_id=P60_DOCK_HANDLER, set_id=SetIds.P60_AUX)
command = generate_one_hk_command(sid=hk_sid, ssc=0)
tc_queue.appendleft(command.pack_command_tuple())
q.add_pus_tc(generate_one_hk_command(sid=hk_sid))
if op_code in GomspaceOpCodes.PRINT_SWITCH_V_I:
tc_queue.appendleft(
(QueueCommands.PRINT, "P60 Dock: Print Switches, Voltages, Currents")
q.add_log_cmd("P60 Dock: Print Switches, Voltages, Currents")
q.add_pus_tc(
generate_action_command(
object_id=objb, action_id=GomspaceDeviceActionIds.PRINT_SWITCH_V_I
)
command = generate_action_command(
object_id=object_id, action_id=GomspaceDeviceActionIds.PRINT_SWITCH_V_I
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code in GomspaceOpCodes.PRINT_LATCHUPS:
tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Print Latchups"))
command = generate_action_command(
object_id=object_id, action_id=GomspaceDeviceActionIds.PRINT_LATCHUPS
q.add_log_cmd("P60 Dock: Print Latchups")
q.add_pus_tc(
generate_action_command(
object_id=objb, action_id=GomspaceDeviceActionIds.PRINT_LATCHUPS
)
)
tc_queue.appendleft(command.pack_command_tuple())
if P60DockTestProcedure.all or P60DockTestProcedure.reboot:
tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Reboot"))
command = pack_reboot_command(object_id)
# command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
q.add_log_cmd("P60 Dock: Reboot")
q.add_pus_tc(pack_reboot_command(object_id))
if P60DockTestProcedure.all or P60DockTestProcedure.read_gnd_wdt:
tc_queue.appendleft(
(QueueCommands.PRINT, "P60 Dock: Reading ground watchdog timer value")
)
command = pack_get_param_command(
object_id,
q.add_log_cmd("P60 Dock: Reading ground watchdog timer value")
q.add_pus_tc(
pack_get_param_command(
objb,
TableIds.hk,
P60DockHkTable.wdt_gnd_left.parameter_address,
P60DockHkTable.wdt_gnd_left.parameter_size,
)
# command = PusTelecommand(service=8, subservice=128, ssc=20, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
)
if P60DockTestProcedure.all or P60DockTestProcedure.gnd_wdt_reset:
tc_queue.appendleft(
(QueueCommands.PRINT, "P60 Dock: Testing ground watchdog reset")
)
command = pack_gnd_wdt_reset_command(object_id)
# command = PusTelecommand(service=8, subservice=128, ssc=21, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
q.add_log_cmd("P60 Dock: Testing ground watchdog reset")
q.add_pus_tc(pack_gnd_wdt_reset_command(object_id))
if P60DockTestProcedure.all or P60DockTestProcedure.ping:
tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Ping"))
q.add_log_cmd("P60 Dock: Ping")
ping_data = bytearray([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
command = pack_ping_command(object_id, ping_data)
# command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
q.add_pus_tc(pack_ping_command(object_id, ping_data))
if P60DockTestProcedure.all or P60DockTestProcedure.channel_3_off:
tc_queue.appendleft(
(QueueCommands.PRINT, "P60 Dock: Testing setting output channel 3 off")
)
q.add_log_cmd("P60 Dock: Testing setting output channel 3 off")
parameter = 0 # set channel off
command = pack_set_param_command(
object_id,
q.add_pus_tc(
pack_set_param_command(
objb,
P60DockConfigTable.out_en_3.parameter_address,
P60DockConfigTable.out_en_3.parameter_size,
parameter,
)
# command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if P60DockTestProcedure.all or P60DockTestProcedure.read_temperature1:
tc_queue.appendleft(
(QueueCommands.PRINT, "P60 Dock: Testing temperature reading")
)
command = pack_get_param_command(
object_id,
if P60DockTestProcedure.all or P60DockTestProcedure.read_temperature1:
q.add_log_cmd("P60 Dock: Testing temperature reading")
q.add_pus_tc(
pack_get_param_command(
objb,
TableIds.hk,
P60DockHkTable.temperature1.parameter_address,
P60DockHkTable.temperature1.parameter_size,
)
# command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if P60DockTestProcedure.all or P60DockTestProcedure.channel_3_on:
tc_queue.appendleft(
(QueueCommands.PRINT, "P60 Dock: Testing Output Channel 3 state (PDU2)")
)
command = pack_get_param_command(
object_id,
if P60DockTestProcedure.all or P60DockTestProcedure.channel_3_on:
q.add_log_cmd("P60 Dock: Testing Output Channel 3 state (PDU2)")
q.add_pus_tc(
pack_get_param_command(
objb,
TableIds.config,
P60DockConfigTable.out_en_3.parameter_address,
P60DockConfigTable.out_en_3.parameter_size,
)
# command = PusTelecommand(service=8, subservice=128, ssc=25, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
)
if P60DockTestProcedure.all or P60DockTestProcedure.read_cur_lu_lim_0:
tc_queue.appendleft(
(
QueueCommands.PRINT,
"P60 Dock: Reading current limit value of output channel 0",
)
)
command = pack_get_param_command(
object_id,
q.add_log_cmd("P60 Dock: Reading current limit value of output channel 0")
q.add_pus_tc(
pack_get_param_command(
objb,
TableIds.config,
P60DockConfigTable.cur_lu_lim_0.parameter_address,
P60DockConfigTable.cur_lu_lim_0.parameter_size,
)
# command = PusTelecommand(service=8, subservice=128, ssc=26, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if P60DockTestProcedure.all or P60DockTestProcedure.channel_3_on:
tc_queue.appendleft(
(QueueCommands.PRINT, "P60 Dock: Testing setting output channel 3 on")
)
if P60DockTestProcedure.all or P60DockTestProcedure.channel_3_on:
q.add_log_cmd("P60 Dock: Testing setting output channel 3 on")
parameter = 1 # set channel on
command = pack_set_param_command(
object_id,
q.add_pus_tc(
pack_set_param_command(
objb,
P60DockConfigTable.out_en_3.parameter_address,
P60DockConfigTable.out_en_3.parameter_size,
parameter,
)
# command = PusTelecommand(service=8, subservice=128, ssc=27, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if P60DockTestProcedure.all or P60DockTestProcedure.invalid_table_id_test:
tc_queue.appendleft(
(QueueCommands.PRINT, "P60 Dock: Testing invalid table id handling")
)
if P60DockTestProcedure.all or P60DockTestProcedure.invalid_table_id_test:
q.add_log_cmd("P60 Dock: Testing invalid table id handling")
table_id_invalid = 5
command = pack_get_param_command(
object_id,
q.add_pus_tc(
pack_get_param_command(
objb,
table_id_invalid,
P60DockHkTable.temperature1.parameter_address,
P60DockHkTable.temperature1.parameter_size,
)
# command = PusTelecommand(service=8, subservice=128, ssc=28, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
)
if P60DockTestProcedure.all or P60DockTestProcedure.invalid_address_test:
tc_queue.appendleft(
(
QueueCommands.PRINT,
"P60 Dock: Testing invalid address handling in get param command",
)
)
q.add_log_cmd("P60 Dock: Testing invalid address handling in get param command")
invalid_address = bytearray([0x01, 0xF4])
command = pack_get_param_command(
object_id,
q.add_pus_tc(
pack_get_param_command(
objb,
TableIds.hk,
invalid_address,
P60DockHkTable.temperature1.parameter_size,
)
# command = PusTelecommand(service=8, subservice=128, ssc=29, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
tc_queue.appendleft(
(
QueueCommands.PRINT,
"P60 Dock: Testing invalid address handling in set param command",
)
)
q.add_log_cmd("P60 Dock: Testing invalid address handling in set param command")
invalid_address = bytearray([0x01, 0xF4])
parameter_size = 2
parameter = 1
command = pack_set_param_command(
object_id, invalid_address, parameter_size, parameter
q.add_pus_tc(
pack_set_param_command(objb, invalid_address, parameter_size, parameter)
)
# command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if P60DockTestProcedure.all or P60DockTestProcedure.invalid_parameter_size_test:
tc_queue.appendleft(
(
QueueCommands.PRINT,
"P60 Dock: Testing handling of invalid parameter sizes in get-param command",
)
q.add_log_cmd(
"P60 Dock: Testing handling of invalid parameter sizes in get-param command"
)
invalid_size = 5
command = pack_get_param_command(
object_id,
q.add_pus_tc(
pack_get_param_command(
objb,
TableIds.hk,
P60DockHkTable.temperature1.parameter_address,
invalid_size,
)
# command = PusTelecommand(service=8, subservice=128, ssc=31, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
tc_queue.appendleft(
(
QueueCommands.PRINT,
"P60 Dock: Testing handling of invalid parameter size in set-param command",
)
q.add_log_cmd(
"P60 Dock: Testing handling of invalid parameter size in set-param command"
)
parameter = 1
command = pack_set_param_command(
object_id,
q.add_pus_tc(
pack_set_param_command(
objb,
P60DockConfigTable.out_en_3.parameter_address,
invalid_size,
parameter,
)
# command = PusTelecommand(service=8, subservice=128, ssc=32, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
return tc_queue
)

View File

@ -5,9 +5,8 @@
@author J. Meier
@date 22.11.2021
"""
from tmtccmd.config.definitions import QueueCommands
from tmtccmd.tc.packer import TcQueueT
from spacepackets.ecss.tc import PusTelecommand
from tmtccmd.tc import DefaultPusQueueHelper
class CommandIds:
@ -17,24 +16,15 @@ class CommandIds:
PRINT_PDEC_MON = bytearray([0x0, 0x0, 0x0, 0x1])
def pack_pdec_handler_test(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
tc_queue.appendleft(
(
QueueCommands.PRINT,
"Testing PDEC handler with object id: 0x" + object_id.hex(),
)
)
def pack_pdec_handler_test(
object_id: bytearray, q: DefaultPusQueueHelper, op_code: str
):
q.add_log_cmd(f"Testing PDEC handler with object id: {object_id.hex()}")
if op_code == "0":
tc_queue.appendleft((QueueCommands.PRINT, "PDEC Handler: Print CLCW"))
q.add_log_cmd("PDEC Handler: Print CLCW")
command = object_id + CommandIds.PRINT_CLCW
command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "1":
tc_queue.appendleft(
(QueueCommands.PRINT, "PDEC Handler: Print PDEC monitor register")
)
q.add_log_cmd("PDEC Handler: Print PDEC monitor register")
command = object_id + CommandIds.PRINT_PDEC_MON
command = PusTelecommand(service=8, subservice=128, ssc=31, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))

View File

@ -1,11 +1,13 @@
# -*- coding: utf-8 -*-
"""PDU2 is mounted on the X2 slot of the P60 dock
"""PDU1 is mounted on the X2 slot of the P60 dock
@author J. Meier
@date 17.12.2020
"""
from tmtccmd.config.definitions import QueueCommands
from tmtccmd.tc.packer import TcQueueT
from tmtccmd.tc.service_3_housekeeping import (
import gomspace.gomspace_common as gs
from pus_tc.devs.common_power import pdu1_cmds, pdu1_req_hk_cmds
from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.tc.pus_3_fsfw_hk import (
generate_one_hk_command,
make_sid,
generate_one_diag_command,
@ -15,28 +17,6 @@ from gomspace.gomspace_pdu_definitions import *
from config.object_ids import PDU_1_HANDLER_ID
class Pdu1OpCodes(enum.Enum):
TCS_BOARD_ON = "0"
TCS_BOARD_OFF = "1"
STAR_TRACKER_ON = "2"
STAR_TRACKER_OFF = "3"
SUS_NOMINAL_ON = "4"
SUS_NOMINAL_OFF = "5"
ACS_A_SIDE_ON = "6"
ACS_A_SIDE_OFF = "7"
SYRLINKS_ON = "8"
SYRLINKS_OFF = "9"
MGT_ON = "10"
MGT_OFF = "11"
# Solar Cell Experiment
SCEX_ON = "12"
SCEX_OFF = "13"
PLOC_ON = "14"
PLOC_OFF = "15"
TESTS = "32"
class PDU1TestProcedure:
"""
@brief Use this class to define the tests to perform for the PDU2.
@ -54,241 +34,87 @@ class PDU1TestProcedure:
turn_channel_3_off = False
def pack_pdu1_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
tc_queue.appendleft((QueueCommands.PRINT, "Commanding PDU1"))
if op_code == Pdu1OpCodes.TCS_BOARD_ON.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn TCS board on"))
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_0.parameter_address,
PDUConfigTable.out_en_0.parameter_size,
Channel.on,
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == Pdu1OpCodes.TCS_BOARD_OFF.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn TCS board off"))
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_0.parameter_address,
PDUConfigTable.out_en_0.parameter_size,
Channel.off,
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == Pdu1OpCodes.STAR_TRACKER_ON.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn star tracker on"))
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_2.parameter_address,
PDUConfigTable.out_en_2.parameter_size,
Channel.on,
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == Pdu1OpCodes.STAR_TRACKER_OFF.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn star tracker off"))
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_2.parameter_address,
PDUConfigTable.out_en_2.parameter_size,
Channel.off,
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == Pdu1OpCodes.SUS_NOMINAL_ON.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn SUS nominal on"))
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_4.parameter_address,
PDUConfigTable.out_en_4.parameter_size,
Channel.on,
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == Pdu1OpCodes.SUS_NOMINAL_OFF.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn SUS nominal off"))
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_4.parameter_address,
PDUConfigTable.out_en_4.parameter_size,
Channel.off,
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == Pdu1OpCodes.ACS_A_SIDE_ON.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn ACS Side A on"))
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_7.parameter_address,
PDUConfigTable.out_en_7.parameter_size,
Channel.on,
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == Pdu1OpCodes.ACS_A_SIDE_OFF.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn ACS Side A off"))
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_7.parameter_address,
PDUConfigTable.out_en_7.parameter_size,
Channel.off,
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == Pdu1OpCodes.SUS_NOMINAL_OFF.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn SUS nominal off"))
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_4.parameter_address,
PDUConfigTable.out_en_4.parameter_size,
Channel.off,
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == Pdu1OpCodes.SCEX_ON.value:
tc_queue.appendleft(
(QueueCommands.PRINT, "PDU1: Turn Solar Cell Experiment on")
)
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_5.parameter_address,
PDUConfigTable.out_en_5.parameter_size,
Channel.on,
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == Pdu1OpCodes.SCEX_OFF.value:
tc_queue.appendleft(
(QueueCommands.PRINT, "PDU1: Turn Solar Cell Experiment off")
)
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_5.parameter_address,
PDUConfigTable.out_en_5.parameter_size,
Channel.off,
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == Pdu1OpCodes.SYRLINKS_ON.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn Syrlinks on"))
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_1.parameter_address,
PDUConfigTable.out_en_1.parameter_size,
Channel.on,
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == Pdu1OpCodes.SYRLINKS_OFF.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn Syrlinks off"))
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_1.parameter_address,
PDUConfigTable.out_en_1.parameter_size,
Channel.off,
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == Pdu1OpCodes.MGT_ON.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn MGT on"))
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_3.parameter_address,
PDUConfigTable.out_en_3.parameter_size,
Channel.on,
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == Pdu1OpCodes.MGT_OFF.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn MGT off"))
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_3.parameter_address,
PDUConfigTable.out_en_3.parameter_size,
Channel.off,
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == Pdu1OpCodes.PLOC_ON.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn PLOC on"))
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_6.parameter_address,
PDUConfigTable.out_en_6.parameter_size,
Channel.on,
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == Pdu1OpCodes.PLOC_OFF.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn PLOC off"))
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_6.parameter_address,
PDUConfigTable.out_en_6.parameter_size,
Channel.off,
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code in GomspaceOpCodes.REQUEST_CORE_HK_ONCE:
tc_queue.appendleft((QueueCommands.PRINT, f"PDU1: {Info.REQUEST_CORE_HK_ONCE}"))
hk_sid = make_sid(object_id=PDU_1_HANDLER_ID, set_id=SetIds.PDU_1_CORE)
command = generate_one_diag_command(sid=hk_sid, ssc=0)
tc_queue.appendleft(command.pack_command_tuple())
if op_code in GomspaceOpCodes.REQUEST_AUX_HK_ONCE:
tc_queue.appendleft((QueueCommands.PRINT, f"PDU1: {Info.REQUEST_AUX_HK_ONCE}"))
hk_sid = make_sid(object_id=PDU_1_HANDLER_ID, set_id=SetIds.PDU_1_AUX)
command = generate_one_hk_command(sid=hk_sid, ssc=0)
tc_queue.appendleft(command.pack_command_tuple())
def pack_pdu1_commands(object_id: ObjectIdU32, q: DefaultPusQueueHelper, op_code: str):
q.add_log_cmd("Commanding PDU1")
objb = object_id.as_bytes
pdu1_cmds(q, op_code)
pdu1_req_hk_cmds(q, op_code)
if op_code in GomspaceOpCodes.PRINT_SWITCH_V_I:
tc_queue.appendleft(
(QueueCommands.PRINT, "PDU1: Print Switches, Voltages, Currents")
q.add_log_cmd("PDU1: Print Switches, Voltages, Currents")
q.add_pus_tc(
generate_action_command(
object_id=objb, action_id=GomspaceDeviceActionIds.PRINT_SWITCH_V_I
)
command = generate_action_command(
object_id=object_id, action_id=GomspaceDeviceActionIds.PRINT_SWITCH_V_I
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code in GomspaceOpCodes.PRINT_LATCHUPS:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Print Latchups"))
command = generate_action_command(
object_id=object_id, action_id=GomspaceDeviceActionIds.PRINT_LATCHUPS
q.add_log_cmd("PDU1: Print Latchups")
q.add_pus_tc(
generate_action_command(
object_id=objb, action_id=GomspaceDeviceActionIds.PRINT_LATCHUPS
)
)
tc_queue.appendleft(command.pack_command_tuple())
if PDU1TestProcedure.all or PDU1TestProcedure.ping:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Ping Test"))
q.add_log_cmd("PDU1: Ping Test")
ping_data = bytearray([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
command = pack_ping_command(object_id, ping_data)
tc_queue.appendleft(command.pack_command_tuple())
q.add_pus_tc(pack_ping_command(object_id, ping_data))
if PDU1TestProcedure.all or PDU1TestProcedure.read_temperature:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Testing temperature reading"))
command = pack_get_param_command(
object_id,
q.add_log_cmd("PDU1: Testing temperature reading")
q.add_pus_tc(
pack_get_param_command(
objb,
TableIds.hk,
PDUHkTable.temperature.parameter_address,
PDUHkTable.temperature.parameter_size,
PduHkTable.temperature.parameter_address,
PduHkTable.temperature.parameter_size,
)
)
tc_queue.appendleft(command.pack_command_tuple())
if PDU1TestProcedure.all or PDU1TestProcedure.turn_channel_2_on:
tc_queue.appendleft(
(QueueCommands.PRINT, "PDU1: Turn channel 2 on (Star Tracker)")
)
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_2.parameter_address,
PDUConfigTable.out_en_2.parameter_size,
q.add_log_cmd("PDU1: Turn channel 2 on (Star Tracker)")
q.add_pus_tc(
pack_set_param_command(
objb,
PduConfigTable.out_en_2.parameter_address,
PduConfigTable.out_en_2.parameter_size,
Channel.on,
)
tc_queue.appendleft(command.pack_command_tuple())
)
if PDU1TestProcedure.all or PDU1TestProcedure.turn_channel_2_off:
tc_queue.appendleft(
(QueueCommands.PRINT, "PDU1: Turn channel 2 off (Star Tracker)")
)
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_2.parameter_address,
PDUConfigTable.out_en_2.parameter_size,
q.add_log_cmd("PDU1: Turn channel 2 off (Star Tracker)")
q.add_pus_tc(
pack_set_param_command(
objb,
PduConfigTable.out_en_2.parameter_address,
PduConfigTable.out_en_2.parameter_size,
Channel.off,
)
tc_queue.appendleft(command.pack_command_tuple())
)
if PDU1TestProcedure.all or PDU1TestProcedure.turn_channel_3_on:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn channel 3 on (MTQ)"))
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_3.parameter_address,
PDUConfigTable.out_en_3.parameter_size,
q.add_log_cmd("PDU1: Turn channel 3 on (MTQ)")
q.add_pus_tc(
pack_set_param_command(
objb,
PduConfigTable.out_en_3.parameter_address,
PduConfigTable.out_en_3.parameter_size,
Channel.on,
)
tc_queue.appendleft(command.pack_command_tuple())
)
if PDU1TestProcedure.all or PDU1TestProcedure.turn_channel_3_off:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn channel 3 off (MTQ)"))
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_3.parameter_address,
PDUConfigTable.out_en_3.parameter_size,
q.add_log_cmd("PDU1: Turn channel 3 off (MTQ)")
q.add_pus_tc(
pack_set_param_command(
objb,
PduConfigTable.out_en_3.parameter_address,
PduConfigTable.out_en_3.parameter_size,
Channel.off,
)
tc_queue.appendleft(command.pack_command_tuple())
)
if op_code in GomspaceOpCodes.SET_PARAM:
q.add_log_cmd(f"PDU1: {GsInfo.SET_PARAMETER}")
memory_address = int(input("Specify memory address: 0x"), 16)
memory_address = struct.pack("!H", memory_address)
parameter_size = int(input("Specify parameter size: "))
parameter = int(input("Specify parameter: "))
q.add_pus_tc(
gs.pack_set_param_command(
object_id.as_bytes, memory_address, parameter_size, parameter
)
)

View File

@ -6,39 +6,18 @@
@author J. Meier
@date 17.12.2020
"""
from tmtccmd.config.definitions import QueueCommands
from tmtccmd.tc.packer import TcQueueT
from tmtccmd.tc.service_3_housekeeping import (
from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.tc.pus_3_fsfw_hk import (
generate_one_hk_command,
generate_one_diag_command,
make_sid,
)
from pus_tc.devs.common_power import pdu2_cmds, pdu2_req_hk_cmds
from gomspace.gomspace_common import *
from gomspace.gomspace_pdu_definitions import *
from config.object_ids import PDU_2_HANDLER_ID
class Pdu2OpCodes(enum.Enum):
ACS_SIDE_B_ON = "1"
ACS_SIDE_B_OFF = "2"
SUS_REDUNDANT_ON = "3"
SUS_REDUNDANT_OFF = "4"
RW_ON = "5"
RW_OFF = "6"
PL_PCDU_VBAT_NOM_ON = "7"
PL_PCDU_VBAT_NOM_OFF = "8"
PL_PCDU_VBAT_RED_ON = "9"
PL_PCDU_VBAT_RED_OFF = "10"
TCS_HEATER_IN_ON = "11"
TCS_HEATER_IN_OFF = "12"
SOLAR_ARRAY_DEPL_ON = "13"
SOLAR_ARRAY_DEPL_OFF = "14"
PL_CAMERA_ON = "15"
PL_CAMERA_OFF = "16"
# There is not really a point of the on command, the SW can not be commanded if the OBC is off
Q7S_OFF = "32"
class PDU2TestProcedure:
"""
@brief Use this class to define the tests to perform for the PDU2.
@ -66,288 +45,95 @@ class PDU2TestProcedure:
request_hk_table = False
def pack_pdu2_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
tc_queue.appendleft((QueueCommands.PRINT, "Testing PDU2"))
if op_code == Pdu2OpCodes.ACS_SIDE_B_ON.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn ACS Side B on"))
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_7.parameter_address,
PDUConfigTable.out_en_7.parameter_size,
Channel.on,
)
tc_queue.appendleft(command.pack_command_tuple())
return tc_queue
if op_code == Pdu2OpCodes.ACS_SIDE_B_OFF.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn ACS Side B off"))
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_7.parameter_address,
PDUConfigTable.out_en_7.parameter_size,
Channel.off,
)
tc_queue.appendleft(command.pack_command_tuple())
return tc_queue
if op_code == Pdu2OpCodes.Q7S_OFF.value:
tc_queue.appendleft((QueueCommands.PRINT, "Turning off Q7S OBC"))
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_0.parameter_address,
PDUConfigTable.out_en_0.parameter_size,
Channel.off,
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == Pdu2OpCodes.SUS_REDUNDANT_ON.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn SUS redundant on"))
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_4.parameter_address,
PDUConfigTable.out_en_4.parameter_size,
Channel.on,
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == Pdu2OpCodes.SUS_REDUNDANT_OFF.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn SUS redundant off"))
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_4.parameter_address,
PDUConfigTable.out_en_4.parameter_size,
Channel.off,
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == Pdu2OpCodes.RW_ON.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn reaction wheels on"))
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_2.parameter_address,
PDUConfigTable.out_en_2.parameter_size,
Channel.on,
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == Pdu2OpCodes.RW_OFF.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn reaction wheels off"))
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_2.parameter_address,
PDUConfigTable.out_en_2.parameter_size,
Channel.off,
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == Pdu2OpCodes.PL_PCDU_VBAT_NOM_ON.value:
tc_queue.appendleft(
(QueueCommands.PRINT, "PDU2: Turn PDU2 PL PCDU Channel 1 on")
)
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_1.parameter_address,
PDUConfigTable.out_en_1.parameter_size,
Channel.on,
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == Pdu2OpCodes.PL_PCDU_VBAT_NOM_OFF.value:
tc_queue.appendleft(
(QueueCommands.PRINT, "PDU2: Turn PDU2 PL PCDU Channel 1 off")
)
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_1.parameter_address,
PDUConfigTable.out_en_1.parameter_size,
Channel.off,
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == Pdu2OpCodes.PL_PCDU_VBAT_RED_ON.value:
tc_queue.appendleft(
(QueueCommands.PRINT, "PDU2: Turn PDU2 PL PCDU Channel 6 on")
)
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_6.parameter_address,
PDUConfigTable.out_en_6.parameter_size,
Channel.off,
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == Pdu2OpCodes.PL_PCDU_VBAT_RED_OFF.value:
tc_queue.appendleft(
(QueueCommands.PRINT, "PDU2: Turn PDU2 PL PCDU Channel 6 off")
)
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_6.parameter_address,
PDUConfigTable.out_en_6.parameter_size,
Channel.off,
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == Pdu2OpCodes.TCS_HEATER_IN_ON.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn TCS Heater Input on"))
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_3.parameter_address,
PDUConfigTable.out_en_3.parameter_size,
Channel.on,
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == Pdu2OpCodes.TCS_HEATER_IN_OFF.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn TCS Heater Input off"))
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_3.parameter_address,
PDUConfigTable.out_en_3.parameter_size,
Channel.off,
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == Pdu2OpCodes.SOLAR_ARRAY_DEPL_ON.value:
tc_queue.appendleft(
(QueueCommands.PRINT, "PDU2: Turn Solar Array Deployment On")
)
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_5.parameter_address,
PDUConfigTable.out_en_5.parameter_size,
Channel.on,
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == Pdu2OpCodes.SOLAR_ARRAY_DEPL_OFF.value:
tc_queue.appendleft(
(QueueCommands.PRINT, "PDU2: Turn Solar Array Deployment Off")
)
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_5.parameter_address,
PDUConfigTable.out_en_5.parameter_size,
Channel.off,
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == Pdu2OpCodes.PL_CAMERA_ON.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn payload camera on"))
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_8.parameter_address,
PDUConfigTable.out_en_8.parameter_size,
Channel.on,
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == Pdu2OpCodes.PL_CAMERA_OFF.value:
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn payload camera off"))
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_8.parameter_address,
PDUConfigTable.out_en_8.parameter_size,
Channel.off,
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code in GomspaceOpCodes.REQUEST_CORE_HK_ONCE:
tc_queue.appendleft((QueueCommands.PRINT, f"PDU2: {Info.REQUEST_CORE_HK_ONCE}"))
hk_sid = make_sid(object_id=PDU_2_HANDLER_ID, set_id=SetIds.PDU_2_CORE)
command = generate_one_diag_command(sid=hk_sid, ssc=0)
tc_queue.appendleft(command.pack_command_tuple())
if op_code in GomspaceOpCodes.REQUEST_AUX_HK_ONCE:
tc_queue.appendleft((QueueCommands.PRINT, f"PDU2: {Info.REQUEST_AUX_HK_ONCE}"))
hk_sid = make_sid(object_id=PDU_2_HANDLER_ID, set_id=SetIds.PDU_2_AUX)
command = generate_one_hk_command(sid=hk_sid, ssc=0)
tc_queue.appendleft(command.pack_command_tuple())
def pack_pdu2_commands(object_id: ObjectIdU32, q: DefaultPusQueueHelper, op_code: str):
q.add_log_cmd("Testing PDU2")
objb = object_id.as_bytes
pdu2_cmds(q, op_code)
pdu2_req_hk_cmds(q, op_code)
if op_code in GomspaceOpCodes.PRINT_SWITCH_V_I:
tc_queue.appendleft(
(QueueCommands.PRINT, "PDU2: Print Switches, Currents, Voltahes")
q.add_log_cmd(f"PDU2: {GsInfo.PRINT_SWITCH_V_I}")
q.add_pus_tc(
generate_action_command(
object_id=objb, action_id=GomspaceDeviceActionIds.PRINT_SWITCH_V_I
)
command = generate_action_command(
object_id=object_id, action_id=GomspaceDeviceActionIds.PRINT_SWITCH_V_I
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code in GomspaceOpCodes.PRINT_LATCHUPS:
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Print Latchups"))
command = generate_action_command(
object_id=object_id, action_id=GomspaceDeviceActionIds.PRINT_LATCHUPS
q.add_log_cmd("PDU2: Print Latchups")
q.add_pus_tc(
generate_action_command(
object_id=objb, action_id=GomspaceDeviceActionIds.PRINT_LATCHUPS
)
)
tc_queue.appendleft(command.pack_command_tuple())
if PDU2TestProcedure.all or PDU2TestProcedure.reboot:
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Reboot"))
command = pack_reboot_command(object_id)
tc_queue.appendleft(command.pack_command_tuple())
q.add_log_cmd("PDU2: Reboot")
q.add_pus_tc(pack_reboot_command(object_id))
if PDU2TestProcedure.all or PDU2TestProcedure.read_gnd_wdt:
tc_queue.appendleft(
(QueueCommands.PRINT, "PDU2: Reading ground watchdog timer value")
)
command = pack_get_param_command(
object_id,
q.add_log_cmd("PDU2: Reading ground watchdog timer value")
q.add_pus_tc(
pack_get_param_command(
objb,
TableIds.hk,
PDUHkTable.wdt_gnd_left.parameter_address,
PDUHkTable.wdt_gnd_left.parameter_size,
PduHkTable.wdt_gnd_left.parameter_address,
PduHkTable.wdt_gnd_left.parameter_size,
)
)
tc_queue.appendleft(command.pack_command_tuple())
if PDU2TestProcedure.all or PDU2TestProcedure.gnd_wdt_reset:
tc_queue.appendleft(
(QueueCommands.PRINT, "PDU2: Testing ground watchdog reset")
)
command = pack_gnd_wdt_reset_command(object_id)
tc_queue.appendleft(command.pack_command_tuple())
q.add_log_cmd("PDU2: Testing ground watchdog reset")
q.add_pus_tc(pack_gnd_wdt_reset_command(object_id))
if PDU2TestProcedure.all or PDU2TestProcedure.ping:
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Ping Test"))
q.add_log_cmd("PDU2: Ping Test")
ping_data = bytearray([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
command = pack_ping_command(object_id, ping_data)
tc_queue.appendleft(command.pack_command_tuple())
q.add_pus_tc(pack_ping_command(object_id, ping_data))
if PDU2TestProcedure.all or PDU2TestProcedure.channel_2_on:
tc_queue.appendleft(
(
QueueCommands.PRINT,
"PDU2: Testing setting output channel 2 on (TCS Heater)",
)
)
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_2.parameter_address,
PDUConfigTable.out_en_2.parameter_size,
q.add_log_cmd("PDU2: Testing setting output channel 2 on (TCS Heater)")
q.add_pus_tc(
pack_set_param_command(
objb,
PduConfigTable.out_en_2.parameter_address,
PduConfigTable.out_en_2.parameter_size,
Channel.on,
)
tc_queue.appendleft(command.pack_command_tuple())
)
if PDU2TestProcedure.all or PDU2TestProcedure.read_temperature:
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Testing temperature reading"))
command = pack_get_param_command(
object_id,
q.add_log_cmd("PDU2: Testing temperature reading")
q.add_pus_tc(
pack_get_param_command(
objb,
TableIds.hk,
PDUHkTable.temperature.parameter_address,
PDUHkTable.temperature.parameter_size,
PduHkTable.temperature.parameter_address,
PduHkTable.temperature.parameter_size,
)
)
tc_queue.appendleft(command.pack_command_tuple())
if PDU2TestProcedure.all or PDU2TestProcedure.read_channel_2_state:
tc_queue.appendleft(
(QueueCommands.PRINT, "PDU2: Reading output channel 2 state (TCS Heater)")
)
command = pack_get_param_command(
object_id,
q.add_log_cmd("PDU2: Reading output channel 2 state (TCS Heater)")
q.add_pus_tc(
pack_get_param_command(
objb,
TableIds.config,
PDUConfigTable.out_en_2.parameter_address,
PDUConfigTable.out_en_2.parameter_size,
PduConfigTable.out_en_2.parameter_address,
PduConfigTable.out_en_2.parameter_size,
)
)
tc_queue.appendleft(command.pack_command_tuple())
if PDU2TestProcedure.all or PDU2TestProcedure.read_cur_lu_lim_0:
tc_queue.appendleft(
(
QueueCommands.PRINT,
"PDU2: Reading current limit value of output channel 0 (OBC)",
)
)
command = pack_get_param_command(
object_id,
q.add_log_cmd("PDU2: Reading current limit value of output channel 0 (OBC)")
q.add_pus_tc(
pack_get_param_command(
objb,
TableIds.config,
PDUConfigTable.cur_lu_lim_0.parameter_address,
PDUConfigTable.cur_lu_lim_0.parameter_size,
PduConfigTable.cur_lu_lim_0.parameter_address,
PduConfigTable.cur_lu_lim_0.parameter_size,
)
)
tc_queue.appendleft(command.pack_command_tuple())
if PDU2TestProcedure.all or PDU2TestProcedure.channel_2_off:
tc_queue.appendleft(
(QueueCommands.PRINT, "PDU2: Testing setting output channel 2 off")
)
command = pack_set_param_command(
object_id,
PDUConfigTable.out_en_2.parameter_address,
PDUConfigTable.out_en_2.parameter_size,
q.add_log_cmd("PDU2: Testing setting output channel 2 off")
q.add_pus_tc(
pack_set_param_command(
objb,
PduConfigTable.out_en_2.parameter_address,
PduConfigTable.out_en_2.parameter_size,
Channel.off,
)
tc_queue.appendleft(command.pack_command_tuple())
if PDU2TestProcedure.all or PDU2TestProcedure.request_hk_table:
tc_queue.appendleft(
(QueueCommands.PRINT, "PDU2: Requesting housekeeping table")
)
command = pack_request_full_hk_table_command(object_id)
tc_queue.appendleft(command.pack_command_tuple())
if PDU2TestProcedure.all or PDU2TestProcedure.request_hk_table:
q.add_log_cmd("PDU2: Requesting housekeeping table")
q.add_pus_tc(pack_request_full_hk_table_command(object_id))

View File

@ -8,36 +8,32 @@
"""
import struct
from tmtccmd.config.definitions import QueueCommands
from tmtccmd.tc.packer import TcQueueT
from spacepackets.ecss.tc import PusTelecommand
from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.util import ObjectIdU32
class ActionIds:
DUMP_MRAM = 1
def pack_ploc_memory_dumper_cmd(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
tc_queue.appendleft(
(
QueueCommands.PRINT,
"Testing PLOC memory dumper with object id: 0x" + object_id.hex(),
)
def pack_ploc_memory_dumper_cmd(
object_id: ObjectIdU32, q: DefaultPusQueueHelper, op_code: str
):
q.add_log_cmd(
f"Testing PLOC memory dumper with object id: {object_id.as_hex_string}"
)
if op_code == "0":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Dump MRAM"))
command = pack_mram_dump_cmd(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
q.add_log_cmd("PLOC Supervisor: Dump MRAM")
command = pack_mram_dump_cmd(object_id.as_bytes)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
def pack_mram_dump_cmd(object_id: bytearray) -> bytearray:
def pack_mram_dump_cmd(object_id: bytes) -> bytearray:
start = int(input("Start address: 0x"), 16)
end = int(input("End address: 0x"), 16)
command = bytearray()
command = object_id + struct.pack("!I", ActionIds.DUMP_MRAM)
command = command + struct.pack("!I", start)
command = command + struct.pack("!I", end)
return command
return bytearray(command)

View File

@ -9,12 +9,12 @@
import struct
import enum
from tmtccmd.config.definitions import QueueCommands
from tmtccmd.logging import get_console_logger
from tmtccmd.tc.packer import TcQueueT
from spacepackets.ecss.tc import PusTelecommand
from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.util import ObjectIdU32
from utility.input_helper import InputHelper
from tmtccmd.tc.service_200_mode import pack_mode_data, Modes
from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Modes
LOGGER = get_console_logger()
@ -53,6 +53,8 @@ class CommandIds(enum.IntEnum):
TC_MODE_REPLAY = 16
TC_CAM_CMD_SEND = 17
TC_MODE_IDLE = 18
SET_UART_TX_TRISTATE = 20
RELEASE_UART_TX = 21
class MemAddresses(enum.IntEnum):
@ -65,132 +67,119 @@ class PlocReplyIds(enum.IntEnum):
def pack_ploc_mpsoc_commands(
object_id: bytearray, tc_queue: TcQueueT, op_code: str
) -> TcQueueT:
tc_queue.appendleft(
(
QueueCommands.PRINT,
"Generate command for PLOC MPSoC with object id: 0x" + object_id.hex(),
object_id: ObjectIdU32, q: DefaultPusQueueHelper, op_code: str
):
q.add_log_cmd(
f"Generate command for PLOC MPSoC with object id: {object_id.as_hex_string}"
)
)
obyt = object_id.as_bytes
if op_code == "0":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: Set mode off"))
command = pack_mode_data(object_id, Modes.OFF, 0)
command = PusTelecommand(service=200, subservice=1, ssc=9, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
q.add_log_cmd("PLOC MPSoC: Set mode off")
command = pack_mode_data(obyt, Modes.OFF, 0)
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=command))
if op_code == "1":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: Set mode on"))
command = pack_mode_data(object_id, Modes.ON, 0)
command = PusTelecommand(service=200, subservice=1, ssc=10, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
q.add_log_cmd("PLOC MPSoC: Set mode on")
data = pack_mode_data(obyt, Modes.ON, 0)
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=data))
if op_code == "2":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: Mode Normal"))
command = pack_mode_data(object_id, Modes.NORMAL, 0)
command = PusTelecommand(service=200, subservice=1, ssc=11, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
q.add_log_cmd("PLOC MPSoC: Mode Normal")
data = pack_mode_data(object_id.as_bytes, Modes.NORMAL, 0)
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=data))
if op_code == "3":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: TC mem write test"))
q.add_log_cmd("PLOC MPSoC: TC mem write test")
memory_address = int(
input("PLOC MPSoC: Tc Mem Write: Type memory address: 0x"), 16
)
memory_data = int(input("PLOC MPSoC: Tc Mem Write: Type memory data: 0x"), 16)
# TODO: implement variable length mem write command
mem_len = 1 # 1 32-bit word
command = generate_write_mem_command(
object_id, memory_address, memory_data, mem_len
data = generate_write_mem_command(
object_id.as_bytes, memory_address, memory_data, mem_len
)
command = PusTelecommand(service=8, subservice=128, ssc=20, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "4":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: TC mem read test"))
command = prepare_mem_read_command(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=21, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "5":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: Flash write"))
command = prepare_flash_write_cmd(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "6":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: Flash delete"))
command = prepare_flash_delete_cmd(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "7":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: Replay start"))
command = prepare_replay_start_cmd(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "8":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: Replay stop"))
command = object_id + struct.pack("!I", CommandIds.TC_REPLAY_STOP)
command = PusTelecommand(service=8, subservice=128, ssc=25, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "9":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: Downlink pwr on"))
command = prepare_downlink_pwr_on_cmd(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=26, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "10":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: Downlink pwr off"))
command = object_id + struct.pack("!I", CommandIds.TC_DOWNLINK_PWR_OFF)
command = PusTelecommand(service=8, subservice=128, ssc=26, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "11":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: Replay write sequence"))
command = prepare_replay_write_sequence_cmd(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=27, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "12":
tc_queue.appendleft(
(QueueCommands.PRINT, "PLOC MPSoC: Reset OBSW sequence count")
)
command = object_id + struct.pack("!I", CommandIds.OBSW_RESET_SEQ_COUNT)
command = PusTelecommand(service=8, subservice=128, ssc=28, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "13":
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if op_code == "4":
q.add_log_cmd("PLOC MPSoC: TC mem read test")
data = prepare_mem_read_command(object_id=object_id.as_bytes)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if op_code == "5":
q.add_log_cmd("PLOC MPSoC: Flash write")
data = prepare_flash_write_cmd(object_id.as_bytes)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if op_code == "6":
q.add_log_cmd("PLOC MPSoC: Flash delete")
data = prepare_flash_delete_cmd(object_id.as_bytes)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if op_code == "7":
q.add_log_cmd("PLOC MPSoC: Replay start")
data = prepare_replay_start_cmd(object_id.as_bytes)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if op_code == "8":
q.add_log_cmd("PLOC MPSoC: Replay stop")
data = object_id.as_bytes + struct.pack("!I", CommandIds.TC_REPLAY_STOP)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if op_code == "9":
q.add_log_cmd("PLOC MPSoC: Downlink pwr on")
data = prepare_downlink_pwr_on_cmd(object_id.as_bytes)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if op_code == "10":
q.add_log_cmd("PLOC MPSoC: Downlink pwr off")
data = object_id.as_bytes + struct.pack("!I", CommandIds.TC_DOWNLINK_PWR_OFF)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if op_code == "11":
q.add_log_cmd("PLOC MPSoC: Replay write sequence")
data = prepare_replay_write_sequence_cmd(object_id.as_bytes)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if op_code == "12":
q.add_log_cmd("PLOC MPSoC: Reset OBSW sequence count")
data = object_id.as_bytes + struct.pack("!I", CommandIds.OBSW_RESET_SEQ_COUNT)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if op_code == "13":
num_words = 1
tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: Read DEADBEEF address"))
command = (
object_id
q.add_log_cmd("PLOC MPSoC: Read DEADBEEF address")
data = (
object_id.as_bytes
+ struct.pack("!I", CommandIds.TC_MEM_READ)
+ struct.pack("!I", MemAddresses.DEADBEEF)
+ struct.pack("!H", num_words)
)
command = PusTelecommand(service=8, subservice=128, ssc=29, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "14":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: Tc mode replay"))
command = object_id + struct.pack("!I", CommandIds.TC_MODE_REPLAY)
command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "15":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: Tc mode idle"))
command = object_id + struct.pack("!I", CommandIds.TC_MODE_IDLE)
command = PusTelecommand(service=8, subservice=128, ssc=31, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "16":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: Tc cam command send"))
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if op_code == "14":
q.add_log_cmd("PLOC MPSoC: Tc mode replay")
data = object_id.as_bytes + struct.pack("!I", CommandIds.TC_MODE_REPLAY)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if op_code == "15":
q.add_log_cmd("PLOC MPSoC: Tc mode idle")
data = object_id.as_bytes + struct.pack("!I", CommandIds.TC_MODE_IDLE)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if op_code == "16":
q.add_log_cmd("PLOC MPSoC: Tc cam command send")
cam_cmd = input("Specify cam command string: ")
command = (
object_id
data = (
object_id.as_bytes
+ struct.pack("!I", CommandIds.TC_CAM_CMD_SEND)
+ bytearray(cam_cmd, "utf-8")
)
command = PusTelecommand(service=8, subservice=128, ssc=32, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
return tc_queue
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if op_code == "17":
q.add_log_cmd("PLOC MPSoC: Set UART TX tristate")
data = object_id.as_bytes + struct.pack("!I", CommandIds.SET_UART_TX_TRISTATE)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if op_code == "18":
q.add_log_cmd("PLOC MPSoC: Release UART TX")
data = object_id.as_bytes + struct.pack("!I", CommandIds.RELEASE_UART_TX)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
def generate_write_mem_command(
object_id: bytearray, memory_address: int, memory_data: int, mem_len: int
object_id: bytes, memory_address: int, memory_data: int, mem_len: int
) -> bytearray:
"""This function generates the command to write to a memory address within the PLOC
@param object_id The object id of the PlocHandler
@param memory_address The PLOC memory address where to write to.
@param memory_data The data to write to the memory address specified by the bytearray memory_address.
"""This function generates the command to write to a memory address within the PLOC.
:param object_id: The object id of the PlocHandler
:param memory_address: The PLOC memory address where to write to.
:param memory_data: The data to write to the memory address specified by the
bytearray memory_address.
:param mem_len:
"""
command = (
object_id
@ -199,10 +188,10 @@ def generate_write_mem_command(
+ struct.pack("!H", mem_len)
+ struct.pack("!I", memory_data)
)
return command
return bytearray(command)
def prepare_mem_read_command(object_id: bytearray) -> bytearray:
def prepare_mem_read_command(object_id: bytes) -> bytearray:
memory_address = int(input("PLOC MPSoC Tc Mem Read: Type memory address: 0x"), 16)
num_words = int(input("PLOC MPSoC specify number of words (32-bit) to read: "))
command = (
@ -211,10 +200,10 @@ def prepare_mem_read_command(object_id: bytearray) -> bytearray:
+ struct.pack("!I", memory_address)
+ struct.pack("!H", num_words)
)
return command
return bytearray(command)
def prepare_flash_write_cmd(object_id: bytearray) -> bytearray:
def prepare_flash_write_cmd(object_id: bytes) -> bytearray:
obcFile = get_obc_file()
mpsocFile = get_mpsoc_file()
command = (
@ -223,30 +212,30 @@ def prepare_flash_write_cmd(object_id: bytearray) -> bytearray:
+ bytearray(obcFile, "utf-8")
+ bytearray(mpsocFile, "utf-8")
)
return command
return bytearray(command)
def prepare_flash_delete_cmd(object_id: bytearray) -> bytearray:
def prepare_flash_delete_cmd(object_id: bytes) -> bytearray:
file = get_mpsoc_file()
command = (
object_id
+ struct.pack("!I", CommandIds.TC_FLASH_DELETE)
+ bytearray(file, "utf-8")
)
return command
return bytearray(command)
def prepare_replay_start_cmd(object_id: bytearray) -> bytearray:
def prepare_replay_start_cmd(object_id: bytes) -> bytearray:
replay = int(input("Specify replay mode (0 - once, 1 - repeated): "))
command = (
object_id
+ struct.pack("!I", CommandIds.TC_REPLAY_START)
+ struct.pack("!B", replay)
)
return command
return bytearray(command)
def prepare_downlink_pwr_on_cmd(object_id: bytearray) -> bytearray:
def prepare_downlink_pwr_on_cmd(object_id: bytes) -> bytearray:
mode = int(input("Specify JESD mode (0 - 5): "))
lane_rate = int(input("Specify lane rate (0 - 9): "))
command = (
@ -255,10 +244,10 @@ def prepare_downlink_pwr_on_cmd(object_id: bytearray) -> bytearray:
+ struct.pack("!B", mode)
+ struct.pack("!B", lane_rate)
)
return command
return bytearray(command)
def prepare_replay_write_sequence_cmd(object_id: bytearray) -> bytearray:
def prepare_replay_write_sequence_cmd(object_id: bytes) -> bytearray:
null_terminator = 0
use_decoding = int(input("Use decoding (set to 1): "))
file = get_sequence_file()
@ -268,7 +257,7 @@ def prepare_replay_write_sequence_cmd(object_id: bytearray) -> bytearray:
+ struct.pack("!B", use_decoding)
+ bytearray(file, "utf-8")
)
return command
return bytearray(command)
def get_obc_file() -> str:

View File

@ -9,10 +9,10 @@
import struct
from spacepackets.ecss.tc import PusTelecommand
from tmtccmd.config.definitions import QueueCommands
from tmtccmd.tc.packer import TcQueueT
from tmtccmd.logging import get_console_logger
from tmtccmd.tc.service_200_mode import pack_mode_data, Modes
from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Modes
from tmtccmd.util import ObjectIdU32
from utility.input_helper import InputHelper
LOGGER = get_console_logger()
@ -40,6 +40,10 @@ update_file_dict = {
"/mnt/sd0/ploc/supervisor/update-small.bin",
"/mnt/sd0/ploc/supervisor/update-small.bin",
],
"5": [
"/mnt/sd0/ploc/supervisor/mpsoc-uart-working.bin",
"/mnt/sd0/ploc/supervisor/mpsoc-uart-working.bin",
],
}
event_buffer_path_dict = {
@ -93,6 +97,8 @@ class SupvActionIds:
LOGGING_SET_TOPIC = 56
REQUEST_ADC_REPORT = 57
RESET_PL = 58
ENABLE_NVMS = 59
CONTINUE_UPDATE = 60
class SupvHkIds:
@ -101,295 +107,235 @@ class SupvHkIds:
def pack_ploc_supv_commands(
object_id: bytearray, tc_queue: TcQueueT, op_code: str
) -> TcQueueT:
tc_queue.appendleft(
(
QueueCommands.PRINT,
"Testing PLOC Supervisor with object id: 0x" + object_id.hex(),
)
)
object_id: ObjectIdU32, q: DefaultPusQueueHelper, op_code: str
):
q.add_log_cmd(f"Testing PLOC Supervisor with object id: {object_id.as_hex_string}")
obyt = object_id.as_bytes
if op_code == "0":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Set mode off"))
command = pack_mode_data(object_id, Modes.OFF, 0)
command = PusTelecommand(service=200, subservice=1, ssc=9, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
q.add_log_cmd("PLOC Supervisor: Set mode off")
command = pack_mode_data(object_id.as_bytes, Modes.OFF, 0)
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=command))
if op_code == "1":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Set mode on"))
command = pack_mode_data(object_id, Modes.ON, 0)
command = PusTelecommand(service=200, subservice=1, ssc=10, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
q.add_log_cmd("PLOC Supervisor: Set mode on")
command = pack_mode_data(object_id.as_bytes, Modes.ON, 0)
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=command))
if op_code == "2":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Mode Normal"))
command = pack_mode_data(object_id, Modes.NORMAL, 0)
command = PusTelecommand(service=200, subservice=1, ssc=11, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
q.add_log_cmd("PLOC Supervisor: Mode Normal")
command = pack_mode_data(object_id.as_bytes, Modes.NORMAL, 0)
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=command))
if op_code == "3":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: TC Get Hk Report"))
command = object_id + struct.pack("!I", SupvActionIds.HK_REPORT)
command = PusTelecommand(service=8, subservice=128, ssc=20, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
q.add_log_cmd("PLOC Supervisor: TC Get Hk Report")
command = obyt + struct.pack("!I", SupvActionIds.HK_REPORT)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
elif op_code == "5":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Start MPSoC"))
command = object_id + struct.pack("!I", SupvActionIds.START_MPSOC)
command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "6":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Shutdown MPSoC"))
command = object_id + struct.pack("!I", SupvActionIds.SHUTWOWN_MPSOC)
command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "7":
tc_queue.appendleft(
(QueueCommands.PRINT, "PLOC Supervisor: Select MPSoC boot image")
)
q.add_log_cmd("PLOC Supervisor: Start MPSoC")
command = obyt + struct.pack("!I", SupvActionIds.START_MPSOC)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "6":
q.add_log_cmd("PLOC Supervisor: Shutdown MPSoC")
command = object_id.as_bytes + struct.pack("!I", SupvActionIds.SHUTWOWN_MPSOC)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "7":
q.add_log_cmd("PLOC Supervisor: Select MPSoC boot image")
mem = int(input("MEM (NVM0 - 0 or NVM1 - 1): "))
bp0 = int(input("BP0 (0 or 1): "))
bp1 = int(input("BP1 (0 or 1): "))
bp2 = int(input("BP2 (0 or 1): "))
command = pack_sel_boot_image_cmd(object_id, mem, bp0, bp1, bp2)
command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "8":
tc_queue.appendleft(
(QueueCommands.PRINT, "PLOC Supervisor: Set max restart tries")
)
command = pack_sel_boot_image_cmd(object_id.as_bytes, mem, bp0, bp1, bp2)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "8":
q.add_log_cmd("PLOC Supervisor: Set max restart tries")
restart_tries = int(input("Specify maximum restart tries: "))
command = (
object_id
object_id.as_bytes
+ struct.pack("!I", SupvActionIds.SET_MAX_RESTART_TRIES)
+ struct.pack("!B", restart_tries)
)
command = PusTelecommand(service=8, subservice=128, ssc=25, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "9":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Reset MPSoC"))
command = object_id + struct.pack("!I", SupvActionIds.RESET_MPSOC)
command = PusTelecommand(service=8, subservice=128, ssc=26, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "10":
tc_queue.appendleft(
(QueueCommands.PRINT, "PLOC Supervisor: Set time reference")
)
command = object_id + struct.pack("!I", SupvActionIds.SET_TIME_REF)
command = PusTelecommand(service=8, subservice=128, ssc=27, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "11":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Set boot timeout"))
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "9":
q.add_log_cmd("PLOC Supervisor: Reset MPSoC")
command = object_id.as_bytes + struct.pack("!I", SupvActionIds.RESET_MPSOC)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "10":
q.add_log_cmd("PLOC Supervisor: Set time reference")
command = object_id.as_bytes + struct.pack("!I", SupvActionIds.SET_TIME_REF)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "11":
q.add_log_cmd("PLOC Supervisor: Set boot timeout")
boot_timeout = int(input("Specify boot timeout [ms]: "))
command = (
object_id
object_id.as_bytes
+ struct.pack("!I", SupvActionIds.SET_BOOT_TIMEOUT)
+ struct.pack("!I", boot_timeout)
)
command = PusTelecommand(service=8, subservice=128, ssc=28, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "12":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Disable HK"))
command = object_id + struct.pack("!I", SupvActionIds.DISABLE_HK)
command = PusTelecommand(service=8, subservice=128, ssc=29, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "13":
tc_queue.appendleft(
(QueueCommands.PRINT, "PLOC Supervisor: Request boot status report")
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "12":
q.add_log_cmd("PLOC Supervisor: Disable HK")
command = object_id.as_bytes + struct.pack("!I", SupvActionIds.DISABLE_HK)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "13":
q.add_log_cmd("PLOC Supervisor: Request boot status report")
command = object_id.as_bytes + struct.pack(
"!I", SupvActionIds.GET_BOOT_STATUS_REPORT
)
command = object_id + struct.pack("!I", SupvActionIds.GET_BOOT_STATUS_REPORT)
command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "17":
tc_queue.appendleft(
(QueueCommands.PRINT, "PLOC Supervisor: Enable latchup alert")
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "17":
q.add_log_cmd("PLOC Supervisor: Enable latchup alert")
command = pack_lachtup_alert_cmd(object_id.as_bytes, True)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "18":
q.add_log_cmd("PLOC Supervisor: Disable latchup alert")
command = pack_lachtup_alert_cmd(object_id.as_bytes, False)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "20":
q.add_log_cmd("PLOC Supervisor: Set alert limit")
command = pack_set_alert_limit_cmd(object_id.as_bytes)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "23":
q.add_log_cmd("PLOC Supervisor: Set ADC enabled channels")
command = pack_set_adc_enabled_channels_cmd(object_id.as_bytes)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "24":
q.add_log_cmd("PLOC Supervisor: Set ADC window and stride")
command = pack_set_adc_window_and_stride_cmd(object_id.as_bytes)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "25":
q.add_log_cmd("PLOC Supervisor: Set ADC threshold")
command = pack_set_adc_threshold_cmd(object_id.as_bytes)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "26":
q.add_log_cmd("PLOC Supervisor: Request latchup status report")
command = object_id.as_bytes + struct.pack(
"!I", SupvActionIds.GET_LATCHUP_STATUS_REPORT
)
command = pack_lachtup_alert_cmd(object_id, True)
command = PusTelecommand(service=8, subservice=128, ssc=34, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "18":
tc_queue.appendleft(
(QueueCommands.PRINT, "PLOC Supervisor: Disable latchup alert")
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "27":
q.add_log_cmd("PLOC Supervisor: Copy ADC data to MRAM")
command = object_id.as_bytes + struct.pack(
"!I", SupvActionIds.COPY_ADC_DATA_TO_MRAM
)
command = pack_lachtup_alert_cmd(object_id, False)
command = PusTelecommand(service=8, subservice=128, ssc=35, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "20":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Set alert limit"))
command = pack_set_alert_limit_cmd(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=37, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "23":
tc_queue.appendleft(
(QueueCommands.PRINT, "PLOC Supervisor: Set ADC enabled channels")
)
command = pack_set_adc_enabled_channels_cmd(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=40, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "24":
tc_queue.appendleft(
(QueueCommands.PRINT, "PLOC Supervisor: Set ADC window and stride")
)
command = pack_set_adc_window_and_stride_cmd(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=41, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "25":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Set ADC threshold"))
command = pack_set_adc_threshold_cmd(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=42, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "26":
tc_queue.appendleft(
(QueueCommands.PRINT, "PLOC Supervisor: Request latchup status report")
)
command = object_id + struct.pack("!I", SupvActionIds.GET_LATCHUP_STATUS_REPORT)
command = PusTelecommand(service=8, subservice=128, ssc=43, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "27":
tc_queue.appendleft(
(QueueCommands.PRINT, "PLOC Supervisor: Copy ADC data to MRAM")
)
command = object_id + struct.pack("!I", SupvActionIds.COPY_ADC_DATA_TO_MRAM)
command = PusTelecommand(service=8, subservice=128, ssc=44, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "30":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Run auto EM tests"))
command = pack_auto_em_tests_cmd(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=45, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "31":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Wipe MRAM"))
command = pack_mram_wipe_cmd(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=46, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "35":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Set GPIO command"))
command = pack_set_gpio_cmd(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=50, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "36":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Read GPIO command"))
command = pack_read_gpio_cmd(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=51, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "37":
tc_queue.appendleft(
(QueueCommands.PRINT, "PLOC Supervisor: Restart supervisor")
)
command = command = object_id + struct.pack(
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "30":
q.add_log_cmd("PLOC Supervisor: Run auto EM tests")
command = pack_auto_em_tests_cmd(object_id.as_bytes)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "31":
q.add_log_cmd("PLOC Supervisor: Wipe MRAM")
command = pack_mram_wipe_cmd(object_id.as_bytes)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "35":
q.add_log_cmd("PLOC Supervisor: Set GPIO command")
command = pack_set_gpio_cmd(object_id.as_bytes)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "36":
q.add_log_cmd("PLOC Supervisor: Read GPIO command")
command = pack_read_gpio_cmd(object_id.as_bytes)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "37":
q.add_log_cmd("PLOC Supervisor: Restart supervisor")
command = object_id.as_bytes + struct.pack(
"!I", SupvActionIds.RESTART_SUPERVISOR
)
command = PusTelecommand(service=8, subservice=128, ssc=52, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "38":
tc_queue.appendleft(
(QueueCommands.PRINT, "PLOC Supervisor: Factory reset clear all")
)
command = command = object_id + struct.pack(
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "38":
q.add_log_cmd("PLOC Supervisor: Factory reset clear all")
command = object_id.as_bytes + struct.pack(
"!I", SupvActionIds.FACTORY_RESET_CLEAR_ALL
)
command = PusTelecommand(service=8, subservice=128, ssc=53, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "39":
tc_queue.appendleft(
(QueueCommands.PRINT, "PLOC Supervisor: Factory reset clear mirror entries")
)
command = object_id + struct.pack(
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "39":
q.add_log_cmd("PLOC Supervisor: Factory reset clear mirror entries")
command = object_id.as_bytes + struct.pack(
"!I", SupvActionIds.FACTORY_RESET_CLEAR_MIRROR
)
command = PusTelecommand(service=8, subservice=128, ssc=54, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "40":
tc_queue.appendleft(
(
QueueCommands.PRINT,
"PLOC Supervisor: Factory reset clear circular entries",
)
)
command = command = object_id + struct.pack(
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "40":
q.add_log_cmd("PLOC Supervisor: Factory reset clear circular entries")
command = object_id.as_bytes + struct.pack(
"!I", SupvActionIds.FACTORY_RESET_CLEAR_CIRCULAR
)
command = PusTelecommand(service=8, subservice=128, ssc=55, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "42":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Perform update"))
command = pack_update_command(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=57, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "43":
tc_queue.appendleft(
(QueueCommands.PRINT, "PLOC Supervisor: Terminate supervisor process")
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "42":
q.add_log_cmd("PLOC Supervisor: Perform update")
command = pack_update_command(object_id.as_bytes)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "43":
q.add_log_cmd("PLOC Supervisor: Terminate supervisor process")
command = object_id.as_bytes + struct.pack(
"!I", SupvActionIds.TERMINATE_SUPV_HELPER
)
command = object_id + struct.pack("!I", SupvActionIds.TERMINATE_SUPV_HELPER)
command = PusTelecommand(service=8, subservice=128, ssc=58, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "44":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Start MPSoC quiet"))
command = object_id + struct.pack("!I", SupvActionIds.START_MPSOC_QUIET)
command = PusTelecommand(service=8, subservice=128, ssc=59, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "45":
tc_queue.appendleft(
(QueueCommands.PRINT, "PLOC Supervisor: Set shutdown timeout")
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "44":
q.add_log_cmd("PLOC Supervisor: Start MPSoC quiet")
command = object_id.as_bytes + struct.pack(
"!I", SupvActionIds.START_MPSOC_QUIET
)
command = pack_set_shutdown_timeout_command(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=60, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "46":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Factory flash"))
command = object_id + struct.pack("!I", SupvActionIds.FACTORY_FLASH)
command = PusTelecommand(service=8, subservice=128, ssc=61, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "47":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Enable auto TM"))
command = object_id + struct.pack("!I", SupvActionIds.ENABLE_AUTO_TM)
command = PusTelecommand(service=8, subservice=128, ssc=62, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "48":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Disable auto TM"))
command = object_id + struct.pack("!I", SupvActionIds.DISABLE_AUTO_TM)
command = PusTelecommand(service=8, subservice=128, ssc=63, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "51":
tc_queue.appendleft(
(QueueCommands.PRINT, "PLOC Supervisor: Logging request event buffers")
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "45":
q.add_log_cmd("PLOC Supervisor: Set shutdown timeout")
command = pack_set_shutdown_timeout_command(object_id.as_bytes)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "46":
q.add_log_cmd("PLOC Supervisor: Factory flash")
command = object_id.as_bytes + struct.pack("!I", SupvActionIds.FACTORY_FLASH)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "47":
q.add_log_cmd("PLOC Supervisor: Enable auto TM")
command = object_id.as_bytes + struct.pack("!I", SupvActionIds.ENABLE_AUTO_TM)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "48":
q.add_log_cmd("PLOC Supervisor: Disable auto TM")
command = object_id.as_bytes + struct.pack("!I", SupvActionIds.DISABLE_AUTO_TM)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "51":
q.add_log_cmd("PLOC Supervisor: Logging request event buffers")
command = pack_logging_buffer_request(object_id.as_bytes)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "52":
q.add_log_cmd("PLOC Supervisor: Logging clear counters")
command = object_id.as_bytes + struct.pack(
"!I", SupvActionIds.LOGGING_CLEAR_COUNTERS
)
command = pack_logging_buffer_request(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=66, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "52":
tc_queue.appendleft(
(QueueCommands.PRINT, "PLOC Supervisor: Logging clear counters")
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "53":
q.add_log_cmd("PLOC Supervisor: Logging set topic")
command = pack_logging_set_topic(object_id.as_bytes)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "54":
q.add_log_cmd("PLOC Supervisor: Logging request counters")
command = object_id.as_bytes + struct.pack(
"!I", SupvActionIds.LOGGING_REQUEST_COUNTERS
)
command = object_id + struct.pack("!I", SupvActionIds.LOGGING_CLEAR_COUNTERS)
command = PusTelecommand(service=8, subservice=128, ssc=67, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "53":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Logging set topic"))
command = pack_logging_set_topic(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=68, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "54":
tc_queue.appendleft(
(QueueCommands.PRINT, "PLOC Supervisor: Logging request counters")
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "55":
q.add_log_cmd("PLOC Supervisor: Request ADC report")
command = object_id.as_bytes + struct.pack(
"!I", SupvActionIds.REQUEST_ADC_REPORT
)
command = object_id + struct.pack("!I", SupvActionIds.LOGGING_REQUEST_COUNTERS)
command = PusTelecommand(service=8, subservice=128, ssc=69, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "55":
tc_queue.appendleft(
(QueueCommands.PRINT, "PLOC Supervisor: Request ADC report")
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "56":
q.add_log_cmd("PLOC Supervisor: Reset PL")
command = object_id.as_bytes + struct.pack("!I", SupvActionIds.RESET_PL)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "57":
q.add_log_cmd("PLOC Supervisor: Enable NVMs")
nvm01 = int(input("Enable (1) or disable(0) NVM 0 and 1: "))
nvm3 = int(input("Enable (1) or disable(0) NVM 3: "))
command = (
object_id.as_bytes
+ struct.pack("!I", SupvActionIds.ENABLE_NVMS)
+ struct.pack("B", nvm01)
+ struct.pack("B", nvm3)
)
command = object_id + struct.pack("!I", SupvActionIds.REQUEST_ADC_REPORT)
command = PusTelecommand(service=8, subservice=128, ssc=70, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "56":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Reset PL"))
command = object_id + struct.pack("!I", SupvActionIds.RESET_PL)
command = PusTelecommand(service=8, subservice=128, ssc=71, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
return tc_queue
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "58":
q.add_log_cmd("PLOC Supervisor: Continue update")
command = object_id.as_bytes + struct.pack("!I", SupvActionIds.CONTINUE_UPDATE)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
def pack_sel_boot_image_cmd(
object_id: bytearray, mem: int, bp0: int, bp1: int, bp2: int
object_id: bytes, mem: int, bp0: int, bp1: int, bp2: int
) -> bytearray:
"""This function can be used to generate the command to select the image from which the MPSoC will boot
@param object_id The object id of the PLOC supervisor handler.
@ -403,10 +349,10 @@ def pack_sel_boot_image_cmd(
command = command + struct.pack("!B", bp0)
command = command + struct.pack("!B", bp1)
command = command + struct.pack("!B", bp2)
return command
return bytearray(command)
def pack_update_available_cmd(object_id: bytearray) -> bytearray:
def pack_update_available_cmd(object_id: bytes) -> bytearray:
"""
@brief This function packs the udpate availabe command.
@param object_id The object id of the PLOC supervisor handler.
@ -422,10 +368,10 @@ def pack_update_available_cmd(object_id: bytearray) -> bytearray:
command = command + struct.pack("!I", image_size)
command = command + struct.pack("!I", image_crc)
command = command + struct.pack("!I", number_of_packets)
return command
return bytearray(command)
def pack_watchdogs_enable_cmd(object_id: bytearray) -> bytearray:
def pack_watchdogs_enable_cmd(object_id: bytes) -> bytearray:
"""
@brief This function packs the command to enable or disable watchdogs on the PLOC.
@param object_id The object id of the PLOC supervisor handler.
@ -439,7 +385,7 @@ def pack_watchdogs_enable_cmd(object_id: bytearray) -> bytearray:
command = command + struct.pack("!B", watchdog_ps)
command = command + struct.pack("!B", watchdog_pl)
command = command + struct.pack("!B", watchdog_int)
return command
return bytearray(command)
def pack_watchdog_config_timeout_cmd(object_id: bytearray) -> bytearray:
@ -456,7 +402,7 @@ def pack_watchdog_config_timeout_cmd(object_id: bytearray) -> bytearray:
return command
def pack_lachtup_alert_cmd(object_id: bytearray, state: bool) -> bytearray:
def pack_lachtup_alert_cmd(object_id: bytes, state: bool) -> bytearray:
"""
@brief This function packs the command to enable or disable a certain latchup alerts.
@param object_id The object id of the PLOC supervisor handler.
@ -469,7 +415,7 @@ def pack_lachtup_alert_cmd(object_id: bytearray, state: bool) -> bytearray:
else:
command = object_id + struct.pack("!I", SupvActionIds.DISABLE_LATCHUP_ALERT)
command = command + struct.pack("!B", latchup_id)
return command
return bytearray(command)
def pack_auto_calibrate_alert_cmd(object_id: bytearray) -> bytearray:
@ -502,7 +448,7 @@ def get_latchup_id() -> int:
return int(input("Specify latchup ID: "))
def pack_set_alert_limit_cmd(object_id: bytearray) -> bytearray:
def pack_set_alert_limit_cmd(object_id: bytes) -> bytearray:
"""
@brief This function packs the command to set the limit of a latchup alert.
@param object_id The object id of the PLOC supervisor handler.
@ -513,10 +459,10 @@ def pack_set_alert_limit_cmd(object_id: bytearray) -> bytearray:
command = object_id + struct.pack("!I", SupvActionIds.SET_ALERT_LIMIT)
command = command + struct.pack("!B", latchup_id)
command = command + struct.pack("!I", dutycycle)
return command
return bytearray(command)
def pack_set_adc_enabled_channels_cmd(object_id: bytearray) -> bytearray:
def pack_set_adc_enabled_channels_cmd(object_id: bytes) -> bytearray:
"""
@brief This function packs the command to enable or disable channels of the ADC.
@param object_id The object id of the PLOC supervisor handler.
@ -524,54 +470,49 @@ def pack_set_adc_enabled_channels_cmd(object_id: bytearray) -> bytearray:
ch = int(input("Specify ch: 0x"), 16)
cmd = object_id + struct.pack("!I", SupvActionIds.SET_ADC_ENABLED_CHANNELS)
cmd = cmd + struct.pack("!H", ch)
return cmd
return bytearray(cmd)
def pack_set_adc_window_and_stride_cmd(object_id: bytearray) -> bytearray:
def pack_set_adc_window_and_stride_cmd(object_id: bytes) -> bytearray:
window_size = int(input("Specify window size: "))
striding_step_size = int(input("Specify striding step size: "))
command = bytearray()
command = object_id + struct.pack("!I", SupvActionIds.SET_ADC_WINDOW_AND_STRIDE)
command = command + struct.pack("!H", window_size)
command = command + struct.pack("!H", striding_step_size)
return command
return bytearray(command)
def pack_set_adc_threshold_cmd(object_id: bytearray) -> bytearray:
def pack_set_adc_threshold_cmd(object_id: bytes) -> bytearray:
threshold = int(input("Specify threshold: "))
command = bytearray()
command = object_id + struct.pack("!I", SupvActionIds.SET_ADC_THRESHOLD)
command = command + struct.pack("!I", threshold)
return command
return bytearray(command)
def pack_select_nvm_cmd(object_id: bytearray) -> bytearray:
def pack_select_nvm_cmd(object_id: bytes) -> bytearray:
mem = int(input("Specify NVM (0 - NVM0, 1 - MVM1): "))
command = bytearray()
command = object_id + struct.pack("!I", SupvActionIds.SELECT_NVM)
command = command + struct.pack("!B", mem)
return command
return bytearray(command)
def pack_auto_em_tests_cmd(object_id: bytearray) -> bytearray:
def pack_auto_em_tests_cmd(object_id: bytes) -> bytearray:
test = int(input("Specify test (1 - complete, 2 - short): "))
command = bytearray()
command = object_id + struct.pack("!I", SupvActionIds.RUN_AUTO_EM_TESTS)
command = command + struct.pack("!B", test)
return command
return bytearray(command)
def pack_mram_wipe_cmd(object_id: bytearray) -> bytearray:
def pack_mram_wipe_cmd(object_id: bytes) -> bytearray:
start = int(input("Start address: 0x"), 16)
stop = int(input("Stop address: 0x"), 16)
command = bytearray()
command = object_id + struct.pack("!I", SupvActionIds.WIPE_MRAM)
command = command + struct.pack("!I", start)
command = command + struct.pack("!I", stop)
return command
return bytearray(command)
def pack_update_command(object_id: bytearray) -> bytearray:
def pack_update_command(object_id: bytes) -> bytearray:
command = bytearray()
memory_id = int(input("Specify memory ID: "))
start_address = int(input("Specify start address: 0x"), 16)
@ -583,10 +524,10 @@ def pack_update_command(object_id: bytearray) -> bytearray:
command += struct.pack("!B", 0)
command += struct.pack("!B", memory_id)
command += struct.pack("!I", start_address)
return command
return bytearray(command)
def pack_set_shutdown_timeout_command(object_id: bytearray) -> bytearray:
def pack_set_shutdown_timeout_command(object_id: bytes) -> bytearray:
command = bytearray()
command += object_id
command += struct.pack("!I", SupvActionIds.SET_SHUTDOWN_TIMEOUT)
@ -595,7 +536,7 @@ def pack_set_shutdown_timeout_command(object_id: bytearray) -> bytearray:
return command
def pack_logging_buffer_request(object_id: bytearray) -> bytearray:
def pack_logging_buffer_request(object_id: bytes) -> bytearray:
command = bytearray()
command += object_id
command += struct.pack("!I", SupvActionIds.LOGGING_REQUEST_EVENT_BUFFERS)
@ -604,31 +545,31 @@ def pack_logging_buffer_request(object_id: bytearray) -> bytearray:
return command
def pack_set_gpio_cmd(object_id: bytearray) -> bytearray:
port = int(input("Specify port : 0x"), 16)
def pack_set_gpio_cmd(object_id: bytes) -> bytearray:
port = int(input("Specify port: 0x"), 16)
pin = int(input("Specify pin: 0x"), 16)
val = int(input("Specify val: 0x"), 16)
command = object_id + struct.pack("!I", SupvActionIds.SET_GPIO)
command = command + struct.pack("!B", port)
command = command + struct.pack("!B", pin)
command = command + struct.pack("!B", val)
return command
return bytearray(command)
def pack_read_gpio_cmd(object_id: bytearray) -> bytearray:
def pack_read_gpio_cmd(object_id: bytes) -> bytearray:
port = int(input("Specify port: 0x"), 16)
pin = int(input("Specify pin: 0x"), 16)
command = object_id + struct.pack("!I", SupvActionIds.READ_GPIO)
command = command + struct.pack("!B", port)
command = command + struct.pack("!B", pin)
return command
return bytearray(command)
def pack_logging_set_topic(objetc_id: bytearray) -> bytearray:
command = objetc_id + struct.pack("!I", SupvActionIds.LOGGING_SET_TOPIC)
def pack_logging_set_topic(object_id: bytes) -> bytearray:
command = object_id + struct.pack("!I", SupvActionIds.LOGGING_SET_TOPIC)
tpc = int(input("Specify logging topic: "))
command += struct.pack("!B", tpc)
return command
return bytearray(command)
def get_update_file() -> str:

View File

@ -1,148 +0,0 @@
# -*- coding: utf-8 -*-
"""
@file ploc_udpater.py
@brief Commands to initiate update transfer to ploc supervisor. This only updates the software of the MPSoC, it is not
possible to update the software of the supervisor.
The supervisor is programmed by Thales.
@author J. Meier
@date 10.07.2021
"""
import struct
from tmtccmd.config.definitions import QueueCommands
from tmtccmd.tc.packer import TcQueueT
from spacepackets.ecss.tc import PusTelecommand
latchup_id_dict = {
"0": "0.85V",
"1": "1.8V",
"2": "MISC",
"3": "3.3V",
"4": "NVM_4XO",
"5": "MISSION",
"6": "SAFECOTS",
}
class UpdaterActionIds:
UPDATE_A_UBOOT = 0
UPDATE_A_BITSTREAM = 1
UPDATE_A_LINUX = 2
UPDATE_A_APP_SW = 3
UPDATE_B_UBOOT = 4
UPDATE_B_BITSTREAM = 5
UPDATE_B_LINUX = 6
UPDATE_B_LINUX = 7
class ImagePathDefs:
imageAuboot = "/mnt/sd0/ploc/updateAuboot.bin"
imageAbitsream = "/mnt/sd0/ploc/updateAbitstream.bin"
imageAlinux = "/mnt/sd0/ploc/updateAlinux.bin"
imageAappsw = "/mnt/sd0/ploc/updateAappsw.bin"
imageBuboot = "/mnt/sd0/ploc/updateBuboot.bin"
imageBbitsream = "/mnt/sd0/ploc/updateBbitstream.bin"
imageBlinux = "/mnt/sd0/ploc/updateBlinux.bin"
imageBappsw = "/mnt/sd0/ploc/updateBappsw.bin"
def pack_ploc_updater_test_into(
object_id: bytearray, tc_queue: TcQueueT, op_code: str
) -> TcQueueT:
tc_queue.appendleft(
(
QueueCommands.PRINT,
"Testing PLOC updater with object id: 0x" + object_id.hex(),
)
)
if op_code == "0":
tc_queue.appendleft(
(QueueCommands.PRINT, "PLOC Supervisor: Update uboot on partition A")
)
command = (
object_id
+ struct.pack("!I", UpdaterActionIds.UPDATE_A_UBOOT)
+ bytearray(ImagePathDefs.imageAuboot, "utf-8")
)
command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "1":
tc_queue.appendleft(
(QueueCommands.PRINT, "PLOC Supervisor: Update bitstream on parition A")
)
command = (
object_id
+ struct.pack("!I", UpdaterActionIds.UPDATE_A_BITSTREAM)
+ bytearray(ImagePathDefs.imageAbitsream, "utf-8")
)
command = PusTelecommand(service=8, subservice=128, ssc=31, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "2":
tc_queue.appendleft(
(QueueCommands.PRINT, "PLOC Supervisor: Update linux on partition A")
)
command = (
object_id
+ struct.pack("!I", UpdaterActionIds.UPDATE_A_LINUX)
+ bytearray(ImagePathDefs.imageAlinux, "utf-8")
)
command = PusTelecommand(service=8, subservice=128, ssc=32, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "3":
tc_queue.appendleft(
(QueueCommands.PRINT, "PLOC Supervisor: Update application on partition A")
)
command = (
object_id
+ struct.pack("!I", UpdaterActionIds.UPDATE_A_APP_SW)
+ bytearray(ImagePathDefs.imageAappsw, "utf-8")
)
command = PusTelecommand(service=8, subservice=128, ssc=33, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "4":
tc_queue.appendleft(
(QueueCommands.PRINT, "PLOC Supervisor: Update uboot on partition B")
)
command = (
object_id
+ struct.pack("!I", UpdaterActionIds.UPDATE_B_UBOOT)
+ bytearray(ImagePathDefs.imageBuboot, "utf-8")
)
command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "5":
tc_queue.appendleft(
(QueueCommands.PRINT, "PLOC Supervisor: Update bitstream on parition B")
)
command = (
object_id
+ struct.pack("!I", UpdaterActionIds.UPDATE_B_BITSTREAM)
+ bytearray(ImagePathDefs.imageBbitsream, "utf-8")
)
command = PusTelecommand(service=8, subservice=128, ssc=31, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "6":
tc_queue.appendleft(
(QueueCommands.PRINT, "PLOC Supervisor: Update linux on partition B")
)
command = (
object_id
+ struct.pack("!I", UpdaterActionIds.UPDATE_B_LINUX)
+ bytearray(ImagePathDefs.imageBlinux, "utf-8")
)
command = PusTelecommand(service=8, subservice=128, ssc=32, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "7":
tc_queue.appendleft(
(QueueCommands.PRINT, "PLOC Supervisor: Update application on partition B")
)
command = (
object_id
+ struct.pack("!I", UpdaterActionIds.UPDATE_B_APP_SW)
+ bytearray(ImagePathDefs.imageBappsw, "utf-8")
)
command = PusTelecommand(service=8, subservice=128, ssc=33, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())

View File

@ -1,10 +1,23 @@
import enum
import struct
import time
from typing import Optional
from tmtccmd.config import QueueCommands
from tmtccmd.tc.definitions import TcQueueT
from tmtccmd.tc.service_200_mode import pack_mode_data, Modes, Subservices
from tmtccmd.tc.service_20_parameter import (
from config.definitions import CustomServiceList
from tmtccmd.config import TmtcDefinitionWrapper
from tmtccmd.config.tmtc import OpCodeEntry, tmtc_definitions_provider
from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.tc.pus_3_fsfw_hk import (
make_sid,
generate_one_diag_command,
)
from tmtccmd.tc.pus_11_tc_sched import (
generate_enable_tc_sched_cmd,
generate_time_tagged_cmd,
)
from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Modes, Subservices
from tmtccmd.tc.pus_20_params import (
pack_scalar_double_param_app_data,
pack_fsfw_load_param_cmd,
pack_boolean_parameter_app_data,
@ -17,14 +30,17 @@ LOGGER = get_console_logger()
class OpCodes:
SWITCH_ON = ["0", "on"]
SWITCH_OFF = ["1", "off"]
NORMAL_SSR = ["2", "nml-ssr"]
NORMAL_DRO = ["3", "nml-dro"]
NORMAL_X8 = ["4", "nml-x8"]
NORMAL_TX = ["5", "nml-tx"]
NORMAL_MPA = ["6", "nml-mpa"]
NORMAL_HPA = ["7", "nml-hpa"]
SWITCH_HPA_ON_PROC = ["0", "proc-hpa"]
SWITCH_ON = ["2", "on"]
SWITCH_OFF = ["3", "off"]
NORMAL_SSR = ["4", "nml-ssr"]
NORMAL_DRO = ["5", "nml-dro"]
NORMAL_X8 = ["6", "nml-x8"]
NORMAL_TX = ["7", "nml-tx"]
NORMAL_MPA = ["8", "nml-mpa"]
NORMAL_HPA = ["9", "nml-hpa"]
REQ_OS_HK = ["8", "hk-os"]
INJECT_SSR_TO_DRO_FAILURE = ["10", "inject-ssr-dro-fault"]
INJECT_DRO_TO_X8_FAILURE = ["11", "inject-dro-x8-fault"]
@ -33,15 +49,10 @@ class OpCodes:
INJECT_MPA_TO_HPA_FAILURE = ["14", "inject-mpa-hpa-fault"]
INJECT_ALL_ON_FAILURE = ["15", "inject-all-on-fault"]
# The following commands might become deprecated in the future
UPDATE_DRO_TO_X8_WAIT = ["128", "dro-to-x8-wait"]
UPDATE_X8_TO_TX_WAIT_TIME = ["129", "x8-to-tx-wait"]
UPDATE_TX_TO_MPA_WAIT_TIME = ["130", "tx-to-mpa-wait"]
UPDATE_MPA_TO_HPA_WAIT_TIME = ["131", "mpa-to-hpa-wait"]
class Info:
NORMAL = "PL PCDU ADC modules normal"
SWITCH_HPA_ON_PROC = "Switch HPA on procedure"
SWITCH_ON = "Switching PL PCDU on"
SWITCH_OFF = "Switching PL PCDU off"
NORMAL_SSR = f"{NORMAL}, SSR on"
@ -50,6 +61,11 @@ class Info:
NORMAL_TX = f"{NORMAL}, TX on"
NORMAL_MPA = f"{NORMAL}, MPA on"
NORMAL_HPA = f"{NORMAL}, HPA on"
REQ_OS_HK = "Request One Shot HK"
class SetIds(enum.IntEnum):
ADC = 0
class NormalSubmodesMask(enum.IntEnum):
@ -99,90 +115,229 @@ class ParamIds(enum.IntEnum):
INJECT_ALL_ON_FAILURE = 35
def pack_pl_pcdu_commands(tc_queue: TcQueueT, op_code: str):
@tmtc_definitions_provider
def add_pl_pcdu_cmds(defs: TmtcDefinitionWrapper):
oce = OpCodeEntry()
oce.add(keys=OpCodes.SWITCH_HPA_ON_PROC, info=Info.SWITCH_HPA_ON_PROC)
oce.add(keys=OpCodes.SWITCH_ON, info=Info.SWITCH_ON)
oce.add(keys=OpCodes.SWITCH_OFF, info=Info.SWITCH_OFF)
oce.add(keys=OpCodes.NORMAL_SSR, info=Info.NORMAL_SSR)
oce.add(keys=OpCodes.NORMAL_DRO, info=Info.NORMAL_DRO)
oce.add(keys=OpCodes.NORMAL_X8, info=Info.NORMAL_X8)
oce.add(keys=OpCodes.NORMAL_TX, info=Info.NORMAL_TX)
oce.add(keys=OpCodes.NORMAL_MPA, info=Info.NORMAL_MPA)
oce.add(keys=OpCodes.NORMAL_HPA, info=Info.NORMAL_HPA)
oce.add(keys=OpCodes.REQ_OS_HK, info=Info.REQ_OS_HK)
oce.add(
keys=OpCodes.INJECT_SSR_TO_DRO_FAILURE,
info="Inject failure SSR to DRO transition",
)
oce.add(
keys=OpCodes.INJECT_DRO_TO_X8_FAILURE,
info="Inject failure in DRO to X8 transition",
)
oce.add(
keys=OpCodes.INJECT_X8_TO_TX_FAILURE,
info="Inject failure in X8 to TX transition",
)
oce.add(
keys=OpCodes.INJECT_TX_TO_MPA_FAILURE,
info="Inject failure in TX to MPA transition",
)
oce.add(
keys=OpCodes.INJECT_MPA_TO_HPA_FAILURE,
info="Inject failure in MPA to HPA transition",
)
oce.add(keys=OpCodes.INJECT_ALL_ON_FAILURE, info="Inject failure in all on mode")
defs.add_service(CustomServiceList.PL_PCDU.value, "PL PCDU", oce)
def pack_pl_pcdu_commands(q: DefaultPusQueueHelper, op_code: str):
if op_code in OpCodes.SWITCH_ON:
pack_pl_pcdu_mode_cmd(
tc_queue=tc_queue, info=Info.SWITCH_ON, mode=Modes.ON, submode=0
)
pack_pl_pcdu_mode_cmd(q=q, info=Info.SWITCH_ON, mode=Modes.ON, submode=0)
if op_code in OpCodes.SWITCH_OFF:
pack_pl_pcdu_mode_cmd(
tc_queue=tc_queue, info=Info.SWITCH_OFF, mode=Modes.OFF, submode=0
)
pack_pl_pcdu_mode_cmd(q=q, info=Info.SWITCH_OFF, mode=Modes.OFF, submode=0)
if op_code in OpCodes.NORMAL_SSR:
pack_pl_pcdu_mode_cmd(
tc_queue=tc_queue,
q=q,
info=Info.NORMAL_SSR,
mode=Modes.NORMAL,
submode=(1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON),
submode=submode_mask_to_submode(
NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON
),
)
if op_code in OpCodes.NORMAL_DRO:
pack_pl_pcdu_mode_cmd(
tc_queue=tc_queue,
q=q,
info=Info.NORMAL_DRO,
mode=Modes.NORMAL,
submode=(
1 << NormalSubmodesMask.DRO_ON
| (1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON)
),
submode=submode_mask_to_submode(NormalSubmodesMask.DRO_ON),
)
if op_code in OpCodes.NORMAL_X8:
pack_pl_pcdu_mode_cmd(
tc_queue=tc_queue,
q=q,
info=Info.NORMAL_X8,
mode=Modes.NORMAL,
submode=(
1 << NormalSubmodesMask.DRO_ON
| (1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON)
| (1 << NormalSubmodesMask.X8_ON)
),
submode=submode_mask_to_submode(NormalSubmodesMask.X8_ON),
)
if op_code in OpCodes.NORMAL_TX:
pack_pl_pcdu_mode_cmd(
tc_queue=tc_queue,
q=q,
info=Info.NORMAL_TX,
mode=Modes.NORMAL,
submode=(
1 << NormalSubmodesMask.DRO_ON
| (1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON)
| (1 << NormalSubmodesMask.X8_ON)
| (1 << NormalSubmodesMask.TX_ON)
),
submode=submode_mask_to_submode(NormalSubmodesMask.TX_ON),
)
if op_code in OpCodes.NORMAL_MPA:
pack_pl_pcdu_mode_cmd(
tc_queue=tc_queue,
q=q,
info=Info.NORMAL_MPA,
mode=Modes.NORMAL,
submode=(
1 << NormalSubmodesMask.DRO_ON
| (1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON)
| (1 << NormalSubmodesMask.X8_ON)
| (1 << NormalSubmodesMask.TX_ON)
| (1 << NormalSubmodesMask.MPA_ON)
),
submode=submode_mask_to_submode(NormalSubmodesMask.MPA_ON),
)
if op_code in OpCodes.NORMAL_HPA:
pack_pl_pcdu_mode_cmd(
tc_queue=tc_queue,
q=q,
info=Info.NORMAL_HPA,
mode=Modes.NORMAL,
submode=(
1 << NormalSubmodesMask.DRO_ON
| (1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON)
| (1 << NormalSubmodesMask.X8_ON)
| (1 << NormalSubmodesMask.TX_ON)
| (1 << NormalSubmodesMask.MPA_ON)
| (1 << NormalSubmodesMask.HPA_ON)
),
submode=submode_mask_to_submode(NormalSubmodesMask.HPA_ON),
)
if op_code in OpCodes.REQ_OS_HK:
q.add_log_cmd(f"PL PCDU: {Info.REQ_OS_HK}")
q.add_pus_tc(
generate_one_diag_command(
sid=make_sid(object_id=PL_PCDU_ID, set_id=SetIds.ADC)
)
)
if op_code in OpCodes.SWITCH_HPA_ON_PROC:
hpa_on_procedure(q)
if op_code in OpCodes.INJECT_ALL_ON_FAILURE:
pack_failure_injection_cmd(
tc_queue=tc_queue,
q=q,
param_id=ParamIds.INJECT_ALL_ON_FAILURE,
print_str="All On",
)
def hpa_on_procedure(q: DefaultPusQueueHelper):
delay_dro_to_x8 = request_wait_time()
if delay_dro_to_x8 is None:
delay_dro_to_x8 = 900
q.add_log_cmd(
f"Starting procedure to switch on PL PCDU HPA with DRO to X8 "
f"delay of {delay_dro_to_x8} seconds"
)
pl_pcdu_on = PusTelecommand(
service=200,
subservice=Subservices.TC_MODE_COMMAND,
app_data=pack_mode_data(object_id=PL_PCDU_ID, mode=Modes.ON, submode=0),
)
ssr_on = PusTelecommand(
service=200,
subservice=Subservices.TC_MODE_COMMAND,
app_data=pack_mode_data(
object_id=PL_PCDU_ID,
mode=Modes.NORMAL,
submode=submode_mask_to_submode(
NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON
),
),
)
dro_on = PusTelecommand(
service=200,
subservice=Subservices.TC_MODE_COMMAND,
app_data=pack_mode_data(
object_id=PL_PCDU_ID,
mode=Modes.NORMAL,
submode=submode_mask_to_submode(NormalSubmodesMask.DRO_ON),
),
)
x8_on = PusTelecommand(
service=200,
subservice=Subservices.TC_MODE_COMMAND,
app_data=pack_mode_data(
object_id=PL_PCDU_ID,
mode=Modes.NORMAL,
submode=submode_mask_to_submode(NormalSubmodesMask.X8_ON),
),
)
tx_on = PusTelecommand(
service=200,
subservice=Subservices.TC_MODE_COMMAND,
app_data=pack_mode_data(
object_id=PL_PCDU_ID,
mode=Modes.NORMAL,
submode=submode_mask_to_submode(NormalSubmodesMask.TX_ON),
),
)
mpa_on = PusTelecommand(
service=200,
subservice=Subservices.TC_MODE_COMMAND,
app_data=pack_mode_data(
object_id=PL_PCDU_ID,
mode=Modes.NORMAL,
submode=submode_mask_to_submode(NormalSubmodesMask.MPA_ON),
),
)
hpa_on = PusTelecommand(
service=200,
subservice=Subservices.TC_MODE_COMMAND,
app_data=pack_mode_data(
object_id=PL_PCDU_ID,
mode=Modes.NORMAL,
submode=submode_mask_to_submode(NormalSubmodesMask.HPA_ON),
),
)
current_time = time.time()
enb_sched = generate_enable_tc_sched_cmd()
sched_time = int(round(current_time + 10))
q.add_pus_tc(enb_sched)
tagged_on_cmd = generate_time_tagged_cmd(
release_time=struct.pack("!I", sched_time),
tc_to_insert=pl_pcdu_on,
)
q.add_pus_tc(tagged_on_cmd)
sched_time += 5
tagged_ssr_cmd = generate_time_tagged_cmd(
release_time=struct.pack("!I", sched_time),
tc_to_insert=ssr_on,
)
q.add_pus_tc(tagged_ssr_cmd)
sched_time += 5
tagged_dro_cmd = generate_time_tagged_cmd(
release_time=struct.pack("!I", sched_time), tc_to_insert=dro_on
)
q.add_pus_tc(tagged_dro_cmd)
sched_time += delay_dro_to_x8
sched_time = int(round(sched_time))
tagged_x8_cmd = generate_time_tagged_cmd(
release_time=struct.pack("!I", sched_time), tc_to_insert=x8_on
)
q.add_pus_tc(tagged_x8_cmd)
sched_time += 5
tagged_tx_cmd = generate_time_tagged_cmd(
release_time=struct.pack("!I", sched_time), tc_to_insert=tx_on
)
q.add_pus_tc(tagged_tx_cmd)
sched_time += 5
tagged_mpa_cmd = generate_time_tagged_cmd(
release_time=struct.pack("!I", sched_time), tc_to_insert=mpa_on
)
q.add_pus_tc(tagged_mpa_cmd)
sched_time += 5
tagged_hpa_cmd = generate_time_tagged_cmd(
release_time=struct.pack("!I", sched_time), tc_to_insert=hpa_on
)
q.add_pus_tc(tagged_hpa_cmd)
def request_wait_time() -> Optional[float]:
while True:
wait_time = input("Please enter DRO to X8 wait time in seconds, x to cancel: ")
@ -199,11 +354,48 @@ def request_wait_time() -> Optional[float]:
return wait_time
def pack_wait_time_cmd(tc_queue: TcQueueT, param_id: int, print_str: str):
wait_time = request_wait_time()
tc_queue.appendleft(
(QueueCommands.PRINT, f"Updating {print_str} wait time to {wait_time}")
def submode_mask_to_submode(on_tgt: NormalSubmodesMask) -> int:
if on_tgt == NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON:
return 1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON
if on_tgt == NormalSubmodesMask.DRO_ON:
return 1 << NormalSubmodesMask.DRO_ON | (
1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON
)
if on_tgt == NormalSubmodesMask.X8_ON:
return (
1 << NormalSubmodesMask.DRO_ON
| (1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON)
| (1 << NormalSubmodesMask.X8_ON)
)
if on_tgt == NormalSubmodesMask.TX_ON:
return (
1 << NormalSubmodesMask.DRO_ON
| (1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON)
| (1 << NormalSubmodesMask.X8_ON)
| (1 << NormalSubmodesMask.TX_ON)
)
if on_tgt == NormalSubmodesMask.MPA_ON:
return (
1 << NormalSubmodesMask.DRO_ON
| (1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON)
| (1 << NormalSubmodesMask.X8_ON)
| (1 << NormalSubmodesMask.TX_ON)
| (1 << NormalSubmodesMask.MPA_ON)
)
if on_tgt == NormalSubmodesMask.HPA_ON:
return (
1 << NormalSubmodesMask.DRO_ON
| (1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON)
| (1 << NormalSubmodesMask.X8_ON)
| (1 << NormalSubmodesMask.TX_ON)
| (1 << NormalSubmodesMask.MPA_ON)
| (1 << NormalSubmodesMask.HPA_ON)
)
def pack_wait_time_cmd(q: DefaultPusQueueHelper, param_id: int, print_str: str):
wait_time = request_wait_time()
q.add_log_cmd(f"Updating {print_str} wait time to {wait_time}")
if wait_time is None:
return
param_data = pack_scalar_double_param_app_data(
@ -212,28 +404,24 @@ def pack_wait_time_cmd(tc_queue: TcQueueT, param_id: int, print_str: str):
unique_id=param_id,
parameter=wait_time,
)
cmd = pack_fsfw_load_param_cmd(ssc=0, app_data=param_data)
tc_queue.appendleft(cmd.pack_command_tuple())
q.add_pus_tc(pack_fsfw_load_param_cmd(app_data=param_data))
def pack_failure_injection_cmd(tc_queue: TcQueueT, param_id: int, print_str: str):
tc_queue.appendleft((QueueCommands.PRINT, f"Inserting {print_str} error"))
def pack_failure_injection_cmd(q: DefaultPusQueueHelper, param_id: int, print_str: str):
q.add_log_cmd(f"Inserting {print_str} error")
param_data = pack_boolean_parameter_app_data(
object_id=PL_PCDU_ID, domain_id=0, unique_id=param_id, parameter=True
)
cmd = pack_fsfw_load_param_cmd(ssc=0, app_data=param_data)
tc_queue.appendleft(cmd.pack_command_tuple())
q.add_pus_tc(pack_fsfw_load_param_cmd(app_data=param_data))
def pack_pl_pcdu_mode_cmd(tc_queue: TcQueueT, info: str, mode: Modes, submode: int):
tc_queue.appendleft(
(
QueueCommands.PRINT,
info,
)
)
def pack_pl_pcdu_mode_cmd(
q: DefaultPusQueueHelper, info: str, mode: Modes, submode: int
):
q.add_log_cmd(info)
mode_data = pack_mode_data(object_id=PL_PCDU_ID, mode=mode, submode=submode)
mode_cmd = PusTelecommand(
service=200, subservice=Subservices.COMMAND_MODE_COMMAND, app_data=mode_data
q.add_pus_tc(
PusTelecommand(
service=200, subservice=Subservices.TC_MODE_COMMAND, app_data=mode_data
)
)
tc_queue.appendleft(mode_cmd.pack_command_tuple())

103
pus_tc/devs/power.py Normal file
View File

@ -0,0 +1,103 @@
from gomspace.gomspace_common import GsInfo
from pus_tc.devs.common_power import (
PowerOpCodes,
Pdu1InfoBase,
Pdu2InfoBase,
add_pdu1_common_defs,
add_pdu2_common_defs,
PowerInfo,
)
from config.definitions import CustomServiceList
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
from pus_tc.devs.p60dock import P60OpCodes, GomspaceOpCodes, P60Info
from pus_tc.devs.acu import add_acu_cmds
from tmtccmd.config.tmtc import tmtc_definitions_provider
@tmtc_definitions_provider
def add_p60_cmds(defs: TmtcDefinitionWrapper):
oce = OpCodeEntry()
oce.add(keys=P60OpCodes.STACK_3V3_ON, info=P60Info.STACK_3V3_ON)
oce.add(keys=P60OpCodes.STACK_3V3_OFF, info=P60Info.STACK_3V3_OFF)
oce.add(keys=P60OpCodes.STACK_5V_ON, info=P60Info.STACK_5V_ON)
oce.add(keys=P60OpCodes.STACK_5V_OFF, info=P60Info.STACK_5V_OFF)
oce.add(keys=GomspaceOpCodes.REQUEST_CORE_HK_ONCE, info=GsInfo.REQUEST_CORE_HK_ONCE)
oce.add(keys=GomspaceOpCodes.REQUEST_AUX_HK_ONCE, info=GsInfo.REQUEST_AUX_HK_ONCE)
oce.add(
keys=GomspaceOpCodes.PRINT_SWITCH_V_I,
info="P60 Dock: Print Switches, Voltages, Currents",
)
oce.add(keys=GomspaceOpCodes.PRINT_LATCHUPS, info="P60 Dock: Print Latchups")
oce.add(keys=P60OpCodes.TEST, info="P60 Tests")
defs.add_service(
name=CustomServiceList.P60DOCK.value, info="P60 Device", op_code_entry=oce
)
@tmtc_definitions_provider
def add_power_cmd_defs(defs: TmtcDefinitionWrapper):
oce = OpCodeEntry()
add_pdu1_common_defs(oce)
add_pdu2_common_defs(oce)
oce.add(keys=PowerOpCodes.INFO_ALL, info=PowerInfo.INFO_ALL)
oce.add(keys=PowerOpCodes.INFO_CORE, info=PowerInfo.INFO_CORE)
oce.add(keys=PowerOpCodes.INFO_AUX, info=PowerInfo.INFO_AUX)
defs.add_service(
name=CustomServiceList.POWER.value,
info="Power Subsystem",
op_code_entry=oce,
)
@tmtc_definitions_provider
def add_pdu1_cmds(defs: TmtcDefinitionWrapper):
oce = OpCodeEntry()
add_pdu1_common_defs(oce)
oce.add(keys=GomspaceOpCodes.REQUEST_CORE_HK_ONCE, info=GsInfo.REQUEST_CORE_HK_ONCE)
oce.add(keys=GomspaceOpCodes.REQUEST_AUX_HK_ONCE, info=GsInfo.REQUEST_AUX_HK_ONCE)
oce.add(
keys=GomspaceOpCodes.PRINT_SWITCH_V_I,
info="PDU1: Print Switches, Voltages, Currents",
)
oce.add(keys=GomspaceOpCodes.PRINT_LATCHUPS, info="PDU1: Print Latchups")
oce.add(keys=GomspaceOpCodes.SET_PARAM, info="Set parameter")
defs.add_service(
name=CustomServiceList.PDU1.value,
info="PDU1 Device",
op_code_entry=oce,
)
@tmtc_definitions_provider
def add_pdu2_cmds(defs: TmtcDefinitionWrapper):
oce = OpCodeEntry()
add_pdu2_common_defs(oce)
oce.add(
keys=GomspaceOpCodes.REQUEST_CORE_HK_ONCE,
info=GsInfo.REQUEST_CORE_HK_ONCE,
)
oce.add(
keys=GomspaceOpCodes.REQUEST_AUX_HK_ONCE,
info=GsInfo.REQUEST_AUX_HK_ONCE,
)
oce.add(
keys=GomspaceOpCodes.PRINT_SWITCH_V_I,
info="PDU2: Print Switches, Voltages, Currents",
)
oce.add(
keys=GomspaceOpCodes.PRINT_LATCHUPS,
info="PDU2: Print Latchups",
)
defs.add_service(
name="pdu2",
info="PDU2 Device",
op_code_entry=oce,
)
def add_pcdu_cmds(defs: TmtcDefinitionWrapper):
add_p60_cmds(defs)
add_pdu1_cmds(defs)
add_pdu2_cmds(defs)
add_acu_cmds(defs)

View File

@ -7,11 +7,37 @@
"""
import struct
from tmtccmd.config.definitions import QueueCommands
from config.definitions import CustomServiceList
from tmtccmd.tc.packer import TcQueueT
from spacepackets.ecss.tc import PusTelecommand
from pus_tc.service_200_mode import pack_mode_data
from pus_tc.service_200_mode import pack_mode_data, Modes
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
from tmtccmd.config.tmtc import tmtc_definitions_provider
from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.tc.pus_3_fsfw_hk import generate_one_hk_command, make_sid
from tmtccmd.util import ObjectIdU32
class SetIds:
HK = 3
class OpCodes:
ON = ["0", "on"]
NORMAL = ["1", "normal"]
OFF = ["2", "off"]
REQ_HK_ONCE = ["3", "hk-os"]
DEBUG_ON = ["10", "dbg-on"]
DEBUG_OFF = ["11", "dbg-off"]
class Info:
ON = "Switch Rad Sensor on"
NORMAL = "Switch Rad Sensor normal"
OFF = "Switch Rad sensor off"
REQ_OS_HK = "Request one-shot HK"
DEBUG_ON = "Switch debug output on"
DEBUG_OFF = "Switch debug output off"
class CommandIds:
@ -21,52 +47,53 @@ class CommandIds:
DISABLE_DEBUG_OUTPUT = 5
def pack_rad_sensor_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
tc_queue.appendleft(
(
QueueCommands.PRINT,
"Testing radiation sensor handler with object id: 0x" + object_id.hex(),
)
@tmtc_definitions_provider
def add_rad_sens_cmds(defs: TmtcDefinitionWrapper):
oce = OpCodeEntry()
oce.add(info=Info.ON, keys=OpCodes.ON)
oce.add(info=Info.OFF, keys=OpCodes.OFF)
oce.add(info=Info.NORMAL, keys=OpCodes.NORMAL)
oce.add(info=Info.REQ_OS_HK, keys=OpCodes.REQ_HK_ONCE)
oce.add(info=Info.DEBUG_ON, keys=OpCodes.DEBUG_ON)
oce.add(info=Info.DEBUG_OFF, keys=OpCodes.DEBUG_OFF)
defs.add_service(
name=CustomServiceList.RAD_SENSOR.value,
info="Radiation Sensor",
op_code_entry=oce,
)
if op_code == "0":
tc_queue.appendleft((QueueCommands.PRINT, "Rad sensor: Switch to mode on"))
mode_data = pack_mode_data(object_id, 1, 0)
command = PusTelecommand(service=200, subservice=1, ssc=41, app_data=mode_data)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "1":
tc_queue.appendleft((QueueCommands.PRINT, "Rad sensor: Switch to mode normal"))
mode_data = pack_mode_data(object_id, 2, 0)
command = PusTelecommand(service=200, subservice=1, ssc=42, app_data=mode_data)
tc_queue.appendleft(command.pack_command_tuple())
def pack_rad_sensor_test_into(
object_id: ObjectIdU32, q: DefaultPusQueueHelper, op_code: str
):
q.add_log_cmd(f"Commanding Radiation sensor handler {object_id}")
if op_code == "2":
tc_queue.appendleft((QueueCommands.PRINT, "Rad sensor: Switch to mode off"))
mode_data = pack_mode_data(object_id, 0, 0)
command = PusTelecommand(service=200, subservice=1, ssc=42, app_data=mode_data)
tc_queue.appendleft(command.pack_command_tuple())
if op_code in OpCodes.ON:
rad_sensor_mode_cmd(object_id, Modes.ON, Info.ON, q)
if op_code in OpCodes.NORMAL:
rad_sensor_mode_cmd(object_id, Modes.NORMAL, Info.NORMAL, q)
if op_code in OpCodes.OFF:
rad_sensor_mode_cmd(object_id, Modes.OFF, Info.OFF, q)
if op_code in OpCodes.REQ_HK_ONCE:
q.add_log_cmd(f"Rad sensor: {Info.REQ_OS_HK}")
q.add_pus_tc(
generate_one_hk_command(sid=make_sid(object_id.as_bytes, set_id=SetIds.HK))
)
if op_code in OpCodes.DEBUG_ON:
q.add_log_cmd(f"Rad sensor: {Info.DEBUG_ON}")
command = object_id.as_bytes + struct.pack("!I", CommandIds.ENABLE_DEBUG_OUTPUT)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code in OpCodes.DEBUG_OFF:
q.add_log_cmd(f"Rad sensor: {Info.DEBUG_OFF}")
command = object_id.as_bytes + struct.pack(
"!I", CommandIds.DISABLE_DEBUG_OUTPUT
)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if op_code == "3":
tc_queue.appendleft((QueueCommands.PRINT, "Rad sensor: Start conversions"))
command = object_id + struct.pack("!I", CommandIds.START_CONVERSIONS)
command = PusTelecommand(service=8, subservice=128, ssc=43, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "4":
tc_queue.appendleft((QueueCommands.PRINT, "Rad sensor: Read conversions"))
command = object_id + struct.pack("!I", CommandIds.READ_CONVERSIONS)
command = PusTelecommand(service=8, subservice=128, ssc=44, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "5":
tc_queue.appendleft((QueueCommands.PRINT, "Rad sensor: Enable debug output"))
command = object_id + struct.pack("!I", CommandIds.ENABLE_DEBUG_OUTPUT)
command = PusTelecommand(service=8, subservice=128, ssc=45, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "6":
tc_queue.appendleft((QueueCommands.PRINT, "Rad sensor: Disable debug output"))
command = object_id + struct.pack("!I", CommandIds.DISABLE_DEBUG_OUTPUT)
command = PusTelecommand(service=8, subservice=128, ssc=45, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
def rad_sensor_mode_cmd(
object_id: ObjectIdU32, mode: Modes, info: str, q: DefaultPusQueueHelper
):
q.add_log_cmd(f"Rad sensor: {info}")
mode_data = pack_mode_data(object_id.as_bytes, mode, 0)
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=mode_data))

View File

@ -1,21 +1,59 @@
# -*- coding: utf-8 -*-
"""
@file reaction_wheels.py
"""reaction_wheels.py
@brief Tests for the reaction wheel handler
@author J. Meier
@date 20.06.2021
"""
import struct
from tmtccmd.config.definitions import QueueCommands
from tmtccmd.tc.packer import TcQueueT
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
from tmtccmd.config.tmtc import tmtc_definitions_provider
from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.tc.pus_3_fsfw_hk import (
generate_one_hk_command,
generate_one_diag_command,
make_sid,
)
from spacepackets.ecss.tc import PusTelecommand
from pus_tc.service_200_mode import pack_mode_data
from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Modes, Subservices
from config.definitions import CustomServiceList
class OpCodesDevs:
SPEED = ["0", "speed"]
ON = ["1", "on"]
NML = ["2", "nml"]
OFF = ["3", "off"]
GET_STATUS = ["4", "status"]
GET_TM = ["5", "tm"]
class InfoDevs:
SPEED = "Set speed"
ON = "Set On"
NML = "Set Normal"
OFF = "Set Off"
GET_STATUS = "Get Status HK"
GET_TM = "Get TM HK"
class OpCodesAss:
ON = ["0", "on"]
NML = ["1", "nml"]
OFF = ["2", "off"]
class InfoAss:
ON = "Mode On: 3/4 RWs min. on"
NML = "Mode Normal: 3/4 RWs min. normal"
OFF = "Mode Off: All RWs off"
class RwSetIds:
STATUS_SET_ID = 4
TEMPERATURE_SET_ID = 8
LAST_RESET = 2
TM_SET = 9
class RwCommandIds:
@ -38,66 +76,144 @@ class RampTime:
MS_1000 = 1000
def pack_single_rw_test_into(
object_id: bytearray, tc_queue: TcQueueT, op_code: str
) -> TcQueueT:
tc_queue.appendleft(
(
QueueCommands.PRINT,
"Testing reaction wheel handler with object id: 0x" + object_id.hex(),
@tmtc_definitions_provider
def add_rw_cmds(defs: TmtcDefinitionWrapper):
oce = OpCodeEntry()
oce.add(info=InfoDevs.SPEED, keys=OpCodesDevs.SPEED)
oce.add(info=InfoDevs.ON, keys=OpCodesDevs.ON)
oce.add(info=InfoDevs.OFF, keys=OpCodesDevs.OFF)
oce.add(info=InfoDevs.NML, keys=OpCodesDevs.NML)
oce.add(info=InfoDevs.GET_STATUS, keys=OpCodesDevs.GET_STATUS)
oce.add(info=InfoDevs.GET_TM, keys=OpCodesDevs.GET_TM)
defs.add_service(
name=CustomServiceList.REACTION_WHEEL_1.value,
info="Reaction Wheel 1",
op_code_entry=oce,
)
defs.add_service(
name=CustomServiceList.REACTION_WHEEL_2.value,
info="Reaction Wheel 2",
op_code_entry=oce,
)
defs.add_service(
name=CustomServiceList.REACTION_WHEEL_3.value,
info="Reaction Wheel 3",
op_code_entry=oce,
)
defs.add_service(
name=CustomServiceList.REACTION_WHEEL_4.value,
info="Reaction Wheel 4",
op_code_entry=oce,
)
oce = OpCodeEntry()
oce.add(info=InfoAss.ON, keys=OpCodesAss.ON)
oce.add(info=InfoAss.NML, keys=OpCodesAss.NML)
oce.add(info=InfoAss.OFF, keys=OpCodesAss.OFF)
defs.add_service(
name=CustomServiceList.RW_ASSEMBLY.value,
info="Reaction Wheel Assembly",
op_code_entry=oce,
)
if op_code == "0" or op_code == "1":
def pack_single_rw_test_into(
object_id: bytes, rw_idx: int, q: DefaultPusQueueHelper, op_code: str
):
if op_code in OpCodesDevs.SPEED:
speed = int(input("Specify speed [0.1 RPM]: "))
ramp_time = int(input("Specify ramp time [ms]: "))
tc_queue.appendleft((QueueCommands.PRINT, "Reaction Wheel: Set speed"))
command = pack_set_speed_command(object_id, speed, ramp_time)
command = PusTelecommand(service=8, subservice=128, ssc=40, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
q.add_log_cmd(f"RW {rw_idx}: {InfoDevs.SPEED}")
q.add_pus_tc(pack_set_speed_command(object_id, speed, ramp_time))
if op_code == "2":
tc_queue.appendleft((QueueCommands.PRINT, "Reaction Wheel: Switch to mode on"))
mode_data = pack_mode_data(object_id, 1, 0)
command = PusTelecommand(service=200, subservice=1, ssc=41, app_data=mode_data)
tc_queue.appendleft(command.pack_command_tuple())
if op_code in OpCodesDevs.ON:
q.add_log_cmd(f"RW {rw_idx}: {InfoDevs.ON}")
mode_data = pack_mode_data(object_id, Modes.ON, 0)
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=mode_data))
if op_code == "3":
tc_queue.appendleft(
(QueueCommands.PRINT, "Reaction Wheel: Switch to mode normal")
if op_code in OpCodesDevs.NML:
q.add_log_cmd(f"RW {rw_idx}: {InfoDevs.NML}")
mode_data = pack_mode_data(object_id, Modes.NORMAL, 0)
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=mode_data))
if op_code in OpCodesDevs.OFF:
q.add_log_cmd(f"RW {rw_idx}: {InfoDevs.OFF}")
mode_data = pack_mode_data(object_id, Modes.OFF, 0)
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=mode_data))
if op_code in OpCodesDevs.GET_TM:
q.add_log_cmd(f"RW {rw_idx}: {InfoDevs.GET_TM}")
q.add_pus_tc(
generate_one_hk_command(
sid=make_sid(object_id=object_id, set_id=RwSetIds.TM_SET)
)
)
if op_code in OpCodesDevs.GET_STATUS:
q.add_log_cmd(f"RW {rw_idx}: {InfoDevs.GET_STATUS}")
q.add_pus_tc(
generate_one_diag_command(
sid=make_sid(object_id=object_id, set_id=RwSetIds.STATUS_SET_ID)
)
)
def pack_rw_ass_cmds(q: DefaultPusQueueHelper, object_id: bytes, op_code: str):
if op_code in OpCodesAss.OFF:
data = pack_mode_data(object_id=object_id, mode=Modes.OFF, submode=0)
q.add_pus_tc(
PusTelecommand(
service=200, subservice=Subservices.TC_MODE_COMMAND, app_data=data
)
)
if op_code in OpCodesAss.ON:
data = pack_mode_data(object_id=object_id, mode=Modes.ON, submode=0)
q.add_pus_tc(
PusTelecommand(
service=200, subservice=Subservices.TC_MODE_COMMAND, app_data=data
)
)
if op_code in OpCodesAss.NML:
data = pack_mode_data(object_id=object_id, mode=Modes.NORMAL, submode=0)
q.add_pus_tc(
PusTelecommand(
service=200, subservice=Subservices.TC_MODE_COMMAND, app_data=data
)
mode_data = pack_mode_data(object_id, 2, 0)
command = PusTelecommand(service=200, subservice=1, ssc=42, app_data=mode_data)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "4":
tc_queue.appendleft((QueueCommands.PRINT, "Reaction Wheel: Switch to mode off"))
mode_data = pack_mode_data(object_id, 0, 0)
command = PusTelecommand(service=200, subservice=1, ssc=43, app_data=mode_data)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "5":
tc_queue.appendleft(
(QueueCommands.PRINT, "Reaction Wheel: Send get-telemetry-command")
)
command = object_id + RwCommandIds.GET_TM
command = PusTelecommand(service=8, subservice=128, ssc=44, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
return tc_queue
def pack_set_speed_command(
object_id: bytearray, speed: int, ramp_time: int
) -> bytearray:
object_id: bytes, speed: int, ramp_time_ms: int
) -> PusTelecommand:
"""With this function a command is packed to set the speed of a reaction wheel
@param object_id The object id of the reaction wheel handler.
@param speed Valid speeds are [-65000, -1000] and [1000, 65000]. Values are specified in 0.1 * RPM
@param ramp_time The time after which the reaction wheel will reached the commanded speed. Valid times are
10 - 10000 ms
:param object_id: The object id of the reaction wheel handler.
:param speed: Valid speeds are [-65000, -1000] and [1000, 65000]. Values are
specified in 0.1 * RPM
:param ramp_time_ms: The time after which the reaction wheel will reach the commanded speed.
Valid times are 10 - 10000 ms
"""
if speed > 0:
if speed < 1000 or speed > 65000:
raise ValueError(
"Invalid RW speed specified. "
"Allowed range is [1000, 65000] 0.1 * RPM"
)
elif speed < 0:
if speed < -65000 or speed > -1000:
raise ValueError(
"Invalid RW speed specified. "
"Allowed range is [-65000, -1000] 0.1 * RPM"
)
else:
# Speed is 0
pass
if ramp_time_ms < 0 or (
ramp_time_ms > 0 and (ramp_time_ms > 10000 or ramp_time_ms < 10)
):
raise ValueError("Invalid Ramp Speed time. Allowed range is [10-10000] ms")
command_id = RwCommandIds.SET_SPEED
command = bytearray()
command = object_id + command_id
command += object_id + command_id
command = command + struct.pack("!i", speed)
command = command + ramp_time.to_bytes(length=2, byteorder="big")
command = command + ramp_time_ms.to_bytes(length=2, byteorder="big")
command = PusTelecommand(service=8, subservice=128, app_data=command)
return command

112
pus_tc/devs/rtd.py Normal file
View File

@ -0,0 +1,112 @@
from typing import Optional
from config.definitions import CustomServiceList
from pus_tc.devs.pdec_handler import CommandIds
from spacepackets.ecss import PusTelecommand
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
from tmtccmd.config.tmtc import tmtc_definitions_provider
from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.util import ObjectIdU32
from tmtccmd.tc.pus_200_fsfw_modes import Modes, pack_mode_data, Subservices
import config.object_ids as oids
from config.object_ids import get_object_ids
RTD_IDS = [
oids.RTD_0_PLOC_HSPD,
oids.RTD_1_PLOC_MISSIONBRD,
oids.RTD_2_4K_CAM,
oids.RTD_3_DAC_HSPD,
oids.RTD_4_STR,
oids.RTD_5_RW1_MX_MY,
oids.RTD_6_DRO,
oids.RTD_7_SCEX,
oids.RTD_8_X8,
oids.RTD_9_HPA,
oids.RTD_10_PL_TX,
oids.RTD_11_MPA,
oids.RTD_12_ACU,
oids.RTD_13_PLPCDU_HSPD,
oids.RTD_14_TCS_BRD,
oids.RTD_15_IMTQ,
]
class OpCodes:
ON = ["0", "on"]
OFF = ["1", "off"]
NORMAL = ["2", "normal"]
CONFIG_CMD = ["3", "Write config"]
class Info:
ON = "Switch handler on"
OFF = "Switch handler off"
NORMAL = "Switch handler normal"
WIRTE_CONFIG = "Write config"
@tmtc_definitions_provider
def specify_rtd_cmds(defs: TmtcDefinitionWrapper):
oce = OpCodeEntry()
oce.add(keys=OpCodes.ON, info=Info.ON)
oce.add(keys=OpCodes.NORMAL, info=Info.NORMAL)
oce.add(keys=OpCodes.OFF, info=Info.OFF)
defs.add_service(
name=CustomServiceList.RTD.value, info="RTD commands", op_code_entry=oce
)
def pack_rtd_commands(
op_code: str, object_id: Optional[ObjectIdU32], q: DefaultPusQueueHelper
):
if object_id is not None and object_id not in RTD_IDS:
print("Specified object ID not a valid RTD ID")
object_id = None
if object_id is None:
tgt_rtd_idx = prompt_rtd_idx()
object_id_dict = get_object_ids()
object_id = object_id_dict.get(RTD_IDS[tgt_rtd_idx])
if op_code in OpCodes.ON:
app_data = pack_mode_data(
object_id=object_id.as_bytes, mode=Modes.ON, submode=0
)
q.add_pus_tc(
PusTelecommand(
service=200, subservice=Subservices.TC_MODE_COMMAND, app_data=app_data
)
)
if op_code in OpCodes.NORMAL:
app_data = pack_mode_data(
object_id=object_id.as_bytes, mode=Modes.NORMAL, submode=0
)
q.add_pus_tc(
PusTelecommand(
service=200, subservice=Subservices.TC_MODE_COMMAND, app_data=app_data
)
)
if op_code in OpCodes.OFF:
app_data = pack_mode_data(
object_id=object_id.as_bytes, mode=Modes.OFF, submode=0
)
q.add_pus_tc(
PusTelecommand(
service=200, subservice=Subservices.TC_MODE_COMMAND, app_data=app_data
)
)
if op_code in OpCodes.CONFIG_CMD:
command = object_id.as_bytes + CommandIds.PRINT_CLCW
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
def prompt_rtd_idx():
while True:
rtd_idx = input("Please specify RTD index [0-15]: ")
if not rtd_idx.isdigit():
print("Invalid input")
continue
rtd_idx = int(rtd_idx)
if rtd_idx < 0 or rtd_idx > 15:
print("Invalid device index")
continue
return rtd_idx

181
pus_tc/devs/scex.py Normal file
View File

@ -0,0 +1,181 @@
import enum
import json
from config.definitions import CustomServiceList
from tmtccmd import DefaultProcedureInfo
from tmtccmd.config.tmtc import tmtc_definitions_provider
from tmtccmd.tc import DefaultPusQueueHelper, service_provider
from tmtccmd.tc.pus_8_funccmd import generate_action_command
from tmtccmd.config import OpCodeEntry, TmtcDefinitionWrapper
from config.object_ids import SCEX_HANDLER_ID
USE_SCEX_CONF_FILE = True
class OpCodes:
PING = ["0", "ping"]
ION_CMD = ["1", "ion"]
TEMP_CMD = ["2", "temp"]
EXP_STATUS_CMD = ["3", "expstatus"]
ONE_CELLS_CMD = ["4", "onecell"]
ALL_CELLS_CMD = ["5", "allcells"]
FRAM = ["6", "fram"]
class ActionIds(enum.IntEnum):
PING = 7
ION_CMD = 4
TEMP_CMD = 3
EXP_STATUS_CMD = 2
ONE_CELLS_CMD = 6
ALL_CELLS_CMD = 5
FRAM = 1
class Info:
PING = "Send Ping command"
ION_CMD = "Read Ion"
TEMP_CMD = "Read Temperature"
EXP_STATUS_CMD = "Read Experiment Status"
ONE_CELLS_CMD = "One Cell"
ALL_CELLS_CMD = "All Cells"
FRAM = "Read FRAM"
@tmtc_definitions_provider
def add_scex_cmds(defs: TmtcDefinitionWrapper):
oce = OpCodeEntry()
oce.add(keys=OpCodes.PING, info=Info.PING)
oce.add(keys=OpCodes.ION_CMD, info=Info.ION_CMD)
oce.add(keys=OpCodes.TEMP_CMD, info=Info.TEMP_CMD)
oce.add(keys=OpCodes.EXP_STATUS_CMD, info=Info.EXP_STATUS_CMD)
oce.add(keys=OpCodes.ONE_CELLS_CMD, info=Info.ONE_CELLS_CMD)
oce.add(keys=OpCodes.ALL_CELLS_CMD, info=Info.ALL_CELLS_CMD)
oce.add(keys=OpCodes.FRAM, info=Info.FRAM)
defs.add_service(
name=CustomServiceList.SCEX.value, info="SCEX Device", op_code_entry=oce
)
@service_provider(CustomServiceList.SCEX.value)
def pack_scex_cmds(_info: DefaultProcedureInfo, q: DefaultPusQueueHelper, op_code: str):
if op_code in OpCodes.PING:
q.add_log_cmd(Info.PING)
app_data = bytes([0])
q.add_pus_tc(generate_action_command(SCEX_HANDLER_ID, ActionIds.PING, app_data))
if op_code in OpCodes.ION_CMD:
q.add_log_cmd(Info.ION_CMD)
app_data = bytes([0])
q.add_pus_tc(
generate_action_command(SCEX_HANDLER_ID, ActionIds.ION_CMD, app_data)
)
if op_code in OpCodes.TEMP_CMD:
q.add_log_cmd(Info.TEMP_CMD)
app_data = bytes([0])
q.add_pus_tc(
generate_action_command(SCEX_HANDLER_ID, ActionIds.TEMP_CMD, app_data)
)
if op_code in OpCodes.EXP_STATUS_CMD:
q.add_log_cmd(Info.EXP_STATUS_CMD)
app_data = bytes([0])
q.add_pus_tc(
generate_action_command(SCEX_HANDLER_ID, ActionIds.EXP_STATUS_CMD, app_data)
)
# one cell
if op_code in OpCodes.ONE_CELLS_CMD:
q.add_log_cmd(Info.ONE_CELLS_CMD)
app_data = bytearray()
# cell number
cn = 0
while True:
cell_select = input("Which solar cell should be measured? (1-10): ")
if not cell_select.isdigit():
print("Invalid cell number. Try again.")
continue
cell_select = int(cell_select)
if cell_select < 1 or cell_select > 10:
print(
f"Invalid cell number {cell_select}, "
f"Please enter a valid number: "
)
continue
cn = cell_select - 1
break
if USE_SCEX_CONF_FILE:
with open("template/scex_conf.json") as json_file:
json_data = json.load(json_file)
first_dac = json_data["first_dac"]
last_dac = json_data["last_dac"]
res_switch1 = json_data["res_switch1"]
res_switch2 = json_data["res_switch2"]
dac_weight1 = json_data["dac_weight1"]
dac_weight2 = json_data["dac_weight2"]
dac_weight3 = json_data["dac_weight3"]
# in app_data
# app_data.extend(struct.pack("!H", first_dac))
append_16_bit_val(packet=app_data, val=first_dac[cn])
append_16_bit_val(packet=app_data, val=last_dac[cn])
append_16_bit_val(packet=app_data, val=res_switch1[cn])
append_16_bit_val(packet=app_data, val=res_switch2[cn])
app_data.append(dac_weight1[cn])
app_data.append(dac_weight2[cn])
app_data.append(dac_weight3[cn])
q.add_pus_tc(
generate_action_command(SCEX_HANDLER_ID, ActionIds.ONE_CELLS_CMD, app_data)
)
if op_code in OpCodes.ALL_CELLS_CMD:
q.add_log_cmd(Info.ALL_CELLS_CMD)
app_data = bytearray()
# cell number
cn = 0
if USE_SCEX_CONF_FILE:
with open("template/scex_conf.json") as json_file:
json_data = json.load(json_file)
first_dac = json_data["first_dac"]
last_dac = json_data["last_dac"]
res_switch1 = json_data["res_switch1"]
res_switch2 = json_data["res_switch2"]
dac_weight1 = json_data["dac_weight1"]
dac_weight2 = json_data["dac_weight2"]
dac_weight3 = json_data["dac_weight3"]
# in app_data
# app_data.extend(struct.pack("!H", first_dac))
append_16_bit_val(packet=app_data, val=first_dac[cn])
append_16_bit_val(packet=app_data, val=last_dac[cn])
append_16_bit_val(packet=app_data, val=res_switch1[cn])
append_16_bit_val(packet=app_data, val=res_switch2[cn])
app_data.append(dac_weight1[cn])
app_data.append(dac_weight2[cn])
app_data.append(dac_weight3[cn])
q.add_pus_tc(
generate_action_command(SCEX_HANDLER_ID, ActionIds.ALL_CELLS_CMD, app_data)
)
if op_code in OpCodes.FRAM:
q.add_log_cmd(Info.FRAM)
app_data = bytes([0])
q.add_pus_tc(generate_action_command(SCEX_HANDLER_ID, ActionIds.FRAM, app_data))
def append_16_bit_val(packet: bytearray, val: int):
packet.append((val >> 8) & 0xFF)
packet.append(val & 0xFF)

Some files were not shown because too many files have changed in this diff Show More