Compare commits
388 Commits
Author | SHA1 | Date | |
---|---|---|---|
c29689cc0a | |||
be80758c71 | |||
ee0baa15c2 | |||
eced453886 | |||
e3b66d52e2 | |||
286ec25445 | |||
b4b3f9aaff | |||
5f44fedc70 | |||
701f6efbee | |||
d6f9b269f8 | |||
b8f95ac015 | |||
c9d35df277 | |||
2a245b1714 | |||
bfc9b17f10 | |||
ce910ba63c | |||
634b0c728d | |||
f7ec8754e0 | |||
00989a20e6 | |||
58ed46e110 | |||
ae0217066b | |||
6cae7f742c | |||
46be9fa092 | |||
64a1ffa1f3 | |||
3ff95280e5 | |||
7259fc008a | |||
19a9faa443 | |||
e2de2e0212 | |||
8a23e8a96c | |||
38b8f2a02f | |||
210ec8805c | |||
37d3c44067 | |||
351bb7c475 | |||
cba2055c59 | |||
a1cbc3bc13 | |||
c3012cd7a4 | |||
048a0ea447 | |||
1bdfc40cdd | |||
b20921788e | |||
e4e0b882e5 | |||
ec4b681b2e | |||
363c93a7d3 | |||
5daf76d081 | |||
5bde637dcc | |||
acd53c1337 | |||
59d4096327 | |||
5df26aac0b | |||
b39f2851ca | |||
27b41c0a48 | |||
79e0838473 | |||
5662c78f7a | |||
ddc1becc66 | |||
dbe3110a96 | |||
04bbc45383 | |||
0795e7c279 | |||
aa733ed5ed | |||
44adf6cf1e | |||
81501b4ae6 | |||
851593a7bf | |||
d85501f43e | |||
f4038f9f70 | |||
f7d843131f | |||
04fca35012 | |||
da544ccb13 | |||
8b644ece5e | |||
3e087dc803 | |||
da18ebab77 | |||
ef349856d6 | |||
49bb59df7f | |||
e70480bc17 | |||
a257f2b707 | |||
74f639ab55 | |||
be71cb792e | |||
01e91bffcd | |||
708edeb458 | |||
c3c65d325e | |||
42aeb874c0 | |||
3f813d9381 | |||
8a00855798 | |||
6db60f9238 | |||
ec13c20325 | |||
1790ac6329 | |||
0131499a6a | |||
7ec3c51cce | |||
44b673dd26 | |||
ef36e65223 | |||
a439a51842 | |||
b0ab9cd79a | |||
1841dbd35d | |||
34e081f3c2 | |||
5b25f910ae | |||
55a6e98850 | |||
72e258308e | |||
a107506b88 | |||
ebf44e8b0e | |||
58b021c37f | |||
36695bbbb0 | |||
6c7c8731ee | |||
7a92bde177 | |||
aa01fe4401 | |||
81b3db694a | |||
b4604951b3 | |||
6a209e1a0b | |||
04ad0ec7d2 | |||
f42d9689e7 | |||
b4ee30e41b | |||
c8ad4ca67a | |||
445a88741f | |||
36fde832c8 | |||
86db4f5103 | |||
f5367ac381 | |||
e88bf7e937 | |||
1c3d67aa15 | |||
58a5c1850e | |||
f7e7f731d5 | |||
f12913d802 | |||
f75a1a13c9 | |||
aa238dbabb | |||
fbc755deda | |||
9c5d16fb7c | |||
83115d43af | |||
c37eb77da3 | |||
e6eee0d518 | |||
96c6feb746 | |||
66c3942afb | |||
0c9547eb3a | |||
931cbe26e6 | |||
095cf822ee | |||
1e44d81c47 | |||
1c0a8534f9 | |||
4b902ce01b | |||
ccafa89a92 | |||
ec16af0724 | |||
4b762328c5 | |||
3d939c42b6 | |||
4d18ececa3 | |||
b7a6291560 | |||
9fc90ba487 | |||
9edc21c674 | |||
41f1f4c99a | |||
575932f646 | |||
51bbeaa693 | |||
f30913b24b | |||
7f03dcb3a6 | |||
3586b541c1 | |||
e7cb7ca096 | |||
dd7a19d134 | |||
c9f5a5652e | |||
45bee6429e | |||
2698756b29 | |||
d36799448c | |||
ba69be6296 | |||
427efab44e | |||
4aa89e42ee | |||
ea1865bd45 | |||
4de3e7d107 | |||
4251b126b7 | |||
fe36485e85 | |||
9332fb8690 | |||
7186636d9c | |||
b54ffcedff | |||
7e36b387fe | |||
15e0861c4d | |||
623e1cc37e | |||
181e6d62ad | |||
8eae5a4278 | |||
648e0b7814 | |||
e884f397cd | |||
17a3ea24df | |||
2506d911de | |||
314071de1c | |||
bcaac870c1 | |||
b9de13ffe7 | |||
e033609177 | |||
580b381848 | |||
b3751004a6 | |||
c01f1d0191 | |||
ea1e440407 | |||
0943a7a998 | |||
85a3c936a4 | |||
1f7faef083 | |||
4237ed0d29 | |||
77f77489c2 | |||
2cb801dc97 | |||
b8e61b38b0 | |||
ff66dd5dd2 | |||
9e8dc4f1e2 | |||
881baf7a82 | |||
022551139c | |||
e15d3a0b7a | |||
da3f143a9b | |||
d9abd03fa9 | |||
d53e26b589 | |||
a6132dd4f8 | |||
3caaffc151 | |||
72de2d99ca | |||
ef4c0a9189 | |||
730acf5ebe | |||
ff651a7f7a | |||
fcb5e9b48c | |||
260a083091 | |||
9bd0783c57 | |||
2557662c4d | |||
084a51ee67 | |||
8ca85d4474 | |||
480e0f07e0 | |||
01337e38d6 | |||
2ba33309a7 | |||
817a89370a | |||
ca5fd6468c | |||
973bdeadd6 | |||
b008cc8392 | |||
dff2c1b041 | |||
b0bdb2208f | |||
bde8a29473 | |||
437be64a28 | |||
de50dcc7fc | |||
963f48120e | |||
476066a5ac | |||
73c8e95dce | |||
2beffdbb27 | |||
b185e94cb5 | |||
a6f669e974 | |||
ccc0096aa5 | |||
1d6002abcf | |||
79d900f57b | |||
66d788abf4 | |||
1272a5aa89 | |||
cff6661f5d | |||
1cdc06c4d2 | |||
5ee77ae9b8 | |||
8455490fe1 | |||
963e9b7a5b | |||
8162cf1508 | |||
a9efd5c86d | |||
86395ac6e7 | |||
78996b2ef6 | |||
85ed307b58 | |||
f89483e6ba | |||
0ebf044496 | |||
497cd16c81 | |||
893b1822e2 | |||
542e6ca48f | |||
b1f96d8a9d | |||
a45aa3410b | |||
619790e01a | |||
14c3f7acb4 | |||
1a9b44711a | |||
a7080fa275 | |||
1cd6f2a651 | |||
4b7529d5b7 | |||
052af605fd | |||
05ca9e37c3 | |||
aadbfb2594 | |||
1464b32e2d | |||
a125d502ec | |||
31ab2c6ac2 | |||
2c5bf6b378 | |||
b81f756e4b | |||
bf64181826 | |||
743670f656 | |||
8e20c2ab08 | |||
eb4143e6b5 | |||
a681850248 | |||
325d06ee85 | |||
bc02c9d607 | |||
fcce78b447 | |||
a648b7f76f | |||
8891908afa | |||
9d105ee97f | |||
6b7b07c340 | |||
dc7e6631f2 | |||
1c5149c2b1 | |||
1e25b08e40 | |||
fd6f366878 | |||
0584db4bb1 | |||
e62484ee80 | |||
91e11482f4 | |||
47a022b684 | |||
50a20cfdc2 | |||
c586257934 | |||
3bc19a387f | |||
e616614a04 | |||
bce981e1f3 | |||
985c032ebb | |||
418b51b413 | |||
a58229dcd5 | |||
78a634fb5f | |||
258c1074f1 | |||
9ec84a01a3 | |||
17b6422cf5 | |||
d86a85b06d | |||
b8af022487 | |||
7e460d05c3 | |||
0be25b10f3 | |||
510ba82fef | |||
bc4099c5bf | |||
4bf58da187 | |||
dd34a049d3 | |||
2e24f764a6 | |||
a4bf730b22 | |||
213e6709ac | |||
5e9f83cd68 | |||
72552c5090 | |||
0486751571 | |||
11ea4ad44e | |||
9c3a8e9ff2 | |||
6f8fe84d67 | |||
8bc51b293b | |||
b3f40b38fc | |||
0eb4d0fb26 | |||
7413a5db5f | |||
927508e65d | |||
79d6e15c55 | |||
f60228f521 | |||
aab5c28960 | |||
c7a19f7122 | |||
c5f99d80a2 | |||
fe833edc91 | |||
0a47c17fa6 | |||
d7efe7d864 | |||
f23ed26807 | |||
8d0a831229 | |||
4e127cb049 | |||
fd1534c168 | |||
bd3d5396da | |||
d8ba63c496 | |||
58b9a3cdaf | |||
d7c0f99a21 | |||
991d828e88 | |||
f263c2b9fe | |||
d41a59834c | |||
2b8fa356c9 | |||
a0b398d214 | |||
e939f2b934 | |||
168b662288 | |||
ecd16da2f4 | |||
3d1a4044fe | |||
981f4f0c3e | |||
443deb8556 | |||
16ebba3f5b | |||
76da8042a4 | |||
4ce67f5be4 | |||
83fefaefd5 | |||
a457b001a3 | |||
5de92a366a | |||
0ef234e837 | |||
af4e3ea574 | |||
8df865c8c1 | |||
ad53f3e9bb | |||
0cb9dbefca | |||
6d80ad7476 | |||
b1aaef90c7 | |||
60f977aa0c | |||
28983d387b | |||
1dd7fddef4 | |||
45470f8c05 | |||
c7da0103e8 | |||
edee0c1aa3 | |||
a3d9e83dc6 | |||
f2d3f8c68c | |||
8a30f669f0 | |||
ecb973c37f | |||
c995ca2dda | |||
259cd25b6e | |||
a966471fe5 | |||
9561dd2f14 | |||
a6c91640a1 | |||
98783a0981 | |||
ec8526314d | |||
19768cb1b1 | |||
9055281da4 | |||
091cf2dd63 | |||
5184912759 | |||
3a1c7c6288 | |||
5189b20b0e | |||
cdce2ba092 | |||
a0ca7e28a7 | |||
633bc406c7 | |||
abf4d694c7 | |||
2accfef011 | |||
aa25b40070 | |||
ab5cca85bf | |||
3c6b88cfcd | |||
39dc222068 | |||
b0f6551c0a | |||
a47925859b | |||
77e46c12ba | |||
df8f86ebd6 |
12
.gitignore
vendored
12
.gitignore
vendored
@ -1,10 +1,8 @@
|
||||
__pycache__
|
||||
/.idea
|
||||
/venv
|
||||
|
||||
log
|
||||
/gps_log.txt
|
||||
|
||||
.idea/*
|
||||
!.idea/runConfigurations
|
||||
|
||||
*.json
|
||||
|
||||
/venv
|
||||
/config/*.json
|
||||
tmtc_conf.json
|
||||
|
@ -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 ploc_supv -l -t 6" />
|
||||
<option name="PARAMETERS" value="-s ploc_supv -t 6" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<option name="EMULATE_TERMINAL" value="true" />
|
||||
<option name="MODULE_MODE" value="false" />
|
24
.run/Service 17.run.xml
Normal file
24
.run/Service 17.run.xml
Normal 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$/tmtccli.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>
|
24
.run/TV Test.run.xml
Normal file
24
.run/TV Test.run.xml
Normal 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$/tmtccli.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>
|
@ -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" />
|
24
.run/tmtcloop.run.xml
Normal file
24
.run/tmtcloop.run.xml
Normal 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>
|
53
CHANGELOG.md
Normal file
53
CHANGELOG.md
Normal file
@ -0,0 +1,53 @@
|
||||
Change Log
|
||||
=======
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/).
|
||||
|
||||
The [milestone](https://egit.irs.uni-stuttgart.de/eive/eive-obsw/milestones)
|
||||
list yields a list of all related PRs for each release.
|
||||
|
||||
# [unreleased]
|
||||
|
||||
# [v1.12.0]
|
||||
|
||||
- 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
|
||||
- Extended heater commands for more informative output which component is heated
|
||||
|
||||
See [milestones](https://egit.irs.uni-stuttgart.de/eive/eive-tmtc/milestones)
|
||||
and [releases](https://egit.irs.uni-stuttgart.de/eive/eive-tmtc/releases)
|
130
README.md
130
README.md
@ -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]
|
||||
```
|
||||
|
||||
|
@ -0,0 +1,6 @@
|
||||
SW_NAME = "eive"
|
||||
VERSION_MAJOR = 1
|
||||
VERSION_MINOR = 11
|
||||
VERSION_SUBMINOR = 0
|
||||
|
||||
__version__ = "1.11.0"
|
||||
|
@ -8,6 +8,7 @@ import enum
|
||||
|
||||
|
||||
PUS_APID = 0x65
|
||||
SPACE_PACKET_IDS = (0x08 << 8 | PUS_APID,)
|
||||
|
||||
|
||||
class CustomServiceList(enum.Enum):
|
||||
@ -27,14 +28,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"
|
||||
@ -45,3 +45,8 @@ class CustomServiceList(enum.Enum):
|
||||
ACS_ASS = "acs-ass"
|
||||
SUS_ASS = "sus-ass"
|
||||
TCS_ASS = "tcs-ass"
|
||||
TIME = "time"
|
||||
PROCEDURE = "proc"
|
||||
RTD = "rtd"
|
||||
TVTTESTPROCEDURE = "tvtestproc"
|
||||
CONTROLLERS = "controllers"
|
||||
|
@ -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,107 +76,133 @@
|
||||
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
|
||||
10800;0x2a30;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
|
||||
10801;0x2a31;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
|
||||
10802;0x2a32;SWITCHING_Q7S_DENIED;MEDIUM;;mission/devices/devicedefinitions/powerDefinitions.h
|
||||
10900;0x2a94;GPIO_PULL_HIGH_FAILED;LOW;;mission/devices/HeaterHandler.h
|
||||
10901;0x2a95;GPIO_PULL_LOW_FAILED;LOW;;mission/devices/HeaterHandler.h
|
||||
10902;0x2a96;SWITCH_ALREADY_ON;LOW;;mission/devices/HeaterHandler.h
|
||||
10903;0x2a97;SWITCH_ALREADY_OFF;LOW;;mission/devices/HeaterHandler.h
|
||||
10904;0x2a98;MAIN_SWITCH_TIMEOUT;LOW;;mission/devices/HeaterHandler.h
|
||||
11000;0x2af8;MAIN_SWITCH_ON_TIMEOUT;LOW;;mission/devices/SolarArrayDeploymentHandler.h
|
||||
11001;0x2af9;MAIN_SWITCH_OFF_TIMEOUT;LOW;;mission/devices/SolarArrayDeploymentHandler.h
|
||||
11002;0x2afa;DEPLOYMENT_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h
|
||||
11003;0x2afb;DEPL_SA1_GPIO_SWTICH_ON_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h
|
||||
11004;0x2afc;DEPL_SA2_GPIO_SWTICH_ON_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h
|
||||
11101;0x2b5d;MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC crc failure in telemetry packet;linux/devices/ploc/PlocMPSoCHandler.h
|
||||
11102;0x2b5e;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
|
||||
11103;0x2b5f;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
|
||||
11104;0x2b60;MPSOC_HANDLER_CRC_FAILURE;LOW;PLOC reply has invalid crc;linux/devices/ploc/PlocMPSoCHandler.h
|
||||
11105;0x2b61;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
|
||||
11201;0x2bc1;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
|
||||
11202;0x2bc2;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
|
||||
11203;0x2bc3;SELF_TEST_ADC_FAILURE;LOW;Get self test result returns failure in measurement of current and temperature. 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
|
||||
11204;0x2bc4;SELF_TEST_PWM_FAILURE;LOW;Get self test result returns PWM failure which concerns the coil actuation. 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
|
||||
11205;0x2bc5;SELF_TEST_TC_FAILURE;LOW;Get self test result returns TC failure (system 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
|
||||
11206;0x2bc6;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
|
||||
11207;0x2bc7;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
|
||||
11208;0x2bc8;INVALID_ERROR_BYTE;LOW;Received invalid error byte. This indicates an error of the communication link between IMTQ and OBC.;mission/devices/IMTQHandler.h
|
||||
11301;0x2c25;ERROR_STATE;HIGH;Reaction wheel signals an error state;mission/devices/RwHandler.h
|
||||
11401;0x2c89;BOOTING_FIRMWARE_FAILED;LOW;Failed to boot firmware;linux/devices/startracker/StarTrackerHandler.h
|
||||
11402;0x2c8a;BOOTING_BOOTLOADER_FAILED;LOW;Failed to boot star tracker into bootloader mode;linux/devices/startracker/StarTrackerHandler.h
|
||||
11501;0x2ced;SUPV_MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC supervisor crc failure in telemetry packet;linux/devices/ploc/PlocSupervisorHandler.h
|
||||
11502;0x2cee;SUPV_ACK_FAILURE;LOW;PLOC supervisor received acknowledgment failure report;linux/devices/ploc/PlocSupervisorHandler.h
|
||||
11503;0x2cef;SUPV_EXE_FAILURE;LOW;PLOC received execution failure report;linux/devices/ploc/PlocSupervisorHandler.h
|
||||
11504;0x2cf0;SUPV_CRC_FAILURE_EVENT;LOW;PLOC supervisor reply has invalid crc;linux/devices/ploc/PlocSupervisorHandler.h
|
||||
11600;0x2d50;SANITIZATION_FAILED;LOW;;bsp_q7s/memory/SdCardManager.h
|
||||
11601;0x2d51;MOUNTED_SD_CARD;INFO;;bsp_q7s/memory/SdCardManager.h
|
||||
11700;0x2db4;UPDATE_FILE_NOT_EXISTS;LOW;;linux/devices/ploc/PlocUpdater.h
|
||||
11701;0x2db5;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
|
||||
11702;0x2db6;UPDATE_AVAILABLE_FAILED;LOW;Supervisor handler replied action message indicating a command execution failure of the update available command;linux/devices/ploc/PlocUpdater.h
|
||||
11703;0x2db7;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
|
||||
11704;0x2db8;UPDATE_VERIFY_FAILED;LOW;Supervisor failed to execute the update verify command.;linux/devices/ploc/PlocUpdater.h
|
||||
11705;0x2db9;UPDATE_FINISHED;INFO;MPSoC update successful completed;linux/devices/ploc/PlocUpdater.h
|
||||
11800;0x2e18;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
|
||||
11801;0x2e19;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
|
||||
11802;0x2e1a;MRAM_DUMP_FINISHED;LOW;MRAM dump finished successfully;linux/devices/ploc/PlocMemoryDumper.h
|
||||
11901;0x2e7d;INVALID_TC_FRAME;HIGH;;linux/obc/PdecHandler.h
|
||||
11902;0x2e7e;INVALID_FAR;HIGH;Read invalid FAR from PDEC after startup;linux/obc/PdecHandler.h
|
||||
11903;0x2e7f;CARRIER_LOCK;INFO;Carrier lock detected;linux/obc/PdecHandler.h
|
||||
11904;0x2e80;BIT_LOCK_PDEC;INFO;Bit lock detected (data valid);linux/obc/PdecHandler.h
|
||||
12000;0x2ee0;IMAGE_UPLOAD_FAILED;LOW;Image upload failed;linux/devices/startracker/StrHelper.h
|
||||
12001;0x2ee1;IMAGE_DOWNLOAD_FAILED;LOW;Image download failed;linux/devices/startracker/StrHelper.h
|
||||
12002;0x2ee2;IMAGE_UPLOAD_SUCCESSFUL;LOW;Uploading image to star tracker was successfulop;linux/devices/startracker/StrHelper.h
|
||||
12003;0x2ee3;IMAGE_DOWNLOAD_SUCCESSFUL;LOW;Image download was successful;linux/devices/startracker/StrHelper.h
|
||||
12004;0x2ee4;FLASH_WRITE_SUCCESSFUL;LOW;Finished flash write procedure successfully;linux/devices/startracker/StrHelper.h
|
||||
12005;0x2ee5;FLASH_READ_SUCCESSFUL;LOW;Finished flash read procedure successfully;linux/devices/startracker/StrHelper.h
|
||||
12006;0x2ee6;FLASH_READ_FAILED;LOW;Flash read procedure failed;linux/devices/startracker/StrHelper.h
|
||||
12007;0x2ee7;FIRMWARE_UPDATE_SUCCESSFUL;LOW;Firmware update was successful;linux/devices/startracker/StrHelper.h
|
||||
12008;0x2ee8;FIRMWARE_UPDATE_FAILED;LOW;Firmware update failed;linux/devices/startracker/StrHelper.h
|
||||
12009;0x2ee9;STR_HELPER_READING_REPLY_FAILED;LOW;Failed to read communication interface reply data P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed;linux/devices/startracker/StrHelper.h
|
||||
12010;0x2eea;STR_HELPER_COM_ERROR;LOW;Unexpected stop of decoding sequence P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed;linux/devices/startracker/StrHelper.h
|
||||
12011;0x2eeb;STR_HELPER_NO_REPLY;LOW;Star tracker did not send replies (maybe device is powered off) P1: Position of upload or download packet for which no reply was sent;linux/devices/startracker/StrHelper.h
|
||||
12012;0x2eec;STR_HELPER_DEC_ERROR;LOW;Error during decoding of received reply occurred P1: Return value of decoding function P2: Position of upload/download packet, or address of flash write/read request;linux/devices/startracker/StrHelper.h
|
||||
12013;0x2eed;POSITION_MISMATCH;LOW;Position mismatch P1: The expected position and thus the position for which the image upload/download failed;linux/devices/startracker/StrHelper.h
|
||||
12014;0x2eee;STR_HELPER_FILE_NOT_EXISTS;LOW;Specified file does not exist P1: Internal state of str helper;linux/devices/startracker/StrHelper.h
|
||||
12015;0x2eef;STR_HELPER_SENDING_PACKET_FAILED;LOW;;linux/devices/startracker/StrHelper.h
|
||||
12016;0x2ef0;STR_HELPER_REQUESTING_MSG_FAILED;LOW;;linux/devices/startracker/StrHelper.h
|
||||
12100;0x2f44;MPSOC_FLASH_WRITE_FAILED;LOW;Flash write fails;linux/devices/ploc/PlocMPSoCHelper.h
|
||||
12101;0x2f45;MPSOC_FLASH_WRITE_SUCCESSFUL;LOW;Flash write successful;linux/devices/ploc/PlocMPSoCHelper.h
|
||||
12102;0x2f46;SENDING_COMMAND_FAILED;LOW;;linux/devices/ploc/PlocMPSoCHelper.h
|
||||
12103;0x2f47;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
|
||||
12104;0x2f48;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
|
||||
12105;0x2f49;MISSING_ACK;LOW;Did not receive acknowledgement report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux/devices/ploc/PlocMPSoCHelper.h
|
||||
12106;0x2f4a;MISSING_EXE;LOW;Did not receive execution report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux/devices/ploc/PlocMPSoCHelper.h
|
||||
12107;0x2f4b;ACK_FAILURE_REPORT;LOW;Received acknowledgement failure report P1: Internal state of MPSoC;linux/devices/ploc/PlocMPSoCHelper.h
|
||||
12108;0x2f4c;EXE_FAILURE_REPORT;LOW;Received execution failure report P1: Internal state of MPSoC;linux/devices/ploc/PlocMPSoCHelper.h
|
||||
12109;0x2f4d;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
|
||||
12110;0x2f4e;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
|
||||
12111;0x2f4f;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
|
||||
12200;0x2fa8;TRANSITION_BACK_TO_OFF;MEDIUM;Could not transition properly and went back to ALL OFF;mission/devices/PayloadPcduHandler.h
|
||||
12201;0x2fa9;NEG_V_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
|
||||
12202;0x2faa;U_DRO_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
|
||||
12203;0x2fab;I_DRO_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
|
||||
12204;0x2fac;U_X8_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
|
||||
12205;0x2fad;I_X8_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
|
||||
12206;0x2fae;U_TX_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
|
||||
12207;0x2faf;I_TX_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
|
||||
12208;0x2fb0;U_MPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
|
||||
12209;0x2fb1;I_MPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
|
||||
12210;0x2fb2;U_HPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
|
||||
12211;0x2fb3;I_HPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
|
||||
12300;0x300c;TRANSITION_OTHER_SIDE_FAILED;HIGH;;mission/system/AcsBoardAssembly.h
|
||||
12301;0x300d;NOT_ENOUGH_DEVICES_DUAL_MODE;HIGH;;mission/system/AcsBoardAssembly.h
|
||||
12302;0x300e;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;;mission/system/AcsBoardAssembly.h
|
||||
12303;0x300f;SIDE_SWITCH_TRANSITION_NOT_ALLOWED;LOW;Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination;mission/system/AcsBoardAssembly.h
|
||||
12400;0x3070;TRANSITION_OTHER_SIDE_FAILED;HIGH;;mission/system/SusAssembly.h
|
||||
12401;0x3071;NOT_ENOUGH_DEVICES_DUAL_MODE;HIGH;;mission/system/SusAssembly.h
|
||||
12402;0x3072;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;;mission/system/SusAssembly.h
|
||||
12403;0x3073;SIDE_SWITCH_TRANSITION_NOT_ALLOWED;LOW;Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination;mission/system/SusAssembly.h
|
||||
12500;0x30d4;CHILDREN_LOST_MODE;MEDIUM;;mission/system/TcsBoardAssembly.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
|
||||
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 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
|
||||
11401;0x2c89;GPIO_PULL_LOW_FAILED;LOW;;mission/devices/HeaterHandler.h
|
||||
11402;0x2c8a;HEATER_WENT_ON;INFO;;mission/devices/HeaterHandler.h
|
||||
11403;0x2c8b;HEATER_WENT_OFF;INFO;;mission/devices/HeaterHandler.h
|
||||
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
|
||||
11503;0x2cef;DEPL_SA1_GPIO_SWTICH_ON_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h
|
||||
11504;0x2cf0;DEPL_SA2_GPIO_SWTICH_ON_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h
|
||||
11601;0x2d51;MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC crc failure in telemetry packet;linux/devices/ploc/PlocMPSoCHandler.h
|
||||
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_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
|
||||
11703;0x2db7;SELF_TEST_ADC_FAILURE;LOW;Get self test result returns failure in measurement of current and temperature. 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
|
||||
11704;0x2db8;SELF_TEST_PWM_FAILURE;LOW;Get self test result returns PWM failure which concerns the coil actuation. 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
|
||||
11705;0x2db9;SELF_TEST_TC_FAILURE;LOW;Get self test result returns TC failure (system 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
|
||||
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/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 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
|
||||
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
|
||||
12401;0x3071;INVALID_TC_FRAME;HIGH;;linux/obc/PdecHandler.h
|
||||
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
|
||||
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
|
||||
12503;0x30d7;IMAGE_DOWNLOAD_SUCCESSFUL;LOW;Image download was successful;linux/devices/startracker/StrHelper.h
|
||||
12504;0x30d8;FLASH_WRITE_SUCCESSFUL;LOW;Finished flash write procedure successfully;linux/devices/startracker/StrHelper.h
|
||||
12505;0x30d9;FLASH_READ_SUCCESSFUL;LOW;Finished flash read procedure successfully;linux/devices/startracker/StrHelper.h
|
||||
12506;0x30da;FLASH_READ_FAILED;LOW;Flash read procedure failed;linux/devices/startracker/StrHelper.h
|
||||
12507;0x30db;FIRMWARE_UPDATE_SUCCESSFUL;LOW;Firmware update was successful;linux/devices/startracker/StrHelper.h
|
||||
12508;0x30dc;FIRMWARE_UPDATE_FAILED;LOW;Firmware update failed;linux/devices/startracker/StrHelper.h
|
||||
12509;0x30dd;STR_HELPER_READING_REPLY_FAILED;LOW;Failed to read communication interface reply data P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed;linux/devices/startracker/StrHelper.h
|
||||
12510;0x30de;STR_HELPER_COM_ERROR;LOW;Unexpected stop of decoding sequence P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed;linux/devices/startracker/StrHelper.h
|
||||
12511;0x30df;STR_HELPER_NO_REPLY;LOW;Star tracker did not send replies (maybe device is powered off) P1: Position of upload or download packet for which no reply was sent;linux/devices/startracker/StrHelper.h
|
||||
12512;0x30e0;STR_HELPER_DEC_ERROR;LOW;Error during decoding of received reply occurred P1: Return value of decoding function P2: Position of upload/download packet, or address of flash write/read request;linux/devices/startracker/StrHelper.h
|
||||
12513;0x30e1;POSITION_MISMATCH;LOW;Position mismatch P1: The expected position and thus the position for which the image upload/download failed;linux/devices/startracker/StrHelper.h
|
||||
12514;0x30e2;STR_HELPER_FILE_NOT_EXISTS;LOW;Specified file does not exist P1: Internal state of str helper;linux/devices/startracker/StrHelper.h
|
||||
12515;0x30e3;STR_HELPER_SENDING_PACKET_FAILED;LOW;;linux/devices/startracker/StrHelper.h
|
||||
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;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;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
|
||||
12702;0x319e;U_DRO_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
|
||||
12703;0x319f;I_DRO_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
|
||||
12704;0x31a0;U_X8_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
|
||||
12705;0x31a1;I_X8_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
|
||||
12706;0x31a2;U_TX_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
|
||||
12707;0x31a3;I_TX_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
|
||||
12708;0x31a4;U_MPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
|
||||
12709;0x31a5;I_MPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
|
||||
12710;0x31a6;U_HPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
|
||||
12711;0x31a7;I_HPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h
|
||||
12800;0x3200;TRANSITION_OTHER_SIDE_FAILED;HIGH;;mission/system/AcsBoardAssembly.h
|
||||
12801;0x3201;NOT_ENOUGH_DEVICES_DUAL_MODE;HIGH;;mission/system/AcsBoardAssembly.h
|
||||
12802;0x3202;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;;mission/system/AcsBoardAssembly.h
|
||||
12803;0x3203;SIDE_SWITCH_TRANSITION_NOT_ALLOWED;LOW;Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination;mission/system/AcsBoardAssembly.h
|
||||
12900;0x3264;TRANSITION_OTHER_SIDE_FAILED;HIGH;;mission/system/SusAssembly.h
|
||||
12901;0x3265;NOT_ENOUGH_DEVICES_DUAL_MODE;HIGH;;mission/system/SusAssembly.h
|
||||
12902;0x3266;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;;mission/system/SusAssembly.h
|
||||
12903;0x3267;SIDE_SWITCH_TRANSITION_NOT_ALLOWED;LOW;Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination;mission/system/SusAssembly.h
|
||||
13000;0x32c8;CHILDREN_LOST_MODE;MEDIUM;;mission/system/TcsBoardAssembly.h
|
||||
13100;0x332c;GPS_FIX_CHANGE;INFO;Fix has changed. P1: Old fix. P2: New fix 0: Not seen, 1: No Fix, 2: 2D-Fix, 3: 3D-Fix;mission/devices/devicedefinitions/GPSDefinitions.h
|
||||
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;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,23 +1,18 @@
|
||||
import argparse
|
||||
from typing import Union, Dict
|
||||
from typing import Union
|
||||
|
||||
from config.definitions import SPACE_PACKET_IDS
|
||||
from tmtccmd.config.definitions import (
|
||||
ServiceOpCodeDictT,
|
||||
HkReplyUnpacked,
|
||||
DataReplyUnpacked,
|
||||
)
|
||||
from tmtccmd.tm.service_3_base import Service3Base
|
||||
from tmtccmd.tc.definitions import TcQueueT
|
||||
from tmtccmd.utility.retval import RetvalDictT
|
||||
from tmtccmd.pus.obj_id import ObjectIdDictT
|
||||
from tmtccmd.utility.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 tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
|
||||
from tmtccmd.config.globals import OpCodeDictKeys
|
||||
|
||||
from config.definitions import CustomServiceList
|
||||
from config.retvals import get_retval_dict
|
||||
from pus_tc.cmd_definitions import get_eive_service_op_code_dict
|
||||
|
||||
|
||||
class EiveHookObject(TmTcHookBase):
|
||||
@ -25,11 +20,7 @@ class EiveHookObject(TmTcHookBase):
|
||||
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
|
||||
return get_eive_service_op_code_dict()
|
||||
|
||||
def assign_communication_interface(
|
||||
self, com_if_key: str
|
||||
@ -39,7 +30,7 @@ class EiveHookObject(TmTcHookBase):
|
||||
return create_communication_interface_default(
|
||||
com_if_key=com_if_key,
|
||||
json_cfg_path=self.json_cfg_path,
|
||||
space_packet_ids=(0x0865,),
|
||||
space_packet_ids=SPACE_PACKET_IDS,
|
||||
)
|
||||
|
||||
def perform_mode_operation(self, tmtc_backend: TmTcHandler, mode: int):
|
||||
@ -61,290 +52,3 @@ class EiveHookObject(TmTcHookBase):
|
||||
|
||||
def get_retval_dict(self) -> RetvalDictT:
|
||||
return get_retval_dict()
|
||||
|
||||
|
||||
def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
|
||||
from pus_tc.cmd_definitions import (
|
||||
add_bpx_cmd_definitions,
|
||||
add_core_controller_definitions,
|
||||
add_pcdu_cmds,
|
||||
add_pl_pcdu_cmds,
|
||||
add_imtq_cmds,
|
||||
add_rw_cmds,
|
||||
add_rad_sens_cmds,
|
||||
add_ploc_mpsoc_cmds,
|
||||
add_ploc_supv_cmds,
|
||||
add_system_cmds,
|
||||
)
|
||||
from pus_tc.devs.gps import GpsOpCodes
|
||||
|
||||
add_bpx_cmd_definitions(cmd_dict=service_op_code_dict)
|
||||
add_core_controller_definitions(cmd_dict=service_op_code_dict)
|
||||
add_pl_pcdu_cmds(cmd_dict=service_op_code_dict)
|
||||
add_pcdu_cmds(cmd_dict=service_op_code_dict)
|
||||
add_imtq_cmds(cmd_dict=service_op_code_dict)
|
||||
add_rad_sens_cmds(cmd_dict=service_op_code_dict)
|
||||
add_rw_cmds(cmd_dict=service_op_code_dict)
|
||||
add_ploc_mpsoc_cmds(cmd_dict=service_op_code_dict)
|
||||
add_ploc_supv_cmds(cmd_dict=service_op_code_dict)
|
||||
add_system_cmds(cmd_dict=service_op_code_dict)
|
||||
|
||||
op_code_dict = {
|
||||
GpsOpCodes.RESET_GNSS.value: ("Reset GPS", {OpCodeDictKeys.TIMEOUT: 2.0})
|
||||
}
|
||||
service_tuple = ("GPS 0", op_code_dict)
|
||||
service_op_code_dict[CustomServiceList.GPS_0.value] = service_tuple
|
||||
service_op_code_dict[CustomServiceList.GPS_1.value] = service_tuple
|
||||
|
||||
op_code_dict = {
|
||||
"0": ("ACU: Tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"51": ("ACU: Print channel statistics", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
}
|
||||
service_tuple = ("ACU Devices", op_code_dict)
|
||||
service_op_code_dict[CustomServiceList.ACU.value] = service_tuple
|
||||
|
||||
op_code_dict = {
|
||||
"0": ("TMP1075 Tests", {OpCodeDictKeys.TIMEOUT: 2.2}),
|
||||
}
|
||||
service_tuple = ("TMP1075 1", op_code_dict)
|
||||
service_op_code_dict[CustomServiceList.TMP1075_1.value] = service_tuple
|
||||
service_tuple = ("TMP1075 2", op_code_dict)
|
||||
service_op_code_dict[CustomServiceList.TMP1075_2.value] = service_tuple
|
||||
|
||||
op_code_dict_srv_heater = {
|
||||
"0": ("Heater Tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
}
|
||||
service_heater_tuple = ("Heater Device", op_code_dict_srv_heater)
|
||||
|
||||
op_code_dict_srv_star_tracker = {
|
||||
"0": (
|
||||
"Star Tracker: Mode On, Submode Bootloader",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"1": ("Star Tracker: Mode On, Submode Firmware", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"2": ("Star Tracker: Mode Normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"3": ("Star Tracker: Mode Off", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"4": ("Star Tracker: Mode Raw", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"5": ("Star Tracker: Ping", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"6": (
|
||||
"Star Tracker: Switch to bootloader program",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"7": ("Star Tracker: Request temperature", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"8": ("Star Tracker: Request version", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"9": ("Star Tracker: Request interface", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"10": ("Star Tracker: Request power", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"11": (
|
||||
"Star Tracker: Set subscription parameters",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"12": (
|
||||
"Star Tracker: Boot image (requires bootloader mode)",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"13": ("Star Tracker: Request time", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"14": ("Star Tracker: Request solution", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"15": ("Star Tracker: Upload image", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"16": ("Star Tracker: Download image", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"17": ("Star Tracker: Set limit parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"18": ("Star Tracker: Set tracking parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"19": ("Star Tracker: Set mounting parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"20": ("Star Tracker: Set camera parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"22": (
|
||||
"Star Tracker: Set centroiding parameters",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"23": ("Star Tracker: Set LISA parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"24": ("Star Tracker: Set matching parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"25": (
|
||||
"Star Tracker: Set validation parameters",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"26": ("Star Tracker: Set algo parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"27": ("Star Tracker: Take image", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"28": ("Star Tracker: Stop str helper", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"30": (
|
||||
"Star Tracker: Set name of download image",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"31": ("Star Tracker: Request histogram", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"32": ("Star Tracker: Request contrast", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"33": ("Star Tracker: Set json filename", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"35": ("Star Tracker: Flash read", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"36": ("Star Tracker: Set flash read filename", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"37": ("Star Tracker: Get checksum", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"49": ("Star Tracker: Request camera parameter", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"50": ("Star Tracker: Request limits", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"51": (
|
||||
"Star Tracker: Set image processor parameters",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"52": (
|
||||
"Star Tracker: (EGSE only) Load camera ground config ",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"53": (
|
||||
"Star Tracker: (EGSE only) Load camera flight config",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"54": (
|
||||
"Star Tracker: Request log level parameters",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"55": (
|
||||
"Star Tracker: Request mounting parameters",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"56": (
|
||||
"Star Tracker: Request image processor parameters",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"57": (
|
||||
"Star Tracker: Request centroiding parameters",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"58": ("Star Tracker: Request lisa parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"59": (
|
||||
"Star Tracker: Request matching parameters",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"60": (
|
||||
"Star Tracker: Request tracking parameters",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"61": (
|
||||
"Star Tracker: Request validation parameters",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"62": ("Star Tracker: Request algo parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"63": (
|
||||
"Star Tracker: Request subscription parameters",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"64": (
|
||||
"Star Tracker: Request log subscription parameters",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"65": (
|
||||
"Star Tracker: Request debug camera parameters",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"66": ("Star Tracker: Set log level parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"67": (
|
||||
"Star Tracker: Set log subscription parameters",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"68": (
|
||||
"Star Tracker: Set debug camera parameters",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"69": ("Star Tracker: Firmware update", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"70": (
|
||||
"Star Tracker: Disable timestamp generation",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"71": (
|
||||
"Star Tracker: Enable timestamp generation",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
}
|
||||
service_star_tracker_tuple = ("Star tracker", op_code_dict_srv_star_tracker)
|
||||
|
||||
op_code_dict_srv_ccsds_handler = {
|
||||
"0": ("CCSDS Handler: Set low rate", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"1": ("CCSDS Handler: Set high rate", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"2": ("CCSDS Handler: Enable transmitter", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"3": ("CCSDS Handler: Disable transmitter", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"4": ("CCSDS Handler: Set arbitrary bitrate", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"5": (
|
||||
"CCSDS Handler: Enable tx clock manipulator",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"6": (
|
||||
"CCSDS Handler: Disable tx clock manipulator",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"7": (
|
||||
"CCSDS Handler: Update tx data on rising edge",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"8": (
|
||||
"CCSDS Handler: Update tx data on falling edge",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
}
|
||||
service_ccsds_handler_tuple = ("CCSDS Handler", op_code_dict_srv_ccsds_handler)
|
||||
|
||||
op_code_dict_srv_pdec_handler = {
|
||||
"0": ("PDEC Handler: Print CLCW", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"1": ("PDEC Handler: Print PDEC monitor", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
}
|
||||
service_pdec_handler_tuple = ("PDEC Handler", op_code_dict_srv_pdec_handler)
|
||||
|
||||
op_code_dict_srv_syrlinks_handler = {
|
||||
"0": ("Syrlinks Handler: Set mode off", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"1": ("Syrlinks Handler: Set mode on", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"2": ("Syrlinks Handler: Set mode normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"3": ("Syrlinks Handler: Set TX standby", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"4": ("Syrlinks Handler: Set TX modulation", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"5": ("Syrlinks Handler: Set TX carrier wave", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"6": ("Syrlinks Handler: Read TX status", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"7": ("Syrlinks Handler: Read TX waveform", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"8": (
|
||||
"Syrlinks Handler: Read TX AGC value high byte ",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"9": (
|
||||
"Syrlinks Handler: Read TX AGC value low byte ",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"12": (
|
||||
"Syrlinks Handler: Write LCL config",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"13": (
|
||||
"Syrlinks Handler: Read RX status registers",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"14": (
|
||||
"Syrlinks Handler: Read LCL config register",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"15": (
|
||||
"Syrlinks Handler: Set waveform OQPSK",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"16": (
|
||||
"Syrlinks Handler: Set waveform BPSK",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"17": (
|
||||
"Syrlinks Handler: Set second config",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"18": (
|
||||
"Syrlinks Handler: Enable debug output",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"19": (
|
||||
"Syrlinks Handler: Disable debug output",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
}
|
||||
service_syrlinks_handler_tuple = (
|
||||
"Syrlinks Handler",
|
||||
op_code_dict_srv_syrlinks_handler,
|
||||
)
|
||||
service_op_code_dict[CustomServiceList.HEATER.value] = service_heater_tuple
|
||||
service_op_code_dict[
|
||||
CustomServiceList.STAR_TRACKER.value
|
||||
] = service_star_tracker_tuple
|
||||
service_op_code_dict[
|
||||
CustomServiceList.CCSDS_HANDLER.value
|
||||
] = service_ccsds_handler_tuple
|
||||
service_op_code_dict[
|
||||
CustomServiceList.PDEC_HANDLER.value
|
||||
] = service_pdec_handler_tuple
|
||||
service_op_code_dict[
|
||||
CustomServiceList.SYRLINKS.value
|
||||
] = service_syrlinks_handler_tuple
|
||||
|
@ -4,7 +4,7 @@
|
||||
it to your needs.
|
||||
"""
|
||||
import os.path
|
||||
from tmtccmd.pus.obj_id import ObjectIdDictT
|
||||
from tmtccmd.utility.obj_id import ObjectIdDictT
|
||||
from tmtccmd.fsfw import parse_fsfw_objects_csv
|
||||
from tmtccmd.logging import get_console_logger
|
||||
|
||||
@ -27,6 +27,7 @@ ACU_HANDLER_ID = bytes([0x44, 0x25, 0x00, 0x03])
|
||||
BPX_HANDLER_ID = bytes([0x44, 0x26, 0x00, 0x00])
|
||||
|
||||
# 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])
|
||||
@ -55,22 +55,77 @@ IMTQ_HANDLER_ID = bytes([0x44, 0x14, 0x00, 0x14])
|
||||
PUS_SERVICE_17_ID = bytes([0x53, 0x00, 0x00, 0x17])
|
||||
TEST_DEVICE_ID = bytes([0x54, 0x00, 0xAF, 0xFE])
|
||||
CCSDS_HANDLER_ID = bytes([0x50, 0x00, 0x08, 0x00])
|
||||
PDEC_HANDLER_ID = bytes([0x50, 0x00, 0x07, 0x04])
|
||||
PDEC_HANDLER_ID = bytes([0x50, 0x00, 0x07, 0x00])
|
||||
|
||||
# Payload Object IDs
|
||||
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])
|
||||
PL_PCDU_ID = bytes([0x44, 0x30, 0x00, 0x00])
|
||||
|
||||
# Other
|
||||
HEATER_0_OBC_BRD = bytes([0x60, 0x00, 0x00, 0x00])
|
||||
HEATER_1_PLOC_PROC_BRD = bytes([0x60, 0x00, 0x00, 0x01])
|
||||
HEATER_2_ACS_BRD = bytes([0x60, 0x00, 0x00, 0x02])
|
||||
HEATER_3_PCDU_BRD = bytes([0x60, 0x00, 0x00, 0x03])
|
||||
HEATER_4_CAMERA = bytes([0x60, 0x00, 0x00, 0x04])
|
||||
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])
|
||||
|
||||
|
||||
def get_object_ids() -> ObjectIdDictT:
|
||||
|
@ -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,13 +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_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
|
||||
|
|
File diff suppressed because it is too large
Load Diff
@ -1,6 +0,0 @@
|
||||
SW_NAME = "eive"
|
||||
VERSION_MAJOR = 1
|
||||
VERSION_MINOR = 9
|
||||
VERSION_SUBMINOR = 0
|
||||
|
||||
__version__ = "1.9.0"
|
@ -7,9 +7,11 @@
|
||||
@date 17.12.2020
|
||||
"""
|
||||
import enum
|
||||
import struct
|
||||
|
||||
from tmtccmd.tc.service_8_functional_cmd import generate_action_command
|
||||
from tmtccmd.tc.pus_8_funccmd import generate_action_command
|
||||
from tmtccmd.tc.definitions import PusTelecommand
|
||||
from tmtccmd.utility import ObjectId
|
||||
|
||||
|
||||
class GomspaceDeviceActionIds(enum.IntEnum):
|
||||
@ -25,16 +27,30 @@ class GomspaceDeviceActionIds(enum.IntEnum):
|
||||
|
||||
class GomspaceOpCodes:
|
||||
# Request HK
|
||||
REQUEST_HK_ONCE = ["req-hk-once", "128"]
|
||||
PRINT_SWITCH_V_I = ["print-switch-vi", "129"]
|
||||
PRINT_LATCHUPS = ["print-latchups", "130"]
|
||||
REQUEST_CORE_HK_ONCE = ["hk-core", "128"]
|
||||
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:
|
||||
REQUEST_CORE_HK_ONCE = "Requesting Core HK once"
|
||||
REQUEST_AUX_HK_ONCE = "Requesting Aux HK once"
|
||||
GET_PARAMETER = "Get parameter"
|
||||
SET_PARAMETER = "Set parameter"
|
||||
|
||||
|
||||
class SetIds:
|
||||
PDU_1 = 0x01
|
||||
PDU_2 = 0x02
|
||||
P60_DOCK = 0x03
|
||||
ACU = 0x04
|
||||
PDU_1_CORE = 1
|
||||
PDU_1_AUX = 2
|
||||
PDU_2_CORE = 3
|
||||
PDU_2_AUX = 4
|
||||
P60_CORE = 5
|
||||
P60_AUX = 6
|
||||
ACU_CORE = 7
|
||||
ACU_AUX = 8
|
||||
|
||||
|
||||
class TableIds:
|
||||
@ -58,7 +74,7 @@ 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: bytearray, 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.
|
||||
@ -67,10 +83,9 @@ def pack_get_param_command(
|
||||
@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)
|
||||
app_data += struct.pack('!H', memory_address)
|
||||
app_data += struct.pack('!B', parameter_size)
|
||||
return generate_action_command(
|
||||
object_id=object_id,
|
||||
action_id=GomspaceDeviceActionIds.PARAM_GET,
|
||||
@ -79,7 +94,7 @@ def pack_get_param_command(
|
||||
|
||||
|
||||
def pack_set_param_command(
|
||||
object_id: bytearray,
|
||||
object_id: bytes,
|
||||
memory_address: bytearray,
|
||||
parameter_size: int,
|
||||
parameter: int,
|
||||
@ -101,10 +116,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
|
||||
@ -119,7 +131,7 @@ def pack_set_param_command(
|
||||
)
|
||||
|
||||
|
||||
def pack_ping_command(object_id: bytearray, data: bytearray) -> PusTelecommand:
|
||||
def pack_ping_command(object_id: ObjectId, 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
|
||||
@ -128,33 +140,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: ObjectId) -> 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: ObjectId) -> 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: ObjectId) -> 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
|
||||
)
|
||||
|
@ -1,3 +1,4 @@
|
||||
from pus_tc.system.proc import add_proc_cmds
|
||||
from tmtccmd.config import (
|
||||
add_op_code_entry,
|
||||
add_service_op_code_entry,
|
||||
@ -5,9 +6,287 @@ from tmtccmd.config import (
|
||||
ServiceOpCodeDictT,
|
||||
OpCodeDictKeys,
|
||||
)
|
||||
from config.definitions import CustomServiceList
|
||||
from tmtccmd.config.globals import get_default_service_op_code_dict
|
||||
|
||||
from pus_tc.devs.gps import add_gps_cmds
|
||||
from pus_tc.devs.pcdu import add_pcdu_cmds
|
||||
from pus_tc.devs.plpcdu import add_pl_pcdu_cmds
|
||||
from pus_tc.devs.rad_sensor import add_rad_sens_cmds
|
||||
from pus_tc.system.core import add_core_controller_definitions
|
||||
from pus_tc.devs.heater import add_heater_cmds
|
||||
from pus_tc.devs.rtd import specify_rtd_cmds
|
||||
from pus_tc.devs.reaction_wheels import add_rw_cmds
|
||||
from pus_tc.devs.bpx_batt import BpxOpCodes
|
||||
|
||||
from config.definitions import CustomServiceList
|
||||
|
||||
|
||||
def get_eive_service_op_code_dict() -> ServiceOpCodeDictT:
|
||||
service_op_code_dict = get_default_service_op_code_dict()
|
||||
add_bpx_cmd_definitions(cmd_dict=service_op_code_dict)
|
||||
add_core_controller_definitions(cmd_dict=service_op_code_dict)
|
||||
add_pl_pcdu_cmds(cmd_dict=service_op_code_dict)
|
||||
add_pcdu_cmds(cmd_dict=service_op_code_dict)
|
||||
specify_rtd_cmds(cmd_dict=service_op_code_dict)
|
||||
add_imtq_cmds(cmd_dict=service_op_code_dict)
|
||||
add_rad_sens_cmds(cmd_dict=service_op_code_dict)
|
||||
add_rw_cmds(cmd_dict=service_op_code_dict)
|
||||
add_ploc_mpsoc_cmds(cmd_dict=service_op_code_dict)
|
||||
add_ploc_supv_cmds(cmd_dict=service_op_code_dict)
|
||||
add_system_cmds(cmd_dict=service_op_code_dict)
|
||||
add_time_cmds(cmd_dict=service_op_code_dict)
|
||||
add_syrlinks_cmds(cmd_dict=service_op_code_dict)
|
||||
add_gps_cmds(cmd_dict=service_op_code_dict)
|
||||
add_str_cmds(cmd_dict=service_op_code_dict)
|
||||
add_ccsds_cmds(cmd_dict=service_op_code_dict)
|
||||
add_pdec_cmds(cmd_dict=service_op_code_dict)
|
||||
add_heater_cmds(cmd_dict=service_op_code_dict)
|
||||
add_tmp_sens_cmds(cmd_dict=service_op_code_dict)
|
||||
add_proc_cmds(cmd_dict=service_op_code_dict)
|
||||
return service_op_code_dict
|
||||
|
||||
|
||||
def add_tmp_sens_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
op_code_dict = {
|
||||
"0": ("TMP1075 Tests", {OpCodeDictKeys.TIMEOUT: 2.2}),
|
||||
}
|
||||
service_tuple = ("TMP1075 1", op_code_dict)
|
||||
cmd_dict[CustomServiceList.TMP1075_1.value] = service_tuple
|
||||
service_tuple = ("TMP1075 2", op_code_dict)
|
||||
cmd_dict[CustomServiceList.TMP1075_2.value] = service_tuple
|
||||
|
||||
|
||||
def add_pdec_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
op_code_dict_srv_pdec_handler = {
|
||||
"0": ("PDEC Handler: Print CLCW", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"1": ("PDEC Handler: Print PDEC monitor", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
}
|
||||
service_pdec_handler_tuple = ("PDEC Handler", op_code_dict_srv_pdec_handler)
|
||||
cmd_dict[CustomServiceList.PDEC_HANDLER.value] = service_pdec_handler_tuple
|
||||
|
||||
|
||||
def add_ccsds_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
op_code_dict_srv_ccsds_handler = {
|
||||
"0": ("CCSDS Handler: Set low rate", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"1": ("CCSDS Handler: Set high rate", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"2": ("CCSDS Handler: Enable transmitter", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"3": ("CCSDS Handler: Disable transmitter", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"4": ("CCSDS Handler: Set arbitrary bitrate", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"5": (
|
||||
"CCSDS Handler: Enable tx clock manipulator",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"6": (
|
||||
"CCSDS Handler: Disable tx clock manipulator",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"7": (
|
||||
"CCSDS Handler: Update tx data on rising edge",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"8": (
|
||||
"CCSDS Handler: Update tx data on falling edge",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
}
|
||||
service_ccsds_handler_tuple = ("CCSDS Handler", op_code_dict_srv_ccsds_handler)
|
||||
cmd_dict[CustomServiceList.CCSDS_HANDLER.value] = service_ccsds_handler_tuple
|
||||
|
||||
|
||||
def add_str_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
op_code_dict_srv_star_tracker = {
|
||||
"0": (
|
||||
"Star Tracker: Mode On, Submode Bootloader",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"1": ("Star Tracker: Mode On, Submode Firmware", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"2": ("Star Tracker: Mode Normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"3": ("Star Tracker: Mode Off", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"4": ("Star Tracker: Mode Raw", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"5": ("Star Tracker: Ping", {OpCodeDictKeys.TIMEOUT: 5.0}),
|
||||
"6": (
|
||||
"Star Tracker: Switch to bootloader program",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"7": ("Star Tracker: Request temperature", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"8": ("Star Tracker: Request version", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"9": ("Star Tracker: Request interface", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"10": ("Star Tracker: Request power", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"11": (
|
||||
"Star Tracker: Set subscription parameters",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"12": (
|
||||
"Star Tracker: Boot image (requires bootloader mode)",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"13": ("Star Tracker: Request time", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"14": ("Star Tracker: Request solution", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"15": ("Star Tracker: Upload image", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"16": ("Star Tracker: Download image", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"17": ("Star Tracker: Set limit parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"18": ("Star Tracker: Set tracking parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"19": ("Star Tracker: Set mounting parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"20": ("Star Tracker: Set camera parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"22": (
|
||||
"Star Tracker: Set centroiding parameters",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"23": ("Star Tracker: Set LISA parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"24": ("Star Tracker: Set matching parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"25": (
|
||||
"Star Tracker: Set validation parameters",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"26": ("Star Tracker: Set algo parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"27": ("Star Tracker: Take image", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"28": ("Star Tracker: Stop str helper", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"30": (
|
||||
"Star Tracker: Set name of download image",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"31": ("Star Tracker: Request histogram", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"32": ("Star Tracker: Request contrast", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"33": ("Star Tracker: Set json filename", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"35": ("Star Tracker: Flash read", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"36": ("Star Tracker: Set flash read filename", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"37": ("Star Tracker: Get checksum", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"49": ("Star Tracker: Request camera parameter", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"50": ("Star Tracker: Request limits", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"51": (
|
||||
"Star Tracker: Set image processor parameters",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"52": (
|
||||
"Star Tracker: (EGSE only) Load camera ground config ",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"53": (
|
||||
"Star Tracker: (EGSE only) Load camera flight config",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"54": (
|
||||
"Star Tracker: Request log level parameters",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"55": (
|
||||
"Star Tracker: Request mounting parameters",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"56": (
|
||||
"Star Tracker: Request image processor parameters",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"57": (
|
||||
"Star Tracker: Request centroiding parameters",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"58": ("Star Tracker: Request lisa parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"59": (
|
||||
"Star Tracker: Request matching parameters",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"60": (
|
||||
"Star Tracker: Request tracking parameters",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"61": (
|
||||
"Star Tracker: Request validation parameters",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"62": ("Star Tracker: Request algo parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"63": (
|
||||
"Star Tracker: Request subscription parameters",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"64": (
|
||||
"Star Tracker: Request log subscription parameters",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"65": (
|
||||
"Star Tracker: Request debug camera parameters",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"66": ("Star Tracker: Set log level parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"67": (
|
||||
"Star Tracker: Set log subscription parameters",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"68": (
|
||||
"Star Tracker: Set debug camera parameters",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"69": ("Star Tracker: Firmware update", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"70": (
|
||||
"Star Tracker: Disable timestamp generation",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"71": (
|
||||
"Star Tracker: Enable timestamp generation",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
}
|
||||
service_star_tracker_tuple = ("Star tracker", op_code_dict_srv_star_tracker)
|
||||
cmd_dict[CustomServiceList.STAR_TRACKER.value] = service_star_tracker_tuple
|
||||
|
||||
|
||||
def add_syrlinks_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
op_code_dict_srv_syrlinks_handler = {
|
||||
"0": ("Syrlinks Handler: Set mode off", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"1": ("Syrlinks Handler: Set mode on", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"2": ("Syrlinks Handler: Set mode normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"3": ("Syrlinks Handler: Set TX standby", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"4": ("Syrlinks Handler: Set TX modulation", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"5": ("Syrlinks Handler: Set TX carrier wave", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"6": ("Syrlinks Handler: Read TX status", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"7": ("Syrlinks Handler: Read TX waveform", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"8": (
|
||||
"Syrlinks Handler: Read TX AGC value high byte ",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"9": (
|
||||
"Syrlinks Handler: Read TX AGC value low byte ",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"12": (
|
||||
"Syrlinks Handler: Write LCL config",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"13": (
|
||||
"Syrlinks Handler: Read RX status registers",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"14": (
|
||||
"Syrlinks Handler: Read LCL config register",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"15": (
|
||||
"Syrlinks Handler: Set waveform OQPSK",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"16": (
|
||||
"Syrlinks Handler: Set waveform BPSK",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"17": (
|
||||
"Syrlinks Handler: Set second config",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"18": (
|
||||
"Syrlinks Handler: Enable debug output",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"19": (
|
||||
"Syrlinks Handler: Disable debug output",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
}
|
||||
service_syrlinks_handler_tuple = (
|
||||
"Syrlinks Handler",
|
||||
op_code_dict_srv_syrlinks_handler,
|
||||
)
|
||||
cmd_dict[CustomServiceList.SYRLINKS.value] = service_syrlinks_handler_tuple
|
||||
|
||||
|
||||
def add_bpx_cmd_definitions(cmd_dict: ServiceOpCodeDictT):
|
||||
op_code_dict = dict()
|
||||
@ -38,457 +317,47 @@ def add_bpx_cmd_definitions(cmd_dict: ServiceOpCodeDictT):
|
||||
)
|
||||
|
||||
|
||||
def add_core_controller_definitions(cmd_dict: ServiceOpCodeDictT):
|
||||
from pus_tc.system.core import OpCodes
|
||||
|
||||
od = dict()
|
||||
add_op_code_entry(op_code_dict=od, keys=OpCodes.REBOOT, info="Reboot with Prompt")
|
||||
add_op_code_entry(op_code_dict=od, keys=OpCodes.REBOOT_SELF, info="Reboot Self")
|
||||
add_op_code_entry(op_code_dict=od, keys=OpCodes.REBOOT_0_0, info="Reboot 0 0")
|
||||
add_op_code_entry(op_code_dict=od, keys=OpCodes.REBOOT_0_1, info="Reboot 0 1")
|
||||
add_op_code_entry(op_code_dict=od, keys=OpCodes.REBOOT_1_0, info="Reboot 1 0")
|
||||
add_op_code_entry(op_code_dict=od, keys=OpCodes.REBOOT_1_1, info="Reboot 1 1")
|
||||
add_op_code_entry(
|
||||
op_code_dict=od,
|
||||
keys=OpCodes.ENABLE_REBOOT_FILE_HANDLING,
|
||||
info="Enable reboot file handling",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=od,
|
||||
keys=OpCodes.DISABLE_REBOOT_FILE_HANDLING,
|
||||
info="Disable reboot file handling",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=od,
|
||||
keys=OpCodes.RESET_ALL_REBOOT_COUNTERS,
|
||||
info="Reset all reboot counters",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=od,
|
||||
keys=OpCodes.RESET_REBOOT_COUNTER_00,
|
||||
info="Reset reboot counter 0 0",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=od,
|
||||
keys=OpCodes.RESET_REBOOT_COUNTER_01,
|
||||
info="Reset reboot counter 0 1",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=od,
|
||||
keys=OpCodes.RESET_REBOOT_COUNTER_10,
|
||||
info="Reset reboot counter 1 0",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=od,
|
||||
keys=OpCodes.RESET_REBOOT_COUNTER_11,
|
||||
info="Reset reboot counter 1 1",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=od,
|
||||
keys=OpCodes.GET_HK,
|
||||
info="Request housekeeping set",
|
||||
)
|
||||
add_service_op_code_entry(
|
||||
srv_op_code_dict=cmd_dict,
|
||||
name=CustomServiceList.CORE.value,
|
||||
info="Reboot Self",
|
||||
op_code_entry=od,
|
||||
)
|
||||
|
||||
|
||||
def add_pl_pcdu_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
from pus_tc.devs.plpcdu import OpCodes, Info
|
||||
|
||||
op_code_dict = dict()
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict, keys=OpCodes.SWITCH_ON, info=Info.SWITCH_ON
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=OpCodes.NORMAL_SSR,
|
||||
info=Info.NORMAL_SSR,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=OpCodes.NORMAL_DRO,
|
||||
info=Info.NORMAL_DRO,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=OpCodes.NORMAL_X8,
|
||||
info=Info.NORMAL_X8,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=OpCodes.NORMAL_TX,
|
||||
info=Info.NORMAL_TX,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=OpCodes.NORMAL_MPA,
|
||||
info=Info.NORMAL_MPA,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=OpCodes.NORMAL_HPA,
|
||||
info=Info.NORMAL_HPA,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict, keys=OpCodes.SWITCH_OFF, info=Info.SWITCH_OFF
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=OpCodes.UPDATE_DRO_TO_X8_WAIT,
|
||||
info="Update DRO to X8 wait time",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=OpCodes.INJECT_SSR_TO_DRO_FAILURE,
|
||||
info="Inject failure SSR to DRO transition",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=OpCodes.INJECT_DRO_TO_X8_FAILURE,
|
||||
info="Inject failure in DRO to X8 transition",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=OpCodes.INJECT_X8_TO_TX_FAILURE,
|
||||
info="Inject failure in X8 to TX transition",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=OpCodes.INJECT_TX_TO_MPA_FAILURE,
|
||||
info="Inject failure in TX to MPA transition",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=OpCodes.INJECT_MPA_TO_HPA_FAILURE,
|
||||
info="Inject failure in MPA to HPA transition",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=OpCodes.INJECT_ALL_ON_FAILURE,
|
||||
info="Inject failure in all on mode",
|
||||
)
|
||||
add_service_op_code_entry(
|
||||
srv_op_code_dict=cmd_dict,
|
||||
name=CustomServiceList.PL_PCDU.value,
|
||||
info="PL PCDU",
|
||||
op_code_entry=op_code_dict,
|
||||
)
|
||||
|
||||
|
||||
def add_pcdu_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
from pus_tc.devs.p60dock import P60OpCodes, GomspaceOpCodes, Info
|
||||
from pus_tc.devs.pdu1 import Pdu1OpCodes
|
||||
from pus_tc.devs.pdu2 import Pdu2OpCodes
|
||||
def add_time_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
from pus_tc.system.time import OpCodes, Info
|
||||
|
||||
op_code_dict = dict()
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=P60OpCodes.STACK_3V3_ON,
|
||||
info=Info.STACK_3V3_ON,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=P60OpCodes.STACK_3V3_OFF,
|
||||
info=Info.STACK_3V3_OFF,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=P60OpCodes.STACK_5V_ON,
|
||||
info=Info.STACK_5V_ON,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=P60OpCodes.STACK_5V_OFF,
|
||||
info=Info.STACK_5V_OFF,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.REQUEST_HK_ONCE,
|
||||
info="P60 Dock: Request HK once",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.PRINT_SWITCH_V_I,
|
||||
info="P60 Dock: Print Switches, Voltages, Currents",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.PRINT_LATCHUPS,
|
||||
info="P60 Dock: Print Latchups",
|
||||
)
|
||||
add_op_code_entry(op_code_dict=op_code_dict, keys=P60OpCodes.TEST, info="P60 Tests")
|
||||
add_service_op_code_entry(
|
||||
srv_op_code_dict=cmd_dict,
|
||||
name=CustomServiceList.P60DOCK.value,
|
||||
info="P60 Device",
|
||||
op_code_entry=op_code_dict,
|
||||
)
|
||||
|
||||
op_code_dict = dict()
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu1OpCodes.TCS_BOARD_ON.value,
|
||||
info="PDU1: Turn TCS board on",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu1OpCodes.TCS_BOARD_OFF.value,
|
||||
info="PDU1: Turn TCS board off",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu1OpCodes.STAR_TRACKER_ON.value,
|
||||
info="PDU1: Turn star tracker on",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu1OpCodes.STAR_TRACKER_OFF.value,
|
||||
info="PDU1: Turn star tracker off",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu1OpCodes.SUS_NOMINAL_ON.value,
|
||||
info="PDU1: Turn SUS nominal on",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu1OpCodes.SUS_NOMINAL_OFF.value,
|
||||
info="PDU1: Turn SUS nominal off",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu1OpCodes.ACS_A_SIDE_ON.value,
|
||||
info="PDU1: Turn ACS A side on",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu1OpCodes.ACS_A_SIDE_OFF.value,
|
||||
info="PDU1: Turn ACS A side off",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu1OpCodes.SYRLINKS_ON.value,
|
||||
info="PDU1: Turn Syrlinks on",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu1OpCodes.SYRLINKS_OFF.value,
|
||||
info="PDU1: Turn Syrlinks off",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu1OpCodes.MGT_ON.value,
|
||||
info="PDU1: Turn MGT on",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu1OpCodes.MGT_OFF.value,
|
||||
info="PDU1: Turn MGT off",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu1OpCodes.PLOC_ON.value,
|
||||
info="PDU1: Turn PLOC on",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu1OpCodes.PLOC_OFF.value,
|
||||
info="PDU1: Turn PLOC off",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu1OpCodes.SCEX_ON.value,
|
||||
info="PDU1: Turn Solar Cell Experiment on",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu1OpCodes.SCEX_OFF.value,
|
||||
info="PDU1: Turn Solar Cell Experiment off",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.REQUEST_HK_ONCE,
|
||||
info="PDU1: Request HK once",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.PRINT_SWITCH_V_I,
|
||||
info="PDU1: Print Switches, Voltages, Currents",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.PRINT_LATCHUPS,
|
||||
info="PDU1: Print Latchups",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict, keys=Pdu1OpCodes.TESTS.value, info="PDU1 Tests"
|
||||
keys=OpCodes.SET_CURRENT_TIME,
|
||||
info=Info.SET_CURRENT_TIME,
|
||||
)
|
||||
add_service_op_code_entry(
|
||||
srv_op_code_dict=cmd_dict,
|
||||
name=CustomServiceList.PDU1.value,
|
||||
info="PDU1 Device",
|
||||
op_code_entry=op_code_dict,
|
||||
)
|
||||
|
||||
op_code_dict = dict()
|
||||
add_op_code_entry(op_code_dict=op_code_dict, keys="0", info="PDU2 Tests")
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu2OpCodes.ACS_SIDE_B_ON.value,
|
||||
info="PDU2: Turn ACS Side B on",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu2OpCodes.ACS_SIDE_B_OFF.value,
|
||||
info="PDU2: Turn ACS Side B off",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu2OpCodes.SUS_REDUNDANT_ON.value,
|
||||
info="PDU2: Turn SUS redundant on",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu2OpCodes.SUS_REDUNDANT_OFF.value,
|
||||
info="PDU2: Turn SUS redundant off",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu2OpCodes.RW_ON.value,
|
||||
info="PDU2: Turn reaction wheels on",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu2OpCodes.RW_OFF.value,
|
||||
info="PDU2: Turn reaction wheels off",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu2OpCodes.PL_PCDU_VBAT_NOM_ON.value,
|
||||
info="PDU2: PL PCDU Switch Channel Nominal (1) on",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu2OpCodes.PL_PCDU_VBAT_NOM_OFF.value,
|
||||
info="PDU2: PL PCDU Switch Channel Nominal (1) off",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu2OpCodes.PL_PCDU_VBAT_RED_ON.value,
|
||||
info="PDU2: PL PCDU Switch Channel Redundant (1) on",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu2OpCodes.PL_PCDU_VBAT_RED_OFF.value,
|
||||
info="PDU2: PL PCDU Switch Channel Redundant (1) off",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu2OpCodes.TCS_HEATER_IN_ON.value,
|
||||
info="PDU2: Switch TCS Heater Input on",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu2OpCodes.TCS_HEATER_IN_OFF.value,
|
||||
info="PDU2: Switch TCS Heater Input off",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu2OpCodes.SOLAR_ARRAY_DEPL_ON.value,
|
||||
info="PDU2: Switch Solar Array Deployment On",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu2OpCodes.SOLAR_ARRAY_DEPL_OFF.value,
|
||||
info="PDU2: Switch Solar Array Deployment Off",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu2OpCodes.PL_CAMERA_ON.value,
|
||||
info="PDU2: Turn payload camera on",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu2OpCodes.PL_CAMERA_OFF.value,
|
||||
info="PDU2: Turn payload camera off",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.REQUEST_HK_ONCE,
|
||||
info="PDU2: Request HK once",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.PRINT_SWITCH_V_I,
|
||||
info="PDU2: Print Switches, Voltages, Currents",
|
||||
options={OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.PRINT_LATCHUPS,
|
||||
info="PDU2: Print Latchups",
|
||||
)
|
||||
add_service_op_code_entry(
|
||||
srv_op_code_dict=cmd_dict,
|
||||
name="pdu2",
|
||||
info="PDU2 Device",
|
||||
name=CustomServiceList.TIME.value,
|
||||
info="Time Service",
|
||||
op_code_entry=op_code_dict,
|
||||
)
|
||||
|
||||
|
||||
def add_imtq_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
op_code_dict_srv_imtq = {
|
||||
"0": ("IMTQ Tests All", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"1": ("IMTQ perform pos X self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"2": ("IMTQ perform neg X self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"3": ("IMTQ perform pos Y self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"4": ("IMTQ perform neg Y self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"5": ("IMTQ perform pos Z self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"6": ("IMTQ perform neg Z self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"7": ("IMTQ command dipole", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"8": ("IMTQ get commanded dipole", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"0": ("Mode off", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"1": ("Mode on", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"2": ("Mode normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"3": ("IMTQ perform pos X self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"4": ("IMTQ perform neg X self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"5": ("IMTQ perform pos Y self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"6": ("IMTQ perform neg Y self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"7": ("IMTQ perform pos Z self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"8": ("IMTQ perform neg Z self test", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"9": ("IMTQ command dipole", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"10": ("IMTQ get commanded dipole", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"11": ("IMTQ get engineering hk set", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"12": (
|
||||
"IMTQ get calibrated MTM measurement one shot",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"13": ("IMTQ get raw MTM measurement one shot", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
}
|
||||
service_imtq_tuple = ("IMTQ Device", op_code_dict_srv_imtq)
|
||||
cmd_dict[CustomServiceList.IMTQ.value] = service_imtq_tuple
|
||||
|
||||
|
||||
def add_rw_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
op_code_dict_srv_rw = {
|
||||
"0": ("Reaction Wheel: Run all commands", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"1": ("Reaction Wheel: Set speed", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"2": ("Reaction Wheel: Set mode on", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"3": ("Reaction Wheel: Set mode normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"4": ("Reaction Wheel: Set mode off", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"5": (
|
||||
"Reaction Wheel: Send get-telemetry-command",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
}
|
||||
service_rw_tuple = ("Reaction Wheel", op_code_dict_srv_rw)
|
||||
cmd_dict[CustomServiceList.REACTION_WHEEL_1.value] = service_rw_tuple
|
||||
cmd_dict[CustomServiceList.REACTION_WHEEL_2.value] = service_rw_tuple
|
||||
cmd_dict[CustomServiceList.REACTION_WHEEL_3.value] = service_rw_tuple
|
||||
cmd_dict[CustomServiceList.REACTION_WHEEL_4.value] = service_rw_tuple
|
||||
|
||||
|
||||
def add_rad_sens_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
op_code_dict_srv_rad_sensor = {
|
||||
"0": ("Radiation Sensor: Set mode on", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"1": ("Radiation Sensor: Set mode normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"2": ("Radiation Sensor: Set mode off", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"3": ("Radiation Sensor: Start conversions", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"4": ("Radiation Sensor: Read conversions", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"5": ("Radiation Sensor: Enable debug output", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"6": ("Radiation Sensor: Disable debug putput", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
}
|
||||
service_rad_sensor_tuple = ("Radiation Sensor", op_code_dict_srv_rad_sensor)
|
||||
cmd_dict[CustomServiceList.RAD_SENSOR.value] = service_rad_sensor_tuple
|
||||
|
||||
|
||||
def add_ploc_mpsoc_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
op_code_dict_srv_ploc_mpsoc = {
|
||||
"0": ("Ploc MPSoC: Set mode off", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
@ -506,6 +375,10 @@ def add_ploc_mpsoc_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
"12": ("Ploc MPSoC: OBSW reset sequence count", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"13": ("Ploc MPSoC: Read DEADBEEF address", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"14": ("Ploc MPSoC: Mode replay", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"15": ("Ploc MPSoC: Mode idle", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"16": ("Ploc MPSoC: Tc cam command send", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"17": ("Ploc MPSoC: Set UART TX tristate", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"18": ("Ploc MPSoC: Relesase UART TX", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
}
|
||||
service_ploc_mpsoc_tuple = ("Ploc MPSoC", op_code_dict_srv_ploc_mpsoc)
|
||||
cmd_dict[CustomServiceList.PLOC_MPSOC.value] = service_ploc_mpsoc_tuple
|
||||
@ -525,7 +398,6 @@ def add_ploc_supv_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
"1": ("PLOC Supervisor: Set mode on", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"2": ("PLOC Supervisor: Set mode normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"3": ("PLOC Supervisor: Get HK Report", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"4": ("PLOC Supervisor: Restart MPSoC", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"5": ("PLOC Supervisor: Start MPSoC", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"6": ("PLOC Supervisor: Shutdown MPSoC", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"7": (
|
||||
@ -541,18 +413,9 @@ def add_ploc_supv_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
"PLOC Supervisor: Request boot status report",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"14": ("PLOC Supervisor: Update available", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"15": ("PLOC Supervisor: Watchdogs enable", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"16": (
|
||||
"PLOC Supervisor: Watchdog Configure Timeout",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"17": ("PLOC Supervisor: Enable latchup alert", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"18": ("PLOC Supervisor: Disable latchup alert", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"19": ("PLOC Supervisor: Auto calibrate alert", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"20": ("PLOC Supervisor: Set alert limit", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"21": ("PLOC Supervisor: Set alert irq filter", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"22": ("PLOC Supervisor: Set ADC sweep period", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"23": (
|
||||
"PLOC Supervisor: Set ADC enabled channels",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
@ -567,15 +430,8 @@ def add_ploc_supv_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"27": ("PLOC Supervisor: Copy ADC data to MRAM", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"28": (
|
||||
"PLOC Supervisor: Enable/Disable NVM0/1/3",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"29": ("PLOC Supervisor: Select NVM", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"30": ("PLOC Supervisor: Run auto EM tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"31": ("PLOC Supervisor: MRAM Wipe", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"33": ("PLOC Supervisor: Print CPU stats", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"34": ("PLOC Supervisor: Set debug verbosity", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"35": ("PLOC Supervisor: Set GPIO", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"36": ("PLOC Supervisor: Read GPIO", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"37": ("PLOC Supervisor: Restart supervisor", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
@ -591,47 +447,36 @@ def add_ploc_supv_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
"PLOC Supervisor: Factory reset clear circular entries",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"41": ("PLOC Supervisor: CAN loopback test", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"42": ("PLOC Supervisor: Perform update", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"43": (
|
||||
"PLOC Supervisor: Terminate supervisor process",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"44": ("PLOC Supervisor: Start MPSoC quiet", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"45": ("PLOC Supervisor: Set shutdown timeout", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"46": ("PLOC Supervisor: Factory flash", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"47": ("PLOC Supervisor: Enable auto TM", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"48": ("PLOC Supervisor: Disable auto TM", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"51": (
|
||||
"PLOC Supervisor: Logging request event buffers",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"52": (
|
||||
"PLOC Supervisor: Logging clear counters",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"53": ("PLOC Supervisor: Logging set topic", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"54": (
|
||||
"PLOC Supervisor: Logging request counters",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"55": ("PLOC Supervisor: Request ADC Report", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"56": ("PLOC Supervisor: Reset PL", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"57": ("PLOC Supervisor: Enable NVMs", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
"58": ("PLOC Supervisor: Continue update", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||
}
|
||||
service_ploc_supv_tuple = ("PLOC Supervisor", op_code_dict_srv_ploc_supv)
|
||||
|
||||
op_code_dict_srv_ploc_updater = {
|
||||
"0": (
|
||||
"Ploc Updater: Update uboot on partition A",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"1": (
|
||||
"Ploc Updater: Update bitstream on partition A",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"2": (
|
||||
"Ploc Updater: Update linux on partition A",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"3": (
|
||||
"Ploc Updater: Update application on partition A",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"4": (
|
||||
"Ploc Updater: Update uboot on partition B",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"5": (
|
||||
"Ploc Updater: Update bitstream on partition B",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"6": (
|
||||
"Ploc Updater: Update linux on partition B",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
"7": (
|
||||
"Ploc Updater: Update application on partition B",
|
||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
),
|
||||
}
|
||||
service_ploc_updater_tuple = ("Ploc Updater", op_code_dict_srv_ploc_updater)
|
||||
cmd_dict[CustomServiceList.PLOC_SUPV.value] = service_ploc_supv_tuple
|
||||
cmd_dict[CustomServiceList.PLOC_UPDATER.value] = service_ploc_updater_tuple
|
||||
cmd_dict[
|
||||
CustomServiceList.PLOC_MEMORY_DUMPER.value
|
||||
] = service_ploc_memory_dumper_tuple
|
||||
@ -640,6 +485,7 @@ def add_ploc_supv_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
def add_system_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
from pus_tc.system.acs import AcsOpCodes, SusOpCodes
|
||||
import pus_tc.system.tcs as tcs
|
||||
import pus_tc.system.controllers as controllers
|
||||
|
||||
default_opts = generate_op_code_options(
|
||||
enter_listener_mode=False, custom_timeout=8.0
|
||||
@ -745,3 +591,23 @@ def add_system_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
info="TCS Board Assembly",
|
||||
op_code_entry=op_code_dict,
|
||||
)
|
||||
|
||||
op_code_dict = dict()
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=controllers.OpCodes.THERMAL_CONTROLLER,
|
||||
info=controllers.Info.THERMAL_CONTROLLER,
|
||||
options=default_opts,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=controllers.OpCodes.CORE_CONTROLLER,
|
||||
info=controllers.Info.CORE_CONTROLLER,
|
||||
options=default_opts,
|
||||
)
|
||||
add_service_op_code_entry(
|
||||
srv_op_code_dict=cmd_dict,
|
||||
name=CustomServiceList.CONTROLLERS.value,
|
||||
info="Controllers",
|
||||
op_code_entry=op_code_dict,
|
||||
)
|
||||
|
@ -1,15 +1,136 @@
|
||||
# -*- 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 config.definitions import CustomServiceList
|
||||
from tmtccmd.config import add_op_code_entry, add_service_op_code_entry
|
||||
from tmtccmd.tc.packer import TcQueueT
|
||||
from tmtccmd.config.definitions import QueueCommands
|
||||
from gomspace.gomspace_common import *
|
||||
from tmtccmd.config.definitions import QueueCommands, ServiceOpCodeDictT
|
||||
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 Info 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.utility import ObjectId
|
||||
|
||||
|
||||
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"
|
||||
|
||||
|
||||
def add_acu_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
op_code_dict = dict()
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.REQUEST_CORE_HK_ONCE,
|
||||
info=GsInfo.REQUEST_CORE_HK_ONCE,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.REQUEST_AUX_HK_ONCE,
|
||||
info=GsInfo.REQUEST_AUX_HK_ONCE,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.REQUEST_AUX_HK_ONCE,
|
||||
info=GsInfo.REQUEST_AUX_HK_ONCE,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.GET_PARAM,
|
||||
info=GsInfo.GET_PARAMETER,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.SET_PARAM,
|
||||
info=GsInfo.SET_PARAMETER,
|
||||
)
|
||||
add_op_code_entry(op_code_dict=op_code_dict, keys=OpCodes.TEST, info=Info.TEST)
|
||||
add_service_op_code_entry(
|
||||
srv_op_code_dict=cmd_dict,
|
||||
op_code_entry=op_code_dict,
|
||||
name=CustomServiceList.ACU.value,
|
||||
info="ACU Device",
|
||||
)
|
||||
|
||||
|
||||
def pack_acu_commands(
|
||||
object_id: ObjectId, tc_queue: TcQueueT, op_code: str
|
||||
) -> TcQueueT:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "Handling ACU command"))
|
||||
if op_code in GomspaceOpCodes.PRINT_SWITCH_V_I:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "ACU: Print channel stats"))
|
||||
command = generate_action_command(
|
||||
object_id=object_id.as_bytes,
|
||||
action_id=gs.GomspaceDeviceActionIds.PRINT_SWITCH_V_I,
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if op_code in GomspaceOpCodes.REQUEST_CORE_HK_ONCE:
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, f"PDU1: {GsInfo.REQUEST_CORE_HK_ONCE}")
|
||||
)
|
||||
hk_sid = make_sid(object_id=object_id.as_bytes, set_id=gs.SetIds.ACU_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: {GsInfo.REQUEST_AUX_HK_ONCE}")
|
||||
)
|
||||
hk_sid = make_sid(object_id=object_id.as_bytes, set_id=gs.SetIds.ACU_AUX)
|
||||
command = generate_one_hk_command(sid=hk_sid, ssc=0)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if op_code in GomspaceOpCodes.GET_PARAM:
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, 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: "))
|
||||
command = gs.pack_get_param_command(object_id.as_bytes, table_id, memory_address, parameter_size)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if op_code in GomspaceOpCodes.SET_PARAM:
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, 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: "))
|
||||
command = gs.pack_set_param_command(object_id.as_bytes, memory_address, parameter_size, parameter)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
pack_test_cmds(object_id=object_id, tc_queue=tc_queue)
|
||||
|
||||
return tc_queue
|
||||
|
||||
|
||||
class ACUTestProcedure:
|
||||
@ -26,59 +147,28 @@ 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: ObjectId, tc_queue: TcQueueT):
|
||||
if ACUTestProcedure.all or ACUTestProcedure.reboot:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "ACU: Reboot"))
|
||||
command = pack_reboot_command(object_id)
|
||||
command = gs.pack_reboot_command(object_id)
|
||||
# command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
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,
|
||||
command = gs.pack_get_param_command(
|
||||
object_id.as_bytes,
|
||||
gs.TableIds.hk,
|
||||
ACUHkTable.wdt_gnd_left.parameter_address,
|
||||
ACUHkTable.wdt_gnd_left.parameter_size,
|
||||
)
|
||||
@ -86,20 +176,20 @@ def pack_acu_test_into(
|
||||
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 = gs.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())
|
||||
if ACUTestProcedure.all or ACUTestProcedure.ping:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "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 = gs.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())
|
||||
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,
|
||||
command = gs.pack_get_param_command(
|
||||
object_id.as_bytes,
|
||||
gs.TableIds.hk,
|
||||
ACUHkTable.temperature3.parameter_address,
|
||||
ACUHkTable.temperature3.parameter_size,
|
||||
)
|
||||
@ -107,9 +197,9 @@ def pack_acu_test_into(
|
||||
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,
|
||||
command = gs.pack_get_param_command(
|
||||
object_id.as_bytes,
|
||||
gs.TableIds.config,
|
||||
ACUConfigTable.vboost.parameter_address,
|
||||
ACUConfigTable.vboost.parameter_size,
|
||||
)
|
||||
@ -117,9 +207,9 @@ def pack_acu_test_into(
|
||||
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,
|
||||
command = gs.pack_get_param_command(
|
||||
object_id.as_bytes,
|
||||
gs.TableIds.config,
|
||||
ACUConfigTable.vbat_max_hi.parameter_address,
|
||||
ACUConfigTable.vbat_max_hi.parameter_size,
|
||||
)
|
||||
@ -127,9 +217,9 @@ def pack_acu_test_into(
|
||||
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,
|
||||
command = gs.pack_get_param_command(
|
||||
object_id.as_bytes,
|
||||
gs.TableIds.config,
|
||||
ACUConfigTable.vbat_max_lo.parameter_address,
|
||||
ACUConfigTable.vbat_max_lo.parameter_size,
|
||||
)
|
||||
@ -137,23 +227,20 @@ def pack_acu_test_into(
|
||||
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,
|
||||
command = 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,
|
||||
P60DockConfigTable.out_en_0.parameter_address,
|
||||
P60DockConfigTable.out_en_0.parameter_size,
|
||||
Channel.off,
|
||||
)
|
||||
# command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
|
||||
return tc_queue
|
||||
if ACUTestProcedure.all or ACUTestProcedure.off:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Turning off ACU"))
|
||||
command = gs.pack_set_param_command(
|
||||
ACU_HANDLER_ID,
|
||||
P60DockConfigTable.out_en_0.parameter_address,
|
||||
P60DockConfigTable.out_en_0.parameter_size,
|
||||
gs.Channel.off,
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
|
@ -1,7 +1,7 @@
|
||||
from tmtccmd.tc.definitions import TcQueueT, QueueCommands
|
||||
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.tc.pus_8_funccmd import generate_action_command
|
||||
from tmtccmd.tc.pus_3_fsfw_hk import generate_one_hk_command, make_sid
|
||||
|
||||
|
||||
class BpxSetIds:
|
||||
|
@ -1,22 +1,54 @@
|
||||
import enum
|
||||
|
||||
from tmtccmd.config.definitions import QueueCommands
|
||||
from config.definitions import CustomServiceList
|
||||
from tmtccmd.config import add_op_code_entry, add_service_op_code_entry
|
||||
from tmtccmd.tc.pus_3_fsfw_hk import make_sid, generate_one_hk_command
|
||||
from tmtccmd.config.definitions import QueueCommands, ServiceOpCodeDictT
|
||||
from tmtccmd.logging import get_console_logger
|
||||
from tmtccmd.tc.definitions import TcQueueT
|
||||
from tmtccmd.tc.service_8_functional_cmd import generate_action_command
|
||||
from tmtccmd.tc.pus_8_funccmd import generate_action_command
|
||||
|
||||
|
||||
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"]
|
||||
|
||||
|
||||
class Info:
|
||||
REQ_OS_HK = "Request One-Shot HK"
|
||||
RESET_GNSS = "Reset GNSS using reset pin"
|
||||
|
||||
|
||||
class SetIds:
|
||||
HK = 0
|
||||
|
||||
|
||||
def add_gps_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
op_code_dict = dict()
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict, keys=OpCodes.RESET_GNSS, info=Info.RESET_GNSS
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict, keys=OpCodes.REQ_OS_HK, info=Info.REQ_OS_HK
|
||||
)
|
||||
add_service_op_code_entry(
|
||||
srv_op_code_dict=cmd_dict,
|
||||
op_code_entry=op_code_dict,
|
||||
name=CustomServiceList.GPS_CTRL.value,
|
||||
info="GPS/GNSS Controller",
|
||||
)
|
||||
|
||||
|
||||
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))
|
||||
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:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, f"GMSS: {Info.REQ_OS_HK}"))
|
||||
cmd = generate_one_hk_command(
|
||||
sid=make_sid(object_id=object_id, set_id=SetIds.HK), ssc=0
|
||||
)
|
||||
tc_queue.appendleft(cmd.pack_command_tuple())
|
||||
|
10
pus_tc/devs/gyros.py
Normal file
10
pus_tc/devs/gyros.py
Normal file
@ -0,0 +1,10 @@
|
||||
import enum
|
||||
|
||||
|
||||
class AdisGyroSetIds(enum.IntEnum):
|
||||
CORE_HK = 0
|
||||
CFG_HK = 1
|
||||
|
||||
|
||||
class L3gGyroSetIds(enum.IntEnum):
|
||||
CORE_HK = 0
|
@ -1,59 +1,224 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
@file tmtcc_tc_heater.py
|
||||
@brief Command sequence to test the HeaterHandler
|
||||
"""Command sequence to test the HeaterHandler
|
||||
@author J. Meier
|
||||
@date 30.01.2021
|
||||
"""
|
||||
from tmtccmd.config.definitions import QueueCommands
|
||||
import enum
|
||||
|
||||
from config.definitions import CustomServiceList
|
||||
from config.object_ids import get_object_ids
|
||||
from tmtccmd.utility.obj_id import 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.pus_8_funccmd 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 spacepackets.ecss.tc import PusTelecommand
|
||||
|
||||
|
||||
class SwitchNumbers:
|
||||
HEATER_0 = 0
|
||||
HEATER_1 = 1
|
||||
HEATER_2 = 2
|
||||
HEATER_3 = 3
|
||||
HEATER_4 = 4
|
||||
HEATER_5 = 5
|
||||
HEATER_6 = 6
|
||||
HEATER_7 = 7
|
||||
HEATER_0_OBC_BRD = 0
|
||||
HEATER_1_PLOC_PROC_BRD = 1
|
||||
HEATER_2_ACS_BRD = 2
|
||||
HEATER_3_PCDU_PDU = 3
|
||||
HEATER_4_CAMERA = 4
|
||||
HEATER_5_STR = 5
|
||||
HEATER_6_DRO = 6
|
||||
HEATER_7_HPA = 7
|
||||
NUMBER_OF_SWITCHES = 8
|
||||
|
||||
|
||||
class ActionIds:
|
||||
SWITCH_HEATER = bytearray([0x0, 0x0, 0x0, 0x0])
|
||||
class OpCodes:
|
||||
HEATER_CMD = ["0", "switch-cmd"]
|
||||
HEATER_EXT_CTRL = ["1", "set-ext-ctrl"]
|
||||
HEATER_FAULTY_CMD = ["2", "set-faulty"]
|
||||
HEATER_HEALTHY_CMD = ["3", "set-healthy"]
|
||||
|
||||
|
||||
def pack_heater_test_into(object_id: bytearray, tc_queue: TcQueueT):
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "Testing Heater Switching"))
|
||||
class Info:
|
||||
HEATER_CMD = "Heater Switch Command"
|
||||
HEATER_EXT_CTRL = "Set to external control"
|
||||
HEATER_FAULTY_CMD = "Set to faulty"
|
||||
HEATER_HEALTHY_CMD = "Set to healthy"
|
||||
|
||||
heater_number = int(input("Type number of heater to switch [0-7]: "))
|
||||
if heater_number >= SwitchNumbers.NUMBER_OF_SWITCHES or heater_number < 0:
|
||||
print("Invalid heater switch number")
|
||||
return
|
||||
action = int(input("Turn switch on or off? (0 - off, 1 - on): "))
|
||||
if action != 0 and action != 1:
|
||||
print("Invalid action defined. Must be 0 (off) or 1 (on")
|
||||
debug_string = "Switching heater " + str(heater_number)
|
||||
tc_queue.appendleft((QueueCommands.PRINT, debug_string))
|
||||
command = pack_switch_heater_command(object_id, heater_number, action)
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=300, app_data=command)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
|
||||
# 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,
|
||||
name=CustomServiceList.HEATER.value,
|
||||
info="Heater Device",
|
||||
op_code_entry=op_code_dict,
|
||||
)
|
||||
|
||||
|
||||
def pack_heater_cmds(object_id: bytearray, op_code: str, tc_queue: TcQueueT):
|
||||
if op_code in OpCodes.HEATER_CMD:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "Heater Switching"))
|
||||
heater_number = prompt_heater()
|
||||
while True:
|
||||
action = input("Turn switch on or off? (0 - off, 1 - on): ")
|
||||
if not action.isdigit():
|
||||
print("Switch action not valid")
|
||||
continue
|
||||
action = int(action)
|
||||
if action != 0 and action != 1:
|
||||
print("Invalid action defined. Must be 0 (off) or 1 (on")
|
||||
continue
|
||||
break
|
||||
if action == 1:
|
||||
act_str = "on"
|
||||
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())
|
||||
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,
|
||||
object_id=obj_id,
|
||||
health=FsfwHealth.EXTERNAL_CTRL,
|
||||
health_str="External Control",
|
||||
heater_idx=heater_number,
|
||||
)
|
||||
if op_code in OpCodes.HEATER_FAULTY_CMD:
|
||||
heater_number = prompt_heater()
|
||||
obj_id = heater_idx_to_obj(heater_number)
|
||||
health_cmd(
|
||||
tc_queue=tc_queue,
|
||||
object_id=obj_id,
|
||||
health=FsfwHealth.FAULTY,
|
||||
health_str="Faulty",
|
||||
heater_idx=heater_number,
|
||||
)
|
||||
if op_code in OpCodes.HEATER_HEALTHY_CMD:
|
||||
heater_number = prompt_heater()
|
||||
obj_id = heater_idx_to_obj(heater_number)
|
||||
health_cmd(
|
||||
tc_queue=tc_queue,
|
||||
object_id=obj_id,
|
||||
health=FsfwHealth.HEALTHY,
|
||||
health_str="Healthy",
|
||||
heater_idx=heater_number,
|
||||
)
|
||||
|
||||
|
||||
def heater_idx_to_obj(heater: int) -> ObjectId:
|
||||
from config.object_ids import (
|
||||
HEATER_0_OBC_BRD,
|
||||
HEATER_1_PLOC_PROC_BRD,
|
||||
HEATER_2_ACS_BRD,
|
||||
HEATER_3_PCDU_BRD,
|
||||
HEATER_4_CAMERA,
|
||||
HEATER_5_STR,
|
||||
HEATER_6_DRO,
|
||||
HEATER_7_HPA,
|
||||
)
|
||||
|
||||
obj_id_array = [
|
||||
HEATER_0_OBC_BRD,
|
||||
HEATER_1_PLOC_PROC_BRD,
|
||||
HEATER_2_ACS_BRD,
|
||||
HEATER_3_PCDU_BRD,
|
||||
HEATER_4_CAMERA,
|
||||
HEATER_5_STR,
|
||||
HEATER_6_DRO,
|
||||
HEATER_7_HPA,
|
||||
]
|
||||
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 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")
|
||||
continue
|
||||
heater_number = int(heater_number)
|
||||
if heater_number >= SwitchNumbers.NUMBER_OF_SWITCHES or heater_number < 0:
|
||||
print("Invalid heater switch number")
|
||||
continue
|
||||
break
|
||||
return heater_number
|
||||
|
||||
|
||||
def health_cmd(
|
||||
tc_queue: TcQueueT,
|
||||
heater_idx: int,
|
||||
object_id: ObjectId,
|
||||
health: FsfwHealth,
|
||||
health_str: str,
|
||||
):
|
||||
tc_queue.appendleft(
|
||||
(
|
||||
QueueCommands.PRINT,
|
||||
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(
|
||||
service=201, subservice=Subservices.TC_SET_HEALTH, app_data=app_data
|
||||
)
|
||||
tc_queue.appendleft(cmd.pack_command_tuple())
|
||||
|
||||
|
||||
def pack_switch_heater_command(
|
||||
object_id: bytearray, switch_nr: int, switch_action: int
|
||||
) -> bytearray:
|
||||
"""Function to generate the command switch a heater
|
||||
@param object_id The object id of the HeaterHandler object.
|
||||
@param switch_nr The switch number identifying the heater to switch
|
||||
@param switch_action Action to perform. 0 - Sets switch off, 1 - Sets switch on.
|
||||
object_id: bytes, switch_nr: int, switch_action: int
|
||||
) -> PusTelecommand:
|
||||
"""Function to generate a heater switch command.
|
||||
:param object_id: The object id of the HeaterHandler object.
|
||||
:param switch_nr: The switch number identifying the heater to switch
|
||||
:param switch_action: Action to perform. 0 - Sets switch off, 1 - Sets switch on.
|
||||
"""
|
||||
action_id = ActionIds.SWITCH_HEATER
|
||||
command = bytearray()
|
||||
command += object_id + action_id
|
||||
command.append(switch_nr)
|
||||
command.append(switch_action)
|
||||
return command
|
||||
command.append(COMMAND_SOURCE_PARAM_EXTERNAL)
|
||||
return generate_action_command(
|
||||
object_id=object_id, action_id=ActionIds.SWITCH_HEATER, app_data=command
|
||||
)
|
||||
|
@ -5,11 +5,18 @@
|
||||
@author J. Meier
|
||||
@date 25.03.2021
|
||||
"""
|
||||
import struct
|
||||
|
||||
from tmtccmd.config.definitions import QueueCommands
|
||||
|
||||
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.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
|
||||
|
||||
|
||||
class ImtqSetIds:
|
||||
@ -48,7 +55,22 @@ def pack_imtq_test_into(
|
||||
)
|
||||
)
|
||||
|
||||
if op_code == "0" or op_code == "1":
|
||||
if op_code == "0":
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "IMTQ: 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())
|
||||
if op_code == "1":
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "IMTQ: 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())
|
||||
if op_code == "2":
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "IMTQ: 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())
|
||||
if op_code == "3":
|
||||
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)
|
||||
@ -74,7 +96,7 @@ def pack_imtq_test_into(
|
||||
command = generate_one_hk_command(sid, 24)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
|
||||
if op_code == "0" or op_code == "2":
|
||||
if op_code == "4":
|
||||
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)
|
||||
@ -100,7 +122,7 @@ def pack_imtq_test_into(
|
||||
command = generate_one_hk_command(sid, 27)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
|
||||
if op_code == "0" or op_code == "3":
|
||||
if op_code == "5":
|
||||
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)
|
||||
@ -126,7 +148,7 @@ def pack_imtq_test_into(
|
||||
command = generate_one_hk_command(sid, 30)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
|
||||
if op_code == "0" or op_code == "4":
|
||||
if op_code == "6":
|
||||
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)
|
||||
@ -152,7 +174,7 @@ def pack_imtq_test_into(
|
||||
command = generate_one_hk_command(sid, 33)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
|
||||
if op_code == "0" or op_code == "5":
|
||||
if op_code == "7":
|
||||
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)
|
||||
@ -178,7 +200,7 @@ def pack_imtq_test_into(
|
||||
command = generate_one_hk_command(sid, 36)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
|
||||
if op_code == "0" or op_code == "6":
|
||||
if op_code == "8":
|
||||
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)
|
||||
@ -204,28 +226,48 @@ def pack_imtq_test_into(
|
||||
command = generate_one_hk_command(sid, 37)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
|
||||
if op_code == "0" or op_code == "7":
|
||||
if op_code == "9":
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "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())
|
||||
|
||||
if op_code == "0" or op_code == "8":
|
||||
if op_code == "10":
|
||||
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 == "11":
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "IMTQ: Get engineering hk set"))
|
||||
command = generate_one_diag_command(
|
||||
sid=make_sid(object_id=object_id, set_id=ImtqSetIds.ENG_HK_SET), ssc=0
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
|
||||
if op_code == "12":
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "IMTQ: Get calibrated MTM hk set"))
|
||||
command = generate_one_diag_command(
|
||||
sid=make_sid(object_id=object_id, set_id=ImtqSetIds.CAL_MTM_SET), ssc=0
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
|
||||
if op_code == "13":
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "IMTQ: Get raw MTM hk set"))
|
||||
command = generate_one_diag_command(
|
||||
sid=make_sid(object_id=object_id, set_id=ImtqSetIds.RAW_MTM_SET), ssc=0
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
|
||||
return tc_queue
|
||||
|
||||
|
||||
def pack_dipole_command(
|
||||
object_id: bytearray, x_dipole: int, y_dipole: int, z_dipole: int, duration: int
|
||||
) -> bytearray:
|
||||
) -> 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 +278,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, ssc=22, app_data=command)
|
||||
return command
|
||||
|
9
pus_tc/devs/mgms.py
Normal file
9
pus_tc/devs/mgms.py
Normal file
@ -0,0 +1,9 @@
|
||||
import enum
|
||||
|
||||
|
||||
class MgmLis3SetIds(enum.IntEnum):
|
||||
CORE_HK = 0
|
||||
|
||||
|
||||
class MgmRm3100SetIds(enum.IntEnum):
|
||||
CORE_HK = 0
|
@ -7,7 +7,7 @@
|
||||
"""
|
||||
from tmtccmd.config.definitions import QueueCommands
|
||||
from tmtccmd.tc.packer import TcQueueT
|
||||
from tmtccmd.tc.service_3_housekeeping import (
|
||||
from tmtccmd.tc.pus_3_fsfw_hk import (
|
||||
generate_one_hk_command,
|
||||
make_sid,
|
||||
generate_one_diag_command,
|
||||
@ -16,9 +16,6 @@ from gomspace.gomspace_common import *
|
||||
from config.object_ids import P60_DOCK_HANDLER
|
||||
|
||||
|
||||
HK_SET_ID = 0x3
|
||||
|
||||
|
||||
class P60OpCodes:
|
||||
STACK_3V3_ON = ["stack-3v3-on", "1"]
|
||||
STACK_3V3_OFF = ["stack-3v3-off", "2"]
|
||||
@ -90,11 +87,12 @@ class P60DockHkTable:
|
||||
wdt_gnd_left = TableEntry(bytearray([0x00, 0xA8]), TableEntry.uint32_size)
|
||||
|
||||
|
||||
def pack_p60dock_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
def pack_p60dock_cmds(object_id: ObjectId, tc_queue: TcQueueT, 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,
|
||||
objb,
|
||||
P60DockConfigTable.out_en_9.parameter_address,
|
||||
P60DockConfigTable.out_en_9.parameter_size,
|
||||
Channel.on,
|
||||
@ -103,7 +101,7 @@ def pack_p60dock_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: st
|
||||
if op_code in P60OpCodes.STACK_3V3_OFF:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, Info.STACK_3V3_OFF))
|
||||
command = pack_set_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
P60DockConfigTable.out_en_9.parameter_address,
|
||||
P60DockConfigTable.out_en_9.parameter_size,
|
||||
Channel.off,
|
||||
@ -112,7 +110,7 @@ def pack_p60dock_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: st
|
||||
if op_code in P60OpCodes.STACK_5V_ON:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, Info.STACK_5V_ON))
|
||||
command = pack_set_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
P60DockConfigTable.out_en_10.parameter_address,
|
||||
P60DockConfigTable.out_en_10.parameter_size,
|
||||
Channel.on,
|
||||
@ -121,15 +119,24 @@ def pack_p60dock_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: st
|
||||
if op_code in P60OpCodes.STACK_5V_OFF:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, Info.STACK_5V_OFF))
|
||||
command = pack_set_param_command(
|
||||
object_id,
|
||||
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_HK_ONCE:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Requesting HK Table Once"))
|
||||
hk_sid = make_sid(object_id=P60_DOCK_HANDLER, set_id=SetIds.P60_DOCK)
|
||||
if op_code in GomspaceOpCodes.REQUEST_CORE_HK_ONCE:
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "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())
|
||||
if op_code in GomspaceOpCodes.REQUEST_AUX_HK_ONCE:
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "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())
|
||||
if op_code in GomspaceOpCodes.PRINT_SWITCH_V_I:
|
||||
@ -137,13 +144,13 @@ def pack_p60dock_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: st
|
||||
(QueueCommands.PRINT, "P60 Dock: Print Switches, Voltages, Currents")
|
||||
)
|
||||
command = generate_action_command(
|
||||
object_id=object_id, action_id=GomspaceDeviceActionIds.PRINT_SWITCH_V_I
|
||||
object_id=objb, 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
|
||||
object_id=objb, action_id=GomspaceDeviceActionIds.PRINT_LATCHUPS
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if P60DockTestProcedure.all or P60DockTestProcedure.reboot:
|
||||
@ -156,7 +163,7 @@ def pack_p60dock_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: st
|
||||
(QueueCommands.PRINT, "P60 Dock: Reading ground watchdog timer value")
|
||||
)
|
||||
command = pack_get_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
TableIds.hk,
|
||||
P60DockHkTable.wdt_gnd_left.parameter_address,
|
||||
P60DockHkTable.wdt_gnd_left.parameter_size,
|
||||
@ -182,7 +189,7 @@ def pack_p60dock_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: st
|
||||
)
|
||||
parameter = 0 # set channel off
|
||||
command = pack_set_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
P60DockConfigTable.out_en_3.parameter_address,
|
||||
P60DockConfigTable.out_en_3.parameter_size,
|
||||
parameter,
|
||||
@ -194,7 +201,7 @@ def pack_p60dock_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: st
|
||||
(QueueCommands.PRINT, "P60 Dock: Testing temperature reading")
|
||||
)
|
||||
command = pack_get_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
TableIds.hk,
|
||||
P60DockHkTable.temperature1.parameter_address,
|
||||
P60DockHkTable.temperature1.parameter_size,
|
||||
@ -206,7 +213,7 @@ def pack_p60dock_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: st
|
||||
(QueueCommands.PRINT, "P60 Dock: Testing Output Channel 3 state (PDU2)")
|
||||
)
|
||||
command = pack_get_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
TableIds.config,
|
||||
P60DockConfigTable.out_en_3.parameter_address,
|
||||
P60DockConfigTable.out_en_3.parameter_size,
|
||||
@ -221,7 +228,7 @@ def pack_p60dock_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: st
|
||||
)
|
||||
)
|
||||
command = pack_get_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
TableIds.config,
|
||||
P60DockConfigTable.cur_lu_lim_0.parameter_address,
|
||||
P60DockConfigTable.cur_lu_lim_0.parameter_size,
|
||||
@ -234,7 +241,7 @@ def pack_p60dock_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: st
|
||||
)
|
||||
parameter = 1 # set channel on
|
||||
command = pack_set_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
P60DockConfigTable.out_en_3.parameter_address,
|
||||
P60DockConfigTable.out_en_3.parameter_size,
|
||||
parameter,
|
||||
@ -247,7 +254,7 @@ def pack_p60dock_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: st
|
||||
)
|
||||
table_id_invalid = 5
|
||||
command = pack_get_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
table_id_invalid,
|
||||
P60DockHkTable.temperature1.parameter_address,
|
||||
P60DockHkTable.temperature1.parameter_size,
|
||||
@ -263,7 +270,7 @@ def pack_p60dock_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: st
|
||||
)
|
||||
invalid_address = bytearray([0x01, 0xF4])
|
||||
command = pack_get_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
TableIds.hk,
|
||||
invalid_address,
|
||||
P60DockHkTable.temperature1.parameter_size,
|
||||
@ -280,7 +287,7 @@ def pack_p60dock_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: st
|
||||
parameter_size = 2
|
||||
parameter = 1
|
||||
command = pack_set_param_command(
|
||||
object_id, invalid_address, parameter_size, parameter
|
||||
objb, invalid_address, parameter_size, parameter
|
||||
)
|
||||
# command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
@ -293,7 +300,7 @@ def pack_p60dock_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: st
|
||||
)
|
||||
invalid_size = 5
|
||||
command = pack_get_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
TableIds.hk,
|
||||
P60DockHkTable.temperature1.parameter_address,
|
||||
invalid_size,
|
||||
@ -308,7 +315,7 @@ def pack_p60dock_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: st
|
||||
)
|
||||
parameter = 1
|
||||
command = pack_set_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
P60DockConfigTable.out_en_3.parameter_address,
|
||||
invalid_size,
|
||||
parameter,
|
||||
|
300
pus_tc/devs/pcdu.py
Normal file
300
pus_tc/devs/pcdu.py
Normal file
@ -0,0 +1,300 @@
|
||||
from config.definitions import CustomServiceList
|
||||
from tmtccmd.config import (
|
||||
ServiceOpCodeDictT,
|
||||
add_op_code_entry,
|
||||
add_service_op_code_entry,
|
||||
OpCodeDictKeys,
|
||||
)
|
||||
|
||||
from pus_tc.devs.p60dock import P60OpCodes, GomspaceOpCodes, Info
|
||||
from pus_tc.devs.pdu1 import Pdu1OpCodes
|
||||
from pus_tc.devs.pdu2 import Pdu2OpCodes
|
||||
from pus_tc.devs.acu import add_acu_cmds
|
||||
from gomspace.gomspace_common import Info as GsInfo
|
||||
|
||||
|
||||
def add_p60_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
op_code_dict = dict()
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=P60OpCodes.STACK_3V3_ON,
|
||||
info=Info.STACK_3V3_ON,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=P60OpCodes.STACK_3V3_OFF,
|
||||
info=Info.STACK_3V3_OFF,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=P60OpCodes.STACK_5V_ON,
|
||||
info=Info.STACK_5V_ON,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=P60OpCodes.STACK_5V_OFF,
|
||||
info=Info.STACK_5V_OFF,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.REQUEST_CORE_HK_ONCE,
|
||||
info=GsInfo.REQUEST_CORE_HK_ONCE,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.REQUEST_AUX_HK_ONCE,
|
||||
info=GsInfo.REQUEST_AUX_HK_ONCE,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.PRINT_SWITCH_V_I,
|
||||
info="P60 Dock: Print Switches, Voltages, Currents",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.PRINT_LATCHUPS,
|
||||
info="P60 Dock: Print Latchups",
|
||||
)
|
||||
add_op_code_entry(op_code_dict=op_code_dict, keys=P60OpCodes.TEST, info="P60 Tests")
|
||||
add_service_op_code_entry(
|
||||
srv_op_code_dict=cmd_dict,
|
||||
name=CustomServiceList.P60DOCK.value,
|
||||
info="P60 Device",
|
||||
op_code_entry=op_code_dict,
|
||||
)
|
||||
|
||||
|
||||
def add_pdu1_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
op_code_dict = dict()
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu1OpCodes.TCS_BOARD_OFF.value,
|
||||
info="PDU1: Turn TCS board off",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu1OpCodes.STAR_TRACKER_ON.value,
|
||||
info="PDU1: Turn star tracker on",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu1OpCodes.STAR_TRACKER_OFF.value,
|
||||
info="PDU1: Turn star tracker off",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu1OpCodes.SUS_NOMINAL_ON.value,
|
||||
info="PDU1: Turn SUS nominal on",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu1OpCodes.SUS_NOMINAL_OFF.value,
|
||||
info="PDU1: Turn SUS nominal off",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu1OpCodes.ACS_A_SIDE_ON.value,
|
||||
info="PDU1: Turn ACS A side on",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu1OpCodes.ACS_A_SIDE_OFF.value,
|
||||
info="PDU1: Turn ACS A side off",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu1OpCodes.SYRLINKS_ON.value,
|
||||
info="PDU1: Turn Syrlinks on",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu1OpCodes.SYRLINKS_OFF.value,
|
||||
info="PDU1: Turn Syrlinks off",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu1OpCodes.MGT_ON.value,
|
||||
info="PDU1: Turn MGT on",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu1OpCodes.MGT_OFF.value,
|
||||
info="PDU1: Turn MGT off",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu1OpCodes.PLOC_ON.value,
|
||||
info="PDU1: Turn PLOC on",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu1OpCodes.PLOC_OFF.value,
|
||||
info="PDU1: Turn PLOC off",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu1OpCodes.SCEX_ON.value,
|
||||
info="PDU1: Turn Solar Cell Experiment on",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu1OpCodes.SCEX_OFF.value,
|
||||
info="PDU1: Turn Solar Cell Experiment off",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.REQUEST_CORE_HK_ONCE,
|
||||
info=GsInfo.REQUEST_CORE_HK_ONCE,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.REQUEST_AUX_HK_ONCE,
|
||||
info=GsInfo.REQUEST_AUX_HK_ONCE,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.PRINT_SWITCH_V_I,
|
||||
info="PDU1: Print Switches, Voltages, Currents",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu1OpCodes.TCS_BOARD_ON.value,
|
||||
info="PDU1: Turn TCS board on",
|
||||
)
|
||||
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.PRINT_LATCHUPS,
|
||||
info="PDU1: Print Latchups",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict, keys=Pdu1OpCodes.TESTS.value, info="PDU1 Tests"
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict, keys=GomspaceOpCodes.SET_PARAM, info="Set parameter"
|
||||
)
|
||||
add_service_op_code_entry(
|
||||
srv_op_code_dict=cmd_dict,
|
||||
name=CustomServiceList.PDU1.value,
|
||||
info="PDU1 Device",
|
||||
op_code_entry=op_code_dict,
|
||||
)
|
||||
|
||||
|
||||
def add_pdu2_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
op_code_dict = dict()
|
||||
add_op_code_entry(op_code_dict=op_code_dict, keys="0", info="PDU2 Tests")
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu2OpCodes.ACS_SIDE_B_ON.value,
|
||||
info="PDU2: Turn ACS Side B on",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu2OpCodes.ACS_SIDE_B_OFF.value,
|
||||
info="PDU2: Turn ACS Side B off",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu2OpCodes.SUS_REDUNDANT_ON.value,
|
||||
info="PDU2: Turn SUS redundant on",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu2OpCodes.SUS_REDUNDANT_OFF.value,
|
||||
info="PDU2: Turn SUS redundant off",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu2OpCodes.RW_ON.value,
|
||||
info="PDU2: Turn reaction wheels on",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu2OpCodes.RW_OFF.value,
|
||||
info="PDU2: Turn reaction wheels off",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu2OpCodes.PL_PCDU_VBAT_NOM_ON.value,
|
||||
info="PDU2: PL PCDU Switch Channel Nominal (1) on",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu2OpCodes.PL_PCDU_VBAT_NOM_OFF.value,
|
||||
info="PDU2: PL PCDU Switch Channel Nominal (1) off",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu2OpCodes.PL_PCDU_VBAT_RED_ON.value,
|
||||
info="PDU2: PL PCDU Switch Channel Redundant (1) on",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu2OpCodes.PL_PCDU_VBAT_RED_OFF.value,
|
||||
info="PDU2: PL PCDU Switch Channel Redundant (1) off",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu2OpCodes.TCS_HEATER_IN_ON.value,
|
||||
info="PDU2: Switch TCS Heater Input on",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu2OpCodes.TCS_HEATER_IN_OFF.value,
|
||||
info="PDU2: Switch TCS Heater Input off",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu2OpCodes.SOLAR_ARRAY_DEPL_ON.value,
|
||||
info="PDU2: Switch Solar Array Deployment On",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu2OpCodes.SOLAR_ARRAY_DEPL_OFF.value,
|
||||
info="PDU2: Switch Solar Array Deployment Off",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu2OpCodes.PL_CAMERA_ON.value,
|
||||
info="PDU2: Turn payload camera on",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=Pdu2OpCodes.PL_CAMERA_OFF.value,
|
||||
info="PDU2: Turn payload camera off",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.REQUEST_CORE_HK_ONCE,
|
||||
info=GsInfo.REQUEST_CORE_HK_ONCE,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.REQUEST_AUX_HK_ONCE,
|
||||
info=GsInfo.REQUEST_AUX_HK_ONCE,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.PRINT_SWITCH_V_I,
|
||||
info="PDU2: Print Switches, Voltages, Currents",
|
||||
options={OpCodeDictKeys.TIMEOUT: 2.0},
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=GomspaceOpCodes.PRINT_LATCHUPS,
|
||||
info="PDU2: Print Latchups",
|
||||
)
|
||||
add_service_op_code_entry(
|
||||
srv_op_code_dict=cmd_dict,
|
||||
name="pdu2",
|
||||
info="PDU2 Device",
|
||||
op_code_entry=op_code_dict,
|
||||
)
|
||||
|
||||
|
||||
def add_pcdu_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
add_p60_cmds(cmd_dict)
|
||||
add_pdu1_cmds(cmd_dict)
|
||||
add_pdu2_cmds(cmd_dict)
|
||||
add_acu_cmds(cmd_dict)
|
@ -1,11 +1,16 @@
|
||||
# -*- 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
|
||||
"""
|
||||
import gomspace.gomspace_common as gs
|
||||
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
|
||||
from tmtccmd.tc.pus_3_fsfw_hk import (
|
||||
generate_one_hk_command,
|
||||
make_sid,
|
||||
generate_one_diag_command,
|
||||
)
|
||||
from gomspace.gomspace_common import *
|
||||
from gomspace.gomspace_pdu_definitions import *
|
||||
from config.object_ids import PDU_1_HANDLER_ID
|
||||
@ -50,13 +55,13 @@ class PDU1TestProcedure:
|
||||
turn_channel_3_off = False
|
||||
|
||||
|
||||
def pack_pdu1_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
def pack_pdu1_commands(object_id: ObjectId, tc_queue: TcQueueT, op_code: str):
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "Commanding PDU1"))
|
||||
|
||||
objb = object_id.as_bytes
|
||||
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,
|
||||
objb,
|
||||
PDUConfigTable.out_en_0.parameter_address,
|
||||
PDUConfigTable.out_en_0.parameter_size,
|
||||
Channel.on,
|
||||
@ -65,7 +70,7 @@ def pack_pdu1_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
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,
|
||||
objb,
|
||||
PDUConfigTable.out_en_0.parameter_address,
|
||||
PDUConfigTable.out_en_0.parameter_size,
|
||||
Channel.off,
|
||||
@ -74,7 +79,7 @@ def pack_pdu1_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
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,
|
||||
objb,
|
||||
PDUConfigTable.out_en_2.parameter_address,
|
||||
PDUConfigTable.out_en_2.parameter_size,
|
||||
Channel.on,
|
||||
@ -83,7 +88,7 @@ def pack_pdu1_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
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,
|
||||
objb,
|
||||
PDUConfigTable.out_en_2.parameter_address,
|
||||
PDUConfigTable.out_en_2.parameter_size,
|
||||
Channel.off,
|
||||
@ -92,7 +97,7 @@ def pack_pdu1_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
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,
|
||||
objb,
|
||||
PDUConfigTable.out_en_4.parameter_address,
|
||||
PDUConfigTable.out_en_4.parameter_size,
|
||||
Channel.on,
|
||||
@ -101,7 +106,7 @@ def pack_pdu1_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
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,
|
||||
objb,
|
||||
PDUConfigTable.out_en_4.parameter_address,
|
||||
PDUConfigTable.out_en_4.parameter_size,
|
||||
Channel.off,
|
||||
@ -110,7 +115,7 @@ def pack_pdu1_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
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,
|
||||
objb,
|
||||
PDUConfigTable.out_en_7.parameter_address,
|
||||
PDUConfigTable.out_en_7.parameter_size,
|
||||
Channel.on,
|
||||
@ -119,7 +124,7 @@ def pack_pdu1_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
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,
|
||||
objb,
|
||||
PDUConfigTable.out_en_7.parameter_address,
|
||||
PDUConfigTable.out_en_7.parameter_size,
|
||||
Channel.off,
|
||||
@ -128,7 +133,7 @@ def pack_pdu1_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
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,
|
||||
objb,
|
||||
PDUConfigTable.out_en_4.parameter_address,
|
||||
PDUConfigTable.out_en_4.parameter_size,
|
||||
Channel.off,
|
||||
@ -139,7 +144,7 @@ def pack_pdu1_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
(QueueCommands.PRINT, "PDU1: Turn Solar Cell Experiment on")
|
||||
)
|
||||
command = pack_set_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
PDUConfigTable.out_en_5.parameter_address,
|
||||
PDUConfigTable.out_en_5.parameter_size,
|
||||
Channel.on,
|
||||
@ -150,7 +155,7 @@ def pack_pdu1_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
(QueueCommands.PRINT, "PDU1: Turn Solar Cell Experiment off")
|
||||
)
|
||||
command = pack_set_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
PDUConfigTable.out_en_5.parameter_address,
|
||||
PDUConfigTable.out_en_5.parameter_size,
|
||||
Channel.off,
|
||||
@ -159,7 +164,7 @@ def pack_pdu1_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
if op_code == Pdu1OpCodes.SYRLINKS_ON.value:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn Syrlinks on"))
|
||||
command = pack_set_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
PDUConfigTable.out_en_1.parameter_address,
|
||||
PDUConfigTable.out_en_1.parameter_size,
|
||||
Channel.on,
|
||||
@ -168,7 +173,7 @@ def pack_pdu1_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
if op_code == Pdu1OpCodes.SYRLINKS_OFF.value:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn Syrlinks off"))
|
||||
command = pack_set_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
PDUConfigTable.out_en_1.parameter_address,
|
||||
PDUConfigTable.out_en_1.parameter_size,
|
||||
Channel.off,
|
||||
@ -177,7 +182,7 @@ def pack_pdu1_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
if op_code == Pdu1OpCodes.MGT_ON.value:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn MGT on"))
|
||||
command = pack_set_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
PDUConfigTable.out_en_3.parameter_address,
|
||||
PDUConfigTable.out_en_3.parameter_size,
|
||||
Channel.on,
|
||||
@ -186,7 +191,7 @@ def pack_pdu1_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
if op_code == Pdu1OpCodes.MGT_OFF.value:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn MGT off"))
|
||||
command = pack_set_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
PDUConfigTable.out_en_3.parameter_address,
|
||||
PDUConfigTable.out_en_3.parameter_size,
|
||||
Channel.off,
|
||||
@ -195,7 +200,7 @@ def pack_pdu1_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
if op_code == Pdu1OpCodes.PLOC_ON.value:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn PLOC on"))
|
||||
command = pack_set_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
PDUConfigTable.out_en_6.parameter_address,
|
||||
PDUConfigTable.out_en_6.parameter_size,
|
||||
Channel.on,
|
||||
@ -204,15 +209,20 @@ def pack_pdu1_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
if op_code == Pdu1OpCodes.PLOC_OFF.value:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn PLOC off"))
|
||||
command = pack_set_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
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_HK_ONCE:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Requesting HK Table Once"))
|
||||
hk_sid = make_sid(object_id=PDU_1_HANDLER_ID, set_id=SetIds.PDU_1)
|
||||
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())
|
||||
if op_code in GomspaceOpCodes.PRINT_SWITCH_V_I:
|
||||
@ -220,13 +230,13 @@ def pack_pdu1_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
(QueueCommands.PRINT, "PDU1: Print Switches, Voltages, Currents")
|
||||
)
|
||||
command = generate_action_command(
|
||||
object_id=object_id, action_id=GomspaceDeviceActionIds.PRINT_SWITCH_V_I
|
||||
object_id=objb, 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
|
||||
object_id=objb, action_id=GomspaceDeviceActionIds.PRINT_LATCHUPS
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if PDU1TestProcedure.all or PDU1TestProcedure.ping:
|
||||
@ -237,7 +247,7 @@ def pack_pdu1_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
if PDU1TestProcedure.all or PDU1TestProcedure.read_temperature:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Testing temperature reading"))
|
||||
command = pack_get_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
TableIds.hk,
|
||||
PDUHkTable.temperature.parameter_address,
|
||||
PDUHkTable.temperature.parameter_size,
|
||||
@ -248,7 +258,7 @@ def pack_pdu1_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
(QueueCommands.PRINT, "PDU1: Turn channel 2 on (Star Tracker)")
|
||||
)
|
||||
command = pack_set_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
PDUConfigTable.out_en_2.parameter_address,
|
||||
PDUConfigTable.out_en_2.parameter_size,
|
||||
Channel.on,
|
||||
@ -259,7 +269,7 @@ def pack_pdu1_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
(QueueCommands.PRINT, "PDU1: Turn channel 2 off (Star Tracker)")
|
||||
)
|
||||
command = pack_set_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
PDUConfigTable.out_en_2.parameter_address,
|
||||
PDUConfigTable.out_en_2.parameter_size,
|
||||
Channel.off,
|
||||
@ -268,7 +278,7 @@ def pack_pdu1_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
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,
|
||||
objb,
|
||||
PDUConfigTable.out_en_3.parameter_address,
|
||||
PDUConfigTable.out_en_3.parameter_size,
|
||||
Channel.on,
|
||||
@ -277,9 +287,19 @@ def pack_pdu1_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
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,
|
||||
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:
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, f"PDU1: {Info.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: "))
|
||||
command = gs.pack_set_param_command(object_id.as_bytes, memory_address, parameter_size, parameter)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
|
@ -8,7 +8,11 @@
|
||||
"""
|
||||
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
|
||||
from tmtccmd.tc.pus_3_fsfw_hk import (
|
||||
generate_one_hk_command,
|
||||
generate_one_diag_command,
|
||||
make_sid,
|
||||
)
|
||||
from gomspace.gomspace_common import *
|
||||
from gomspace.gomspace_pdu_definitions import *
|
||||
from config.object_ids import PDU_2_HANDLER_ID
|
||||
@ -62,13 +66,13 @@ class PDU2TestProcedure:
|
||||
request_hk_table = False
|
||||
|
||||
|
||||
def pack_pdu2_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
def pack_pdu2_commands(object_id: ObjectId, tc_queue: TcQueueT, op_code: str):
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "Testing PDU2"))
|
||||
|
||||
objb = object_id.as_bytes
|
||||
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,
|
||||
objb,
|
||||
PDUConfigTable.out_en_7.parameter_address,
|
||||
PDUConfigTable.out_en_7.parameter_size,
|
||||
Channel.on,
|
||||
@ -78,7 +82,7 @@ def pack_pdu2_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
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,
|
||||
objb,
|
||||
PDUConfigTable.out_en_7.parameter_address,
|
||||
PDUConfigTable.out_en_7.parameter_size,
|
||||
Channel.off,
|
||||
@ -88,7 +92,7 @@ def pack_pdu2_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
if op_code == Pdu2OpCodes.Q7S_OFF.value:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "Turning off Q7S OBC"))
|
||||
command = pack_set_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
PDUConfigTable.out_en_0.parameter_address,
|
||||
PDUConfigTable.out_en_0.parameter_size,
|
||||
Channel.off,
|
||||
@ -97,7 +101,7 @@ def pack_pdu2_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
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,
|
||||
objb,
|
||||
PDUConfigTable.out_en_4.parameter_address,
|
||||
PDUConfigTable.out_en_4.parameter_size,
|
||||
Channel.on,
|
||||
@ -106,7 +110,7 @@ def pack_pdu2_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
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,
|
||||
objb,
|
||||
PDUConfigTable.out_en_4.parameter_address,
|
||||
PDUConfigTable.out_en_4.parameter_size,
|
||||
Channel.off,
|
||||
@ -115,7 +119,7 @@ def pack_pdu2_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
if op_code == Pdu2OpCodes.RW_ON.value:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn reaction wheels on"))
|
||||
command = pack_set_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
PDUConfigTable.out_en_2.parameter_address,
|
||||
PDUConfigTable.out_en_2.parameter_size,
|
||||
Channel.on,
|
||||
@ -124,7 +128,7 @@ def pack_pdu2_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
if op_code == Pdu2OpCodes.RW_OFF.value:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Turn reaction wheels off"))
|
||||
command = pack_set_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
PDUConfigTable.out_en_2.parameter_address,
|
||||
PDUConfigTable.out_en_2.parameter_size,
|
||||
Channel.off,
|
||||
@ -135,7 +139,7 @@ def pack_pdu2_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
(QueueCommands.PRINT, "PDU2: Turn PDU2 PL PCDU Channel 1 on")
|
||||
)
|
||||
command = pack_set_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
PDUConfigTable.out_en_1.parameter_address,
|
||||
PDUConfigTable.out_en_1.parameter_size,
|
||||
Channel.on,
|
||||
@ -146,7 +150,7 @@ def pack_pdu2_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
(QueueCommands.PRINT, "PDU2: Turn PDU2 PL PCDU Channel 1 off")
|
||||
)
|
||||
command = pack_set_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
PDUConfigTable.out_en_1.parameter_address,
|
||||
PDUConfigTable.out_en_1.parameter_size,
|
||||
Channel.off,
|
||||
@ -157,7 +161,7 @@ def pack_pdu2_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
(QueueCommands.PRINT, "PDU2: Turn PDU2 PL PCDU Channel 6 on")
|
||||
)
|
||||
command = pack_set_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
PDUConfigTable.out_en_6.parameter_address,
|
||||
PDUConfigTable.out_en_6.parameter_size,
|
||||
Channel.off,
|
||||
@ -168,7 +172,7 @@ def pack_pdu2_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
(QueueCommands.PRINT, "PDU2: Turn PDU2 PL PCDU Channel 6 off")
|
||||
)
|
||||
command = pack_set_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
PDUConfigTable.out_en_6.parameter_address,
|
||||
PDUConfigTable.out_en_6.parameter_size,
|
||||
Channel.off,
|
||||
@ -177,7 +181,7 @@ def pack_pdu2_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
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,
|
||||
objb,
|
||||
PDUConfigTable.out_en_3.parameter_address,
|
||||
PDUConfigTable.out_en_3.parameter_size,
|
||||
Channel.on,
|
||||
@ -186,7 +190,7 @@ def pack_pdu2_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
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,
|
||||
objb,
|
||||
PDUConfigTable.out_en_3.parameter_address,
|
||||
PDUConfigTable.out_en_3.parameter_size,
|
||||
Channel.off,
|
||||
@ -197,7 +201,7 @@ def pack_pdu2_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
(QueueCommands.PRINT, "PDU2: Turn Solar Array Deployment On")
|
||||
)
|
||||
command = pack_set_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
PDUConfigTable.out_en_5.parameter_address,
|
||||
PDUConfigTable.out_en_5.parameter_size,
|
||||
Channel.on,
|
||||
@ -208,7 +212,7 @@ def pack_pdu2_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
(QueueCommands.PRINT, "PDU2: Turn Solar Array Deployment Off")
|
||||
)
|
||||
command = pack_set_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
PDUConfigTable.out_en_5.parameter_address,
|
||||
PDUConfigTable.out_en_5.parameter_size,
|
||||
Channel.off,
|
||||
@ -217,7 +221,7 @@ def pack_pdu2_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
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,
|
||||
objb,
|
||||
PDUConfigTable.out_en_8.parameter_address,
|
||||
PDUConfigTable.out_en_8.parameter_size,
|
||||
Channel.on,
|
||||
@ -226,15 +230,20 @@ def pack_pdu2_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
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,
|
||||
objb,
|
||||
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_HK_ONCE:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Requesting HK Table Once"))
|
||||
hk_sid = make_sid(object_id=PDU_2_HANDLER_ID, set_id=SetIds.PDU_2)
|
||||
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())
|
||||
if op_code in GomspaceOpCodes.PRINT_SWITCH_V_I:
|
||||
@ -242,13 +251,13 @@ def pack_pdu2_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
(QueueCommands.PRINT, "PDU2: Print Switches, Currents, Voltahes")
|
||||
)
|
||||
command = generate_action_command(
|
||||
object_id=object_id, action_id=GomspaceDeviceActionIds.PRINT_SWITCH_V_I
|
||||
object_id=objb, 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
|
||||
object_id=objb, action_id=GomspaceDeviceActionIds.PRINT_LATCHUPS
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if PDU2TestProcedure.all or PDU2TestProcedure.reboot:
|
||||
@ -260,7 +269,7 @@ def pack_pdu2_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
(QueueCommands.PRINT, "PDU2: Reading ground watchdog timer value")
|
||||
)
|
||||
command = pack_get_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
TableIds.hk,
|
||||
PDUHkTable.wdt_gnd_left.parameter_address,
|
||||
PDUHkTable.wdt_gnd_left.parameter_size,
|
||||
@ -285,7 +294,7 @@ def pack_pdu2_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
)
|
||||
)
|
||||
command = pack_set_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
PDUConfigTable.out_en_2.parameter_address,
|
||||
PDUConfigTable.out_en_2.parameter_size,
|
||||
Channel.on,
|
||||
@ -294,7 +303,7 @@ def pack_pdu2_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
if PDU2TestProcedure.all or PDU2TestProcedure.read_temperature:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "PDU2: Testing temperature reading"))
|
||||
command = pack_get_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
TableIds.hk,
|
||||
PDUHkTable.temperature.parameter_address,
|
||||
PDUHkTable.temperature.parameter_size,
|
||||
@ -305,7 +314,7 @@ def pack_pdu2_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
(QueueCommands.PRINT, "PDU2: Reading output channel 2 state (TCS Heater)")
|
||||
)
|
||||
command = pack_get_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
TableIds.config,
|
||||
PDUConfigTable.out_en_2.parameter_address,
|
||||
PDUConfigTable.out_en_2.parameter_size,
|
||||
@ -319,7 +328,7 @@ def pack_pdu2_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
)
|
||||
)
|
||||
command = pack_get_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
TableIds.config,
|
||||
PDUConfigTable.cur_lu_lim_0.parameter_address,
|
||||
PDUConfigTable.cur_lu_lim_0.parameter_size,
|
||||
@ -330,7 +339,7 @@ def pack_pdu2_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
(QueueCommands.PRINT, "PDU2: Testing setting output channel 2 off")
|
||||
)
|
||||
command = pack_set_param_command(
|
||||
object_id,
|
||||
objb,
|
||||
PDUConfigTable.out_en_2.parameter_address,
|
||||
PDUConfigTable.out_en_2.parameter_size,
|
||||
Channel.off,
|
||||
|
@ -14,7 +14,7 @@ from tmtccmd.logging import get_console_logger
|
||||
from tmtccmd.tc.packer import TcQueueT
|
||||
from spacepackets.ecss.tc import PusTelecommand
|
||||
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()
|
||||
|
||||
@ -36,6 +36,8 @@ sequence_file_dict = {
|
||||
"3": ["0:/EQ04/E-75", "0:/EQ04/E-75"],
|
||||
}
|
||||
|
||||
CARRIAGE_RETURN = 0xD
|
||||
|
||||
|
||||
class CommandIds(enum.IntEnum):
|
||||
TC_MEM_WRITE = 1
|
||||
@ -49,14 +51,19 @@ class CommandIds(enum.IntEnum):
|
||||
TC_DOWNLINK_PWR_OFF = 15
|
||||
OBSW_RESET_SEQ_COUNT = 50
|
||||
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):
|
||||
DEADBEEF = 0x40000004
|
||||
|
||||
|
||||
class PlocReplyIds:
|
||||
tm_mem_read_report = 6
|
||||
class PlocReplyIds(enum.IntEnum):
|
||||
TM_MEM_READ_RPT = 6
|
||||
TM_CAM_CMD_RPT = 19
|
||||
|
||||
|
||||
def pack_ploc_mpsoc_commands(
|
||||
@ -160,6 +167,31 @@ def pack_ploc_mpsoc_commands(
|
||||
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"))
|
||||
cam_cmd = input("Specify cam command string: ")
|
||||
command = (
|
||||
object_id
|
||||
+ 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())
|
||||
elif op_code == "17":
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: Set UART TX tristate"))
|
||||
command = object_id + struct.pack("!I", CommandIds.SET_UART_TX_TRISTATE)
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=33, app_data=command)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
elif op_code == "18":
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: Release UART TX"))
|
||||
command = object_id + struct.pack("!I", CommandIds.RELEASE_UART_TX)
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=33, app_data=command)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
|
||||
return tc_queue
|
||||
|
||||
|
@ -12,7 +12,8 @@ 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.pus_200_fsfw_modes import pack_mode_data, Modes
|
||||
from utility.input_helper import InputHelper
|
||||
|
||||
LOGGER = get_console_logger()
|
||||
|
||||
@ -26,10 +27,33 @@ latchup_id_dict = {
|
||||
"6": "SAFECOTS",
|
||||
}
|
||||
|
||||
MANUAL_INPUT = "1"
|
||||
|
||||
update_file_dict = {
|
||||
MANUAL_INPUT: ["manual input", ""],
|
||||
"2": ["/mnt/sd0/ploc/supervisor/update.bin", "/mnt/sd0/ploc/supervisor/update.bin"],
|
||||
"3": [
|
||||
"/mnt/sd0/ploc/supervisor/update-large.bin",
|
||||
"/mnt/sd0/ploc/supervisor/update-large.bin",
|
||||
],
|
||||
"4": [
|
||||
"/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 = {
|
||||
MANUAL_INPUT: ["manual input", ""],
|
||||
"2": ["/mnt/sd0/ploc/supervisor", "/mnt/sd0/ploc/supervisor"],
|
||||
}
|
||||
|
||||
|
||||
class SupvActionIds:
|
||||
HK_REPORT = 1
|
||||
RESTART_MPSOC = 2
|
||||
START_MPSOC = 3
|
||||
SHUTWOWN_MPSOC = 4
|
||||
SEL_MPSOC_BOOT_IMAGE = 5
|
||||
@ -40,35 +64,41 @@ class SupvActionIds:
|
||||
DISABLE_HK = 10
|
||||
GET_BOOT_STATUS_REPORT = 11
|
||||
UPDATE_AVAILABLE = 12
|
||||
WATCHDOGS_ENABLE = 13
|
||||
WATCHDOGS_CONFIG_TIMEOUT = 14
|
||||
ENABLE_LATCHUP_ALERT = 15
|
||||
DISABLE_LATCHUP_ALERT = 16
|
||||
AUTO_CALIBRATE_ALERT = 17
|
||||
SET_ALERT_LIMIT = 18
|
||||
SET_ALERT_IRQ_FILTER = 19
|
||||
SET_ADC_SWEEP_PERIOD = 20
|
||||
SET_ADC_ENABLED_CHANNELS = 21
|
||||
SET_ADC_WINDOW_AND_STRIDE = 22
|
||||
SET_ADC_THRESHOLD = 23
|
||||
GET_LATCHUP_STATUS_REPORT = 24
|
||||
COPY_ADC_DATA_TO_MRAM = 25
|
||||
ENABLE_NVMS = 26
|
||||
SELECT_NVM = 27
|
||||
RUN_AUTO_EM_TESTS = 28
|
||||
WIPE_MRAM = 29
|
||||
DUMP_MRAM = 30
|
||||
SET_DBG_VERBOSITY = 31
|
||||
CAN_LOOPBACK_TEST = 32
|
||||
PRINT_CPU_STATS = 33
|
||||
SET_GPIO = 34
|
||||
READ_GPIO = 35
|
||||
RESTART_SUPERVISOR = 36
|
||||
FACTORY_RESET_CLEAR_ALL = 37
|
||||
REQUEST_LOGGING_DATA = 38
|
||||
LOGGING_REQUEST_COUNTERS = 38
|
||||
UPDATE_IMAGE_DATA = 39
|
||||
FACTORY_RESET_CLEAR_MIRROR = 40
|
||||
FACTORY_RESET_CLEAR_CIRCULAR = 41
|
||||
START_MPSOC_QUIET = 45
|
||||
SET_SHUTDOWN_TIMEOUT = 46
|
||||
FACTORY_FLASH = 47
|
||||
PERFORM_UPDATE = 48
|
||||
TERMINATE_SUPV_HELPER = 49
|
||||
ENABLE_AUTO_TM = 50
|
||||
DISABLE_AUTO_TM = 51
|
||||
LOGGING_REQUEST_EVENT_BUFFERS = 54
|
||||
LOGGING_CLEAR_COUNTERS = 55
|
||||
LOGGING_SET_TOPIC = 56
|
||||
REQUEST_ADC_REPORT = 57
|
||||
RESET_PL = 58
|
||||
ENABLE_NVMS = 59
|
||||
CONTINUE_UPDATE = 60
|
||||
|
||||
|
||||
class SupvHkIds:
|
||||
@ -96,7 +126,7 @@ def pack_ploc_supv_commands(
|
||||
command = PusTelecommand(service=200, subservice=1, ssc=10, app_data=command)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if op_code == "2":
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Mode Normal"))
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: 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())
|
||||
@ -105,11 +135,6 @@ def pack_ploc_supv_commands(
|
||||
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())
|
||||
elif op_code == "4":
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Restart MPSoC"))
|
||||
command = object_id + struct.pack("!I", SupvActionIds.RESTART_MPSOC)
|
||||
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 Supervisor: Start MPSoC"))
|
||||
command = object_id + struct.pack("!I", SupvActionIds.START_MPSOC)
|
||||
@ -124,10 +149,10 @@ def pack_ploc_supv_commands(
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "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):"))
|
||||
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())
|
||||
@ -135,7 +160,7 @@ def pack_ploc_supv_commands(
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "PLOC Supervisor: Set max restart tries")
|
||||
)
|
||||
restart_tries = int(input("Set maximum restart tries:"))
|
||||
restart_tries = int(input("Specify maximum restart tries: "))
|
||||
command = (
|
||||
object_id
|
||||
+ struct.pack("!I", SupvActionIds.SET_MAX_RESTART_TRIES)
|
||||
@ -157,7 +182,7 @@ def pack_ploc_supv_commands(
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
elif op_code == "11":
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Set boot timeout"))
|
||||
boot_timeout = int(input("Specify boot timeout [ms]:"))
|
||||
boot_timeout = int(input("Specify boot timeout [ms]: "))
|
||||
command = (
|
||||
object_id
|
||||
+ struct.pack("!I", SupvActionIds.SET_BOOT_TIMEOUT)
|
||||
@ -177,23 +202,6 @@ def pack_ploc_supv_commands(
|
||||
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 == "14":
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Update available"))
|
||||
command = pack_update_available_cmd(object_id)
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=31, app_data=command)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
elif op_code == "15":
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Watchdogs Enable"))
|
||||
command = pack_watchdogs_enable_cmd(object_id)
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=32, app_data=command)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
elif op_code == "16":
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "PLOC Supervisor: Watchdog configure timeout")
|
||||
)
|
||||
command = pack_watchdog_config_timeout_cmd(object_id)
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=33, app_data=command)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
elif op_code == "17":
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "PLOC Supervisor: Enable latchup alert")
|
||||
@ -208,32 +216,11 @@ def pack_ploc_supv_commands(
|
||||
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 == "19":
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "PLOC Supervisor: Auto calibrate alert")
|
||||
)
|
||||
command = pack_auto_calibrate_alert_cmd(object_id)
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=36, 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 == "21":
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "PLOC Supervisor: Set alert irq filter")
|
||||
)
|
||||
command = pack_set_alert_irq_filter_cmd(object_id)
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=38, app_data=command)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
elif op_code == "22":
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "PLOC Supervisor: Set ADC sweep period")
|
||||
)
|
||||
command = pack_set_adc_sweep_period_cmd(object_id)
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=39, 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")
|
||||
@ -267,18 +254,6 @@ def pack_ploc_supv_commands(
|
||||
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 == "28":
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "PLOC Supervisor: Enalbe/Disable NVMs")
|
||||
)
|
||||
command = pack_enable_nvms_cmd(object_id)
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=45, app_data=command)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
elif op_code == "29":
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Select NVM"))
|
||||
command = pack_select_nvm_cmd(object_id)
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=45, 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)
|
||||
@ -289,18 +264,6 @@ def pack_ploc_supv_commands(
|
||||
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 == "33":
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Print CPU stats"))
|
||||
command = pack_print_cpu_stats_cmd(object_id)
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=48, app_data=command)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
elif op_code == "34":
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "PLOC Supervisor: Set debug verbosity")
|
||||
)
|
||||
command = pack_set_debug_verbosity_cmd(object_id)
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=49, 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)
|
||||
@ -315,25 +278,21 @@ def pack_ploc_supv_commands(
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "PLOC Supervisor: Restart supervisor")
|
||||
)
|
||||
command = command = object_id + struct.pack(
|
||||
"!I", SupvActionIds.RESTART_SUPERVISOR
|
||||
)
|
||||
command = object_id + 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(
|
||||
"!I", SupvActionIds.FACTORY_RESET_CLEAR_ALL
|
||||
)
|
||||
command = object_id + 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 = command = object_id + struct.pack(
|
||||
command = object_id + struct.pack(
|
||||
"!I", SupvActionIds.FACTORY_RESET_CLEAR_MIRROR
|
||||
)
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=54, app_data=command)
|
||||
@ -345,17 +304,104 @@ def pack_ploc_supv_commands(
|
||||
"PLOC Supervisor: Factory reset clear circular entries",
|
||||
)
|
||||
)
|
||||
command = command = object_id + struct.pack(
|
||||
command = object_id + 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 == "41":
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: CAN loopback test"))
|
||||
command = command = object_id + struct.pack(
|
||||
"!I", SupvActionIds.CAN_LOOPBACK_TEST
|
||||
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")
|
||||
)
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=56, app_data=command)
|
||||
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")
|
||||
)
|
||||
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")
|
||||
)
|
||||
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")
|
||||
)
|
||||
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")
|
||||
)
|
||||
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")
|
||||
)
|
||||
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())
|
||||
elif op_code == "57":
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "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
|
||||
+ struct.pack("!I", SupvActionIds.ENABLE_NVMS)
|
||||
+ struct.pack("B", nvm01)
|
||||
+ struct.pack("B", nvm3)
|
||||
)
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=72, app_data=command)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
elif op_code == "58":
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Continue update"))
|
||||
command = object_id + struct.pack("!I", SupvActionIds.CONTINUE_UPDATE)
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=73, app_data=command)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
|
||||
return tc_queue
|
||||
@ -371,7 +417,6 @@ def pack_sel_boot_image_cmd(
|
||||
@param bp1 Partition pin 1
|
||||
@param bp2 Partition pin 2
|
||||
"""
|
||||
command = bytearray()
|
||||
command = object_id + struct.pack("!I", SupvActionIds.SEL_MPSOC_BOOT_IMAGE)
|
||||
command = command + struct.pack("!B", mem)
|
||||
command = command + struct.pack("!B", bp0)
|
||||
@ -390,7 +435,6 @@ def pack_update_available_cmd(object_id: bytearray) -> bytearray:
|
||||
image_size = 222
|
||||
image_crc = 0x0
|
||||
number_of_packets = 150
|
||||
command = bytearray()
|
||||
command = object_id + struct.pack("!I", SupvActionIds.UPDATE_AVAILABLE)
|
||||
command = command + struct.pack("!B", image_select)
|
||||
command = command + struct.pack("!B", image_partition)
|
||||
@ -453,7 +497,7 @@ def pack_auto_calibrate_alert_cmd(object_id: bytearray) -> bytearray:
|
||||
@param object_id The object id of the PLOC supervisor handler.
|
||||
"""
|
||||
latchup_id = get_latchup_id()
|
||||
mg = int(input("Specify MG:"))
|
||||
mg = int(input("Specify MG: "))
|
||||
command = bytearray()
|
||||
command = object_id + struct.pack("!I", SupvActionIds.AUTO_CALIBRATE_ALERT)
|
||||
command = command + struct.pack("!B", latchup_id)
|
||||
@ -474,7 +518,7 @@ def get_latchup_id() -> int:
|
||||
key_string = key.ljust(key_column_width)
|
||||
description_string = latchup_id_dict[key].ljust(description_column_width)
|
||||
print(f"{key_string} | {description_string}")
|
||||
return int(input("Specify latchup ID:"))
|
||||
return int(input("Specify latchup ID: "))
|
||||
|
||||
|
||||
def pack_set_alert_limit_cmd(object_id: bytearray) -> bytearray:
|
||||
@ -483,7 +527,7 @@ def pack_set_alert_limit_cmd(object_id: bytearray) -> bytearray:
|
||||
@param object_id The object id of the PLOC supervisor handler.
|
||||
"""
|
||||
latchup_id = get_latchup_id()
|
||||
dutycycle = int(input("Specify dutycycle:"))
|
||||
dutycycle = int(input("Specify dutycycle: "))
|
||||
command = bytearray()
|
||||
command = object_id + struct.pack("!I", SupvActionIds.SET_ALERT_LIMIT)
|
||||
command = command + struct.pack("!B", latchup_id)
|
||||
@ -491,49 +535,20 @@ def pack_set_alert_limit_cmd(object_id: bytearray) -> bytearray:
|
||||
return command
|
||||
|
||||
|
||||
def pack_set_alert_irq_filter_cmd(object_id: bytearray) -> bytearray:
|
||||
"""
|
||||
@brief This function packs the command to configure the latchup alert irq filter.
|
||||
@param object_id The object id of the PLOC supervisor handler.
|
||||
"""
|
||||
latchup_id = get_latchup_id()
|
||||
tp = int(input("Specify filter type (TP):"))
|
||||
div = int(input("Specify clock divider (DIV):"))
|
||||
command = bytearray()
|
||||
command = object_id + struct.pack("!I", SupvActionIds.SET_ALERT_IRQ_FILTER)
|
||||
command = command + struct.pack("!B", latchup_id)
|
||||
command = command + struct.pack("!B", tp)
|
||||
command = command + struct.pack("!B", div)
|
||||
return command
|
||||
|
||||
|
||||
def pack_set_adc_sweep_period_cmd(object_id: bytearray) -> 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.
|
||||
"""
|
||||
sweep_period = int(input("Specify sweep period (min 21 us):"))
|
||||
command = bytearray()
|
||||
command = object_id + struct.pack("!I", SupvActionIds.SET_ADC_SWEEP_PERIOD)
|
||||
command = command + struct.pack("!I", sweep_period)
|
||||
return command
|
||||
|
||||
|
||||
def pack_set_adc_enabled_channels_cmd(object_id: bytearray) -> 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.
|
||||
"""
|
||||
ch = int(input("Specify ch:"))
|
||||
command = bytearray()
|
||||
command = object_id + struct.pack("!I", SupvActionIds.SET_ADC_ENABLED_CHANNELS)
|
||||
command = command + struct.pack("!H", ch)
|
||||
return command
|
||||
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
|
||||
|
||||
|
||||
def pack_set_adc_window_and_stride_cmd(object_id: bytearray) -> bytearray:
|
||||
window_size = int(input("Specify window size:"))
|
||||
striding_step_size = int(input("Specify striding step size:"))
|
||||
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)
|
||||
@ -542,25 +557,15 @@ def pack_set_adc_window_and_stride_cmd(object_id: bytearray) -> bytearray:
|
||||
|
||||
|
||||
def pack_set_adc_threshold_cmd(object_id: bytearray) -> bytearray:
|
||||
threshold = int(input("Specify threshold:"))
|
||||
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
|
||||
|
||||
|
||||
def pack_enable_nvms_cmd(object_id: bytearray) -> bytearray:
|
||||
n01 = int(input("NVM0/1 (0 - off, 1 - on):"))
|
||||
n3 = int(input("NVM3 (0 - off, 1 - on):"))
|
||||
command = bytearray()
|
||||
command = object_id + struct.pack("!I", SupvActionIds.ENABLE_NVMS)
|
||||
command = command + struct.pack("!B", n01)
|
||||
command = command + struct.pack("!B", n3)
|
||||
return command
|
||||
|
||||
|
||||
def pack_select_nvm_cmd(object_id: bytearray) -> bytearray:
|
||||
mem = int(input("Specify NVM (0 - NVM0, 1 - MVM1):"))
|
||||
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)
|
||||
@ -568,7 +573,7 @@ def pack_select_nvm_cmd(object_id: bytearray) -> bytearray:
|
||||
|
||||
|
||||
def pack_auto_em_tests_cmd(object_id: bytearray) -> bytearray:
|
||||
test = int(input("Specify test (1 - complete, 2 - short):"))
|
||||
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)
|
||||
@ -585,52 +590,43 @@ def pack_mram_wipe_cmd(object_id: bytearray) -> bytearray:
|
||||
return command
|
||||
|
||||
|
||||
def pack_print_cpu_stats_cmd(object_id: bytearray) -> bytearray:
|
||||
en = 1
|
||||
def pack_update_command(object_id: bytearray) -> bytearray:
|
||||
command = bytearray()
|
||||
command = object_id + struct.pack("!I", SupvActionIds.PRINT_CPU_STATS)
|
||||
command = command + struct.pack("!B", en)
|
||||
memory_id = int(input("Specify memory ID: "))
|
||||
start_address = int(input("Specify start address: 0x"), 16)
|
||||
update_file = get_update_file()
|
||||
command += object_id
|
||||
command += struct.pack("!I", SupvActionIds.PERFORM_UPDATE)
|
||||
command += bytearray(update_file, "utf-8")
|
||||
# Adding null terminator
|
||||
command += struct.pack("!B", 0)
|
||||
command += struct.pack("!B", memory_id)
|
||||
command += struct.pack("!I", start_address)
|
||||
return command
|
||||
|
||||
|
||||
def pack_set_debug_verbosity_cmd(object_id: bytearray) -> bytearray:
|
||||
def pack_set_shutdown_timeout_command(object_id: bytearray) -> bytearray:
|
||||
command = bytearray()
|
||||
verbosity = get_debug_verbosity()
|
||||
command = object_id + struct.pack("!I", SupvActionIds.SET_DBG_VERBOSITY)
|
||||
command = command + struct.pack("!B", verbosity)
|
||||
command += object_id
|
||||
command += struct.pack("!I", SupvActionIds.SET_SHUTDOWN_TIMEOUT)
|
||||
timeout = int(input("Specify shutdown timeout (ms): "))
|
||||
command += struct.pack("!I", timeout)
|
||||
return command
|
||||
|
||||
|
||||
def get_debug_verbosity() -> int:
|
||||
tries = 0
|
||||
while tries < 3:
|
||||
try:
|
||||
print("Debug verbosity options")
|
||||
verbosity_options_dict = {
|
||||
0: "None",
|
||||
1: "Error",
|
||||
2: "Warn",
|
||||
3: "Info",
|
||||
}
|
||||
print("{:<6} | {}".format("Key", "Description"))
|
||||
for entry in verbosity_options_dict.items():
|
||||
print("{:<6} | {}".format(entry[0], entry[1]))
|
||||
verbosity = int(input("Specify verbosity key: "))
|
||||
if verbosity > len(verbosity_options_dict) - 1:
|
||||
raise ValueError
|
||||
return verbosity
|
||||
except ValueError:
|
||||
LOGGER.warning("Invalid verbosity key specified")
|
||||
tries = tries + 1
|
||||
LOGGER.error("get_debug_verbosity: Exceeded max tries to input verbosity key")
|
||||
quit()
|
||||
def pack_logging_buffer_request(object_id: bytearray) -> bytearray:
|
||||
command = bytearray()
|
||||
command += object_id
|
||||
command += struct.pack("!I", SupvActionIds.LOGGING_REQUEST_EVENT_BUFFERS)
|
||||
path = get_event_buffer_path()
|
||||
command += bytearray(path, "utf-8")
|
||||
return command
|
||||
|
||||
|
||||
def pack_set_gpio_cmd(object_id: bytearray) -> bytearray:
|
||||
port = int(input("Specify port: "))
|
||||
pin = int(input("Specify pin: "))
|
||||
val = int(input("Specify val: "))
|
||||
command = 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)
|
||||
@ -639,10 +635,38 @@ def pack_set_gpio_cmd(object_id: bytearray) -> bytearray:
|
||||
|
||||
|
||||
def pack_read_gpio_cmd(object_id: bytearray) -> bytearray:
|
||||
port = int(input("Specify port: "))
|
||||
pin = int(input("Specify pin: "))
|
||||
command = 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
|
||||
|
||||
|
||||
def pack_logging_set_topic(objetc_id: bytearray) -> bytearray:
|
||||
command = objetc_id + struct.pack("!I", SupvActionIds.LOGGING_SET_TOPIC)
|
||||
tpc = int(input("Specify logging topic: "))
|
||||
command += struct.pack("!B", tpc)
|
||||
return command
|
||||
|
||||
|
||||
def get_update_file() -> str:
|
||||
LOGGER.info("Specify update file ")
|
||||
input_helper = InputHelper(update_file_dict)
|
||||
key = input_helper.get_key()
|
||||
if key == MANUAL_INPUT:
|
||||
file = input("Ploc Supervisor: Specify absolute name of update file: ")
|
||||
else:
|
||||
file = update_file_dict[key][1]
|
||||
return file
|
||||
|
||||
|
||||
def get_event_buffer_path() -> str:
|
||||
LOGGER.info("Specify path where to store event buffer file ")
|
||||
input_helper = InputHelper(event_buffer_path_dict)
|
||||
key = input_helper.get_key()
|
||||
if key == MANUAL_INPUT:
|
||||
file = input("Ploc Supervisor: Specify path: ")
|
||||
else:
|
||||
file = event_buffer_path_dict[key][1]
|
||||
return 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())
|
@ -1,10 +1,27 @@
|
||||
import enum
|
||||
import struct
|
||||
import time
|
||||
from typing import Optional
|
||||
|
||||
from tmtccmd.config import QueueCommands
|
||||
from config.definitions import CustomServiceList
|
||||
from tmtccmd.config import (
|
||||
QueueCommands,
|
||||
ServiceOpCodeDictT,
|
||||
add_op_code_entry,
|
||||
add_service_op_code_entry,
|
||||
)
|
||||
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 tmtccmd.tc.pus_3_fsfw_hk import (
|
||||
generate_one_hk_command,
|
||||
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 +34,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,12 +53,6 @@ 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"
|
||||
@ -50,6 +64,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,6 +118,85 @@ class ParamIds(enum.IntEnum):
|
||||
INJECT_ALL_ON_FAILURE = 35
|
||||
|
||||
|
||||
def add_pl_pcdu_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
op_code_dict = dict()
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict, keys=OpCodes.SWITCH_ON, info=Info.SWITCH_ON
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict, keys=OpCodes.SWITCH_OFF, info=Info.SWITCH_OFF
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=OpCodes.NORMAL_SSR,
|
||||
info=Info.NORMAL_SSR,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=OpCodes.NORMAL_DRO,
|
||||
info=Info.NORMAL_DRO,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=OpCodes.NORMAL_X8,
|
||||
info=Info.NORMAL_X8,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=OpCodes.NORMAL_TX,
|
||||
info=Info.NORMAL_TX,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=OpCodes.NORMAL_MPA,
|
||||
info=Info.NORMAL_MPA,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=OpCodes.NORMAL_HPA,
|
||||
info=Info.NORMAL_HPA,
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict, keys=OpCodes.REQ_OS_HK, info=Info.REQ_OS_HK
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=OpCodes.INJECT_SSR_TO_DRO_FAILURE,
|
||||
info="Inject failure SSR to DRO transition",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=OpCodes.INJECT_DRO_TO_X8_FAILURE,
|
||||
info="Inject failure in DRO to X8 transition",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=OpCodes.INJECT_X8_TO_TX_FAILURE,
|
||||
info="Inject failure in X8 to TX transition",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=OpCodes.INJECT_TX_TO_MPA_FAILURE,
|
||||
info="Inject failure in TX to MPA transition",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=OpCodes.INJECT_MPA_TO_HPA_FAILURE,
|
||||
info="Inject failure in MPA to HPA transition",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=OpCodes.INJECT_ALL_ON_FAILURE,
|
||||
info="Inject failure in all on mode",
|
||||
)
|
||||
add_service_op_code_entry(
|
||||
srv_op_code_dict=cmd_dict,
|
||||
name=CustomServiceList.PL_PCDU.value,
|
||||
info="PL PCDU",
|
||||
op_code_entry=op_code_dict,
|
||||
)
|
||||
|
||||
|
||||
def pack_pl_pcdu_commands(tc_queue: TcQueueT, op_code: str):
|
||||
if op_code in OpCodes.SWITCH_ON:
|
||||
pack_pl_pcdu_mode_cmd(
|
||||
@ -113,68 +211,53 @@ def pack_pl_pcdu_commands(tc_queue: TcQueueT, op_code: str):
|
||||
tc_queue=tc_queue,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, f"PL PCDU: {Info.REQ_OS_HK}"))
|
||||
cmd = generate_one_diag_command(
|
||||
sid=make_sid(object_id=PL_PCDU_ID, set_id=SetIds.ADC), ssc=0
|
||||
)
|
||||
tc_queue.appendleft(cmd.pack_command_tuple())
|
||||
if op_code in OpCodes.SWITCH_HPA_ON_PROC:
|
||||
hpa_on_procedure(tc_queue)
|
||||
if op_code in OpCodes.INJECT_ALL_ON_FAILURE:
|
||||
pack_failure_injection_cmd(
|
||||
tc_queue=tc_queue,
|
||||
@ -183,6 +266,129 @@ def pack_pl_pcdu_commands(tc_queue: TcQueueT, op_code: str):
|
||||
)
|
||||
|
||||
|
||||
def hpa_on_procedure(tc_queue: TcQueueT):
|
||||
delay_dro_to_x8 = request_wait_time()
|
||||
if delay_dro_to_x8 is None:
|
||||
delay_dro_to_x8 = 900
|
||||
tc_queue.appendleft(
|
||||
(
|
||||
QueueCommands.PRINT,
|
||||
f"Starting procedure to switch on PL PCDU HPA with DRO to X8 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(ssc=0)
|
||||
|
||||
sched_time = current_time + 10
|
||||
tc_queue.appendleft(enb_sched.pack_command_tuple())
|
||||
tagged_on_cmd = generate_time_tagged_cmd(
|
||||
release_time=struct.pack("!I", sched_time),
|
||||
tc_to_insert=pl_pcdu_on,
|
||||
ssc=1,
|
||||
)
|
||||
tc_queue.appendleft(tagged_on_cmd.pack_command_tuple())
|
||||
|
||||
sched_time += 5
|
||||
tagged_ssr_cmd = generate_time_tagged_cmd(
|
||||
release_time=struct.pack("!I", sched_time),
|
||||
tc_to_insert=ssr_on,
|
||||
ssc=2,
|
||||
)
|
||||
tc_queue.appendleft(tagged_ssr_cmd.pack_command_tuple())
|
||||
|
||||
sched_time += 5
|
||||
tagged_dro_cmd = generate_time_tagged_cmd(
|
||||
release_time=struct.pack("!I", sched_time), tc_to_insert=dro_on, ssc=3
|
||||
)
|
||||
tc_queue.appendleft(tagged_dro_cmd.pack_command_tuple())
|
||||
|
||||
sched_time += delay_dro_to_x8
|
||||
tagged_x8_cmd = generate_time_tagged_cmd(
|
||||
release_time=struct.pack("!I", sched_time), tc_to_insert=x8_on, ssc=4
|
||||
)
|
||||
tc_queue.appendleft(tagged_x8_cmd.pack_command_tuple())
|
||||
|
||||
sched_time += 5
|
||||
tagged_tx_cmd = generate_time_tagged_cmd(
|
||||
release_time=struct.pack("!I", sched_time), tc_to_insert=tx_on, ssc=5
|
||||
)
|
||||
tc_queue.appendleft(tagged_tx_cmd.pack_command_tuple())
|
||||
|
||||
sched_time += 5
|
||||
tagged_mpa_cmd = generate_time_tagged_cmd(
|
||||
release_time=struct.pack("!I", sched_time), tc_to_insert=mpa_on, ssc=6
|
||||
)
|
||||
tc_queue.appendleft(tagged_mpa_cmd.pack_command_tuple())
|
||||
|
||||
sched_time += 5
|
||||
tagged_hpa_cmd = generate_time_tagged_cmd(
|
||||
release_time=struct.pack("!I", sched_time), tc_to_insert=hpa_on, ssc=7
|
||||
)
|
||||
tc_queue.appendleft(tagged_hpa_cmd.pack_command_tuple())
|
||||
|
||||
|
||||
def request_wait_time() -> Optional[float]:
|
||||
while True:
|
||||
wait_time = input("Please enter DRO to X8 wait time in seconds, x to cancel: ")
|
||||
@ -199,6 +405,45 @@ def request_wait_time() -> Optional[float]:
|
||||
return 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(tc_queue: TcQueueT, param_id: int, print_str: str):
|
||||
wait_time = request_wait_time()
|
||||
tc_queue.appendleft(
|
||||
@ -225,7 +470,7 @@ def pack_failure_injection_cmd(tc_queue: TcQueueT, param_id: int, print_str: str
|
||||
tc_queue.appendleft(cmd.pack_command_tuple())
|
||||
|
||||
|
||||
def pack_pl_pcdu_mode_cmd(tc_queue: TcQueueT, info: str, mode: int, submode: int):
|
||||
def pack_pl_pcdu_mode_cmd(tc_queue: TcQueueT, info: str, mode: Modes, submode: int):
|
||||
tc_queue.appendleft(
|
||||
(
|
||||
QueueCommands.PRINT,
|
||||
@ -234,6 +479,6 @@ def pack_pl_pcdu_mode_cmd(tc_queue: TcQueueT, info: str, mode: int, submode: int
|
||||
)
|
||||
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
|
||||
service=200, subservice=Subservices.TC_MODE_COMMAND, app_data=mode_data
|
||||
)
|
||||
tc_queue.appendleft(mode_cmd.pack_command_tuple())
|
||||
|
@ -7,11 +7,37 @@
|
||||
"""
|
||||
import struct
|
||||
|
||||
from tmtccmd.config.definitions import QueueCommands
|
||||
from config.definitions import CustomServiceList
|
||||
from tmtccmd.config import add_op_code_entry, add_service_op_code_entry
|
||||
from tmtccmd.config.definitions import QueueCommands, ServiceOpCodeDictT, OpCodeDictKeys
|
||||
|
||||
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.tc.pus_3_fsfw_hk import generate_one_hk_command, make_sid
|
||||
from tmtccmd.utility import ObjectId
|
||||
|
||||
|
||||
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,64 @@ 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(),
|
||||
)
|
||||
def add_rad_sens_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
|
||||
op_code_dict = dict()
|
||||
add_op_code_entry(op_code_dict=op_code_dict, info=Info.ON, keys=OpCodes.ON)
|
||||
add_op_code_entry(op_code_dict=op_code_dict, info=Info.OFF, keys=OpCodes.OFF)
|
||||
add_op_code_entry(op_code_dict=op_code_dict, info=Info.NORMAL, keys=OpCodes.NORMAL)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict, info=Info.REQ_OS_HK, keys=OpCodes.REQ_HK_ONCE
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict, info=Info.DEBUG_ON, keys=OpCodes.DEBUG_ON
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict, info=Info.DEBUG_OFF, keys=OpCodes.DEBUG_OFF
|
||||
)
|
||||
add_service_op_code_entry(
|
||||
srv_op_code_dict=cmd_dict,
|
||||
name=CustomServiceList.RAD_SENSOR.value,
|
||||
info="Radiation Sensor",
|
||||
op_code_entry=op_code_dict,
|
||||
)
|
||||
|
||||
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: ObjectId, tc_queue: TcQueueT, op_code: str):
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, 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)
|
||||
if op_code in OpCodes.ON:
|
||||
rad_sensor_mode_cmd(object_id, Modes.ON, Info.ON, tc_queue)
|
||||
if op_code in OpCodes.NORMAL:
|
||||
rad_sensor_mode_cmd(object_id, Modes.NORMAL, Info.NORMAL, tc_queue)
|
||||
if op_code in OpCodes.OFF:
|
||||
rad_sensor_mode_cmd(object_id, Modes.OFF, Info.OFF, tc_queue)
|
||||
if op_code in OpCodes.REQ_HK_ONCE:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, f"Rad sensor: {Info.REQ_OS_HK}"))
|
||||
cmd = generate_one_hk_command(
|
||||
sid=make_sid(object_id.as_bytes, set_id=SetIds.HK), ssc=0
|
||||
)
|
||||
tc_queue.appendleft(cmd.pack_command_tuple())
|
||||
if op_code in OpCodes.DEBUG_ON:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, f"Rad sensor: {Info.DEBUG_ON}"))
|
||||
command = object_id.as_bytes + 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 == "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)
|
||||
if op_code in OpCodes.DEBUG_OFF:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, f"Rad sensor: {Info.DEBUG_OFF}"))
|
||||
command = object_id.as_bytes + 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())
|
||||
|
||||
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: ObjectId, mode: Modes, info: str, tc_queue: TcQueueT
|
||||
):
|
||||
tc_queue.appendleft((QueueCommands.PRINT, f"Rad sensor: {info}"))
|
||||
mode_data = pack_mode_data(object_id.as_bytes, mode, 0)
|
||||
command = PusTelecommand(service=200, subservice=1, ssc=41, app_data=mode_data)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
|
@ -1,21 +1,58 @@
|
||||
# -*- 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.config.definitions import QueueCommands, ServiceOpCodeDictT
|
||||
from tmtccmd.tc.pus_3_fsfw_hk import (
|
||||
generate_one_hk_command,
|
||||
generate_one_diag_command,
|
||||
make_sid,
|
||||
)
|
||||
from tmtccmd.config.globals import add_op_code_entry, add_service_op_code_entry
|
||||
from tmtccmd.tc.packer import TcQueueT
|
||||
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 +75,161 @@ 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(),
|
||||
)
|
||||
def add_rw_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
op_code_dict = dict()
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict, info=InfoDevs.SPEED, keys=OpCodesDevs.SPEED
|
||||
)
|
||||
add_op_code_entry(op_code_dict=op_code_dict, info=InfoDevs.ON, keys=OpCodesDevs.ON)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict, info=InfoDevs.OFF, keys=OpCodesDevs.OFF
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict, info=InfoDevs.NML, keys=OpCodesDevs.NML
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict, info=InfoDevs.GET_STATUS, keys=OpCodesDevs.GET_STATUS
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict, info=InfoDevs.GET_TM, keys=OpCodesDevs.GET_TM
|
||||
)
|
||||
add_service_op_code_entry(
|
||||
srv_op_code_dict=cmd_dict,
|
||||
name=CustomServiceList.REACTION_WHEEL_1.value,
|
||||
op_code_entry=op_code_dict,
|
||||
info="Reaction Wheel 1",
|
||||
)
|
||||
add_service_op_code_entry(
|
||||
srv_op_code_dict=cmd_dict,
|
||||
name=CustomServiceList.REACTION_WHEEL_2.value,
|
||||
op_code_entry=op_code_dict,
|
||||
info="Reaction Wheel 2",
|
||||
)
|
||||
add_service_op_code_entry(
|
||||
srv_op_code_dict=cmd_dict,
|
||||
name=CustomServiceList.REACTION_WHEEL_3.value,
|
||||
op_code_entry=op_code_dict,
|
||||
info="Reaction Wheel 3",
|
||||
)
|
||||
add_service_op_code_entry(
|
||||
srv_op_code_dict=cmd_dict,
|
||||
name=CustomServiceList.REACTION_WHEEL_4.value,
|
||||
op_code_entry=op_code_dict,
|
||||
info="Reaction Wheel 4",
|
||||
)
|
||||
op_code_dict = dict()
|
||||
add_op_code_entry(op_code_dict=op_code_dict, info=InfoAss.ON, keys=OpCodesAss.ON)
|
||||
add_op_code_entry(op_code_dict=op_code_dict, info=InfoAss.NML, keys=OpCodesAss.NML)
|
||||
add_op_code_entry(op_code_dict=op_code_dict, info=InfoAss.OFF, keys=OpCodesAss.OFF)
|
||||
add_service_op_code_entry(
|
||||
srv_op_code_dict=cmd_dict,
|
||||
name=CustomServiceList.RW_ASSEMBLY.value,
|
||||
op_code_entry=op_code_dict,
|
||||
info="Reaction Wheel Assembly",
|
||||
)
|
||||
|
||||
if op_code == "0" or op_code == "1":
|
||||
|
||||
def pack_single_rw_test_into(
|
||||
object_id: bytes, rw_idx: int, tc_queue: TcQueueT, op_code: str
|
||||
) -> TcQueueT:
|
||||
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((QueueCommands.PRINT, f"RW {rw_idx}: {InfoDevs.SPEED}"))
|
||||
command = pack_set_speed_command(object_id, speed, ramp_time, 40)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
|
||||
if op_code == "2":
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "Reaction Wheel: Switch to mode on"))
|
||||
mode_data = pack_mode_data(object_id, 1, 0)
|
||||
if op_code in OpCodesDevs.ON:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, f"RW {rw_idx}: {InfoDevs.ON}"))
|
||||
mode_data = pack_mode_data(object_id, Modes.ON, 0)
|
||||
command = PusTelecommand(service=200, subservice=1, ssc=41, app_data=mode_data)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
|
||||
if op_code == "3":
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "Reaction Wheel: Switch to mode normal")
|
||||
)
|
||||
mode_data = pack_mode_data(object_id, 2, 0)
|
||||
if op_code in OpCodesDevs.NML:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, f"RW {rw_idx}: {InfoDevs.NML}"))
|
||||
mode_data = pack_mode_data(object_id, Modes.NORMAL, 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)
|
||||
if op_code in OpCodesDevs.OFF:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, f"RW {rw_idx}: {InfoDevs.OFF}"))
|
||||
mode_data = pack_mode_data(object_id, Modes.OFF, 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")
|
||||
if op_code in OpCodesDevs.GET_TM:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, f"RW {rw_idx}: {InfoDevs.GET_TM}"))
|
||||
command = generate_one_hk_command(
|
||||
sid=make_sid(object_id=object_id, set_id=RwSetIds.TM_SET), ssc=0
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if op_code in OpCodesDevs.GET_STATUS:
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, f"RW {rw_idx}: {InfoDevs.GET_STATUS}")
|
||||
)
|
||||
command = generate_one_diag_command(
|
||||
sid=make_sid(object_id=object_id, set_id=RwSetIds.STATUS_SET_ID), ssc=0
|
||||
)
|
||||
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_rw_ass_cmds(tc_queue: TcQueueT, 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)
|
||||
cmd = PusTelecommand(
|
||||
service=200, subservice=Subservices.TC_MODE_COMMAND, app_data=data
|
||||
)
|
||||
tc_queue.appendleft(cmd.pack_command_tuple())
|
||||
if op_code in OpCodesAss.ON:
|
||||
data = pack_mode_data(object_id=object_id, mode=Modes.ON, submode=0)
|
||||
cmd = PusTelecommand(
|
||||
service=200, subservice=Subservices.TC_MODE_COMMAND, app_data=data
|
||||
)
|
||||
tc_queue.appendleft(cmd.pack_command_tuple())
|
||||
if op_code in OpCodesAss.NML:
|
||||
data = pack_mode_data(object_id=object_id, mode=Modes.NORMAL, submode=0)
|
||||
cmd = PusTelecommand(
|
||||
service=200, subservice=Subservices.TC_MODE_COMMAND, app_data=data
|
||||
)
|
||||
tc_queue.appendleft(cmd.pack_command_tuple())
|
||||
|
||||
|
||||
def pack_set_speed_command(
|
||||
object_id: bytearray, speed: int, ramp_time: int
|
||||
) -> bytearray:
|
||||
object_id: bytes, speed: int, ramp_time_ms: int, ssc: 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
|
||||
:param ssc: Source sequence count
|
||||
"""
|
||||
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, ssc=ssc, app_data=command)
|
||||
return command
|
||||
|
111
pus_tc/devs/rtd.py
Normal file
111
pus_tc/devs/rtd.py
Normal file
@ -0,0 +1,111 @@
|
||||
from typing import Optional
|
||||
|
||||
from config.definitions import CustomServiceList
|
||||
from spacepackets.ecss import PusTelecommand
|
||||
from tmtccmd.config import (
|
||||
ServiceOpCodeDictT,
|
||||
add_op_code_entry,
|
||||
add_service_op_code_entry,
|
||||
)
|
||||
from tmtccmd.tc.definitions import TcQueueT
|
||||
from tmtccmd.utility import ObjectId
|
||||
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"
|
||||
|
||||
|
||||
def specify_rtd_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
op_code_dict = dict()
|
||||
add_op_code_entry(op_code_dict=op_code_dict, keys=OpCodes.ON, info=Info.ON)
|
||||
add_op_code_entry(op_code_dict=op_code_dict, keys=OpCodes.NORMAL, info=Info.NORMAL)
|
||||
add_op_code_entry(op_code_dict=op_code_dict, keys=OpCodes.OFF, info=Info.OFF)
|
||||
add_service_op_code_entry(
|
||||
srv_op_code_dict=cmd_dict,
|
||||
op_code_entry=op_code_dict,
|
||||
name=CustomServiceList.RTD.value,
|
||||
info="RTD commands",
|
||||
)
|
||||
|
||||
|
||||
def pack_rtd_commands(op_code: str, object_id: Optional[ObjectId], tc_queue: TcQueueT):
|
||||
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
|
||||
)
|
||||
cmd = PusTelecommand(
|
||||
service=200, subservice=Subservices.TC_MODE_COMMAND, app_data=app_data
|
||||
)
|
||||
tc_queue.appendleft(cmd.pack_command_tuple())
|
||||
if op_code in OpCodes.NORMAL:
|
||||
app_data = pack_mode_data(
|
||||
object_id=object_id.as_bytes, mode=Modes.NORMAL, submode=0
|
||||
)
|
||||
cmd = PusTelecommand(
|
||||
service=200, subservice=Subservices.TC_MODE_COMMAND, app_data=app_data
|
||||
)
|
||||
tc_queue.appendleft(cmd.pack_command_tuple())
|
||||
if op_code in OpCodes.OFF:
|
||||
app_data = pack_mode_data(
|
||||
object_id=object_id.as_bytes, mode=Modes.OFF, submode=0
|
||||
)
|
||||
cmd = PusTelecommand(
|
||||
service=200, subservice=Subservices.TC_MODE_COMMAND, app_data=app_data
|
||||
)
|
||||
tc_queue.appendleft(cmd.pack_command_tuple())
|
||||
if op_code in OpCodes.CONFIG_CMD:
|
||||
command = object_id + CommandIds.PRINT_CLCW
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
|
||||
|
||||
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
|
@ -11,7 +11,7 @@ from tmtccmd.config.definitions import QueueCommands
|
||||
|
||||
from tmtccmd.tc.packer import TcQueueT
|
||||
from spacepackets.ecss.tc import PusTelecommand
|
||||
from tmtccmd.tc.service_200_mode import pack_mode_data, Modes
|
||||
from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Modes
|
||||
from tmtccmd.logging import get_console_logger
|
||||
from utility.input_helper import InputHelper
|
||||
|
||||
@ -85,6 +85,10 @@ class StarTrackerActionIds:
|
||||
FIRMWARE_UPDATE = 84
|
||||
|
||||
|
||||
class SetIds:
|
||||
TEMPERATURE = 25
|
||||
|
||||
|
||||
class FileDefs:
|
||||
download_path = "/mnt/sd0/startracker"
|
||||
json_file = "/mnt/sd0/startracker/full.json"
|
||||
@ -146,9 +150,7 @@ class Submode:
|
||||
FIRMWARE = 2
|
||||
|
||||
|
||||
def pack_star_tracker_commands(
|
||||
object_id: bytearray, tc_queue: TcQueueT, op_code: str
|
||||
) -> TcQueueT:
|
||||
def pack_star_tracker_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
||||
tc_queue.appendleft(
|
||||
(
|
||||
QueueCommands.PRINT,
|
||||
|
2
pus_tc/devs/sus.py
Normal file
2
pus_tc/devs/sus.py
Normal file
@ -0,0 +1,2 @@
|
||||
class SetIds:
|
||||
HK = 3
|
@ -8,9 +8,9 @@
|
||||
|
||||
from tmtccmd.config.definitions import QueueCommands
|
||||
from tmtccmd.tc.definitions import TcQueueT
|
||||
from tmtccmd.tc.service_3_housekeeping import make_sid, generate_one_hk_command
|
||||
from tmtccmd.tc.pus_3_fsfw_hk import make_sid, generate_one_hk_command
|
||||
from spacepackets.ecss.tc import PusTelecommand
|
||||
from tmtccmd.tc.service_200_mode import pack_mode_data, Modes
|
||||
from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Modes
|
||||
import struct
|
||||
|
||||
|
||||
@ -64,17 +64,17 @@ def pack_syrlinks_command(
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if op_code == "3":
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "syrlinks: Set TX mode standby"))
|
||||
command = object_id + CommandIds.SET_TX_MODE_STANDBY
|
||||
command = object_id + struct.pack("!I", CommandIds.SET_TX_MODE_STANDBY)
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=10, app_data=command)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if op_code == "4":
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "syrlinks: Set TX mode modulation"))
|
||||
command = object_id + CommandIds.SET_TX_MODE_MODULATION
|
||||
command = object_id + struct.pack("!I", CommandIds.SET_TX_MODE_MODULATION)
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=11, app_data=command)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if op_code == "5":
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "syrlinks: Set TX mode CW"))
|
||||
command = object_id + CommandIds.SET_TX_MODE_CW
|
||||
command = object_id + struct.pack("!I", CommandIds.SET_TX_MODE_CW)
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=12, app_data=command)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if op_code == "6":
|
||||
@ -89,26 +89,26 @@ def pack_syrlinks_command(
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if op_code == "8":
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "Syrlinks: Read TX status"))
|
||||
command = object_id + CommandIds.READ_TX_STATUS
|
||||
command = object_id + struct.pack("!I", CommandIds.READ_TX_STATUS)
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=13, app_data=command)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if op_code == "9":
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "Syrlinks: Read TX waveform"))
|
||||
command = object_id + CommandIds.READ_TX_WAVEFORM
|
||||
command = object_id + struct.pack("!I", CommandIds.READ_TX_WAVEFORM)
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=14, app_data=command)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if op_code == "10":
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "Syrlinks: Read TX AGC value high byte")
|
||||
)
|
||||
command = object_id + CommandIds.READ_TX_AGC_VALUE_HIGH_BYTE
|
||||
command = object_id + struct.pack("!I", CommandIds.READ_TX_AGC_VALUE_HIGH_BYTE)
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=15, app_data=command)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if op_code == "11":
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, "Syrlinks: Read TX AGC value low byte")
|
||||
)
|
||||
command = object_id + CommandIds.READ_TX_AGC_VALUE_LOW_BYTE
|
||||
command = object_id + struct.pack("!I", CommandIds.READ_TX_AGC_VALUE_LOW_BYTE)
|
||||
command = PusTelecommand(service=8, subservice=128, ssc=16, app_data=command)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
if op_code == "12":
|
||||
|
124
pus_tc/prompt_parameters.py
Normal file
124
pus_tc/prompt_parameters.py
Normal file
@ -0,0 +1,124 @@
|
||||
from PyQt5.QtWidgets import (
|
||||
QDialog,
|
||||
QDialogButtonBox,
|
||||
QVBoxLayout,
|
||||
QLabel,
|
||||
QGroupBox,
|
||||
QGridLayout,
|
||||
QLineEdit,
|
||||
)
|
||||
|
||||
from PyQt5 import QtCore
|
||||
|
||||
|
||||
from tmtccmd.core.globals_manager import get_global
|
||||
from tmtccmd.config.definitions import CoreGlobalIds, CoreModeList
|
||||
|
||||
|
||||
class Parameter:
|
||||
def __init__(self, name: str, defaultValue: str, widget: QLineEdit):
|
||||
self.name = name
|
||||
self.defaultValue = defaultValue
|
||||
self.widget = widget
|
||||
self.value = self.defaultValue
|
||||
self.widget.setPlaceholderText(self.defaultValue)
|
||||
|
||||
def reset(self):
|
||||
self.value = self.defaultValue
|
||||
self.widget.setPlaceholderText(self.defaultValue)
|
||||
self.widget.setText("")
|
||||
|
||||
|
||||
class ParameterDialog(QDialog):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
self.setWindowTitle("Enter Parameters")
|
||||
|
||||
Buttons = QDialogButtonBox.Ok | QDialogButtonBox.Cancel | QDialogButtonBox.Reset
|
||||
|
||||
self.buttonBox = QDialogButtonBox(Buttons)
|
||||
self.buttonBox.accepted.connect(self.accept)
|
||||
self.buttonBox.rejected.connect(self.reject)
|
||||
self.buttonBox.button(QDialogButtonBox.Reset).clicked.connect(self._reset)
|
||||
|
||||
self.data = 1
|
||||
|
||||
self.rootLayout = QVBoxLayout()
|
||||
self.group = QGroupBox("Parameters")
|
||||
self.rootLayout.addWidget(self.group)
|
||||
self.rootLayout.addWidget(self.buttonBox)
|
||||
self.setLayout(self.rootLayout)
|
||||
|
||||
self.groupLayout = QGridLayout()
|
||||
self.group.setLayout(self.groupLayout)
|
||||
|
||||
self.parameters = {}
|
||||
|
||||
def addParameter(self, name: str, defaultValue: str):
|
||||
row = self.groupLayout.rowCount() + 1
|
||||
description = QLabel(name)
|
||||
self.groupLayout.addWidget(description, row, 0)
|
||||
valueWidget = QLineEdit()
|
||||
self.groupLayout.addWidget(valueWidget, row, 1)
|
||||
|
||||
parameter = Parameter(name, defaultValue, valueWidget)
|
||||
|
||||
self.parameters[name] = parameter
|
||||
|
||||
def _reset(self):
|
||||
for value in self.parameters.values():
|
||||
value.reset()
|
||||
|
||||
def getParameters(self):
|
||||
output = {}
|
||||
for key, parameter in self.parameters.items():
|
||||
if parameter.widget != None:
|
||||
if parameter.widget.text() != "":
|
||||
parameter.value = parameter.widget.text()
|
||||
output[key] = parameter.value
|
||||
return output
|
||||
|
||||
@QtCore.pyqtSlot()
|
||||
def reject(self):
|
||||
print("reject")
|
||||
self._reset()
|
||||
super().reject()
|
||||
|
||||
|
||||
"""Prompt the user to specify additional Parameters
|
||||
|
||||
:param parameterList: array of dictionaries with name and defaultValue attributes
|
||||
:return: dict with all names as key and user supplied input as value string
|
||||
"""
|
||||
|
||||
|
||||
def prompt_parameters(parameterList):
|
||||
gui = get_global(CoreGlobalIds.GUI)
|
||||
mode = get_global(CoreGlobalIds.MODE)
|
||||
|
||||
# gui only works in cont mode right now
|
||||
if gui and mode == CoreModeList.CONTINUOUS_MODE:
|
||||
return _gui_prompt(parameterList)
|
||||
else:
|
||||
return _cli_prompt(parameterList)
|
||||
|
||||
|
||||
def _gui_prompt(parameterList):
|
||||
dialog = ParameterDialog()
|
||||
for parameter in parameterList:
|
||||
dialog.addParameter(parameter["name"], parameter["defaultValue"])
|
||||
dialog.exec_()
|
||||
return dialog.getParameters()
|
||||
|
||||
|
||||
def _cli_prompt(parameterList):
|
||||
result = {}
|
||||
for parameter in parameterList:
|
||||
userInput = input(
|
||||
"Specify {} [{}]: ".format(parameter["name"], parameter["defaultValue"])
|
||||
)
|
||||
if userInput == "":
|
||||
userInput = parameter["defaultValue"]
|
||||
result[parameter["name"]] = userInput
|
||||
return result
|
@ -8,7 +8,7 @@
|
||||
from tmtccmd.config.definitions import QueueCommands
|
||||
from spacepackets.ecss.tc import PusTelecommand
|
||||
from tmtccmd.tc.packer import TcQueueT
|
||||
from tmtccmd.tc.service_200_mode import pack_mode_data
|
||||
from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Modes
|
||||
from config.object_ids import TEST_DEVICE_ID
|
||||
|
||||
TEST_DEVICE_OBJ_ID = TEST_DEVICE_ID
|
||||
@ -20,23 +20,22 @@ def pack_service200_test_into(tc_queue: TcQueueT) -> TcQueueT:
|
||||
obj_id = TEST_DEVICE_OBJ_ID
|
||||
# Set On Mode
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "Testing Service 200: Set Mode On"))
|
||||
mode_data = pack_mode_data(obj_id, 1, 0)
|
||||
mode_data = pack_mode_data(obj_id, Modes.ON, 0)
|
||||
command = PusTelecommand(service=200, subservice=1, ssc=2000, app_data=mode_data)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
# Set Normal mode
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "Testing Service 200: Set Mode Normal"))
|
||||
mode_data = pack_mode_data(obj_id, 2, 0)
|
||||
mode_data = pack_mode_data(obj_id, Modes.NORMAL, 0)
|
||||
command = PusTelecommand(service=200, subservice=1, ssc=2010, app_data=mode_data)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
# Set Raw Mode
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "Testing Service 200: Set Mode Raw"))
|
||||
mode_data = pack_mode_data(obj_id, 3, 0)
|
||||
mode_data = pack_mode_data(obj_id, Modes.RAW, 0)
|
||||
command = PusTelecommand(service=200, subservice=1, ssc=2020, app_data=mode_data)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
# Set Off Mode
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "Testing Service 200: Set Mode Off"))
|
||||
mode_data = pack_mode_data(obj_id, 0, 0)
|
||||
mode_data = pack_mode_data(obj_id, Modes.OFF, 0)
|
||||
command = PusTelecommand(service=200, subservice=1, ssc=2030, app_data=mode_data)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
tc_queue.appendleft((QueueCommands.EXPORT_LOG, "log/tmtc_log_service200.txt"))
|
||||
return tc_queue
|
||||
|
@ -1,9 +1,9 @@
|
||||
import enum
|
||||
from tmtccmd.tc.definitions import TcQueueT
|
||||
from tmtccmd.tc.service_200_mode import Modes
|
||||
from tmtccmd.tc.pus_200_fsfw_modes import Modes
|
||||
from config.object_ids import ACS_BOARD_ASS_ID, SUS_BOARD_ASS_ID
|
||||
|
||||
from .common import command_assembly
|
||||
from .common import command_mode
|
||||
|
||||
|
||||
class AcsOpCodes:
|
||||
@ -31,7 +31,7 @@ class DualSideSubmodes(enum.IntEnum):
|
||||
|
||||
def pack_acs_command(tc_queue: TcQueueT, op_code: str):
|
||||
if op_code in AcsOpCodes.ACS_ASS_A_SIDE:
|
||||
command_assembly(
|
||||
command_mode(
|
||||
object_id=ACS_BOARD_ASS_ID,
|
||||
mode=Modes.NORMAL,
|
||||
submode=DualSideSubmodes.A_SIDE,
|
||||
@ -39,7 +39,7 @@ def pack_acs_command(tc_queue: TcQueueT, op_code: str):
|
||||
info="Switching to ACS board assembly A side",
|
||||
)
|
||||
if op_code in AcsOpCodes.ACS_ASS_B_SIDE:
|
||||
command_assembly(
|
||||
command_mode(
|
||||
object_id=ACS_BOARD_ASS_ID,
|
||||
mode=Modes.NORMAL,
|
||||
submode=DualSideSubmodes.B_SIDE,
|
||||
@ -47,7 +47,7 @@ def pack_acs_command(tc_queue: TcQueueT, op_code: str):
|
||||
info="Switching to ACS board assembly B side",
|
||||
)
|
||||
if op_code in AcsOpCodes.ACS_ASS_DUAL_MODE:
|
||||
command_assembly(
|
||||
command_mode(
|
||||
object_id=ACS_BOARD_ASS_ID,
|
||||
mode=Modes.NORMAL,
|
||||
submode=DualSideSubmodes.DUAL_SIDE,
|
||||
@ -55,7 +55,7 @@ def pack_acs_command(tc_queue: TcQueueT, op_code: str):
|
||||
info="Switching to ACS board assembly dual mode",
|
||||
)
|
||||
if op_code in AcsOpCodes.ACS_ASS_A_ON:
|
||||
command_assembly(
|
||||
command_mode(
|
||||
object_id=ACS_BOARD_ASS_ID,
|
||||
mode=Modes.ON,
|
||||
submode=DualSideSubmodes.A_SIDE,
|
||||
@ -63,7 +63,7 @@ def pack_acs_command(tc_queue: TcQueueT, op_code: str):
|
||||
info="Switching ACS board assembly A side on",
|
||||
)
|
||||
if op_code in AcsOpCodes.ACS_ASS_B_ON:
|
||||
command_assembly(
|
||||
command_mode(
|
||||
object_id=ACS_BOARD_ASS_ID,
|
||||
mode=Modes.ON,
|
||||
submode=DualSideSubmodes.B_SIDE,
|
||||
@ -71,7 +71,7 @@ def pack_acs_command(tc_queue: TcQueueT, op_code: str):
|
||||
info="Switching ACS board assembly B side on",
|
||||
)
|
||||
if op_code in AcsOpCodes.ACS_ASS_DUAL_ON:
|
||||
command_assembly(
|
||||
command_mode(
|
||||
object_id=ACS_BOARD_ASS_ID,
|
||||
mode=Modes.ON,
|
||||
submode=DualSideSubmodes.B_SIDE,
|
||||
@ -79,7 +79,7 @@ def pack_acs_command(tc_queue: TcQueueT, op_code: str):
|
||||
info="Switching ACS board assembly dual side on",
|
||||
)
|
||||
if op_code in AcsOpCodes.ACS_ASS_OFF:
|
||||
command_assembly(
|
||||
command_mode(
|
||||
object_id=ACS_BOARD_ASS_ID,
|
||||
mode=Modes.OFF,
|
||||
submode=0,
|
||||
@ -90,7 +90,7 @@ def pack_acs_command(tc_queue: TcQueueT, op_code: str):
|
||||
|
||||
def pack_sus_cmds(tc_queue: TcQueueT, op_code: str):
|
||||
if op_code in SusOpCodes.SUS_ASS_NOM_SIDE:
|
||||
command_assembly(
|
||||
command_mode(
|
||||
object_id=SUS_BOARD_ASS_ID,
|
||||
mode=Modes.NORMAL,
|
||||
submode=DualSideSubmodes.A_SIDE,
|
||||
@ -98,7 +98,7 @@ def pack_sus_cmds(tc_queue: TcQueueT, op_code: str):
|
||||
info="Switching to SUS board to nominal side",
|
||||
)
|
||||
if op_code in SusOpCodes.SUS_ASS_RED_SIDE:
|
||||
command_assembly(
|
||||
command_mode(
|
||||
object_id=SUS_BOARD_ASS_ID,
|
||||
mode=Modes.NORMAL,
|
||||
submode=DualSideSubmodes.B_SIDE,
|
||||
@ -106,7 +106,7 @@ def pack_sus_cmds(tc_queue: TcQueueT, op_code: str):
|
||||
info="Switching to SUS board to redundant side",
|
||||
)
|
||||
if op_code in SusOpCodes.SUS_ASS_OFF:
|
||||
command_assembly(
|
||||
command_mode(
|
||||
object_id=SUS_BOARD_ASS_ID,
|
||||
mode=Modes.OFF,
|
||||
submode=0,
|
||||
@ -114,7 +114,7 @@ def pack_sus_cmds(tc_queue: TcQueueT, op_code: str):
|
||||
info="Switching SUS board off",
|
||||
)
|
||||
if op_code in SusOpCodes.SUS_ASS_DUAL_MODE:
|
||||
command_assembly(
|
||||
command_mode(
|
||||
object_id=SUS_BOARD_ASS_ID,
|
||||
mode=Modes.NORMAL,
|
||||
submode=DualSideSubmodes.DUAL_SIDE,
|
||||
|
@ -1,10 +1,16 @@
|
||||
from typing import Union
|
||||
|
||||
from tmtccmd.tc.definitions import TcQueueT, QueueCommands
|
||||
from spacepackets.ecss.tc import PusTelecommand
|
||||
from tmtccmd.tc.service_200_mode import pack_mode_data, Modes, Subservices
|
||||
from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Modes, Subservices
|
||||
|
||||
|
||||
def command_assembly(
|
||||
object_id: bytes, mode: Modes, submode: int, tc_queue: TcQueueT, info: str
|
||||
def command_mode(
|
||||
object_id: bytes,
|
||||
mode: Union[int, Modes],
|
||||
submode: int,
|
||||
tc_queue: TcQueueT,
|
||||
info: str,
|
||||
):
|
||||
tc_queue.appendleft((QueueCommands.PRINT, info))
|
||||
mode_data = pack_mode_data(
|
||||
@ -13,6 +19,6 @@ def command_assembly(
|
||||
submode=submode,
|
||||
)
|
||||
cmd = PusTelecommand(
|
||||
service=200, subservice=Subservices.COMMAND_MODE_COMMAND, app_data=mode_data
|
||||
service=200, subservice=Subservices.TC_MODE_COMMAND, app_data=mode_data
|
||||
)
|
||||
tc_queue.appendleft(cmd.pack_command_tuple())
|
||||
|
82
pus_tc/system/controllers.py
Normal file
82
pus_tc/system/controllers.py
Normal file
@ -0,0 +1,82 @@
|
||||
from tmtccmd.tc.definitions import TcQueueT
|
||||
from tmtccmd.config import QueueCommands
|
||||
from tmtccmd.tc.pus_200_fsfw_modes import Modes
|
||||
from tmtccmd.utility import ObjectId
|
||||
|
||||
from .common import command_mode
|
||||
import config.object_ids as obj_ids
|
||||
|
||||
from pus_tc.prompt_parameters import prompt_parameters
|
||||
|
||||
|
||||
class OpCodes:
|
||||
THERMAL_CONTROLLER = [obj_ids.THERMAL_CONTROLLER_ID.hex(), "ctrl-th"]
|
||||
CORE_CONTROLLER = [obj_ids.CORE_CONTROLLER_ID.hex(), "ctrl-core"]
|
||||
|
||||
|
||||
class Info:
|
||||
THERMAL_CONTROLLER = "Thermal controller"
|
||||
CORE_CONTROLLER = "ACS controller"
|
||||
|
||||
|
||||
def pack_cmd_ctrl_to_prompted_mode(tc_queue: TcQueueT, object_id: ObjectId):
|
||||
parameters = prompt_parameters(
|
||||
[
|
||||
{"name": "Mode", "defaultValue": "2"},
|
||||
{"name": "Submode", "defaultValue": "0"},
|
||||
]
|
||||
)
|
||||
mode = int(parameters["Mode"])
|
||||
if mode < 0 or mode > 2:
|
||||
print("Invalid Mode, defaulting to OFF")
|
||||
mode = 0
|
||||
submode = int(parameters["Submode"])
|
||||
command_mode(
|
||||
object_id=object_id.as_bytes,
|
||||
mode=mode,
|
||||
submode=submode,
|
||||
tc_queue=tc_queue,
|
||||
info=f"Commanding {object_id} to {mode}, {submode}",
|
||||
)
|
||||
|
||||
|
||||
def pack_cmd_ctrl_to_off(tc_queue: TcQueueT, object_id: ObjectId):
|
||||
command_mode(
|
||||
object_id=object_id.as_bytes,
|
||||
mode=Modes.OFF,
|
||||
submode=0,
|
||||
tc_queue=tc_queue,
|
||||
info=f"Commanding {object_id} OFF",
|
||||
)
|
||||
|
||||
|
||||
def pack_cmd_ctrl_to_on(tc_queue: TcQueueT, object_id: ObjectId):
|
||||
command_mode(
|
||||
object_id=object_id.as_bytes,
|
||||
mode=Modes.ON,
|
||||
submode=0,
|
||||
tc_queue=tc_queue,
|
||||
info=f"Commanding {object_id} ON",
|
||||
)
|
||||
|
||||
|
||||
def pack_cmd_ctrl_to_nml(tc_queue: TcQueueT, object_id: ObjectId):
|
||||
command_mode(
|
||||
object_id=object_id.as_bytes,
|
||||
mode=Modes.NORMAL,
|
||||
submode=0,
|
||||
tc_queue=tc_queue,
|
||||
info=f"Commanding {object_id} NORMAL",
|
||||
)
|
||||
|
||||
|
||||
def get_object_from_op_code(op_code: str):
|
||||
try:
|
||||
return bytes.fromhex(op_code)
|
||||
except:
|
||||
pass
|
||||
|
||||
if op_code in OpCodes.THERMAL_CONTROLLER:
|
||||
return obj_ids.THERMAL_CONTROLLER_ID
|
||||
if op_code in OpCodes.CORE_CONTROLLER:
|
||||
return obj_ids.CORE_CONTROLLER_ID
|
@ -1,10 +1,12 @@
|
||||
import enum
|
||||
|
||||
from tmtccmd.config.definitions import QueueCommands
|
||||
from config.definitions import CustomServiceList
|
||||
from tmtccmd.config import add_op_code_entry, add_service_op_code_entry
|
||||
from tmtccmd.config.definitions import QueueCommands, ServiceOpCodeDictT
|
||||
from tmtccmd.tc.definitions import TcQueueT
|
||||
from tmtccmd.tc.service_8_functional_cmd import generate_action_command
|
||||
from tmtccmd.tc.pus_8_funccmd import generate_action_command
|
||||
from tmtccmd.logging import get_console_logger
|
||||
from tmtccmd.tc.service_3_housekeeping import make_sid, generate_one_hk_command
|
||||
from tmtccmd.tc.pus_3_fsfw_hk import make_sid, generate_one_hk_command
|
||||
from config.object_ids import CORE_CONTROLLER_ID
|
||||
|
||||
LOGGER = get_console_logger()
|
||||
@ -19,7 +21,8 @@ class ActionIds(enum.IntEnum):
|
||||
RESET_REBOOT_COUNTER_10 = 9
|
||||
RESET_REBOOT_COUNTER_11 = 10
|
||||
SET_MAX_REBOOT_CNT = 11
|
||||
REBOOT = 32
|
||||
XSC_REBOOT = 32
|
||||
FULL_REBOOT = 34
|
||||
|
||||
|
||||
class SetIds(enum.IntEnum):
|
||||
@ -27,21 +30,27 @@ class SetIds(enum.IntEnum):
|
||||
|
||||
|
||||
class OpCodes:
|
||||
REBOOT = ["0", "reboot"]
|
||||
REBOOT_SELF = ["1", "reboot_self"]
|
||||
REBOOT_0_0 = ["2", "reboot_0_0"]
|
||||
REBOOT_0_1 = ["3", "reboot_0_1"]
|
||||
REBOOT_1_0 = ["4", "reboot_1_0"]
|
||||
REBOOT_1_1 = ["5", "reboot_1_1"]
|
||||
ENABLE_REBOOT_FILE_HANDLING = ["6", "rbh-off"]
|
||||
DISABLE_REBOOT_FILE_HANDLING = ["7", "rbh-on"]
|
||||
RESET_ALL_REBOOT_COUNTERS = ["8", "rbh-reset-a"]
|
||||
RESET_REBOOT_COUNTER_00 = ["9", "rbh-reset-00"]
|
||||
RESET_REBOOT_COUNTER_01 = ["10", "rbh-reset-01"]
|
||||
RESET_REBOOT_COUNTER_10 = ["11", "rbh-reset-10"]
|
||||
RESET_REBOOT_COUNTER_11 = ["12", "rbh-reset-11"]
|
||||
SET_MAX_REBOOT_CNT = ["13", "rbh-max-cnt"]
|
||||
GET_HK = ["14", "get-hk"]
|
||||
REBOOT_XSC = ["0", "reboot-xsc"]
|
||||
XSC_REBOOT_SELF = ["1", "reboot-self"]
|
||||
XSC_REBOOT_0_0 = ["2", "reboot-00"]
|
||||
XSC_REBOOT_0_1 = ["3", "reboot-01"]
|
||||
XSC_REBOOT_1_0 = ["4", "reboot-10"]
|
||||
XSC_REBOOT_1_1 = ["5", "reboot-11"]
|
||||
REBOOT_FULL = ["6", "reboot-regular"]
|
||||
GET_HK = ["7", "get-hk"]
|
||||
ENABLE_REBOOT_FILE_HANDLING = ["32", "rbh-off"]
|
||||
DISABLE_REBOOT_FILE_HANDLING = ["33", "rbh-on"]
|
||||
RESET_ALL_REBOOT_COUNTERS = ["34", "rbh-reset-a"]
|
||||
RESET_REBOOT_COUNTER_00 = ["35", "rbh-reset-00"]
|
||||
RESET_REBOOT_COUNTER_01 = ["36", "rbh-reset-01"]
|
||||
RESET_REBOOT_COUNTER_10 = ["37", "rbh-reset-10"]
|
||||
RESET_REBOOT_COUNTER_11 = ["38", "rbh-reset-11"]
|
||||
SET_MAX_REBOOT_CNT = ["39", "rbh-max-cnt"]
|
||||
|
||||
|
||||
class Info:
|
||||
REBOOT_XSC = "XSC reboot with prompt"
|
||||
REBOOT_FULL = "Full regular reboot"
|
||||
|
||||
|
||||
class Chip(enum.IntEnum):
|
||||
@ -56,8 +65,65 @@ class Copy(enum.IntEnum):
|
||||
NONE = 2
|
||||
|
||||
|
||||
def add_core_controller_definitions(cmd_dict: ServiceOpCodeDictT):
|
||||
od = dict()
|
||||
add_op_code_entry(op_code_dict=od, keys=OpCodes.REBOOT_XSC, info=Info.REBOOT_XSC)
|
||||
add_op_code_entry(op_code_dict=od, keys=OpCodes.REBOOT_FULL, info=Info.REBOOT_FULL)
|
||||
add_op_code_entry(op_code_dict=od, keys=OpCodes.XSC_REBOOT_SELF, info="Reboot Self")
|
||||
add_op_code_entry(op_code_dict=od, keys=OpCodes.XSC_REBOOT_0_0, info="Reboot 0 0")
|
||||
add_op_code_entry(op_code_dict=od, keys=OpCodes.XSC_REBOOT_0_1, info="Reboot 0 1")
|
||||
add_op_code_entry(op_code_dict=od, keys=OpCodes.XSC_REBOOT_1_0, info="Reboot 1 0")
|
||||
add_op_code_entry(op_code_dict=od, keys=OpCodes.XSC_REBOOT_1_1, info="Reboot 1 1")
|
||||
add_op_code_entry(
|
||||
op_code_dict=od,
|
||||
keys=OpCodes.GET_HK,
|
||||
info="Request housekeeping set",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=od,
|
||||
keys=OpCodes.ENABLE_REBOOT_FILE_HANDLING,
|
||||
info="Enable reboot file handling",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=od,
|
||||
keys=OpCodes.DISABLE_REBOOT_FILE_HANDLING,
|
||||
info="Disable reboot file handling",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=od,
|
||||
keys=OpCodes.RESET_ALL_REBOOT_COUNTERS,
|
||||
info="Reset all reboot counters",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=od,
|
||||
keys=OpCodes.RESET_REBOOT_COUNTER_00,
|
||||
info="Reset reboot counter 0 0",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=od,
|
||||
keys=OpCodes.RESET_REBOOT_COUNTER_01,
|
||||
info="Reset reboot counter 0 1",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=od,
|
||||
keys=OpCodes.RESET_REBOOT_COUNTER_10,
|
||||
info="Reset reboot counter 1 0",
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=od,
|
||||
keys=OpCodes.RESET_REBOOT_COUNTER_11,
|
||||
info="Reset reboot counter 1 1",
|
||||
)
|
||||
add_service_op_code_entry(
|
||||
srv_op_code_dict=cmd_dict,
|
||||
name=CustomServiceList.CORE.value,
|
||||
info="Core Controller",
|
||||
op_code_entry=od,
|
||||
)
|
||||
|
||||
|
||||
def pack_core_commands(tc_queue: TcQueueT, op_code: str):
|
||||
if op_code in OpCodes.REBOOT:
|
||||
if op_code in OpCodes.REBOOT_XSC:
|
||||
reboot_self, chip_select, copy_select = determine_reboot_params()
|
||||
perform_reboot_cmd(
|
||||
tc_queue=tc_queue,
|
||||
@ -65,31 +131,37 @@ def pack_core_commands(tc_queue: TcQueueT, op_code: str):
|
||||
chip=chip_select,
|
||||
copy=copy_select,
|
||||
)
|
||||
elif op_code in OpCodes.REBOOT_SELF:
|
||||
if op_code in OpCodes.REBOOT_FULL:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, f"Core Command: {Info.REBOOT_FULL}"))
|
||||
cmd = generate_action_command(
|
||||
object_id=CORE_CONTROLLER_ID, action_id=ActionIds.FULL_REBOOT
|
||||
)
|
||||
tc_queue.appendleft(cmd.pack_command_tuple())
|
||||
if op_code in OpCodes.XSC_REBOOT_SELF:
|
||||
perform_reboot_cmd(tc_queue=tc_queue, reboot_self=True)
|
||||
elif op_code in OpCodes.REBOOT_0_0:
|
||||
if op_code in OpCodes.XSC_REBOOT_0_0:
|
||||
perform_reboot_cmd(
|
||||
tc_queue=tc_queue, reboot_self=False, chip=Chip.CHIP_0, copy=Copy.COPY_0_NOM
|
||||
)
|
||||
elif op_code in OpCodes.REBOOT_0_1:
|
||||
if op_code in OpCodes.XSC_REBOOT_0_1:
|
||||
perform_reboot_cmd(
|
||||
tc_queue=tc_queue,
|
||||
reboot_self=False,
|
||||
chip=Chip.CHIP_0,
|
||||
copy=Copy.COPY_1_GOLD,
|
||||
)
|
||||
elif op_code in OpCodes.REBOOT_1_0:
|
||||
if op_code in OpCodes.XSC_REBOOT_1_0:
|
||||
perform_reboot_cmd(
|
||||
tc_queue=tc_queue, reboot_self=False, chip=Chip.CHIP_1, copy=Copy.COPY_0_NOM
|
||||
)
|
||||
elif op_code in OpCodes.REBOOT_1_1:
|
||||
if op_code in OpCodes.XSC_REBOOT_1_1:
|
||||
perform_reboot_cmd(
|
||||
tc_queue=tc_queue,
|
||||
reboot_self=False,
|
||||
chip=Chip.CHIP_1,
|
||||
copy=Copy.COPY_1_GOLD,
|
||||
)
|
||||
elif op_code in OpCodes.DISABLE_REBOOT_FILE_HANDLING:
|
||||
if op_code in OpCodes.DISABLE_REBOOT_FILE_HANDLING:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "Disabling reboot file handling"))
|
||||
app_data = bytearray([0])
|
||||
generate_action_command(
|
||||
@ -97,7 +169,7 @@ def pack_core_commands(tc_queue: TcQueueT, op_code: str):
|
||||
action_id=ActionIds.SWITCH_REBOOT_FILE_HANDLING,
|
||||
app_data=app_data,
|
||||
)
|
||||
elif op_code in OpCodes.ENABLE_REBOOT_FILE_HANDLING:
|
||||
if op_code in OpCodes.ENABLE_REBOOT_FILE_HANDLING:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "Enabling reboot file handling"))
|
||||
app_data = bytearray([1])
|
||||
generate_action_command(
|
||||
@ -105,32 +177,32 @@ def pack_core_commands(tc_queue: TcQueueT, op_code: str):
|
||||
action_id=ActionIds.SWITCH_REBOOT_FILE_HANDLING,
|
||||
app_data=app_data,
|
||||
)
|
||||
elif op_code in OpCodes.RESET_ALL_REBOOT_COUNTERS:
|
||||
if op_code in OpCodes.RESET_ALL_REBOOT_COUNTERS:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "Resetting all reboot counters"))
|
||||
generate_action_command(
|
||||
object_id=CORE_CONTROLLER_ID, action_id=ActionIds.RESET_ALL_REBOOT_COUNTERS
|
||||
)
|
||||
elif op_code in OpCodes.RESET_REBOOT_COUNTER_00:
|
||||
if op_code in OpCodes.RESET_REBOOT_COUNTER_00:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "Resetting reboot counter 0 0"))
|
||||
generate_action_command(
|
||||
object_id=CORE_CONTROLLER_ID, action_id=ActionIds.RESET_REBOOT_COUNTER_00
|
||||
)
|
||||
elif op_code in OpCodes.RESET_REBOOT_COUNTER_01:
|
||||
if op_code in OpCodes.RESET_REBOOT_COUNTER_01:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "Resetting reboot counter 0 1"))
|
||||
generate_action_command(
|
||||
object_id=CORE_CONTROLLER_ID, action_id=ActionIds.RESET_REBOOT_COUNTER_01
|
||||
)
|
||||
elif op_code in OpCodes.RESET_REBOOT_COUNTER_10:
|
||||
if op_code in OpCodes.RESET_REBOOT_COUNTER_10:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "Resetting reboot counter 1 0"))
|
||||
generate_action_command(
|
||||
object_id=CORE_CONTROLLER_ID, action_id=ActionIds.RESET_REBOOT_COUNTER_10
|
||||
)
|
||||
elif op_code in OpCodes.RESET_REBOOT_COUNTER_11:
|
||||
if op_code in OpCodes.RESET_REBOOT_COUNTER_11:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "Resetting reboot counter 1 1"))
|
||||
generate_action_command(
|
||||
object_id=CORE_CONTROLLER_ID, action_id=ActionIds.RESET_REBOOT_COUNTER_11
|
||||
)
|
||||
elif op_code in OpCodes.GET_HK:
|
||||
if op_code in OpCodes.GET_HK:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "Requesting housekeeping set"))
|
||||
sid = make_sid(object_id=CORE_CONTROLLER_ID, set_id=SetIds.HK)
|
||||
command = generate_one_hk_command(sid, 201)
|
||||
@ -192,7 +264,7 @@ def perform_reboot_cmd(
|
||||
)
|
||||
action_cmd = generate_action_command(
|
||||
object_id=CORE_CONTROLLER_ID,
|
||||
action_id=ActionIds.REBOOT,
|
||||
action_id=ActionIds.XSC_REBOOT,
|
||||
app_data=tc_data,
|
||||
ssc=0,
|
||||
)
|
||||
|
901
pus_tc/system/proc.py
Normal file
901
pus_tc/system/proc.py
Normal file
@ -0,0 +1,901 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import struct
|
||||
import time
|
||||
from typing import List
|
||||
|
||||
from config.definitions import CustomServiceList
|
||||
from config.object_ids import get_object_ids
|
||||
from pus_tc.system.tcs import pack_tcs_sys_commands
|
||||
from tmtccmd.config import (
|
||||
QueueCommands,
|
||||
ServiceOpCodeDictT,
|
||||
add_op_code_entry,
|
||||
add_service_op_code_entry,
|
||||
)
|
||||
from tmtccmd.tc.definitions import TcQueueT
|
||||
from tmtccmd.tc.pus_11_tc_sched import (
|
||||
generate_time_tagged_cmd,
|
||||
generate_enable_tc_sched_cmd,
|
||||
generate_reset_tc_sched_cmd,
|
||||
)
|
||||
from tmtccmd.tc.pus_3_fsfw_hk import *
|
||||
|
||||
import config.object_ids as oids
|
||||
from pus_tc.system.tcs import OpCodes as TcsOpCodes
|
||||
from pus_tc.devs.bpx_batt import BpxSetIds
|
||||
from pus_tc.system.core import SetIds as CoreSetIds
|
||||
from gomspace.gomspace_common import SetIds as GsSetIds
|
||||
from pus_tc.devs.rad_sensor import SetIds as RadSetIds
|
||||
from pus_tc.devs.mgms import MgmLis3SetIds as MgmLis3SetIds_0_2
|
||||
from pus_tc.devs.mgms import MgmRm3100SetIds as MgmRm3100SetIds_1_3
|
||||
from pus_tc.devs.gyros import AdisGyroSetIds as AdisGyroSetIds_0_2
|
||||
from pus_tc.devs.gyros import L3gGyroSetIds as L3gGyroSetIds_1_3
|
||||
from pus_tc.devs.gps import SetIds as GpsSetIds
|
||||
from pus_tc.devs.imtq import ImtqSetIds
|
||||
from pus_tc.devs.sus import SetIds
|
||||
from pus_tc.devs.star_tracker import SetIds as StrSetIds
|
||||
from pus_tc.devs.reaction_wheels import RwSetIds
|
||||
from pus_tc.system.controllers import pack_cmd_ctrl_to_off, pack_cmd_ctrl_to_nml
|
||||
from pus_tc.system.acs import pack_acs_command, pack_sus_cmds
|
||||
from pus_tc.devs.imtq import pack_imtq_test_into, pack_dipole_command
|
||||
from pus_tc.devs.star_tracker import pack_star_tracker_commands
|
||||
from pus_tc.devs.reaction_wheels import pack_rw_ass_cmds, pack_set_speed_command
|
||||
|
||||
|
||||
class OpCodes:
|
||||
TV_SETUP_TCS_FT_ON = ["s", "tcs-ft-on"]
|
||||
RESET_SCHED = ["reset-sched", "rs"]
|
||||
HEATER = ["heater"]
|
||||
BAT_FT = ["bat-ft"]
|
||||
CORE_FT = ["core-ft"]
|
||||
PCDU_FT = ["pcdu-ft"]
|
||||
RAD_SEN_FT = ["rad-sen-ft"]
|
||||
ACS_FT = ["acs-ft"]
|
||||
MGT_FT = ["mgt-ft"]
|
||||
MGT_FT_DP = ["mgt-ft-dp"]
|
||||
SUS_FT = ["sus-ft"]
|
||||
STR_FT = ["str-ft"]
|
||||
RW_FT_ONE_RW = ["rw-ft-one-rw"]
|
||||
RW_FT_TWO_RWS = ["rw-ft-two-rws"]
|
||||
TV_TEARDOWN_TCS_FT_OFF = ["t", "tcs-ft-off"]
|
||||
|
||||
|
||||
class KeyAndInfo:
|
||||
TV_SETUP_TCS_FT_ON = ["TCS Act.", "TCS functional test activation"]
|
||||
RESET_SCHED = ["Reset Sched", "Reset/Clear TC schedule"]
|
||||
HEATER = ["Heater", "heater procedure"]
|
||||
BAT_FT = ["BPX Battery", "battery functional test"]
|
||||
CORE_FT = ["OBC", "OBC functional test"]
|
||||
PCDU_FT = ["PCDU", "PCDU functional test"]
|
||||
RAD_SEN_FT = ["Radiation Sensor", "Radiation Sensor functional test"]
|
||||
ACS_FT = ["ACS", "ACS functional test"]
|
||||
MGT_FT = ["MGT", "MGT functional test"]
|
||||
MGT_FT_DP = ["MGT dipole", "MGT functional test with dipole"]
|
||||
SUS_FT = ["SUS", "SUS functional test"]
|
||||
STR_FT = ["STR", "STR functional test"]
|
||||
RW_FT_ONE_RW = ["RW ONE RW", "RW functional test with one RW"]
|
||||
RW_FT_TWO_RWS = ["RW TWO RWS", "RW functional test with two RWs"]
|
||||
TV_TEARDOWN_TCS_FT_OFF = ["TCS Deact.", "TCS functional test deactivation"]
|
||||
|
||||
|
||||
KAI = KeyAndInfo
|
||||
|
||||
PROC_INFO_DICT = {
|
||||
KAI.TV_SETUP_TCS_FT_ON[0]: [OpCodes.TV_SETUP_TCS_FT_ON, KAI.TV_SETUP_TCS_FT_ON[1], 120.0, 10.0],
|
||||
KAI.TV_TEARDOWN_TCS_FT_OFF[0]: [
|
||||
OpCodes.TV_TEARDOWN_TCS_FT_OFF,
|
||||
KAI.TV_TEARDOWN_TCS_FT_OFF[1],
|
||||
120.0,
|
||||
10.0,
|
||||
],
|
||||
KAI.BAT_FT[0]: [OpCodes.BAT_FT, KAI.BAT_FT[1], 120.0, 10.0],
|
||||
KAI.CORE_FT[0]: [OpCodes.CORE_FT, KAI.CORE_FT[1], 120.0, 10.0],
|
||||
KAI.PCDU_FT[0]: [OpCodes.PCDU_FT, KAI.PCDU_FT[1], 120.0, 10.0],
|
||||
KAI.RAD_SEN_FT[0]: [OpCodes.RAD_SEN_FT, KAI.RAD_SEN_FT[1], 120.0, 10.0],
|
||||
KAI.ACS_FT[0]: [OpCodes.ACS_FT, KAI.ACS_FT[1], 120.0, 10.0],
|
||||
KAI.MGT_FT[0]: [OpCodes.MGT_FT, KAI.MGT_FT[1], 120.0, 10.0],
|
||||
# collection_time for KAI.MGT_FT_DP maybe be reduced as a full 120
|
||||
# seconds is not needed after MGTs are tested
|
||||
KAI.MGT_FT_DP[0]: [OpCodes.MGT_FT_DP, KAI.MGT_FT_DP[1], 10.0, 10.0],
|
||||
KAI.SUS_FT[0]: [OpCodes.SUS_FT, KAI.SUS_FT[1], 120.0, 10.0],
|
||||
KAI.STR_FT[0]: [OpCodes.STR_FT, KAI.STR_FT[1], 120.0, 10.0],
|
||||
# collection_time for KAI.RW_FT_ONE_RW maybe be reduced as a full 120
|
||||
# seconds is not needed after RWs are tested
|
||||
KAI.RW_FT_ONE_RW[0]: [OpCodes.RW_FT_ONE_RW, KAI.RW_FT_ONE_RW[1], 10.0, 1.0],
|
||||
# collection_time for KAI.RW_FT_ONE_RW maybe be reduced as a full 120
|
||||
# seconds is not needed after RWs are tested
|
||||
KAI.RW_FT_TWO_RWS[0]: [OpCodes.RW_FT_TWO_RWS, KAI.RW_FT_TWO_RWS[1], 10.0, 1.0],
|
||||
}
|
||||
|
||||
|
||||
class GenericHkListeningCfg:
|
||||
def __init__(self, mgt: bool = False, one_rw: bool = False, two_rws: bool = False):
|
||||
self.use_tc_sched = False
|
||||
self.mgt = mgt
|
||||
self.one_rw = one_rw
|
||||
self.two_rws = two_rws
|
||||
|
||||
@classmethod
|
||||
def default(cls) -> GenericHkListeningCfg:
|
||||
return GenericHkListeningCfg(False, False, False)
|
||||
|
||||
|
||||
def generic_print(tc_queue: TcQueueT, info: dict):
|
||||
tc_queue.appendleft(
|
||||
(QueueCommands.PRINT, f"Executing {info[1]} Procedure (OpCodes: {info[0]})")
|
||||
)
|
||||
|
||||
|
||||
def add_proc_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
op_code_dict = dict()
|
||||
for proc_entry in PROC_INFO_DICT.values():
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict, keys=proc_entry[0], info=proc_entry[1]
|
||||
)
|
||||
add_service_op_code_entry(
|
||||
srv_op_code_dict=cmd_dict,
|
||||
name=CustomServiceList.PROCEDURE.value,
|
||||
info="TV Test Procedures",
|
||||
op_code_entry=op_code_dict,
|
||||
)
|
||||
|
||||
|
||||
def pack_generic_hk_listening_cmds(
|
||||
tc_queue: TcQueueT,
|
||||
proc_key: str,
|
||||
sid_list: list[bytearray],
|
||||
diag_list: list[bool],
|
||||
cfg: GenericHkListeningCfg,
|
||||
):
|
||||
info = PROC_INFO_DICT[proc_key]
|
||||
collection_time = info[2]
|
||||
generic_print(tc_queue=tc_queue, info=info)
|
||||
|
||||
for i in range(len(sid_list)):
|
||||
enable_listen_to_hk_for_x_seconds(
|
||||
diag=diag_list[i],
|
||||
tc_queue=tc_queue,
|
||||
device=proc_key,
|
||||
sid=sid_list[i],
|
||||
interval_seconds=info[3],
|
||||
)
|
||||
if not cfg.use_tc_sched:
|
||||
tc_queue.appendleft((QueueCommands.WAIT, 2.0))
|
||||
|
||||
if cfg.mgt:
|
||||
activate_mgts_alternately(
|
||||
tc_queue=tc_queue,
|
||||
)
|
||||
|
||||
elif cfg.one_rw:
|
||||
activate_all_rws_in_sequence(
|
||||
tc_queue=tc_queue, test_speed=20000, test_ramp_time=10000, init_ssc=0
|
||||
)
|
||||
elif cfg.two_rws:
|
||||
activate_all_rws_two_consecutively(tc_queue=tc_queue, init_ssc=0)
|
||||
else:
|
||||
pass
|
||||
|
||||
if not cfg.use_tc_sched:
|
||||
tc_queue.appendleft((QueueCommands.WAIT, collection_time))
|
||||
disable_cmd_list = []
|
||||
for i in range(len(sid_list)):
|
||||
disable_cmd_list.append(
|
||||
gen_disable_listen_to_hk_for_x_seconds(
|
||||
diag=diag_list[i],
|
||||
tc_queue=tc_queue,
|
||||
device=proc_key,
|
||||
sid=sid_list[i],
|
||||
)
|
||||
)
|
||||
if cfg.one_rw or cfg.two_rws:
|
||||
activate_all_rws_in_sequence(
|
||||
tc_queue=tc_queue, test_speed=0, test_ramp_time=5000, init_ssc=0
|
||||
)
|
||||
tc_queue.appendleft((QueueCommands.WAIT, 60))
|
||||
current_time = time.time()
|
||||
current_time += collection_time
|
||||
if not cfg.use_tc_sched:
|
||||
for cmd in disable_cmd_list:
|
||||
tc_queue.appendleft(cmd.pack_command_tuple())
|
||||
else:
|
||||
for cmd in disable_cmd_list:
|
||||
tc_queue.appendleft(
|
||||
generate_time_tagged_cmd(
|
||||
release_time=struct.pack("!I", int(current_time)),
|
||||
tc_to_insert=cmd,
|
||||
ssc=0,
|
||||
)
|
||||
)
|
||||
|
||||
if not cfg.use_tc_sched:
|
||||
tc_queue.appendleft((QueueCommands.WAIT, 60))
|
||||
sid_list.clear()
|
||||
diag_list.clear()
|
||||
|
||||
|
||||
def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
|
||||
sid_list = []
|
||||
obj_id_dict = get_object_ids()
|
||||
if op_code in OpCodes.RESET_SCHED:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "Resetting/Clearing TC schedule"))
|
||||
tc_queue.appendleft(generate_reset_tc_sched_cmd().pack_command_tuple())
|
||||
if op_code in OpCodes.BAT_FT:
|
||||
key = KAI.BAT_FT[0]
|
||||
sid_list.append(make_sid(oids.BPX_HANDLER_ID, BpxSetIds.GET_HK_SET))
|
||||
diag_list = [False]
|
||||
pack_generic_hk_listening_cmds(
|
||||
tc_queue=tc_queue,
|
||||
proc_key=key,
|
||||
sid_list=sid_list,
|
||||
diag_list=diag_list,
|
||||
cfg=GenericHkListeningCfg.default(),
|
||||
)
|
||||
|
||||
if op_code in OpCodes.CORE_FT:
|
||||
key = KAI.CORE_FT[0]
|
||||
sid_list.append(make_sid(oids.CORE_CONTROLLER_ID, CoreSetIds.HK))
|
||||
diag_list = [False]
|
||||
pack_generic_hk_listening_cmds(
|
||||
tc_queue=tc_queue,
|
||||
proc_key=key,
|
||||
sid_list=sid_list,
|
||||
diag_list=diag_list,
|
||||
cfg=GenericHkListeningCfg.default(),
|
||||
)
|
||||
|
||||
if op_code in OpCodes.PCDU_FT:
|
||||
key = KAI.PCDU_FT[0]
|
||||
pcdu_pairs = [
|
||||
(oids.P60_DOCK_HANDLER, GsSetIds.P60_CORE),
|
||||
(oids.PDU_1_HANDLER_ID, GsSetIds.PDU_1_CORE),
|
||||
(oids.PDU_2_HANDLER_ID, GsSetIds.PDU_2_CORE),
|
||||
(oids.ACU_HANDLER_ID, GsSetIds.ACU_CORE),
|
||||
(oids.P60_DOCK_HANDLER, GsSetIds.P60_AUX),
|
||||
(oids.PDU_1_HANDLER_ID, GsSetIds.PDU_1_AUX),
|
||||
(oids.PDU_2_HANDLER_ID, GsSetIds.PDU_2_AUX),
|
||||
(oids.ACU_HANDLER_ID, GsSetIds.ACU_AUX),
|
||||
]
|
||||
|
||||
diag_list = [
|
||||
False,
|
||||
True,
|
||||
True,
|
||||
True,
|
||||
False,
|
||||
False,
|
||||
False,
|
||||
False,
|
||||
]
|
||||
|
||||
for pcdu_dev in pcdu_pairs:
|
||||
oid = pcdu_dev[0]
|
||||
set_id = pcdu_dev[1]
|
||||
sid_list.append(make_sid(oid, set_id))
|
||||
pack_generic_hk_listening_cmds(
|
||||
tc_queue=tc_queue,
|
||||
proc_key=key,
|
||||
sid_list=sid_list,
|
||||
diag_list=diag_list,
|
||||
cfg=GenericHkListeningCfg.default(),
|
||||
)
|
||||
|
||||
if op_code in OpCodes.RAD_SEN_FT:
|
||||
key = KAI.RAD_SEN_FT[0]
|
||||
sid_list.append(make_sid(oids.RAD_SENSOR_ID, RadSetIds.HK))
|
||||
diag_list = [False]
|
||||
pack_generic_hk_listening_cmds(
|
||||
tc_queue=tc_queue,
|
||||
proc_key=key,
|
||||
sid_list=sid_list,
|
||||
diag_list=diag_list,
|
||||
cfg=GenericHkListeningCfg.default(),
|
||||
)
|
||||
|
||||
if op_code in OpCodes.TV_SETUP_TCS_FT_ON:
|
||||
# Enable scheduling
|
||||
tc_queue.appendleft(generate_enable_tc_sched_cmd(ssc=22).pack_command_tuple())
|
||||
# check whether tcs_assembly also has to be commanded to NORMAL Mode
|
||||
pack_tcs_sys_commands(
|
||||
tc_queue=tc_queue, op_code=TcsOpCodes.TCS_BOARD_ASS_NORMAL[0]
|
||||
)
|
||||
pack_cmd_ctrl_to_nml(
|
||||
tc_queue=tc_queue, object_id=obj_id_dict.get(oids.THERMAL_CONTROLLER_ID)
|
||||
)
|
||||
|
||||
if op_code in OpCodes.TV_TEARDOWN_TCS_FT_OFF:
|
||||
# TCS board should always be on anyway, do not command it off here
|
||||
pack_cmd_ctrl_to_off(
|
||||
tc_queue=tc_queue, object_id=obj_id_dict.get(oids.THERMAL_CONTROLLER_ID)
|
||||
)
|
||||
|
||||
if op_code in OpCodes.ACS_FT:
|
||||
key = KAI.ACS_FT[0]
|
||||
a_side_pairs = [
|
||||
(oids.MGM_0_LIS3_HANDLER_ID, MgmLis3SetIds_0_2.CORE_HK),
|
||||
(oids.MGM_1_RM3100_HANDLER_ID, MgmRm3100SetIds_1_3.CORE_HK),
|
||||
(oids.GYRO_0_ADIS_HANDLER_ID, AdisGyroSetIds_0_2.CORE_HK),
|
||||
(oids.GYRO_1_L3G_HANDLER_ID, L3gGyroSetIds_1_3.CORE_HK),
|
||||
(oids.GPS_CONTROLLER, GpsSetIds.HK),
|
||||
]
|
||||
b_side_pairs = [
|
||||
(oids.MGM_2_LIS3_HANDLER_ID, MgmLis3SetIds_0_2.CORE_HK),
|
||||
(oids.MGM_3_RM3100_HANDLER_ID, MgmRm3100SetIds_1_3.CORE_HK),
|
||||
(oids.GYRO_2_ADIS_HANDLER_ID, AdisGyroSetIds_0_2.CORE_HK),
|
||||
(oids.GYRO_3_L3G_HANDLER_ID, L3gGyroSetIds_1_3.CORE_HK),
|
||||
(oids.GPS_CONTROLLER, GpsSetIds.HK),
|
||||
]
|
||||
d_side_pairs = a_side_pairs + b_side_pairs
|
||||
diag_list = [
|
||||
False,
|
||||
False,
|
||||
True,
|
||||
False,
|
||||
False
|
||||
]
|
||||
pack_acs_command(tc_queue=tc_queue, op_code="acs-a")
|
||||
|
||||
for a_side_dev in a_side_pairs:
|
||||
oid = a_side_dev[0]
|
||||
set_id = a_side_dev[1]
|
||||
sid_list.append(make_sid(oid, set_id))
|
||||
pack_generic_hk_listening_cmds(
|
||||
tc_queue=tc_queue,
|
||||
proc_key=key,
|
||||
sid_list=sid_list,
|
||||
diag_list=diag_list,
|
||||
cfg=GenericHkListeningCfg.default(),
|
||||
)
|
||||
|
||||
pack_acs_command(tc_queue=tc_queue, op_code="acs-off")
|
||||
tc_queue.appendleft((QueueCommands.WAIT, 5.0))
|
||||
pack_acs_command(tc_queue=tc_queue, op_code="acs-b")
|
||||
|
||||
sid_list.clear()
|
||||
diag_list = [
|
||||
False,
|
||||
False,
|
||||
True,
|
||||
False,
|
||||
False
|
||||
]
|
||||
|
||||
for b_side_dev in b_side_pairs:
|
||||
oid = b_side_dev[0]
|
||||
set_id = b_side_dev[1]
|
||||
sid_list.append(make_sid(oid, set_id))
|
||||
pack_generic_hk_listening_cmds(
|
||||
tc_queue=tc_queue,
|
||||
proc_key=key,
|
||||
sid_list=sid_list,
|
||||
diag_list=diag_list,
|
||||
cfg=GenericHkListeningCfg.default(),
|
||||
)
|
||||
|
||||
pack_acs_command(tc_queue=tc_queue, op_code="acs-off")
|
||||
tc_queue.appendleft((QueueCommands.WAIT, 5.0))
|
||||
pack_acs_command(tc_queue=tc_queue, op_code="acs-d")
|
||||
|
||||
sid_list.clear()
|
||||
|
||||
for d_side_dev in d_side_pairs:
|
||||
oid = d_side_dev[0]
|
||||
set_id = d_side_dev[1]
|
||||
sid_list.append(make_sid(oid, set_id))
|
||||
diag_list = [
|
||||
False,
|
||||
False,
|
||||
True,
|
||||
False,
|
||||
False,
|
||||
False,
|
||||
False,
|
||||
True,
|
||||
False,
|
||||
False,
|
||||
]
|
||||
pack_generic_hk_listening_cmds(
|
||||
tc_queue=tc_queue,
|
||||
proc_key=key,
|
||||
sid_list=sid_list,
|
||||
diag_list=diag_list,
|
||||
cfg=GenericHkListeningCfg.default(),
|
||||
)
|
||||
|
||||
pack_acs_command(tc_queue=tc_queue, op_code="acs-off")
|
||||
|
||||
if op_code in OpCodes.MGT_FT:
|
||||
key = KAI.MGT_FT[0]
|
||||
imtq_pairs = [
|
||||
(oids.IMTQ_HANDLER_ID, ImtqSetIds.ENG_HK_SET),
|
||||
(oids.IMTQ_HANDLER_ID, ImtqSetIds.CAL_MTM_SET),
|
||||
(oids.IMTQ_HANDLER_ID, ImtqSetIds.RAW_MTM_SET),
|
||||
]
|
||||
diag_list = [
|
||||
True,
|
||||
True,
|
||||
True,
|
||||
]
|
||||
|
||||
# Command MGT to mode on
|
||||
pack_imtq_test_into(oids.IMTQ_HANDLER_ID, tc_queue=tc_queue, op_code="1")
|
||||
tc_queue.appendleft((QueueCommands.WAIT, 5))
|
||||
# Command MGT to normal mode
|
||||
pack_imtq_test_into(oids.IMTQ_HANDLER_ID, tc_queue=tc_queue, op_code="2")
|
||||
|
||||
for imtq_dev in imtq_pairs:
|
||||
oid = imtq_dev[0]
|
||||
set_id = imtq_dev[1]
|
||||
sid_list.append(make_sid(oid, set_id))
|
||||
pack_generic_hk_listening_cmds(
|
||||
tc_queue=tc_queue, proc_key=key, sid_list=sid_list, diag_list=diag_list, cfg=GenericHkListeningCfg.default()
|
||||
)
|
||||
|
||||
pack_imtq_test_into(oids.IMTQ_HANDLER_ID, tc_queue=tc_queue, op_code="0")
|
||||
|
||||
if op_code in OpCodes.MGT_FT_DP:
|
||||
key = KAI.MGT_FT_DP[0]
|
||||
a_side_pairs = [
|
||||
(oids.MGM_0_LIS3_HANDLER_ID, MgmLis3SetIds_0_2.CORE_HK),
|
||||
(oids.MGM_1_RM3100_HANDLER_ID, MgmRm3100SetIds_1_3.CORE_HK),
|
||||
(oids.GYRO_0_ADIS_HANDLER_ID, AdisGyroSetIds_0_2.CORE_HK),
|
||||
(oids.GYRO_1_L3G_HANDLER_ID, L3gGyroSetIds_1_3.CORE_HK),
|
||||
(oids.GPS_CONTROLLER, GpsSetIds.HK),
|
||||
]
|
||||
b_side_pairs = [
|
||||
(oids.MGM_2_LIS3_HANDLER_ID, MgmLis3SetIds_0_2.CORE_HK),
|
||||
(oids.MGM_3_RM3100_HANDLER_ID, MgmRm3100SetIds_1_3.CORE_HK),
|
||||
(oids.GYRO_2_ADIS_HANDLER_ID, AdisGyroSetIds_0_2.CORE_HK),
|
||||
(oids.GYRO_3_L3G_HANDLER_ID, L3gGyroSetIds_1_3.CORE_HK),
|
||||
(oids.GPS_CONTROLLER, GpsSetIds.HK),
|
||||
]
|
||||
imtq_pairs = [
|
||||
(oids.IMTQ_HANDLER_ID, ImtqSetIds.ENG_HK_SET),
|
||||
(oids.IMTQ_HANDLER_ID, ImtqSetIds.CAL_MTM_SET),
|
||||
(oids.IMTQ_HANDLER_ID, ImtqSetIds.RAW_MTM_SET),
|
||||
]
|
||||
d_side_and_imtq_pairs = a_side_pairs + b_side_pairs + imtq_pairs
|
||||
diag_list = [
|
||||
False,
|
||||
False,
|
||||
True,
|
||||
False,
|
||||
False,
|
||||
False,
|
||||
False,
|
||||
True,
|
||||
False,
|
||||
False,
|
||||
True,
|
||||
True,
|
||||
True,
|
||||
]
|
||||
pack_acs_command(tc_queue=tc_queue, op_code="acs-d")
|
||||
# Command MGT to mode on
|
||||
pack_imtq_test_into(oids.IMTQ_HANDLER_ID, tc_queue=tc_queue, op_code="1")
|
||||
tc_queue.appendleft((QueueCommands.WAIT, 20))
|
||||
# Command MGT to normal mode
|
||||
pack_imtq_test_into(oids.IMTQ_HANDLER_ID, tc_queue=tc_queue, op_code="2")
|
||||
|
||||
for d_side_and_imtq_dev in d_side_and_imtq_pairs:
|
||||
oid = d_side_and_imtq_dev[0]
|
||||
set_id = d_side_and_imtq_dev[1]
|
||||
sid_list.append(make_sid(oid, set_id))
|
||||
|
||||
cfg = GenericHkListeningCfg.default()
|
||||
cfg.mgt = True
|
||||
pack_generic_hk_listening_cmds(
|
||||
tc_queue=tc_queue,
|
||||
proc_key=key,
|
||||
sid_list=sid_list,
|
||||
diag_list=diag_list,
|
||||
cfg=cfg,
|
||||
)
|
||||
|
||||
pack_imtq_test_into(oids.IMTQ_HANDLER_ID, tc_queue=tc_queue, op_code="0")
|
||||
pack_acs_command(tc_queue=tc_queue, op_code="acs-off")
|
||||
|
||||
if op_code in OpCodes.SUS_FT:
|
||||
key = KAI.SUS_FT[0]
|
||||
|
||||
pack_sus_cmds(tc_queue=tc_queue, op_code="sus-nom")
|
||||
|
||||
sus_n_ids = [
|
||||
oids.SUS_0_N_LOC_XFYFZM_PT_XF,
|
||||
oids.SUS_1_N_LOC_XBYFZM_PT_XB,
|
||||
oids.SUS_2_N_LOC_XFYBZB_PT_YB,
|
||||
oids.SUS_3_N_LOC_XFYBZF_PT_YF,
|
||||
oids.SUS_4_N_LOC_XMYFZF_PT_ZF,
|
||||
oids.SUS_5_N_LOC_XFYMZB_PT_ZB,
|
||||
]
|
||||
sus_r_ids = [
|
||||
oids.SUS_6_R_LOC_XFYBZM_PT_XF,
|
||||
oids.SUS_7_R_LOC_XBYBZM_PT_XB,
|
||||
oids.SUS_8_R_LOC_XBYBZB_PT_YB,
|
||||
oids.SUS_9_R_LOC_XBYBZB_PT_YF,
|
||||
oids.SUS_10_R_LOC_XMYBZF_PT_ZF,
|
||||
oids.SUS_11_R_LOC_XBYMZB_PT_ZB,
|
||||
]
|
||||
diag_list = [
|
||||
True,
|
||||
True,
|
||||
True,
|
||||
True,
|
||||
True,
|
||||
True,
|
||||
]
|
||||
|
||||
# SUSs
|
||||
for nom_sus in sus_n_ids:
|
||||
sid_list.append(make_sid(nom_sus, SetIds.HK))
|
||||
pack_generic_hk_listening_cmds(
|
||||
tc_queue=tc_queue,
|
||||
proc_key=key,
|
||||
sid_list=sid_list,
|
||||
diag_list=diag_list,
|
||||
cfg=GenericHkListeningCfg.default(),
|
||||
)
|
||||
|
||||
pack_acs_command(tc_queue=tc_queue, op_code="sus-off")
|
||||
tc_queue.appendleft((QueueCommands.WAIT, 5.0))
|
||||
pack_sus_cmds(tc_queue=tc_queue, op_code="sus-red")
|
||||
|
||||
diag_list = [
|
||||
True,
|
||||
True,
|
||||
True,
|
||||
True,
|
||||
True,
|
||||
True,
|
||||
]
|
||||
|
||||
# SUSs
|
||||
for red_sus in sus_r_ids:
|
||||
sid_list.append(make_sid(red_sus, SetIds.HK))
|
||||
pack_generic_hk_listening_cmds(
|
||||
tc_queue=tc_queue,
|
||||
proc_key=key,
|
||||
sid_list=sid_list,
|
||||
diag_list=diag_list,
|
||||
cfg=GenericHkListeningCfg.default(),
|
||||
)
|
||||
|
||||
pack_acs_command(tc_queue=tc_queue, op_code="sus-off")
|
||||
tc_queue.appendleft((QueueCommands.WAIT, 5.0))
|
||||
pack_sus_cmds(tc_queue=tc_queue, op_code="sus-d")
|
||||
|
||||
# SUSs
|
||||
for nom_sus in sus_n_ids:
|
||||
sid_list.append(make_sid(nom_sus, SetIds.HK))
|
||||
for red_sus in sus_r_ids:
|
||||
sid_list.append(make_sid(red_sus, SetIds.HK))
|
||||
diag_list = [
|
||||
True,
|
||||
True,
|
||||
True,
|
||||
True,
|
||||
True,
|
||||
True,
|
||||
True,
|
||||
True,
|
||||
True,
|
||||
True,
|
||||
True,
|
||||
True,
|
||||
]
|
||||
pack_generic_hk_listening_cmds(
|
||||
tc_queue=tc_queue,
|
||||
proc_key=key,
|
||||
sid_list=sid_list,
|
||||
diag_list=diag_list,
|
||||
cfg=GenericHkListeningCfg.default(),
|
||||
)
|
||||
|
||||
pack_acs_command(tc_queue=tc_queue, op_code="sus-off")
|
||||
|
||||
if op_code in OpCodes.STR_FT:
|
||||
key = KAI.STR_FT[0]
|
||||
|
||||
pack_star_tracker_commands(
|
||||
object_id=oids.STAR_TRACKER_ID, tc_queue=tc_queue, op_code="2"
|
||||
)
|
||||
|
||||
# STR
|
||||
sid_list.append(make_sid(oids.STAR_TRACKER_ID, StrSetIds.TEMPERATURE))
|
||||
diag_list = [False]
|
||||
pack_generic_hk_listening_cmds(
|
||||
tc_queue=tc_queue,
|
||||
proc_key=key,
|
||||
sid_list=sid_list,
|
||||
diag_list=diag_list,
|
||||
cfg=GenericHkListeningCfg.default(),
|
||||
)
|
||||
|
||||
pack_star_tracker_commands(
|
||||
object_id=oids.STAR_TRACKER_ID, tc_queue=tc_queue, op_code="3"
|
||||
)
|
||||
|
||||
if op_code in OpCodes.RW_FT_ONE_RW:
|
||||
key = KAI.RW_FT_ONE_RW[0]
|
||||
rw_pairs = [
|
||||
(oids.RW1_ID, RwSetIds.STATUS_SET_ID),
|
||||
(oids.RW1_ID, RwSetIds.LAST_RESET),
|
||||
(oids.RW1_ID, RwSetIds.TM_SET),
|
||||
(oids.RW2_ID, RwSetIds.STATUS_SET_ID),
|
||||
(oids.RW2_ID, RwSetIds.LAST_RESET),
|
||||
(oids.RW2_ID, RwSetIds.TM_SET),
|
||||
(oids.RW3_ID, RwSetIds.STATUS_SET_ID),
|
||||
(oids.RW3_ID, RwSetIds.LAST_RESET),
|
||||
(oids.RW3_ID, RwSetIds.TM_SET),
|
||||
(oids.RW4_ID, RwSetIds.STATUS_SET_ID),
|
||||
(oids.RW4_ID, RwSetIds.LAST_RESET),
|
||||
(oids.RW4_ID, RwSetIds.TM_SET),
|
||||
]
|
||||
diag_list = [
|
||||
True,
|
||||
False,
|
||||
False,
|
||||
True,
|
||||
False,
|
||||
False,
|
||||
True,
|
||||
False,
|
||||
False,
|
||||
True,
|
||||
False,
|
||||
False,
|
||||
]
|
||||
# RW NORMAL
|
||||
pack_rw_ass_cmds(object_id=oids.RW_ASSEMBLY, tc_queue=tc_queue, op_code="nml")
|
||||
|
||||
# RW HK für alle RWs nur einzeln
|
||||
for rw_dev in rw_pairs:
|
||||
oid = rw_dev[0]
|
||||
set_id = rw_dev[1]
|
||||
sid_list.append(make_sid(oid, set_id))
|
||||
pack_generic_hk_listening_cmds(
|
||||
tc_queue=tc_queue,
|
||||
proc_key=key,
|
||||
sid_list=sid_list,
|
||||
diag_list=diag_list,
|
||||
cfg=GenericHkListeningCfg(mgt=False, one_rw=True, two_rws=False),
|
||||
)
|
||||
# RW OFF
|
||||
pack_rw_ass_cmds(object_id=oids.RW_ASSEMBLY, tc_queue=tc_queue, op_code="off")
|
||||
|
||||
# ass command with 2 rws to speed
|
||||
if op_code in OpCodes.RW_FT_TWO_RWS:
|
||||
key = KAI.RW_FT_TWO_RWS[0]
|
||||
rw_pairs = [
|
||||
(oids.RW1_ID, RwSetIds.STATUS_SET_ID),
|
||||
(oids.RW1_ID, RwSetIds.TEMPERATURE_SET_ID),
|
||||
(oids.RW1_ID, RwSetIds.LAST_RESET),
|
||||
(oids.RW1_ID, RwSetIds.TM_SET),
|
||||
(oids.RW2_ID, RwSetIds.STATUS_SET_ID),
|
||||
(oids.RW2_ID, RwSetIds.TEMPERATURE_SET_ID),
|
||||
(oids.RW2_ID, RwSetIds.LAST_RESET),
|
||||
(oids.RW2_ID, RwSetIds.TM_SET),
|
||||
(oids.RW3_ID, RwSetIds.STATUS_SET_ID),
|
||||
(oids.RW3_ID, RwSetIds.TEMPERATURE_SET_ID),
|
||||
(oids.RW3_ID, RwSetIds.LAST_RESET),
|
||||
(oids.RW3_ID, RwSetIds.TM_SET),
|
||||
(oids.RW4_ID, RwSetIds.STATUS_SET_ID),
|
||||
(oids.RW4_ID, RwSetIds.TEMPERATURE_SET_ID),
|
||||
(oids.RW4_ID, RwSetIds.LAST_RESET),
|
||||
(oids.RW4_ID, RwSetIds.TM_SET),
|
||||
]
|
||||
diag_list = [
|
||||
False,
|
||||
False,
|
||||
False,
|
||||
False,
|
||||
False,
|
||||
False,
|
||||
False,
|
||||
False,
|
||||
False,
|
||||
False,
|
||||
False,
|
||||
False,
|
||||
False,
|
||||
False,
|
||||
False,
|
||||
False,
|
||||
]
|
||||
# RW NORMAL
|
||||
pack_rw_ass_cmds(object_id=oids.RW_ASSEMBLY, tc_queue=tc_queue, op_code="nml")
|
||||
|
||||
# RW
|
||||
for rw_dev in rw_pairs:
|
||||
oid = rw_dev[0]
|
||||
set_id = rw_dev[1]
|
||||
sid_list.append(make_sid(oid, set_id))
|
||||
pack_generic_hk_listening_cmds(
|
||||
tc_queue=tc_queue,
|
||||
proc_key=key,
|
||||
sid_list=sid_list,
|
||||
diag_list=diag_list,
|
||||
cfg=GenericHkListeningCfg(mgt=False, one_rw=False, two_rws=True),
|
||||
)
|
||||
# RW OFF
|
||||
pack_rw_ass_cmds(object_id=oids.RW_ASSEMBLY, tc_queue=tc_queue, op_code="off")
|
||||
|
||||
|
||||
def enable_listen_to_hk_for_x_seconds(
|
||||
tc_queue: TcQueueT,
|
||||
diag: bool,
|
||||
device: str,
|
||||
sid: bytes,
|
||||
interval_seconds: float,
|
||||
):
|
||||
tc_queue.appendleft((QueueCommands.PRINT, f"Enabling periodic HK for {device}"))
|
||||
cmd_tuple = enable_periodic_hk_command_with_interval(
|
||||
diag=diag, sid=sid, interval_seconds=interval_seconds, ssc=0
|
||||
)
|
||||
for cmd in cmd_tuple:
|
||||
tc_queue.appendleft(cmd.pack_command_tuple())
|
||||
|
||||
|
||||
def gen_disable_listen_to_hk_for_x_seconds(
|
||||
tc_queue: TcQueueT,
|
||||
diag: bool,
|
||||
device: str,
|
||||
sid: bytes,
|
||||
) -> PusTelecommand:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, f"Disabling periodic HK for {device}"))
|
||||
return disable_periodic_hk_command(diag=diag, sid=sid, ssc=0)
|
||||
|
||||
|
||||
def activate_mgts_alternately(
|
||||
tc_queue: TcQueueT,
|
||||
):
|
||||
|
||||
command = pack_dipole_command(
|
||||
object_id=oids.IMTQ_HANDLER_ID,
|
||||
x_dipole=2000,
|
||||
y_dipole=0,
|
||||
z_dipole=0,
|
||||
duration=30000,
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
tc_queue.appendleft((QueueCommands.WAIT, 40.0))
|
||||
|
||||
command = pack_dipole_command(
|
||||
object_id=oids.IMTQ_HANDLER_ID,
|
||||
x_dipole=-2000,
|
||||
y_dipole=0,
|
||||
z_dipole=0,
|
||||
duration=30000,
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
tc_queue.appendleft((QueueCommands.WAIT, 40.0))
|
||||
|
||||
command = pack_dipole_command(
|
||||
object_id=oids.IMTQ_HANDLER_ID,
|
||||
x_dipole=0,
|
||||
y_dipole=2000,
|
||||
z_dipole=0,
|
||||
duration=30000,
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
tc_queue.appendleft((QueueCommands.WAIT, 40.0))
|
||||
|
||||
command = pack_dipole_command(
|
||||
object_id=oids.IMTQ_HANDLER_ID,
|
||||
x_dipole=0,
|
||||
y_dipole=-2000,
|
||||
z_dipole=0,
|
||||
duration=30000,
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
tc_queue.appendleft((QueueCommands.WAIT, 40.0))
|
||||
|
||||
command = pack_dipole_command(
|
||||
object_id=oids.IMTQ_HANDLER_ID,
|
||||
x_dipole=0,
|
||||
y_dipole=0,
|
||||
z_dipole=2000,
|
||||
duration=30000,
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
tc_queue.appendleft((QueueCommands.WAIT, 40.0))
|
||||
|
||||
command = pack_dipole_command(
|
||||
object_id=oids.IMTQ_HANDLER_ID,
|
||||
x_dipole=0,
|
||||
y_dipole=0,
|
||||
z_dipole=-2000,
|
||||
duration=30000,
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
tc_queue.appendleft((QueueCommands.WAIT, 40.0))
|
||||
|
||||
|
||||
def rw_speed_cmd_single(
|
||||
tc_queue: TcQueueT, oid: bytes, init_ssc: int, speed: int, ramp_time: int
|
||||
) -> int:
|
||||
command = pack_set_speed_command(
|
||||
object_id=oid, speed=speed, ramp_time_ms=ramp_time, ssc=init_ssc
|
||||
)
|
||||
init_ssc += 1
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
tc_queue.appendleft((QueueCommands.WAIT, 70.0))
|
||||
command = pack_set_speed_command(
|
||||
object_id=oid, speed=0, ramp_time_ms=ramp_time, ssc=init_ssc
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
return init_ssc + 1
|
||||
|
||||
|
||||
def rw_speed_up_cmd_consec(
|
||||
tc_queue: TcQueueT, obids: List[bytes], init_ssc: int, speed: int, ramp_time: int
|
||||
) -> int:
|
||||
for oid in obids:
|
||||
command = pack_set_speed_command(
|
||||
object_id=oid, speed=speed, ramp_time_ms=ramp_time, ssc=init_ssc
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
init_ssc += 1
|
||||
return init_ssc
|
||||
|
||||
|
||||
def rw_speed_down_cmd_consec(
|
||||
tc_queue: TcQueueT, obids: List[bytes], init_ssc: int, ramp_time: int
|
||||
) -> int:
|
||||
for oid in obids:
|
||||
command = pack_set_speed_command(
|
||||
object_id=oid, speed=0, ramp_time_ms=ramp_time, ssc=init_ssc
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
||||
init_ssc += 1
|
||||
return init_ssc
|
||||
|
||||
|
||||
def activate_all_rws_in_sequence(
|
||||
tc_queue: TcQueueT, init_ssc: int, test_speed: int, test_ramp_time: int
|
||||
) -> int:
|
||||
new_ssc = init_ssc
|
||||
# RW1 speed cmd
|
||||
tc_queue.appendleft((QueueCommands.WAIT, 58))
|
||||
new_ssc = rw_speed_cmd_single(
|
||||
tc_queue, oids.RW1_ID, new_ssc, test_speed, test_ramp_time
|
||||
)
|
||||
tc_queue.appendleft((QueueCommands.WAIT, 30))
|
||||
new_ssc = rw_speed_cmd_single(
|
||||
tc_queue, oids.RW2_ID, new_ssc, test_speed, test_ramp_time
|
||||
)
|
||||
tc_queue.appendleft((QueueCommands.WAIT, 30))
|
||||
new_ssc = rw_speed_cmd_single(
|
||||
tc_queue, oids.RW3_ID, new_ssc, test_speed, test_ramp_time
|
||||
)
|
||||
tc_queue.appendleft((QueueCommands.WAIT, 30))
|
||||
new_ssc = rw_speed_cmd_single(
|
||||
tc_queue, oids.RW4_ID, new_ssc, test_speed, test_ramp_time
|
||||
)
|
||||
tc_queue.appendleft((QueueCommands.WAIT, 30))
|
||||
return new_ssc
|
||||
|
||||
|
||||
def activate_all_rws_two_consecutively(tc_queue: TcQueueT, init_ssc: int) -> int:
|
||||
new_ssc = init_ssc
|
||||
# RW1+3 speed cmd
|
||||
tc_queue.appendleft((QueueCommands.WAIT, 5.0))
|
||||
new_ssc = rw_speed_up_cmd_consec(
|
||||
tc_queue, [oids.RW1_ID, oids.RW3_ID], new_ssc, -20000, 10000
|
||||
)
|
||||
tc_queue.appendleft((QueueCommands.WAIT, 70.0))
|
||||
new_ssc = rw_speed_down_cmd_consec(
|
||||
tc_queue, [oids.RW1_ID, oids.RW3_ID], new_ssc, 10000
|
||||
)
|
||||
tc_queue.appendleft((QueueCommands.WAIT, 15.0))
|
||||
# RW2+4 speed cmd
|
||||
new_ssc = rw_speed_up_cmd_consec(
|
||||
tc_queue, [oids.RW2_ID, oids.RW4_ID], new_ssc, -20000, 10000
|
||||
)
|
||||
tc_queue.appendleft((QueueCommands.WAIT, 70.0))
|
||||
new_ssc = rw_speed_down_cmd_consec(
|
||||
tc_queue, [oids.RW2_ID, oids.RW4_ID], new_ssc, 10000
|
||||
)
|
||||
tc_queue.appendleft((QueueCommands.WAIT, 15.0))
|
||||
return new_ssc
|
@ -1,7 +1,7 @@
|
||||
from tmtccmd.tc.definitions import TcQueueT, QueueCommands
|
||||
from tmtccmd.tc.service_200_mode import Modes
|
||||
from tmtccmd.tc.pus_200_fsfw_modes import Modes
|
||||
|
||||
from .common import command_assembly
|
||||
from .common import command_mode
|
||||
from config.object_ids import TCS_BOARD_ASS_ID
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ class Info:
|
||||
|
||||
def pack_tcs_sys_commands(tc_queue: TcQueueT, op_code: str):
|
||||
if op_code in OpCodes.TCS_BOARD_ASS_NORMAL:
|
||||
command_assembly(
|
||||
command_mode(
|
||||
object_id=TCS_BOARD_ASS_ID,
|
||||
mode=Modes.NORMAL,
|
||||
submode=0,
|
||||
@ -25,7 +25,7 @@ def pack_tcs_sys_commands(tc_queue: TcQueueT, op_code: str):
|
||||
info=Info.TCS_BOARD_ASS_NORMAL,
|
||||
)
|
||||
if op_code in OpCodes.TCS_BOARD_ASS_OFF:
|
||||
command_assembly(
|
||||
command_mode(
|
||||
object_id=TCS_BOARD_ASS_ID,
|
||||
mode=Modes.OFF,
|
||||
submode=0,
|
||||
|
28
pus_tc/system/time.py
Normal file
28
pus_tc/system/time.py
Normal file
@ -0,0 +1,28 @@
|
||||
from datetime import datetime
|
||||
|
||||
from spacepackets.ecss import PusTelecommand
|
||||
from tmtccmd.config import QueueCommands
|
||||
from tmtccmd.tc.definitions import TcQueueT
|
||||
|
||||
from tmtccmd.logging import get_console_logger
|
||||
|
||||
LOGGER = get_console_logger()
|
||||
|
||||
|
||||
class OpCodes:
|
||||
SET_CURRENT_TIME = ["0", "set-curr-time"]
|
||||
|
||||
|
||||
class Info:
|
||||
SET_CURRENT_TIME = "Setting current time in ASCII format"
|
||||
|
||||
|
||||
def pack_set_current_time_ascii_command(tc_queue: TcQueueT, ssc: int):
|
||||
time_test_current_time = datetime.utcnow().isoformat() + "Z" + "\0"
|
||||
current_time_ascii = time_test_current_time.encode("ascii")
|
||||
LOGGER.info(f"Current time in ASCII format: {current_time_ascii}")
|
||||
tc_queue.appendleft((QueueCommands.PRINT, Info.SET_CURRENT_TIME))
|
||||
command = PusTelecommand(
|
||||
service=9, subservice=128, ssc=ssc, app_data=current_time_ascii
|
||||
)
|
||||
tc_queue.appendleft(command.pack_command_tuple())
|
@ -5,43 +5,47 @@ import os
|
||||
from collections import deque
|
||||
from typing import Union
|
||||
|
||||
from pus_tc.devs.rtd import pack_rtd_commands
|
||||
from spacepackets.ecss import PusTelecommand
|
||||
from tmtccmd.com_if.com_interface_base import CommunicationInterface
|
||||
from tmtccmd.config.definitions import CoreServiceList
|
||||
from tmtccmd.config.definitions import CoreServiceList, QueueCommands
|
||||
from tmtccmd.logging import get_console_logger
|
||||
from tmtccmd.logging.pus import log_raw_pus_tc
|
||||
from tmtccmd.tc.definitions import TcQueueT
|
||||
from tmtccmd.tc.service_5_event import pack_generic_service5_test_into
|
||||
from tmtccmd.pus.service_17_test import pack_service_17_ping_command
|
||||
from tmtccmd.tc.pus_5_event import pack_generic_service5_test_into
|
||||
from tmtccmd.pus.pus_17_test import pack_service_17_ping_command
|
||||
from tmtccmd.logging import get_current_time_string
|
||||
|
||||
from pus_tc.service_200_mode import pack_service200_test_into
|
||||
from pus_tc.devs.p60dock import pack_p60dock_test_into
|
||||
from pus_tc.devs.p60dock import pack_p60dock_cmds
|
||||
from pus_tc.devs.pdu2 import pack_pdu2_commands
|
||||
from pus_tc.devs.pdu1 import pack_pdu1_commands
|
||||
from pus_tc.devs.bpx_batt import pack_bpx_commands
|
||||
from pus_tc.devs.acu import pack_acu_test_into
|
||||
from pus_tc.devs.acu import pack_acu_commands
|
||||
from pus_tc.devs.solar_array_deployment import pack_solar_array_deployment_test_into
|
||||
from pus_tc.devs.imtq import pack_imtq_test_into
|
||||
from pus_tc.devs.tmp1075 import pack_tmp1075_test_into
|
||||
from pus_tc.devs.ploc_mpsoc import pack_ploc_mpsoc_commands
|
||||
from pus_tc.devs.ploc_supervisor import pack_ploc_supv_commands
|
||||
from pus_tc.devs.heater import pack_heater_test_into
|
||||
from pus_tc.devs.reaction_wheels import pack_single_rw_test_into
|
||||
from pus_tc.devs.heater import pack_heater_cmds
|
||||
from pus_tc.devs.reaction_wheels import pack_single_rw_test_into, pack_rw_ass_cmds
|
||||
from pus_tc.devs.rad_sensor import pack_rad_sensor_test_into
|
||||
from pus_tc.devs.ploc_upater import pack_ploc_updater_test_into
|
||||
from pus_tc.devs.ploc_memory_dumper import pack_ploc_memory_dumper_cmd
|
||||
from pus_tc.devs.ccsds_handler import pack_ccsds_handler_test
|
||||
from pus_tc.system.core import pack_core_commands
|
||||
from pus_tc.devs.star_tracker import pack_star_tracker_commands
|
||||
from pus_tc.devs.syrlinks_hk_handler import pack_syrlinks_command
|
||||
from pus_tc.devs.gps import pack_gps_command
|
||||
from pus_tc.system.time import pack_set_current_time_ascii_command
|
||||
from pus_tc.system.acs import pack_acs_command, pack_sus_cmds
|
||||
from pus_tc.devs.plpcdu import pack_pl_pcdu_commands
|
||||
from pus_tc.devs.str_img_helper import pack_str_img_helper_command
|
||||
from pus_tc.system.tcs import pack_tcs_sys_commands
|
||||
from pus_tc.system.proc import pack_proc_commands
|
||||
from pus_tc.system.controllers import pack_cmd_ctrl_to_prompted_mode
|
||||
from config.definitions import CustomServiceList
|
||||
from config.object_ids import (
|
||||
get_object_ids,
|
||||
P60_DOCK_HANDLER,
|
||||
PDU_1_HANDLER_ID,
|
||||
PDU_2_HANDLER_ID,
|
||||
@ -57,40 +61,46 @@ from config.object_ids import (
|
||||
RW4_ID,
|
||||
RAD_SENSOR_ID,
|
||||
PLOC_SUPV_ID,
|
||||
PLOC_UPDATER_ID,
|
||||
STAR_TRACKER_ID,
|
||||
PLOC_MEMORY_DUMPER_ID,
|
||||
GPS_HANDLER_0_ID,
|
||||
GPS_HANDLER_1_ID,
|
||||
GPS_CONTROLLER,
|
||||
CCSDS_HANDLER_ID,
|
||||
PDEC_HANDLER_ID,
|
||||
STR_IMG_HELPER_ID,
|
||||
SYRLINKS_HANDLER_ID,
|
||||
SOLAR_ARRAY_DEPLOYMENT_ID,
|
||||
RW_ASSEMBLY,
|
||||
get_object_ids,
|
||||
)
|
||||
|
||||
import config.object_ids as oids
|
||||
|
||||
LOGGER = get_console_logger()
|
||||
|
||||
|
||||
def pre_tc_send_cb(
|
||||
packet: bytes,
|
||||
queue_entry: Union[bytes, QueueCommands],
|
||||
com_if: CommunicationInterface,
|
||||
pus_info: Union[PusTelecommand, any],
|
||||
queue_info: Union[PusTelecommand, any],
|
||||
file_logger: logging.Logger,
|
||||
):
|
||||
log_raw_pus_tc(
|
||||
packet=packet, srv_subservice=(pus_info.service, pus_info.subservice)
|
||||
)
|
||||
tc_info_string = f"Sent {pus_info}"
|
||||
LOGGER.info(tc_info_string)
|
||||
file_logger.info(f"{get_current_time_string(True)}: {tc_info_string}")
|
||||
com_if.send(data=packet)
|
||||
if isinstance(queue_entry, bytes) or isinstance(queue_entry, bytearray):
|
||||
log_raw_pus_tc(
|
||||
packet=queue_entry,
|
||||
srv_subservice=(queue_info.service, queue_info.subservice),
|
||||
)
|
||||
tc_info_string = f"Sent {queue_info}"
|
||||
LOGGER.info(tc_info_string)
|
||||
file_logger.info(f"{get_current_time_string(True)}: {tc_info_string}")
|
||||
com_if.send(data=queue_entry)
|
||||
elif isinstance(queue_entry, QueueCommands):
|
||||
if queue_entry == QueueCommands.PRINT:
|
||||
file_logger.info(queue_info)
|
||||
|
||||
|
||||
def pack_service_queue_user(
|
||||
service: Union[str, int], op_code: str, service_queue: TcQueueT
|
||||
):
|
||||
obj_id_man = get_object_ids()
|
||||
if service == CoreServiceList.SERVICE_5.value:
|
||||
return pack_generic_service5_test_into(tc_queue=service_queue)
|
||||
if service == CoreServiceList.SERVICE_17.value:
|
||||
@ -100,23 +110,27 @@ def pack_service_queue_user(
|
||||
if service == CoreServiceList.SERVICE_200.value:
|
||||
return pack_service200_test_into(tc_queue=service_queue)
|
||||
if service == CustomServiceList.P60DOCK.value:
|
||||
object_id = P60_DOCK_HANDLER
|
||||
return pack_p60dock_test_into(
|
||||
object_id = obj_id_man.get(P60_DOCK_HANDLER)
|
||||
return pack_p60dock_cmds(
|
||||
object_id=object_id, tc_queue=service_queue, op_code=op_code
|
||||
)
|
||||
if service == CustomServiceList.RTD.value:
|
||||
return pack_rtd_commands(
|
||||
object_id=None, tc_queue=service_queue, op_code=op_code
|
||||
)
|
||||
if service == CustomServiceList.PDU1.value:
|
||||
object_id = PDU_1_HANDLER_ID
|
||||
object_id = obj_id_man.get(PDU_1_HANDLER_ID)
|
||||
return pack_pdu1_commands(
|
||||
object_id=object_id, tc_queue=service_queue, op_code=op_code
|
||||
)
|
||||
if service == CustomServiceList.PDU2.value:
|
||||
object_id = PDU_2_HANDLER_ID
|
||||
object_id = obj_id_man.get(PDU_2_HANDLER_ID)
|
||||
return pack_pdu2_commands(
|
||||
object_id=object_id, tc_queue=service_queue, op_code=op_code
|
||||
)
|
||||
if service == CustomServiceList.ACU.value:
|
||||
object_id = ACU_HANDLER_ID
|
||||
return pack_acu_test_into(
|
||||
object_id = obj_id_man.get(ACU_HANDLER_ID)
|
||||
return pack_acu_commands(
|
||||
object_id=object_id, tc_queue=service_queue, op_code=op_code
|
||||
)
|
||||
if service == CustomServiceList.BPX_BATTERY.value:
|
||||
@ -133,7 +147,9 @@ def pack_service_queue_user(
|
||||
)
|
||||
if service == CustomServiceList.HEATER.value:
|
||||
object_id = HEATER_ID
|
||||
return pack_heater_test_into(object_id=object_id, tc_queue=service_queue)
|
||||
return pack_heater_cmds(
|
||||
object_id=object_id, tc_queue=service_queue, op_code=op_code
|
||||
)
|
||||
if service == CustomServiceList.IMTQ.value:
|
||||
object_id = IMTQ_HANDLER_ID
|
||||
return pack_imtq_test_into(
|
||||
@ -145,27 +161,23 @@ def pack_service_queue_user(
|
||||
object_id=object_id, tc_queue=service_queue, op_code=op_code
|
||||
)
|
||||
if service == CustomServiceList.REACTION_WHEEL_1.value:
|
||||
object_id = RW1_ID
|
||||
return pack_single_rw_test_into(
|
||||
object_id=object_id, tc_queue=service_queue, op_code=op_code
|
||||
object_id=RW1_ID, rw_idx=1, tc_queue=service_queue, op_code=op_code
|
||||
)
|
||||
if service == CustomServiceList.REACTION_WHEEL_2.value:
|
||||
object_id = RW2_ID
|
||||
return pack_single_rw_test_into(
|
||||
object_id=object_id, tc_queue=service_queue, op_code=op_code
|
||||
object_id=RW2_ID, rw_idx=2, tc_queue=service_queue, op_code=op_code
|
||||
)
|
||||
if service == CustomServiceList.REACTION_WHEEL_3.value:
|
||||
object_id = RW3_ID
|
||||
return pack_single_rw_test_into(
|
||||
object_id=object_id, tc_queue=service_queue, op_code=op_code
|
||||
object_id=RW3_ID, rw_idx=3, tc_queue=service_queue, op_code=op_code
|
||||
)
|
||||
if service == CustomServiceList.REACTION_WHEEL_4.value:
|
||||
object_id = RW4_ID
|
||||
return pack_single_rw_test_into(
|
||||
object_id=object_id, tc_queue=service_queue, op_code=op_code
|
||||
object_id=RW4_ID, rw_idx=4, tc_queue=service_queue, op_code=op_code
|
||||
)
|
||||
if service == CustomServiceList.RAD_SENSOR.value:
|
||||
object_id = RAD_SENSOR_ID
|
||||
object_id = obj_id_man.get(RAD_SENSOR_ID)
|
||||
return pack_rad_sensor_test_into(
|
||||
object_id=object_id, tc_queue=service_queue, op_code=op_code
|
||||
)
|
||||
@ -174,11 +186,6 @@ def pack_service_queue_user(
|
||||
return pack_ploc_supv_commands(
|
||||
object_id=object_id, tc_queue=service_queue, op_code=op_code
|
||||
)
|
||||
if service == CustomServiceList.PLOC_UPDATER.value:
|
||||
object_id = PLOC_UPDATER_ID
|
||||
return pack_ploc_updater_test_into(
|
||||
object_id=object_id, tc_queue=service_queue, op_code=op_code
|
||||
)
|
||||
if service == CustomServiceList.STAR_TRACKER.value:
|
||||
object_id = STAR_TRACKER_ID
|
||||
return pack_star_tracker_commands(
|
||||
@ -198,13 +205,9 @@ def pack_service_queue_user(
|
||||
)
|
||||
if service == CustomServiceList.ACS.value:
|
||||
return pack_acs_command(tc_queue=service_queue, op_code=op_code)
|
||||
if service == CustomServiceList.GPS_0.value:
|
||||
if service == CustomServiceList.GPS_CTRL.value:
|
||||
return pack_gps_command(
|
||||
object_id=GPS_HANDLER_0_ID, tc_queue=service_queue, op_code=op_code
|
||||
)
|
||||
if service == CustomServiceList.GPS_1.value:
|
||||
return pack_gps_command(
|
||||
object_id=GPS_HANDLER_1_ID, tc_queue=service_queue, op_code=op_code
|
||||
object_id=oids.GPS_CONTROLLER, tc_queue=service_queue, op_code=op_code
|
||||
)
|
||||
if service == CustomServiceList.CCSDS_HANDLER.value:
|
||||
return pack_ccsds_handler_test(
|
||||
@ -222,6 +225,8 @@ def pack_service_queue_user(
|
||||
return pack_solar_array_deployment_test_into(
|
||||
object_id=SOLAR_ARRAY_DEPLOYMENT_ID, tc_queue=service_queue
|
||||
)
|
||||
if service == CustomServiceList.PROCEDURE.value:
|
||||
return pack_proc_commands(tc_queue=service_queue, op_code=op_code)
|
||||
if service == CustomServiceList.SUS_ASS.value:
|
||||
return pack_sus_cmds(tc_queue=service_queue, op_code=op_code)
|
||||
if service == CustomServiceList.PL_PCDU.value:
|
||||
@ -230,7 +235,15 @@ def pack_service_queue_user(
|
||||
return pack_acs_command(tc_queue=service_queue, op_code=op_code)
|
||||
if service == CustomServiceList.TCS_ASS.value:
|
||||
return pack_tcs_sys_commands(tc_queue=service_queue, op_code=op_code)
|
||||
LOGGER.warning("Invalid Service !")
|
||||
if service == CustomServiceList.TIME.value:
|
||||
return pack_set_current_time_ascii_command(tc_queue=service_queue, ssc=0)
|
||||
if service == CustomServiceList.RW_ASSEMBLY.value:
|
||||
return pack_rw_ass_cmds(
|
||||
tc_queue=service_queue, object_id=RW_ASSEMBLY, op_code=op_code
|
||||
)
|
||||
if service == CustomServiceList.CONTROLLERS.value:
|
||||
return pack_controller_commands(tc_queue=service_queue, op_code=op_code)
|
||||
LOGGER.warning(f"Invalid Service {service}")
|
||||
|
||||
|
||||
def create_total_tc_queue_user() -> TcQueueT:
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user