Compare commits
26 Commits
Author | SHA1 | Date | |
---|---|---|---|
d9945d4054 | |||
1947ebcb1f | |||
cf2b7443d4 | |||
49521e1661 | |||
08c315fbf9 | |||
1e143ea6fa | |||
8b677041e2 | |||
ff787f4497 | |||
7e90d6183c | |||
20e107c7ae | |||
4f9c728e51 | |||
bd3b666f8c | |||
483ebe87ad | |||
9b7471e909 | |||
09cf960350 | |||
d47da4c314 | |||
2d79f6f484 | |||
d99adf55a1 | |||
6db34aacaa | |||
654a5a2e13 | |||
8ec086f778 | |||
8d23f29f94 | |||
9178251ed7 | |||
d7c30ba406 | |||
24f6a59cf9 | |||
9016d3d992 |
32
CHANGELOG.md
32
CHANGELOG.md
@ -10,6 +10,37 @@ list yields a list of all related PRs for each release.
|
|||||||
|
|
||||||
# [unreleased]
|
# [unreleased]
|
||||||
|
|
||||||
|
# [v2.12.7] 2023-02-17
|
||||||
|
|
||||||
|
- Re-run generators
|
||||||
|
- Small fix for HK parsing, faulty printout
|
||||||
|
|
||||||
|
# [v2.12.6] 2023-02-14
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
|
||||||
|
- Fixed GPS processed set output
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
|
- Added command to request switcher set from PCDU handler.
|
||||||
|
|
||||||
|
# [v2.12.5] 2023-02-13
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
|
- EIVE system commands
|
||||||
|
|
||||||
|
# [v2.12.4] 2023-02-12
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
|
||||||
|
- `tmtccmd` bumped to v4.0.0rc2, package discovery was broken.
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
|
- Syrlinks temperatur set readout
|
||||||
|
|
||||||
# [v2.12.3] 2023-02-10
|
# [v2.12.3] 2023-02-10
|
||||||
|
|
||||||
tmtccmd v4.0.0rc1
|
tmtccmd v4.0.0rc1
|
||||||
@ -108,7 +139,6 @@ tmtccmd v4.0.0rc0
|
|||||||
|
|
||||||
## Added
|
## Added
|
||||||
|
|
||||||
- Added command to request switcher set from PCDU handler.
|
|
||||||
- Star Tracker: Add commands to update default datarate.
|
- Star Tracker: Add commands to update default datarate.
|
||||||
|
|
||||||
## Changed
|
## Changed
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
__version__ = "2.12.3"
|
__version__ = "2.12.7"
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
@ -6,7 +6,7 @@ from pathlib import Path
|
|||||||
SW_NAME = "eive-tmtc"
|
SW_NAME = "eive-tmtc"
|
||||||
VERSION_MAJOR = 2
|
VERSION_MAJOR = 2
|
||||||
VERSION_MINOR = 12
|
VERSION_MINOR = 12
|
||||||
VERSION_REVISION = 3
|
VERSION_REVISION = 7
|
||||||
|
|
||||||
EIVE_TMTC_ROOT = Path(__file__).parent
|
EIVE_TMTC_ROOT = Path(__file__).parent
|
||||||
PACKAGE_ROOT = EIVE_TMTC_ROOT.parent
|
PACKAGE_ROOT = EIVE_TMTC_ROOT.parent
|
||||||
|
@ -71,6 +71,6 @@ class CustomServiceList(str, enum.Enum):
|
|||||||
RTD = "rtd"
|
RTD = "rtd"
|
||||||
TMP1075 = "tcs_tmp"
|
TMP1075 = "tcs_tmp"
|
||||||
TVTTESTPROCEDURE = "tvtestproc"
|
TVTTESTPROCEDURE = "tvtestproc"
|
||||||
CONTROLLERS = "controllers"
|
|
||||||
SCEX = "scex"
|
SCEX = "scex"
|
||||||
TM_STORE = "tm_store"
|
TM_STORE = "tm_store"
|
||||||
|
SYSTEM = "system"
|
||||||
|
@ -121,8 +121,8 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
|
|||||||
11706;0x2dba;SELF_TEST_MTM_RANGE_FAILURE;LOW;Get self test result returns failure that MTM values were outside of the expected range. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/ImtqHandler.h
|
11706;0x2dba;SELF_TEST_MTM_RANGE_FAILURE;LOW;Get self test result returns failure that MTM values were outside of the expected range. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/ImtqHandler.h
|
||||||
11707;0x2dbb;SELF_TEST_COIL_CURRENT_FAILURE;LOW;Get self test result returns failure indicating that the coil current was outside of the expected range P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/ImtqHandler.h
|
11707;0x2dbb;SELF_TEST_COIL_CURRENT_FAILURE;LOW;Get self test result returns failure indicating that the coil current was outside of the expected range P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/ImtqHandler.h
|
||||||
11708;0x2dbc;INVALID_ERROR_BYTE;LOW;Received invalid error byte. This indicates an error of the communication link between IMTQ and OBC.;mission/devices/ImtqHandler.h
|
11708;0x2dbc;INVALID_ERROR_BYTE;LOW;Received invalid error byte. This indicates an error of the communication link between IMTQ and OBC.;mission/devices/ImtqHandler.h
|
||||||
11801;0x2e19;ERROR_STATE;HIGH;Reaction wheel signals an error state;mission/devices/devicedefinitions/RwDefinitions.h
|
11801;0x2e19;ERROR_STATE;HIGH;Reaction wheel signals an error state;mission/devices/devicedefinitions/rwHelpers.h
|
||||||
11802;0x2e1a;RESET_OCCURED;LOW;;mission/devices/devicedefinitions/RwDefinitions.h
|
11802;0x2e1a;RESET_OCCURED;LOW;;mission/devices/devicedefinitions/rwHelpers.h
|
||||||
11901;0x2e7d;BOOTING_FIRMWARE_FAILED;LOW;Failed to boot firmware;linux/devices/startracker/StarTrackerHandler.h
|
11901;0x2e7d;BOOTING_FIRMWARE_FAILED;LOW;Failed to boot firmware;linux/devices/startracker/StarTrackerHandler.h
|
||||||
11902;0x2e7e;BOOTING_BOOTLOADER_FAILED;LOW;Failed to boot star tracker into bootloader mode;linux/devices/startracker/StarTrackerHandler.h
|
11902;0x2e7e;BOOTING_BOOTLOADER_FAILED;LOW;Failed to boot star tracker into bootloader mode;linux/devices/startracker/StarTrackerHandler.h
|
||||||
12001;0x2ee1;SUPV_MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC supervisor crc failure in telemetry packet;linux/devices/ploc/PlocSupervisorHandler.h
|
12001;0x2ee1;SUPV_MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC supervisor crc failure in telemetry packet;linux/devices/ploc/PlocSupervisorHandler.h
|
||||||
|
|
@ -126,6 +126,7 @@ SUS_5_N_LOC_XFYMZB_PT_ZB = bytes([0x44, 0x12, 0x00, 0x37])
|
|||||||
SUS_11_R_LOC_XBYMZB_PT_ZB = bytes([0x44, 0x12, 0x00, 0x43])
|
SUS_11_R_LOC_XBYMZB_PT_ZB = bytes([0x44, 0x12, 0x00, 0x43])
|
||||||
|
|
||||||
# System and Assembly Objects
|
# System and Assembly Objects
|
||||||
|
EIVE_SYSTEM_ID = bytes([0x73, 0x01, 0x00, 0x00])
|
||||||
ACS_SUBSYSTEM_ID = bytes([0x73, 0x01, 0x00, 0x01])
|
ACS_SUBSYSTEM_ID = bytes([0x73, 0x01, 0x00, 0x01])
|
||||||
PL_SUBSYSTEM_ID = bytes([0x73, 0x01, 0x00, 0x02])
|
PL_SUBSYSTEM_ID = bytes([0x73, 0x01, 0x00, 0x02])
|
||||||
TCS_SUBSYSTEM_ID = bytes([0x73, 0x01, 0x00, 0x03])
|
TCS_SUBSYSTEM_ID = bytes([0x73, 0x01, 0x00, 0x03])
|
||||||
|
@ -76,7 +76,7 @@
|
|||||||
0x49010005;GPIO_IF
|
0x49010005;GPIO_IF
|
||||||
0x49010006;SCEX_UART_READER
|
0x49010006;SCEX_UART_READER
|
||||||
0x49020004;SPI_MAIN_COM_IF
|
0x49020004;SPI_MAIN_COM_IF
|
||||||
0x49020005;SPI_RW_COM_IF
|
0x49020005;RW_POLLING_TASK
|
||||||
0x49020006;SPI_RTD_COM_IF
|
0x49020006;SPI_RTD_COM_IF
|
||||||
0x49030003;UART_COM_IF
|
0x49030003;UART_COM_IF
|
||||||
0x49040002;I2C_COM_IF
|
0x49040002;I2C_COM_IF
|
||||||
|
|
@ -3,6 +3,14 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path
|
|||||||
0x0001;Failed;Unspecified system-wide code for failed.;1;HasReturnvaluesIF;fsfw/returnvalues/returnvalue.h
|
0x0001;Failed;Unspecified system-wide code for failed.;1;HasReturnvaluesIF;fsfw/returnvalues/returnvalue.h
|
||||||
0x63a0;NVMB_KeyNotExists;Specified key does not exist in json file;160;NVM_PARAM_BASE;mission/memory/NVMParameterBase.h
|
0x63a0;NVMB_KeyNotExists;Specified key does not exist in json file;160;NVM_PARAM_BASE;mission/memory/NVMParameterBase.h
|
||||||
0x6300;NVMB_Busy;;0;NVM_PARAM_BASE;mission/system/objects/Stack5VHandler.h
|
0x6300;NVMB_Busy;;0;NVM_PARAM_BASE;mission/system/objects/Stack5VHandler.h
|
||||||
|
0x52b0;RWHA_SpiWriteFailure;;176;RW_HANDLER;mission/devices/devicedefinitions/rwHelpers.h
|
||||||
|
0x52b1;RWHA_SpiReadFailure;Used by the spi send function to tell a failing read call;177;RW_HANDLER;mission/devices/devicedefinitions/rwHelpers.h
|
||||||
|
0x52b2;RWHA_MissingStartSign;Can be used by the HDLC decoding mechanism to inform about a missing start sign 0x7E;178;RW_HANDLER;mission/devices/devicedefinitions/rwHelpers.h
|
||||||
|
0x52b3;RWHA_InvalidSubstitute;Can be used by the HDLC decoding mechanism to inform about an invalid substitution combination;179;RW_HANDLER;mission/devices/devicedefinitions/rwHelpers.h
|
||||||
|
0x52b4;RWHA_MissingEndSign;HDLC decoding mechanism never receives the end sign 0x7E;180;RW_HANDLER;mission/devices/devicedefinitions/rwHelpers.h
|
||||||
|
0x52b5;RWHA_NoReply;Reaction wheel only responds with empty frames.;181;RW_HANDLER;mission/devices/devicedefinitions/rwHelpers.h
|
||||||
|
0x52b6;RWHA_NoStartMarker;Expected a start marker as first byte;182;RW_HANDLER;mission/devices/devicedefinitions/rwHelpers.h
|
||||||
|
0x52b7;RWHA_SpiReadTimeout;Timeout when reading reply;183;RW_HANDLER;mission/devices/devicedefinitions/rwHelpers.h
|
||||||
0x58a0;SUSS_ErrorUnlockMutex;;160;SUS_HANDLER;mission/devices/SusHandler.h
|
0x58a0;SUSS_ErrorUnlockMutex;;160;SUS_HANDLER;mission/devices/SusHandler.h
|
||||||
0x58a1;SUSS_ErrorLockMutex;;161;SUS_HANDLER;mission/devices/SusHandler.h
|
0x58a1;SUSS_ErrorLockMutex;;161;SUS_HANDLER;mission/devices/SusHandler.h
|
||||||
0x66a0;SADPL_CommandNotSupported;;160;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h
|
0x66a0;SADPL_CommandNotSupported;;160;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h
|
||||||
@ -10,26 +18,14 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path
|
|||||||
0x66a2;SADPL_MainSwitchTimeoutFailure;;162;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h
|
0x66a2;SADPL_MainSwitchTimeoutFailure;;162;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h
|
||||||
0x66a3;SADPL_SwitchingDeplSa1Failed;;163;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h
|
0x66a3;SADPL_SwitchingDeplSa1Failed;;163;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h
|
||||||
0x66a4;SADPL_SwitchingDeplSa2Failed;;164;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h
|
0x66a4;SADPL_SwitchingDeplSa2Failed;;164;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h
|
||||||
0x51a0;IMTQ_InvalidCommandCode;;160;IMTQ_HANDLER;mission/devices/ImtqHandler.h
|
0x51a0;IMTQ_InvalidSpeed;Action Message with invalid speed was received. Valid speeds must be in the range of [-65000, 1000] or [1000, 65000];160;IMTQ_HANDLER;mission/devices/RwHandler.h
|
||||||
0x51a1;IMTQ_ParameterMissing;;161;IMTQ_HANDLER;mission/devices/ImtqHandler.h
|
0x51a1;IMTQ_InvalidRampTime;Action Message with invalid ramp time was received.;161;IMTQ_HANDLER;mission/devices/RwHandler.h
|
||||||
0x51a2;IMTQ_ParameterInvalid;;162;IMTQ_HANDLER;mission/devices/ImtqHandler.h
|
0x51a2;IMTQ_SetSpeedCommandInvalidLength;Received set speed command has invalid length. Should be 6.;162;IMTQ_HANDLER;mission/devices/RwHandler.h
|
||||||
0x51a3;IMTQ_CcUnavailable;;163;IMTQ_HANDLER;mission/devices/ImtqHandler.h
|
0x51a3;IMTQ_ExecutionFailed;Command execution failed;163;IMTQ_HANDLER;mission/devices/RwHandler.h
|
||||||
0x51a4;IMTQ_InternalProcessingError;;164;IMTQ_HANDLER;mission/devices/ImtqHandler.h
|
0x51a4;IMTQ_CrcError;Reaction wheel reply has invalid crc;164;IMTQ_HANDLER;mission/devices/RwHandler.h
|
||||||
0x51a5;IMTQ_RejectedWithoutReason;;165;IMTQ_HANDLER;mission/devices/ImtqHandler.h
|
0x51a5;IMTQ_ValueNotRead;;165;IMTQ_HANDLER;mission/devices/RwHandler.h
|
||||||
0x51a6;IMTQ_CmdErrUnknown;;166;IMTQ_HANDLER;mission/devices/ImtqHandler.h
|
0x51a6;IMTQ_CmdErrUnknown;;166;IMTQ_HANDLER;mission/devices/ImtqHandler.h
|
||||||
0x51a7;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.;167;IMTQ_HANDLER;mission/devices/ImtqHandler.h
|
0x51a7;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.;167;IMTQ_HANDLER;mission/devices/ImtqHandler.h
|
||||||
0x52b0;RWHA_SpiWriteFailure;;176;RW_HANDLER;mission/devices/RwHandler.h
|
|
||||||
0x52b1;RWHA_SpiReadFailure;Used by the spi send function to tell a failing read call;177;RW_HANDLER;mission/devices/RwHandler.h
|
|
||||||
0x52b2;RWHA_MissingStartSign;Can be used by the HDLC decoding mechanism to inform about a missing start sign 0x7E;178;RW_HANDLER;mission/devices/RwHandler.h
|
|
||||||
0x52b3;RWHA_InvalidSubstitute;Can be used by the HDLC decoding mechanism to inform about an invalid substitution combination;179;RW_HANDLER;mission/devices/RwHandler.h
|
|
||||||
0x52b4;RWHA_MissingEndSign;HDLC decoding mechanism never receives the end sign 0x7E;180;RW_HANDLER;mission/devices/RwHandler.h
|
|
||||||
0x52b5;RWHA_NoReply;Reaction wheel only responds with empty frames.;181;RW_HANDLER;mission/devices/RwHandler.h
|
|
||||||
0x52b6;RWHA_NoStartMarker;Expected a start marker as first byte;182;RW_HANDLER;mission/devices/RwHandler.h
|
|
||||||
0x52a0;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/devices/RwHandler.h
|
|
||||||
0x52a1;RWHA_InvalidRampTime;Action Message with invalid ramp time was received.;161;RW_HANDLER;mission/devices/RwHandler.h
|
|
||||||
0x52a2;RWHA_SetSpeedCommandInvalidLength;Received set speed command has invalid length. Should be 6.;162;RW_HANDLER;mission/devices/RwHandler.h
|
|
||||||
0x52a3;RWHA_ExecutionFailed;Command execution failed;163;RW_HANDLER;mission/devices/RwHandler.h
|
|
||||||
0x52a4;RWHA_CrcError;Reaction wheel reply has invalid crc;164;RW_HANDLER;mission/devices/RwHandler.h
|
|
||||||
0x50a0;SYRLINKS_CrcFailure;;160;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h
|
0x50a0;SYRLINKS_CrcFailure;;160;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h
|
||||||
0x50a1;SYRLINKS_UartFraminOrParityErrorAck;;161;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h
|
0x50a1;SYRLINKS_UartFraminOrParityErrorAck;;161;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h
|
||||||
0x50a2;SYRLINKS_BadCharacterAck;;162;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h
|
0x50a2;SYRLINKS_BadCharacterAck;;162;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h
|
||||||
|
|
@ -94,23 +94,3 @@ def add_str_cmds(defs: TmtcDefinitionWrapper):
|
|||||||
oce.add("70", "Star Tracker: Disable timestamp generation")
|
oce.add("70", "Star Tracker: Disable timestamp generation")
|
||||||
oce.add("71", "Star Tracker: Enable timestamp generation")
|
oce.add("71", "Star Tracker: Enable timestamp generation")
|
||||||
defs.add_service(CustomServiceList.STAR_TRACKER.value, "Star Tracker", oce)
|
defs.add_service(CustomServiceList.STAR_TRACKER.value, "Star Tracker", oce)
|
||||||
|
|
||||||
|
|
||||||
@tmtc_definitions_provider
|
|
||||||
def add_system_cmds(defs: TmtcDefinitionWrapper):
|
|
||||||
import eive_tmtc.pus_tc.system.controllers as controllers
|
|
||||||
|
|
||||||
oce = OpCodeEntry()
|
|
||||||
oce.add(
|
|
||||||
keys=controllers.OpCode.THERMAL_CONTROLLER,
|
|
||||||
info=controllers.Info.THERMAL_CONTROLLER,
|
|
||||||
)
|
|
||||||
oce.add(
|
|
||||||
keys=controllers.OpCode.CORE_CONTROLLER,
|
|
||||||
info=controllers.Info.CORE_CONTROLLER,
|
|
||||||
)
|
|
||||||
defs.add_service(
|
|
||||||
name=CustomServiceList.CONTROLLERS.value,
|
|
||||||
info="Controllers",
|
|
||||||
op_code_entry=oce,
|
|
||||||
)
|
|
||||||
|
@ -6,10 +6,6 @@ from typing import cast
|
|||||||
from eive_tmtc.tmtc.power.power import pack_power_commands
|
from eive_tmtc.tmtc.power.power import pack_power_commands
|
||||||
from eive_tmtc.tmtc.tcs.rtd import pack_rtd_commands
|
from eive_tmtc.tmtc.tcs.rtd import pack_rtd_commands
|
||||||
from eive_tmtc.tmtc.payload.scex import pack_scex_cmds
|
from eive_tmtc.tmtc.payload.scex import pack_scex_cmds
|
||||||
from eive_tmtc.pus_tc.system.controllers import (
|
|
||||||
pack_cmd_ctrl_to_prompted_mode,
|
|
||||||
get_object_from_op_code,
|
|
||||||
)
|
|
||||||
from eive_tmtc.tmtc.tcs.subsystem import pack_tcs_sys_commands
|
from eive_tmtc.tmtc.tcs.subsystem import pack_tcs_sys_commands
|
||||||
from tmtccmd import DefaultProcedureInfo, TcHandlerBase
|
from tmtccmd import DefaultProcedureInfo, TcHandlerBase
|
||||||
from tmtccmd.config import CoreServiceList
|
from tmtccmd.config import CoreServiceList
|
||||||
@ -194,15 +190,6 @@ def handle_default_procedure(
|
|||||||
return pack_tcs_sys_commands(q=queue_helper, op_code=op_code)
|
return pack_tcs_sys_commands(q=queue_helper, op_code=op_code)
|
||||||
if service == CustomServiceList.RW_ASSEMBLY.value:
|
if service == CustomServiceList.RW_ASSEMBLY.value:
|
||||||
return pack_rw_ass_cmds(q=queue_helper, object_id=RW_ASSEMBLY, op_code=op_code)
|
return pack_rw_ass_cmds(q=queue_helper, object_id=RW_ASSEMBLY, op_code=op_code)
|
||||||
if service == CustomServiceList.CONTROLLERS.value:
|
|
||||||
from tmtcc import TcHandler
|
|
||||||
|
|
||||||
tc_handler = cast(TcHandler, tc_base)
|
|
||||||
return pack_cmd_ctrl_to_prompted_mode(
|
|
||||||
q=queue_helper,
|
|
||||||
object_id=get_object_from_op_code(op_code),
|
|
||||||
gui=tc_handler.gui,
|
|
||||||
)
|
|
||||||
if service == CustomServiceList.SCEX.value:
|
if service == CustomServiceList.SCEX.value:
|
||||||
return pack_scex_cmds(
|
return pack_scex_cmds(
|
||||||
ServiceProviderParams(
|
ServiceProviderParams(
|
||||||
|
@ -24,6 +24,7 @@ from eive_tmtc.tmtc.power.tm import (
|
|||||||
handle_pdu_data,
|
handle_pdu_data,
|
||||||
handle_p60_hk_data,
|
handle_p60_hk_data,
|
||||||
handle_acu_hk_data,
|
handle_acu_hk_data,
|
||||||
|
handle_pcdu_hk,
|
||||||
)
|
)
|
||||||
from eive_tmtc.tmtc.acs.imtq import (
|
from eive_tmtc.tmtc.acs.imtq import (
|
||||||
ImtqSetId,
|
ImtqSetId,
|
||||||
@ -92,9 +93,9 @@ def handle_regular_hk_print(
|
|||||||
set_id = hk_packet.set_id
|
set_id = hk_packet.set_id
|
||||||
"""This function is called when a Service 3 Housekeeping packet is received."""
|
"""This function is called when a Service 3 Housekeeping packet is received."""
|
||||||
if objb in [obj_ids.RW1_ID, obj_ids.RW2_ID, obj_ids.RW3_ID, obj_ids.RW4_ID]:
|
if objb in [obj_ids.RW1_ID, obj_ids.RW2_ID, obj_ids.RW3_ID, obj_ids.RW4_ID]:
|
||||||
handle_rw_hk_data(printer, object_id, set_id, hk_data)
|
return handle_rw_hk_data(printer, object_id, set_id, hk_data)
|
||||||
elif objb == obj_ids.SYRLINKS_HANDLER_ID:
|
elif objb == obj_ids.SYRLINKS_HANDLER_ID:
|
||||||
handle_syrlinks_hk_data(printer=printer, hk_data=hk_data, set_id=set_id)
|
return handle_syrlinks_hk_data(printer=printer, hk_data=hk_data, set_id=set_id)
|
||||||
elif objb == obj_ids.IMTQ_HANDLER_ID:
|
elif objb == obj_ids.IMTQ_HANDLER_ID:
|
||||||
if (set_id >= ImtqSetId.POSITIVE_X_TEST) and (
|
if (set_id >= ImtqSetId.POSITIVE_X_TEST) and (
|
||||||
set_id <= ImtqSetId.NEGATIVE_Z_TEST
|
set_id <= ImtqSetId.NEGATIVE_Z_TEST
|
||||||
@ -110,8 +111,10 @@ def handle_regular_hk_print(
|
|||||||
_LOGGER.info("Service 3 TM: IMTQ handler reply with unknown set id")
|
_LOGGER.info("Service 3 TM: IMTQ handler reply with unknown set id")
|
||||||
elif objb == obj_ids.GPS_CONTROLLER:
|
elif objb == obj_ids.GPS_CONTROLLER:
|
||||||
return handle_gps_data(printer=printer, hk_data=hk_data)
|
return handle_gps_data(printer=printer, hk_data=hk_data)
|
||||||
|
elif objb == obj_ids.PCDU_HANDLER_ID:
|
||||||
|
return handle_pcdu_hk(printer=printer, set_id=set_id, hk_data=hk_data)
|
||||||
elif objb == obj_ids.BPX_HANDLER_ID:
|
elif objb == obj_ids.BPX_HANDLER_ID:
|
||||||
handle_bpx_hk_data(hk_data=hk_data, set_id=set_id, printer=printer)
|
return handle_bpx_hk_data(hk_data=hk_data, set_id=set_id, printer=printer)
|
||||||
elif objb == obj_ids.CORE_CONTROLLER_ID:
|
elif objb == obj_ids.CORE_CONTROLLER_ID:
|
||||||
return handle_core_hk_data(printer=printer, hk_data=hk_data, set_id=set_id)
|
return handle_core_hk_data(printer=printer, hk_data=hk_data, set_id=set_id)
|
||||||
elif objb == obj_ids.PDU_1_HANDLER_ID:
|
elif objb == obj_ids.PDU_1_HANDLER_ID:
|
||||||
@ -144,18 +147,18 @@ def handle_regular_hk_print(
|
|||||||
obj_ids.SUS_10_R_LOC_XMYBZF_PT_ZF,
|
obj_ids.SUS_10_R_LOC_XMYBZF_PT_ZF,
|
||||||
obj_ids.SUS_11_R_LOC_XBYMZB_PT_ZB,
|
obj_ids.SUS_11_R_LOC_XBYMZB_PT_ZB,
|
||||||
]:
|
]:
|
||||||
handle_sus_hk(
|
return handle_sus_hk(
|
||||||
object_id=object_id, hk_data=hk_data, printer=printer, set_id=set_id
|
object_id=object_id, hk_data=hk_data, printer=printer, set_id=set_id
|
||||||
)
|
)
|
||||||
elif objb == obj_ids.P60_DOCK_HANDLER:
|
elif objb == obj_ids.P60_DOCK_HANDLER:
|
||||||
handle_p60_hk_data(printer=printer, set_id=set_id, hk_data=hk_data)
|
return handle_p60_hk_data(printer=printer, set_id=set_id, hk_data=hk_data)
|
||||||
elif objb in [
|
elif objb in [
|
||||||
obj_ids.GYRO_0_ADIS_HANDLER_ID,
|
obj_ids.GYRO_0_ADIS_HANDLER_ID,
|
||||||
obj_ids.GYRO_1_L3G_HANDLER_ID,
|
obj_ids.GYRO_1_L3G_HANDLER_ID,
|
||||||
obj_ids.GYRO_2_ADIS_HANDLER_ID,
|
obj_ids.GYRO_2_ADIS_HANDLER_ID,
|
||||||
obj_ids.GYRO_3_L3G_HANDLER_ID,
|
obj_ids.GYRO_3_L3G_HANDLER_ID,
|
||||||
]:
|
]:
|
||||||
handle_gyros_hk_data(
|
return handle_gyros_hk_data(
|
||||||
object_id=object_id, hk_data=hk_data, printer=printer, set_id=set_id
|
object_id=object_id, hk_data=hk_data, printer=printer, set_id=set_id
|
||||||
)
|
)
|
||||||
elif objb in [
|
elif objb in [
|
||||||
@ -164,19 +167,19 @@ def handle_regular_hk_print(
|
|||||||
obj_ids.MGM_2_LIS3_HANDLER_ID,
|
obj_ids.MGM_2_LIS3_HANDLER_ID,
|
||||||
obj_ids.MGM_3_RM3100_HANDLER_ID,
|
obj_ids.MGM_3_RM3100_HANDLER_ID,
|
||||||
]:
|
]:
|
||||||
handle_mgm_hk_data(
|
return handle_mgm_hk_data(
|
||||||
object_id=object_id, hk_data=hk_data, printer=printer, set_id=set_id
|
object_id=object_id, hk_data=hk_data, printer=printer, set_id=set_id
|
||||||
)
|
)
|
||||||
elif objb == obj_ids.PL_PCDU_ID:
|
elif objb == obj_ids.PL_PCDU_ID:
|
||||||
handle_plpcdu_hk(set_id=set_id, hk_data=hk_data, printer=printer)
|
return handle_plpcdu_hk(set_id=set_id, hk_data=hk_data, printer=printer)
|
||||||
elif objb == obj_ids.THERMAL_CONTROLLER_ID:
|
elif objb == obj_ids.THERMAL_CONTROLLER_ID:
|
||||||
handle_thermal_controller_hk_data(
|
return handle_thermal_controller_hk_data(
|
||||||
object_id=object_id, printer=printer, set_id=set_id, hk_data=hk_data
|
object_id=object_id, printer=printer, set_id=set_id, hk_data=hk_data
|
||||||
)
|
)
|
||||||
elif objb == obj_ids.PLOC_SUPV_ID:
|
elif objb == obj_ids.PLOC_SUPV_ID:
|
||||||
handle_supv_hk_data(set_id=set_id, hk_data=hk_data, printer=printer)
|
return handle_supv_hk_data(set_id=set_id, hk_data=hk_data, printer=printer)
|
||||||
elif objb == obj_ids.ACS_CONTROLLER:
|
elif objb == obj_ids.ACS_CONTROLLER:
|
||||||
handle_acs_ctrl_hk_data(printer, set_id, hk_data)
|
return handle_acs_ctrl_hk_data(printer, set_id, hk_data)
|
||||||
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} "
|
||||||
|
@ -3,3 +3,4 @@ from .solar_array_deployment import add_sa_depl_cmds
|
|||||||
from .test import add_test_defs
|
from .test import add_test_defs
|
||||||
from .time import add_time_cmds
|
from .time import add_time_cmds
|
||||||
from .health import add_health_cmd_defs
|
from .health import add_health_cmd_defs
|
||||||
|
from .system import add_system_cmd_defs
|
||||||
|
@ -668,6 +668,7 @@ def handle_gps_data_processed(pw: PrintWrapper, hk_data: bytes):
|
|||||||
fmt_vec, hk_data[current_idx : current_idx + inc_len_vec]
|
fmt_vec, hk_data[current_idx : current_idx + inc_len_vec]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
current_idx += inc_len_vec
|
||||||
velo = [
|
velo = [
|
||||||
f"{val:8.3f}"
|
f"{val:8.3f}"
|
||||||
for val in struct.unpack(
|
for val in struct.unpack(
|
||||||
@ -679,7 +680,7 @@ def handle_gps_data_processed(pw: PrintWrapper, hk_data: bytes):
|
|||||||
pw.dlog(f"GPS Longitude: {long} [rad]")
|
pw.dlog(f"GPS Longitude: {long} [rad]")
|
||||||
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]")
|
||||||
pw.printer.print_validity_buffer(hk_data[current_idx:], num_vars=3)
|
pw.printer.print_validity_buffer(hk_data[current_idx:], num_vars=4)
|
||||||
|
|
||||||
|
|
||||||
def handle_mekf_data(pw: PrintWrapper, hk_data: bytes):
|
def handle_mekf_data(pw: PrintWrapper, hk_data: bytes):
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
@date 13.12.2020
|
@date 13.12.2020
|
||||||
"""
|
"""
|
||||||
import enum
|
import enum
|
||||||
|
import logging
|
||||||
|
import math
|
||||||
|
|
||||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||||
|
|
||||||
@ -21,6 +23,7 @@ from tmtccmd.tc.pus_3_fsfw_hk import (
|
|||||||
create_request_one_diag_command,
|
create_request_one_diag_command,
|
||||||
create_enable_periodic_hk_command_with_interval,
|
create_enable_periodic_hk_command_with_interval,
|
||||||
create_disable_periodic_hk_command,
|
create_disable_periodic_hk_command,
|
||||||
|
create_request_one_hk_command,
|
||||||
)
|
)
|
||||||
from spacepackets.ecss.tc import PusTelecommand
|
from spacepackets.ecss.tc import PusTelecommand
|
||||||
from tmtccmd.tc.pus_200_fsfw_mode import Mode, create_mode_command
|
from tmtccmd.tc.pus_200_fsfw_mode import Mode, create_mode_command
|
||||||
@ -46,6 +49,7 @@ class OpCode:
|
|||||||
NORMAL_RX_AND_TX_LOW_DATARATE = "nml_low_datarate"
|
NORMAL_RX_AND_TX_LOW_DATARATE = "nml_low_datarate"
|
||||||
NORMAL_RX_AND_TX_HIGH_DATARATE = "nml_high_datarate"
|
NORMAL_RX_AND_TX_HIGH_DATARATE = "nml_high_datarate"
|
||||||
HK_RX_REGS = "hk_rx_regs"
|
HK_RX_REGS = "hk_rx_regs"
|
||||||
|
HK_TEMPS = "hk_temps"
|
||||||
ENABLE_HK_RX_REGS = "enable_hk_rx"
|
ENABLE_HK_RX_REGS = "enable_hk_rx"
|
||||||
DISABLE_HK_RX_REGS = "disable_hk_rx"
|
DISABLE_HK_RX_REGS = "disable_hk_rx"
|
||||||
ENABLE_HK_TX_REGS = "enable_hk_tx"
|
ENABLE_HK_TX_REGS = "enable_hk_tx"
|
||||||
@ -65,6 +69,7 @@ class Info:
|
|||||||
NORMAL_RX_AND_TX_HIGH_DATARATE = "NORMAL RX and TX, TX with high datarate"
|
NORMAL_RX_AND_TX_HIGH_DATARATE = "NORMAL RX and TX, TX with high datarate"
|
||||||
HK_RX_REGS = "Request RX register set"
|
HK_RX_REGS = "Request RX register set"
|
||||||
HK_TX_REGS = "Request TX register set"
|
HK_TX_REGS = "Request TX register set"
|
||||||
|
HK_TEMPS = "Request Temperatures HK"
|
||||||
ENABLE_HK_RX_REGS = "Enable periodic RX register HK"
|
ENABLE_HK_RX_REGS = "Enable periodic RX register HK"
|
||||||
DISABLE_HK_RX_REGS = "Disable periodic RX register HK"
|
DISABLE_HK_RX_REGS = "Disable periodic RX register HK"
|
||||||
ENABLE_HK_TX_REGS = "Enable periodic TX register HK"
|
ENABLE_HK_TX_REGS = "Enable periodic TX register HK"
|
||||||
@ -123,6 +128,7 @@ def add_syrlinks_cmds(defs: TmtcDefinitionWrapper):
|
|||||||
oce.add(OpCode.DISABLE_HK_RX_REGS, Info.DISABLE_HK_RX_REGS)
|
oce.add(OpCode.DISABLE_HK_RX_REGS, Info.DISABLE_HK_RX_REGS)
|
||||||
oce.add(OpCode.ENABLE_HK_TX_REGS, Info.ENABLE_HK_TX_REGS)
|
oce.add(OpCode.ENABLE_HK_TX_REGS, Info.ENABLE_HK_TX_REGS)
|
||||||
oce.add(OpCode.DISABLE_HK_TX_REGS, Info.DISABLE_HK_TX_REGS)
|
oce.add(OpCode.DISABLE_HK_TX_REGS, Info.DISABLE_HK_TX_REGS)
|
||||||
|
oce.add(OpCode.HK_TEMPS, Info.HK_TEMPS)
|
||||||
oce.add("7", "Syrlinks Handler: Read TX waveform")
|
oce.add("7", "Syrlinks Handler: Read TX waveform")
|
||||||
oce.add("8", "Syrlinks Handler: Read TX AGC value high byte")
|
oce.add("8", "Syrlinks Handler: Read TX AGC value high byte")
|
||||||
oce.add("9", "Syrlinks Handler: Read TX AGC value low byte")
|
oce.add("9", "Syrlinks Handler: Read TX AGC value low byte")
|
||||||
@ -176,6 +182,10 @@ def pack_syrlinks_command(
|
|||||||
q.add_log_cmd(f"{prefix}: {Info.HK_RX_REGS}")
|
q.add_log_cmd(f"{prefix}: {Info.HK_RX_REGS}")
|
||||||
sid = make_sid(obyt, SetId.RX_REGISTERS_DATASET)
|
sid = make_sid(obyt, SetId.RX_REGISTERS_DATASET)
|
||||||
q.add_pus_tc(create_request_one_diag_command(sid))
|
q.add_pus_tc(create_request_one_diag_command(sid))
|
||||||
|
if op_code in OpCode.HK_TEMPS:
|
||||||
|
q.add_log_cmd(f"{prefix}: {Info.HK_TEMPS}")
|
||||||
|
sid = make_sid(obyt, SetId.TEMPERATURE_SET_ID)
|
||||||
|
q.add_pus_tc(create_request_one_hk_command(sid))
|
||||||
if op_code in OpCode.ENABLE_HK_RX_REGS:
|
if op_code in OpCode.ENABLE_HK_RX_REGS:
|
||||||
q.add_log_cmd(f"{prefix}: {Info.ENABLE_HK_RX_REGS}")
|
q.add_log_cmd(f"{prefix}: {Info.ENABLE_HK_RX_REGS}")
|
||||||
sid = make_sid(obyt, SetId.RX_REGISTERS_DATASET)
|
sid = make_sid(obyt, SetId.RX_REGISTERS_DATASET)
|
||||||
@ -257,11 +267,24 @@ def handle_syrlinks_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: byte
|
|||||||
return handle_syrlinks_rx_registers_dataset(printer, hk_data)
|
return handle_syrlinks_rx_registers_dataset(printer, hk_data)
|
||||||
elif set_id == SetId.TX_REGISTERS_DATASET:
|
elif set_id == SetId.TX_REGISTERS_DATASET:
|
||||||
return handle_syrlinks_tx_registers_dataset(printer, hk_data)
|
return handle_syrlinks_tx_registers_dataset(printer, hk_data)
|
||||||
|
elif set_id == SetId.TEMPERATURE_SET_ID:
|
||||||
|
return handle_syrlinks_temp_dataset(printer, hk_data)
|
||||||
else:
|
else:
|
||||||
pw = PrintWrapper(printer)
|
pw = PrintWrapper(printer)
|
||||||
pw.dlog(f"Service 3 TM: Syrlinks handler reply with unknown set ID {set_id}")
|
pw.dlog(f"Service 3 TM: Syrlinks handler reply with unknown set ID {set_id}")
|
||||||
|
|
||||||
|
|
||||||
|
def handle_syrlinks_temp_dataset(printer: FsfwTmTcPrinter, hk_data: bytes):
|
||||||
|
pw = PrintWrapper(printer)
|
||||||
|
if len(hk_data) < 8:
|
||||||
|
raise ValueError("expected at least 8 bytes of HK data")
|
||||||
|
temp_power_amplifier = struct.unpack("!f", hk_data[0:4])[0]
|
||||||
|
temp_baseband_board = struct.unpack("!f", hk_data[4:8])[0]
|
||||||
|
pw.dlog(f"Temperatur Power Amplifier [C]: {temp_power_amplifier}")
|
||||||
|
pw.dlog(f"Temperatur Baseband Board [C]: {temp_baseband_board}")
|
||||||
|
printer.print_validity_buffer(hk_data[8:], 2)
|
||||||
|
|
||||||
|
|
||||||
def handle_syrlinks_rx_registers_dataset(printer: FsfwTmTcPrinter, hk_data: bytes):
|
def handle_syrlinks_rx_registers_dataset(printer: FsfwTmTcPrinter, hk_data: bytes):
|
||||||
pw = PrintWrapper(printer)
|
pw = PrintWrapper(printer)
|
||||||
header_list = [
|
header_list = [
|
||||||
@ -269,21 +292,41 @@ def handle_syrlinks_rx_registers_dataset(printer: FsfwTmTcPrinter, hk_data: byte
|
|||||||
"RX Sensitivity",
|
"RX Sensitivity",
|
||||||
"RX Frequency Shift",
|
"RX Frequency Shift",
|
||||||
"RX IQ Power",
|
"RX IQ Power",
|
||||||
"RX AGC Value",
|
"RX AGC Value (Raw)",
|
||||||
"RX Demod Eb",
|
"RX Demod Eb",
|
||||||
"RX Demod N0",
|
"RX Demod N0",
|
||||||
"RX Datarate",
|
"RX Datarate [kbps]",
|
||||||
]
|
]
|
||||||
rx_status = hk_data[0]
|
rx_status = hk_data[0]
|
||||||
|
carrier_detect = rx_status & 0b1
|
||||||
|
carrier_lock = (rx_status >> 1) & 0b1
|
||||||
|
data_lock = (rx_status >> 2) & 0b1
|
||||||
|
data_valid = (rx_status >> 3) & 0b1
|
||||||
rx_sensitivity = struct.unpack("!I", hk_data[1:5])[0]
|
rx_sensitivity = struct.unpack("!I", hk_data[1:5])[0]
|
||||||
rx_frequency_shift = struct.unpack("!i", hk_data[5:9])[0]
|
rx_frequency_shift = struct.unpack("!i", hk_data[5:9])[0]
|
||||||
freq_shift_hz = rx_frequency_shift / 8.0
|
freq_shift_hz = rx_frequency_shift / 8.0
|
||||||
freq_shift_printout = f"Raw: {rx_frequency_shift}, Eng: {freq_shift_hz} Hz"
|
freq_shift_printout = f"Raw: {rx_frequency_shift}, Eng: {freq_shift_hz} Hz"
|
||||||
rx_iq_power = struct.unpack("!H", hk_data[9:11])[0]
|
rx_iq_power = struct.unpack("!H", hk_data[9:11])[0]
|
||||||
rx_agc_value = struct.unpack("!H", hk_data[11:13])[0]
|
rx_agc_value = struct.unpack("!H", hk_data[11:13])[0]
|
||||||
rx_demod_eb = struct.unpack("!I", hk_data[13:17])[0]
|
rx_agc_inhibit = (rx_agc_value >> 15) & 0b1
|
||||||
rx_demod_n0 = struct.unpack("!I", hk_data[17:21])[0]
|
rx_agc = rx_agc_value & 0xFFF
|
||||||
rx_data_rate = hk_data[21]
|
rx_demod_eb = struct.unpack("!I", hk_data[13:17])[0] & 0xFFFFFF
|
||||||
|
rx_demod_n0 = struct.unpack("!I", hk_data[17:21])[0] & 0xFFFFFF
|
||||||
|
eb_to_n0 = 20 * math.log10(rx_demod_eb / rx_demod_n0) - 3
|
||||||
|
rx_data_rate_raw = hk_data[21]
|
||||||
|
rx_data_rate = -1
|
||||||
|
if rx_data_rate_raw == 0:
|
||||||
|
rx_data_rate = 256
|
||||||
|
elif rx_data_rate_raw == 1:
|
||||||
|
rx_data_rate = 128
|
||||||
|
elif rx_data_rate_raw == 3:
|
||||||
|
rx_data_rate = 64
|
||||||
|
elif rx_data_rate_raw == 7:
|
||||||
|
rx_data_rate = 32
|
||||||
|
elif rx_data_rate_raw == 15:
|
||||||
|
rx_data_rate = 16
|
||||||
|
elif rx_data_rate_raw == 31:
|
||||||
|
rx_data_rate = 8
|
||||||
content_list = [
|
content_list = [
|
||||||
rx_status,
|
rx_status,
|
||||||
rx_sensitivity,
|
rx_sensitivity,
|
||||||
@ -298,6 +341,36 @@ def handle_syrlinks_rx_registers_dataset(printer: FsfwTmTcPrinter, hk_data: byte
|
|||||||
for header, content in zip(header_list, content_list):
|
for header, content in zip(header_list, content_list):
|
||||||
pw.dlog(f"{header}: {content}")
|
pw.dlog(f"{header}: {content}")
|
||||||
printer.print_validity_buffer(validity_buffer=validity_buffer, num_vars=8)
|
printer.print_validity_buffer(validity_buffer=validity_buffer, num_vars=8)
|
||||||
|
pw.dlog(f"Carrier Detect: {carrier_detect}")
|
||||||
|
pw.dlog(f"Carrier Lock: {carrier_lock}")
|
||||||
|
pw.dlog(f"Data Lock (data clock recovery loop lock status): {data_lock}")
|
||||||
|
pw.dlog(f"Data Valid (valid if TEB < 10e-5): {data_valid}")
|
||||||
|
pw.dlog(f"Data Lock (data clock recovery loop lock status): {data_lock}")
|
||||||
|
pw.dlog(f"RX AGC Inhibit: {rx_agc_inhibit}")
|
||||||
|
pw.dlog(f"RX AGC: {rx_agc}")
|
||||||
|
pw.dlog(f"Eb / E0RX [dB]: {eb_to_n0}")
|
||||||
|
|
||||||
|
|
||||||
|
class TxConv(enum.IntEnum):
|
||||||
|
NO_CODING = 0b000
|
||||||
|
VITERBI_HALF_G1G2INV = 0b010
|
||||||
|
VITERBI_HALF = 0b111
|
||||||
|
|
||||||
|
|
||||||
|
class TxStatus(enum.IntEnum):
|
||||||
|
NOT_AVAILABLE = 0b00
|
||||||
|
MODULATION = 0b01
|
||||||
|
CW = 0b10
|
||||||
|
STANDBY = 0b11
|
||||||
|
|
||||||
|
|
||||||
|
class TxCfgSet(enum.IntEnum):
|
||||||
|
START_WITH_CURRENT_CFG = 0b00
|
||||||
|
START_WITH_CONF_0 = 0b01
|
||||||
|
START_WITH_CONF_1 = 0b10
|
||||||
|
|
||||||
|
|
||||||
|
WAVEFORM_STRINGS = ["OFF", "CW", "QPSK", "0QPSK", "PCM/PM", "PSK/PM", "BPSK"]
|
||||||
|
|
||||||
|
|
||||||
def handle_syrlinks_tx_registers_dataset(
|
def handle_syrlinks_tx_registers_dataset(
|
||||||
@ -305,12 +378,49 @@ def handle_syrlinks_tx_registers_dataset(
|
|||||||
hk_data: bytes,
|
hk_data: bytes,
|
||||||
):
|
):
|
||||||
pw = PrintWrapper(printer)
|
pw = PrintWrapper(printer)
|
||||||
header_list = ["TX Status", "TX Waveform", "TX AGC value"]
|
header_list = ["TX Status Raw", "TX Waveform", "TX AGC value"]
|
||||||
tx_status = hk_data[0]
|
tx_status = hk_data[0]
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
tx_conv = TxConv(tx_status & 0b111)
|
||||||
|
except ValueError:
|
||||||
|
logging.getLogger(__name__).warning(
|
||||||
|
f"invalid TX conv value {tx_status & 0b111}"
|
||||||
|
)
|
||||||
|
tx_conv = -1
|
||||||
|
tx_diff_encoder_enable = (tx_status >> 3) & 0b1
|
||||||
|
"""
|
||||||
|
tx_status_status = TxStatus(tx_status & 0b11)
|
||||||
|
try:
|
||||||
|
tx_conf_set = TxCfgSet((tx_status >> 2) & 0b11)
|
||||||
|
except ValueError:
|
||||||
|
logging.getLogger(__name__).warning(
|
||||||
|
f"invalid TX conf set {(tx_status >> 2) & 0b11}"
|
||||||
|
)
|
||||||
|
tx_conf_set = -1
|
||||||
|
tx_clock_detect = (tx_status >> 4) & 0b1
|
||||||
tx_waveform = hk_data[1]
|
tx_waveform = hk_data[1]
|
||||||
|
waveform = tx_waveform & 0b1111
|
||||||
|
try:
|
||||||
|
waveform_str = WAVEFORM_STRINGS[waveform]
|
||||||
|
except IndexError:
|
||||||
|
logging.getLogger(__name__).warning(f"Unknown waveform value {waveform}")
|
||||||
|
waveform_str = "Unknown"
|
||||||
|
pcm_mode = (tx_waveform >> 4) & 0b1
|
||||||
tx_agc_value = struct.unpack("!H", hk_data[2:4])[0]
|
tx_agc_value = struct.unpack("!H", hk_data[2:4])[0]
|
||||||
|
tx_agc_inhibit = (tx_agc_value >> 15) & 0b1
|
||||||
|
tx_agc = tx_agc_value & 0xFFF
|
||||||
content_list = [tx_status, tx_waveform, tx_agc_value]
|
content_list = [tx_status, tx_waveform, tx_agc_value]
|
||||||
validity_buffer = hk_data[4:]
|
validity_buffer = hk_data[4:]
|
||||||
for header, content in zip(header_list, content_list):
|
for header, content in zip(header_list, content_list):
|
||||||
pw.dlog(f"{header}: {content}")
|
pw.dlog(f"{header}: {content}")
|
||||||
printer.print_validity_buffer(validity_buffer=validity_buffer, num_vars=3)
|
printer.print_validity_buffer(validity_buffer=validity_buffer, num_vars=3)
|
||||||
|
# pw.dlog(f"TX CONV: {tx_conv!r}")
|
||||||
|
# pw.dlog(f"TX DIFF (differential encoder enable): {tx_diff_encoder_enable}")
|
||||||
|
pw.dlog(f"TX Status: {tx_status_status!r}")
|
||||||
|
pw.dlog(f"TX Config Set: {tx_conf_set!r}")
|
||||||
|
pw.dlog(f"TX Clock Detect: {tx_clock_detect}")
|
||||||
|
pw.dlog(f"Waveform: {waveform_str}")
|
||||||
|
pw.dlog(f"PCM Mode: {pcm_mode}")
|
||||||
|
pw.dlog(f"TX AGC Inhibit: {tx_agc_inhibit}")
|
||||||
|
pw.dlog(f"TX AGC: {tx_agc}")
|
||||||
|
@ -52,6 +52,7 @@ class GsInfo:
|
|||||||
class PowerInfo:
|
class PowerInfo:
|
||||||
INFO_CORE = "Core Information"
|
INFO_CORE = "Core Information"
|
||||||
INFO_AUX = "Auxiliary Information"
|
INFO_AUX = "Auxiliary Information"
|
||||||
|
SWITCHER_HK = "Switcher State Information"
|
||||||
INFO_ALL = "All Information"
|
INFO_ALL = "All Information"
|
||||||
REQUEST_SWITCHER_SET = "Request Switcher Information"
|
REQUEST_SWITCHER_SET = "Request Switcher Information"
|
||||||
ENABLE_INFO_HK = "Enable Core Info HK"
|
ENABLE_INFO_HK = "Enable Core Info HK"
|
||||||
@ -102,7 +103,7 @@ class PowerOpCodes:
|
|||||||
|
|
||||||
REBOOT = ["reboot"]
|
REBOOT = ["reboot"]
|
||||||
INFO_CORE = ["info"]
|
INFO_CORE = ["info"]
|
||||||
REQUEST_SWITCHER_SET = ["request_switchers"]
|
SWITCHER_HK = ["switcher_states"]
|
||||||
ENABLE_INFO_HK = ["info_hk_on"]
|
ENABLE_INFO_HK = ["info_hk_on"]
|
||||||
DISABLE_INFO_HK = ["info_hk_off"]
|
DISABLE_INFO_HK = ["info_hk_off"]
|
||||||
INFO_AUX = ["info_aux"]
|
INFO_AUX = ["info_aux"]
|
||||||
|
@ -453,18 +453,18 @@ def pack_pl_pcdu_mode_cmd(
|
|||||||
|
|
||||||
|
|
||||||
ADC_CHANNELS_NAMED = [
|
ADC_CHANNELS_NAMED = [
|
||||||
"U BAT DIV 6",
|
"U BAT DIV 6 [V]",
|
||||||
"U NEG V FB",
|
"U NEG V FB [V]",
|
||||||
"I HPA",
|
"I HPA [mA]",
|
||||||
"U HPA DIV 6",
|
"U HPA DIV 6 [V]",
|
||||||
"I MPA",
|
"I MPA [mA]",
|
||||||
"U MPA DIV 6",
|
"U MPA DIV 6 [V]",
|
||||||
"I TX",
|
"I TX [mA]",
|
||||||
"U TX DIV 6",
|
"U TX DIV 6 [V]",
|
||||||
"I X8",
|
"I X8 [mA]",
|
||||||
"U X8 DIV 6",
|
"U X8 DIV 6 [V]",
|
||||||
"I DRO",
|
"I DRO [mA]",
|
||||||
"U DRO DIV 6",
|
"U DRO DIV 6 [V]",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@ from eive_tmtc.config.object_ids import (
|
|||||||
ACU_HANDLER_ID,
|
ACU_HANDLER_ID,
|
||||||
PDU_1_HANDLER_ID,
|
PDU_1_HANDLER_ID,
|
||||||
PDU_2_HANDLER_ID,
|
PDU_2_HANDLER_ID,
|
||||||
PCDU_HANDLER_ID,
|
|
||||||
get_object_ids,
|
get_object_ids,
|
||||||
)
|
)
|
||||||
from eive_tmtc.tmtc.power.pdu1 import (
|
from eive_tmtc.tmtc.power.pdu1 import (
|
||||||
@ -29,10 +28,15 @@ from eive_tmtc.tmtc.power.pdu2 import (
|
|||||||
add_pdu2_cmds,
|
add_pdu2_cmds,
|
||||||
)
|
)
|
||||||
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
|
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
|
||||||
|
from eive_tmtc.config.object_ids import PCDU_HANDLER_ID
|
||||||
|
|
||||||
from eive_tmtc.tmtc.power.p60dock import P60OpCode, P60Info, p60_dock_req_hk_cmds
|
from eive_tmtc.tmtc.power.p60dock import P60OpCode, P60Info, p60_dock_req_hk_cmds
|
||||||
from eive_tmtc.tmtc.power.acu import add_acu_cmds, acu_req_hk_cmds
|
from eive_tmtc.tmtc.power.acu import add_acu_cmds, acu_req_hk_cmds
|
||||||
from tmtccmd.tc.pus_3_fsfw_hk import create_request_one_diag_command, make_sid
|
from tmtccmd.tc.pus_3_fsfw_hk import (
|
||||||
|
create_request_one_diag_command,
|
||||||
|
make_sid,
|
||||||
|
create_request_one_hk_command,
|
||||||
|
)
|
||||||
from tmtccmd.config.tmtc import tmtc_definitions_provider
|
from tmtccmd.config.tmtc import tmtc_definitions_provider
|
||||||
from tmtccmd.tc import DefaultPusQueueHelper
|
from tmtccmd.tc import DefaultPusQueueHelper
|
||||||
|
|
||||||
@ -41,9 +45,20 @@ class SetId(enum.IntEnum):
|
|||||||
SWITCHER_SET = 0
|
SWITCHER_SET = 0
|
||||||
|
|
||||||
|
|
||||||
|
class PcduSetIds:
|
||||||
|
SWITCHER_SET = 0
|
||||||
|
|
||||||
|
|
||||||
def pack_power_commands(q: DefaultPusQueueHelper, op_code: str):
|
def pack_power_commands(q: DefaultPusQueueHelper, op_code: str):
|
||||||
pdu1_switch_cmds(q, op_code)
|
pdu1_switch_cmds(q, op_code)
|
||||||
pdu2_switch_cmds(q, op_code)
|
pdu2_switch_cmds(q, op_code)
|
||||||
|
if op_code in PowerOpCodes.SWITCHER_HK:
|
||||||
|
q.add_log_cmd("Requesting switcher state HK")
|
||||||
|
q.add_pus_tc(
|
||||||
|
create_request_one_diag_command(
|
||||||
|
make_sid(PCDU_HANDLER_ID, PcduSetIds.SWITCHER_SET)
|
||||||
|
)
|
||||||
|
)
|
||||||
if op_code in PowerOpCodes.INFO_CORE:
|
if op_code in PowerOpCodes.INFO_CORE:
|
||||||
pdu1_req_hk_cmds(q, PowerOpCodes.REQUEST_CORE_HK_ONCE[0])
|
pdu1_req_hk_cmds(q, PowerOpCodes.REQUEST_CORE_HK_ONCE[0])
|
||||||
pdu2_req_hk_cmds(q, PowerOpCodes.REQUEST_CORE_HK_ONCE[0])
|
pdu2_req_hk_cmds(q, PowerOpCodes.REQUEST_CORE_HK_ONCE[0])
|
||||||
@ -73,13 +88,6 @@ def pack_power_commands(q: DefaultPusQueueHelper, op_code: str):
|
|||||||
pack_reset_gnd_wdt_cmd(q, "PDU1", oids[PDU_1_HANDLER_ID])
|
pack_reset_gnd_wdt_cmd(q, "PDU1", oids[PDU_1_HANDLER_ID])
|
||||||
pack_reset_gnd_wdt_cmd(q, "PDU2", oids[PDU_2_HANDLER_ID])
|
pack_reset_gnd_wdt_cmd(q, "PDU2", oids[PDU_2_HANDLER_ID])
|
||||||
q.add_wait_seconds(5.0)
|
q.add_wait_seconds(5.0)
|
||||||
elif op_code in PowerOpCodes.REQUEST_SWITCHER_SET:
|
|
||||||
q.add_log_cmd("PCDU: Requesting Switcher Set")
|
|
||||||
q.add_pus_tc(
|
|
||||||
create_request_one_diag_command(
|
|
||||||
make_sid(PCDU_HANDLER_ID, SetId.SWITCHER_SET)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
if q.empty():
|
if q.empty():
|
||||||
logging.getLogger(__name__).info(
|
logging.getLogger(__name__).info(
|
||||||
f"Queue is empty, no stack for op code {op_code}"
|
f"Queue is empty, no stack for op code {op_code}"
|
||||||
@ -105,10 +113,10 @@ def add_power_cmd_defs(defs: TmtcDefinitionWrapper):
|
|||||||
oce = OpCodeEntry()
|
oce = OpCodeEntry()
|
||||||
add_pdu1_common_defs(oce)
|
add_pdu1_common_defs(oce)
|
||||||
add_pdu2_common_defs(oce)
|
add_pdu2_common_defs(oce)
|
||||||
|
oce.add(keys=PowerOpCodes.SWITCHER_HK, info=PowerInfo.SWITCHER_HK)
|
||||||
oce.add(keys=PowerOpCodes.INFO_ALL, info=PowerInfo.INFO_ALL)
|
oce.add(keys=PowerOpCodes.INFO_ALL, info=PowerInfo.INFO_ALL)
|
||||||
oce.add(keys=PowerOpCodes.INFO_CORE, info=PowerInfo.INFO_CORE)
|
oce.add(keys=PowerOpCodes.INFO_CORE, info=PowerInfo.INFO_CORE)
|
||||||
oce.add(keys=PowerOpCodes.INFO_AUX, info=PowerInfo.INFO_AUX)
|
oce.add(keys=PowerOpCodes.INFO_AUX, info=PowerInfo.INFO_AUX)
|
||||||
oce.add(keys=PowerOpCodes.REQUEST_SWITCHER_SET, info=PowerInfo.REQUEST_SWITCHER_SET)
|
|
||||||
oce.add(keys=PowerOpCodes.RESET_ALL_GND_WDTS, info=PowerInfo.RESET_ALL_GND_WDTS)
|
oce.add(keys=PowerOpCodes.RESET_ALL_GND_WDTS, info=PowerInfo.RESET_ALL_GND_WDTS)
|
||||||
defs.add_service(
|
defs.add_service(
|
||||||
name=CustomServiceList.POWER.value,
|
name=CustomServiceList.POWER.value,
|
||||||
|
@ -7,6 +7,7 @@ from eive_tmtc.tmtc.power.common_power import (
|
|||||||
unpack_array_in_data,
|
unpack_array_in_data,
|
||||||
OBC_ENDIANNESS,
|
OBC_ENDIANNESS,
|
||||||
)
|
)
|
||||||
|
from eive_tmtc.tmtc.power.power import PcduSetIds
|
||||||
from tmtccmd.util import ObjectIdBase
|
from tmtccmd.util import ObjectIdBase
|
||||||
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
||||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||||
@ -554,3 +555,24 @@ def parse_name_list(data: bytes, name_len: int):
|
|||||||
idx += len(name)
|
idx += len(name)
|
||||||
idx += 1
|
idx += 1
|
||||||
return ch_list
|
return ch_list
|
||||||
|
|
||||||
|
|
||||||
|
def handle_pcdu_hk(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
|
||||||
|
pw = PrintWrapper(printer)
|
||||||
|
pw.dlog("Received PCDU HK")
|
||||||
|
if set_id == PcduSetIds.SWITCHER_SET:
|
||||||
|
current_idx = 0
|
||||||
|
pdu1_vals = [hk_data[i] for i in range(len(PDU1_CHANNELS_NAMES))]
|
||||||
|
current_idx += len(PDU1_CHANNELS_NAMES)
|
||||||
|
pdu2_vals = [hk_data[i + current_idx] for i in range(len(PDU2_CHANNELS_NAMES))]
|
||||||
|
current_idx += len(PDU2_CHANNELS_NAMES)
|
||||||
|
p60_stack_val = hk_data[current_idx]
|
||||||
|
current_idx += 1
|
||||||
|
pw.dlog("PDU1 Switcher States")
|
||||||
|
for name, val in zip(PDU1_CHANNELS_NAMES, pdu1_vals):
|
||||||
|
pw.dlog(f"{name.ljust(25)}: {val}")
|
||||||
|
pw.dlog("PDU2 Switcher States")
|
||||||
|
for name, val in zip(PDU2_CHANNELS_NAMES, pdu2_vals):
|
||||||
|
pw.dlog(f"{name.ljust(25)}: {val}")
|
||||||
|
pw.dlog(f"{'P60 Dock 5V Stack'.ljust(25)}: {p60_stack_val}")
|
||||||
|
pw.printer.print_validity_buffer(hk_data[current_idx:], 3)
|
||||||
|
47
eive_tmtc/tmtc/system.py
Normal file
47
eive_tmtc/tmtc/system.py
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
from eive_tmtc.config.definitions import CustomServiceList
|
||||||
|
from eive_tmtc.tmtc.acs.subsystem import AcsMode
|
||||||
|
from tmtccmd.config.tmtc import (
|
||||||
|
tmtc_definitions_provider,
|
||||||
|
TmtcDefinitionWrapper,
|
||||||
|
OpCodeEntry,
|
||||||
|
)
|
||||||
|
from tmtccmd.tc import service_provider
|
||||||
|
from eive_tmtc.config.object_ids import EIVE_SYSTEM_ID
|
||||||
|
from tmtccmd.tc.pus_200_fsfw_mode import create_mode_command, Mode
|
||||||
|
from tmtccmd.tc.decorator import ServiceProviderParams
|
||||||
|
|
||||||
|
|
||||||
|
class OpCode:
|
||||||
|
SAFE_MODE = "safe"
|
||||||
|
IDLE_MODE = "idle"
|
||||||
|
|
||||||
|
|
||||||
|
class Info:
|
||||||
|
SAFE_MODE = "Command System into Safe Mode"
|
||||||
|
IDLE_MODE = "Command System into Idle Pointing Mode"
|
||||||
|
|
||||||
|
|
||||||
|
@service_provider(CustomServiceList.SYSTEM.value)
|
||||||
|
def build_system_cmds(p: ServiceProviderParams):
|
||||||
|
o = p.op_code
|
||||||
|
q = p.queue_helper
|
||||||
|
prefix = "EIVE System"
|
||||||
|
if o == OpCode.SAFE_MODE:
|
||||||
|
q.add_log_cmd(f"{prefix}: {Info.SAFE_MODE}")
|
||||||
|
q.add_pus_tc(create_mode_command(EIVE_SYSTEM_ID, AcsMode.SAFE, 0))
|
||||||
|
elif o == OpCode.IDLE_MODE:
|
||||||
|
q.add_log_cmd(f"{prefix}: {Info.IDLE_MODE}")
|
||||||
|
q.add_pus_tc(create_mode_command(EIVE_SYSTEM_ID, AcsMode.IDLE, 0))
|
||||||
|
|
||||||
|
|
||||||
|
@tmtc_definitions_provider
|
||||||
|
def add_system_cmd_defs(defs: TmtcDefinitionWrapper):
|
||||||
|
oce = OpCodeEntry()
|
||||||
|
oce.add(keys=OpCode.SAFE_MODE, info=Info.SAFE_MODE)
|
||||||
|
oce.add(keys=OpCode.IDLE_MODE, info=Info.IDLE_MODE)
|
||||||
|
defs.add_service(
|
||||||
|
name=CustomServiceList.SYSTEM.value,
|
||||||
|
info="EIVE system commands",
|
||||||
|
op_code_entry=oce,
|
||||||
|
)
|
||||||
|
pass
|
@ -27,7 +27,7 @@ classifiers =
|
|||||||
|
|
||||||
[options]
|
[options]
|
||||||
install_requires =
|
install_requires =
|
||||||
tmtccmd @ git+https://github.com/robamu-org/tmtccmd@v4.0.0rc1
|
tmtccmd @ git+https://github.com/robamu-org/tmtccmd@v4.0.0rc2
|
||||||
# tmtccmd @ git+https://github.com/robamu-org/tmtccmd@<gitRev>#egg=tmtccmd
|
# tmtccmd @ git+https://github.com/robamu-org/tmtccmd@<gitRev>#egg=tmtccmd
|
||||||
packages = find:
|
packages = find:
|
||||||
python_requires = >=3.10
|
python_requires = >=3.10
|
||||||
|
Reference in New Issue
Block a user