Compare commits
55 Commits
07b13c153d
...
clean-up-e
Author | SHA1 | Date | |
---|---|---|---|
dc37a29d34
|
|||
d33013ed58 | |||
7e39a481bd | |||
4744de8a54 | |||
916ce92bdc | |||
bb765ac8a0 | |||
84f0f42783 | |||
ee2dade270 | |||
4f26c34c60 | |||
b5ae7c5f38 | |||
caaf937003
|
|||
1831ea8b7a
|
|||
747ad34eec
|
|||
2789453d57 | |||
5456d79965
|
|||
4c54aa7586 | |||
1a132684a6 | |||
f63a834d9a | |||
58def42281
|
|||
ee955e96fb
|
|||
97fb8a166f | |||
d477242881 | |||
451c2c07ee | |||
8de88127c3 | |||
e7e97ff2d3 | |||
35e3f8b572 | |||
77010937b8 | |||
c1f4a3f59d | |||
74e55b16dc | |||
f1f4a1e9a0
|
|||
40aa648e6b | |||
098843a74f
|
|||
1ea255d3e8 | |||
b1caaff672
|
|||
3b047094e6 | |||
56ebfb1000 | |||
a41dc9b691 | |||
1d121c40b2 | |||
0a417a89e9 | |||
7abce63a56 | |||
af24a95475 | |||
6ea3312b62 | |||
d7e61f1395 | |||
51227100af | |||
fc243b76cf
|
|||
62b16028e6
|
|||
4ae659cb4e
|
|||
228065bf3b
|
|||
1508acb7ae | |||
2642a772ad | |||
7c94ab3404 | |||
38b3166b3f | |||
e285ac1c47 | |||
534d0dc1af
|
|||
c4bd355146 |
23
CHANGELOG.md
23
CHANGELOG.md
@ -10,9 +10,32 @@ list yields a list of all related PRs for each release.
|
|||||||
|
|
||||||
# [unreleased]
|
# [unreleased]
|
||||||
|
|
||||||
|
# [v5.13.0] 2024-01-30
|
||||||
|
|
||||||
## Added
|
## Added
|
||||||
|
|
||||||
|
- Added new parameter commands for PLOC MPSoC to skip SUPV commanding.
|
||||||
|
|
||||||
|
# [v5.12.1] 2023-12-13
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
|
- A few new commands to test the TC scheduler.
|
||||||
|
|
||||||
|
# [v5.12.0] 2023-12-06
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
|
- New ACS controller commands.
|
||||||
|
|
||||||
|
# [v5.11.0] 2023-11-30
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
|
- Added new commands to disable channel order checks partially for the payload PCDU normal modes.
|
||||||
- Core controller auto switch enable and disable command.
|
- Core controller auto switch enable and disable command.
|
||||||
|
- Star Tracker JSON reload command. Reboot still required.
|
||||||
|
- PLOC SUPV ADC and Counters report TM handling.
|
||||||
|
|
||||||
# [v5.10.1] 2023-10-27
|
# [v5.10.1] 2023-10-27
|
||||||
|
|
||||||
|
@ -88,14 +88,16 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
|
|||||||
10804;0x2a34;FILENAME_TOO_LARGE_ERROR;LOW;P1: Transaction step ID, P2: 0 for source file name, 1 for dest file name;fsfw/src/fsfw/cfdp/handler/defs.h
|
10804;0x2a34;FILENAME_TOO_LARGE_ERROR;LOW;P1: Transaction step ID, P2: 0 for source file name, 1 for dest file name;fsfw/src/fsfw/cfdp/handler/defs.h
|
||||||
10805;0x2a35;HANDLING_CFDP_REQUEST_FAILED;LOW;CFDP request handling failed. P2: Returncode.;fsfw/src/fsfw/cfdp/handler/defs.h
|
10805;0x2a35;HANDLING_CFDP_REQUEST_FAILED;LOW;CFDP request handling failed. P2: Returncode.;fsfw/src/fsfw/cfdp/handler/defs.h
|
||||||
11200;0x2bc0;SAFE_RATE_VIOLATION;MEDIUM;The limits for the rotation in safe mode were violated.;mission/acs/defs.h
|
11200;0x2bc0;SAFE_RATE_VIOLATION;MEDIUM;The limits for the rotation in safe mode were violated.;mission/acs/defs.h
|
||||||
11201;0x2bc1;SAFE_RATE_RECOVERY;MEDIUM;The system has recovered from a safe rate rotation violation.;mission/acs/defs.h
|
11201;0x2bc1;RATE_RECOVERY;MEDIUM;The system has recovered from a rate rotation violation.;mission/acs/defs.h
|
||||||
11202;0x2bc2;MULTIPLE_RW_INVALID;HIGH;Multiple RWs are invalid, uncommandable and therefore higher ACS modes cannot be maintained.;mission/acs/defs.h
|
11202;0x2bc2;MULTIPLE_RW_INVALID;HIGH;Multiple RWs are invalid, uncommandable and therefore higher ACS modes cannot be maintained.;mission/acs/defs.h
|
||||||
11203;0x2bc3;MEKF_INVALID_INFO;INFO;MEKF was not able to compute a solution. P1: MEKF state on exit;mission/acs/defs.h
|
11203;0x2bc3;MEKF_INVALID_INFO;INFO;MEKF was not able to compute a solution. P1: MEKF state on exit;mission/acs/defs.h
|
||||||
11204;0x2bc4;MEKF_RECOVERY;INFO;MEKF is able to compute a solution again.;mission/acs/defs.h
|
11204;0x2bc4;MEKF_RECOVERY;INFO;MEKF is able to compute a solution again.;mission/acs/defs.h
|
||||||
11205;0x2bc5;MEKF_AUTOMATIC_RESET;INFO;MEKF performed an automatic reset after detection of nonfinite values.;mission/acs/defs.h
|
11205;0x2bc5;MEKF_AUTOMATIC_RESET;INFO;MEKF performed an automatic reset after detection of nonfinite values.;mission/acs/defs.h
|
||||||
11206;0x2bc6;MEKF_INVALID_MODE_VIOLATION;HIGH;MEKF was not able to compute a solution during any pointing ACS mode for a prolonged time.;mission/acs/defs.h
|
11206;0x2bc6;PTG_CTRL_NO_ATTITUDE_INFORMATION;HIGH;For a prolonged time, no attitude information was available for the Pointing Controller. Falling back to Safe Mode.;mission/acs/defs.h
|
||||||
11207;0x2bc7;SAFE_MODE_CONTROLLER_FAILURE;HIGH;The ACS safe mode controller was not able to compute a solution and has failed. P1: Missing information about magnetic field, P2: Missing information about rotational rate;mission/acs/defs.h
|
11207;0x2bc7;SAFE_MODE_CONTROLLER_FAILURE;HIGH;The ACS safe mode controller was not able to compute a solution and has failed. P1: Missing information about magnetic field, P2: Missing information about rotational rate;mission/acs/defs.h
|
||||||
11208;0x2bc8;TLE_TOO_OLD;INFO;The TLE for the SGP4 Propagator has become too old.;mission/acs/defs.h
|
11208;0x2bc8;TLE_TOO_OLD;INFO;The TLE for the SGP4 Propagator has become too old.;mission/acs/defs.h
|
||||||
|
11209;0x2bc9;TLE_FILE_READ_FAILED;LOW;The TLE could not be read from the filesystem.;mission/acs/defs.h
|
||||||
|
11210;0x2bca;PTG_RATE_VIOLATION;MEDIUM;The limits for the rotation in pointing mode were violated.;mission/acs/defs.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/power/defs.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/power/defs.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/power/defs.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/power/defs.h
|
||||||
11302;0x2c26;SWITCHING_Q7S_DENIED;MEDIUM;No description;mission/power/defs.h
|
11302;0x2c26;SWITCHING_Q7S_DENIED;MEDIUM;No description;mission/power/defs.h
|
||||||
@ -143,14 +145,16 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
|
|||||||
11901;0x2e7d;BOOTING_FIRMWARE_FAILED_EVENT;LOW;Failed to boot firmware;mission/acs/str/StarTrackerHandler.h
|
11901;0x2e7d;BOOTING_FIRMWARE_FAILED_EVENT;LOW;Failed to boot firmware;mission/acs/str/StarTrackerHandler.h
|
||||||
11902;0x2e7e;BOOTING_BOOTLOADER_FAILED_EVENT;LOW;Failed to boot star tracker into bootloader mode;mission/acs/str/StarTrackerHandler.h
|
11902;0x2e7e;BOOTING_BOOTLOADER_FAILED_EVENT;LOW;Failed to boot star tracker into bootloader mode;mission/acs/str/StarTrackerHandler.h
|
||||||
11903;0x2e7f;COM_ERROR_REPLY_RECEIVED;LOW;Received COM error. P1: Communication Error ID (datasheet p32);mission/acs/str/StarTrackerHandler.h
|
11903;0x2e7f;COM_ERROR_REPLY_RECEIVED;LOW;Received COM error. P1: Communication Error ID (datasheet p32);mission/acs/str/StarTrackerHandler.h
|
||||||
12001;0x2ee1;SUPV_MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC supervisor crc failure in telemetry packet;linux/payload/PlocSupervisorHandler.h
|
12001;0x2ee1;SUPV_MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC supervisor crc failure in telemetry packet;linux/payload/plocSupvDefs.h
|
||||||
12002;0x2ee2;SUPV_UNKNOWN_TM;LOW;Unhandled event. P1: APID, P2: Service ID;linux/payload/PlocSupervisorHandler.h
|
12002;0x2ee2;SUPV_UNKNOWN_TM;LOW;Unhandled event. P1: APID, P2: Service ID;linux/payload/plocSupvDefs.h
|
||||||
12003;0x2ee3;SUPV_UNINIMPLEMENTED_TM;LOW;No description;linux/payload/PlocSupervisorHandler.h
|
12003;0x2ee3;SUPV_UNINIMPLEMENTED_TM;LOW;No description;linux/payload/plocSupvDefs.h
|
||||||
12004;0x2ee4;SUPV_ACK_FAILURE;LOW;PLOC supervisor received acknowledgment failure report;linux/payload/PlocSupervisorHandler.h
|
12004;0x2ee4;SUPV_ACK_FAILURE;LOW;PLOC supervisor received acknowledgment failure report;linux/payload/plocSupvDefs.h
|
||||||
12005;0x2ee5;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/payload/PlocSupervisorHandler.h
|
12005;0x2ee5;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/payload/plocSupvDefs.h
|
||||||
12006;0x2ee6;SUPV_CRC_FAILURE_EVENT;LOW;PLOC supervisor reply has invalid crc;linux/payload/PlocSupervisorHandler.h
|
12006;0x2ee6;SUPV_CRC_FAILURE_EVENT;LOW;PLOC supervisor reply has invalid crc;linux/payload/plocSupvDefs.h
|
||||||
12007;0x2ee7;SUPV_HELPER_EXECUTING;LOW;Supervisor helper currently executing a command;linux/payload/PlocSupervisorHandler.h
|
12007;0x2ee7;SUPV_HELPER_EXECUTING;LOW;Supervisor helper currently executing a command;linux/payload/plocSupvDefs.h
|
||||||
12008;0x2ee8;SUPV_MPSOC_SHUTDOWN_BUILD_FAILED;LOW;Failed to build the command to shutdown the MPSoC;linux/payload/PlocSupervisorHandler.h
|
12008;0x2ee8;SUPV_MPSOC_SHUTDOWN_BUILD_FAILED;LOW;Failed to build the command to shutdown the MPSoC;linux/payload/plocSupvDefs.h
|
||||||
|
12009;0x2ee9;SUPV_ACK_UNKNOWN_COMMAND;LOW;Received ACK, but no related command is unknown or has not been sent by this software instance. P1: Module APID. P2: Service ID.;linux/payload/plocSupvDefs.h
|
||||||
|
12010;0x2eea;SUPV_EXE_ACK_UNKNOWN_COMMAND;LOW;Received ACK EXE, but no related command is unknown or has not been sent by this software instance. P1: Module APID. P2: Service ID.;linux/payload/plocSupvDefs.h
|
||||||
12100;0x2f44;SANITIZATION_FAILED;LOW;No description;bsp_q7s/fs/SdCardManager.h
|
12100;0x2f44;SANITIZATION_FAILED;LOW;No description;bsp_q7s/fs/SdCardManager.h
|
||||||
12101;0x2f45;MOUNTED_SD_CARD;INFO;No description;bsp_q7s/fs/SdCardManager.h
|
12101;0x2f45;MOUNTED_SD_CARD;INFO;No description;bsp_q7s/fs/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/payload/PlocMemoryDumper.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/payload/PlocMemoryDumper.h
|
||||||
|
|
@ -167,6 +167,9 @@ NOT_OK_TM_STORE = bytes([0x73, 0x02, 0x00, 0x03])
|
|||||||
HK_TM_STORE = bytes([0x73, 0x02, 0x00, 0x04])
|
HK_TM_STORE = bytes([0x73, 0x02, 0x00, 0x04])
|
||||||
CFDP_TM_STORE = bytes([0x73, 0x03, 0x00, 0x00])
|
CFDP_TM_STORE = bytes([0x73, 0x03, 0x00, 0x00])
|
||||||
|
|
||||||
|
|
||||||
|
SUPV_FILTER_SET = [PLOC_SUPV_ID, PDU_2_HANDLER_ID, PDU_1_HANDLER_ID]
|
||||||
|
|
||||||
ObjectIdDict = Dict[bytes, ObjectIdU32]
|
ObjectIdDict = Dict[bytes, ObjectIdU32]
|
||||||
|
|
||||||
|
|
||||||
|
@ -387,6 +387,7 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path
|
|||||||
0x4304;PUS11_InvalidRelativeTime;No description;4;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
|
0x4304;PUS11_InvalidRelativeTime;No description;4;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
|
||||||
0x4305;PUS11_ContainedTcTooSmall;No description;5;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
|
0x4305;PUS11_ContainedTcTooSmall;No description;5;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
|
||||||
0x4306;PUS11_ContainedTcCrcMissmatch;No description;6;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
|
0x4306;PUS11_ContainedTcCrcMissmatch;No description;6;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
|
||||||
|
0x4307;PUS11_MapIsFull;No description;7;PUS_SERVICE_11;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
|
||||||
0x4400;FILS_GenericFileError;No description;0;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
0x4400;FILS_GenericFileError;No description;0;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||||
0x4401;FILS_GenericDirError;No description;1;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
0x4401;FILS_GenericDirError;No description;1;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||||
0x4402;FILS_FilesystemInactive;No description;2;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
0x4402;FILS_FilesystemInactive;No description;2;FILE_SYSTEM;fsfw/src/fsfw/filesystem/HasFileSystemIF.h
|
||||||
@ -453,6 +454,12 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path
|
|||||||
0x5208;IMTQ_CmdErrUnknown;No description;8;IMTQ_HANDLER;mission/acs/imtqHelpers.h
|
0x5208;IMTQ_CmdErrUnknown;No description;8;IMTQ_HANDLER;mission/acs/imtqHelpers.h
|
||||||
0x5209;IMTQ_StartupCfgError;No description;9;IMTQ_HANDLER;mission/acs/imtqHelpers.h
|
0x5209;IMTQ_StartupCfgError;No description;9;IMTQ_HANDLER;mission/acs/imtqHelpers.h
|
||||||
0x520a;IMTQ_UnexpectedSelfTestReply;The status reply to a self test command was received but no self test command has been sent. This should normally never happen.;10;IMTQ_HANDLER;mission/acs/imtqHelpers.h
|
0x520a;IMTQ_UnexpectedSelfTestReply;The status reply to a self test command was received but no self test command has been sent. This should normally never happen.;10;IMTQ_HANDLER;mission/acs/imtqHelpers.h
|
||||||
|
0x53a0;RWHA_InvalidSpeed;Action Message with invalid speed was received. Valid speeds must be in the range of [-65000, 1000] or [1000, 65000];160;RW_HANDLER;mission/acs/RwHandler.h
|
||||||
|
0x53a1;RWHA_InvalidRampTime;Action Message with invalid ramp time was received.;161;RW_HANDLER;mission/acs/RwHandler.h
|
||||||
|
0x53a2;RWHA_SetSpeedCommandInvalidLength;Received set speed command has invalid length. Should be 6.;162;RW_HANDLER;mission/acs/RwHandler.h
|
||||||
|
0x53a3;RWHA_ExecutionFailed;Command execution failed;163;RW_HANDLER;mission/acs/RwHandler.h
|
||||||
|
0x53a4;RWHA_CrcError;Reaction wheel reply has invalid crc;164;RW_HANDLER;mission/acs/RwHandler.h
|
||||||
|
0x53a5;RWHA_ValueNotRead;No description;165;RW_HANDLER;mission/acs/RwHandler.h
|
||||||
0x53b0;RWHA_SpiWriteFailure;No description;176;RW_HANDLER;mission/acs/rwHelpers.h
|
0x53b0;RWHA_SpiWriteFailure;No description;176;RW_HANDLER;mission/acs/rwHelpers.h
|
||||||
0x53b1;RWHA_SpiReadFailure;Used by the spi send function to tell a failing read call;177;RW_HANDLER;mission/acs/rwHelpers.h
|
0x53b1;RWHA_SpiReadFailure;Used by the spi send function to tell a failing read call;177;RW_HANDLER;mission/acs/rwHelpers.h
|
||||||
0x53b2;RWHA_MissingStartSign;Can be used by the HDLC decoding mechanism to inform about a missing start sign 0x7E;178;RW_HANDLER;mission/acs/rwHelpers.h
|
0x53b2;RWHA_MissingStartSign;Can be used by the HDLC decoding mechanism to inform about a missing start sign 0x7E;178;RW_HANDLER;mission/acs/rwHelpers.h
|
||||||
@ -498,12 +505,8 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path
|
|||||||
0x58a1;PLSPVhLP_ProcessTerminated;Process has been terminated by command;161;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h
|
0x58a1;PLSPVhLP_ProcessTerminated;Process has been terminated by command;161;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h
|
||||||
0x58a2;PLSPVhLP_PathNotExists;Received command with invalid pathname;162;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h
|
0x58a2;PLSPVhLP_PathNotExists;Received command with invalid pathname;162;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h
|
||||||
0x58a3;PLSPVhLP_EventBufferReplyInvalidApid;Expected event buffer TM but received space packet with other APID;163;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h
|
0x58a3;PLSPVhLP_EventBufferReplyInvalidApid;Expected event buffer TM but received space packet with other APID;163;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h
|
||||||
0x59a0;SUSS_InvalidSpeed;Action Message with invalid speed was received. Valid speeds must be in the range of [-65000, 1000] or [1000, 65000];160;SUS_HANDLER;mission/acs/RwHandler.h
|
0x59a0;SUSS_ErrorUnlockMutex;No description;160;SUS_HANDLER;mission/acs/archive/LegacySusHandler.h
|
||||||
0x59a1;SUSS_InvalidRampTime;Action Message with invalid ramp time was received.;161;SUS_HANDLER;mission/acs/RwHandler.h
|
0x59a1;SUSS_ErrorLockMutex;No description;161;SUS_HANDLER;mission/acs/archive/LegacySusHandler.h
|
||||||
0x59a2;SUSS_SetSpeedCommandInvalidLength;Received set speed command has invalid length. Should be 6.;162;SUS_HANDLER;mission/acs/RwHandler.h
|
|
||||||
0x59a3;SUSS_ExecutionFailed;Command execution failed;163;SUS_HANDLER;mission/acs/RwHandler.h
|
|
||||||
0x59a4;SUSS_CrcError;Reaction wheel reply has invalid crc;164;SUS_HANDLER;mission/acs/RwHandler.h
|
|
||||||
0x59a5;SUSS_ValueNotRead;No description;165;SUS_HANDLER;mission/acs/RwHandler.h
|
|
||||||
0x5aa0;IPCI_PapbBusy;No description;160;CCSDS_IP_CORE_BRIDGE;linux/ipcore/PapbVcInterface.h
|
0x5aa0;IPCI_PapbBusy;No description;160;CCSDS_IP_CORE_BRIDGE;linux/ipcore/PapbVcInterface.h
|
||||||
0x5ba0;PTME_UnknownVcId;No description;160;PTME;linux/ipcore/Ptme.h
|
0x5ba0;PTME_UnknownVcId;No description;160;PTME;linux/ipcore/Ptme.h
|
||||||
0x5d01;STRHLP_SdNotMounted;SD card specified in path string not mounted;1;STR_HELPER;linux/acs/StrComHandler.h
|
0x5d01;STRHLP_SdNotMounted;SD card specified in path string not mounted;1;STR_HELPER;linux/acs/StrComHandler.h
|
||||||
@ -592,7 +595,11 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path
|
|||||||
0x69b5;SPVRTVIF_SupvHelperExecuting;Supervisor helper task ist currently executing a command (wait until helper tas has finished or interrupt by sending the terminate command);181;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
0x69b5;SPVRTVIF_SupvHelperExecuting;Supervisor helper task ist currently executing a command (wait until helper tas has finished or interrupt by sending the terminate command);181;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||||
0x69c0;SPVRTVIF_BufTooSmall;No description;192;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
0x69c0;SPVRTVIF_BufTooSmall;No description;192;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||||
0x69c1;SPVRTVIF_NoReplyTimeout;No description;193;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
0x69c1;SPVRTVIF_NoReplyTimeout;No description;193;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
|
||||||
0x6a00;ACSCTRL_FileDeletionFailed;File deletion failed and at least one file is still existent.;0;ACS_CTRL;mission/controller/AcsController.h
|
0x6aa0;ACSCTRL_FileDeletionFailed;File deletion failed and at least one file is still existent.;160;ACS_CTRL;mission/controller/controllerdefinitions/AcsCtrlDefinitions.h
|
||||||
|
0x6aa1;ACSCTRL_WriteFileFailed;Writing the TLE to the file has failed.;161;ACS_CTRL;mission/controller/controllerdefinitions/AcsCtrlDefinitions.h
|
||||||
|
0x6aa2;ACSCTRL_ReadFileFailed;Reading the TLE to the file has failed.;162;ACS_CTRL;mission/controller/controllerdefinitions/AcsCtrlDefinitions.h
|
||||||
|
0x6aa3;ACSCTRL_SingleRwUnavailable;A single RW has failed.;163;ACS_CTRL;mission/controller/controllerdefinitions/AcsCtrlDefinitions.h
|
||||||
|
0x6aa4;ACSCTRL_MultipleRwUnavailable;Multiple RWs have failed.;164;ACS_CTRL;mission/controller/controllerdefinitions/AcsCtrlDefinitions.h
|
||||||
0x6b02;ACSMEKF_MekfUninitialized;No description;2;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h
|
0x6b02;ACSMEKF_MekfUninitialized;No description;2;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h
|
||||||
0x6b03;ACSMEKF_MekfNoGyrData;No description;3;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h
|
0x6b03;ACSMEKF_MekfNoGyrData;No description;3;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h
|
||||||
0x6b04;ACSMEKF_MekfNoModelVectors;No description;4;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h
|
0x6b04;ACSMEKF_MekfNoModelVectors;No description;4;ACS_MEKF;mission/controller/acs/MultiplicativeKalmanFilter.h
|
||||||
@ -617,5 +624,6 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path
|
|||||||
0x6f00;TMS_IsBusy;No description;0;TM_SINK;mission/tmtc/DirectTmSinkIF.h
|
0x6f00;TMS_IsBusy;No description;0;TM_SINK;mission/tmtc/DirectTmSinkIF.h
|
||||||
0x6f01;TMS_PartiallyWritten;No description;1;TM_SINK;mission/tmtc/DirectTmSinkIF.h
|
0x6f01;TMS_PartiallyWritten;No description;1;TM_SINK;mission/tmtc/DirectTmSinkIF.h
|
||||||
0x6f02;TMS_NoWriteActive;No description;2;TM_SINK;mission/tmtc/DirectTmSinkIF.h
|
0x6f02;TMS_NoWriteActive;No description;2;TM_SINK;mission/tmtc/DirectTmSinkIF.h
|
||||||
|
0x6f03;TMS_Timeout;No description;3;TM_SINK;mission/tmtc/DirectTmSinkIF.h
|
||||||
0x7000;VCS_ChannelDoesNotExist;No description;0;VIRTUAL_CHANNEL;mission/com/VirtualChannel.h
|
0x7000;VCS_ChannelDoesNotExist;No description;0;VIRTUAL_CHANNEL;mission/com/VirtualChannel.h
|
||||||
0x7200;SCBU_KeyNotFound;No description;0;SCRATCH_BUFFER;bsp_q7s/memory/scratchApi.h
|
0x7200;SCBU_KeyNotFound;No description;0;SCRATCH_BUFFER;bsp_q7s/memory/scratchApi.h
|
||||||
|
|
@ -10,6 +10,7 @@ from eive_tmtc.config.object_ids import (
|
|||||||
CORE_CONTROLLER_ID,
|
CORE_CONTROLLER_ID,
|
||||||
STAR_TRACKER_ID,
|
STAR_TRACKER_ID,
|
||||||
P60_DOCK_HANDLER,
|
P60_DOCK_HANDLER,
|
||||||
|
ACS_CONTROLLER,
|
||||||
)
|
)
|
||||||
from eive_tmtc.tmtc.acs.imtq import ImtqActionId
|
from eive_tmtc.tmtc.acs.imtq import ImtqActionId
|
||||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||||
@ -17,6 +18,7 @@ from eive_tmtc.tmtc.core import handle_core_ctrl_action_replies
|
|||||||
from eive_tmtc.tmtc.payload.ploc_mpsoc import handle_mpsoc_data_reply
|
from eive_tmtc.tmtc.payload.ploc_mpsoc import handle_mpsoc_data_reply
|
||||||
from eive_tmtc.tmtc.payload.ploc_supervisor import SupvActionId
|
from eive_tmtc.tmtc.payload.ploc_supervisor import SupvActionId
|
||||||
from eive_tmtc.tmtc.acs.star_tracker import handle_star_tracker_action_replies
|
from eive_tmtc.tmtc.acs.star_tracker import handle_star_tracker_action_replies
|
||||||
|
from eive_tmtc.tmtc.acs.acs_ctrl import handle_acs_ctrl_action_replies
|
||||||
from eive_tmtc.tmtc.power.tm import handle_get_param_data_reply
|
from eive_tmtc.tmtc.power.tm import handle_get_param_data_reply
|
||||||
from tmtccmd.pus.s8_fsfw_action import Service8FsfwTm
|
from tmtccmd.pus.s8_fsfw_action import Service8FsfwTm
|
||||||
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
|
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
|
||||||
@ -53,6 +55,8 @@ def handle_action_reply(
|
|||||||
return handle_core_ctrl_action_replies(action_id, pw, custom_data)
|
return handle_core_ctrl_action_replies(action_id, pw, custom_data)
|
||||||
elif object_id.as_bytes == STAR_TRACKER_ID:
|
elif object_id.as_bytes == STAR_TRACKER_ID:
|
||||||
return handle_star_tracker_action_replies(action_id, pw, custom_data)
|
return handle_star_tracker_action_replies(action_id, pw, custom_data)
|
||||||
|
elif object_id.as_bytes == ACS_CONTROLLER:
|
||||||
|
return handle_acs_ctrl_action_replies(action_id, pw, custom_data)
|
||||||
elif object_id.as_bytes in [
|
elif object_id.as_bytes in [
|
||||||
ACU_HANDLER_ID,
|
ACU_HANDLER_ID,
|
||||||
PDU_1_HANDLER_ID,
|
PDU_1_HANDLER_ID,
|
||||||
|
@ -1,26 +1,24 @@
|
|||||||
import logging
|
|
||||||
import datetime
|
import datetime
|
||||||
|
import logging
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
from spacepackets.ccsds.time import CdsShortTimestamp
|
||||||
|
from tmtccmd.fsfw import EventInfo
|
||||||
|
from tmtccmd.pus.s5_fsfw_event import EventDefinition, Service5Tm
|
||||||
|
from tmtccmd.pus.s200_fsfw_mode import Mode
|
||||||
|
from tmtccmd.pus.s201_fsfw_health import FsfwHealth
|
||||||
|
|
||||||
from eive_tmtc.config.events import get_event_dict
|
from eive_tmtc.config.events import get_event_dict
|
||||||
from eive_tmtc.config.object_ids import get_object_ids
|
from eive_tmtc.config.object_ids import get_object_ids
|
||||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||||
from eive_tmtc.pus_tm.verification_handler import generic_retval_printout
|
from eive_tmtc.pus_tm.verification_handler import generic_retval_printout
|
||||||
from eive_tmtc.tmtc.acs.subsystem import AcsMode
|
from eive_tmtc.tmtc.acs.subsystem import AcsMode
|
||||||
from eive_tmtc.tmtc.core import SdState, SdCardSelect
|
from eive_tmtc.tmtc.core import SdCardSelect, SdState
|
||||||
from tmtccmd.pus.s200_fsfw_mode import Mode
|
|
||||||
from tmtccmd.pus.s201_fsfw_health import FsfwHealth
|
|
||||||
|
|
||||||
from tmtccmd.pus.s5_fsfw_event import Service5Tm
|
|
||||||
from tmtccmd.fsfw import EventInfo
|
|
||||||
from spacepackets.ccsds.time import CdsShortTimestamp
|
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def handle_event_packet( # noqa C901: Complexity okay here
|
def handle_event_packet(raw_tm: bytes, pw: PrintWrapper):
|
||||||
raw_tm: bytes, pw: PrintWrapper
|
|
||||||
): # noqa C901: Complexity okay here
|
|
||||||
tm = Service5Tm.unpack(data=raw_tm, time_reader=CdsShortTimestamp.empty())
|
tm = Service5Tm.unpack(data=raw_tm, time_reader=CdsShortTimestamp.empty())
|
||||||
event_dict = get_event_dict()
|
event_dict = get_event_dict()
|
||||||
event_def = tm.event_definition
|
event_def = tm.event_definition
|
||||||
@ -36,16 +34,30 @@ def handle_event_packet( # noqa C901: Complexity okay here
|
|||||||
obj_name = event_def.reporter_id.hex(sep=",")
|
obj_name = event_def.reporter_id.hex(sep=",")
|
||||||
else:
|
else:
|
||||||
obj_name = obj_id_obj.name
|
obj_name = obj_id_obj.name
|
||||||
|
assert tm.time_provider is not None
|
||||||
generic_event_string = (
|
generic_event_string = (
|
||||||
f"Object {obj_name} generated Event {info.name} (ID: {event_def.event_id:#04x})"
|
f"Object {obj_name} generated Event {info.name} (ID: {event_def.event_id:#04x})"
|
||||||
f" at {tm.time_provider.as_date_time()}"
|
f" at {tm.time_provider.as_date_time()}"
|
||||||
)
|
)
|
||||||
_LOGGER.info(generic_event_string)
|
_LOGGER.info(generic_event_string)
|
||||||
pw.file_logger.info(
|
if pw.file_logger is not None:
|
||||||
f"{datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')}:"
|
pw.file_logger.info(
|
||||||
f" {generic_event_string}"
|
f"{datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')}:"
|
||||||
)
|
f" {generic_event_string}"
|
||||||
specific_handler = False
|
)
|
||||||
|
specific_handler = handle_specific_events(pw, obj_name, info, event_def)
|
||||||
|
if not specific_handler:
|
||||||
|
additional_event_info = (
|
||||||
|
f"Additional info: {info.info} | P1: {event_def.param1} | "
|
||||||
|
f"P2: {event_def.param2}"
|
||||||
|
)
|
||||||
|
pw.dlog(additional_event_info)
|
||||||
|
|
||||||
|
|
||||||
|
def handle_specific_events(
|
||||||
|
pw: PrintWrapper, obj_name: str, info: EventInfo, event_def: EventDefinition
|
||||||
|
) -> bool:
|
||||||
|
specific_handler = True
|
||||||
if info.name == "MODE_TRANSITION_FAILED":
|
if info.name == "MODE_TRANSITION_FAILED":
|
||||||
reason = generic_retval_printout(event_def.param1)
|
reason = generic_retval_printout(event_def.param1)
|
||||||
for string in reason:
|
for string in reason:
|
||||||
@ -151,12 +163,4 @@ def handle_event_packet( # noqa C901: Complexity okay here
|
|||||||
mode = event_def.param1
|
mode = event_def.param1
|
||||||
submode = event_def.param2
|
submode = event_def.param2
|
||||||
pw.dlog(f"Mode Number {mode}, Submode: {submode}")
|
pw.dlog(f"Mode Number {mode}, Submode: {submode}")
|
||||||
if not specific_handler:
|
return specific_handler
|
||||||
additional_event_info = (
|
|
||||||
f"Additional info: {info.info} | P1: {event_def.param1} | "
|
|
||||||
f"P2: {event_def.param2}"
|
|
||||||
)
|
|
||||||
pw.dlog(additional_event_info)
|
|
||||||
if not specific_handler:
|
|
||||||
# printer.handle_long_tm_print(packet_if=tm.pus_tm, info_if=tm.pus_tm)
|
|
||||||
pass
|
|
||||||
|
@ -13,6 +13,7 @@ from eive_tmtc.tmtc.payload.rad_sensor import handle_rad_sensor_data
|
|||||||
from eive_tmtc.tmtc.acs.sus import handle_sus_hk
|
from eive_tmtc.tmtc.acs.sus import handle_sus_hk
|
||||||
from eive_tmtc.tmtc.payload.ploc_supervisor import handle_supv_hk_data
|
from eive_tmtc.tmtc.payload.ploc_supervisor import handle_supv_hk_data
|
||||||
from eive_tmtc.tmtc.acs.reaction_wheels import handle_rw_hk_data
|
from eive_tmtc.tmtc.acs.reaction_wheels import handle_rw_hk_data
|
||||||
|
from eive_tmtc.tmtc.power.pwr_ctrl import handle_pwr_ctrl_hk_data
|
||||||
from eive_tmtc.tmtc.com.syrlinks_handler import handle_syrlinks_hk_data
|
from eive_tmtc.tmtc.com.syrlinks_handler import handle_syrlinks_hk_data
|
||||||
from eive_tmtc.tmtc.tcs import handle_thermal_controller_hk_data
|
from eive_tmtc.tmtc.tcs import handle_thermal_controller_hk_data
|
||||||
from eive_tmtc.tmtc.tcs.tmp1075 import handle_tmp_1075_hk_data
|
from eive_tmtc.tmtc.tcs.tmp1075 import handle_tmp_1075_hk_data
|
||||||
@ -201,6 +202,10 @@ def handle_regular_hk_print( # noqa C901: Complexity okay here
|
|||||||
return handle_acs_ctrl_hk_data(
|
return handle_acs_ctrl_hk_data(
|
||||||
pw=pw, set_id=set_id, hk_data=hk_data, packet_time=packet_dt
|
pw=pw, set_id=set_id, hk_data=hk_data, packet_time=packet_dt
|
||||||
)
|
)
|
||||||
|
elif objb == obj_ids.PWR_CONTROLLER:
|
||||||
|
return handle_pwr_ctrl_hk_data(
|
||||||
|
pw=pw, set_id=set_id, hk_data=hk_data, packet_time=packet_dt
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
_LOGGER.info(
|
_LOGGER.info(
|
||||||
f"Service 3 TM: Parsing for object {object_id} and set ID {set_id} "
|
f"Service 3 TM: Parsing for object {object_id} and set ID {set_id} "
|
||||||
|
@ -29,9 +29,9 @@ from tmtccmd.pus.s20_fsfw_param_defs import (
|
|||||||
from tmtccmd.pus.s200_fsfw_mode import Mode, pack_mode_command
|
from tmtccmd.pus.s200_fsfw_mode import Mode, pack_mode_command
|
||||||
from tmtccmd.pus.tc.s3_fsfw_hk import (
|
from tmtccmd.pus.tc.s3_fsfw_hk import (
|
||||||
create_request_one_diag_command,
|
create_request_one_diag_command,
|
||||||
|
create_request_one_hk_command,
|
||||||
disable_periodic_hk_command,
|
disable_periodic_hk_command,
|
||||||
enable_periodic_hk_command_with_interval,
|
enable_periodic_hk_command_with_interval,
|
||||||
generate_one_hk_command,
|
|
||||||
make_sid,
|
make_sid,
|
||||||
)
|
)
|
||||||
from tmtccmd.tmtc import service_provider
|
from tmtccmd.tmtc import service_provider
|
||||||
@ -54,10 +54,17 @@ class SetId(enum.IntEnum):
|
|||||||
GYR_RAW_SET = 4
|
GYR_RAW_SET = 4
|
||||||
GYR_PROC_SET = 5
|
GYR_PROC_SET = 5
|
||||||
GPS_PROC_SET = 6
|
GPS_PROC_SET = 6
|
||||||
MEKF_DATA = 7
|
ATTITUDE_ESTIMATION_DATA = 7
|
||||||
CTRL_VAL_DATA = 8
|
CTRL_VAL_DATA = 8
|
||||||
ACTUATOR_CMD_DATA = 9
|
ACTUATOR_CMD_DATA = 9
|
||||||
FUSED_ROT_RATE_DATA = 10
|
FUSED_ROT_RATE_DATA = 10
|
||||||
|
FUSED_ROT_RATE_SOURCE_DATA = 11
|
||||||
|
|
||||||
|
|
||||||
|
class DataSetRequest(enum.IntEnum):
|
||||||
|
ONESHOT = 0
|
||||||
|
ENABLE = 1
|
||||||
|
DISABLE = 2
|
||||||
|
|
||||||
|
|
||||||
class ActionId(enum.IntEnum):
|
class ActionId(enum.IntEnum):
|
||||||
@ -65,6 +72,7 @@ class ActionId(enum.IntEnum):
|
|||||||
RESET_MEKF = 1
|
RESET_MEKF = 1
|
||||||
RESTORE_MEKF_NONFINITE_RECOVERY = 2
|
RESTORE_MEKF_NONFINITE_RECOVERY = 2
|
||||||
UPDATE_TLE = 3
|
UPDATE_TLE = 3
|
||||||
|
READ_TLE = 4
|
||||||
|
|
||||||
|
|
||||||
CTRL_STRAT_DICT = {
|
CTRL_STRAT_DICT = {
|
||||||
@ -85,67 +93,46 @@ CTRL_STRAT_DICT = {
|
|||||||
19: "SAFE_ECLIPSE_IDELING",
|
19: "SAFE_ECLIPSE_IDELING",
|
||||||
20: "DETUMBLE_FULL",
|
20: "DETUMBLE_FULL",
|
||||||
21: "DETUMBLE_DETERIORATED",
|
21: "DETUMBLE_DETERIORATED",
|
||||||
30: "PTG_MEKF",
|
100: "PTG_MEKF",
|
||||||
31: "PTG_RAW",
|
101: "PTG_STR",
|
||||||
|
102: "PTG_QUEST",
|
||||||
}
|
}
|
||||||
|
|
||||||
GPS_COURCE_DICT = {
|
GPS_SOURCE_DICT = {
|
||||||
0: "NONE",
|
0: "NONE",
|
||||||
1: "GPS",
|
1: "GPS",
|
||||||
2: "GPS_EXTRAPOLATED",
|
2: "GPS_EXTRAPOLATED",
|
||||||
3: "SGP4",
|
3: "SGP4",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FUSED_ROT_RATE_SOURCE_DICT = {
|
||||||
|
0: "NONE",
|
||||||
|
1: "SUSMGM",
|
||||||
|
2: "QUEST",
|
||||||
|
3: "STR",
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class OpCodes:
|
class OpCodes:
|
||||||
OFF = ["off"]
|
OFF = "off"
|
||||||
SAFE = ["safe"]
|
SAFE = "safe"
|
||||||
DTBL = ["safe_detumble"]
|
DTBL = "safe_detumble"
|
||||||
IDLE = ["ptg_idle"]
|
IDLE = "ptg_idle"
|
||||||
NADIR = ["ptg_nadir"]
|
NADIR = "ptg_nadir"
|
||||||
TARGET = ["ptg_target"]
|
TARGET = "ptg_target"
|
||||||
GS = ["ptg_target_gs"]
|
GS = "ptg_target_gs"
|
||||||
INERTIAL = ["ptg_inertial"]
|
INERTIAL = "ptg_inertial"
|
||||||
SAFE_PTG = ["confirm_deployment"]
|
SAFE_PTG = "confirm_deployment"
|
||||||
RESET_MEKF = ["reset_mekf"]
|
RESET_MEKF = "reset_mekf"
|
||||||
RESTORE_MEKF_NONFINITE_RECOVERY = ["restore_mekf_nonfinite_recovery"]
|
RESTORE_MEKF_NONFINITE_RECOVERY = "restore_mekf_nonfinite_recovery"
|
||||||
UPDATE_TLE = ["update_tle"]
|
UPDATE_TLE = "update_tle"
|
||||||
SET_PARAMETER_SCALAR = ["set_scalar_param"]
|
READ_TLE = "read_tle"
|
||||||
SET_PARAMETER_VECTOR = ["set_vector_param"]
|
SET_PARAMETER_SCALAR = "set_scalar_param"
|
||||||
SET_PARAMETER_MATRIX = ["set_matrix_param"]
|
SET_PARAMETER_VECTOR = "set_vector_param"
|
||||||
REQUEST_RAW_MGM_HK = ["mgm_raw_hk"]
|
SET_PARAMETER_MATRIX = "set_matrix_param"
|
||||||
ENABLE_RAW_MGM_HK = ["mgm_raw_enable_hk"]
|
ONE_SHOOT_HK = "one_shot_hk"
|
||||||
DISABLE_RAW_MGM_HK = ["mgm_raw_disable_hk"]
|
ENABLE_HK = "enable_hk"
|
||||||
REQUEST_PROC_MGM_HK = ["mgm_proc_hk"]
|
DISABLE_HK = "disable_hk"
|
||||||
ENABLE_PROC_MGM_HK = ["mgm_proc_enable_hk"]
|
|
||||||
DISABLE_PROC_MGM_HK = ["mgm_proc_disable_hk"]
|
|
||||||
REQUEST_RAW_SUS_HK = ["sus_raw_hk"]
|
|
||||||
ENABLE_RAW_SUS_HK = ["sus_raw_enable_hk"]
|
|
||||||
DISABLE_RAW_SUS_HK = ["sus_raw_disable_hk"]
|
|
||||||
REQUEST_PROC_SUS_HK = ["sus_proc_hk"]
|
|
||||||
ENABLE_PROC_SUS_HK = ["sus_proc_enable_hk"]
|
|
||||||
DISABLE_PROC_SUS_HK = ["sus_proc_disable_hk"]
|
|
||||||
REQUEST_RAW_GYR_HK = ["gyr_raw_hk"]
|
|
||||||
ENABLE_RAW_GYR_HK = ["gyr_raw_enable_hk"]
|
|
||||||
DISABLE_RAW_GYR_HK = ["gyr_raw_disable_hk"]
|
|
||||||
REQUEST_PROC_GYR_HK = ["gyr_proc_hk"]
|
|
||||||
ENABLE_PROC_GYR_HK = ["gyr_proc_enable_hk"]
|
|
||||||
DISABLE_PROC_GYR_HK = ["gyr_proc_disable_hk"]
|
|
||||||
REQUEST_PROC_GPS_HK = ["gps_proc_hk"]
|
|
||||||
ENABLE_PROC_GPS_HK = ["gps_proc_enable_hk"]
|
|
||||||
DISABLE_PROC_GPS_HK = ["gps_proc_disable_hk"]
|
|
||||||
REQUEST_MEKF_HK = ["mekf_hk"]
|
|
||||||
ENABLE_MEKF_HK = ["mekf_enable_hk"]
|
|
||||||
DISABLE_MEKF_HK = ["mekf_disable_hk"]
|
|
||||||
REQUEST_CTRL_VAL_HK = ["ctrl_val_hk"]
|
|
||||||
ENABLE_CTRL_VAL_HK = ["ctrl_val_enable_hk"]
|
|
||||||
DISABLE_CTRL_VAL_HK = ["ctrl_val_disable_hk"]
|
|
||||||
REQUEST_ACT_CMD_HK = ["act_cmd_hk"]
|
|
||||||
ENABLE_ACT_CMD_HK = ["act_cmd_enable_hk"]
|
|
||||||
DISABLE_ACT_CMD_HK = ["act_cmd_disable_hk"]
|
|
||||||
REQUEST_FUSED_ROT_RATE_HK = ["f_rot_rate_hk"]
|
|
||||||
ENABLE_FUSED_ROT_RATE_HK = ["f_rot_rate_enable_hk"]
|
|
||||||
DISABLE_FUSED_ROT_RATE_HK = ["f_rot_rate_disable_hk"]
|
|
||||||
|
|
||||||
|
|
||||||
class Info:
|
class Info:
|
||||||
@ -161,42 +148,13 @@ class Info:
|
|||||||
RESET_MEKF = "Reset the MEKF"
|
RESET_MEKF = "Reset the MEKF"
|
||||||
RESTORE_MEKF_NONFINITE_RECOVERY = "Restore MEKF non-finite recovery"
|
RESTORE_MEKF_NONFINITE_RECOVERY = "Restore MEKF non-finite recovery"
|
||||||
UPDATE_TLE = "Update TLE"
|
UPDATE_TLE = "Update TLE"
|
||||||
|
READ_TLE = "Read the currently stored TLE"
|
||||||
SET_PARAMETER_SCALAR = "Set Scalar Parameter"
|
SET_PARAMETER_SCALAR = "Set Scalar Parameter"
|
||||||
SET_PARAMETER_VECTOR = "Set Vector Parameter"
|
SET_PARAMETER_VECTOR = "Set Vector Parameter"
|
||||||
SET_PARAMETER_MATRIX = "Set Matrix Parameter"
|
SET_PARAMETER_MATRIX = "Set Matrix Parameter"
|
||||||
REQUEST_RAW_MGM_HK = "Request Raw MGM HK once"
|
ONE_SHOOT_HK = "One shoot HK Set"
|
||||||
ENABLE_RAW_MGM_HK = "Enable Raw MGM HK data generation"
|
ENABLE_HK = "Enable Periodic HK"
|
||||||
DISABLE_RAW_MGM_HK = "Disable Raw MGM HK data generation"
|
DISABLE_HK = "Disable Periodic HK"
|
||||||
REQUEST_PROC_MGM_HK = "Request Processed MGM HK"
|
|
||||||
ENABLE_PROC_MGM_HK = "Enable Processed MGM HK data generation"
|
|
||||||
DISABLE_PROC_MGM_HK = "Disable Processed MGM HK data generation"
|
|
||||||
REQUEST_RAW_SUS_HK = "Request Raw SUS HK"
|
|
||||||
ENABLE_RAW_SUS_HK = "Enable Raw SUS HK data generation"
|
|
||||||
DISABLE_RAW_SUS_HK = "Disable Raw SUS HK data generation"
|
|
||||||
REQUEST_PROC_SUS_HK = "Request Processed SUS HK"
|
|
||||||
ENABLE_PROC_SUS_HK = "Enable Processed SUS HK data generation"
|
|
||||||
DISABLE_PROC_SUS_HK = "Disable Processed MGM HK data generation"
|
|
||||||
REQUEST_RAW_GYR_HK = "Request Raw GYR HK"
|
|
||||||
ENABLE_RAW_GYR_HK = "Enable Raw GYR HK data generation"
|
|
||||||
DISABLE_RAW_GYR_HK = "Disable Raw GYR HK data generation"
|
|
||||||
REQUEST_PROC_GYR_HK = "Request Processed GYR HK"
|
|
||||||
ENABLE_PROC_GYR_HK = "Enable Processed GYR HK data generation"
|
|
||||||
DISABLE_PROC_GYR_HK = "Disable Processed GYR HK data generation"
|
|
||||||
REQUEST_PROC_GPS_HK = "Request Processed GPS HK"
|
|
||||||
ENABLE_PROC_GPS_HK = "Enable Processed GPS HK data generation"
|
|
||||||
DISABLE_PROC_GPS_HK = "Disable Processed GPS HK data generation"
|
|
||||||
REQUEST_MEKF_HK = "Request MEKF HK"
|
|
||||||
ENABLE_MEKF_HK = "Enable MEKF HK data generation"
|
|
||||||
DISABLE_MEKF_HK = "Disable MEKF HK data generation"
|
|
||||||
REQUEST_CTRL_VAL_HK = "Request Control Values HK"
|
|
||||||
ENABLE_CTRL_VAL_HK = "Enable Control Values HK data generation"
|
|
||||||
DISABLE_CTRL_VAL_HK = "Disable Control Values HK data generation"
|
|
||||||
REQUEST_ACT_CMD_HK = "Request Actuator Commands HK"
|
|
||||||
ENABLE_ACT_CMD_HK = "Enable Actuator Commands HK data generation"
|
|
||||||
DISABLE_ACT_CMD_HK = "Disable Actuator Commands HK data generation"
|
|
||||||
REQUEST_FUSED_ROT_RATE_HK = "Request Fused Rotational Rates HK"
|
|
||||||
ENABLE_FUSED_ROT_RATE_HK = "Enable Fused Rotational Rates HK data generation"
|
|
||||||
DISABLE_FUSED_ROT_RATE_HK = "Disable Fused Rotational Rates HK data generation"
|
|
||||||
|
|
||||||
|
|
||||||
PERFORM_MGM_CALIBRATION = False
|
PERFORM_MGM_CALIBRATION = False
|
||||||
@ -229,42 +187,13 @@ def acs_cmd_defs(defs: TmtcDefinitionWrapper):
|
|||||||
info=Info.RESTORE_MEKF_NONFINITE_RECOVERY,
|
info=Info.RESTORE_MEKF_NONFINITE_RECOVERY,
|
||||||
)
|
)
|
||||||
oce.add(keys=OpCodes.UPDATE_TLE, info=Info.UPDATE_TLE)
|
oce.add(keys=OpCodes.UPDATE_TLE, info=Info.UPDATE_TLE)
|
||||||
|
oce.add(keys=OpCodes.READ_TLE, info=Info.READ_TLE)
|
||||||
oce.add(keys=OpCodes.SET_PARAMETER_SCALAR, info=Info.SET_PARAMETER_SCALAR)
|
oce.add(keys=OpCodes.SET_PARAMETER_SCALAR, info=Info.SET_PARAMETER_SCALAR)
|
||||||
oce.add(keys=OpCodes.SET_PARAMETER_VECTOR, info=Info.SET_PARAMETER_VECTOR)
|
oce.add(keys=OpCodes.SET_PARAMETER_VECTOR, info=Info.SET_PARAMETER_VECTOR)
|
||||||
oce.add(keys=OpCodes.SET_PARAMETER_MATRIX, info=Info.SET_PARAMETER_MATRIX)
|
oce.add(keys=OpCodes.SET_PARAMETER_MATRIX, info=Info.SET_PARAMETER_MATRIX)
|
||||||
oce.add(keys=OpCodes.REQUEST_RAW_MGM_HK, info=Info.REQUEST_RAW_MGM_HK)
|
oce.add(keys=OpCodes.ONE_SHOOT_HK, info=Info.ONE_SHOOT_HK)
|
||||||
oce.add(keys=OpCodes.ENABLE_RAW_MGM_HK, info=Info.ENABLE_RAW_MGM_HK)
|
oce.add(keys=OpCodes.ENABLE_HK, info=Info.ENABLE_HK)
|
||||||
oce.add(keys=OpCodes.DISABLE_RAW_MGM_HK, info=Info.DISABLE_RAW_MGM_HK)
|
oce.add(keys=OpCodes.DISABLE_HK, info=Info.DISABLE_HK)
|
||||||
oce.add(keys=OpCodes.REQUEST_PROC_MGM_HK, info=Info.REQUEST_PROC_MGM_HK)
|
|
||||||
oce.add(keys=OpCodes.ENABLE_PROC_MGM_HK, info=Info.ENABLE_PROC_MGM_HK)
|
|
||||||
oce.add(keys=OpCodes.DISABLE_PROC_MGM_HK, info=Info.DISABLE_PROC_MGM_HK)
|
|
||||||
oce.add(keys=OpCodes.REQUEST_RAW_SUS_HK, info=Info.REQUEST_RAW_SUS_HK)
|
|
||||||
oce.add(keys=OpCodes.ENABLE_RAW_SUS_HK, info=Info.ENABLE_RAW_SUS_HK)
|
|
||||||
oce.add(keys=OpCodes.DISABLE_RAW_SUS_HK, info=Info.DISABLE_RAW_SUS_HK)
|
|
||||||
oce.add(keys=OpCodes.REQUEST_PROC_SUS_HK, info=Info.REQUEST_PROC_SUS_HK)
|
|
||||||
oce.add(keys=OpCodes.ENABLE_PROC_SUS_HK, info=Info.ENABLE_PROC_SUS_HK)
|
|
||||||
oce.add(keys=OpCodes.DISABLE_PROC_SUS_HK, info=Info.DISABLE_PROC_SUS_HK)
|
|
||||||
oce.add(keys=OpCodes.REQUEST_RAW_GYR_HK, info=Info.REQUEST_RAW_GYR_HK)
|
|
||||||
oce.add(keys=OpCodes.ENABLE_RAW_GYR_HK, info=Info.ENABLE_RAW_GYR_HK)
|
|
||||||
oce.add(keys=OpCodes.DISABLE_RAW_GYR_HK, info=Info.DISABLE_RAW_GYR_HK)
|
|
||||||
oce.add(keys=OpCodes.REQUEST_PROC_GYR_HK, info=Info.REQUEST_PROC_GYR_HK)
|
|
||||||
oce.add(keys=OpCodes.ENABLE_PROC_GYR_HK, info=Info.ENABLE_PROC_GYR_HK)
|
|
||||||
oce.add(keys=OpCodes.DISABLE_PROC_GYR_HK, info=Info.DISABLE_PROC_GYR_HK)
|
|
||||||
oce.add(keys=OpCodes.REQUEST_PROC_GPS_HK, info=Info.REQUEST_PROC_GPS_HK)
|
|
||||||
oce.add(keys=OpCodes.ENABLE_PROC_GPS_HK, info=Info.ENABLE_PROC_GPS_HK)
|
|
||||||
oce.add(keys=OpCodes.DISABLE_PROC_GPS_HK, info=Info.DISABLE_PROC_GPS_HK)
|
|
||||||
oce.add(keys=OpCodes.REQUEST_MEKF_HK, info=Info.REQUEST_MEKF_HK)
|
|
||||||
oce.add(keys=OpCodes.ENABLE_MEKF_HK, info=Info.ENABLE_MEKF_HK)
|
|
||||||
oce.add(keys=OpCodes.DISABLE_MEKF_HK, info=Info.DISABLE_MEKF_HK)
|
|
||||||
oce.add(keys=OpCodes.REQUEST_CTRL_VAL_HK, info=Info.REQUEST_CTRL_VAL_HK)
|
|
||||||
oce.add(keys=OpCodes.ENABLE_CTRL_VAL_HK, info=Info.ENABLE_CTRL_VAL_HK)
|
|
||||||
oce.add(keys=OpCodes.DISABLE_CTRL_VAL_HK, info=Info.DISABLE_CTRL_VAL_HK)
|
|
||||||
oce.add(keys=OpCodes.REQUEST_ACT_CMD_HK, info=Info.REQUEST_ACT_CMD_HK)
|
|
||||||
oce.add(keys=OpCodes.ENABLE_ACT_CMD_HK, info=Info.ENABLE_ACT_CMD_HK)
|
|
||||||
oce.add(keys=OpCodes.DISABLE_ACT_CMD_HK, info=Info.DISABLE_ACT_CMD_HK)
|
|
||||||
oce.add(keys=OpCodes.REQUEST_FUSED_ROT_RATE_HK, info=Info.REQUEST_FUSED_ROT_RATE_HK)
|
|
||||||
oce.add(keys=OpCodes.ENABLE_FUSED_ROT_RATE_HK, info=Info.ENABLE_FUSED_ROT_RATE_HK)
|
|
||||||
oce.add(keys=OpCodes.DISABLE_FUSED_ROT_RATE_HK, info=Info.DISABLE_FUSED_ROT_RATE_HK)
|
|
||||||
defs.add_service(
|
defs.add_service(
|
||||||
name=CustomServiceList.ACS_CTRL.value, info="ACS Controller", op_code_entry=oce
|
name=CustomServiceList.ACS_CTRL.value, info="ACS Controller", op_code_entry=oce
|
||||||
)
|
)
|
||||||
@ -274,50 +203,50 @@ def acs_cmd_defs(defs: TmtcDefinitionWrapper):
|
|||||||
def pack_acs_ctrl_command(p: ServiceProviderParams): # noqa C901
|
def pack_acs_ctrl_command(p: ServiceProviderParams): # noqa C901
|
||||||
op_code = p.op_code
|
op_code = p.op_code
|
||||||
q = p.queue_helper
|
q = p.queue_helper
|
||||||
if op_code in OpCodes.OFF:
|
if op_code == OpCodes.OFF:
|
||||||
q.add_log_cmd(f"{Info.OFF}")
|
q.add_log_cmd(f"{Info.OFF}")
|
||||||
q.add_pus_tc(pack_mode_command(ACS_CONTROLLER, Mode.OFF, 0))
|
q.add_pus_tc(pack_mode_command(ACS_CONTROLLER, Mode.OFF, 0))
|
||||||
elif op_code in OpCodes.SAFE:
|
elif op_code == OpCodes.SAFE:
|
||||||
q.add_log_cmd(f"{Info.SAFE}")
|
q.add_log_cmd(f"{Info.SAFE}")
|
||||||
q.add_pus_tc(
|
q.add_pus_tc(
|
||||||
pack_mode_command(ACS_CONTROLLER, AcsMode.SAFE, SafeSubmode.DEFAULT)
|
pack_mode_command(ACS_CONTROLLER, AcsMode.SAFE, SafeSubmode.DEFAULT)
|
||||||
)
|
)
|
||||||
elif op_code in OpCodes.DTBL:
|
elif op_code == OpCodes.DTBL:
|
||||||
q.add_log_cmd(f"{Info.DTBL}")
|
q.add_log_cmd(f"{Info.DTBL}")
|
||||||
q.add_pus_tc(
|
q.add_pus_tc(
|
||||||
pack_mode_command(ACS_CONTROLLER, AcsMode.SAFE, SafeSubmode.DETUMBLE)
|
pack_mode_command(ACS_CONTROLLER, AcsMode.SAFE, SafeSubmode.DETUMBLE)
|
||||||
)
|
)
|
||||||
elif op_code in OpCodes.IDLE:
|
elif op_code == OpCodes.IDLE:
|
||||||
q.add_log_cmd(f"{Info.IDLE}")
|
q.add_log_cmd(f"{Info.IDLE}")
|
||||||
q.add_pus_tc(pack_mode_command(ACS_CONTROLLER, AcsMode.IDLE, 0))
|
q.add_pus_tc(pack_mode_command(ACS_CONTROLLER, AcsMode.IDLE, 0))
|
||||||
elif op_code in OpCodes.NADIR:
|
elif op_code == OpCodes.NADIR:
|
||||||
q.add_log_cmd(f"{Info.NADIR}")
|
q.add_log_cmd(f"{Info.NADIR}")
|
||||||
q.add_pus_tc(pack_mode_command(ACS_CONTROLLER, AcsMode.PTG_NADIR, 0))
|
q.add_pus_tc(pack_mode_command(ACS_CONTROLLER, AcsMode.PTG_NADIR, 0))
|
||||||
elif op_code in OpCodes.TARGET:
|
elif op_code == OpCodes.TARGET:
|
||||||
q.add_log_cmd(f"{Info.TARGET}")
|
q.add_log_cmd(f"{Info.TARGET}")
|
||||||
q.add_pus_tc(pack_mode_command(ACS_CONTROLLER, AcsMode.PTG_TARGET, 0))
|
q.add_pus_tc(pack_mode_command(ACS_CONTROLLER, AcsMode.PTG_TARGET, 0))
|
||||||
elif op_code in OpCodes.GS:
|
elif op_code == OpCodes.GS:
|
||||||
q.add_log_cmd(f"{Info.GS}")
|
q.add_log_cmd(f"{Info.GS}")
|
||||||
q.add_pus_tc(pack_mode_command(ACS_CONTROLLER, AcsMode.PTG_TARGET_GS, 0))
|
q.add_pus_tc(pack_mode_command(ACS_CONTROLLER, AcsMode.PTG_TARGET_GS, 0))
|
||||||
elif op_code in OpCodes.INERTIAL:
|
elif op_code == OpCodes.INERTIAL:
|
||||||
q.add_log_cmd(f"{Info.INERTIAL}")
|
q.add_log_cmd(f"{Info.INERTIAL}")
|
||||||
q.add_pus_tc(pack_mode_command(ACS_CONTROLLER, AcsMode.PTG_INERTIAL, 0))
|
q.add_pus_tc(pack_mode_command(ACS_CONTROLLER, AcsMode.PTG_INERTIAL, 0))
|
||||||
elif op_code in OpCodes.SAFE_PTG:
|
elif op_code == OpCodes.SAFE_PTG:
|
||||||
q.add_log_cmd(f"{Info.SAFE_PTG}")
|
q.add_log_cmd(f"{Info.SAFE_PTG}")
|
||||||
q.add_pus_tc(
|
q.add_pus_tc(
|
||||||
create_action_cmd(
|
create_action_cmd(
|
||||||
ACS_CONTROLLER, ActionId.SOLAR_ARRAY_DEPLOYMENT_SUCCESSFUL
|
ACS_CONTROLLER, ActionId.SOLAR_ARRAY_DEPLOYMENT_SUCCESSFUL
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
elif op_code in OpCodes.RESET_MEKF:
|
elif op_code == OpCodes.RESET_MEKF:
|
||||||
q.add_log_cmd(f"{Info.RESET_MEKF}")
|
q.add_log_cmd(f"{Info.RESET_MEKF}")
|
||||||
q.add_pus_tc(create_action_cmd(ACS_CONTROLLER, ActionId.RESET_MEKF))
|
q.add_pus_tc(create_action_cmd(ACS_CONTROLLER, ActionId.RESET_MEKF))
|
||||||
elif op_code in OpCodes.RESTORE_MEKF_NONFINITE_RECOVERY:
|
elif op_code == OpCodes.RESTORE_MEKF_NONFINITE_RECOVERY:
|
||||||
q.add_log_cmd(f"{Info.RESTORE_MEKF_NONFINITE_RECOVERY}")
|
q.add_log_cmd(f"{Info.RESTORE_MEKF_NONFINITE_RECOVERY}")
|
||||||
q.add_pus_tc(
|
q.add_pus_tc(
|
||||||
create_action_cmd(ACS_CONTROLLER, ActionId.RESTORE_MEKF_NONFINITE_RECOVERY)
|
create_action_cmd(ACS_CONTROLLER, ActionId.RESTORE_MEKF_NONFINITE_RECOVERY)
|
||||||
)
|
)
|
||||||
elif op_code in OpCodes.UPDATE_TLE:
|
elif op_code == OpCodes.UPDATE_TLE:
|
||||||
q.add_log_cmd(f"{Info.UPDATE_TLE}")
|
q.add_log_cmd(f"{Info.UPDATE_TLE}")
|
||||||
while True:
|
while True:
|
||||||
line1 = input("Please input the first line of the TLE: ")
|
line1 = input("Please input the first line of the TLE: ")
|
||||||
@ -333,239 +262,79 @@ def pack_acs_ctrl_command(p: ServiceProviderParams): # noqa C901
|
|||||||
print("The line does not have the required length of 69 characters")
|
print("The line does not have the required length of 69 characters")
|
||||||
tle = line1.encode() + line2.encode()
|
tle = line1.encode() + line2.encode()
|
||||||
q.add_pus_tc(create_action_cmd(ACS_CONTROLLER, ActionId.UPDATE_TLE, tle))
|
q.add_pus_tc(create_action_cmd(ACS_CONTROLLER, ActionId.UPDATE_TLE, tle))
|
||||||
elif op_code in OpCodes.SET_PARAMETER_SCALAR:
|
elif op_code == OpCodes.READ_TLE:
|
||||||
|
q.add_log_cmd(f"{Info.READ_TLE}")
|
||||||
|
q.add_pus_tc(create_action_cmd(ACS_CONTROLLER, ActionId.READ_TLE))
|
||||||
|
elif op_code == OpCodes.SET_PARAMETER_SCALAR:
|
||||||
q.add_log_cmd(f"{Info.SET_PARAMETER_SCALAR}")
|
q.add_log_cmd(f"{Info.SET_PARAMETER_SCALAR}")
|
||||||
set_acs_ctrl_param_scalar(q)
|
set_acs_ctrl_param_scalar(q)
|
||||||
elif op_code in OpCodes.SET_PARAMETER_VECTOR:
|
elif op_code == OpCodes.SET_PARAMETER_VECTOR:
|
||||||
q.add_log_cmd(f"{Info.SET_PARAMETER_VECTOR}")
|
q.add_log_cmd(f"{Info.SET_PARAMETER_VECTOR}")
|
||||||
set_acs_ctrl_param_vector(q)
|
set_acs_ctrl_param_vector(q)
|
||||||
elif op_code in OpCodes.SET_PARAMETER_MATRIX:
|
elif op_code == OpCodes.SET_PARAMETER_MATRIX:
|
||||||
q.add_log_cmd(f"{Info.SET_PARAMETER_MATRIX}")
|
q.add_log_cmd(f"{Info.SET_PARAMETER_MATRIX}")
|
||||||
set_acs_ctrl_param_matrix(q)
|
set_acs_ctrl_param_matrix(q)
|
||||||
elif op_code in OpCodes.REQUEST_RAW_MGM_HK:
|
elif op_code == OpCodes.ONE_SHOOT_HK:
|
||||||
q.add_log_cmd(Info.REQUEST_RAW_MGM_HK)
|
q.add_log_cmd(Info.ONE_SHOOT_HK)
|
||||||
q.add_pus_tc(
|
request_dataset(q, DataSetRequest.ONESHOT)
|
||||||
generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.MGM_RAW_SET))
|
elif op_code == OpCodes.ENABLE_HK:
|
||||||
)
|
q.add_log_cmd(Info.ENABLE_HK)
|
||||||
elif op_code in OpCodes.ENABLE_RAW_MGM_HK:
|
request_dataset(q, DataSetRequest.ENABLE)
|
||||||
interval = float(input("Please specify interval in floating point seconds: "))
|
elif op_code == OpCodes.DISABLE_HK:
|
||||||
q.add_log_cmd(Info.ENABLE_RAW_MGM_HK)
|
q.add_log_cmd(Info.DISABLE_HK)
|
||||||
cmd_tuple = enable_periodic_hk_command_with_interval(
|
request_dataset(q, DataSetRequest.DISABLE)
|
||||||
False, make_sid(ACS_CONTROLLER, SetId.MGM_RAW_SET), interval
|
|
||||||
)
|
|
||||||
q.add_pus_tc(cmd_tuple[0])
|
|
||||||
q.add_pus_tc(cmd_tuple[1])
|
|
||||||
elif op_code in OpCodes.DISABLE_RAW_MGM_HK:
|
|
||||||
q.add_log_cmd(Info.DISABLE_RAW_MGM_HK)
|
|
||||||
q.add_pus_tc(
|
|
||||||
disable_periodic_hk_command(
|
|
||||||
False, make_sid(ACS_CONTROLLER, SetId.MGM_RAW_SET)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
elif op_code in OpCodes.REQUEST_PROC_MGM_HK:
|
|
||||||
q.add_log_cmd(Info.REQUEST_PROC_MGM_HK)
|
|
||||||
q.add_pus_tc(
|
|
||||||
generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.MGM_PROC_SET))
|
|
||||||
)
|
|
||||||
elif op_code in OpCodes.ENABLE_PROC_MGM_HK:
|
|
||||||
interval = float(input("Please specify interval in floating point seconds: "))
|
|
||||||
q.add_log_cmd(Info.ENABLE_PROC_MGM_HK)
|
|
||||||
cmd_tuple = enable_periodic_hk_command_with_interval(
|
|
||||||
False, make_sid(ACS_CONTROLLER, SetId.MGM_PROC_SET), interval
|
|
||||||
)
|
|
||||||
q.add_pus_tc(cmd_tuple[0])
|
|
||||||
q.add_pus_tc(cmd_tuple[1])
|
|
||||||
elif op_code in OpCodes.DISABLE_PROC_MGM_HK:
|
|
||||||
q.add_log_cmd(Info.DISABLE_PROC_MGM_HK)
|
|
||||||
q.add_pus_tc(
|
|
||||||
disable_periodic_hk_command(
|
|
||||||
False, make_sid(ACS_CONTROLLER, SetId.MGM_PROC_SET)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
elif op_code in OpCodes.REQUEST_RAW_SUS_HK:
|
|
||||||
q.add_log_cmd(Info.REQUEST_RAW_SUS_HK)
|
|
||||||
q.add_pus_tc(
|
|
||||||
generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.SUS_RAW_SET))
|
|
||||||
)
|
|
||||||
elif op_code in OpCodes.ENABLE_RAW_SUS_HK:
|
|
||||||
interval = float(input("Please specify interval in floating point seconds: "))
|
|
||||||
q.add_log_cmd(Info.ENABLE_RAW_SUS_HK)
|
|
||||||
cmd_tuple = enable_periodic_hk_command_with_interval(
|
|
||||||
False, make_sid(ACS_CONTROLLER, SetId.SUS_RAW_SET), interval
|
|
||||||
)
|
|
||||||
q.add_pus_tc(cmd_tuple[0])
|
|
||||||
q.add_pus_tc(cmd_tuple[1])
|
|
||||||
elif op_code in OpCodes.DISABLE_RAW_SUS_HK:
|
|
||||||
q.add_log_cmd(Info.DISABLE_RAW_SUS_HK)
|
|
||||||
q.add_pus_tc(
|
|
||||||
disable_periodic_hk_command(
|
|
||||||
False, make_sid(ACS_CONTROLLER, SetId.SUS_RAW_SET)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
elif op_code in OpCodes.REQUEST_PROC_SUS_HK:
|
|
||||||
q.add_log_cmd(Info.REQUEST_PROC_SUS_HK)
|
|
||||||
q.add_pus_tc(
|
|
||||||
generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.SUS_PROC_SET))
|
|
||||||
)
|
|
||||||
elif op_code in OpCodes.ENABLE_PROC_SUS_HK:
|
|
||||||
interval = float(input("Please specify interval in floating point seconds: "))
|
|
||||||
q.add_log_cmd(Info.ENABLE_PROC_SUS_HK)
|
|
||||||
cmd_tuple = enable_periodic_hk_command_with_interval(
|
|
||||||
False, make_sid(ACS_CONTROLLER, SetId.SUS_PROC_SET), interval
|
|
||||||
)
|
|
||||||
q.add_pus_tc(cmd_tuple[0])
|
|
||||||
q.add_pus_tc(cmd_tuple[1])
|
|
||||||
elif op_code in OpCodes.DISABLE_PROC_SUS_HK:
|
|
||||||
q.add_log_cmd(Info.DISABLE_PROC_SUS_HK)
|
|
||||||
q.add_pus_tc(
|
|
||||||
disable_periodic_hk_command(
|
|
||||||
False, make_sid(ACS_CONTROLLER, SetId.SUS_PROC_SET)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
elif op_code in OpCodes.REQUEST_RAW_GYR_HK:
|
|
||||||
q.add_log_cmd(Info.REQUEST_RAW_GYR_HK)
|
|
||||||
q.add_pus_tc(
|
|
||||||
create_request_one_diag_command(make_sid(ACS_CONTROLLER, SetId.GYR_RAW_SET))
|
|
||||||
)
|
|
||||||
elif op_code in OpCodes.ENABLE_RAW_GYR_HK:
|
|
||||||
interval = float(input("Please specify interval in floating point seconds: "))
|
|
||||||
q.add_log_cmd(Info.ENABLE_RAW_GYR_HK)
|
|
||||||
cmd_tuple = enable_periodic_hk_command_with_interval(
|
|
||||||
True, make_sid(ACS_CONTROLLER, SetId.GYR_RAW_SET), interval
|
|
||||||
)
|
|
||||||
q.add_pus_tc(cmd_tuple[0])
|
|
||||||
q.add_pus_tc(cmd_tuple[1])
|
|
||||||
elif op_code in OpCodes.DISABLE_RAW_GYR_HK:
|
|
||||||
q.add_log_cmd(Info.DISABLE_RAW_GYR_HK)
|
|
||||||
q.add_pus_tc(
|
|
||||||
disable_periodic_hk_command(
|
|
||||||
True, make_sid(ACS_CONTROLLER, SetId.GYR_RAW_SET)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
elif op_code in OpCodes.REQUEST_PROC_GYR_HK:
|
|
||||||
q.add_log_cmd(Info.REQUEST_PROC_GYR_HK)
|
|
||||||
q.add_pus_tc(
|
|
||||||
create_request_one_diag_command(
|
|
||||||
make_sid(ACS_CONTROLLER, SetId.GYR_PROC_SET)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
elif op_code in OpCodes.ENABLE_PROC_GYR_HK:
|
|
||||||
interval = float(input("Please specify interval in floating point seconds: "))
|
|
||||||
q.add_log_cmd(Info.ENABLE_PROC_GYR_HK)
|
|
||||||
cmd_tuple = enable_periodic_hk_command_with_interval(
|
|
||||||
True, make_sid(ACS_CONTROLLER, SetId.GYR_PROC_SET), interval
|
|
||||||
)
|
|
||||||
q.add_pus_tc(cmd_tuple[0])
|
|
||||||
q.add_pus_tc(cmd_tuple[1])
|
|
||||||
elif op_code in OpCodes.DISABLE_PROC_GYR_HK:
|
|
||||||
q.add_log_cmd(Info.DISABLE_PROC_GYR_HK)
|
|
||||||
q.add_pus_tc(
|
|
||||||
disable_periodic_hk_command(
|
|
||||||
True, make_sid(ACS_CONTROLLER, SetId.GYR_PROC_SET)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
elif op_code in OpCodes.REQUEST_PROC_GPS_HK:
|
|
||||||
q.add_log_cmd(Info.REQUEST_PROC_GPS_HK)
|
|
||||||
q.add_pus_tc(
|
|
||||||
generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.GPS_PROC_SET))
|
|
||||||
)
|
|
||||||
elif op_code in OpCodes.ENABLE_PROC_GPS_HK:
|
|
||||||
interval = float(input("Please specify interval in floating point seconds: "))
|
|
||||||
q.add_log_cmd(Info.ENABLE_PROC_GPS_HK)
|
|
||||||
cmd_tuple = enable_periodic_hk_command_with_interval(
|
|
||||||
False, make_sid(ACS_CONTROLLER, SetId.GPS_PROC_SET), interval
|
|
||||||
)
|
|
||||||
q.add_pus_tc(cmd_tuple[0])
|
|
||||||
q.add_pus_tc(cmd_tuple[1])
|
|
||||||
elif op_code in OpCodes.DISABLE_PROC_GPS_HK:
|
|
||||||
q.add_log_cmd(Info.DISABLE_PROC_GPS_HK)
|
|
||||||
q.add_pus_tc(
|
|
||||||
disable_periodic_hk_command(
|
|
||||||
False, make_sid(ACS_CONTROLLER, SetId.GPS_PROC_SET)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
elif op_code in OpCodes.REQUEST_MEKF_HK:
|
|
||||||
q.add_log_cmd(Info.REQUEST_MEKF_HK)
|
|
||||||
q.add_pus_tc(
|
|
||||||
create_request_one_diag_command(make_sid(ACS_CONTROLLER, SetId.MEKF_DATA))
|
|
||||||
)
|
|
||||||
elif op_code in OpCodes.ENABLE_MEKF_HK:
|
|
||||||
interval = float(input("Please specify interval in floating point seconds: "))
|
|
||||||
q.add_log_cmd(Info.ENABLE_MEKF_HK)
|
|
||||||
cmd_tuple = enable_periodic_hk_command_with_interval(
|
|
||||||
True, make_sid(ACS_CONTROLLER, SetId.MEKF_DATA), interval
|
|
||||||
)
|
|
||||||
q.add_pus_tc(cmd_tuple[0])
|
|
||||||
q.add_pus_tc(cmd_tuple[1])
|
|
||||||
elif op_code in OpCodes.DISABLE_MEKF_HK:
|
|
||||||
q.add_log_cmd(Info.DISABLE_MEKF_HK)
|
|
||||||
q.add_pus_tc(
|
|
||||||
disable_periodic_hk_command(True, make_sid(ACS_CONTROLLER, SetId.MEKF_DATA))
|
|
||||||
)
|
|
||||||
elif op_code in OpCodes.REQUEST_CTRL_VAL_HK:
|
|
||||||
q.add_log_cmd(Info.REQUEST_CTRL_VAL_HK)
|
|
||||||
q.add_pus_tc(
|
|
||||||
generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.CTRL_VAL_DATA))
|
|
||||||
)
|
|
||||||
elif op_code in OpCodes.ENABLE_CTRL_VAL_HK:
|
|
||||||
interval = float(input("Please specify interval in floating point seconds: "))
|
|
||||||
q.add_log_cmd(Info.ENABLE_CTRL_VAL_HK)
|
|
||||||
cmd_tuple = enable_periodic_hk_command_with_interval(
|
|
||||||
False, make_sid(ACS_CONTROLLER, SetId.CTRL_VAL_DATA), interval
|
|
||||||
)
|
|
||||||
q.add_pus_tc(cmd_tuple[0])
|
|
||||||
q.add_pus_tc(cmd_tuple[1])
|
|
||||||
elif op_code in OpCodes.DISABLE_CTRL_VAL_HK:
|
|
||||||
q.add_log_cmd(Info.DISABLE_CTRL_VAL_HK)
|
|
||||||
q.add_pus_tc(
|
|
||||||
disable_periodic_hk_command(
|
|
||||||
False, make_sid(ACS_CONTROLLER, SetId.CTRL_VAL_DATA)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
elif op_code in OpCodes.REQUEST_ACT_CMD_HK:
|
|
||||||
q.add_log_cmd(Info.REQUEST_ACT_CMD_HK)
|
|
||||||
q.add_pus_tc(
|
|
||||||
generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.ACTUATOR_CMD_DATA))
|
|
||||||
)
|
|
||||||
elif op_code in OpCodes.ENABLE_ACT_CMD_HK:
|
|
||||||
interval = float(input("Please specify interval in floating point seconds: "))
|
|
||||||
q.add_log_cmd(Info.ENABLE_ACT_CMD_HK)
|
|
||||||
cmd_tuple = enable_periodic_hk_command_with_interval(
|
|
||||||
False, make_sid(ACS_CONTROLLER, SetId.ACTUATOR_CMD_DATA), interval
|
|
||||||
)
|
|
||||||
q.add_pus_tc(cmd_tuple[0])
|
|
||||||
q.add_pus_tc(cmd_tuple[1])
|
|
||||||
elif op_code in OpCodes.DISABLE_ACT_CMD_HK:
|
|
||||||
q.add_log_cmd(Info.DISABLE_ACT_CMD_HK)
|
|
||||||
q.add_pus_tc(
|
|
||||||
disable_periodic_hk_command(
|
|
||||||
False, make_sid(ACS_CONTROLLER, SetId.ACTUATOR_CMD_DATA)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
elif op_code in OpCodes.REQUEST_FUSED_ROT_RATE_HK:
|
|
||||||
q.add_log_cmd(Info.REQUEST_FUSED_ROT_RATE_HK)
|
|
||||||
q.add_pus_tc(
|
|
||||||
generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.FUSED_ROT_RATE_DATA))
|
|
||||||
)
|
|
||||||
elif op_code in OpCodes.ENABLE_FUSED_ROT_RATE_HK:
|
|
||||||
interval = float(input("Please specify interval in floating point seconds: "))
|
|
||||||
q.add_log_cmd(Info.ENABLE_FUSED_ROT_RATE_HK)
|
|
||||||
cmd_tuple = enable_periodic_hk_command_with_interval(
|
|
||||||
False, make_sid(ACS_CONTROLLER, SetId.FUSED_ROT_RATE_DATA), interval
|
|
||||||
)
|
|
||||||
q.add_pus_tc(cmd_tuple[0])
|
|
||||||
q.add_pus_tc(cmd_tuple[1])
|
|
||||||
elif op_code in OpCodes.DISABLE_FUSED_ROT_RATE_HK:
|
|
||||||
q.add_log_cmd(Info.DISABLE_FUSED_ROT_RATE_HK)
|
|
||||||
q.add_pus_tc(
|
|
||||||
disable_periodic_hk_command(
|
|
||||||
False, make_sid(ACS_CONTROLLER, SetId.FUSED_ROT_RATE_DATA)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
logging.getLogger(__name__).info(f"Unknown op code {op_code}")
|
logging.getLogger(__name__).info(f"Unknown op code {op_code}")
|
||||||
|
|
||||||
|
|
||||||
|
def request_dataset(q: DefaultPusQueueHelper, req_type: DataSetRequest):
|
||||||
|
for val in SetId:
|
||||||
|
print("{:<2}: {:<20}".format(val, val.name))
|
||||||
|
set_id = int(input("Specify the dataset \n" ""))
|
||||||
|
if set_id in [
|
||||||
|
SetId.GYR_RAW_SET,
|
||||||
|
SetId.GPS_PROC_SET,
|
||||||
|
SetId.ATTITUDE_ESTIMATION_DATA,
|
||||||
|
]:
|
||||||
|
is_diag = True
|
||||||
|
else:
|
||||||
|
is_diag = False
|
||||||
|
match req_type:
|
||||||
|
case DataSetRequest.ONESHOT:
|
||||||
|
if is_diag:
|
||||||
|
q.add_pus_tc(
|
||||||
|
create_request_one_diag_command(make_sid(ACS_CONTROLLER, set_id))
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
q.add_pus_tc(
|
||||||
|
create_request_one_hk_command(make_sid(ACS_CONTROLLER, set_id))
|
||||||
|
)
|
||||||
|
case DataSetRequest.ENABLE:
|
||||||
|
interval = float(
|
||||||
|
input("Please specify interval in floating point seconds: ")
|
||||||
|
)
|
||||||
|
|
||||||
|
if is_diag:
|
||||||
|
cmd_tuple = enable_periodic_hk_command_with_interval(
|
||||||
|
True, make_sid(ACS_CONTROLLER, set_id), interval
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
cmd_tuple = enable_periodic_hk_command_with_interval(
|
||||||
|
False, make_sid(ACS_CONTROLLER, set_id), interval
|
||||||
|
)
|
||||||
|
q.add_pus_tc(cmd_tuple[0])
|
||||||
|
q.add_pus_tc(cmd_tuple[1])
|
||||||
|
case DataSetRequest.DISABLE:
|
||||||
|
if is_diag:
|
||||||
|
q.add_pus_tc(
|
||||||
|
disable_periodic_hk_command(True, make_sid(ACS_CONTROLLER, set_id))
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
q.add_pus_tc(
|
||||||
|
disable_periodic_hk_command(False, make_sid(ACS_CONTROLLER, set_id))
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def set_acs_ctrl_param_scalar(q: DefaultPusQueueHelper):
|
def set_acs_ctrl_param_scalar(q: DefaultPusQueueHelper):
|
||||||
pt = int(
|
pt = int(
|
||||||
input(
|
input(
|
||||||
@ -771,14 +540,16 @@ def handle_acs_ctrl_hk_data(
|
|||||||
handle_gyr_data_processed(pw, hk_data)
|
handle_gyr_data_processed(pw, hk_data)
|
||||||
case SetId.GPS_PROC_SET:
|
case SetId.GPS_PROC_SET:
|
||||||
handle_gps_data_processed(pw, hk_data)
|
handle_gps_data_processed(pw, hk_data)
|
||||||
case SetId.MEKF_DATA:
|
case SetId.ATTITUDE_ESTIMATION_DATA:
|
||||||
handle_mekf_data(pw, hk_data)
|
handle_attitude_estimation_data(pw, hk_data)
|
||||||
case SetId.CTRL_VAL_DATA:
|
case SetId.CTRL_VAL_DATA:
|
||||||
handle_ctrl_val_data(pw, hk_data)
|
handle_ctrl_val_data(pw, hk_data)
|
||||||
case SetId.ACTUATOR_CMD_DATA:
|
case SetId.ACTUATOR_CMD_DATA:
|
||||||
handle_act_cmd_data(pw, hk_data)
|
handle_act_cmd_data(pw, hk_data)
|
||||||
case SetId.FUSED_ROT_RATE_DATA:
|
case SetId.FUSED_ROT_RATE_DATA:
|
||||||
handle_fused_rot_rate_data(pw, hk_data)
|
handle_fused_rot_rate_data(pw, hk_data)
|
||||||
|
case SetId.FUSED_ROT_RATE_SOURCE_DATA:
|
||||||
|
handle_fused_rot_rate_source_data(pw, hk_data)
|
||||||
|
|
||||||
|
|
||||||
def handle_acs_ctrl_sus_raw_data(pw: PrintWrapper, hk_data: bytes):
|
def handle_acs_ctrl_sus_raw_data(pw: PrintWrapper, hk_data: bytes):
|
||||||
@ -800,7 +571,7 @@ def handle_acs_ctrl_sus_raw_data(pw: PrintWrapper, hk_data: bytes):
|
|||||||
sus_list_formatted = vec_fmt.format(*sus_list)
|
sus_list_formatted = vec_fmt.format(*sus_list)
|
||||||
current_idx += length
|
current_idx += length
|
||||||
pw.dlog(f"SUS {idx} RAW: {sus_list_formatted}")
|
pw.dlog(f"SUS {idx} RAW: {sus_list_formatted}")
|
||||||
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=12)
|
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=12))
|
||||||
|
|
||||||
|
|
||||||
def handle_acs_ctrl_sus_processed_data(pw: PrintWrapper, hk_data: bytes):
|
def handle_acs_ctrl_sus_processed_data(pw: PrintWrapper, hk_data: bytes):
|
||||||
@ -836,7 +607,7 @@ def handle_acs_ctrl_sus_processed_data(pw: PrintWrapper, hk_data: bytes):
|
|||||||
sun_ijk_model = vec_fmt.format(*sun_ijk_model)
|
sun_ijk_model = vec_fmt.format(*sun_ijk_model)
|
||||||
current_idx += inc_len
|
current_idx += inc_len
|
||||||
pw.dlog(f"{'SUS ijk Model'.ljust(25)}: {sun_ijk_model}")
|
pw.dlog(f"{'SUS ijk Model'.ljust(25)}: {sun_ijk_model}")
|
||||||
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=15)
|
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=15))
|
||||||
|
|
||||||
|
|
||||||
def handle_raw_mgm_data(pw: PrintWrapper, hk_data: bytes):
|
def handle_raw_mgm_data(pw: PrintWrapper, hk_data: bytes):
|
||||||
@ -892,7 +663,7 @@ def handle_raw_mgm_data(pw: PrintWrapper, hk_data: bytes):
|
|||||||
pw.dlog(f"{entry[0].ljust(28)}: {entry[1]}")
|
pw.dlog(f"{entry[0].ljust(28)}: {entry[1]}")
|
||||||
current_idx += 1
|
current_idx += 1
|
||||||
assert current_idx == 61
|
assert current_idx == 61
|
||||||
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=6)
|
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=6))
|
||||||
|
|
||||||
|
|
||||||
def handle_mgm_data_processed(pw: PrintWrapper, hk_data: bytes):
|
def handle_mgm_data_processed(pw: PrintWrapper, hk_data: bytes):
|
||||||
@ -946,7 +717,7 @@ def handle_mgm_data_processed(pw: PrintWrapper, hk_data: bytes):
|
|||||||
current_idx += inc_len
|
current_idx += inc_len
|
||||||
if PERFORM_MGM_CALIBRATION:
|
if PERFORM_MGM_CALIBRATION:
|
||||||
perform_mgm_calibration(pw, mgm_3)
|
perform_mgm_calibration(pw, mgm_3)
|
||||||
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=8)
|
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=8))
|
||||||
|
|
||||||
|
|
||||||
def handle_gyr_data_raw(pw: PrintWrapper, hk_data: bytes):
|
def handle_gyr_data_raw(pw: PrintWrapper, hk_data: bytes):
|
||||||
@ -980,7 +751,7 @@ def handle_gyr_data_raw(pw: PrintWrapper, hk_data: bytes):
|
|||||||
pw.dlog(f"{'GYR 1 L3'.ljust(15)}: {float_str_fmt.format(*gyr_1_l3)}")
|
pw.dlog(f"{'GYR 1 L3'.ljust(15)}: {float_str_fmt.format(*gyr_1_l3)}")
|
||||||
pw.dlog(f"{'GYR 2 ADIS'.ljust(15)}: {float_str_fmt.format(*gyr_2_adis)}")
|
pw.dlog(f"{'GYR 2 ADIS'.ljust(15)}: {float_str_fmt.format(*gyr_2_adis)}")
|
||||||
pw.dlog(f"{'GYR 3 L3'.ljust(15)}: {float_str_fmt.format(*gyr_3_l3)}")
|
pw.dlog(f"{'GYR 3 L3'.ljust(15)}: {float_str_fmt.format(*gyr_3_l3)}")
|
||||||
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], 4)
|
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], 4))
|
||||||
|
|
||||||
|
|
||||||
GYR_NAMES = ["GYR 0 ADIS", "GYR 1 L3", "GYR 2 ADIS", "GYR 3 L3"]
|
GYR_NAMES = ["GYR 0 ADIS", "GYR 1 L3", "GYR 2 ADIS", "GYR 3 L3"]
|
||||||
@ -1006,7 +777,7 @@ def handle_gyr_data_processed(pw: PrintWrapper, hk_data: bytes):
|
|||||||
]
|
]
|
||||||
pw.dlog(f"GYR Vec Total: {gyr_vec_tot}")
|
pw.dlog(f"GYR Vec Total: {gyr_vec_tot}")
|
||||||
current_idx += inc_len
|
current_idx += inc_len
|
||||||
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=5)
|
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=5))
|
||||||
|
|
||||||
|
|
||||||
def handle_gps_data_processed(pw: PrintWrapper, hk_data: bytes):
|
def handle_gps_data_processed(pw: PrintWrapper, hk_data: bytes):
|
||||||
@ -1060,8 +831,8 @@ def handle_gps_data_processed(pw: PrintWrapper, hk_data: bytes):
|
|||||||
fmt_source, hk_data[current_idx : current_idx + inc_len_source]
|
fmt_source, hk_data[current_idx : current_idx + inc_len_source]
|
||||||
)[0]
|
)[0]
|
||||||
current_idx += inc_len_source
|
current_idx += inc_len_source
|
||||||
if GPS_COURCE_DICT.get(source) is not None:
|
if GPS_SOURCE_DICT.get(source) is not None:
|
||||||
pw.dlog(f"GPS Source: {GPS_COURCE_DICT[source]}")
|
pw.dlog(f"GPS Source: {GPS_SOURCE_DICT[source]}")
|
||||||
else:
|
else:
|
||||||
pw.dlog(f"'GPS Source (key unknown)': {source}")
|
pw.dlog(f"'GPS Source (key unknown)': {source}")
|
||||||
pw.dlog(f"GPS Latitude: {lat} [deg]")
|
pw.dlog(f"GPS Latitude: {lat} [deg]")
|
||||||
@ -1069,10 +840,10 @@ def handle_gps_data_processed(pw: PrintWrapper, hk_data: bytes):
|
|||||||
pw.dlog(f"GPS Altitude: {alt} [m]")
|
pw.dlog(f"GPS Altitude: {alt} [m]")
|
||||||
pw.dlog(f"GPS Position: {pos} [m]")
|
pw.dlog(f"GPS Position: {pos} [m]")
|
||||||
pw.dlog(f"GPS Velocity: {velo} [m/s]")
|
pw.dlog(f"GPS Velocity: {velo} [m/s]")
|
||||||
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=6)
|
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=6))
|
||||||
|
|
||||||
|
|
||||||
def handle_mekf_data(pw: PrintWrapper, hk_data: bytes):
|
def handle_attitude_estimation_data(pw: PrintWrapper, hk_data: bytes):
|
||||||
mekf_status = {
|
mekf_status = {
|
||||||
0: "UNINITIALIZED",
|
0: "UNINITIALIZED",
|
||||||
1: "NO_GYR_DATA",
|
1: "NO_GYR_DATA",
|
||||||
@ -1083,7 +854,7 @@ def handle_mekf_data(pw: PrintWrapper, hk_data: bytes):
|
|||||||
10: "INITIALIZED",
|
10: "INITIALIZED",
|
||||||
11: "RUNNING",
|
11: "RUNNING",
|
||||||
}
|
}
|
||||||
pw.dlog("Received MEKF Set")
|
pw.dlog("Received Attitude Estimation Set")
|
||||||
fmt_quat = "!dddd"
|
fmt_quat = "!dddd"
|
||||||
fmt_str_4 = "[{:8.3f}, {:8.3f}, {:8.3f}, {:8.3f}]"
|
fmt_str_4 = "[{:8.3f}, {:8.3f}, {:8.3f}, {:8.3f}]"
|
||||||
fmt_str_3 = "[{:8.3f}, {:8.3f}, {:8.3f}]"
|
fmt_str_3 = "[{:8.3f}, {:8.3f}, {:8.3f}]"
|
||||||
@ -1092,11 +863,16 @@ def handle_mekf_data(pw: PrintWrapper, hk_data: bytes):
|
|||||||
inc_len_quat = struct.calcsize(fmt_quat)
|
inc_len_quat = struct.calcsize(fmt_quat)
|
||||||
inc_len_vec = struct.calcsize(fmt_vec)
|
inc_len_vec = struct.calcsize(fmt_vec)
|
||||||
inc_len_sts = struct.calcsize(fmt_sts)
|
inc_len_sts = struct.calcsize(fmt_sts)
|
||||||
if len(hk_data) < inc_len_quat + inc_len_vec + inc_len_sts:
|
old_size = inc_len_quat + inc_len_vec + inc_len_sts + 1
|
||||||
pw.dlog("Received HK set too small")
|
new_size = 2 * inc_len_quat + inc_len_vec + inc_len_sts + 1
|
||||||
|
size = len(hk_data)
|
||||||
|
if size not in [old_size, new_size]:
|
||||||
|
pw.dlog(f"Received Attitude Estimation HK Set of unexpected size: {size}")
|
||||||
return
|
return
|
||||||
current_idx = 0
|
current_idx = 0
|
||||||
quat = struct.unpack(fmt_quat, hk_data[current_idx : current_idx + inc_len_quat])
|
mekf_quat = struct.unpack(
|
||||||
|
fmt_quat, hk_data[current_idx : current_idx + inc_len_quat]
|
||||||
|
)
|
||||||
current_idx += inc_len_quat
|
current_idx += inc_len_quat
|
||||||
rates = [
|
rates = [
|
||||||
rate * 180 / math.pi
|
rate * 180 / math.pi
|
||||||
@ -1111,9 +887,17 @@ def handle_mekf_data(pw: PrintWrapper, hk_data: bytes):
|
|||||||
pw.dlog(f"{'MEKF Status'.ljust(25)}: {mekf_status[status]}")
|
pw.dlog(f"{'MEKF Status'.ljust(25)}: {mekf_status[status]}")
|
||||||
else:
|
else:
|
||||||
pw.dlog(f"{'MEKF Raw Status (key unknown)'.ljust(25)}: {status}")
|
pw.dlog(f"{'MEKF Raw Status (key unknown)'.ljust(25)}: {status}")
|
||||||
pw.dlog(f"{'MEKF Quaternion'.ljust(25)}: {fmt_str_4.format(*quat)}")
|
pw.dlog(f"{'MEKF Quaternion'.ljust(25)}: {fmt_str_4.format(*mekf_quat)}")
|
||||||
pw.dlog(f"{'MEKF Rotational Rate'.ljust(25)}: {fmt_str_3.format(*rates)}")
|
pw.dlog(f"{'MEKF Rotational Rate'.ljust(25)}: {fmt_str_3.format(*rates)}")
|
||||||
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=3)
|
if size == new_size:
|
||||||
|
quest_quat = struct.unpack(
|
||||||
|
fmt_quat, hk_data[current_idx : current_idx + inc_len_quat]
|
||||||
|
)
|
||||||
|
current_idx += inc_len_quat
|
||||||
|
pw.dlog(f"{'QUEST Quaternion'.ljust(25)}: {fmt_str_4.format(*quest_quat)}")
|
||||||
|
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=4))
|
||||||
|
return
|
||||||
|
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=3))
|
||||||
|
|
||||||
|
|
||||||
def handle_ctrl_val_data(pw: PrintWrapper, hk_data: bytes):
|
def handle_ctrl_val_data(pw: PrintWrapper, hk_data: bytes):
|
||||||
@ -1163,14 +947,14 @@ def handle_ctrl_val_data(pw: PrintWrapper, hk_data: bytes):
|
|||||||
]
|
]
|
||||||
current_idx += inc_len_vec
|
current_idx += inc_len_vec
|
||||||
if CTRL_STRAT_DICT.get(strat) is not None:
|
if CTRL_STRAT_DICT.get(strat) is not None:
|
||||||
pw.dlog(f"{'Safe Ctrl Strategy'.ljust(25)}: {CTRL_STRAT_DICT[strat]}")
|
pw.dlog(f"{'Ctrl Strategy'.ljust(25)}: {CTRL_STRAT_DICT[strat]}")
|
||||||
else:
|
else:
|
||||||
pw.dlog(f"{'Safe Ctrl Strategy (key unknown)'.ljust(25)}: {strat}")
|
pw.dlog(f"{'Ctrl Strategy (key unknown)'.ljust(25)}: {strat}")
|
||||||
pw.dlog(f"Control Values Target Quaternion: {tgt_quat}")
|
pw.dlog(f"Control Values Target Quaternion: {tgt_quat}")
|
||||||
pw.dlog(f"Control Values Error Quaternion: {err_quat}")
|
pw.dlog(f"Control Values Error Quaternion: {err_quat}")
|
||||||
pw.dlog(f"Control Values Error Angle: {err_ang} [deg]")
|
pw.dlog(f"Control Values Error Angle: {err_ang} [deg]")
|
||||||
pw.dlog(f"Control Values Target Rotational Rate: {tgt_rot} [deg/s]")
|
pw.dlog(f"Control Values Target Rotational Rate: {tgt_rot} [deg/s]")
|
||||||
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=5)
|
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=5))
|
||||||
|
|
||||||
|
|
||||||
def handle_act_cmd_data(pw: PrintWrapper, hk_data: bytes):
|
def handle_act_cmd_data(pw: PrintWrapper, hk_data: bytes):
|
||||||
@ -1209,15 +993,20 @@ def handle_act_cmd_data(pw: PrintWrapper, hk_data: bytes):
|
|||||||
pw.dlog(f"Actuator Commands RW Target Torque: {rw_tgt_torque}")
|
pw.dlog(f"Actuator Commands RW Target Torque: {rw_tgt_torque}")
|
||||||
pw.dlog(f"Actuator Commands RW Target Speed: {rw_tgt_speed}")
|
pw.dlog(f"Actuator Commands RW Target Speed: {rw_tgt_speed}")
|
||||||
pw.dlog(f"Actuator Commands MTQ Target Dipole: {mtq_tgt_dipole}")
|
pw.dlog(f"Actuator Commands MTQ Target Dipole: {mtq_tgt_dipole}")
|
||||||
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=3)
|
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=3))
|
||||||
|
|
||||||
|
|
||||||
def handle_fused_rot_rate_data(pw: PrintWrapper, hk_data: bytes):
|
def handle_fused_rot_rate_data(pw: PrintWrapper, hk_data: bytes):
|
||||||
pw.dlog("Received Fused Rotation Rates Data Set")
|
pw.dlog("Received Fused Rotation Rates Data Set")
|
||||||
fmt_vec3_double = "!ddd"
|
fmt_vec3_double = "!ddd"
|
||||||
inc_len_vec3_double = struct.calcsize(fmt_vec3_double)
|
inc_len_vec3_double = struct.calcsize(fmt_vec3_double)
|
||||||
if len(hk_data) < 3 * inc_len_vec3_double:
|
fmt_source = "!B"
|
||||||
pw.dlog("Received HK set too small")
|
inc_len_source = struct.calcsize(fmt_source)
|
||||||
|
old_size = 3 * inc_len_vec3_double + 1
|
||||||
|
new_size = 3 * inc_len_vec3_double + inc_len_source + 1
|
||||||
|
size = len(hk_data)
|
||||||
|
if size not in [old_size, new_size]:
|
||||||
|
pw.dlog(f"Received Fused Rot Rate HK set of unexpected size: {len(hk_data)}")
|
||||||
return
|
return
|
||||||
current_idx = 0
|
current_idx = 0
|
||||||
rot_rate_orthogonal = [
|
rot_rate_orthogonal = [
|
||||||
@ -1244,7 +1033,91 @@ def handle_fused_rot_rate_data(pw: PrintWrapper, hk_data: bytes):
|
|||||||
pw.dlog(f"Fused Rotational Rate Orthogonal: {rot_rate_orthogonal} [deg/s]")
|
pw.dlog(f"Fused Rotational Rate Orthogonal: {rot_rate_orthogonal} [deg/s]")
|
||||||
pw.dlog(f"Fused Rotational Rate Parallel: {rot_rate_parallel} [deg/s]")
|
pw.dlog(f"Fused Rotational Rate Parallel: {rot_rate_parallel} [deg/s]")
|
||||||
pw.dlog(f"Fused Rotational Rate Total: {rot_rate_total} [deg/s]")
|
pw.dlog(f"Fused Rotational Rate Total: {rot_rate_total} [deg/s]")
|
||||||
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=3)
|
if size == new_size:
|
||||||
|
rot_rate_source = struct.unpack(
|
||||||
|
fmt_source, hk_data[current_idx : current_idx + inc_len_source]
|
||||||
|
)[0]
|
||||||
|
current_idx += inc_len_source
|
||||||
|
if FUSED_ROT_RATE_SOURCE_DICT.get(rot_rate_source) is not None:
|
||||||
|
pw.dlog(
|
||||||
|
f"Fused Rotational Rate Source: {FUSED_ROT_RATE_SOURCE_DICT[rot_rate_source]}"
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
pw.dlog(f"Ctrl Strategy (key unknown): {rot_rate_source}")
|
||||||
|
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=4))
|
||||||
|
return
|
||||||
|
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=3))
|
||||||
|
|
||||||
|
|
||||||
|
def handle_fused_rot_rate_source_data(pw: PrintWrapper, hk_data: bytes):
|
||||||
|
pw.dlog("Received Fused Rotation Rates Sources Data Set")
|
||||||
|
fmt_vec3_double = "!ddd"
|
||||||
|
inc_len_vec3_double = struct.calcsize(fmt_vec3_double)
|
||||||
|
if len(hk_data) < 5 * inc_len_vec3_double:
|
||||||
|
pw.dlog("Received HK set too small")
|
||||||
|
return
|
||||||
|
current_idx = 0
|
||||||
|
rot_rate_orthogonal_susmgm = [
|
||||||
|
f"{val*180/math.pi:8.3f}"
|
||||||
|
for val in struct.unpack(
|
||||||
|
fmt_vec3_double, hk_data[current_idx : current_idx + inc_len_vec3_double]
|
||||||
|
)
|
||||||
|
]
|
||||||
|
current_idx += inc_len_vec3_double
|
||||||
|
rot_rate_parallel_susmgm = [
|
||||||
|
f"{val*180/math.pi:8.3f}"
|
||||||
|
for val in struct.unpack(
|
||||||
|
fmt_vec3_double, hk_data[current_idx : current_idx + inc_len_vec3_double]
|
||||||
|
)
|
||||||
|
]
|
||||||
|
current_idx += inc_len_vec3_double
|
||||||
|
rot_rate_total_susmgm = [
|
||||||
|
f"{val*180/math.pi:8.3f}"
|
||||||
|
for val in struct.unpack(
|
||||||
|
fmt_vec3_double, hk_data[current_idx : current_idx + inc_len_vec3_double]
|
||||||
|
)
|
||||||
|
]
|
||||||
|
current_idx += inc_len_vec3_double
|
||||||
|
rot_rate_total_quest = [
|
||||||
|
f"{val * 180 / math.pi:8.3f}"
|
||||||
|
for val in struct.unpack(
|
||||||
|
fmt_vec3_double, hk_data[current_idx : current_idx + inc_len_vec3_double]
|
||||||
|
)
|
||||||
|
]
|
||||||
|
current_idx += inc_len_vec3_double
|
||||||
|
rot_rate_total_str = [
|
||||||
|
f"{val * 180 / math.pi:8.3f}"
|
||||||
|
for val in struct.unpack(
|
||||||
|
fmt_vec3_double, hk_data[current_idx : current_idx + inc_len_vec3_double]
|
||||||
|
)
|
||||||
|
]
|
||||||
|
current_idx += inc_len_vec3_double
|
||||||
|
pw.dlog(
|
||||||
|
f"Fused Rotational Rate Orthogonal SUSMGM: {rot_rate_orthogonal_susmgm} [deg/s]"
|
||||||
|
)
|
||||||
|
pw.dlog(
|
||||||
|
f"Fused Rotational Rate Parallel SUSMGM: {rot_rate_parallel_susmgm} [deg/s]"
|
||||||
|
)
|
||||||
|
pw.dlog(f"Fused Rotational Rate Total SUSMGM: {rot_rate_total_susmgm} [deg/s]")
|
||||||
|
pw.dlog(f"Fused Rotational Rate Total QUEST: {rot_rate_total_quest} [deg/s]")
|
||||||
|
pw.dlog(f"Fused Rotational Rate Total STR: {rot_rate_total_str} [deg/s]")
|
||||||
|
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=5))
|
||||||
|
|
||||||
|
|
||||||
|
def handle_acs_ctrl_action_replies(
|
||||||
|
action_id: int, pw: PrintWrapper, custom_data: bytes
|
||||||
|
):
|
||||||
|
if action_id == ActionId.READ_TLE:
|
||||||
|
handle_read_tle(pw, custom_data)
|
||||||
|
|
||||||
|
|
||||||
|
def handle_read_tle(pw: PrintWrapper, custom_data: bytes):
|
||||||
|
pw.dlog("Received TLE")
|
||||||
|
data_length = 69 * 2
|
||||||
|
if len(custom_data) != data_length:
|
||||||
|
raise ValueError(f"Received data of unexpected length {len(custom_data)}")
|
||||||
|
tle = custom_data.decode()
|
||||||
|
pw.dlog(f"{tle[0:69]}\n{tle[69:69*2]}")
|
||||||
|
|
||||||
|
|
||||||
def perform_mgm_calibration( # noqa C901: Complexity okay
|
def perform_mgm_calibration( # noqa C901: Complexity okay
|
||||||
|
@ -100,9 +100,10 @@ class StarTrackerActionId(enum.IntEnum):
|
|||||||
ADD_SECONDARY_TM_TO_NORMAL_MODE = 95
|
ADD_SECONDARY_TM_TO_NORMAL_MODE = 95
|
||||||
RESET_SECONDARY_TM_SET = 96
|
RESET_SECONDARY_TM_SET = 96
|
||||||
READ_SECONDARY_TM_SET = 97
|
READ_SECONDARY_TM_SET = 97
|
||||||
|
RELOAD_JSON_CFG_FILE = 100
|
||||||
|
|
||||||
|
|
||||||
class OpCodes:
|
class OpCode:
|
||||||
ON_BOOTLOADER = "on_bootloader"
|
ON_BOOTLOADER = "on_bootloader"
|
||||||
ON_FIRMWARE = "on_firmware"
|
ON_FIRMWARE = "on_firmware"
|
||||||
NORMAL = "nml"
|
NORMAL = "nml"
|
||||||
@ -120,6 +121,7 @@ class OpCodes:
|
|||||||
SET_IMG_PROCESSOR_MODE = "set_img_proc_mode"
|
SET_IMG_PROCESSOR_MODE = "set_img_proc_mode"
|
||||||
FW_UPDATE = "fw_update"
|
FW_UPDATE = "fw_update"
|
||||||
SET_TIME_FROM_SYS_TIME = "set_time"
|
SET_TIME_FROM_SYS_TIME = "set_time"
|
||||||
|
RELOAD_JSON_CFG_FILE = "reload_json_cfg"
|
||||||
|
|
||||||
|
|
||||||
class Info:
|
class Info:
|
||||||
@ -135,6 +137,7 @@ class Info:
|
|||||||
SET_IMG_PROCESSOR_MODE = "Set Image Processor Mode"
|
SET_IMG_PROCESSOR_MODE = "Set Image Processor Mode"
|
||||||
FW_UPDATE = "Firmware Update"
|
FW_UPDATE = "Firmware Update"
|
||||||
SET_TIME_FROM_SYS_TIME = "Set time from system time"
|
SET_TIME_FROM_SYS_TIME = "Set time from system time"
|
||||||
|
RELOAD_JSON_CFG_FILE = "Reload JSON configuration file. Reboot still required."
|
||||||
|
|
||||||
|
|
||||||
class SetId(enum.IntEnum):
|
class SetId(enum.IntEnum):
|
||||||
@ -244,36 +247,36 @@ def pack_star_tracker_commands( # noqa C901
|
|||||||
f"Generate command for star tracker with object id: {object_id.as_hex_string}"
|
f"Generate command for star tracker with object id: {object_id.as_hex_string}"
|
||||||
)
|
)
|
||||||
obyt = object_id.as_bytes
|
obyt = object_id.as_bytes
|
||||||
if op_code == OpCodes.ON_BOOTLOADER:
|
if op_code == OpCode.ON_BOOTLOADER:
|
||||||
q.add_log_cmd("Star tracker: Mode On, Submode Bootloader")
|
q.add_log_cmd("Star tracker: Mode On, Submode Bootloader")
|
||||||
data = pack_mode_data(prompt_object_id_mode_cmd(), Mode.ON, Submode.BOOTLOADER)
|
data = pack_mode_data(prompt_object_id_mode_cmd(), Mode.ON, Submode.BOOTLOADER)
|
||||||
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=data))
|
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=data))
|
||||||
if op_code == OpCodes.ON_FIRMWARE:
|
if op_code == OpCode.ON_FIRMWARE:
|
||||||
q.add_log_cmd("Star tracker: Mode On, Submode Firmware")
|
q.add_log_cmd("Star tracker: Mode On, Submode Firmware")
|
||||||
data = pack_mode_data(prompt_object_id_mode_cmd(), Mode.ON, Submode.FIRMWARE)
|
data = pack_mode_data(prompt_object_id_mode_cmd(), Mode.ON, Submode.FIRMWARE)
|
||||||
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=data))
|
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=data))
|
||||||
if op_code == OpCodes.NORMAL:
|
if op_code == OpCode.NORMAL:
|
||||||
q.add_log_cmd("Star tracker: Mode Normal")
|
q.add_log_cmd("Star tracker: Mode Normal")
|
||||||
data = pack_mode_data(prompt_object_id_mode_cmd(), Mode.NORMAL, 0)
|
data = pack_mode_data(prompt_object_id_mode_cmd(), Mode.NORMAL, 0)
|
||||||
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=data))
|
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=data))
|
||||||
if op_code == OpCodes.OFF:
|
if op_code == OpCode.OFF:
|
||||||
q.add_log_cmd("Star tracker: Mode Off")
|
q.add_log_cmd("Star tracker: Mode Off")
|
||||||
data = pack_mode_data(prompt_object_id_mode_cmd(), Mode.OFF, 0)
|
data = pack_mode_data(prompt_object_id_mode_cmd(), Mode.OFF, 0)
|
||||||
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=data))
|
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=data))
|
||||||
if op_code == OpCodes.ONE_SHOOT_HK:
|
if op_code == OpCode.ONE_SHOOT_HK:
|
||||||
q.add_log_cmd(Info.ONE_SHOOT_HK)
|
q.add_log_cmd(Info.ONE_SHOOT_HK)
|
||||||
request_dataset(q, DataSetRequest.ONESHOT)
|
request_dataset(q, DataSetRequest.ONESHOT)
|
||||||
if op_code == OpCodes.ENABLE_HK:
|
if op_code == OpCode.ENABLE_HK:
|
||||||
q.add_log_cmd(Info.ENABLE_HK)
|
q.add_log_cmd(Info.ENABLE_HK)
|
||||||
request_dataset(q, DataSetRequest.ENABLE)
|
request_dataset(q, DataSetRequest.ENABLE)
|
||||||
if op_code == OpCodes.DISABLE_HK:
|
if op_code == OpCode.DISABLE_HK:
|
||||||
q.add_log_cmd(Info.DISABLE_HK)
|
q.add_log_cmd(Info.DISABLE_HK)
|
||||||
request_dataset(q, DataSetRequest.DISABLE)
|
request_dataset(q, DataSetRequest.DISABLE)
|
||||||
if op_code == "4":
|
if op_code == "4":
|
||||||
q.add_log_cmd("Star tracker: Mode Raw")
|
q.add_log_cmd("Star tracker: Mode Raw")
|
||||||
data = pack_mode_data(obyt, Mode.RAW, 0)
|
data = pack_mode_data(obyt, Mode.RAW, 0)
|
||||||
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=data))
|
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=data))
|
||||||
if op_code == OpCodes.PING:
|
if op_code == OpCode.PING:
|
||||||
q.add_log_cmd("Star tracker: Ping")
|
q.add_log_cmd("Star tracker: Ping")
|
||||||
data = obyt + struct.pack("!I", StarTrackerActionId.PING)
|
data = obyt + struct.pack("!I", StarTrackerActionId.PING)
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
||||||
@ -316,7 +319,7 @@ def pack_star_tracker_commands( # noqa C901
|
|||||||
q.add_log_cmd("Star tracker: Request time")
|
q.add_log_cmd("Star tracker: Request time")
|
||||||
data = obyt + struct.pack("!I", StarTrackerActionId.REQ_TIME)
|
data = obyt + struct.pack("!I", StarTrackerActionId.REQ_TIME)
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
||||||
if op_code == OpCodes.UPLOAD_IMAGE:
|
if op_code == OpCode.UPLOAD_IMAGE:
|
||||||
q.add_log_cmd("Star tracker: Upload image")
|
q.add_log_cmd("Star tracker: Upload image")
|
||||||
image = get_upload_image()
|
image = get_upload_image()
|
||||||
data = (
|
data = (
|
||||||
@ -325,7 +328,7 @@ def pack_star_tracker_commands( # noqa C901
|
|||||||
+ bytearray(image, "utf-8")
|
+ bytearray(image, "utf-8")
|
||||||
)
|
)
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
||||||
if op_code == OpCodes.DOWNLOAD_IMAGE:
|
if op_code == OpCode.DOWNLOAD_IMAGE:
|
||||||
q.add_log_cmd(f"STR: {Info.DOWNLOAD_IMAGE}")
|
q.add_log_cmd(f"STR: {Info.DOWNLOAD_IMAGE}")
|
||||||
path = input("Specify storage location (default - /mnt/sd0/startracker): ")
|
path = input("Specify storage location (default - /mnt/sd0/startracker): ")
|
||||||
if not path:
|
if not path:
|
||||||
@ -417,7 +420,7 @@ def pack_star_tracker_commands( # noqa C901
|
|||||||
+ bytearray(json_file, "utf-8")
|
+ bytearray(json_file, "utf-8")
|
||||||
)
|
)
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
||||||
if op_code == OpCodes.TAKE_IMAGE:
|
if op_code == OpCode.TAKE_IMAGE:
|
||||||
q.add_log_cmd("Star tracker: Take image")
|
q.add_log_cmd("Star tracker: Take image")
|
||||||
actionid = int(
|
actionid = int(
|
||||||
input("Specify parameter ID (4: take image, 7: get histogram): ")
|
input("Specify parameter ID (4: take image, 7: get histogram): ")
|
||||||
@ -475,7 +478,7 @@ def pack_star_tracker_commands( # noqa C901
|
|||||||
q.add_log_cmd("Star tracker: Get checksum")
|
q.add_log_cmd("Star tracker: Get checksum")
|
||||||
data = pack_checksum_command(obyt)
|
data = pack_checksum_command(obyt)
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
||||||
if op_code == OpCodes.SET_TIME_FROM_SYS_TIME:
|
if op_code == OpCode.SET_TIME_FROM_SYS_TIME:
|
||||||
q.add_log_cmd(Info.SET_TIME_FROM_SYS_TIME)
|
q.add_log_cmd(Info.SET_TIME_FROM_SYS_TIME)
|
||||||
data = obyt + struct.pack("!I", StarTrackerActionId.SET_TIME_FROM_SYS_TIME)
|
data = obyt + struct.pack("!I", StarTrackerActionId.SET_TIME_FROM_SYS_TIME)
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
||||||
@ -538,7 +541,7 @@ def pack_star_tracker_commands( # noqa C901
|
|||||||
q.add_log_cmd("Star tracker: Request limits")
|
q.add_log_cmd("Star tracker: Request limits")
|
||||||
data = obyt + struct.pack("!I", StarTrackerActionId.REQ_LIMITS)
|
data = obyt + struct.pack("!I", StarTrackerActionId.REQ_LIMITS)
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
||||||
if op_code == OpCodes.SET_IMG_PROCESSOR_MODE:
|
if op_code == OpCode.SET_IMG_PROCESSOR_MODE:
|
||||||
q.add_log_cmd(Info.SET_IMG_PROCESSOR_MODE)
|
q.add_log_cmd(Info.SET_IMG_PROCESSOR_MODE)
|
||||||
json_file = get_config_file()
|
json_file = get_config_file()
|
||||||
data = (
|
data = (
|
||||||
@ -639,7 +642,7 @@ def pack_star_tracker_commands( # noqa C901
|
|||||||
+ bytearray(json_file, "utf-8")
|
+ bytearray(json_file, "utf-8")
|
||||||
)
|
)
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
||||||
if op_code == OpCodes.FW_UPDATE:
|
if op_code == OpCode.FW_UPDATE:
|
||||||
q.add_log_cmd(Info.FW_UPDATE)
|
q.add_log_cmd(Info.FW_UPDATE)
|
||||||
firmware = get_firmware()
|
firmware = get_firmware()
|
||||||
data = (
|
data = (
|
||||||
@ -648,7 +651,7 @@ def pack_star_tracker_commands( # noqa C901
|
|||||||
+ firmware.encode()
|
+ firmware.encode()
|
||||||
)
|
)
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
||||||
if op_code == OpCodes.ADD_SECONDARY_TM_TO_NORMAL_MODE:
|
if op_code == OpCode.ADD_SECONDARY_TM_TO_NORMAL_MODE:
|
||||||
q.add_log_cmd(Info.ADD_SECONDARY_TM_TO_NORMAL_MODE)
|
q.add_log_cmd(Info.ADD_SECONDARY_TM_TO_NORMAL_MODE)
|
||||||
for val in SetId:
|
for val in SetId:
|
||||||
print("{:<2}: {:<20}".format(val, val.name))
|
print("{:<2}: {:<20}".format(val, val.name))
|
||||||
@ -660,7 +663,7 @@ def pack_star_tracker_commands( # noqa C901
|
|||||||
struct.pack("!I", set_id),
|
struct.pack("!I", set_id),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if op_code == OpCodes.RESET_SECONDARY_TM_SET:
|
if op_code == OpCode.RESET_SECONDARY_TM_SET:
|
||||||
q.add_log_cmd(Info.RESET_SECONDARY_TM_SET)
|
q.add_log_cmd(Info.RESET_SECONDARY_TM_SET)
|
||||||
q.add_pus_tc(
|
q.add_pus_tc(
|
||||||
create_action_cmd(
|
create_action_cmd(
|
||||||
@ -668,13 +671,18 @@ def pack_star_tracker_commands( # noqa C901
|
|||||||
StarTrackerActionId.RESET_SECONDARY_TM_SET,
|
StarTrackerActionId.RESET_SECONDARY_TM_SET,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if op_code == OpCodes.READ_SECONDARY_TM_SET:
|
if op_code == OpCode.READ_SECONDARY_TM_SET:
|
||||||
q.add_log_cmd(Info.READ_SECONDARY_TM_SET)
|
q.add_log_cmd(Info.READ_SECONDARY_TM_SET)
|
||||||
q.add_pus_tc(
|
q.add_pus_tc(
|
||||||
create_action_cmd(
|
create_action_cmd(
|
||||||
STAR_TRACKER_ID, StarTrackerActionId.READ_SECONDARY_TM_SET
|
STAR_TRACKER_ID, StarTrackerActionId.READ_SECONDARY_TM_SET
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
if op_code == OpCode.RELOAD_JSON_CFG_FILE:
|
||||||
|
q.add_log_cmd(Info.RELOAD_JSON_CFG_FILE)
|
||||||
|
q.add_pus_tc(
|
||||||
|
create_action_cmd(STAR_TRACKER_ID, StarTrackerActionId.RELOAD_JSON_CFG_FILE)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def request_dataset(q: DefaultPusQueueHelper, req_type: DataSetRequest):
|
def request_dataset(q: DefaultPusQueueHelper, req_type: DataSetRequest):
|
||||||
@ -1150,23 +1158,24 @@ def handle_read_secondary_tm_set(pw: PrintWrapper, custom_data: bytes):
|
|||||||
@tmtc_definitions_provider
|
@tmtc_definitions_provider
|
||||||
def add_str_cmds(defs: TmtcDefinitionWrapper):
|
def add_str_cmds(defs: TmtcDefinitionWrapper):
|
||||||
oce = OpCodeEntry()
|
oce = OpCodeEntry()
|
||||||
oce.add(OpCodes.ON_BOOTLOADER, "Mode On, Submode Bootloader")
|
oce.add(OpCode.ON_BOOTLOADER, "Mode On, Submode Bootloader")
|
||||||
oce.add(OpCodes.ON_FIRMWARE, "Mode On, Submode Firmware")
|
oce.add(OpCode.ON_FIRMWARE, "Mode On, Submode Firmware")
|
||||||
oce.add(OpCodes.NORMAL, "Mode Normal")
|
oce.add(OpCode.NORMAL, "Mode Normal")
|
||||||
oce.add(OpCodes.OFF, "Mode Off")
|
oce.add(OpCode.OFF, "Mode Off")
|
||||||
oce.add(OpCodes.PING, "Star Tracker: Ping")
|
oce.add(OpCode.PING, "Star Tracker: Ping")
|
||||||
oce.add(OpCodes.TAKE_IMAGE, "Take Image")
|
oce.add(OpCode.TAKE_IMAGE, "Take Image")
|
||||||
oce.add(OpCodes.UPLOAD_IMAGE, Info.UPLOAD_IMAGE)
|
oce.add(OpCode.UPLOAD_IMAGE, Info.UPLOAD_IMAGE)
|
||||||
oce.add(OpCodes.DOWNLOAD_IMAGE, Info.DOWNLOAD_IMAGE)
|
oce.add(OpCode.DOWNLOAD_IMAGE, Info.DOWNLOAD_IMAGE)
|
||||||
oce.add(OpCodes.ONE_SHOOT_HK, Info.ONE_SHOOT_HK)
|
oce.add(OpCode.ONE_SHOOT_HK, Info.ONE_SHOOT_HK)
|
||||||
oce.add(OpCodes.ENABLE_HK, Info.ENABLE_HK)
|
oce.add(OpCode.ENABLE_HK, Info.ENABLE_HK)
|
||||||
oce.add(OpCodes.DISABLE_HK, Info.DISABLE_HK)
|
oce.add(OpCode.DISABLE_HK, Info.DISABLE_HK)
|
||||||
oce.add(OpCodes.SET_IMG_PROCESSOR_MODE, Info.SET_IMG_PROCESSOR_MODE)
|
oce.add(OpCode.SET_IMG_PROCESSOR_MODE, Info.SET_IMG_PROCESSOR_MODE)
|
||||||
oce.add(
|
oce.add(
|
||||||
OpCodes.ADD_SECONDARY_TM_TO_NORMAL_MODE, Info.ADD_SECONDARY_TM_TO_NORMAL_MODE
|
OpCode.ADD_SECONDARY_TM_TO_NORMAL_MODE, Info.ADD_SECONDARY_TM_TO_NORMAL_MODE
|
||||||
)
|
)
|
||||||
oce.add(OpCodes.READ_SECONDARY_TM_SET, Info.READ_SECONDARY_TM_SET)
|
oce.add(OpCode.READ_SECONDARY_TM_SET, Info.READ_SECONDARY_TM_SET)
|
||||||
oce.add(OpCodes.RESET_SECONDARY_TM_SET, Info.RESET_SECONDARY_TM_SET)
|
oce.add(OpCode.RESET_SECONDARY_TM_SET, Info.RESET_SECONDARY_TM_SET)
|
||||||
oce.add(OpCodes.FW_UPDATE, Info.FW_UPDATE)
|
oce.add(OpCode.FW_UPDATE, Info.FW_UPDATE)
|
||||||
oce.add(OpCodes.SET_TIME_FROM_SYS_TIME, Info.SET_TIME_FROM_SYS_TIME)
|
oce.add(OpCode.SET_TIME_FROM_SYS_TIME, Info.SET_TIME_FROM_SYS_TIME)
|
||||||
|
oce.add(OpCode.RELOAD_JSON_CFG_FILE, Info.RELOAD_JSON_CFG_FILE)
|
||||||
defs.add_service(CustomServiceList.STAR_TRACKER.value, "Star Tracker", oce)
|
defs.add_service(CustomServiceList.STAR_TRACKER.value, "Star Tracker", oce)
|
||||||
|
@ -5,22 +5,25 @@ import struct
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Tuple
|
from typing import Tuple
|
||||||
|
|
||||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
|
||||||
|
|
||||||
from eive_tmtc.config.definitions import CustomServiceList
|
|
||||||
from spacepackets.ecss import PusTelecommand
|
from spacepackets.ecss import PusTelecommand
|
||||||
from tmtccmd.config import TmtcDefinitionWrapper
|
from tmtccmd.config import TmtcDefinitionWrapper
|
||||||
|
|
||||||
from tmtccmd.tmtc import DefaultPusQueueHelper
|
|
||||||
from tmtccmd.pus.s8_fsfw_action import create_action_cmd
|
|
||||||
from tmtccmd.pus.tc.s3_fsfw_hk import make_sid, generate_one_hk_command
|
|
||||||
from tmtccmd.pus.s20_fsfw_param import (
|
|
||||||
create_scalar_u8_parameter,
|
|
||||||
create_load_param_cmd,
|
|
||||||
)
|
|
||||||
from tmtccmd.config.tmtc import OpCodeEntry, tmtc_definitions_provider
|
from tmtccmd.config.tmtc import OpCodeEntry, tmtc_definitions_provider
|
||||||
from eive_tmtc.config.object_ids import CORE_CONTROLLER_ID
|
|
||||||
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
|
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
|
||||||
|
from tmtccmd.pus.s8_fsfw_action import create_action_cmd
|
||||||
|
from tmtccmd.pus.s11_tc_sched import (
|
||||||
|
create_enable_tc_sched_cmd,
|
||||||
|
create_disable_tc_sched_cmd,
|
||||||
|
)
|
||||||
|
from tmtccmd.pus.s20_fsfw_param import (
|
||||||
|
create_load_param_cmd,
|
||||||
|
create_scalar_u8_parameter,
|
||||||
|
)
|
||||||
|
from tmtccmd.pus.tc.s3_fsfw_hk import generate_one_hk_command, make_sid
|
||||||
|
from tmtccmd.tmtc import DefaultPusQueueHelper
|
||||||
|
|
||||||
|
from eive_tmtc.config.definitions import CustomServiceList
|
||||||
|
from eive_tmtc.config.object_ids import CORE_CONTROLLER_ID
|
||||||
|
from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -66,6 +69,7 @@ class ActionId(enum.IntEnum):
|
|||||||
MV_HELPER = 53
|
MV_HELPER = 53
|
||||||
RM_HELPER = 54
|
RM_HELPER = 54
|
||||||
MKDIR_HELPER = 55
|
MKDIR_HELPER = 55
|
||||||
|
ENABLE_SCHEDULER = 56
|
||||||
|
|
||||||
|
|
||||||
class ParamId(enum.IntEnum):
|
class ParamId(enum.IntEnum):
|
||||||
@ -115,6 +119,8 @@ class OpCode:
|
|||||||
RWD_SET_MAX_REBOOT_CNT = "rwd_max_cnt"
|
RWD_SET_MAX_REBOOT_CNT = "rwd_max_cnt"
|
||||||
AUTO_SWITCH_ENABLE = "auto_switch_enable"
|
AUTO_SWITCH_ENABLE = "auto_switch_enable"
|
||||||
AUTO_SWITCH_DISABLE = "auto_switch_disable"
|
AUTO_SWITCH_DISABLE = "auto_switch_disable"
|
||||||
|
ENABLE_SCHEDULER = "enable_scheduler"
|
||||||
|
DISABLE_SCHEDULER = "disable_scheduler"
|
||||||
|
|
||||||
|
|
||||||
class Info:
|
class Info:
|
||||||
@ -142,6 +148,8 @@ class Info:
|
|||||||
MKDIR_HELPER = "Filesystem Directory Creation Helper"
|
MKDIR_HELPER = "Filesystem Directory Creation Helper"
|
||||||
AUTO_SWITCH_ENABLE = "Enable Auto-Switch Feature with a specific target image"
|
AUTO_SWITCH_ENABLE = "Enable Auto-Switch Feature with a specific target image"
|
||||||
AUTO_SWITCH_DISABLE = "Disable Auto-Switch Feature"
|
AUTO_SWITCH_DISABLE = "Disable Auto-Switch Feature"
|
||||||
|
ENABLE_SCHEDULER = "Enable scheduler"
|
||||||
|
DISABLE_SCHEDULER = "Disable scheduler"
|
||||||
|
|
||||||
|
|
||||||
class Chip(enum.IntEnum):
|
class Chip(enum.IntEnum):
|
||||||
@ -241,6 +249,8 @@ def add_core_controller_definitions(defs: TmtcDefinitionWrapper):
|
|||||||
oce.add(keys=OpCode.CP_HELPER, info=Info.CP_HELPER)
|
oce.add(keys=OpCode.CP_HELPER, info=Info.CP_HELPER)
|
||||||
oce.add(keys=OpCode.RM_HELPER, info=Info.RM_HELPER)
|
oce.add(keys=OpCode.RM_HELPER, info=Info.RM_HELPER)
|
||||||
oce.add(keys=OpCode.MKDIR_HELPER, info=Info.MKDIR_HELPER)
|
oce.add(keys=OpCode.MKDIR_HELPER, info=Info.MKDIR_HELPER)
|
||||||
|
oce.add(keys=OpCode.ENABLE_SCHEDULER, info=Info.ENABLE_SCHEDULER)
|
||||||
|
oce.add(keys=OpCode.DISABLE_SCHEDULER, info=Info.DISABLE_SCHEDULER)
|
||||||
defs.add_service(CustomServiceList.CORE.value, "Core Controller", oce)
|
defs.add_service(CustomServiceList.CORE.value, "Core Controller", oce)
|
||||||
|
|
||||||
|
|
||||||
@ -514,6 +524,12 @@ def pack_core_commands( # noqa C901
|
|||||||
q.add_pus_tc(
|
q.add_pus_tc(
|
||||||
create_action_cmd(CORE_CONTROLLER_ID, ActionId.MKDIR_HELPER, user_data)
|
create_action_cmd(CORE_CONTROLLER_ID, ActionId.MKDIR_HELPER, user_data)
|
||||||
)
|
)
|
||||||
|
elif op_code == OpCode.ENABLE_SCHEDULER:
|
||||||
|
q.add_log_cmd(Info.ENABLE_SCHEDULER)
|
||||||
|
q.add_pus_tc(create_enable_tc_sched_cmd())
|
||||||
|
elif op_code == OpCode.DISABLE_SCHEDULER:
|
||||||
|
q.add_log_cmd(Info.DISABLE_SCHEDULER)
|
||||||
|
q.add_pus_tc(create_disable_tc_sched_cmd())
|
||||||
else:
|
else:
|
||||||
_LOGGER.warning(
|
_LOGGER.warning(
|
||||||
f"Unknown operation code {op_code} for core controller commands"
|
f"Unknown operation code {op_code} for core controller commands"
|
||||||
|
@ -4,6 +4,7 @@ from eive_tmtc.config.object_ids import (
|
|||||||
GPS_0_HEALTH_DEV,
|
GPS_0_HEALTH_DEV,
|
||||||
GYRO_0_ADIS_HANDLER_ID,
|
GYRO_0_ADIS_HANDLER_ID,
|
||||||
GYRO_1_L3G_HANDLER_ID,
|
GYRO_1_L3G_HANDLER_ID,
|
||||||
|
GYRO_2_ADIS_HANDLER_ID,
|
||||||
ACS_BOARD_ASS_ID,
|
ACS_BOARD_ASS_ID,
|
||||||
RW_ASSEMBLY,
|
RW_ASSEMBLY,
|
||||||
SUS_BOARD_ASS_ID,
|
SUS_BOARD_ASS_ID,
|
||||||
@ -38,14 +39,15 @@ ACS_OBJ_DICT = {
|
|||||||
5: ("iMTQ MGT", IMTQ_HANDLER_ID),
|
5: ("iMTQ MGT", IMTQ_HANDLER_ID),
|
||||||
6: ("GYR 0 ADIS", GYRO_0_ADIS_HANDLER_ID),
|
6: ("GYR 0 ADIS", GYRO_0_ADIS_HANDLER_ID),
|
||||||
7: ("GYR 1 L3G", GYRO_1_L3G_HANDLER_ID),
|
7: ("GYR 1 L3G", GYRO_1_L3G_HANDLER_ID),
|
||||||
8: ("MGM 0 LIS3", MGM_0_LIS3_HANDLER_ID),
|
8: ("GYR 2 ADIS", GYRO_2_ADIS_HANDLER_ID),
|
||||||
9: ("MGM 1 RM3100", MGM_1_RM3100_HANDLER_ID),
|
9: ("MGM 0 LIS3", MGM_0_LIS3_HANDLER_ID),
|
||||||
10: ("GPS 0 Health Device", GPS_0_HEALTH_DEV),
|
10: ("MGM 1 RM3100", MGM_1_RM3100_HANDLER_ID),
|
||||||
11: ("SUS 0", SUS_0_N_LOC_XFYFZM_PT_XF),
|
11: ("GPS 0 Health Device", GPS_0_HEALTH_DEV),
|
||||||
12: ("SUS 6", SUS_6_R_LOC_XFYBZM_PT_XF),
|
12: ("SUS 0", SUS_0_N_LOC_XFYFZM_PT_XF),
|
||||||
13: ("RW 1", RW1_ID),
|
13: ("SUS 6", SUS_6_R_LOC_XFYBZM_PT_XF),
|
||||||
14: ("RW 2", RW2_ID),
|
14: ("RW 1", RW1_ID),
|
||||||
15: ("STR", STAR_TRACKER_ID),
|
15: ("RW 2", RW2_ID),
|
||||||
|
16: ("STR", STAR_TRACKER_ID),
|
||||||
}
|
}
|
||||||
|
|
||||||
TCS_OBJ_DICT = {
|
TCS_OBJ_DICT = {
|
||||||
|
@ -24,6 +24,7 @@ from tmtccmd.tmtc import service_provider
|
|||||||
from tmtccmd.tmtc.decorator import ServiceProviderParams
|
from tmtccmd.tmtc.decorator import ServiceProviderParams
|
||||||
from eive_tmtc.utility.input_helper import InputHelper
|
from eive_tmtc.utility.input_helper import InputHelper
|
||||||
from tmtccmd.pus.s200_fsfw_mode import pack_mode_data, Mode
|
from tmtccmd.pus.s200_fsfw_mode import pack_mode_data, Mode
|
||||||
|
from tmtccmd.pus.s20_fsfw_param import create_load_param_cmd, create_scalar_u8_parameter
|
||||||
from tmtccmd.pus.s8_fsfw_action import create_action_cmd
|
from tmtccmd.pus.s8_fsfw_action import create_action_cmd
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
@ -93,6 +94,10 @@ class ActionId(enum.IntEnum):
|
|||||||
TC_FLASH_READ_FULL_FILE = 30
|
TC_FLASH_READ_FULL_FILE = 30
|
||||||
|
|
||||||
|
|
||||||
|
class ParamId(enum.IntEnum):
|
||||||
|
PLOC_SUPV_CMD_TO_ON = 1
|
||||||
|
|
||||||
|
|
||||||
class OpCode:
|
class OpCode:
|
||||||
ON = "on"
|
ON = "on"
|
||||||
OFF = "off"
|
OFF = "off"
|
||||||
@ -115,6 +120,8 @@ class OpCode:
|
|||||||
SIMPLEX_SEND_FILE = "simplex_send_file"
|
SIMPLEX_SEND_FILE = "simplex_send_file"
|
||||||
DOWNLINK_DATA_MODULATE = "downlink_data_modulate"
|
DOWNLINK_DATA_MODULATE = "downlink_data_modulate"
|
||||||
MODE_SNAPSHOT = "mode_snapshot"
|
MODE_SNAPSHOT = "mode_snapshot"
|
||||||
|
ENABLE_PLOC_SUPV_COMMANDING_TO_ON = "enable_ploc_supv_cmd_to_on"
|
||||||
|
DISABLE_PLOC_SUPV_COMMANDING_TO_ON = "disable_ploc_supv_cmd_to_on"
|
||||||
|
|
||||||
|
|
||||||
class Info:
|
class Info:
|
||||||
@ -137,6 +144,10 @@ class Info:
|
|||||||
FLASH_GET_DIR_CONTENT = "Get flash directory content on MPSoC"
|
FLASH_GET_DIR_CONTENT = "Get flash directory content on MPSoC"
|
||||||
DOWNLINK_DATA_MODULATE = "Downlink data modulate"
|
DOWNLINK_DATA_MODULATE = "Downlink data modulate"
|
||||||
MODE_SNAPSHOT = "Mode Snapshot"
|
MODE_SNAPSHOT = "Mode Snapshot"
|
||||||
|
ENABLE_PLOC_SUPV_COMMANDING_TO_ON = "Enable PLOC SUPV commanding when switching ON"
|
||||||
|
DISABLE_PLOC_SUPV_COMMANDING_TO_ON = (
|
||||||
|
"Disable PLOC SUPV commanding when switching ON"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class MemAddresses(enum.IntEnum):
|
class MemAddresses(enum.IntEnum):
|
||||||
@ -171,6 +182,13 @@ def add_ploc_mpsoc_cmds(defs: TmtcDefinitionWrapper):
|
|||||||
oce.add(OpCode.SIMPLEX_SEND_FILE, Info.SIMPLEX_SEND_FILE)
|
oce.add(OpCode.SIMPLEX_SEND_FILE, Info.SIMPLEX_SEND_FILE)
|
||||||
oce.add(OpCode.DOWNLINK_DATA_MODULATE, Info.DOWNLINK_DATA_MODULATE)
|
oce.add(OpCode.DOWNLINK_DATA_MODULATE, Info.DOWNLINK_DATA_MODULATE)
|
||||||
oce.add(OpCode.MODE_SNAPSHOT, Info.MODE_SNAPSHOT)
|
oce.add(OpCode.MODE_SNAPSHOT, Info.MODE_SNAPSHOT)
|
||||||
|
oce.add(
|
||||||
|
OpCode.ENABLE_PLOC_SUPV_COMMANDING_TO_ON, Info.ENABLE_PLOC_SUPV_COMMANDING_TO_ON
|
||||||
|
)
|
||||||
|
oce.add(
|
||||||
|
OpCode.DISABLE_PLOC_SUPV_COMMANDING_TO_ON,
|
||||||
|
Info.DISABLE_PLOC_SUPV_COMMANDING_TO_ON,
|
||||||
|
)
|
||||||
defs.add_service(CustomServiceList.PLOC_MPSOC.value, "Ploc MPSoC", oce)
|
defs.add_service(CustomServiceList.PLOC_MPSOC.value, "Ploc MPSoC", oce)
|
||||||
|
|
||||||
|
|
||||||
@ -179,6 +197,7 @@ def pack_ploc_mpsoc_commands( # noqa C901
|
|||||||
p: ServiceProviderParams,
|
p: ServiceProviderParams,
|
||||||
): # noqa C901: Complexity okay here.
|
): # noqa C901: Complexity okay here.
|
||||||
object_id = get_object_ids().get(PLOC_MPSOC_ID)
|
object_id = get_object_ids().get(PLOC_MPSOC_ID)
|
||||||
|
assert object_id is not None
|
||||||
q = p.queue_helper
|
q = p.queue_helper
|
||||||
prefix = "PLOC MPSoC"
|
prefix = "PLOC MPSoC"
|
||||||
op_code = p.op_code
|
op_code = p.op_code
|
||||||
@ -313,6 +332,24 @@ def pack_ploc_mpsoc_commands( # noqa C901
|
|||||||
q.add_log_cmd("PLOC MPSoC: Mode snapshot")
|
q.add_log_cmd("PLOC MPSoC: Mode snapshot")
|
||||||
data = object_id.as_bytes + struct.pack("!I", ActionId.TC_MODE_SNAPSHOT)
|
data = object_id.as_bytes + struct.pack("!I", ActionId.TC_MODE_SNAPSHOT)
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
||||||
|
if op_code == OpCode.ENABLE_PLOC_SUPV_COMMANDING_TO_ON:
|
||||||
|
q.add_log_cmd(Info.ENABLE_PLOC_SUPV_COMMANDING_TO_ON)
|
||||||
|
q.add_pus_tc(
|
||||||
|
create_load_param_cmd(
|
||||||
|
create_scalar_u8_parameter(
|
||||||
|
object_id.as_bytes, 0, ParamId.PLOC_SUPV_CMD_TO_ON, 0
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
if op_code == OpCode.DISABLE_PLOC_SUPV_COMMANDING_TO_ON:
|
||||||
|
q.add_log_cmd(Info.DISABLE_PLOC_SUPV_COMMANDING_TO_ON)
|
||||||
|
q.add_pus_tc(
|
||||||
|
create_load_param_cmd(
|
||||||
|
create_scalar_u8_parameter(
|
||||||
|
object_id.as_bytes, 0, ParamId.PLOC_SUPV_CMD_TO_ON, 1
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def generate_write_mem_command(
|
def generate_write_mem_command(
|
||||||
|
@ -10,23 +10,24 @@ import enum
|
|||||||
import logging
|
import logging
|
||||||
import struct
|
import struct
|
||||||
|
|
||||||
from eive_tmtc.config.object_ids import PLOC_SUPV_ID, get_object_ids
|
|
||||||
from eive_tmtc.config.definitions import CustomServiceList
|
|
||||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
|
||||||
from spacepackets.ecss.tc import PusTelecommand
|
from spacepackets.ecss.tc import PusTelecommand
|
||||||
from tmtccmd.pus.tc.s3_fsfw_hk import generate_one_hk_command, make_sid
|
|
||||||
from tmtccmd.config import TmtcDefinitionWrapper
|
from tmtccmd.config import TmtcDefinitionWrapper
|
||||||
from tmtccmd.config.tmtc import tmtc_definitions_provider, OpCodeEntry
|
from tmtccmd.config.tmtc import OpCodeEntry, tmtc_definitions_provider
|
||||||
|
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
|
||||||
|
from tmtccmd.pus.s8_fsfw_action import create_action_cmd
|
||||||
|
from tmtccmd.pus.s200_fsfw_mode import Mode, pack_mode_data
|
||||||
|
from tmtccmd.pus.tc.s3_fsfw_hk import generate_one_hk_command, make_sid
|
||||||
from tmtccmd.tmtc import service_provider
|
from tmtccmd.tmtc import service_provider
|
||||||
from tmtccmd.tmtc.decorator import ServiceProviderParams
|
from tmtccmd.tmtc.decorator import ServiceProviderParams
|
||||||
from tmtccmd.pus.s200_fsfw_mode import pack_mode_data, Mode
|
|
||||||
from tmtccmd.pus.s8_fsfw_action import create_action_cmd
|
from eive_tmtc.config.definitions import CustomServiceList
|
||||||
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
|
from eive_tmtc.config.object_ids import PLOC_SUPV_ID, get_object_ids
|
||||||
|
from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||||
from eive_tmtc.utility.input_helper import InputHelper
|
from eive_tmtc.utility.input_helper import InputHelper
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
latchup_id_dict = {
|
LATCHUP_ID_DICT = {
|
||||||
"0": "0.85V",
|
"0": "0.85V",
|
||||||
"1": "1.8V",
|
"1": "1.8V",
|
||||||
"2": "MISC",
|
"2": "MISC",
|
||||||
@ -40,25 +41,13 @@ HARDCODED = "0"
|
|||||||
MANUAL_INPUT = "1"
|
MANUAL_INPUT = "1"
|
||||||
HARDCODED_FILE = "/home/rmueller/EIVE/mpsoc_boot.bin"
|
HARDCODED_FILE = "/home/rmueller/EIVE/mpsoc_boot.bin"
|
||||||
|
|
||||||
update_file_dict = {
|
UPDATE_FILE_DICT = {
|
||||||
HARDCODED: ["hardcoded", ""],
|
HARDCODED: ["hardcoded", ""],
|
||||||
MANUAL_INPUT: ["manual input", ""],
|
MANUAL_INPUT: ["manual input", ""],
|
||||||
"2": ["/mnt/sd0/ploc/supervisor/update.bin", "/mnt/sd0/ploc/supervisor/update.bin"],
|
"2": ["/mnt/sd0/ploc/mpsoc/image.bin", "/mnt/sd0/ploc/mpsoc/image.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 = {
|
EVENT_BUFFER_PATH_DICT = {
|
||||||
MANUAL_INPUT: ["manual input", ""],
|
MANUAL_INPUT: ["manual input", ""],
|
||||||
"2": ["/mnt/sd0/ploc/supervisor", "/mnt/sd0/ploc/supervisor"],
|
"2": ["/mnt/sd0/ploc/supervisor", "/mnt/sd0/ploc/supervisor"],
|
||||||
}
|
}
|
||||||
@ -84,7 +73,7 @@ FACTORY_RESET_OPS = {
|
|||||||
|
|
||||||
|
|
||||||
class SupvActionId(enum.IntEnum):
|
class SupvActionId(enum.IntEnum):
|
||||||
HK_REPORT = 1
|
REQUEST_HK_REPORT = 1
|
||||||
START_MPSOC = 3
|
START_MPSOC = 3
|
||||||
SHUTWOWN_MPSOC = 4
|
SHUTWOWN_MPSOC = 4
|
||||||
SEL_MPSOC_BOOT_IMAGE = 5
|
SEL_MPSOC_BOOT_IMAGE = 5
|
||||||
@ -111,7 +100,7 @@ class SupvActionId(enum.IntEnum):
|
|||||||
SET_GPIO = 34
|
SET_GPIO = 34
|
||||||
READ_GPIO = 35
|
READ_GPIO = 35
|
||||||
RESTART_SUPERVISOR = 36
|
RESTART_SUPERVISOR = 36
|
||||||
LOGGING_REQUEST_COUNTERS = 38
|
REQUEST_LOGGING_COUNTERS = 38
|
||||||
FACTORY_RESET = 39
|
FACTORY_RESET = 39
|
||||||
START_MPSOC_QUIET = 45
|
START_MPSOC_QUIET = 45
|
||||||
SET_SHUTDOWN_TIMEOUT = 46
|
SET_SHUTDOWN_TIMEOUT = 46
|
||||||
@ -130,27 +119,32 @@ class SupvActionId(enum.IntEnum):
|
|||||||
MEM_CHECK = 61
|
MEM_CHECK = 61
|
||||||
|
|
||||||
|
|
||||||
class SetIds(enum.IntEnum):
|
class SetId(enum.IntEnum):
|
||||||
HK_REPORT = 102
|
HK_REPORT = 102
|
||||||
BOOT_STATUS_REPORT = 103
|
BOOT_STATUS_REPORT = 103
|
||||||
|
LATCHUP_REPORT = 104
|
||||||
|
COUNTERS_REPORT = 105
|
||||||
|
ADC_REPORT = 106
|
||||||
|
UPDATE_STATUS_REPORT = 107
|
||||||
|
|
||||||
|
|
||||||
class OpCodes:
|
class OpCode:
|
||||||
OFF = ["0", "off"]
|
OFF = "off"
|
||||||
ON = ["1", "on"]
|
ON = "on"
|
||||||
NORMAL = ["2", "nml"]
|
NORMAL = "nml"
|
||||||
HK_TO_OBC = ["3", "hk_to_obc"]
|
HK_TO_OBC = "hk_to_obc"
|
||||||
REQUEST_HK = ["4", "req_hk"]
|
REQUEST_HK_SET_FROM_DEV = "req_hk_from_dev"
|
||||||
START_MPSOC = ["5", "start_mpsoc"]
|
REQUEST_HK_SET = "req_hk"
|
||||||
SHUTDOWN_MPSOC = ["6", "stop_mpsoc"]
|
START_MPSOC = "start_mpsoc"
|
||||||
SEL_NVM = ["7", "sel_nvm"]
|
SHUTDOWN_MPSOC = "stop_mpsoc"
|
||||||
SET_TIME_REF = ["set_time_ref"]
|
SEL_NVM = "sel_nvm"
|
||||||
FACTORY_FLASH = ["factory_flash"]
|
SET_TIME_REF = "set_time_ref"
|
||||||
REQ_BOOT_STATUS_REPORT = ["13", "boot_report"]
|
FACTORY_FLASH = "factory_flash"
|
||||||
START_UPDATE = ["42", "start_update"]
|
REQ_BOOT_STATUS_REPORT = "boot_report"
|
||||||
PERFORM_UPDATE = ["update"]
|
START_UPDATE = "start_update"
|
||||||
FACTORY_RESET = ["factory_reset"]
|
PERFORM_UPDATE = "update"
|
||||||
MEM_CHECK = ["mem_check"]
|
FACTORY_RESET = "factory_reset"
|
||||||
|
MEM_CHECK = "mem_check"
|
||||||
RESET_MPSOC = "reset_mpsoc"
|
RESET_MPSOC = "reset_mpsoc"
|
||||||
|
|
||||||
|
|
||||||
@ -160,7 +154,8 @@ class Info(str, enum.Enum):
|
|||||||
ON = "Switch On"
|
ON = "Switch On"
|
||||||
NML = "Switch Normal"
|
NML = "Switch Normal"
|
||||||
HK_TO_OBC = "Request HK from PLOC SUPV"
|
HK_TO_OBC = "Request HK from PLOC SUPV"
|
||||||
REQUEST_HK = "Request HK set from PLOC Handler"
|
REQUEST_HK_SET_FROM_DEV = "Request HK set from the device to the PLOC Handler"
|
||||||
|
REQUEST_HK_SET = "Request HK set from PLOC Handler"
|
||||||
SET_TIME_REF = "Set time reference"
|
SET_TIME_REF = "Set time reference"
|
||||||
FACTORY_FLASH = "Factory Flash Mode"
|
FACTORY_FLASH = "Factory Flash Mode"
|
||||||
PERFORM_UPDATE = "Start or continue MPSoC SW update at starting bytes"
|
PERFORM_UPDATE = "Start or continue MPSoC SW update at starting bytes"
|
||||||
@ -175,21 +170,22 @@ class Info(str, enum.Enum):
|
|||||||
@tmtc_definitions_provider
|
@tmtc_definitions_provider
|
||||||
def add_ploc_supv_cmds(defs: TmtcDefinitionWrapper):
|
def add_ploc_supv_cmds(defs: TmtcDefinitionWrapper):
|
||||||
oce = OpCodeEntry()
|
oce = OpCodeEntry()
|
||||||
oce.add(OpCodes.OFF, Info.OFF)
|
oce.add(OpCode.OFF, Info.OFF)
|
||||||
oce.add(OpCodes.ON, Info.ON)
|
oce.add(OpCode.ON, Info.ON)
|
||||||
oce.add(OpCodes.NORMAL, Info.NML)
|
oce.add(OpCode.NORMAL, Info.NML)
|
||||||
oce.add(OpCodes.HK_TO_OBC, Info.HK_TO_OBC)
|
oce.add(OpCode.HK_TO_OBC, Info.HK_TO_OBC)
|
||||||
oce.add(OpCodes.REQUEST_HK, Info.REQUEST_HK)
|
oce.add(OpCode.REQUEST_HK_SET, Info.REQUEST_HK_SET)
|
||||||
oce.add(OpCodes.START_MPSOC, "PLOC Supervisor: Start MPSoC")
|
oce.add(OpCode.REQUEST_HK_SET_FROM_DEV, Info.REQUEST_HK_SET_FROM_DEV)
|
||||||
oce.add(OpCodes.SHUTDOWN_MPSOC, "PLOC Supervisor: Shutdown MPSoC")
|
oce.add(OpCode.START_MPSOC, "PLOC Supervisor: Start MPSoC")
|
||||||
oce.add(OpCodes.SEL_NVM, Info.SEL_NVM)
|
oce.add(OpCode.SHUTDOWN_MPSOC, "PLOC Supervisor: Shutdown MPSoC")
|
||||||
oce.add(OpCodes.SET_TIME_REF, Info.SET_TIME_REF)
|
oce.add(OpCode.SEL_NVM, Info.SEL_NVM)
|
||||||
oce.add(OpCodes.FACTORY_RESET, Info.FACTORY_RESET)
|
oce.add(OpCode.SET_TIME_REF, Info.SET_TIME_REF)
|
||||||
oce.add(OpCodes.RESET_MPSOC, Info.RESET_MPSOC)
|
oce.add(OpCode.FACTORY_RESET, Info.FACTORY_RESET)
|
||||||
|
oce.add(OpCode.RESET_MPSOC, Info.RESET_MPSOC)
|
||||||
oce.add("8", "PLOC Supervisor: Set max restart tries")
|
oce.add("8", "PLOC Supervisor: Set max restart tries")
|
||||||
oce.add("11", "PLOC Supervisor: Set boot timeout")
|
oce.add("11", "PLOC Supervisor: Set boot timeout")
|
||||||
oce.add("12", "PLOC Supervisor: Disable Hk")
|
oce.add("12", "PLOC Supervisor: Disable Hk")
|
||||||
oce.add(OpCodes.REQ_BOOT_STATUS_REPORT, Info.REQ_BOOT_STATUS_REPORT)
|
oce.add(OpCode.REQ_BOOT_STATUS_REPORT, Info.REQ_BOOT_STATUS_REPORT)
|
||||||
oce.add("17", "PLOC Supervisor: Enable latchup alert")
|
oce.add("17", "PLOC Supervisor: Enable latchup alert")
|
||||||
oce.add("18", "PLOC Supervisor: Disable latchup alert")
|
oce.add("18", "PLOC Supervisor: Disable latchup alert")
|
||||||
oce.add("20", "PLOC Supervisor: Set alert limit")
|
oce.add("20", "PLOC Supervisor: Set alert limit")
|
||||||
@ -203,12 +199,12 @@ def add_ploc_supv_cmds(defs: TmtcDefinitionWrapper):
|
|||||||
oce.add("35", "PLOC Supervisor: Set GPIO")
|
oce.add("35", "PLOC Supervisor: Set GPIO")
|
||||||
oce.add("36", "PLOC Supervisor: Read GPIO")
|
oce.add("36", "PLOC Supervisor: Read GPIO")
|
||||||
oce.add("37", "PLOC Supervisor: Restart supervisor")
|
oce.add("37", "PLOC Supervisor: Restart supervisor")
|
||||||
oce.add(OpCodes.PERFORM_UPDATE, Info.PERFORM_UPDATE)
|
oce.add(OpCode.PERFORM_UPDATE, Info.PERFORM_UPDATE)
|
||||||
oce.add(OpCodes.START_UPDATE, Info.START_UPDATE)
|
oce.add(OpCode.START_UPDATE, Info.START_UPDATE)
|
||||||
oce.add("43", "PLOC Supervisor: Terminate supervisor process")
|
oce.add("43", "PLOC Supervisor: Terminate supervisor process")
|
||||||
oce.add("44", "PLOC Supervisor: Start MPSoC quiet")
|
oce.add("44", "PLOC Supervisor: Start MPSoC quiet")
|
||||||
oce.add("45", "PLOC Supervisor: Set shutdown timeout")
|
oce.add("45", "PLOC Supervisor: Set shutdown timeout")
|
||||||
oce.add(OpCodes.FACTORY_FLASH, Info.FACTORY_FLASH)
|
oce.add(OpCode.FACTORY_FLASH, Info.FACTORY_FLASH)
|
||||||
oce.add("47", "PLOC Supervisor: Enable auto TM")
|
oce.add("47", "PLOC Supervisor: Enable auto TM")
|
||||||
oce.add("48", "PLOC Supervisor: Disable auto TM")
|
oce.add("48", "PLOC Supervisor: Disable auto TM")
|
||||||
oce.add("51", "PLOC Supervisor: Logging request event buffers")
|
oce.add("51", "PLOC Supervisor: Logging request event buffers")
|
||||||
@ -219,7 +215,7 @@ def add_ploc_supv_cmds(defs: TmtcDefinitionWrapper):
|
|||||||
oce.add("56", "PLOC Supervisor: Reset PL")
|
oce.add("56", "PLOC Supervisor: Reset PL")
|
||||||
oce.add("57", "PLOC Supervisor: Enable NVMs")
|
oce.add("57", "PLOC Supervisor: Enable NVMs")
|
||||||
oce.add("58", "PLOC Supervisor: Continue update")
|
oce.add("58", "PLOC Supervisor: Continue update")
|
||||||
oce.add(OpCodes.MEM_CHECK, Info.MEM_CHECK)
|
oce.add(OpCode.MEM_CHECK, Info.MEM_CHECK)
|
||||||
defs.add_service(CustomServiceList.PLOC_SUPV.value, "PLOC Supervisor", oce)
|
defs.add_service(CustomServiceList.PLOC_SUPV.value, "PLOC Supervisor", oce)
|
||||||
|
|
||||||
|
|
||||||
@ -228,39 +224,56 @@ def pack_ploc_supv_commands(p: ServiceProviderParams): # noqa C901
|
|||||||
q = p.queue_helper
|
q = p.queue_helper
|
||||||
op_code = p.op_code
|
op_code = p.op_code
|
||||||
object_id = get_object_ids().get(PLOC_SUPV_ID)
|
object_id = get_object_ids().get(PLOC_SUPV_ID)
|
||||||
|
assert object_id is not None
|
||||||
q.add_log_cmd(f"Testing PLOC Supervisor with object id: {object_id.as_hex_string}")
|
q.add_log_cmd(f"Testing PLOC Supervisor with object id: {object_id.as_hex_string}")
|
||||||
obyt = object_id.as_bytes
|
obyt = object_id.as_bytes
|
||||||
prefix = "PLOC Supervisor"
|
prefix = "PLOC Supervisor"
|
||||||
if op_code in OpCodes.OFF:
|
if op_code == OpCode.OFF:
|
||||||
q.add_log_cmd(f"{prefix}: {Info.OFF}")
|
q.add_log_cmd(f"{prefix}: {Info.OFF}")
|
||||||
command = pack_mode_data(object_id.as_bytes, Mode.OFF, 0)
|
command = pack_mode_data(object_id.as_bytes, Mode.OFF, 0)
|
||||||
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=command))
|
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=command))
|
||||||
if op_code in OpCodes.ON:
|
if op_code == OpCode.ON:
|
||||||
q.add_log_cmd(f"{prefix}: {Info.ON}")
|
q.add_log_cmd(f"{prefix}: {Info.ON}")
|
||||||
command = pack_mode_data(object_id.as_bytes, Mode.ON, 0)
|
command = pack_mode_data(object_id.as_bytes, Mode.ON, 0)
|
||||||
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=command))
|
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=command))
|
||||||
if op_code in OpCodes.NORMAL:
|
if op_code == OpCode.NORMAL:
|
||||||
q.add_log_cmd(f"{prefix}: {Info.NML}")
|
q.add_log_cmd(f"{prefix}: {Info.NML}")
|
||||||
command = pack_mode_data(object_id.as_bytes, Mode.NORMAL, 0)
|
command = pack_mode_data(object_id.as_bytes, Mode.NORMAL, 0)
|
||||||
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=command))
|
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=command))
|
||||||
if op_code in OpCodes.HK_TO_OBC:
|
if op_code == OpCode.HK_TO_OBC:
|
||||||
q.add_log_cmd(f"{prefix}: {Info.HK_TO_OBC}")
|
q.add_log_cmd(f"{prefix}: {Info.HK_TO_OBC}")
|
||||||
command = obyt + struct.pack("!I", SupvActionId.HK_REPORT)
|
command = obyt + struct.pack("!I", SupvActionId.REQUEST_HK_REPORT)
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||||
if op_code in OpCodes.REQUEST_HK:
|
if op_code == OpCode.REQUEST_HK_SET:
|
||||||
q.add_log_cmd(f"{prefix}: {Info.REQUEST_HK}")
|
q.add_log_cmd(f"{prefix}: {Info.REQUEST_HK_SET}")
|
||||||
sid = make_sid(object_id.as_bytes, SetIds.HK_REPORT)
|
sid = make_sid(object_id.as_bytes, prompt_set_id())
|
||||||
cmd = generate_one_hk_command(sid)
|
cmd = generate_one_hk_command(sid)
|
||||||
q.add_pus_tc(cmd)
|
q.add_pus_tc(cmd)
|
||||||
elif op_code in OpCodes.START_MPSOC:
|
if op_code == OpCode.REQUEST_HK_SET_FROM_DEV:
|
||||||
|
q.add_log_cmd(f"{prefix}: {Info.REQUEST_HK_SET_FROM_DEV}")
|
||||||
|
set_id = prompt_set_id()
|
||||||
|
action_cmd = None
|
||||||
|
if set_id == SetId.HK_REPORT:
|
||||||
|
action_cmd = create_action_cmd(PLOC_SUPV_ID, SupvActionId.REQUEST_HK_REPORT)
|
||||||
|
if set_id == SetId.ADC_REPORT:
|
||||||
|
action_cmd = create_action_cmd(
|
||||||
|
PLOC_SUPV_ID, SupvActionId.REQUEST_ADC_REPORT
|
||||||
|
)
|
||||||
|
if set_id == SetId.COUNTERS_REPORT:
|
||||||
|
action_cmd = create_action_cmd(
|
||||||
|
PLOC_SUPV_ID, SupvActionId.REQUEST_LOGGING_COUNTERS
|
||||||
|
)
|
||||||
|
assert action_cmd is not None
|
||||||
|
q.add_pus_tc(action_cmd)
|
||||||
|
elif op_code == OpCode.START_MPSOC:
|
||||||
q.add_log_cmd("PLOC Supervisor: Start MPSoC")
|
q.add_log_cmd("PLOC Supervisor: Start MPSoC")
|
||||||
command = obyt + struct.pack("!I", SupvActionId.START_MPSOC)
|
command = obyt + struct.pack("!I", SupvActionId.START_MPSOC)
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||||
if op_code in OpCodes.SHUTDOWN_MPSOC:
|
if op_code == OpCode.SHUTDOWN_MPSOC:
|
||||||
q.add_log_cmd("PLOC Supervisor: Shutdown MPSoC")
|
q.add_log_cmd("PLOC Supervisor: Shutdown MPSoC")
|
||||||
command = object_id.as_bytes + struct.pack("!I", SupvActionId.SHUTWOWN_MPSOC)
|
command = object_id.as_bytes + struct.pack("!I", SupvActionId.SHUTWOWN_MPSOC)
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||||
if op_code in OpCodes.SEL_NVM:
|
if op_code == OpCode.SEL_NVM:
|
||||||
q.add_log_cmd("PLOC Supervisor: Select MPSoC boot image")
|
q.add_log_cmd("PLOC Supervisor: Select MPSoC boot image")
|
||||||
mem = int(input("MEM (NVM0 - 0 or NVM1 - 1): "))
|
mem = int(input("MEM (NVM0 - 0 or NVM1 - 1): "))
|
||||||
bp0 = int(input("BP0 (0 or 1): "))
|
bp0 = int(input("BP0 (0 or 1): "))
|
||||||
@ -268,7 +281,7 @@ def pack_ploc_supv_commands(p: ServiceProviderParams): # noqa C901
|
|||||||
bp2 = int(input("BP2 (0 or 1): "))
|
bp2 = int(input("BP2 (0 or 1): "))
|
||||||
command = pack_sel_boot_image_cmd(object_id.as_bytes, mem, bp0, bp1, bp2)
|
command = pack_sel_boot_image_cmd(object_id.as_bytes, mem, bp0, bp1, bp2)
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||||
if op_code in OpCodes.FACTORY_RESET:
|
if op_code == OpCode.FACTORY_RESET:
|
||||||
q.add_log_cmd(f"{prefix}: {Info.FACTORY_RESET}")
|
q.add_log_cmd(f"{prefix}: {Info.FACTORY_RESET}")
|
||||||
while True:
|
while True:
|
||||||
print("Please select the key for a factory reset operation")
|
print("Please select the key for a factory reset operation")
|
||||||
@ -294,11 +307,11 @@ def pack_ploc_supv_commands(p: ServiceProviderParams): # noqa C901
|
|||||||
+ struct.pack("!B", restart_tries)
|
+ struct.pack("!B", restart_tries)
|
||||||
)
|
)
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||||
if op_code == OpCodes.RESET_MPSOC:
|
if op_code == OpCode.RESET_MPSOC:
|
||||||
q.add_log_cmd(Info.RESET_MPSOC)
|
q.add_log_cmd(Info.RESET_MPSOC)
|
||||||
command = object_id.as_bytes + struct.pack("!I", SupvActionId.RESET_MPSOC)
|
command = object_id.as_bytes + struct.pack("!I", SupvActionId.RESET_MPSOC)
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||||
if op_code in OpCodes.SET_TIME_REF:
|
if op_code == OpCode.SET_TIME_REF:
|
||||||
q.add_log_cmd("PLOC Supervisor: Set time reference")
|
q.add_log_cmd("PLOC Supervisor: Set time reference")
|
||||||
command = object_id.as_bytes + struct.pack("!I", SupvActionId.SET_TIME_REF)
|
command = object_id.as_bytes + struct.pack("!I", SupvActionId.SET_TIME_REF)
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||||
@ -315,14 +328,14 @@ def pack_ploc_supv_commands(p: ServiceProviderParams): # noqa C901
|
|||||||
q.add_log_cmd("PLOC Supervisor: Disable HK")
|
q.add_log_cmd("PLOC Supervisor: Disable HK")
|
||||||
command = object_id.as_bytes + struct.pack("!I", SupvActionId.DISABLE_HK)
|
command = object_id.as_bytes + struct.pack("!I", SupvActionId.DISABLE_HK)
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||||
if op_code in OpCodes.REQ_BOOT_STATUS_REPORT:
|
if op_code in OpCode.REQ_BOOT_STATUS_REPORT:
|
||||||
q.add_log_cmd(f"{prefix}: {Info.REQ_BOOT_STATUS_REPORT}")
|
q.add_log_cmd(f"{prefix}: {Info.REQ_BOOT_STATUS_REPORT}")
|
||||||
command = object_id.as_bytes + struct.pack(
|
command = object_id.as_bytes + struct.pack(
|
||||||
"!I", SupvActionId.GET_BOOT_STATUS_REPORT
|
"!I", SupvActionId.GET_BOOT_STATUS_REPORT
|
||||||
)
|
)
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||||
q.add_wait_seconds(2.0)
|
q.add_wait_seconds(2.0)
|
||||||
sid = make_sid(object_id.as_bytes, SetIds.BOOT_STATUS_REPORT)
|
sid = make_sid(object_id.as_bytes, SetId.BOOT_STATUS_REPORT)
|
||||||
req_hk = generate_one_hk_command(sid)
|
req_hk = generate_one_hk_command(sid)
|
||||||
q.add_pus_tc(req_hk)
|
q.add_pus_tc(req_hk)
|
||||||
if op_code == "17":
|
if op_code == "17":
|
||||||
@ -383,11 +396,11 @@ def pack_ploc_supv_commands(p: ServiceProviderParams): # noqa C901
|
|||||||
"!I", SupvActionId.RESTART_SUPERVISOR
|
"!I", SupvActionId.RESTART_SUPERVISOR
|
||||||
)
|
)
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||||
if op_code in OpCodes.START_UPDATE:
|
if op_code in OpCode.START_UPDATE:
|
||||||
q.add_log_cmd("PLOC Supversior: Start new MPSoC SW update")
|
q.add_log_cmd("PLOC Supversior: Start new MPSoC SW update")
|
||||||
command = pack_update_command(object_id.as_bytes, True)
|
command = pack_update_command(object_id.as_bytes, True)
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||||
if op_code in OpCodes.PERFORM_UPDATE:
|
if op_code in OpCode.PERFORM_UPDATE:
|
||||||
q.add_log_cmd("PLOC Supervisor: Perform MPSoC SW update")
|
q.add_log_cmd("PLOC Supervisor: Perform MPSoC SW update")
|
||||||
command = pack_update_command(object_id.as_bytes, False)
|
command = pack_update_command(object_id.as_bytes, False)
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||||
@ -405,7 +418,7 @@ def pack_ploc_supv_commands(p: ServiceProviderParams): # noqa C901
|
|||||||
q.add_log_cmd("PLOC Supervisor: Set shutdown timeout")
|
q.add_log_cmd("PLOC Supervisor: Set shutdown timeout")
|
||||||
command = pack_set_shutdown_timeout_command(object_id.as_bytes)
|
command = pack_set_shutdown_timeout_command(object_id.as_bytes)
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||||
if op_code in OpCodes.FACTORY_FLASH:
|
if op_code in OpCode.FACTORY_FLASH:
|
||||||
q.add_log_cmd(f"{prefix}: {Info.FACTORY_FLASH}")
|
q.add_log_cmd(f"{prefix}: {Info.FACTORY_FLASH}")
|
||||||
command = object_id.as_bytes + struct.pack("!I", SupvActionId.FACTORY_FLASH)
|
command = object_id.as_bytes + struct.pack("!I", SupvActionId.FACTORY_FLASH)
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||||
@ -434,7 +447,7 @@ def pack_ploc_supv_commands(p: ServiceProviderParams): # noqa C901
|
|||||||
if op_code == "54":
|
if op_code == "54":
|
||||||
q.add_log_cmd("PLOC Supervisor: Logging request counters")
|
q.add_log_cmd("PLOC Supervisor: Logging request counters")
|
||||||
command = object_id.as_bytes + struct.pack(
|
command = object_id.as_bytes + struct.pack(
|
||||||
"!I", SupvActionId.LOGGING_REQUEST_COUNTERS
|
"!I", SupvActionId.REQUEST_LOGGING_COUNTERS
|
||||||
)
|
)
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||||
if op_code == "55":
|
if op_code == "55":
|
||||||
@ -462,7 +475,7 @@ def pack_ploc_supv_commands(p: ServiceProviderParams): # noqa C901
|
|||||||
q.add_log_cmd("PLOC Supervisor: Continue update")
|
q.add_log_cmd("PLOC Supervisor: Continue update")
|
||||||
command = object_id.as_bytes + struct.pack("!I", SupvActionId.CONTINUE_UPDATE)
|
command = object_id.as_bytes + struct.pack("!I", SupvActionId.CONTINUE_UPDATE)
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||||
if op_code in OpCodes.MEM_CHECK:
|
if op_code == OpCode.MEM_CHECK:
|
||||||
custom_data = bytearray()
|
custom_data = bytearray()
|
||||||
update_file = get_update_file()
|
update_file = get_update_file()
|
||||||
memory_id = int(input("Specify memory ID: "))
|
memory_id = int(input("Specify memory ID: "))
|
||||||
@ -481,6 +494,20 @@ def pack_ploc_supv_commands(p: ServiceProviderParams): # noqa C901
|
|||||||
q.add_pus_tc(command)
|
q.add_pus_tc(command)
|
||||||
|
|
||||||
|
|
||||||
|
def prompt_set_id() -> SetId:
|
||||||
|
for set_id in SetId:
|
||||||
|
print(f"{set_id}: {set_id.name}")
|
||||||
|
while True:
|
||||||
|
set_id = int(input("Please select the set ID to request: "))
|
||||||
|
try:
|
||||||
|
set_id_typed = SetId(set_id)
|
||||||
|
except ValueError:
|
||||||
|
_LOGGER.warning("invalid set ID, try again")
|
||||||
|
continue
|
||||||
|
break
|
||||||
|
return set_id_typed
|
||||||
|
|
||||||
|
|
||||||
def pack_sel_boot_image_cmd(
|
def pack_sel_boot_image_cmd(
|
||||||
object_id: bytes, mem: int, bp0: int, bp1: int, bp2: int
|
object_id: bytes, mem: int, bp0: int, bp1: int, bp2: int
|
||||||
) -> bytearray:
|
) -> bytearray:
|
||||||
@ -545,9 +572,9 @@ def get_latchup_id() -> int:
|
|||||||
description_string = "Description".ljust(description_column_width)
|
description_string = "Description".ljust(description_column_width)
|
||||||
print(f"{key_string} | {description_string}")
|
print(f"{key_string} | {description_string}")
|
||||||
print(separator_string)
|
print(separator_string)
|
||||||
for key in latchup_id_dict:
|
for key in LATCHUP_ID_DICT:
|
||||||
key_string = key.ljust(key_column_width)
|
key_string = key.ljust(key_column_width)
|
||||||
description_string = latchup_id_dict[key].ljust(description_column_width)
|
description_string = LATCHUP_ID_DICT[key].ljust(description_column_width)
|
||||||
print(f"{key_string} | {description_string}")
|
print(f"{key_string} | {description_string}")
|
||||||
return int(input("Specify latchup ID: "))
|
return int(input("Specify latchup ID: "))
|
||||||
|
|
||||||
@ -676,10 +703,10 @@ def pack_set_gpio_cmd(object_id: bytes) -> bytearray:
|
|||||||
port = int(input("Specify port: 0x"), 16)
|
port = int(input("Specify port: 0x"), 16)
|
||||||
pin = int(input("Specify pin: 0x"), 16)
|
pin = int(input("Specify pin: 0x"), 16)
|
||||||
val = int(input("Specify val: 0x"), 16)
|
val = int(input("Specify val: 0x"), 16)
|
||||||
command = object_id + struct.pack("!I", SupvActionId.SET_GPIO)
|
command = bytearray(object_id + struct.pack("!I", SupvActionId.SET_GPIO))
|
||||||
command = command + struct.pack("!B", port)
|
command.append(port)
|
||||||
command = command + struct.pack("!B", pin)
|
command.append(pin)
|
||||||
command = command + struct.pack("!B", val)
|
command.append(val)
|
||||||
return bytearray(command)
|
return bytearray(command)
|
||||||
|
|
||||||
|
|
||||||
@ -701,25 +728,25 @@ def pack_logging_set_topic(object_id: bytes) -> bytearray:
|
|||||||
|
|
||||||
def get_update_file() -> str:
|
def get_update_file() -> str:
|
||||||
_LOGGER.info("Specify update file ")
|
_LOGGER.info("Specify update file ")
|
||||||
input_helper = InputHelper(update_file_dict)
|
input_helper = InputHelper(UPDATE_FILE_DICT)
|
||||||
key = input_helper.get_key()
|
key = input_helper.get_key()
|
||||||
if key == HARDCODED:
|
if key == HARDCODED:
|
||||||
file = HARDCODED_FILE
|
file = HARDCODED_FILE
|
||||||
elif key == MANUAL_INPUT:
|
elif key == MANUAL_INPUT:
|
||||||
file = input("Ploc Supervisor: Specify absolute name of update file: ")
|
file = input("Ploc Supervisor: Specify absolute name of update file: ")
|
||||||
else:
|
else:
|
||||||
file = update_file_dict[key][1]
|
file = UPDATE_FILE_DICT[key][1]
|
||||||
return file
|
return file
|
||||||
|
|
||||||
|
|
||||||
def get_event_buffer_path() -> str:
|
def get_event_buffer_path() -> str:
|
||||||
_LOGGER.info("Specify path where to store event buffer file ")
|
_LOGGER.info("Specify path where to store event buffer file ")
|
||||||
input_helper = InputHelper(event_buffer_path_dict)
|
input_helper = InputHelper(EVENT_BUFFER_PATH_DICT)
|
||||||
key = input_helper.get_key()
|
key = input_helper.get_key()
|
||||||
if key == MANUAL_INPUT:
|
if key == MANUAL_INPUT:
|
||||||
file = input("Ploc Supervisor: Specify path: ")
|
file = input("Ploc Supervisor: Specify path: ")
|
||||||
else:
|
else:
|
||||||
file = event_buffer_path_dict[key][1]
|
file = EVENT_BUFFER_PATH_DICT[key][1]
|
||||||
return file
|
return file
|
||||||
|
|
||||||
|
|
||||||
@ -731,62 +758,152 @@ class SocState(enum.IntEnum):
|
|||||||
|
|
||||||
|
|
||||||
def handle_supv_hk_data(set_id: int, hk_data: bytes, pw: PrintWrapper):
|
def handle_supv_hk_data(set_id: int, hk_data: bytes, pw: PrintWrapper):
|
||||||
current_idx = 0
|
if set_id == SetId.HK_REPORT:
|
||||||
if set_id == SetIds.HK_REPORT:
|
handle_hk_report(hk_data, pw)
|
||||||
fmt_str = "!IIIQIIIIIBBBB"
|
elif set_id == SetId.BOOT_STATUS_REPORT:
|
||||||
inc_len = struct.calcsize(fmt_str)
|
handle_boot_report(hk_data, pw)
|
||||||
(
|
elif set_id == SetId.ADC_REPORT:
|
||||||
temp_ps,
|
handle_adc_report(hk_data)
|
||||||
temp_pl,
|
elif set_id == SetId.COUNTERS_REPORT:
|
||||||
temp_sup,
|
handle_counters_report(hk_data)
|
||||||
uptime,
|
|
||||||
cpu_load,
|
|
||||||
avail_heap,
|
|
||||||
num_tcs,
|
|
||||||
num_tms,
|
|
||||||
soc_state,
|
|
||||||
nvm_0_1_state,
|
|
||||||
nvm_3_state,
|
|
||||||
mission_io_state,
|
|
||||||
fmc_state,
|
|
||||||
) = struct.unpack(fmt_str, hk_data[:inc_len])
|
|
||||||
pw.dlog(f"Temp PS {temp_ps} C | Temp PL {temp_pl} C | Temp SUP {temp_sup} C")
|
|
||||||
pw.dlog(f"Uptime {uptime} | CPU Load {cpu_load} | Avail Heap {avail_heap}")
|
|
||||||
pw.dlog(f"Number TCs {num_tcs} | Number TMs {num_tms}")
|
|
||||||
pw.dlog(f"SOC state {SocState(soc_state)}")
|
|
||||||
pw.dlog(f"NVM 01 State {nvm_0_1_state}")
|
|
||||||
pw.dlog(f"NVM 3 State {nvm_3_state}")
|
|
||||||
pw.dlog(f"Mission IO state {mission_io_state}")
|
|
||||||
pw.dlog(f"FMC state {fmc_state}")
|
|
||||||
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[inc_len:], 13))
|
|
||||||
elif set_id == SetIds.BOOT_STATUS_REPORT:
|
|
||||||
fmt_str = "!BBIIBBBBBB"
|
|
||||||
inc_len = struct.calcsize(fmt_str)
|
|
||||||
(
|
|
||||||
soc_state,
|
|
||||||
power_cycles,
|
|
||||||
boot_after_ms,
|
|
||||||
boot_timeout_ms,
|
|
||||||
active_nvm,
|
|
||||||
bp_0_state,
|
|
||||||
bp_1_state,
|
|
||||||
bp_2_state,
|
|
||||||
boot_state,
|
|
||||||
boot_cycles,
|
|
||||||
) = struct.unpack(fmt_str, hk_data[0 : 0 + inc_len])
|
|
||||||
current_idx += inc_len
|
|
||||||
pw.dlog(
|
|
||||||
"SoC state (0:off, 1:booting, 2:update, 3:operating, 4:shutdown, 5:reset):"
|
|
||||||
f" {soc_state}"
|
|
||||||
)
|
|
||||||
pw.dlog(f"Power Cycles {power_cycles}")
|
|
||||||
pw.dlog(f"Boot after {boot_after_ms} ms | Boot timeout {boot_timeout_ms} ms")
|
|
||||||
pw.dlog(f"Active NVM: {active_nvm}")
|
|
||||||
pw.dlog(
|
|
||||||
f"BP0 State {bp_0_state} | BP1 State {bp_1_state} | BP2 State {bp_2_state}"
|
|
||||||
)
|
|
||||||
pw.dlog(f"Boot State {boot_state} | Boot Cycles {boot_cycles}")
|
|
||||||
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], 10)
|
|
||||||
else:
|
else:
|
||||||
pw.dlog(f"PLOC SUPV: HK handling not implemented for set ID {set_id}")
|
pw.dlog(f"PLOC SUPV: HK handling not implemented for set ID {set_id}")
|
||||||
pw.dlog(f"Raw Data: 0x[{hk_data.hex(sep=',')}]")
|
pw.dlog(f"Raw Data: 0x[{hk_data.hex(sep=',')}]")
|
||||||
|
|
||||||
|
|
||||||
|
def handle_hk_report(hk_data: bytes, pw: PrintWrapper):
|
||||||
|
fmt_str = "!IIIQIIIIIBBBB"
|
||||||
|
inc_len = struct.calcsize(fmt_str)
|
||||||
|
(
|
||||||
|
temp_ps,
|
||||||
|
temp_pl,
|
||||||
|
temp_sup,
|
||||||
|
uptime,
|
||||||
|
cpu_load,
|
||||||
|
avail_heap,
|
||||||
|
num_tcs,
|
||||||
|
num_tms,
|
||||||
|
soc_state,
|
||||||
|
nvm_0_1_state,
|
||||||
|
nvm_3_state,
|
||||||
|
mission_io_state,
|
||||||
|
fmc_state,
|
||||||
|
) = struct.unpack(fmt_str, hk_data[:inc_len])
|
||||||
|
pw.dlog(f"Temp PS {temp_ps} C | Temp PL {temp_pl} C | Temp SUP {temp_sup} C")
|
||||||
|
pw.dlog(f"Uptime {uptime} | CPU Load {cpu_load} | Avail Heap {avail_heap}")
|
||||||
|
pw.dlog(f"Number TCs {num_tcs} | Number TMs {num_tms}")
|
||||||
|
pw.dlog(f"SOC state {SocState(soc_state)}")
|
||||||
|
pw.dlog(f"NVM 01 State {nvm_0_1_state}")
|
||||||
|
pw.dlog(f"NVM 3 State {nvm_3_state}")
|
||||||
|
pw.dlog(f"Mission IO state {mission_io_state}")
|
||||||
|
pw.dlog(f"FMC state {fmc_state}")
|
||||||
|
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[inc_len:], 13))
|
||||||
|
|
||||||
|
|
||||||
|
def handle_boot_report(hk_data: bytes, pw: PrintWrapper):
|
||||||
|
current_idx = 0
|
||||||
|
fmt_str = "!BBIIBBBBBB"
|
||||||
|
inc_len = struct.calcsize(fmt_str)
|
||||||
|
(
|
||||||
|
soc_state,
|
||||||
|
power_cycles,
|
||||||
|
boot_after_ms,
|
||||||
|
boot_timeout_ms,
|
||||||
|
active_nvm,
|
||||||
|
bp_0_state,
|
||||||
|
bp_1_state,
|
||||||
|
bp_2_state,
|
||||||
|
boot_state,
|
||||||
|
boot_cycles,
|
||||||
|
) = struct.unpack(fmt_str, hk_data[0 : 0 + inc_len])
|
||||||
|
current_idx += inc_len
|
||||||
|
pw.dlog(
|
||||||
|
"SoC state (0:off, 1:booting, 2:update, 3:operating, 4:shutdown, 5:reset):"
|
||||||
|
f" {soc_state}"
|
||||||
|
)
|
||||||
|
pw.dlog(f"Power Cycles {power_cycles}")
|
||||||
|
pw.dlog(f"Boot after {boot_after_ms} ms | Boot timeout {boot_timeout_ms} ms")
|
||||||
|
pw.dlog(f"Active NVM: {active_nvm}")
|
||||||
|
pw.dlog(f"BP0 State {bp_0_state} | BP1 State {bp_1_state} | BP2 State {bp_2_state}")
|
||||||
|
pw.dlog(f"Boot State {boot_state} | Boot Cycles {boot_cycles}")
|
||||||
|
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], 10)
|
||||||
|
|
||||||
|
|
||||||
|
def handle_adc_report(hk_data: bytes):
|
||||||
|
if len(hk_data) < 64:
|
||||||
|
_LOGGER.warning("ADC report smaller than 64 bytes")
|
||||||
|
current_idx = 0
|
||||||
|
adc_raw = []
|
||||||
|
adc_eng = []
|
||||||
|
for _ in range(16):
|
||||||
|
adc_raw.append(struct.unpack("!H", hk_data[current_idx : current_idx + 2])[0])
|
||||||
|
current_idx += 2
|
||||||
|
for _ in range(16):
|
||||||
|
adc_eng.append(struct.unpack("!H", hk_data[current_idx : current_idx + 2])[0])
|
||||||
|
current_idx += 2
|
||||||
|
|
||||||
|
print(f"{'Index'.ljust(10)} | {'ADC RAW'.ljust(10)} | {'ADC ENG'.ljust(10)}")
|
||||||
|
for i in range(16):
|
||||||
|
print(f"{i: >10} | {adc_raw[i]: >10} | {adc_eng[i]: >10}")
|
||||||
|
|
||||||
|
|
||||||
|
def handle_counters_report(hk_data: bytes):
|
||||||
|
current_idx = 0
|
||||||
|
signature = struct.unpack("!I", hk_data[current_idx : current_idx + 4])[0]
|
||||||
|
current_idx += 4
|
||||||
|
latchup_counters = []
|
||||||
|
for _ in range(7):
|
||||||
|
latchup_counters.append(
|
||||||
|
struct.unpack("!I", hk_data[current_idx : current_idx + 4])[0]
|
||||||
|
)
|
||||||
|
current_idx += 4
|
||||||
|
fmt_str = "!IIIIIIIIIIIIIIIIIIII"
|
||||||
|
inc_len = struct.calcsize(fmt_str)
|
||||||
|
(
|
||||||
|
adc_deviation_triggers_cnt,
|
||||||
|
tc_received_cnt,
|
||||||
|
tm_available_cnt,
|
||||||
|
supervisor_boots,
|
||||||
|
mpsoc_boots,
|
||||||
|
mpsoc_boot_failed_attempts,
|
||||||
|
mpsoc_powerup,
|
||||||
|
mpsoc_updates,
|
||||||
|
mpsoc_heartbeat_resets,
|
||||||
|
cpu_wdt_resets,
|
||||||
|
ps_heartbeats_lost,
|
||||||
|
pl_heartbeats_lost,
|
||||||
|
eb_task_lost,
|
||||||
|
bm_task_lost,
|
||||||
|
lm_task_lost,
|
||||||
|
am_task_lost,
|
||||||
|
tctmm_task_lost,
|
||||||
|
mm_task_lost,
|
||||||
|
hk_task_lost,
|
||||||
|
dl_task_lost,
|
||||||
|
) = struct.unpack(fmt_str, hk_data[current_idx : current_idx + inc_len])
|
||||||
|
current_idx += inc_len
|
||||||
|
_redwire_tasks_lost = []
|
||||||
|
for _ in range(3):
|
||||||
|
_redwire_tasks_lost.append(
|
||||||
|
struct.unpack("!I", hk_data[current_idx : current_idx + 4])[0]
|
||||||
|
)
|
||||||
|
print(f"Signature: {signature}")
|
||||||
|
print(f"Latchup Counters: {latchup_counters}")
|
||||||
|
print(f"ADC Deviation Triggers Count: {adc_deviation_triggers_cnt}")
|
||||||
|
print(f"TCs received: {tc_received_cnt} | TMs Available: {tm_available_cnt}")
|
||||||
|
print(f"Supervisor Boots: {supervisor_boots} | MPSoC boots: {mpsoc_boots}")
|
||||||
|
print(f"MPSoC boot failed attempts: {mpsoc_boot_failed_attempts}")
|
||||||
|
print(f"MPSoC powerup: {mpsoc_powerup}")
|
||||||
|
print(f"MPSoC updates: {mpsoc_updates}")
|
||||||
|
print(f"MPSoC heartbeat resets: {mpsoc_heartbeat_resets}")
|
||||||
|
print(f"CPU WDT resets: {cpu_wdt_resets}")
|
||||||
|
print(f"PS heartbeats lost: {ps_heartbeats_lost}")
|
||||||
|
print(f"PL heartbeats lost: {pl_heartbeats_lost}")
|
||||||
|
print(f"EB task lost: {eb_task_lost}")
|
||||||
|
print(f"BM task lost: {bm_task_lost}")
|
||||||
|
print(f"LM task lost: {lm_task_lost}")
|
||||||
|
print(f"AM task lost: {am_task_lost}")
|
||||||
|
print(f"TCTMM task lost: {tctmm_task_lost}")
|
||||||
|
print(f"MM task lost: {mm_task_lost}")
|
||||||
|
print(f"HK task lost: {hk_task_lost}")
|
||||||
|
print(f"DL task lost: {dl_task_lost}")
|
||||||
|
@ -43,21 +43,25 @@ class OpCode:
|
|||||||
NORMAL_TX = "nml_tx"
|
NORMAL_TX = "nml_tx"
|
||||||
NORMAL_MPA = "nml_mpa"
|
NORMAL_MPA = "nml_mpa"
|
||||||
NORMAL_HPA = "nml_hpa"
|
NORMAL_HPA = "nml_hpa"
|
||||||
|
NORMAL_CUSTOM = "nml_custom"
|
||||||
|
|
||||||
ENABLE_HK = "enable_hk"
|
ENABLE_HK = "enable_hk"
|
||||||
DISABLE_HK = "disable_hk"
|
DISABLE_HK = "disable_hk"
|
||||||
REQ_OS_HK = "hk_os"
|
REQ_OS_HK = "hk_os"
|
||||||
|
|
||||||
|
DISABLE_ORDER_CHECKING = "disable_order_checking"
|
||||||
|
ENABLE_ORDER_CHECKING = "enable_order_checking"
|
||||||
|
|
||||||
UPDATE_I_UPPER_LIMIT = "update_i_upper_limit"
|
UPDATE_I_UPPER_LIMIT = "update_i_upper_limit"
|
||||||
UPDATE_V_LOWER_LIMIT = "update_v_lower_limit"
|
UPDATE_V_LOWER_LIMIT = "update_v_lower_limit"
|
||||||
UPDATE_V_UPPER_LIMIT = "update_v_upper_limit"
|
UPDATE_V_UPPER_LIMIT = "update_v_upper_limit"
|
||||||
|
|
||||||
INJECT_SSR_TO_DRO_FAILURE = ["10", "inject_ssr_dro_fault"]
|
INJECT_SSR_TO_DRO_FAILURE = "inject_ssr_dro_fault"
|
||||||
INJECT_DRO_TO_X8_FAILURE = ["11", "inject_dro_x8_fault"]
|
INJECT_DRO_TO_X8_FAILURE = "inject_dro_x8_fault"
|
||||||
INJECT_X8_TO_TX_FAILURE = ["12", "inject_x8_tx_fault"]
|
INJECT_X8_TO_TX_FAILURE = "inject_x8_tx_fault"
|
||||||
INJECT_TX_TO_MPA_FAILURE = ["13", "inject_tx_mpa_fault"]
|
INJECT_TX_TO_MPA_FAILURE = "inject_tx_mpa_fault"
|
||||||
INJECT_MPA_TO_HPA_FAILURE = ["14", "inject_mpa_hpa_fault"]
|
INJECT_MPA_TO_HPA_FAILURE = "inject_mpa_hpa_fault"
|
||||||
INJECT_ALL_ON_FAILURE = ["15", "inject_all_on_fault"]
|
INJECT_ALL_ON_FAILURE = "inject_all_on_fault"
|
||||||
|
|
||||||
|
|
||||||
class Info:
|
class Info:
|
||||||
@ -70,6 +74,7 @@ class Info:
|
|||||||
NORMAL_TX = f"{NORMAL}, TX on"
|
NORMAL_TX = f"{NORMAL}, TX on"
|
||||||
NORMAL_MPA = f"{NORMAL}, MPA on"
|
NORMAL_MPA = f"{NORMAL}, MPA on"
|
||||||
NORMAL_HPA = f"{NORMAL}, HPA on"
|
NORMAL_HPA = f"{NORMAL}, HPA on"
|
||||||
|
NORMAL_CUSTOM = f"{NORMAL}, Custom Channel Settings"
|
||||||
REQ_OS_HK = "Request One Shot HK"
|
REQ_OS_HK = "Request One Shot HK"
|
||||||
SWITCH_HPA_ON_PROC = "Switch HPA on procedure"
|
SWITCH_HPA_ON_PROC = "Switch HPA on procedure"
|
||||||
ENABLE_HK = "Enable HK"
|
ENABLE_HK = "Enable HK"
|
||||||
@ -77,6 +82,8 @@ class Info:
|
|||||||
UPDATE_I_UPPER_LIMIT = "Update upper current parameter"
|
UPDATE_I_UPPER_LIMIT = "Update upper current parameter"
|
||||||
UPDATE_V_LOWER_LIMIT = "Update lower voltage parameter"
|
UPDATE_V_LOWER_LIMIT = "Update lower voltage parameter"
|
||||||
UPDATE_V_UPPER_LIMIT = "Update upper voltage parameter"
|
UPDATE_V_UPPER_LIMIT = "Update upper voltage parameter"
|
||||||
|
DISABLE_ORDER_CHECKING = "Disable order checks"
|
||||||
|
ENABLE_ORDER_CHECKING = "Enable order checks"
|
||||||
|
|
||||||
|
|
||||||
class SetId(enum.IntEnum):
|
class SetId(enum.IntEnum):
|
||||||
@ -163,6 +170,8 @@ class ParamId(enum.IntEnum):
|
|||||||
INJECT_MPA_TO_HPA_FAILURE = 34
|
INJECT_MPA_TO_HPA_FAILURE = 34
|
||||||
INJECT_ALL_ON_FAILURE = 35
|
INJECT_ALL_ON_FAILURE = 35
|
||||||
|
|
||||||
|
DISABLE_ORDER_CHECK_CHANNELS = 40
|
||||||
|
|
||||||
|
|
||||||
class DevSelect(enum.IntEnum):
|
class DevSelect(enum.IntEnum):
|
||||||
SSR_NEG_V = 0
|
SSR_NEG_V = 0
|
||||||
@ -185,6 +194,7 @@ def add_pl_pcdu_cmds(defs: TmtcDefinitionWrapper):
|
|||||||
oce.add(keys=OpCode.NORMAL_TX, info=Info.NORMAL_TX)
|
oce.add(keys=OpCode.NORMAL_TX, info=Info.NORMAL_TX)
|
||||||
oce.add(keys=OpCode.NORMAL_MPA, info=Info.NORMAL_MPA)
|
oce.add(keys=OpCode.NORMAL_MPA, info=Info.NORMAL_MPA)
|
||||||
oce.add(keys=OpCode.NORMAL_HPA, info=Info.NORMAL_HPA)
|
oce.add(keys=OpCode.NORMAL_HPA, info=Info.NORMAL_HPA)
|
||||||
|
oce.add(keys=OpCode.NORMAL_CUSTOM, info=Info.NORMAL_CUSTOM)
|
||||||
oce.add(keys=OpCode.REQ_OS_HK, info=Info.REQ_OS_HK)
|
oce.add(keys=OpCode.REQ_OS_HK, info=Info.REQ_OS_HK)
|
||||||
oce.add(keys=OpCode.ENABLE_HK, info=Info.ENABLE_HK)
|
oce.add(keys=OpCode.ENABLE_HK, info=Info.ENABLE_HK)
|
||||||
oce.add(keys=OpCode.UPDATE_V_LOWER_LIMIT, info=Info.UPDATE_V_LOWER_LIMIT)
|
oce.add(keys=OpCode.UPDATE_V_LOWER_LIMIT, info=Info.UPDATE_V_LOWER_LIMIT)
|
||||||
@ -211,6 +221,8 @@ def add_pl_pcdu_cmds(defs: TmtcDefinitionWrapper):
|
|||||||
info="Inject failure in MPA to HPA transition",
|
info="Inject failure in MPA to HPA transition",
|
||||||
)
|
)
|
||||||
oce.add(keys=OpCode.INJECT_ALL_ON_FAILURE, info="Inject failure in all on mode")
|
oce.add(keys=OpCode.INJECT_ALL_ON_FAILURE, info="Inject failure in all on mode")
|
||||||
|
oce.add(keys=OpCode.DISABLE_ORDER_CHECKING, info=Info.DISABLE_ORDER_CHECKING)
|
||||||
|
oce.add(keys=OpCode.ENABLE_ORDER_CHECKING, info=Info.ENABLE_ORDER_CHECKING)
|
||||||
defs.add_service(CustomServiceList.PL_PCDU.value, "PL PCDU", oce)
|
defs.add_service(CustomServiceList.PL_PCDU.value, "PL PCDU", oce)
|
||||||
|
|
||||||
|
|
||||||
@ -281,6 +293,14 @@ def pack_pl_pcdu_commands( # noqa C901: Complexity is okay here.
|
|||||||
mode=Mode.NORMAL,
|
mode=Mode.NORMAL,
|
||||||
submode=submode_mask_to_submode(NormalSubmodesMask.HPA_ON),
|
submode=submode_mask_to_submode(NormalSubmodesMask.HPA_ON),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if op_code == OpCode.NORMAL_CUSTOM:
|
||||||
|
pack_pl_pcdu_mode_cmd(
|
||||||
|
q=q,
|
||||||
|
info=Info.NORMAL_CUSTOM,
|
||||||
|
mode=Mode.NORMAL,
|
||||||
|
submode=prompt_custom_normal_submode(),
|
||||||
|
)
|
||||||
if op_code == OpCode.REQ_OS_HK:
|
if op_code == OpCode.REQ_OS_HK:
|
||||||
q.add_log_cmd(f"PL PCDU: {Info.REQ_OS_HK}")
|
q.add_log_cmd(f"PL PCDU: {Info.REQ_OS_HK}")
|
||||||
q.add_pus_tc(
|
q.add_pus_tc(
|
||||||
@ -288,6 +308,26 @@ def pack_pl_pcdu_commands( # noqa C901: Complexity is okay here.
|
|||||||
sid=make_sid(object_id=PL_PCDU_ID, set_id=SetId.ADC)
|
sid=make_sid(object_id=PL_PCDU_ID, set_id=SetId.ADC)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
if op_code == OpCode.DISABLE_ORDER_CHECKING:
|
||||||
|
q.add_log_cmd(Info.DISABLE_ORDER_CHECKING)
|
||||||
|
q.add_pus_tc(
|
||||||
|
create_load_param_cmd(
|
||||||
|
create_scalar_boolean_parameter(
|
||||||
|
PL_PCDU_ID, 0, ParamId.DISABLE_ORDER_CHECK_CHANNELS, True
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
if op_code == OpCode.ENABLE_ORDER_CHECKING:
|
||||||
|
q.add_log_cmd(Info.ENABLE_ORDER_CHECKING)
|
||||||
|
q.add_pus_tc(
|
||||||
|
create_load_param_cmd(
|
||||||
|
create_scalar_boolean_parameter(
|
||||||
|
PL_PCDU_ID, 0, ParamId.DISABLE_ORDER_CHECK_CHANNELS, False
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
if op_code == OpCode.UPDATE_I_UPPER_LIMIT:
|
if op_code == OpCode.UPDATE_I_UPPER_LIMIT:
|
||||||
q.add_log_cmd(Info.UPDATE_I_UPPER_LIMIT)
|
q.add_log_cmd(Info.UPDATE_I_UPPER_LIMIT)
|
||||||
print("Select device to update lower current limit for: ")
|
print("Select device to update lower current limit for: ")
|
||||||
@ -634,3 +674,31 @@ def dev_select_to_upper_u_update_param_id(dev_select: DevSelect) -> ParamId:
|
|||||||
if param_id is None:
|
if param_id is None:
|
||||||
raise ValueError("invalid parameter ID")
|
raise ValueError("invalid parameter ID")
|
||||||
return param_id
|
return param_id
|
||||||
|
|
||||||
|
|
||||||
|
def prompt_custom_normal_submode() -> int:
|
||||||
|
print("Prompting custom submode.")
|
||||||
|
submode = 0
|
||||||
|
|
||||||
|
def prompt_channel(submode: int, channel_str: str, mask: NormalSubmodesMask) -> int:
|
||||||
|
while True:
|
||||||
|
channel_on = input(f" {channel_str} ON? [y/n]: ")
|
||||||
|
if channel_on in ["y", "1", "yes"]:
|
||||||
|
submode |= 1 << mask
|
||||||
|
elif channel_on in ["n", "0", "no"]:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
_LOGGER.warning("invalid input, try again")
|
||||||
|
continue
|
||||||
|
break
|
||||||
|
return submode
|
||||||
|
|
||||||
|
submode = prompt_channel(
|
||||||
|
submode, "SSR", NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON
|
||||||
|
)
|
||||||
|
submode = prompt_channel(submode, "DRO", NormalSubmodesMask.DRO_ON)
|
||||||
|
submode = prompt_channel(submode, "X8", NormalSubmodesMask.X8_ON)
|
||||||
|
submode = prompt_channel(submode, "TX", NormalSubmodesMask.TX_ON)
|
||||||
|
submode = prompt_channel(submode, "MPA", NormalSubmodesMask.MPA_ON)
|
||||||
|
submode = prompt_channel(submode, "HPA", NormalSubmodesMask.HPA_ON)
|
||||||
|
return submode
|
||||||
|
@ -28,10 +28,12 @@ from tmtccmd.util import ObjectIdU32
|
|||||||
|
|
||||||
|
|
||||||
class P60OpCode:
|
class P60OpCode:
|
||||||
STACK_3V3_ON = ["stack_3v3_on", "1"]
|
STACK_3V3_ON = "stack_3v3_on"
|
||||||
STACK_3V3_OFF = ["stack_3v3_off", "2"]
|
STACK_3V3_OFF = "stack_3v3_off"
|
||||||
STACK_5V_ON = ["stack_5v_on", "3"]
|
STACK_5V_ON = "stack_5v_on"
|
||||||
STACK_5V_OFF = ["stack_5v_off", "4"]
|
STACK_5V_OFF = "stack_5v_off"
|
||||||
|
ACU_OFF = "acu_off"
|
||||||
|
ACU_ON = "acu_on"
|
||||||
TEST = ["test", "0"]
|
TEST = ["test", "0"]
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,10 +1,15 @@
|
|||||||
from spacepackets.ecss import PusTelecommand, PusService
|
import struct
|
||||||
|
import datetime
|
||||||
|
import math
|
||||||
|
|
||||||
|
from spacepackets.ecss import PusService, PusTelecommand
|
||||||
from tmtccmd.config import CoreServiceList
|
from tmtccmd.config import CoreServiceList
|
||||||
from tmtccmd.config.tmtc import (
|
from tmtccmd.config.tmtc import (
|
||||||
tmtc_definitions_provider,
|
|
||||||
TmtcDefinitionWrapper,
|
|
||||||
OpCodeEntry,
|
OpCodeEntry,
|
||||||
|
TmtcDefinitionWrapper,
|
||||||
|
tmtc_definitions_provider,
|
||||||
)
|
)
|
||||||
|
from tmtccmd.pus.s11_tc_sched import create_time_tagged_cmd
|
||||||
from tmtccmd.pus.s17_test import create_service_17_ping_command
|
from tmtccmd.pus.s17_test import create_service_17_ping_command
|
||||||
from tmtccmd.tmtc import service_provider
|
from tmtccmd.tmtc import service_provider
|
||||||
from tmtccmd.tmtc.decorator import ServiceProviderParams
|
from tmtccmd.tmtc.decorator import ServiceProviderParams
|
||||||
@ -14,12 +19,14 @@ class OpCodes:
|
|||||||
PING = "ping"
|
PING = "ping"
|
||||||
TRIGGER_EVENT = "trig_event"
|
TRIGGER_EVENT = "trig_event"
|
||||||
PING_WITH_DATA = "ping_with_data"
|
PING_WITH_DATA = "ping_with_data"
|
||||||
|
SCHEDULE_PING = "sched_ping"
|
||||||
|
|
||||||
|
|
||||||
class Info:
|
class Info:
|
||||||
PING = "Simple Ping and Connection Test"
|
PING = "Simple Ping and Connection Test"
|
||||||
TRIGGER_EVENT = "Trigger an event"
|
TRIGGER_EVENT = "Trigger an event"
|
||||||
PING_WITH_DATA = "Ping with data. Size of sent data is sent back"
|
PING_WITH_DATA = "Ping with data. Size of sent data is sent back"
|
||||||
|
SCHEDULE_PING = "Schedule a ping"
|
||||||
|
|
||||||
|
|
||||||
@tmtc_definitions_provider
|
@tmtc_definitions_provider
|
||||||
@ -28,6 +35,7 @@ def add_test_defs(defs: TmtcDefinitionWrapper):
|
|||||||
oce.add(keys=OpCodes.PING, info=Info.PING)
|
oce.add(keys=OpCodes.PING, info=Info.PING)
|
||||||
oce.add(keys=OpCodes.TRIGGER_EVENT, info=Info.TRIGGER_EVENT)
|
oce.add(keys=OpCodes.TRIGGER_EVENT, info=Info.TRIGGER_EVENT)
|
||||||
oce.add(keys=OpCodes.PING_WITH_DATA, info=Info.PING_WITH_DATA)
|
oce.add(keys=OpCodes.PING_WITH_DATA, info=Info.PING_WITH_DATA)
|
||||||
|
oce.add(keys=OpCodes.SCHEDULE_PING, info=Info.SCHEDULE_PING)
|
||||||
|
|
||||||
defs.add_service(
|
defs.add_service(
|
||||||
name=CoreServiceList.SERVICE_17_ALT,
|
name=CoreServiceList.SERVICE_17_ALT,
|
||||||
@ -46,6 +54,21 @@ def pack_test_command(p: ServiceProviderParams):
|
|||||||
if info.op_code == OpCodes.TRIGGER_EVENT:
|
if info.op_code == OpCodes.TRIGGER_EVENT:
|
||||||
q.add_log_cmd("Sending PUS TC Event Trigger [17, 128]")
|
q.add_log_cmd("Sending PUS TC Event Trigger [17, 128]")
|
||||||
q.add_pus_tc(PusTelecommand(service=PusService.S17_TEST, subservice=128))
|
q.add_pus_tc(PusTelecommand(service=PusService.S17_TEST, subservice=128))
|
||||||
|
if info.op_code == OpCodes.SCHEDULE_PING:
|
||||||
|
q.add_log_cmd("Sending scheduled PUS ping")
|
||||||
|
# Generate a UNIX timestamp 30 seconds in the future using the datetime API with a UTC timezone
|
||||||
|
now = datetime.datetime.now(tz=datetime.timezone.utc)
|
||||||
|
second_offset_to_now = input("Please specify offset to now in seconds: ")
|
||||||
|
now += datetime.timedelta(seconds=int(second_offset_to_now))
|
||||||
|
unix_stamp = struct.pack("!I", math.floor(now.timestamp()))
|
||||||
|
print(f"Sending ping scheuled at {now}")
|
||||||
|
ping = PusTelecommand(service=PusService.S17_TEST, subservice=128)
|
||||||
|
q.add_pus_tc(
|
||||||
|
create_time_tagged_cmd(
|
||||||
|
release_time=unix_stamp,
|
||||||
|
tc_to_insert=ping,
|
||||||
|
)
|
||||||
|
)
|
||||||
if info.op_code == OpCodes.PING_WITH_DATA:
|
if info.op_code == OpCodes.PING_WITH_DATA:
|
||||||
q.add_log_cmd("Sending Ping With Data, Size Reported Back [17, 129]")
|
q.add_log_cmd("Sending Ping With Data, Size Reported Back [17, 129]")
|
||||||
while True:
|
while True:
|
||||||
|
@ -3,6 +3,7 @@ import enum
|
|||||||
import logging
|
import logging
|
||||||
import math
|
import math
|
||||||
import struct
|
import struct
|
||||||
|
from typing import Tuple
|
||||||
|
|
||||||
from eive_tmtc.config.object_ids import (
|
from eive_tmtc.config.object_ids import (
|
||||||
HK_TM_STORE,
|
HK_TM_STORE,
|
||||||
@ -19,20 +20,25 @@ from tmtccmd.tmtc import service_provider
|
|||||||
from tmtccmd.tmtc.decorator import ServiceProviderParams
|
from tmtccmd.tmtc.decorator import ServiceProviderParams
|
||||||
from dateutil.parser import parse
|
from dateutil.parser import parse
|
||||||
|
|
||||||
from spacepackets.ecss import PusService # noqa
|
|
||||||
from spacepackets.ecss.tc import PusTelecommand
|
from spacepackets.ecss.tc import PusTelecommand
|
||||||
from spacepackets.ecss.pus_15_tm_storage import Subservice
|
from spacepackets.ecss.pus_15_tm_storage import Subservice
|
||||||
from tmtccmd.util import ObjectIdU32
|
from tmtccmd.util import ObjectIdU32
|
||||||
|
|
||||||
|
|
||||||
|
class CustomSubservice(enum.IntEnum):
|
||||||
|
DELETE_BY_TIME_RANGE = 128
|
||||||
|
|
||||||
|
|
||||||
class OpCode:
|
class OpCode:
|
||||||
RETRIEVAL_BY_TIME_RANGE = "retrieval_time_range"
|
RETRIEVAL_BY_TIME_RANGE = "retrieval_time_range"
|
||||||
DELETE_UP_TO = "delete_up_to"
|
DELETE_UP_TO = "delete_up_to"
|
||||||
|
DELETE_BY_TIME_RANGE = "delete_time_range"
|
||||||
|
|
||||||
|
|
||||||
class Info:
|
class Info:
|
||||||
RETRIEVAL_BY_TIME_RANGE = "Dump Telemetry Packets by time range"
|
RETRIEVAL_BY_TIME_RANGE = "Dump Telemetry Packets by time range"
|
||||||
DELETE_UP_TO = "Delete Telemetry Packets up to time"
|
DELETE_UP_TO = "Delete Telemetry Packets up to time"
|
||||||
|
DELETE_BY_TIME_RANGE = "Delete Telemetry by time range"
|
||||||
|
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
@ -43,7 +49,7 @@ def pack_tm_store_commands(p: ServiceProviderParams):
|
|||||||
q = p.queue_helper
|
q = p.queue_helper
|
||||||
o = p.op_code
|
o = p.op_code
|
||||||
if o == OpCode.DELETE_UP_TO:
|
if o == OpCode.DELETE_UP_TO:
|
||||||
obj_id, store_string = store_select_prompt()
|
obj_id, _ = store_select_prompt()
|
||||||
app_data = bytearray(obj_id.as_bytes)
|
app_data = bytearray(obj_id.as_bytes)
|
||||||
delete_up_to_time = time_prompt("Determining deletion end time")
|
delete_up_to_time = time_prompt("Determining deletion end time")
|
||||||
end_stamp = int(math.floor(delete_up_to_time.timestamp()))
|
end_stamp = int(math.floor(delete_up_to_time.timestamp()))
|
||||||
@ -58,7 +64,7 @@ def pack_tm_store_commands(p: ServiceProviderParams):
|
|||||||
)
|
)
|
||||||
elif o == OpCode.RETRIEVAL_BY_TIME_RANGE:
|
elif o == OpCode.RETRIEVAL_BY_TIME_RANGE:
|
||||||
q.add_log_cmd(Info.RETRIEVAL_BY_TIME_RANGE)
|
q.add_log_cmd(Info.RETRIEVAL_BY_TIME_RANGE)
|
||||||
obj_id, store_string = store_select_prompt()
|
obj_id, _ = store_select_prompt()
|
||||||
app_data = bytearray(obj_id.as_bytes)
|
app_data = bytearray(obj_id.as_bytes)
|
||||||
start_of_dump_time = time_prompt("Determining retrieval start time")
|
start_of_dump_time = time_prompt("Determining retrieval start time")
|
||||||
start_stamp = int(math.floor(start_of_dump_time.timestamp()))
|
start_stamp = int(math.floor(start_of_dump_time.timestamp()))
|
||||||
@ -78,6 +84,28 @@ def pack_tm_store_commands(p: ServiceProviderParams):
|
|||||||
app_data=app_data,
|
app_data=app_data,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
elif o == OpCode.DELETE_BY_TIME_RANGE:
|
||||||
|
q.add_log_cmd(Info.DELETE_BY_TIME_RANGE)
|
||||||
|
obj_id, _ = store_select_prompt()
|
||||||
|
app_data = bytearray(obj_id.as_bytes)
|
||||||
|
start_of_dump_time = time_prompt("Determining deletion start time")
|
||||||
|
start_stamp = int(math.floor(start_of_dump_time.timestamp()))
|
||||||
|
end_of_dump_time = time_prompt("Determining deletion end time")
|
||||||
|
end_stamp = int(math.floor(end_of_dump_time.timestamp()))
|
||||||
|
app_data.extend(struct.pack("!I", start_stamp))
|
||||||
|
app_data.extend(struct.pack("!I", end_stamp))
|
||||||
|
q.add_log_cmd(Info.DELETE_BY_TIME_RANGE)
|
||||||
|
q.add_log_cmd(f"Selected Store: {obj_id}")
|
||||||
|
q.add_log_cmd(
|
||||||
|
f"Deletion from time {start_of_dump_time} up to time {end_of_dump_time}"
|
||||||
|
)
|
||||||
|
q.add_pus_tc(
|
||||||
|
PusTelecommand(
|
||||||
|
service=15,
|
||||||
|
subservice=CustomSubservice.DELETE_BY_TIME_RANGE,
|
||||||
|
app_data=app_data,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@tmtc_definitions_provider
|
@tmtc_definitions_provider
|
||||||
@ -85,6 +113,7 @@ def add_persistent_tm_store_cmd_defs(defs: TmtcDefinitionWrapper):
|
|||||||
oce = OpCodeEntry()
|
oce = OpCodeEntry()
|
||||||
oce.add(keys=OpCode.DELETE_UP_TO, info=Info.DELETE_UP_TO)
|
oce.add(keys=OpCode.DELETE_UP_TO, info=Info.DELETE_UP_TO)
|
||||||
oce.add(keys=OpCode.RETRIEVAL_BY_TIME_RANGE, info=Info.RETRIEVAL_BY_TIME_RANGE)
|
oce.add(keys=OpCode.RETRIEVAL_BY_TIME_RANGE, info=Info.RETRIEVAL_BY_TIME_RANGE)
|
||||||
|
oce.add(keys=OpCode.DELETE_BY_TIME_RANGE, info=Info.DELETE_BY_TIME_RANGE)
|
||||||
defs.add_service(
|
defs.add_service(
|
||||||
CustomServiceList.TM_STORE, "Persistent TM Store", op_code_entry=oce
|
CustomServiceList.TM_STORE, "Persistent TM Store", op_code_entry=oce
|
||||||
)
|
)
|
||||||
@ -130,6 +159,8 @@ def time_prompt(info_str: str) -> datetime.datetime:
|
|||||||
return time_prompt_fully_manually()
|
return time_prompt_fully_manually()
|
||||||
elif time_input_key == 2:
|
elif time_input_key == 2:
|
||||||
return time_prompt_offset_from_now()
|
return time_prompt_offset_from_now()
|
||||||
|
else:
|
||||||
|
raise ValueError()
|
||||||
|
|
||||||
|
|
||||||
def time_prompt_fully_manually() -> datetime.datetime:
|
def time_prompt_fully_manually() -> datetime.datetime:
|
||||||
@ -160,7 +191,7 @@ def time_prompt_offset_from_now() -> datetime.datetime:
|
|||||||
return time_now_with_offset
|
return time_now_with_offset
|
||||||
|
|
||||||
|
|
||||||
def store_select_prompt() -> (ObjectIdU32, str):
|
def store_select_prompt() -> Tuple[ObjectIdU32, str]:
|
||||||
obj_id_dict = get_object_ids()
|
obj_id_dict = get_object_ids()
|
||||||
print("Available TM stores:")
|
print("Available TM stores:")
|
||||||
for k, v in STORE_DICT.items():
|
for k, v in STORE_DICT.items():
|
||||||
|
@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
|
|||||||
name = "eive-tmtc"
|
name = "eive-tmtc"
|
||||||
description = "TMTC Commander EIVE"
|
description = "TMTC Commander EIVE"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
version = "5.10.1"
|
version = "5.13.0"
|
||||||
requires-python = ">=3.10"
|
requires-python = ">=3.10"
|
||||||
license = {text = "Apache-2.0"}
|
license = {text = "Apache-2.0"}
|
||||||
authors = [
|
authors = [
|
||||||
|
Reference in New Issue
Block a user