Compare commits
72 Commits
Author | SHA1 | Date | |
---|---|---|---|
bf06dd70f4 | |||
c8ea75b2ad | |||
6b657b5623 | |||
6c663b473c | |||
7b5df331ef | |||
c6478f05fd | |||
b95204ef9e | |||
f082f05886 | |||
28b3e4bec7 | |||
dbd2e5d9fc | |||
3eeb58182b | |||
48675efe3f | |||
b98fc2f56d | |||
3c20d2ea24 | |||
2793b354a6 | |||
72fee20d65 | |||
98af6a7907 | |||
a7f11b3159 | |||
98ba66dba2 | |||
28fda7cdbd | |||
619bd6b71b | |||
ece20bf177 | |||
63d7f577b1 | |||
6f783441be | |||
db70b4bd44 | |||
a4a4a6b666 | |||
f99a3ab74a | |||
a9c23a4453 | |||
407163397d | |||
65839f5aec | |||
14ed2415a4 | |||
fb6d5eeb80 | |||
39a9497494 | |||
f4702eb701 | |||
b7e6a79704 | |||
b8376c6f48 | |||
8b6039e15d | |||
e4963fb712 | |||
feacfeaf65 | |||
47480a7959 | |||
67c6b86baf | |||
df1bbe9ded | |||
39dfac2520 | |||
b8a8f4b5a3 | |||
733fc19d78 | |||
83f10ed253 | |||
c4329558c9 | |||
72c577e991 | |||
0fe6cec54c | |||
2ac182e753 | |||
ffdc6a68bb | |||
99d5ed014b | |||
05f22ae4ce | |||
69e2b82c8e | |||
8a5e779e23 | |||
c36c7ca5bb | |||
8a7880bc35 | |||
cac68dba7f | |||
4323b0659d | |||
55cecdf81c | |||
82c6b60af2 | |||
35a485d79e | |||
49ccb4be8d | |||
8341ccc99d | |||
5998aa12a4 | |||
5a05eb4825 | |||
f8299b91cd | |||
45253bc9b8 | |||
7537388f6e | |||
fe19284a8e | |||
49f27c9923 | |||
0010ac581a |
49
CHANGELOG.md
49
CHANGELOG.md
@ -10,7 +10,54 @@ list yields a list of all related PRs for each release.
|
|||||||
|
|
||||||
# [unreleased]
|
# [unreleased]
|
||||||
|
|
||||||
# [v2.4.0] 2023-01-23
|
# [v2.8.0] 2023-01-01
|
||||||
|
|
||||||
|
- Move all device modules inside `pus_tc` and `pus_tm` to `tmtc` module and respective
|
||||||
|
subsystem submodules.
|
||||||
|
- Move low level ACS board device modules `gyros.py` and `mgms.py`
|
||||||
|
to the `tmtc.acs` module.
|
||||||
|
- Bump tmtccmd to include more pythonic log usage. All related changes.
|
||||||
|
It is recommended to use `logging.getLogger(__name__)` for module level loggers now.
|
||||||
|
- Moved TCS components to `tmtc` module
|
||||||
|
- Renamed `HEATER_ID` to `HEATER_CONTROLLER_ID`
|
||||||
|
|
||||||
|
# [v2.7.0] 2023-01-31
|
||||||
|
|
||||||
|
- tmtccmd v4.0.0a3
|
||||||
|
|
||||||
|
# [v2.6.0 and v2.6.1] 2023-01-28
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
|
||||||
|
- Reworked and improved PUS 20 parameter reply handling
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
|
- COM subsystem commanding. Default datarate parameter commanding
|
||||||
|
was moved to the subsystem as well.
|
||||||
|
|
||||||
|
# [v2.5.0] 2023-01-26
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
|
||||||
|
- Bugfix for CCSDS handler commanding: Pass correct object ID
|
||||||
|
- Processed MGM set TM handling fix
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
|
- Added command to request switcher set from PCDU handler.
|
||||||
|
- Star Tracker: Add commands to update default datarate.
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
|
||||||
|
- Move Star Tracker module to `tmtc` folder and add some set IDs. Rename `SetIds` to `SetId`.
|
||||||
|
- Move `syrlinks_hk_handler` and `ccsds_handler` module to `tmtc` module.
|
||||||
|
Rename `syrlinks_hk_handler` to `syrlinks_handler`.
|
||||||
|
- Move `star_tracker` module into `tmtc.acs`
|
||||||
|
- CCSDS Handler: Switch from action commands to mode commands for ON/OFF handling.
|
||||||
|
- Star Tracker: Switch from actions commands to mode commands for RX/TX/Modulation commanding.
|
||||||
|
|
||||||
|
# [v2.4.0] and [v2.4.1] 2023-01-23
|
||||||
|
|
||||||
- Pin `tmtccmd` to v4.0.0a2
|
- Pin `tmtccmd` to v4.0.0a2
|
||||||
- Unify and move Syrlinks module, some bugfixes
|
- Unify and move Syrlinks module, some bugfixes
|
||||||
|
@ -2,10 +2,10 @@ from pathlib import Path
|
|||||||
|
|
||||||
SW_NAME = "eive-tmtc"
|
SW_NAME = "eive-tmtc"
|
||||||
VERSION_MAJOR = 2
|
VERSION_MAJOR = 2
|
||||||
VERSION_MINOR = 3
|
VERSION_MINOR = 8
|
||||||
VERSION_REVISION = 1
|
VERSION_REVISION = 0
|
||||||
|
|
||||||
__version__ = "2.3.1"
|
__version__ = "2.8.0"
|
||||||
|
|
||||||
EIVE_TMTC_ROOT = Path(__file__).parent
|
EIVE_TMTC_ROOT = Path(__file__).parent
|
||||||
PACKAGE_ROOT = EIVE_TMTC_ROOT.parent
|
PACKAGE_ROOT = EIVE_TMTC_ROOT.parent
|
||||||
|
@ -17,8 +17,8 @@ CFDP_APID = 0x66
|
|||||||
PUS_PACKET_ID = PacketId(PacketType.TM, True, PUS_APID)
|
PUS_PACKET_ID = PacketId(PacketType.TM, True, PUS_APID)
|
||||||
CFDP_PACKET_ID = PacketId(PacketType.TM, False, CFDP_APID)
|
CFDP_PACKET_ID = PacketId(PacketType.TM, False, CFDP_APID)
|
||||||
SPACE_PACKET_IDS = (
|
SPACE_PACKET_IDS = (
|
||||||
PUS_PACKET_ID.raw(),
|
PUS_PACKET_ID,
|
||||||
CFDP_PACKET_ID.raw(),
|
CFDP_PACKET_ID,
|
||||||
)
|
)
|
||||||
|
|
||||||
CFDP_LOCAL_ENTITY_ID = UnsignedByteField(byte_len=2, val=1)
|
CFDP_LOCAL_ENTITY_ID = UnsignedByteField(byte_len=2, val=1)
|
||||||
@ -35,6 +35,7 @@ class CustomServiceList(str, enum.Enum):
|
|||||||
POWER = "power"
|
POWER = "power"
|
||||||
ACU = "acu"
|
ACU = "acu"
|
||||||
ACS = "acs"
|
ACS = "acs"
|
||||||
|
COM_SS = "com"
|
||||||
BPX_BATTERY = "bpx"
|
BPX_BATTERY = "bpx"
|
||||||
TMP1075_1 = "tmp1075_1"
|
TMP1075_1 = "tmp1075_1"
|
||||||
TMP1075_2 = "tmp1075_2"
|
TMP1075_2 = "tmp1075_2"
|
||||||
|
@ -226,11 +226,9 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
|
|||||||
13630;0x353e;SUPV_UPDATE_PROGRESS;INFO;Will be triggered every 5 percent of the update progress. P1: First byte percent, third and fourth byte Sequence Count, P2: Bytes written;linux/devices/ploc/PlocSupvUartMan.h
|
13630;0x353e;SUPV_UPDATE_PROGRESS;INFO;Will be triggered every 5 percent of the update progress. P1: First byte percent, third and fourth byte Sequence Count, P2: Bytes written;linux/devices/ploc/PlocSupvUartMan.h
|
||||||
13631;0x353f;HDLC_FRAME_REMOVAL_ERROR;INFO;;linux/devices/ploc/PlocSupvUartMan.h
|
13631;0x353f;HDLC_FRAME_REMOVAL_ERROR;INFO;;linux/devices/ploc/PlocSupvUartMan.h
|
||||||
13632;0x3540;HDLC_CRC_ERROR;INFO;;linux/devices/ploc/PlocSupvUartMan.h
|
13632;0x3540;HDLC_CRC_ERROR;INFO;;linux/devices/ploc/PlocSupvUartMan.h
|
||||||
13700;0x3584;ALLOC_FAILURE;MEDIUM;;bsp_q7s/core/CoreController.h
|
13700;0x3584;FDIR_REACTION_IGNORED;MEDIUM;;mission/devices/devicedefinitions/SyrlinksDefinitions.h
|
||||||
13701;0x3585;REBOOT_SW;MEDIUM; Software reboot occurred. Can also be a systemd reboot. P1: Current Chip, P2: Current Copy;bsp_q7s/core/CoreController.h
|
13701;0x3585;TX_ON;INFO;Transmitter is on now. P1: Submode, P2: Current default datarate.;mission/devices/devicedefinitions/SyrlinksDefinitions.h
|
||||||
13702;0x3586;REBOOT_MECHANISM_TRIGGERED;MEDIUM;The reboot mechanism was triggered. P1: First 16 bits: Last Chip, Last 16 bits: Last Copy, P2: Each byte is the respective reboot count for the slots;bsp_q7s/core/CoreController.h
|
13702;0x3586;TX_OFF;INFO;Transmitter is off now.;mission/devices/devicedefinitions/SyrlinksDefinitions.h
|
||||||
13703;0x3587;REBOOT_HW;MEDIUM;;bsp_q7s/core/CoreController.h
|
|
||||||
13704;0x3588;NO_SD_CARD_ACTIVE;HIGH;No SD card was active. Core controller will attempt to re-initialize a SD card.;bsp_q7s/core/CoreController.h
|
|
||||||
13800;0x35e8;MISSING_PACKET;LOW;;mission/devices/devicedefinitions/ScexDefinitions.h
|
13800;0x35e8;MISSING_PACKET;LOW;;mission/devices/devicedefinitions/ScexDefinitions.h
|
||||||
13801;0x35e9;EXPERIMENT_TIMEDOUT;LOW;;mission/devices/devicedefinitions/ScexDefinitions.h
|
13801;0x35e9;EXPERIMENT_TIMEDOUT;LOW;;mission/devices/devicedefinitions/ScexDefinitions.h
|
||||||
13802;0x35ea;MULTI_PACKET_COMMAND_DONE;INFO;;mission/devices/devicedefinitions/ScexDefinitions.h
|
13802;0x35ea;MULTI_PACKET_COMMAND_DONE;INFO;;mission/devices/devicedefinitions/ScexDefinitions.h
|
||||||
@ -239,3 +237,8 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
|
|||||||
13903;0x364f;INSERT_CONFIGFILEVALUE_FAILED;MEDIUM;;mission/utility/GlobalConfigHandler.h
|
13903;0x364f;INSERT_CONFIGFILEVALUE_FAILED;MEDIUM;;mission/utility/GlobalConfigHandler.h
|
||||||
13904;0x3650;WRITE_CONFIGFILE_FAILED;MEDIUM;;mission/utility/GlobalConfigHandler.h
|
13904;0x3650;WRITE_CONFIGFILE_FAILED;MEDIUM;;mission/utility/GlobalConfigHandler.h
|
||||||
13905;0x3651;READ_CONFIGFILE_FAILED;MEDIUM;;mission/utility/GlobalConfigHandler.h
|
13905;0x3651;READ_CONFIGFILE_FAILED;MEDIUM;;mission/utility/GlobalConfigHandler.h
|
||||||
|
14000;0x36b0;ALLOC_FAILURE;MEDIUM;;bsp_q7s/core/CoreController.h
|
||||||
|
14001;0x36b1;REBOOT_SW;MEDIUM; Software reboot occurred. Can also be a systemd reboot. P1: Current Chip, P2: Current Copy;bsp_q7s/core/CoreController.h
|
||||||
|
14002;0x36b2;REBOOT_MECHANISM_TRIGGERED;MEDIUM;The reboot mechanism was triggered. P1: First 16 bits: Last Chip, Last 16 bits: Last Copy, P2: Each byte is the respective reboot count for the slots;bsp_q7s/core/CoreController.h
|
||||||
|
14003;0x36b3;REBOOT_HW;MEDIUM;;bsp_q7s/core/CoreController.h
|
||||||
|
14004;0x36b4;NO_SD_CARD_ACTIVE;HIGH;No SD card was active. Core controller will attempt to re-initialize a SD card.;bsp_q7s/core/CoreController.h
|
||||||
|
|
@ -1,11 +1,10 @@
|
|||||||
|
import logging
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from eive_tmtc import EIVE_TMTC_ROOT
|
from eive_tmtc import EIVE_TMTC_ROOT
|
||||||
from tmtccmd import get_console_logger
|
|
||||||
from tmtccmd.fsfw import parse_fsfw_events_csv
|
from tmtccmd.fsfw import parse_fsfw_events_csv
|
||||||
from tmtccmd.pus.s5_event import EventDictT
|
from tmtccmd.pus.s5_event import EventDictT
|
||||||
|
|
||||||
LOGGER = get_console_logger()
|
|
||||||
DEFAULT_EVENTS_CSV_PATH = EIVE_TMTC_ROOT / "config/events.csv"
|
DEFAULT_EVENTS_CSV_PATH = EIVE_TMTC_ROOT / "config/events.csv"
|
||||||
__EVENT_DICT = None
|
__EVENT_DICT = None
|
||||||
|
|
||||||
@ -16,6 +15,8 @@ def get_event_dict() -> EventDictT:
|
|||||||
if os.path.exists(DEFAULT_EVENTS_CSV_PATH):
|
if os.path.exists(DEFAULT_EVENTS_CSV_PATH):
|
||||||
__EVENT_DICT = parse_fsfw_events_csv(DEFAULT_EVENTS_CSV_PATH)
|
__EVENT_DICT = parse_fsfw_events_csv(DEFAULT_EVENTS_CSV_PATH)
|
||||||
else:
|
else:
|
||||||
LOGGER.warning(f"No Event CSV file found at {DEFAULT_EVENTS_CSV_PATH}")
|
logging.getLogger(__name__).warning(
|
||||||
|
f"No Event CSV file found at {DEFAULT_EVENTS_CSV_PATH}"
|
||||||
|
)
|
||||||
__EVENT_DICT = dict()
|
__EVENT_DICT = dict()
|
||||||
return __EVENT_DICT
|
return __EVENT_DICT
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from eive_tmtc.config.definitions import SPACE_PACKET_IDS
|
from eive_tmtc.config.definitions import SPACE_PACKET_IDS
|
||||||
from tmtccmd import TmTcCfgHookBase, CcsdsTmtcBackend
|
from tmtccmd import HookBase, CcsdsTmtcBackend
|
||||||
from tmtccmd.com_if import ComInterface
|
from tmtccmd.com import ComInterface
|
||||||
from tmtccmd.config import TmtcDefinitionWrapper
|
from tmtccmd.config import TmtcDefinitionWrapper
|
||||||
|
|
||||||
from eive_tmtc.config.retvals import get_retval_dict
|
from eive_tmtc.config.retvals import get_retval_dict
|
||||||
@ -10,7 +10,7 @@ from eive_tmtc.pus_tc.cmd_definitions import get_eive_service_op_code_dict
|
|||||||
from tmtccmd.util import ObjectIdDictT, RetvalDictT
|
from tmtccmd.util import ObjectIdDictT, RetvalDictT
|
||||||
|
|
||||||
|
|
||||||
class EiveHookObject(TmTcCfgHookBase):
|
class EiveHookObject(HookBase):
|
||||||
def __init__(self, json_cfg_path: str):
|
def __init__(self, json_cfg_path: str):
|
||||||
super().__init__(json_cfg_path=json_cfg_path)
|
super().__init__(json_cfg_path=json_cfg_path)
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ class EiveHookObject(TmTcCfgHookBase):
|
|||||||
return get_eive_service_op_code_dict()
|
return get_eive_service_op_code_dict()
|
||||||
|
|
||||||
def assign_communication_interface(self, com_if_key: str) -> Optional[ComInterface]:
|
def assign_communication_interface(self, com_if_key: str) -> Optional[ComInterface]:
|
||||||
from tmtccmd.config.com_if import (
|
from tmtccmd.config.com import (
|
||||||
create_com_interface_default,
|
create_com_interface_default,
|
||||||
create_com_interface_cfg_default,
|
create_com_interface_cfg_default,
|
||||||
)
|
)
|
||||||
|
@ -3,15 +3,14 @@
|
|||||||
@details Template configuration file. Copy this folder to the TMTC commander root and adapt
|
@details Template configuration file. Copy this folder to the TMTC commander root and adapt
|
||||||
it to your needs.
|
it to your needs.
|
||||||
"""
|
"""
|
||||||
|
import logging
|
||||||
import os.path
|
import os.path
|
||||||
|
|
||||||
from eive_tmtc import EIVE_TMTC_ROOT
|
from eive_tmtc import EIVE_TMTC_ROOT
|
||||||
from tmtccmd.util.obj_id import ObjectIdDictT
|
from tmtccmd.util.obj_id import ObjectIdDictT
|
||||||
from tmtccmd.fsfw import parse_fsfw_objects_csv
|
from tmtccmd.fsfw import parse_fsfw_objects_csv
|
||||||
from tmtccmd.logging import get_console_logger
|
|
||||||
|
|
||||||
|
|
||||||
LOGGER = get_console_logger()
|
|
||||||
DEFAULT_OBJECTS_CSV_PATH = EIVE_TMTC_ROOT / "config/objects.csv"
|
DEFAULT_OBJECTS_CSV_PATH = EIVE_TMTC_ROOT / "config/objects.csv"
|
||||||
__OBJECT_ID_DICT = None
|
__OBJECT_ID_DICT = None
|
||||||
|
|
||||||
@ -30,7 +29,7 @@ SCEX_HANDLER_ID = bytes([0x44, 0x33, 0x00, 0x32])
|
|||||||
|
|
||||||
# Thermal Object IDs
|
# Thermal Object IDs
|
||||||
THERMAL_CONTROLLER_ID = bytes([0x43, 0x40, 0x00, 0x01])
|
THERMAL_CONTROLLER_ID = bytes([0x43, 0x40, 0x00, 0x01])
|
||||||
HEATER_ID = bytes([0x44, 0x41, 0x00, 0xA4])
|
HEATER_CONTROLLER_ID = bytes([0x44, 0x41, 0x00, 0xA4])
|
||||||
TMP_1075_1_HANDLER_ID = bytes([0x44, 0x42, 0x00, 0x04])
|
TMP_1075_1_HANDLER_ID = bytes([0x44, 0x42, 0x00, 0x04])
|
||||||
TMP_1075_2_HANDLER_ID = bytes([0x44, 0x42, 0x00, 0x05])
|
TMP_1075_2_HANDLER_ID = bytes([0x44, 0x42, 0x00, 0x05])
|
||||||
|
|
||||||
@ -127,6 +126,8 @@ SUS_11_R_LOC_XBYMZB_PT_ZB = bytes([0x44, 0x12, 0x00, 0x43])
|
|||||||
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])
|
||||||
|
COM_SUBSYSTEM_ID = bytes([0x73, 0x01, 0x00, 0x04])
|
||||||
|
|
||||||
ACS_BOARD_ASS_ID = bytes([0x73, 0x00, 0x00, 0x01])
|
ACS_BOARD_ASS_ID = bytes([0x73, 0x00, 0x00, 0x01])
|
||||||
SUS_BOARD_ASS_ID = bytes([0x73, 0x00, 0x00, 0x02])
|
SUS_BOARD_ASS_ID = bytes([0x73, 0x00, 0x00, 0x02])
|
||||||
TCS_BOARD_ASS_ID = bytes([0x73, 0x00, 0x00, 0x03])
|
TCS_BOARD_ASS_ID = bytes([0x73, 0x00, 0x00, 0x03])
|
||||||
@ -141,7 +142,9 @@ CORE_CONTROLLER_ID = bytes([0x43, 0x00, 0x00, 0x03])
|
|||||||
def get_object_ids() -> ObjectIdDictT:
|
def get_object_ids() -> ObjectIdDictT:
|
||||||
global __OBJECT_ID_DICT
|
global __OBJECT_ID_DICT
|
||||||
if not os.path.exists(DEFAULT_OBJECTS_CSV_PATH):
|
if not os.path.exists(DEFAULT_OBJECTS_CSV_PATH):
|
||||||
LOGGER.warning(f"No Objects CSV file found at {DEFAULT_OBJECTS_CSV_PATH}")
|
logging.getLogger(__name__).warning(
|
||||||
|
f"No Objects CSV file found at {DEFAULT_OBJECTS_CSV_PATH}"
|
||||||
|
)
|
||||||
if __OBJECT_ID_DICT is None:
|
if __OBJECT_ID_DICT is None:
|
||||||
if os.path.exists(DEFAULT_OBJECTS_CSV_PATH):
|
if os.path.exists(DEFAULT_OBJECTS_CSV_PATH):
|
||||||
__OBJECT_ID_DICT = parse_fsfw_objects_csv(csv_file=DEFAULT_OBJECTS_CSV_PATH)
|
__OBJECT_ID_DICT = parse_fsfw_objects_csv(csv_file=DEFAULT_OBJECTS_CSV_PATH)
|
||||||
|
@ -72,7 +72,7 @@
|
|||||||
0x44420029;RTD_13_IC16_PLPCDU_HEATSPREADER
|
0x44420029;RTD_13_IC16_PLPCDU_HEATSPREADER
|
||||||
0x44420030;RTD_14_IC17_TCS_BOARD
|
0x44420030;RTD_14_IC17_TCS_BOARD
|
||||||
0x44420031;RTD_15_IC18_IMTQ
|
0x44420031;RTD_15_IC18_IMTQ
|
||||||
0x445300A3;SYRLINKS_HK_HANDLER
|
0x445300A3;SYRLINKS_HANDLER
|
||||||
0x49000000;ARDUINO_COM_IF
|
0x49000000;ARDUINO_COM_IF
|
||||||
0x49010005;GPIO_IF
|
0x49010005;GPIO_IF
|
||||||
0x49010006;SCEX_UART_READER
|
0x49010006;SCEX_UART_READER
|
||||||
@ -147,5 +147,6 @@
|
|||||||
0x73010001;ACS_SUBSYSTEM
|
0x73010001;ACS_SUBSYSTEM
|
||||||
0x73010002;PL_SUBSYSTEM
|
0x73010002;PL_SUBSYSTEM
|
||||||
0x73010003;TCS_SUBSYSTEM
|
0x73010003;TCS_SUBSYSTEM
|
||||||
|
0x73010004;COM_SUBSYSTEM
|
||||||
0x73500000;CCSDS_IP_CORE_BRIDGE
|
0x73500000;CCSDS_IP_CORE_BRIDGE
|
||||||
0xFFFFFFFF;NO_OBJECT
|
0xFFFFFFFF;NO_OBJECT
|
||||||
|
|
@ -35,15 +35,15 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path
|
|||||||
0x51a5;IMTQ_RejectedWithoutReason;;165;IMTQ_HANDLER;mission/devices/ImtqHandler.h
|
0x51a5;IMTQ_RejectedWithoutReason;;165;IMTQ_HANDLER;mission/devices/ImtqHandler.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
|
||||||
0x50a0;SYRLINKS_CrcFailure;;160;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h
|
0x50a0;SYRLINKS_CrcFailure;;160;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h
|
||||||
0x50a1;SYRLINKS_UartFraminOrParityErrorAck;;161;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h
|
0x50a1;SYRLINKS_UartFraminOrParityErrorAck;;161;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h
|
||||||
0x50a2;SYRLINKS_BadCharacterAck;;162;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h
|
0x50a2;SYRLINKS_BadCharacterAck;;162;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h
|
||||||
0x50a3;SYRLINKS_BadParameterValueAck;;163;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h
|
0x50a3;SYRLINKS_BadParameterValueAck;;163;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h
|
||||||
0x50a4;SYRLINKS_BadEndOfFrameAck;;164;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h
|
0x50a4;SYRLINKS_BadEndOfFrameAck;;164;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h
|
||||||
0x50a5;SYRLINKS_UnknownCommandIdAck;;165;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h
|
0x50a5;SYRLINKS_UnknownCommandIdAck;;165;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h
|
||||||
0x50a6;SYRLINKS_BadCrcAck;;166;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h
|
0x50a6;SYRLINKS_BadCrcAck;;166;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h
|
||||||
0x50a7;SYRLINKS_ReplyWrongSize;;167;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h
|
0x50a7;SYRLINKS_ReplyWrongSize;;167;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h
|
||||||
0x50a8;SYRLINKS_MissingStartFrameCharacter;;168;SYRLINKS_HANDLER;mission/devices/SyrlinksHkHandler.h
|
0x50a8;SYRLINKS_MissingStartFrameCharacter;;168;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h
|
||||||
0x66a0;SADPL_CommandNotSupported;;160;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h
|
0x66a0;SADPL_CommandNotSupported;;160;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h
|
||||||
0x66a1;SADPL_DeploymentAlreadyExecuting;;161;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h
|
0x66a1;SADPL_DeploymentAlreadyExecuting;;161;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h
|
||||||
0x66a2;SADPL_MainSwitchTimeoutFailure;;162;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h
|
0x66a2;SADPL_MainSwitchTimeoutFailure;;162;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h
|
||||||
|
|
@ -1,12 +1,11 @@
|
|||||||
import os
|
import os
|
||||||
|
import logging
|
||||||
|
|
||||||
from eive_tmtc import EIVE_TMTC_ROOT
|
from eive_tmtc import EIVE_TMTC_ROOT
|
||||||
from tmtccmd.fsfw import parse_fsfw_returnvalues_csv, RetvalDictT
|
from tmtccmd.fsfw import parse_fsfw_returnvalues_csv, RetvalDictT
|
||||||
from tmtccmd.logging import get_console_logger
|
|
||||||
|
|
||||||
DEFAULT_RETVAL_CSV_NAME = EIVE_TMTC_ROOT / "config/returnvalues.csv"
|
DEFAULT_RETVAL_CSV_NAME = EIVE_TMTC_ROOT / "config/returnvalues.csv"
|
||||||
__RETVAL_DICT = None
|
__RETVAL_DICT = None
|
||||||
LOGGER = get_console_logger()
|
|
||||||
|
|
||||||
|
|
||||||
def get_retval_dict() -> RetvalDictT:
|
def get_retval_dict() -> RetvalDictT:
|
||||||
@ -17,7 +16,7 @@ def get_retval_dict() -> RetvalDictT:
|
|||||||
csv_file=DEFAULT_RETVAL_CSV_NAME
|
csv_file=DEFAULT_RETVAL_CSV_NAME
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
LOGGER.warning(
|
logging.getLogger(__name__).warning(
|
||||||
f"No Return Value CSV file found at {DEFAULT_RETVAL_CSV_NAME}"
|
f"No Return Value CSV file found at {DEFAULT_RETVAL_CSV_NAME}"
|
||||||
)
|
)
|
||||||
__RETVAL_DICT = dict()
|
__RETVAL_DICT = dict()
|
||||||
|
@ -39,21 +39,6 @@ def add_pdec_cmds(defs: TmtcDefinitionWrapper):
|
|||||||
defs.add_service(CustomServiceList.PDEC_HANDLER.value, "PDEC Handler", oce)
|
defs.add_service(CustomServiceList.PDEC_HANDLER.value, "PDEC Handler", oce)
|
||||||
|
|
||||||
|
|
||||||
@tmtc_definitions_provider
|
|
||||||
def add_ccsds_cmds(defs: TmtcDefinitionWrapper):
|
|
||||||
oce = OpCodeEntry()
|
|
||||||
oce.add("0", "CCSDS Handler: Set low rate")
|
|
||||||
oce.add("1", "CCSDS Handler: Set high rate")
|
|
||||||
oce.add("2", "CCSDS Handler: Enable transmitter")
|
|
||||||
oce.add("3", "CCSDS Handler: Disable transmitter")
|
|
||||||
oce.add("4", "CCSDS Handler: Set arbitrary bitrate")
|
|
||||||
oce.add("5", "CCSDS Handler: Enable tx clock manipulator")
|
|
||||||
oce.add("6", "CCSDS Handler: Disable tx clock manipulator")
|
|
||||||
oce.add("7", "CCSDS Handler: Update tx data on rising edge")
|
|
||||||
oce.add("8", "CCSDS Handler: Update tx data on falling edge")
|
|
||||||
defs.add_service(CustomServiceList.CCSDS_HANDLER.value, "CCSDS Handler", oce)
|
|
||||||
|
|
||||||
|
|
||||||
@tmtc_definitions_provider
|
@tmtc_definitions_provider
|
||||||
def add_str_cmds(defs: TmtcDefinitionWrapper):
|
def add_str_cmds(defs: TmtcDefinitionWrapper):
|
||||||
oce = OpCodeEntry()
|
oce = OpCodeEntry()
|
||||||
|
@ -1 +0,0 @@
|
|||||||
|
|
@ -1,81 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
"""
|
|
||||||
@file ccsds_handler.py
|
|
||||||
@brief Test commanding of CCSDS Handler
|
|
||||||
@author J. Meier
|
|
||||||
@date 20.11.2021
|
|
||||||
"""
|
|
||||||
import enum
|
|
||||||
import struct
|
|
||||||
|
|
||||||
from spacepackets.ecss.tc import PusTelecommand
|
|
||||||
from tmtccmd.tc import DefaultPusQueueHelper
|
|
||||||
from tmtccmd.util import ObjectIdU32
|
|
||||||
|
|
||||||
|
|
||||||
class CommandId(enum.IntEnum):
|
|
||||||
# Configures input rate of syrlinks to 400 Khz (results in downlink rate of 200 kbps)
|
|
||||||
SET_LOW_RATE = 0
|
|
||||||
# Configures input rate of syrlinks to 2000 Khz (results in downlink rate of 1000 kbps)
|
|
||||||
SET_HIGH_RATE = 1
|
|
||||||
# Enables the syrlinks transmitter (by using RS485 enables lines)
|
|
||||||
EN_TRANSMITTER = 2
|
|
||||||
# Disables the syrlinks transmitter (by using RS485 enables lines)
|
|
||||||
DIS_TRANSMITTER = 3
|
|
||||||
# Sets an arbitrary bitrate. Normally only set low and set high rate commands should be
|
|
||||||
# required
|
|
||||||
ARBITRARY_BITRATE = 4
|
|
||||||
ENABLE_TX_CLK_MANIPULATOR = 5
|
|
||||||
DISABLE_TX_CLK_MANIPULATOR = 6
|
|
||||||
# Tx data will be updated on rising edge of tx clock
|
|
||||||
UPDATE_ON_RISING_EDGE = 7
|
|
||||||
# Tx data will be updated on falling edge of tx clock
|
|
||||||
UPDATE_ON_FALLING_EDGE = 8
|
|
||||||
|
|
||||||
|
|
||||||
def pack_ccsds_handler_test(
|
|
||||||
object_id: ObjectIdU32, q: DefaultPusQueueHelper, op_code: str
|
|
||||||
):
|
|
||||||
obyt = object_id.as_bytes
|
|
||||||
q.add_log_cmd(f"Testing CCSDS handler with object id: {object_id.as_hex_string}")
|
|
||||||
if op_code == "0":
|
|
||||||
q.add_log_cmd("CCSDS Handler: Set low rate")
|
|
||||||
command = obyt + struct.pack("!I", CommandId.SET_LOW_RATE)
|
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
|
||||||
if op_code == "1":
|
|
||||||
q.add_log_cmd("CCSDS Handler: Set high rate")
|
|
||||||
command = obyt + struct.pack("!I", CommandId.SET_HIGH_RATE)
|
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
|
||||||
if op_code == "2":
|
|
||||||
q.add_log_cmd("CCSDS Handler: Enables the transmitter")
|
|
||||||
command = obyt + struct.pack("!I", CommandId.EN_TRANSMITTER)
|
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
|
||||||
if op_code == "3":
|
|
||||||
q.add_log_cmd("CCSDS Handler: Disables the transmitter")
|
|
||||||
command = obyt + struct.pack("!I", CommandId.DIS_TRANSMITTER)
|
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
|
||||||
if op_code == "4":
|
|
||||||
q.add_log_cmd("CCSDS Handler: Set arbitrary bitrate")
|
|
||||||
bitrate = int(input("Specify bit rate (bps): "))
|
|
||||||
command = (
|
|
||||||
obyt
|
|
||||||
+ struct.pack("!I", CommandId.ARBITRARY_BITRATE)
|
|
||||||
+ struct.pack("!I", bitrate)
|
|
||||||
)
|
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
|
||||||
if op_code == "5":
|
|
||||||
q.add_log_cmd("CCSDS Handler: Enable tx clock manipulator")
|
|
||||||
command = obyt + struct.pack("!I", CommandId.ENABLE_TX_CLK_MANIPULATOR)
|
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
|
||||||
if op_code == "6":
|
|
||||||
q.add_log_cmd("CCSDS Handler: Disable tx clock manipulator")
|
|
||||||
command = obyt + struct.pack("!I", CommandId.DISABLE_TX_CLK_MANIPULATOR)
|
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
|
||||||
if op_code == "7":
|
|
||||||
q.add_log_cmd("CCSDS Handler: Update tx data on rising edge of tx clock")
|
|
||||||
command = obyt + struct.pack("!I", CommandId.UPDATE_ON_RISING_EDGE)
|
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
|
||||||
if op_code == "8":
|
|
||||||
q.add_log_cmd("CCSDS Handler: Update tx data on falling edge of tx clock")
|
|
||||||
command = obyt + struct.pack("!I", CommandId.UPDATE_ON_FALLING_EDGE)
|
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
|
@ -1,48 +0,0 @@
|
|||||||
import enum
|
|
||||||
|
|
||||||
from eive_tmtc.config.definitions import CustomServiceList
|
|
||||||
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
|
|
||||||
from tmtccmd.config.tmtc import tmtc_definitions_provider
|
|
||||||
from tmtccmd.tc import DefaultPusQueueHelper
|
|
||||||
from tmtccmd.tc.pus_3_fsfw_hk import make_sid, generate_one_hk_command
|
|
||||||
from tmtccmd.logging import get_console_logger
|
|
||||||
|
|
||||||
|
|
||||||
LOGGER = get_console_logger()
|
|
||||||
|
|
||||||
|
|
||||||
class OpCode:
|
|
||||||
REQ_OS_HK = ["0", "hk-os"]
|
|
||||||
RESET_GNSS = ["5", "reset"]
|
|
||||||
|
|
||||||
|
|
||||||
class Info:
|
|
||||||
REQ_OS_HK = "Request One-Shot HK"
|
|
||||||
RESET_GNSS = "Reset GNSS using reset pin"
|
|
||||||
|
|
||||||
|
|
||||||
class SetId:
|
|
||||||
HK = 0
|
|
||||||
|
|
||||||
|
|
||||||
@tmtc_definitions_provider
|
|
||||||
def add_gps_cmds(defs: TmtcDefinitionWrapper):
|
|
||||||
oce = OpCodeEntry()
|
|
||||||
oce.add(keys=OpCode.RESET_GNSS, info=Info.RESET_GNSS)
|
|
||||||
oce.add(keys=OpCode.REQ_OS_HK, info=Info.REQ_OS_HK)
|
|
||||||
defs.add_service(
|
|
||||||
name=CustomServiceList.GPS_CTRL.value,
|
|
||||||
info="GPS/GNSS Controller",
|
|
||||||
op_code_entry=oce,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def pack_gps_command(object_id: bytes, q: DefaultPusQueueHelper, op_code: str):
|
|
||||||
if op_code in OpCode.RESET_GNSS:
|
|
||||||
# TODO: This needs to be re-implemented
|
|
||||||
LOGGER.warning("Reset pin handling needs to be re-implemented")
|
|
||||||
if op_code in OpCode.REQ_OS_HK:
|
|
||||||
q.add_log_cmd(f"GMSS: {Info.REQ_OS_HK}")
|
|
||||||
q.add_pus_tc(
|
|
||||||
generate_one_hk_command(sid=make_sid(object_id=object_id, set_id=SetId.HK))
|
|
||||||
)
|
|
@ -1,10 +0,0 @@
|
|||||||
import enum
|
|
||||||
|
|
||||||
|
|
||||||
class AdisGyroSetId(enum.IntEnum):
|
|
||||||
CORE_HK = 0
|
|
||||||
CFG_HK = 1
|
|
||||||
|
|
||||||
|
|
||||||
class L3gGyroSetId(enum.IntEnum):
|
|
||||||
CORE_HK = 0
|
|
@ -1,9 +0,0 @@
|
|||||||
import enum
|
|
||||||
|
|
||||||
|
|
||||||
class MgmLis3SetId(enum.IntEnum):
|
|
||||||
CORE_HK = 0
|
|
||||||
|
|
||||||
|
|
||||||
class MgmRm3100SetId(enum.IntEnum):
|
|
||||||
CORE_HK = 0
|
|
@ -1,2 +0,0 @@
|
|||||||
class SetId:
|
|
||||||
HK = 3
|
|
@ -1,18 +1,18 @@
|
|||||||
"""Hook function which packs telecommands based on service and operation code string
|
"""Hook function which packs telecommands based on service and operation code string
|
||||||
"""
|
"""
|
||||||
|
import logging
|
||||||
from typing import cast
|
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.pus_tc.devs.rtd import pack_rtd_commands
|
from eive_tmtc.tmtc.tcs.rtd import pack_rtd_commands
|
||||||
from eive_tmtc.pus_tc.devs.scex import pack_scex_cmds
|
from eive_tmtc.tmtc.payload.scex import pack_scex_cmds
|
||||||
from eive_tmtc.pus_tc.system.controllers import (
|
from eive_tmtc.pus_tc.system.controllers import (
|
||||||
pack_cmd_ctrl_to_prompted_mode,
|
pack_cmd_ctrl_to_prompted_mode,
|
||||||
get_object_from_op_code,
|
get_object_from_op_code,
|
||||||
)
|
)
|
||||||
from eive_tmtc.tmtc.tcs 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
|
||||||
from tmtccmd.logging import get_console_logger
|
|
||||||
from tmtccmd.tc import DefaultPusQueueHelper
|
from tmtccmd.tc import DefaultPusQueueHelper
|
||||||
from tmtccmd.tc.decorator import (
|
from tmtccmd.tc.decorator import (
|
||||||
route_to_registered_service_handlers,
|
route_to_registered_service_handlers,
|
||||||
@ -28,23 +28,17 @@ from eive_tmtc.tmtc.power.pdu2 import pack_pdu2_commands
|
|||||||
from eive_tmtc.tmtc.power.pdu1 import pack_pdu1_commands
|
from eive_tmtc.tmtc.power.pdu1 import pack_pdu1_commands
|
||||||
from eive_tmtc.tmtc.power.acu import pack_acu_commands
|
from eive_tmtc.tmtc.power.acu import pack_acu_commands
|
||||||
from eive_tmtc.tmtc.acs.imtq import pack_imtq_test_into
|
from eive_tmtc.tmtc.acs.imtq import pack_imtq_test_into
|
||||||
from eive_tmtc.pus_tc.devs.tmp1075 import pack_tmp1075_test_into
|
from eive_tmtc.tmtc.tcs.heater import pack_heater_cmds
|
||||||
from eive_tmtc.pus_tc.devs.heater import pack_heater_cmds
|
|
||||||
from eive_tmtc.tmtc.acs.reaction_wheels import (
|
from eive_tmtc.tmtc.acs.reaction_wheels import (
|
||||||
pack_single_rw_test_into,
|
pack_single_rw_test_into,
|
||||||
pack_rw_ass_cmds,
|
pack_rw_ass_cmds,
|
||||||
)
|
)
|
||||||
from eive_tmtc.pus_tc.devs.rad_sensor import pack_rad_sensor_test_into
|
|
||||||
from eive_tmtc.tmtc.payload.ploc_memory_dumper import pack_ploc_memory_dumper_cmd
|
from eive_tmtc.tmtc.payload.ploc_memory_dumper import pack_ploc_memory_dumper_cmd
|
||||||
from eive_tmtc.pus_tc.devs.ccsds_handler import pack_ccsds_handler_test
|
from eive_tmtc.tmtc.com.ccsds_handler import pack_ccsds_handler_test
|
||||||
from eive_tmtc.tmtc.core import pack_core_commands
|
from eive_tmtc.tmtc.core import pack_core_commands
|
||||||
from eive_tmtc.pus_tc.devs.star_tracker import pack_star_tracker_commands
|
from eive_tmtc.tmtc.acs.star_tracker import pack_star_tracker_commands
|
||||||
from eive_tmtc.tmtc.syrlinks_hk_handler import pack_syrlinks_command
|
from eive_tmtc.tmtc.com.syrlinks_handler import pack_syrlinks_command
|
||||||
from eive_tmtc.pus_tc.devs.gps import pack_gps_command
|
|
||||||
from eive_tmtc.tmtc.acs.acs_board import pack_acs_command
|
from eive_tmtc.tmtc.acs.acs_board import pack_acs_command
|
||||||
from eive_tmtc.pus_tc.devs.plpcdu import pack_pl_pcdu_commands
|
|
||||||
from eive_tmtc.pus_tc.devs.str_img_helper import pack_str_img_helper_command
|
|
||||||
from eive_tmtc.pus_tc.system.proc import pack_proc_commands
|
|
||||||
from eive_tmtc.config.definitions import CustomServiceList
|
from eive_tmtc.config.definitions import CustomServiceList
|
||||||
from eive_tmtc.config.object_ids import (
|
from eive_tmtc.config.object_ids import (
|
||||||
P60_DOCK_HANDLER,
|
P60_DOCK_HANDLER,
|
||||||
@ -53,7 +47,7 @@ from eive_tmtc.config.object_ids import (
|
|||||||
ACU_HANDLER_ID,
|
ACU_HANDLER_ID,
|
||||||
TMP_1075_1_HANDLER_ID,
|
TMP_1075_1_HANDLER_ID,
|
||||||
TMP_1075_2_HANDLER_ID,
|
TMP_1075_2_HANDLER_ID,
|
||||||
HEATER_ID,
|
HEATER_CONTROLLER_ID,
|
||||||
IMTQ_HANDLER_ID,
|
IMTQ_HANDLER_ID,
|
||||||
RW1_ID,
|
RW1_ID,
|
||||||
RW2_ID,
|
RW2_ID,
|
||||||
@ -69,11 +63,17 @@ from eive_tmtc.config.object_ids import (
|
|||||||
RW_ASSEMBLY,
|
RW_ASSEMBLY,
|
||||||
get_object_ids,
|
get_object_ids,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
from eive_tmtc.tmtc.tcs.tmp1075 import pack_tmp1075_test_into
|
||||||
|
from eive_tmtc.tmtc.acs.gps import pack_gps_command
|
||||||
|
from eive_tmtc.tmtc.payload.rad_sensor import pack_rad_sensor_test_into
|
||||||
|
from eive_tmtc.tmtc.power.plpcdu import pack_pl_pcdu_commands
|
||||||
|
from eive_tmtc.tmtc.acs.str_img_helper import pack_str_img_helper_command
|
||||||
|
from eive_tmtc.pus_tc.system.proc import pack_proc_commands
|
||||||
|
|
||||||
import eive_tmtc.config.object_ids as oids
|
import eive_tmtc.config.object_ids as oids
|
||||||
from tmtccmd.util import ObjectIdU32
|
from tmtccmd.util import ObjectIdU32
|
||||||
|
|
||||||
LOGGER = get_console_logger()
|
|
||||||
|
|
||||||
|
|
||||||
def handle_default_procedure(
|
def handle_default_procedure(
|
||||||
tc_base: TcHandlerBase,
|
tc_base: TcHandlerBase,
|
||||||
@ -114,7 +114,7 @@ def handle_default_procedure(
|
|||||||
object_id=object_id, q=queue_helper, op_code=op_code
|
object_id=object_id, q=queue_helper, op_code=op_code
|
||||||
)
|
)
|
||||||
if service == CustomServiceList.HEATER.value:
|
if service == CustomServiceList.HEATER.value:
|
||||||
object_id = HEATER_ID
|
object_id = HEATER_CONTROLLER_ID
|
||||||
return pack_heater_cmds(object_id=object_id, q=queue_helper, op_code=op_code)
|
return pack_heater_cmds(object_id=object_id, q=queue_helper, op_code=op_code)
|
||||||
if service == CustomServiceList.IMTQ.value:
|
if service == CustomServiceList.IMTQ.value:
|
||||||
object_id = cast(ObjectIdU32, obj_id_man.get(IMTQ_HANDLER_ID))
|
object_id = cast(ObjectIdU32, obj_id_man.get(IMTQ_HANDLER_ID))
|
||||||
@ -166,8 +166,9 @@ def handle_default_procedure(
|
|||||||
object_id=oids.GPS_CONTROLLER, q=queue_helper, op_code=op_code
|
object_id=oids.GPS_CONTROLLER, q=queue_helper, op_code=op_code
|
||||||
)
|
)
|
||||||
if service == CustomServiceList.CCSDS_HANDLER.value:
|
if service == CustomServiceList.CCSDS_HANDLER.value:
|
||||||
|
object_id = cast(ObjectIdU32, obj_id_man.get(CCSDS_HANDLER_ID))
|
||||||
return pack_ccsds_handler_test(
|
return pack_ccsds_handler_test(
|
||||||
object_id=CCSDS_HANDLER_ID, q=queue_helper, op_code=op_code
|
object_id=object_id, q=queue_helper, op_code=op_code
|
||||||
)
|
)
|
||||||
if service == CustomServiceList.PDEC_HANDLER.value:
|
if service == CustomServiceList.PDEC_HANDLER.value:
|
||||||
return pack_ccsds_handler_test(
|
return pack_ccsds_handler_test(
|
||||||
@ -213,4 +214,4 @@ def handle_default_procedure(
|
|||||||
queue_helper=queue_helper,
|
queue_helper=queue_helper,
|
||||||
),
|
),
|
||||||
):
|
):
|
||||||
LOGGER.warning(f"Invalid Service {service}")
|
logging.getLogger(__name__).warning(f"Invalid Service {service}")
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
"""
|
"""
|
||||||
from spacepackets.ecss.tc import PusTelecommand
|
from spacepackets.ecss.tc import PusTelecommand
|
||||||
from tmtccmd.tc import DefaultPusQueueHelper
|
from tmtccmd.tc import DefaultPusQueueHelper
|
||||||
from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Mode
|
from tmtccmd.tc.pus_200_fsfw_mode import pack_mode_data, Mode
|
||||||
from eive_tmtc.config.object_ids import TEST_DEVICE_ID
|
from eive_tmtc.config.object_ids import TEST_DEVICE_ID
|
||||||
|
|
||||||
TEST_DEVICE_OBJ_ID = TEST_DEVICE_ID
|
TEST_DEVICE_OBJ_ID = TEST_DEVICE_ID
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
from tmtccmd.tc import DefaultPusQueueHelper
|
from tmtccmd.tc import DefaultPusQueueHelper
|
||||||
from tmtccmd.tc.pus_200_fsfw_modes import Mode
|
from tmtccmd.tc.pus_200_fsfw_mode import Mode
|
||||||
from tmtccmd.util import ObjectIdU32, ObjectIdBase
|
from tmtccmd.util import ObjectIdU32, ObjectIdBase
|
||||||
|
|
||||||
from eive_tmtc.tmtc.common import pack_mode_cmd_with_info
|
from eive_tmtc.tmtc.common import pack_mode_cmd_with_info
|
||||||
|
@ -17,20 +17,13 @@ from tmtccmd.pus.s11_tc_sched import (
|
|||||||
from tmtccmd.tc.pus_3_fsfw_hk import *
|
from tmtccmd.tc.pus_3_fsfw_hk import *
|
||||||
|
|
||||||
import eive_tmtc.config.object_ids as oids
|
import eive_tmtc.config.object_ids as oids
|
||||||
from eive_tmtc.tmtc.tcs import OpCodeAssy as TcsOpCodes, pack_tcs_sys_commands
|
from eive_tmtc.tmtc.tcs.brd_assy import OpCodeAssy as TcsOpCodes
|
||||||
from eive_tmtc.pus_tc.devs.bpx_batt import BpxSetId
|
from eive_tmtc.tmtc.tcs.subsystem import pack_tcs_sys_commands
|
||||||
from eive_tmtc.tmtc.core import SetId as CoreSetIds
|
from eive_tmtc.tmtc.core import SetId as CoreSetIds
|
||||||
from eive_tmtc.tmtc.power.common_power import SetId as GsSetIds
|
from eive_tmtc.tmtc.power.common_power import SetId as GsSetIds
|
||||||
from eive_tmtc.pus_tc.devs.rad_sensor import SetId as RadSetIds
|
from eive_tmtc.tmtc.com.syrlinks_handler import SetId as SyrlinksSetIds
|
||||||
from eive_tmtc.pus_tc.devs.mgms import MgmLis3SetId as MgmLis3SetIds_0_2
|
|
||||||
from eive_tmtc.pus_tc.devs.mgms import MgmRm3100SetId as MgmRm3100SetIds_1_3
|
|
||||||
from eive_tmtc.pus_tc.devs.gyros import AdisGyroSetId as AdisGyroSetIds_0_2
|
|
||||||
from eive_tmtc.pus_tc.devs.gyros import L3gGyroSetId as L3gGyroSetIds_1_3
|
|
||||||
from eive_tmtc.tmtc.syrlinks_hk_handler import SetId as SyrlinksSetIds
|
|
||||||
from eive_tmtc.pus_tc.devs.gps import SetId as GpsSetIds
|
|
||||||
from eive_tmtc.tmtc.acs.imtq import ImtqSetId
|
from eive_tmtc.tmtc.acs.imtq import ImtqSetId
|
||||||
from eive_tmtc.pus_tc.devs.sus import SetId
|
from eive_tmtc.tmtc.acs.star_tracker import SetId as StrSetIds
|
||||||
from eive_tmtc.pus_tc.devs.star_tracker import SetIds as StrSetIds
|
|
||||||
from eive_tmtc.tmtc.acs.reaction_wheels import (
|
from eive_tmtc.tmtc.acs.reaction_wheels import (
|
||||||
RwSetId,
|
RwSetId,
|
||||||
rw_speed_up_cmd_consec,
|
rw_speed_up_cmd_consec,
|
||||||
@ -43,9 +36,20 @@ from eive_tmtc.pus_tc.system.controllers import (
|
|||||||
from eive_tmtc.tmtc.acs.acs_board import pack_acs_command
|
from eive_tmtc.tmtc.acs.acs_board import pack_acs_command
|
||||||
from eive_tmtc.tmtc.acs.sus_board import pack_sus_cmds
|
from eive_tmtc.tmtc.acs.sus_board import pack_sus_cmds
|
||||||
from eive_tmtc.tmtc.acs.imtq import pack_imtq_test_into, pack_dipole_command
|
from eive_tmtc.tmtc.acs.imtq import pack_imtq_test_into, pack_dipole_command
|
||||||
from eive_tmtc.pus_tc.devs.star_tracker import pack_star_tracker_commands
|
from eive_tmtc.tmtc.acs.star_tracker import pack_star_tracker_commands
|
||||||
from eive_tmtc.tmtc.acs.reaction_wheels import pack_rw_ass_cmds, pack_set_speed_command
|
from eive_tmtc.tmtc.acs.reaction_wheels import pack_rw_ass_cmds, pack_set_speed_command
|
||||||
|
|
||||||
|
from eive_tmtc.tmtc.acs.sus import SetId
|
||||||
|
from eive_tmtc.tmtc.power.bpx_batt import BpxSetId
|
||||||
|
from eive_tmtc.tmtc.payload.rad_sensor import SetId as RadSetIds
|
||||||
|
from eive_tmtc.tmtc.acs.mgms import MgmLis3SetId as MgmLis3SetIds_0_2
|
||||||
|
from eive_tmtc.tmtc.acs.mgms import MgmRm3100SetId as MgmRm3100SetIds_1_3
|
||||||
|
from eive_tmtc.tmtc.acs.gyros import (
|
||||||
|
AdisGyroSetId as AdisGyroSetIds_0_2,
|
||||||
|
L3gGyroSetId as L3gGyroSetIds_1_3,
|
||||||
|
)
|
||||||
|
from eive_tmtc.tmtc.acs.gps import SetId as GpsSetIds
|
||||||
|
|
||||||
|
|
||||||
class OpCode:
|
class OpCode:
|
||||||
"""FT: Functional Test"""
|
"""FT: Functional Test"""
|
||||||
|
@ -1,15 +1,12 @@
|
|||||||
|
import logging
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
from eive_tmtc.config.definitions import CustomServiceList
|
from eive_tmtc.config.definitions import CustomServiceList
|
||||||
from spacepackets.ecss import PusTelecommand
|
from spacepackets.ecss import PusTelecommand
|
||||||
from tmtccmd import DefaultProcedureInfo, TcHandlerBase
|
|
||||||
|
|
||||||
from tmtccmd.logging import get_console_logger
|
from tmtccmd.tc import service_provider
|
||||||
from tmtccmd.tc import DefaultPusQueueHelper, service_provider
|
|
||||||
from tmtccmd.tc.decorator import ServiceProviderParams
|
from tmtccmd.tc.decorator import ServiceProviderParams
|
||||||
|
|
||||||
LOGGER = get_console_logger()
|
|
||||||
|
|
||||||
|
|
||||||
class OpCode:
|
class OpCode:
|
||||||
SET_CURRENT_TIME = ["0", "set-curr-time"]
|
SET_CURRENT_TIME = ["0", "set-curr-time"]
|
||||||
@ -24,6 +21,8 @@ def pack_set_current_time_ascii_command(p: ServiceProviderParams):
|
|||||||
q = p.queue_helper
|
q = p.queue_helper
|
||||||
time_test_current_time = datetime.utcnow().isoformat() + "Z" + "\0"
|
time_test_current_time = datetime.utcnow().isoformat() + "Z" + "\0"
|
||||||
current_time_ascii = time_test_current_time.encode("ascii")
|
current_time_ascii = time_test_current_time.encode("ascii")
|
||||||
LOGGER.info(f"Current time in ASCII format: {current_time_ascii}")
|
logging.getLogger(__name__).info(
|
||||||
|
f"Current time in ASCII format: {current_time_ascii}"
|
||||||
|
)
|
||||||
q.add_log_cmd(Info.SET_CURRENT_TIME)
|
q.add_log_cmd(Info.SET_CURRENT_TIME)
|
||||||
q.add_pus_tc(PusTelecommand(service=9, subservice=128, app_data=current_time_ascii))
|
q.add_pus_tc(PusTelecommand(service=9, subservice=128, app_data=current_time_ascii))
|
||||||
|
@ -4,14 +4,13 @@ from eive_tmtc.tmtc.acs.imtq import ImtqActionId
|
|||||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||||
from eive_tmtc.tmtc.payload.ploc_mpsoc import PlocReplyIds
|
from eive_tmtc.tmtc.payload.ploc_mpsoc import PlocReplyIds
|
||||||
from eive_tmtc.tmtc.payload.ploc_supervisor import SupvActionId
|
from eive_tmtc.tmtc.payload.ploc_supervisor import SupvActionId
|
||||||
from eive_tmtc.pus_tc.devs.star_tracker import StarTrackerActionId
|
from eive_tmtc.tmtc.acs.star_tracker import StarTrackerActionId
|
||||||
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.logging import get_console_logger
|
|
||||||
from tmtccmd.tm import Service8FsfwTm
|
from tmtccmd.tm import Service8FsfwTm
|
||||||
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
||||||
from spacepackets.ccsds.time import CdsShortTimestamp
|
from spacepackets.ccsds.time import CdsShortTimestamp
|
||||||
|
|
||||||
LOGGER = get_console_logger()
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def handle_action_reply(
|
def handle_action_reply(
|
||||||
@ -123,7 +122,7 @@ def handle_startracker_replies(
|
|||||||
):
|
):
|
||||||
if action_id == StarTrackerActionId.CHECKSUM:
|
if action_id == StarTrackerActionId.CHECKSUM:
|
||||||
if len(custom_data) != 5:
|
if len(custom_data) != 5:
|
||||||
LOGGER.warning(
|
_LOGGER.warning(
|
||||||
"Star tracker reply has invalid length {0}".format(len(custom_data))
|
"Star tracker reply has invalid length {0}".format(len(custom_data))
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
@ -1,68 +0,0 @@
|
|||||||
import struct
|
|
||||||
|
|
||||||
from eive_tmtc.pus_tc.devs.bpx_batt import BpxSetId
|
|
||||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
|
||||||
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
|
||||||
|
|
||||||
|
|
||||||
HEADER_LIST = [
|
|
||||||
"Charge Current",
|
|
||||||
"Discharge Current",
|
|
||||||
"Heater Current",
|
|
||||||
"Battery Voltage",
|
|
||||||
"Batt Temp 1",
|
|
||||||
"Batt Temp 2",
|
|
||||||
"Batt Temp 3",
|
|
||||||
"Batt Temp 4",
|
|
||||||
"Reboot Counter",
|
|
||||||
"Boot Cause",
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
def handle_bpx_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
|
|
||||||
pw = PrintWrapper(printer)
|
|
||||||
if set_id == BpxSetId.GET_HK_SET:
|
|
||||||
fmt_str = "!HHHHhhhhIB"
|
|
||||||
inc_len = struct.calcsize(fmt_str)
|
|
||||||
(
|
|
||||||
charge_current,
|
|
||||||
discharge_current,
|
|
||||||
heater_current,
|
|
||||||
batt_voltage,
|
|
||||||
batt_temp_1,
|
|
||||||
batt_temp_2,
|
|
||||||
batt_temp_3,
|
|
||||||
batt_temp_4,
|
|
||||||
reboot_cntr,
|
|
||||||
boot_cause,
|
|
||||||
) = struct.unpack(fmt_str, hk_data[0:inc_len])
|
|
||||||
content_list = [
|
|
||||||
charge_current,
|
|
||||||
discharge_current,
|
|
||||||
heater_current,
|
|
||||||
batt_voltage,
|
|
||||||
batt_temp_1,
|
|
||||||
batt_temp_2,
|
|
||||||
batt_temp_3,
|
|
||||||
batt_temp_4,
|
|
||||||
reboot_cntr,
|
|
||||||
boot_cause,
|
|
||||||
]
|
|
||||||
validity_buffer = hk_data[inc_len:]
|
|
||||||
pw.dlog(str(HEADER_LIST))
|
|
||||||
pw.dlog(str(content_list))
|
|
||||||
printer.print_validity_buffer(validity_buffer=validity_buffer, num_vars=10)
|
|
||||||
elif set_id == BpxSetId.GET_CFG_SET:
|
|
||||||
battheat_mode = hk_data[0]
|
|
||||||
battheat_low = struct.unpack("!b", hk_data[1:2])[0]
|
|
||||||
battheat_high = struct.unpack("!b", hk_data[2:3])[0]
|
|
||||||
header_list = [
|
|
||||||
"Battery Heater Mode",
|
|
||||||
"Battery Heater Low Limit",
|
|
||||||
"Battery Heater High Limit",
|
|
||||||
]
|
|
||||||
content_list = [battheat_mode, battheat_low, battheat_high]
|
|
||||||
validity_buffer = hk_data[3:]
|
|
||||||
pw.dlog(str(header_list))
|
|
||||||
pw.dlog(str(content_list))
|
|
||||||
printer.print_validity_buffer(validity_buffer=validity_buffer, num_vars=10)
|
|
@ -1,39 +0,0 @@
|
|||||||
import struct
|
|
||||||
|
|
||||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
|
||||||
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
|
||||||
|
|
||||||
|
|
||||||
def handle_gps_data(printer: FsfwTmTcPrinter, hk_data: bytes):
|
|
||||||
pw = PrintWrapper(printer)
|
|
||||||
pw.dlog(f"Received GPS data, HK data length {len(hk_data)}")
|
|
||||||
current_idx = 0
|
|
||||||
fmt_str = "!ddddBBBHBBBBBI"
|
|
||||||
inc_len = struct.calcsize(fmt_str)
|
|
||||||
(
|
|
||||||
lat,
|
|
||||||
long,
|
|
||||||
alt,
|
|
||||||
speed,
|
|
||||||
fix,
|
|
||||||
sats_in_use,
|
|
||||||
sats_in_view,
|
|
||||||
year,
|
|
||||||
month,
|
|
||||||
day,
|
|
||||||
hours,
|
|
||||||
minutes,
|
|
||||||
seconds,
|
|
||||||
unix_seconds,
|
|
||||||
) = struct.unpack(fmt_str, hk_data[current_idx : current_idx + inc_len])
|
|
||||||
current_idx += inc_len
|
|
||||||
date_string = f"{day}.{month}.{year} {hours}:{minutes}:{seconds}"
|
|
||||||
pw.dlog(f"Lat: {lat} deg")
|
|
||||||
pw.dlog(f"Long: {long} deg")
|
|
||||||
pw.dlog(f"Altitude: {alt} m | Speed: {speed} m/s")
|
|
||||||
pw.dlog(
|
|
||||||
f"Fix Type: {fix} | Sats in View {sats_in_view} | Sats in Use {sats_in_use}"
|
|
||||||
)
|
|
||||||
pw.dlog(f"GNSS Date: {date_string}")
|
|
||||||
pw.dlog(f"Unix seconds {unix_seconds}")
|
|
||||||
printer.print_validity_buffer(validity_buffer=hk_data[current_idx:], num_vars=14)
|
|
@ -1,52 +0,0 @@
|
|||||||
import struct
|
|
||||||
|
|
||||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
|
||||||
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
|
||||||
from eive_tmtc.pus_tc.devs.plpcdu import SetId
|
|
||||||
|
|
||||||
|
|
||||||
ADC_CHANNELS_NAMED = [
|
|
||||||
"U BAT DIV 6",
|
|
||||||
"U NEG V FB",
|
|
||||||
"I HPA",
|
|
||||||
"U HPA DIV 6",
|
|
||||||
"I MPA",
|
|
||||||
"U MPA DIV 6",
|
|
||||||
"I TX",
|
|
||||||
"U TX DIV 6",
|
|
||||||
"I X8",
|
|
||||||
"U X8 DIV 6",
|
|
||||||
"I DRO",
|
|
||||||
"U DRO DIV 6",
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
def handle_plpcdu_hk(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
|
|
||||||
if set_id == SetId.ADC:
|
|
||||||
pw = PrintWrapper(printer)
|
|
||||||
current_idx = 0
|
|
||||||
pw.dlog("Received PL PCDU ADC HK data")
|
|
||||||
channels = []
|
|
||||||
ch_print = "Channels Raw (hex): ["
|
|
||||||
for i in range(12):
|
|
||||||
channels.append(
|
|
||||||
struct.unpack("!H", hk_data[current_idx : current_idx + 2])[0]
|
|
||||||
)
|
|
||||||
if i < 11:
|
|
||||||
ch_print += f"{channels[i]:06x},"
|
|
||||||
else:
|
|
||||||
ch_print += f"{channels[i]:06x}]"
|
|
||||||
current_idx += 2
|
|
||||||
processed_vals = []
|
|
||||||
for i in range(12):
|
|
||||||
processed_vals.append(
|
|
||||||
struct.unpack("!f", hk_data[current_idx : current_idx + 4])[0]
|
|
||||||
)
|
|
||||||
current_idx += 4
|
|
||||||
temp = struct.unpack("!f", hk_data[current_idx : current_idx + 4])[0]
|
|
||||||
current_idx += 4
|
|
||||||
pw.dlog(f"Temperature: {temp} C")
|
|
||||||
pw.dlog(ch_print)
|
|
||||||
for i in range(12):
|
|
||||||
pw.dlog(f"{ADC_CHANNELS_NAMED[i].ljust(24)} | {processed_vals[i]}")
|
|
||||||
printer.print_validity_buffer(validity_buffer=hk_data[current_idx:], num_vars=3)
|
|
@ -1,24 +0,0 @@
|
|||||||
import struct
|
|
||||||
|
|
||||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
|
||||||
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
|
||||||
from eive_tmtc.pus_tc.devs.rad_sensor import SetId
|
|
||||||
|
|
||||||
|
|
||||||
def handle_rad_sensor_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
|
|
||||||
if set_id == SetId.HK:
|
|
||||||
pw = PrintWrapper(printer)
|
|
||||||
current_idx = 0
|
|
||||||
pw.dlog("Received Radiation Sensor HK data")
|
|
||||||
fmt_str = "!fHHHHHH"
|
|
||||||
inc_len = struct.calcsize(fmt_str)
|
|
||||||
(temp, ain0, ain1, ain4, ain5, ain6, ain7) = struct.unpack(
|
|
||||||
fmt_str, hk_data[current_idx : current_idx + inc_len]
|
|
||||||
)
|
|
||||||
ain_dict = {0: ain0, 1: ain1, 4: ain4, 5: ain5, 6: ain6, 7: ain7}
|
|
||||||
pw.dlog(f"Temperature: {temp} C")
|
|
||||||
pw.dlog(f"AIN Channel | Raw Value (hex) | Raw Value (dec)")
|
|
||||||
for idx, val in ain_dict.items():
|
|
||||||
pw.dlog(f"{idx} | {val:#06x} | {str(val).ljust(5)}")
|
|
||||||
current_idx += inc_len
|
|
||||||
printer.print_validity_buffer(validity_buffer=hk_data[current_idx:], num_vars=7)
|
|
@ -1,88 +1,86 @@
|
|||||||
|
import logging
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
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.acs_subsystem import AcsMode
|
from eive_tmtc.tmtc.acs.subsystem import AcsMode
|
||||||
from tmtccmd.tc.pus_200_fsfw_modes import Mode
|
from tmtccmd.tc.pus_200_fsfw_mode import Mode
|
||||||
|
|
||||||
from tmtccmd.tm import Service5Tm
|
from tmtccmd.tm import Service5Tm
|
||||||
from tmtccmd.logging import get_console_logger
|
|
||||||
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
||||||
from tmtccmd.fsfw import EventInfo
|
from tmtccmd.fsfw import EventInfo
|
||||||
from spacepackets.ccsds.time import CdsShortTimestamp
|
from spacepackets.ccsds.time import CdsShortTimestamp
|
||||||
|
|
||||||
LOGGER = get_console_logger()
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def handle_event_packet(raw_tm: bytes, printer: FsfwTmTcPrinter):
|
def handle_event_packet(raw_tm: bytes, printer: FsfwTmTcPrinter):
|
||||||
pw = PrintWrapper(printer)
|
pw = PrintWrapper(printer)
|
||||||
tm = Service5Tm.unpack(raw_telemetry=raw_tm, time_reader=CdsShortTimestamp.empty())
|
tm = Service5Tm.unpack(raw_telemetry=raw_tm, time_reader=CdsShortTimestamp.empty())
|
||||||
event_dict = get_event_dict()
|
event_dict = get_event_dict()
|
||||||
info = event_dict.get(tm.event_id)
|
event_def = tm.event_definition
|
||||||
|
info = event_dict.get(event_def.event_id)
|
||||||
if info is None:
|
if info is None:
|
||||||
LOGGER.warning(f"Event ID {tm.event_id} has no information")
|
_LOGGER.warning(f"Event ID {event_def.event_id} has no information")
|
||||||
info = EventInfo()
|
info = EventInfo()
|
||||||
info.name = "Unknown event"
|
info.name = "Unknown event"
|
||||||
obj_ids = get_object_ids()
|
obj_ids = get_object_ids()
|
||||||
obj_id_obj = obj_ids.get(tm.reporter_id.as_bytes)
|
obj_id_obj = obj_ids.get(event_def.reporter_id)
|
||||||
if obj_id_obj is None:
|
if obj_id_obj is None:
|
||||||
LOGGER.warning(f"Object ID 0x{tm.reporter_id.as_hex_string} has no name")
|
_LOGGER.warning(f"Object ID 0x{event_def.reporter_id.hex(sep=',')} has no name")
|
||||||
obj_name = tm.reporter_id.as_hex_string
|
obj_name = event_def.reporter_id.hex(sep=",")
|
||||||
else:
|
else:
|
||||||
obj_name = obj_id_obj.name
|
obj_name = obj_id_obj.name
|
||||||
generic_event_string = (
|
generic_event_string = f"Object {obj_name} generated Event {info.name} (ID: {event_def.event_id:#04x}) at {tm.time_provider.as_date_time()}"
|
||||||
f"Object {obj_name} generated Event {tm.event_id} | {info.name}"
|
|
||||||
)
|
|
||||||
pw.printer.file_logger.info(
|
pw.printer.file_logger.info(
|
||||||
f"{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}: {generic_event_string}"
|
f"{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}: {generic_event_string}"
|
||||||
)
|
)
|
||||||
LOGGER.info(generic_event_string)
|
_LOGGER.info(generic_event_string)
|
||||||
specific_handler = True
|
specific_handler = True
|
||||||
if info.name == "MODE_TRANSITION_FAILED":
|
if info.name == "MODE_TRANSITION_FAILED":
|
||||||
reason = generic_retval_printout(tm.param_1)
|
reason = generic_retval_printout(event_def.param1)
|
||||||
for string in reason:
|
for string in reason:
|
||||||
pw.dlog(f"Reason from event parameter 1: {string}")
|
pw.dlog(f"Reason from event parameter 1: {string}")
|
||||||
pw.dlog(f"Mode, sequence or table: {tm.param_2:#08x}")
|
pw.dlog(f"Mode, sequence or table: {event_def.param2:#08x}")
|
||||||
if info.name == "SUPV_UPDATE_PROGRESS" or info.name == "WRITE_MEMORY_FAILED":
|
if info.name == "SUPV_UPDATE_PROGRESS" or info.name == "WRITE_MEMORY_FAILED":
|
||||||
additional_event_info = f"Additional info: {info.info}"
|
additional_event_info = f"Additional info: {info.info}"
|
||||||
context = (
|
context = (
|
||||||
f"Progress Percent: {tm.param_1 >> 24 & 0xff} | Sequence Count: {tm.param_1 & 0xffff} "
|
f"Progress Percent: {event_def.param1 >> 24 & 0xff} | Sequence Count: {event_def.param1 & 0xffff} "
|
||||||
f"| Bytes Written: {tm.param_2}"
|
f"| Bytes Written: {event_def.param2}"
|
||||||
)
|
)
|
||||||
pw.dlog(additional_event_info)
|
pw.dlog(additional_event_info)
|
||||||
pw.dlog(context)
|
pw.dlog(context)
|
||||||
if info.name == "MODE_INFO":
|
if info.name == "MODE_INFO":
|
||||||
mode_name = "Unknown"
|
mode_name = "Unknown"
|
||||||
if obj_name == "ACS_SUBSYSTEM":
|
if obj_name == "ACS_SUBSYSTEM":
|
||||||
if tm.param_1 == Mode.OFF:
|
if event_def.param1 == Mode.OFF:
|
||||||
mode_name = "Off"
|
mode_name = "Off"
|
||||||
elif tm.param_1 == AcsMode.IDLE:
|
elif event_def.param1 == AcsMode.IDLE:
|
||||||
mode_name = "Idle"
|
mode_name = "Idle"
|
||||||
elif tm.param_1 == AcsMode.DETUMBLE:
|
elif event_def.param1 == AcsMode.DETUMBLE:
|
||||||
mode_name = "Detumble"
|
mode_name = "Detumble"
|
||||||
elif tm.param_1 == AcsMode.SAFE:
|
elif event_def.param1 == AcsMode.SAFE:
|
||||||
mode_name = "Safe"
|
mode_name = "Safe"
|
||||||
elif tm.param_1 == AcsMode.TARGET_PT:
|
elif event_def.param1 == AcsMode.TARGET_PT:
|
||||||
mode_name = "Target Pointing"
|
mode_name = "Target Pointing"
|
||||||
else:
|
else:
|
||||||
if tm.param_1 == Mode.OFF:
|
if event_def.param1 == Mode.OFF:
|
||||||
mode_name = "Off"
|
mode_name = "Off"
|
||||||
elif tm.param_1 == Mode.ON:
|
elif event_def.param1 == Mode.ON:
|
||||||
mode_name = "On"
|
mode_name = "On"
|
||||||
elif tm.param_1 == Mode.NORMAL:
|
elif event_def.param1 == Mode.NORMAL:
|
||||||
mode_name = "Normal"
|
mode_name = "Normal"
|
||||||
elif tm.param_1 == Mode.RAW:
|
elif event_def.param1 == Mode.RAW:
|
||||||
mode_name = "Raw"
|
mode_name = "Raw"
|
||||||
pw.dlog(f"Mode Number {tm.param_1}, Mode Name {mode_name}")
|
pw.dlog(f"Mode Number {event_def.param1}, Mode Name {mode_name}")
|
||||||
pw.dlog(f"Submode: {tm.param_2}")
|
pw.dlog(f"Submode: {event_def.param2}")
|
||||||
else:
|
else:
|
||||||
specific_handler = False
|
specific_handler = False
|
||||||
if info.info != "":
|
if info.info != "":
|
||||||
additional_event_info = (
|
additional_event_info = f"Additional info: {info.info} | P1: {event_def.param1} | P2: {event_def.param2}"
|
||||||
f"Additional info: {info.info} | P1: {tm.param_1} | P2: {tm.param_2}"
|
|
||||||
)
|
|
||||||
pw.dlog(additional_event_info)
|
pw.dlog(additional_event_info)
|
||||||
if not specific_handler:
|
if not specific_handler:
|
||||||
printer.handle_long_tm_print(packet_if=tm, info_if=tm)
|
# printer.handle_long_tm_print(packet_if=tm.pus_tm, info_if=tm.pus_tm)
|
||||||
|
pass
|
||||||
|
@ -1,15 +1,18 @@
|
|||||||
"""Core EIVE TM handler module
|
"""Core EIVE TM handler module
|
||||||
"""
|
"""
|
||||||
|
import logging
|
||||||
|
|
||||||
from eive_tmtc.config.object_ids import get_object_ids
|
from eive_tmtc.config.object_ids import get_object_ids
|
||||||
from spacepackets.ecss import PusTelemetry
|
from spacepackets.ecss import PusTelemetry
|
||||||
from spacepackets.ecss.pus_17_test import Service17Tm
|
from spacepackets.ecss.pus_17_test import Service17Tm
|
||||||
from spacepackets.util import PrintFormats
|
from spacepackets.util import PrintFormats
|
||||||
from spacepackets.ccsds.time import CdsShortTimestamp
|
from spacepackets.ccsds.time import CdsShortTimestamp
|
||||||
from tmtccmd import get_console_logger
|
|
||||||
from tmtccmd.logging.pus import RawTmtcTimedLogWrapper
|
from tmtccmd.logging.pus import RawTmtcTimedLogWrapper
|
||||||
from tmtccmd.pus import VerificationWrapper
|
from tmtccmd.pus import VerificationWrapper
|
||||||
from tmtccmd.tm import Service20FsfwTm, Service200FsfwTm
|
from tmtccmd.tm import Service20FsfwTm, Service200FsfwTm
|
||||||
from tmtccmd.tm.pus_200_fsfw_modes import Subservice as ModeSubservices
|
from tmtccmd.tm.pus_20_fsfw_param import Service20ParamDumpWrapper
|
||||||
|
from tmtccmd.pus.s20_fsfw_param_defs import CustomSubservice as ParamSubservice
|
||||||
|
from tmtccmd.tm.pus_200_fsfw_mode import Subservice as ModeSubservice
|
||||||
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
||||||
from .defs import PrintWrapper
|
from .defs import PrintWrapper
|
||||||
|
|
||||||
@ -18,7 +21,7 @@ from .verification_handler import handle_service_1_fsfw_packet, generic_retval_p
|
|||||||
from .hk_handling import handle_hk_packet
|
from .hk_handling import handle_hk_packet
|
||||||
from .action_reply_handler import handle_action_reply
|
from .action_reply_handler import handle_action_reply
|
||||||
|
|
||||||
LOGGER = get_console_logger()
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def pus_factory_hook(
|
def pus_factory_hook(
|
||||||
@ -28,13 +31,13 @@ def pus_factory_hook(
|
|||||||
raw_logger: RawTmtcTimedLogWrapper,
|
raw_logger: RawTmtcTimedLogWrapper,
|
||||||
):
|
):
|
||||||
if len(packet) < 8:
|
if len(packet) < 8:
|
||||||
LOGGER.warning("Detected packet shorter than 8 bytes!")
|
_LOGGER.warning("Detected packet shorter than 8 bytes!")
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
tm_packet = PusTelemetry.unpack(packet, CdsShortTimestamp.empty())
|
tm_packet = PusTelemetry.unpack(packet, CdsShortTimestamp.empty())
|
||||||
except ValueError:
|
except ValueError:
|
||||||
LOGGER.warning("Could not generate PUS TM object from raw data")
|
_LOGGER.warning("Could not generate PUS TM object from raw data")
|
||||||
LOGGER.warning(f"Raw Packet: [{packet.hex(sep=',')}], REPR: {packet!r}")
|
_LOGGER.warning(f"Raw Packet: [{packet.hex(sep=',')}], REPR: {packet!r}")
|
||||||
return
|
return
|
||||||
service = tm_packet.service
|
service = tm_packet.service
|
||||||
obj_id_dict = get_object_ids()
|
obj_id_dict = get_object_ids()
|
||||||
@ -56,15 +59,42 @@ def pus_factory_hook(
|
|||||||
verif_wrapper.dlog("Received Ping Reply TM[17,2]")
|
verif_wrapper.dlog("Received Ping Reply TM[17,2]")
|
||||||
dedicated_handler = True
|
dedicated_handler = True
|
||||||
elif service == 20:
|
elif service == 20:
|
||||||
tm_packet = Service20FsfwTm.unpack(
|
param_packet = Service20FsfwTm.unpack(
|
||||||
raw_telemetry=packet, time_reader=CdsShortTimestamp.empty()
|
raw_telemetry=packet, time_reader=CdsShortTimestamp.empty()
|
||||||
)
|
)
|
||||||
dedicated_handler = False
|
if tm_packet.subservice == ParamSubservice.TM_DUMP_REPLY:
|
||||||
|
param_wrapper = Service20ParamDumpWrapper(param_tm=param_packet)
|
||||||
|
try:
|
||||||
|
param = param_wrapper.get_param()
|
||||||
|
obj = obj_id_dict.get(param_wrapper.param_tm.object_id)
|
||||||
|
pw.dlog(f"Received parameter dump TM from {obj}")
|
||||||
|
pw.dlog(f"Parameter: {param}")
|
||||||
|
if param.rows == 1 and param.columns == 1:
|
||||||
|
try:
|
||||||
|
scalar_param = param.parse_scalar_param()
|
||||||
|
if isinstance(scalar_param, int):
|
||||||
|
pw.dlog(f"Scalar integer parameter: {scalar_param}")
|
||||||
|
elif isinstance(scalar_param, float):
|
||||||
|
pw.dlog(f"Scalar floating point parameter: {scalar_param}")
|
||||||
|
except ValueError as e:
|
||||||
|
pw.dlog("received {e} trying to parse scalar parameter")
|
||||||
|
else:
|
||||||
|
# TODO: Could improve display further by actually displaying a matrix as a
|
||||||
|
# matrix using row and column information
|
||||||
|
pw.dlog(
|
||||||
|
f"Received vector or matrix data: {param.param_raw.hex(sep=',')}"
|
||||||
|
)
|
||||||
|
except ValueError as e:
|
||||||
|
pw.dlog(f"received {e} when trying to parse parameters")
|
||||||
|
except NotImplementedError as e:
|
||||||
|
pw.dlog(f"received {e} when trying to parse parameters")
|
||||||
|
else:
|
||||||
|
pw.dlog(f"unknown subservice {tm_packet.subservice} for parameter service")
|
||||||
elif service == 200:
|
elif service == 200:
|
||||||
tm_packet = Service200FsfwTm.unpack(
|
tm_packet = Service200FsfwTm.unpack(
|
||||||
raw_telemetry=packet, time_reader=CdsShortTimestamp.empty()
|
raw_telemetry=packet, time_reader=CdsShortTimestamp.empty()
|
||||||
)
|
)
|
||||||
if tm_packet.subservice == ModeSubservices.TM_CANT_REACH_MODE:
|
if tm_packet.subservice == ModeSubservice.TM_CANT_REACH_MODE:
|
||||||
obj_id = tm_packet.object_id
|
obj_id = tm_packet.object_id
|
||||||
obj_id_obj = obj_id_dict.get(obj_id)
|
obj_id_obj = obj_id_dict.get(obj_id)
|
||||||
retval = tm_packet.return_value
|
retval = tm_packet.return_value
|
||||||
@ -76,7 +106,7 @@ def pus_factory_hook(
|
|||||||
else:
|
else:
|
||||||
dedicated_handler = False
|
dedicated_handler = False
|
||||||
else:
|
else:
|
||||||
LOGGER.info(f"The service {service} is not implemented in Telemetry Factory")
|
_LOGGER.info(f"The service {service} is not implemented in Telemetry Factory")
|
||||||
tm_packet.print_source_data(PrintFormats.HEX)
|
tm_packet.print_source_data(PrintFormats.HEX)
|
||||||
dedicated_handler = True
|
dedicated_handler = True
|
||||||
if not dedicated_handler and tm_packet is not None:
|
if not dedicated_handler and tm_packet is not None:
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
"""HK Handling for EIVE OBSW"""
|
"""HK Handling for EIVE OBSW"""
|
||||||
|
import logging
|
||||||
|
|
||||||
# from pus_tm.tcp_server_objects import TCP_SEVER_SENSOR_TEMPERATURES
|
# from pus_tm.tcp_server_objects import TCP_SEVER_SENSOR_TEMPERATURES
|
||||||
from eive_tmtc.tmtc.acs.acs_ctrl import handle_raw_mgm_data, handle_acs_ctrl_hk_data
|
from eive_tmtc.tmtc.acs.acs_ctrl import handle_raw_mgm_data, handle_acs_ctrl_hk_data
|
||||||
from eive_tmtc.pus_tm.devs.plpcdu import handle_plpcdu_hk
|
from eive_tmtc.tmtc.power.plpcdu import handle_plpcdu_hk
|
||||||
from eive_tmtc.pus_tm.devs.rad_sensor import handle_rad_sensor_data
|
from eive_tmtc.tmtc.payload.rad_sensor import handle_rad_sensor_data
|
||||||
from eive_tmtc.pus_tm.devs.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.syrlinks_hk_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 tmtccmd.tm.pus_3_fsfw_hk import (
|
from tmtccmd.tm.pus_3_fsfw_hk import (
|
||||||
Service3Base,
|
Service3Base,
|
||||||
@ -14,11 +16,10 @@ from tmtccmd.tm.pus_3_fsfw_hk import (
|
|||||||
Service3FsfwTm,
|
Service3FsfwTm,
|
||||||
)
|
)
|
||||||
from tmtccmd.util.obj_id import ObjectIdU32, ObjectIdDictT
|
from tmtccmd.util.obj_id import ObjectIdU32, ObjectIdDictT
|
||||||
from tmtccmd.logging import get_console_logger
|
|
||||||
|
|
||||||
from eive_tmtc.pus_tm.devs.bpx_bat import handle_bpx_hk_data
|
from eive_tmtc.tmtc.power.bpx_batt import handle_bpx_hk_data
|
||||||
from eive_tmtc.pus_tm.devs.gps import handle_gps_data
|
from eive_tmtc.tmtc.acs.gps import handle_gps_data
|
||||||
from eive_tmtc.pus_tm.devs.gyros import handle_gyros_hk_data
|
from eive_tmtc.tmtc.acs.gyros import handle_gyros_hk_data
|
||||||
from eive_tmtc.tmtc.power.tm import (
|
from eive_tmtc.tmtc.power.tm import (
|
||||||
handle_pdu_data,
|
handle_pdu_data,
|
||||||
handle_p60_hk_data,
|
handle_p60_hk_data,
|
||||||
@ -33,11 +34,11 @@ from eive_tmtc.tmtc.acs.imtq import (
|
|||||||
)
|
)
|
||||||
from eive_tmtc.pus_tm.defs import FsfwTmTcPrinter
|
from eive_tmtc.pus_tm.defs import FsfwTmTcPrinter
|
||||||
from eive_tmtc.tmtc.core import handle_core_hk_data
|
from eive_tmtc.tmtc.core import handle_core_hk_data
|
||||||
from eive_tmtc.pus_tm.devs.mgms import handle_mgm_hk_data
|
from eive_tmtc.tmtc.acs.mgms import handle_mgm_hk_data
|
||||||
import eive_tmtc.config.object_ids as obj_ids
|
import eive_tmtc.config.object_ids as obj_ids
|
||||||
|
|
||||||
|
|
||||||
LOGGER = get_console_logger()
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
FORWARD_SENSOR_TEMPS = False
|
FORWARD_SENSOR_TEMPS = False
|
||||||
@ -74,11 +75,11 @@ def handle_hk_packet(
|
|||||||
hk_data=hk_data,
|
hk_data=hk_data,
|
||||||
)
|
)
|
||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
LOGGER.exception(
|
_LOGGER.exception(
|
||||||
f"{e} error when parsing HK data coming from {named_obj_id}"
|
f"{e} error when parsing HK data coming from {named_obj_id}"
|
||||||
)
|
)
|
||||||
if tm_packet.subservice == 10 or tm_packet.subservice == 12:
|
if tm_packet.subservice == 10 or tm_packet.subservice == 12:
|
||||||
LOGGER.warning("HK definitions printout not implemented yet")
|
_LOGGER.warning("HK definitions printout not implemented yet")
|
||||||
|
|
||||||
|
|
||||||
def handle_regular_hk_print(
|
def handle_regular_hk_print(
|
||||||
@ -106,7 +107,7 @@ def handle_regular_hk_print(
|
|||||||
elif set_id == ImtqSetId.RAW_MTM_SET:
|
elif set_id == ImtqSetId.RAW_MTM_SET:
|
||||||
return handle_raw_mtm_measurement(printer, hk_data)
|
return handle_raw_mtm_measurement(printer, hk_data)
|
||||||
else:
|
else:
|
||||||
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.BPX_HANDLER_ID:
|
elif objb == obj_ids.BPX_HANDLER_ID:
|
||||||
@ -177,7 +178,7 @@ def handle_regular_hk_print(
|
|||||||
elif objb == obj_ids.ACS_CONTROLLER:
|
elif objb == obj_ids.ACS_CONTROLLER:
|
||||||
handle_acs_ctrl_hk_data(printer, set_id, hk_data)
|
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} "
|
||||||
f"has not been implemented."
|
f"has not been implemented."
|
||||||
)
|
)
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
|
import logging
|
||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
|
|
||||||
from spacepackets.ccsds import CdsShortTimestamp
|
from spacepackets.ccsds import CdsShortTimestamp
|
||||||
from spacepackets.ecss.pus_1_verification import UnpackParams, Service1Tm
|
from spacepackets.ecss.pus_1_verification import UnpackParams, Service1Tm
|
||||||
from tmtccmd.logging import get_console_logger
|
|
||||||
from tmtccmd.pus import VerificationWrapper
|
from tmtccmd.pus import VerificationWrapper
|
||||||
from tmtccmd.tm.pus_1_verification import Service1FsfwWrapper
|
from tmtccmd.tm.pus_1_verification import Service1FsfwWrapper
|
||||||
from eive_tmtc.config.retvals import get_retval_dict
|
from eive_tmtc.config.retvals import get_retval_dict
|
||||||
|
|
||||||
LOGGER = get_console_logger()
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def handle_service_1_fsfw_packet(wrapper: VerificationWrapper, raw_tm: bytes):
|
def handle_service_1_fsfw_packet(wrapper: VerificationWrapper, raw_tm: bytes):
|
||||||
@ -22,11 +22,11 @@ def handle_service_1_fsfw_packet(wrapper: VerificationWrapper, raw_tm: bytes):
|
|||||||
fsfw_wrapper = Service1FsfwWrapper(tm_packet)
|
fsfw_wrapper = Service1FsfwWrapper(tm_packet)
|
||||||
res = wrapper.verificator.add_tm(tm_packet)
|
res = wrapper.verificator.add_tm(tm_packet)
|
||||||
if res is None:
|
if res is None:
|
||||||
LOGGER.info(
|
_LOGGER.info(
|
||||||
f"Received Verification TM[{tm_packet.service}, {tm_packet.subservice}] "
|
f"Received Verification TM[{tm_packet.service}, {tm_packet.subservice}] "
|
||||||
f"with Request ID {tm_packet.tc_req_id.as_u32():#08x}"
|
f"with Request ID {tm_packet.tc_req_id.as_u32():#08x}"
|
||||||
)
|
)
|
||||||
LOGGER.warning(f"No matching telecommand found for {tm_packet.tc_req_id}")
|
_LOGGER.warning(f"No matching telecommand found for {tm_packet.tc_req_id}")
|
||||||
else:
|
else:
|
||||||
wrapper.log_to_console(tm_packet, res)
|
wrapper.log_to_console(tm_packet, res)
|
||||||
wrapper.log_to_file(tm_packet, res)
|
wrapper.log_to_file(tm_packet, res)
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
from .payload.pl_subsystem import add_payload_subsystem_cmds
|
from .payload.subsystem import add_payload_subsystem_cmds
|
||||||
from .solar_array_deployment import add_sa_depl_cmds
|
from .solar_array_deployment import add_sa_depl_cmds
|
||||||
from .test import add_test_defs
|
from .test import add_test_defs
|
||||||
|
@ -8,7 +8,7 @@ from tmtccmd.config.tmtc import (
|
|||||||
)
|
)
|
||||||
from tmtccmd.tc import service_provider, DefaultPusQueueHelper
|
from tmtccmd.tc import service_provider, DefaultPusQueueHelper
|
||||||
from tmtccmd.tc.decorator import ServiceProviderParams
|
from tmtccmd.tc.decorator import ServiceProviderParams
|
||||||
from tmtccmd.tc.pus_200_fsfw_modes import Mode
|
from tmtccmd.tc.pus_200_fsfw_mode import Mode
|
||||||
from eive_tmtc.config.object_ids import ACS_BOARD_ASS_ID
|
from eive_tmtc.config.object_ids import ACS_BOARD_ASS_ID
|
||||||
|
|
||||||
from eive_tmtc.tmtc.common import pack_mode_cmd_with_info
|
from eive_tmtc.tmtc.common import pack_mode_cmd_with_info
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import enum
|
import enum
|
||||||
|
import logging
|
||||||
import socket
|
import socket
|
||||||
import struct
|
import struct
|
||||||
from socket import AF_INET
|
from socket import AF_INET
|
||||||
@ -7,14 +8,13 @@ from typing import Tuple
|
|||||||
from eive_tmtc.config.definitions import CustomServiceList
|
from eive_tmtc.config.definitions import CustomServiceList
|
||||||
from eive_tmtc.config.object_ids import ACS_CONTROLLER
|
from eive_tmtc.config.object_ids import ACS_CONTROLLER
|
||||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||||
from tmtccmd import get_console_logger
|
|
||||||
from tmtccmd.config.tmtc import (
|
from tmtccmd.config.tmtc import (
|
||||||
tmtc_definitions_provider,
|
tmtc_definitions_provider,
|
||||||
TmtcDefinitionWrapper,
|
TmtcDefinitionWrapper,
|
||||||
OpCodeEntry,
|
OpCodeEntry,
|
||||||
)
|
)
|
||||||
from tmtccmd.tc import service_provider
|
from tmtccmd.tc import service_provider
|
||||||
from tmtccmd.tc.pus_200_fsfw_modes import Mode, pack_mode_command
|
from tmtccmd.tc.pus_200_fsfw_mode import Mode, pack_mode_command
|
||||||
from tmtccmd.tc.decorator import ServiceProviderParams
|
from tmtccmd.tc.decorator import ServiceProviderParams
|
||||||
from tmtccmd.tc.pus_3_fsfw_hk import (
|
from tmtccmd.tc.pus_3_fsfw_hk import (
|
||||||
generate_one_hk_command,
|
generate_one_hk_command,
|
||||||
@ -25,9 +25,6 @@ from tmtccmd.tc.pus_3_fsfw_hk import (
|
|||||||
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
||||||
|
|
||||||
|
|
||||||
LOGGER = get_console_logger()
|
|
||||||
|
|
||||||
|
|
||||||
class SetId(enum.IntEnum):
|
class SetId(enum.IntEnum):
|
||||||
MGM_RAW_SET = 0
|
MGM_RAW_SET = 0
|
||||||
MGM_PROC_SET = 1
|
MGM_PROC_SET = 1
|
||||||
@ -378,7 +375,7 @@ def pack_acs_ctrl_command(p: ServiceProviderParams):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
LOGGER.info(f"Unknown op code {op_code}")
|
logging.getLogger(__name__).info(f"Unknown op code {op_code}")
|
||||||
|
|
||||||
|
|
||||||
def handle_acs_ctrl_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
|
def handle_acs_ctrl_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
|
||||||
@ -534,6 +531,7 @@ def handle_mgm_data_processed(pw: PrintWrapper, hk_data: bytes):
|
|||||||
mgm_vec = struct.unpack(fmt_str, hk_data[current_idx : current_idx + inc_len])
|
mgm_vec = struct.unpack(fmt_str, hk_data[current_idx : current_idx + inc_len])
|
||||||
mgm_vec = [f"{val:8.3f}" for val in mgm_vec]
|
mgm_vec = [f"{val:8.3f}" for val in mgm_vec]
|
||||||
pw.dlog(f"MGM {i}: {mgm_vec}")
|
pw.dlog(f"MGM {i}: {mgm_vec}")
|
||||||
|
current_idx += inc_len
|
||||||
fmt_str = "!ddd"
|
fmt_str = "!ddd"
|
||||||
inc_len = struct.calcsize(fmt_str)
|
inc_len = struct.calcsize(fmt_str)
|
||||||
mgm_vec_tot = struct.unpack(fmt_str, hk_data[current_idx : current_idx + inc_len])
|
mgm_vec_tot = struct.unpack(fmt_str, hk_data[current_idx : current_idx + inc_len])
|
||||||
|
84
eive_tmtc/tmtc/acs/gps.py
Normal file
84
eive_tmtc/tmtc/acs/gps.py
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
import logging
|
||||||
|
import struct
|
||||||
|
|
||||||
|
from eive_tmtc.config.definitions import CustomServiceList
|
||||||
|
from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||||
|
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
|
||||||
|
from tmtccmd.config.tmtc import tmtc_definitions_provider
|
||||||
|
from tmtccmd.tc import DefaultPusQueueHelper
|
||||||
|
from tmtccmd.tc.pus_3_fsfw_hk import make_sid, generate_one_hk_command
|
||||||
|
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
||||||
|
|
||||||
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
class OpCode:
|
||||||
|
REQ_OS_HK = ["0", "hk-os"]
|
||||||
|
RESET_GNSS = ["5", "reset"]
|
||||||
|
|
||||||
|
|
||||||
|
class Info:
|
||||||
|
REQ_OS_HK = "Request One-Shot HK"
|
||||||
|
RESET_GNSS = "Reset GNSS using reset pin"
|
||||||
|
|
||||||
|
|
||||||
|
class SetId:
|
||||||
|
HK = 0
|
||||||
|
|
||||||
|
|
||||||
|
@tmtc_definitions_provider
|
||||||
|
def add_gps_cmds(defs: TmtcDefinitionWrapper):
|
||||||
|
oce = OpCodeEntry()
|
||||||
|
oce.add(keys=OpCode.RESET_GNSS, info=Info.RESET_GNSS)
|
||||||
|
oce.add(keys=OpCode.REQ_OS_HK, info=Info.REQ_OS_HK)
|
||||||
|
defs.add_service(
|
||||||
|
name=CustomServiceList.GPS_CTRL.value,
|
||||||
|
info="GPS/GNSS Controller",
|
||||||
|
op_code_entry=oce,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def pack_gps_command(object_id: bytes, q: DefaultPusQueueHelper, op_code: str):
|
||||||
|
if op_code in OpCode.RESET_GNSS:
|
||||||
|
# TODO: This needs to be re-implemented
|
||||||
|
_LOGGER.warning("Reset pin handling needs to be re-implemented")
|
||||||
|
if op_code in OpCode.REQ_OS_HK:
|
||||||
|
q.add_log_cmd(f"GMSS: {Info.REQ_OS_HK}")
|
||||||
|
q.add_pus_tc(
|
||||||
|
generate_one_hk_command(sid=make_sid(object_id=object_id, set_id=SetId.HK))
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def handle_gps_data(printer: FsfwTmTcPrinter, hk_data: bytes):
|
||||||
|
pw = PrintWrapper(printer)
|
||||||
|
pw.dlog(f"Received GPS data, HK data length {len(hk_data)}")
|
||||||
|
current_idx = 0
|
||||||
|
fmt_str = "!ddddBBBHBBBBBI"
|
||||||
|
inc_len = struct.calcsize(fmt_str)
|
||||||
|
(
|
||||||
|
lat,
|
||||||
|
long,
|
||||||
|
alt,
|
||||||
|
speed,
|
||||||
|
fix,
|
||||||
|
sats_in_use,
|
||||||
|
sats_in_view,
|
||||||
|
year,
|
||||||
|
month,
|
||||||
|
day,
|
||||||
|
hours,
|
||||||
|
minutes,
|
||||||
|
seconds,
|
||||||
|
unix_seconds,
|
||||||
|
) = struct.unpack(fmt_str, hk_data[current_idx : current_idx + inc_len])
|
||||||
|
current_idx += inc_len
|
||||||
|
date_string = f"{day}.{month}.{year} {hours}:{minutes}:{seconds}"
|
||||||
|
pw.dlog(f"Lat: {lat} deg")
|
||||||
|
pw.dlog(f"Long: {long} deg")
|
||||||
|
pw.dlog(f"Altitude: {alt} m | Speed: {speed} m/s")
|
||||||
|
pw.dlog(
|
||||||
|
f"Fix Type: {fix} | Sats in View {sats_in_view} | Sats in Use {sats_in_use}"
|
||||||
|
)
|
||||||
|
pw.dlog(f"GNSS Date: {date_string}")
|
||||||
|
pw.dlog(f"Unix seconds {unix_seconds}")
|
||||||
|
printer.print_validity_buffer(validity_buffer=hk_data[current_idx:], num_vars=14)
|
@ -1,11 +1,20 @@
|
|||||||
|
import enum
|
||||||
import struct
|
import struct
|
||||||
|
|
||||||
|
import eive_tmtc.config.object_ids as obj_ids
|
||||||
|
|
||||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||||
from tmtccmd.util import ObjectIdU32
|
from tmtccmd.util import ObjectIdU32
|
||||||
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
||||||
|
|
||||||
from eive_tmtc.pus_tc.devs.gyros import L3gGyroSetId, AdisGyroSetId
|
|
||||||
import eive_tmtc.config.object_ids as obj_ids
|
class AdisGyroSetId(enum.IntEnum):
|
||||||
|
CORE_HK = 0
|
||||||
|
CFG_HK = 1
|
||||||
|
|
||||||
|
|
||||||
|
class L3gGyroSetId(enum.IntEnum):
|
||||||
|
CORE_HK = 0
|
||||||
|
|
||||||
|
|
||||||
def handle_gyros_hk_data(
|
def handle_gyros_hk_data(
|
@ -22,7 +22,7 @@ from tmtccmd.tc.pus_3_fsfw_hk import (
|
|||||||
generate_one_diag_command,
|
generate_one_diag_command,
|
||||||
generate_one_hk_command,
|
generate_one_hk_command,
|
||||||
)
|
)
|
||||||
from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Mode
|
from tmtccmd.tc.pus_200_fsfw_mode import pack_mode_data, Mode
|
||||||
from tmtccmd.util import ObjectIdU32
|
from tmtccmd.util import ObjectIdU32
|
||||||
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
||||||
|
|
||||||
|
@ -1,10 +1,19 @@
|
|||||||
|
import enum
|
||||||
import struct
|
import struct
|
||||||
|
|
||||||
|
import eive_tmtc.config.object_ids as obj_ids
|
||||||
|
|
||||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||||
from eive_tmtc.pus_tc.devs.mgms import MgmRm3100SetId, MgmLis3SetId
|
|
||||||
from tmtccmd.util import ObjectIdU32
|
from tmtccmd.util import ObjectIdU32
|
||||||
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
||||||
import eive_tmtc.config.object_ids as obj_ids
|
|
||||||
|
|
||||||
|
class MgmLis3SetId(enum.IntEnum):
|
||||||
|
CORE_HK = 0
|
||||||
|
|
||||||
|
|
||||||
|
class MgmRm3100SetId(enum.IntEnum):
|
||||||
|
CORE_HK = 0
|
||||||
|
|
||||||
|
|
||||||
def handle_mgm_hk_data(
|
def handle_mgm_hk_data(
|
@ -20,7 +20,7 @@ from tmtccmd.tc.pus_3_fsfw_hk import (
|
|||||||
disable_periodic_hk_command,
|
disable_periodic_hk_command,
|
||||||
)
|
)
|
||||||
from spacepackets.ecss.tc import PusTelecommand
|
from spacepackets.ecss.tc import PusTelecommand
|
||||||
from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Mode, Subservice
|
from tmtccmd.tc.pus_200_fsfw_mode import pack_mode_data, Mode, Subservice
|
||||||
from eive_tmtc.config.definitions import CustomServiceList
|
from eive_tmtc.config.definitions import CustomServiceList
|
||||||
from tmtccmd.util import ObjectIdU32
|
from tmtccmd.util import ObjectIdU32
|
||||||
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
||||||
|
@ -6,18 +6,18 @@
|
|||||||
@date 14.08.2021
|
@date 14.08.2021
|
||||||
"""
|
"""
|
||||||
import enum
|
import enum
|
||||||
|
import logging
|
||||||
import struct
|
import struct
|
||||||
|
|
||||||
from spacepackets.ecss.tc import PusTelecommand
|
from spacepackets.ecss.tc import PusTelecommand
|
||||||
from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Mode
|
from tmtccmd.tc.pus_200_fsfw_mode import pack_mode_data, Mode
|
||||||
from tmtccmd.logging import get_console_logger
|
|
||||||
|
|
||||||
from tmtccmd.tc import DefaultPusQueueHelper
|
from tmtccmd.tc import DefaultPusQueueHelper
|
||||||
from tmtccmd.util import ObjectIdU32
|
from tmtccmd.util import ObjectIdU32
|
||||||
from eive_tmtc.utility.input_helper import InputHelper
|
from eive_tmtc.utility.input_helper import InputHelper
|
||||||
|
|
||||||
|
|
||||||
LOGGER = get_console_logger()
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class StarTrackerActionId(enum.IntEnum):
|
class StarTrackerActionId(enum.IntEnum):
|
||||||
@ -90,8 +90,18 @@ class OpCodes:
|
|||||||
NORMAL = ["2", "nml"]
|
NORMAL = ["2", "nml"]
|
||||||
|
|
||||||
|
|
||||||
class SetIds:
|
class SetId(enum.IntEnum):
|
||||||
|
VERSION = 2
|
||||||
|
INTERFACE = 3
|
||||||
|
POWER = 11
|
||||||
TEMPERATURE = 25
|
TEMPERATURE = 25
|
||||||
|
SOLUTION = 24
|
||||||
|
HISTOGRAM = 28
|
||||||
|
CHECKSUM = 50
|
||||||
|
CAMERA = 67
|
||||||
|
LIMITS = 68
|
||||||
|
CENTROIDING = 72
|
||||||
|
LISA = 73
|
||||||
|
|
||||||
|
|
||||||
class FileDefs:
|
class FileDefs:
|
||||||
@ -637,7 +647,7 @@ def pack_checksum_command(object_id: bytes) -> bytearray:
|
|||||||
|
|
||||||
|
|
||||||
def get_config_file() -> str:
|
def get_config_file() -> str:
|
||||||
LOGGER.info("Specify json file")
|
_LOGGER.info("Specify json file")
|
||||||
input_helper = InputHelper(json_dict)
|
input_helper = InputHelper(json_dict)
|
||||||
key = input_helper.get_key()
|
key = input_helper.get_key()
|
||||||
json_file = json_dict[key][1]
|
json_file = json_dict[key][1]
|
||||||
@ -645,7 +655,7 @@ def get_config_file() -> str:
|
|||||||
|
|
||||||
|
|
||||||
def get_firmware() -> str:
|
def get_firmware() -> str:
|
||||||
LOGGER.info("Specify firmware file")
|
_LOGGER.info("Specify firmware file")
|
||||||
input_helper = InputHelper(firmware_dict)
|
input_helper = InputHelper(firmware_dict)
|
||||||
key = input_helper.get_key()
|
key = input_helper.get_key()
|
||||||
firmware = firmware_dict[key][1]
|
firmware = firmware_dict[key][1]
|
||||||
@ -653,7 +663,7 @@ def get_firmware() -> str:
|
|||||||
|
|
||||||
|
|
||||||
def get_upload_image() -> str:
|
def get_upload_image() -> str:
|
||||||
LOGGER.info("Specify image to upload")
|
_LOGGER.info("Specify image to upload")
|
||||||
input_helper = InputHelper(upload_image_dict)
|
input_helper = InputHelper(upload_image_dict)
|
||||||
key = input_helper.get_key()
|
key = input_helper.get_key()
|
||||||
image = upload_image_dict[key][1]
|
image = upload_image_dict[key][1]
|
@ -10,7 +10,7 @@ from tmtccmd.config.tmtc import (
|
|||||||
TmtcDefinitionWrapper,
|
TmtcDefinitionWrapper,
|
||||||
OpCodeEntry,
|
OpCodeEntry,
|
||||||
)
|
)
|
||||||
from tmtccmd.tc.pus_200_fsfw_modes import Subservice as ModeSubservices
|
from tmtccmd.tc.pus_200_fsfw_mode import Subservice as ModeSubservices
|
||||||
from tmtccmd.tc import service_provider
|
from tmtccmd.tc import service_provider
|
||||||
from tmtccmd.tc.decorator import ServiceProviderParams
|
from tmtccmd.tc.decorator import ServiceProviderParams
|
||||||
|
|
@ -1,11 +1,14 @@
|
|||||||
import struct
|
import struct
|
||||||
|
|
||||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||||
from eive_tmtc.pus_tc.devs.sus import SetId
|
|
||||||
from tmtccmd.util import ObjectIdU32
|
from tmtccmd.util import ObjectIdU32
|
||||||
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
||||||
|
|
||||||
|
|
||||||
|
class SetId:
|
||||||
|
HK = 3
|
||||||
|
|
||||||
|
|
||||||
def handle_sus_hk(
|
def handle_sus_hk(
|
||||||
object_id: ObjectIdU32, hk_data: bytes, printer: FsfwTmTcPrinter, set_id: int
|
object_id: ObjectIdU32, hk_data: bytes, printer: FsfwTmTcPrinter, set_id: int
|
||||||
):
|
):
|
@ -9,7 +9,7 @@ from tmtccmd.config.tmtc import (
|
|||||||
)
|
)
|
||||||
from tmtccmd.tc import service_provider, DefaultPusQueueHelper
|
from tmtccmd.tc import service_provider, DefaultPusQueueHelper
|
||||||
from tmtccmd.tc.decorator import ServiceProviderParams
|
from tmtccmd.tc.decorator import ServiceProviderParams
|
||||||
from tmtccmd.tc.pus_200_fsfw_modes import Mode
|
from tmtccmd.tc.pus_200_fsfw_mode import Mode
|
||||||
|
|
||||||
|
|
||||||
class SusOpCode:
|
class SusOpCode:
|
||||||
|
1
eive_tmtc/tmtc/com/__init__.py
Normal file
1
eive_tmtc/tmtc/com/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
from .subsystem import add_com_subsystem_cmds
|
132
eive_tmtc/tmtc/com/ccsds_handler.py
Normal file
132
eive_tmtc/tmtc/com/ccsds_handler.py
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
"""
|
||||||
|
@file ccsds_handler.py
|
||||||
|
@brief Test commanding of CCSDS Handler
|
||||||
|
@author J. Meier
|
||||||
|
@date 20.11.2021
|
||||||
|
"""
|
||||||
|
import enum
|
||||||
|
import struct
|
||||||
|
|
||||||
|
from eive_tmtc.config.definitions import CustomServiceList
|
||||||
|
from spacepackets.ecss.tc import PusTelecommand
|
||||||
|
from tmtccmd.config.tmtc import (
|
||||||
|
tmtc_definitions_provider,
|
||||||
|
OpCodeEntry,
|
||||||
|
TmtcDefinitionWrapper,
|
||||||
|
)
|
||||||
|
from tmtccmd.tc import DefaultPusQueueHelper
|
||||||
|
from tmtccmd.tc.pus_200_fsfw_mode import create_mode_command, Mode
|
||||||
|
from tmtccmd.util import ObjectIdU32
|
||||||
|
from eive_tmtc.config.object_ids import CCSDS_HANDLER_ID
|
||||||
|
|
||||||
|
|
||||||
|
class ActionId(enum.IntEnum):
|
||||||
|
# Configures input rate of syrlinks to 400 Khz (results in downlink rate of 200 kbps)
|
||||||
|
# SET_LOW_RATE = 0
|
||||||
|
# Configures input rate of syrlinks to 2000 Khz (results in downlink rate of 1000 kbps)
|
||||||
|
# SET_HIGH_RATE = 1
|
||||||
|
# Enables the syrlinks transmitter (by using RS485 enables lines). Please note that this
|
||||||
|
# is a legacy command. It is recommended to use mode commands instead
|
||||||
|
EN_TRANSMITTER = 2
|
||||||
|
# Disables the syrlinks transmitter (by using RS485 enables lines). Please note that this is
|
||||||
|
# a legacy command. It is recommended to use mode commands instead.
|
||||||
|
DIS_TRANSMITTER = 3
|
||||||
|
# Sets an arbitrary bitrate. Normally only set low and set high rate commands should be
|
||||||
|
# required
|
||||||
|
ARBITRARY_BITRATE = 4
|
||||||
|
ENABLE_TX_CLK_MANIPULATOR = 5
|
||||||
|
DISABLE_TX_CLK_MANIPULATOR = 6
|
||||||
|
# Tx data will be updated on rising edge of tx clock
|
||||||
|
UPDATE_ON_RISING_EDGE = 7
|
||||||
|
# Tx data will be updated on falling edge of tx clock
|
||||||
|
UPDATE_ON_FALLING_EDGE = 8
|
||||||
|
|
||||||
|
|
||||||
|
class Submode(enum.IntEnum):
|
||||||
|
# Informative, do not command this.
|
||||||
|
UNSET = 0
|
||||||
|
DATARATE_LOW = 1
|
||||||
|
DATARATE_HIGH = 2
|
||||||
|
|
||||||
|
|
||||||
|
class OpCode:
|
||||||
|
ENABLE_WITH_LOW_DATARATE = ["enable_low_datarate"]
|
||||||
|
ENABLE_WITH_HIGH_DATARATE = ["enable_high_datarate"]
|
||||||
|
DISABLE = ["disable"]
|
||||||
|
ENABLE_ACTION = ["legacy_enable_tx"]
|
||||||
|
DISABLE_ACTION = ["legacy_disable_tx"]
|
||||||
|
|
||||||
|
|
||||||
|
class Info:
|
||||||
|
ENABLE_WITH_LOW_DATARATE = "Enable TX with low datarate"
|
||||||
|
ENABLE_WITH_HIGH_DATARATE = "Enable TX with high datarate"
|
||||||
|
DISABLE = "Disable TX"
|
||||||
|
ENABLE_ACTION = "Enable TX (legacy)"
|
||||||
|
DISABLE_ACTION = "Disable TX (legacy)"
|
||||||
|
|
||||||
|
|
||||||
|
def pack_ccsds_handler_test(
|
||||||
|
object_id: ObjectIdU32, q: DefaultPusQueueHelper, op_code: str
|
||||||
|
):
|
||||||
|
obyt = object_id.as_bytes
|
||||||
|
prefix = "CCSDS Handler"
|
||||||
|
q.add_log_cmd(f"Testing CCSDS handler with object id: {object_id.as_hex_string}")
|
||||||
|
if op_code in OpCode.ENABLE_WITH_LOW_DATARATE:
|
||||||
|
q.add_log_cmd(f"{prefix}: {Info.ENABLE_WITH_LOW_DATARATE}")
|
||||||
|
q.add_pus_tc(create_mode_command(obyt, Mode.ON, Submode.DATARATE_LOW))
|
||||||
|
if op_code in OpCode.ENABLE_WITH_HIGH_DATARATE:
|
||||||
|
q.add_log_cmd(f"{prefix}: {Info.ENABLE_WITH_HIGH_DATARATE}")
|
||||||
|
q.add_pus_tc(create_mode_command(obyt, Mode.ON, Submode.DATARATE_HIGH))
|
||||||
|
if op_code in OpCode.DISABLE:
|
||||||
|
q.add_log_cmd(f"{prefix}: {Info.DISABLE}")
|
||||||
|
q.add_pus_tc(create_mode_command(obyt, Mode.OFF, 0))
|
||||||
|
if op_code in OpCode.ENABLE_ACTION:
|
||||||
|
q.add_log_cmd(f"{prefix}: {Info.ENABLE_ACTION}")
|
||||||
|
command = obyt + struct.pack("!I", ActionId.EN_TRANSMITTER)
|
||||||
|
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||||
|
if op_code in OpCode.DISABLE_ACTION:
|
||||||
|
q.add_log_cmd(f"{prefix}: {Info.DISABLE_ACTION}")
|
||||||
|
command = obyt + struct.pack("!I", ActionId.DIS_TRANSMITTER)
|
||||||
|
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||||
|
if op_code == "4":
|
||||||
|
q.add_log_cmd("CCSDS Handler: Set arbitrary bitrate")
|
||||||
|
bitrate = int(input("Specify bit rate (bps): "))
|
||||||
|
command = (
|
||||||
|
obyt
|
||||||
|
+ struct.pack("!I", ActionId.ARBITRARY_BITRATE)
|
||||||
|
+ struct.pack("!I", bitrate)
|
||||||
|
)
|
||||||
|
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||||
|
if op_code == "5":
|
||||||
|
q.add_log_cmd("CCSDS Handler: Enable tx clock manipulator")
|
||||||
|
command = obyt + struct.pack("!I", ActionId.ENABLE_TX_CLK_MANIPULATOR)
|
||||||
|
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||||
|
if op_code == "6":
|
||||||
|
q.add_log_cmd("CCSDS Handler: Disable tx clock manipulator")
|
||||||
|
command = obyt + struct.pack("!I", ActionId.DISABLE_TX_CLK_MANIPULATOR)
|
||||||
|
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||||
|
if op_code == "7":
|
||||||
|
q.add_log_cmd("CCSDS Handler: Update tx data on rising edge of tx clock")
|
||||||
|
command = obyt + struct.pack("!I", ActionId.UPDATE_ON_RISING_EDGE)
|
||||||
|
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||||
|
if op_code == "8":
|
||||||
|
q.add_log_cmd("CCSDS Handler: Update tx data on falling edge of tx clock")
|
||||||
|
command = obyt + struct.pack("!I", ActionId.UPDATE_ON_FALLING_EDGE)
|
||||||
|
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||||
|
|
||||||
|
|
||||||
|
@tmtc_definitions_provider
|
||||||
|
def add_ccsds_cmds(defs: TmtcDefinitionWrapper):
|
||||||
|
oce = OpCodeEntry()
|
||||||
|
oce.add(OpCode.ENABLE_WITH_LOW_DATARATE, Info.ENABLE_WITH_LOW_DATARATE)
|
||||||
|
oce.add(OpCode.ENABLE_WITH_HIGH_DATARATE, Info.ENABLE_WITH_HIGH_DATARATE)
|
||||||
|
oce.add(OpCode.DISABLE, Info.DISABLE)
|
||||||
|
oce.add(OpCode.ENABLE_ACTION, Info.ENABLE_ACTION)
|
||||||
|
oce.add(OpCode.DISABLE_ACTION, Info.DISABLE_ACTION)
|
||||||
|
oce.add("4", "CCSDS Handler: Set arbitrary bitrate")
|
||||||
|
oce.add("5", "CCSDS Handler: Enable tx clock manipulator")
|
||||||
|
oce.add("6", "CCSDS Handler: Disable tx clock manipulator")
|
||||||
|
oce.add("7", "CCSDS Handler: Update tx data on rising edge")
|
||||||
|
oce.add("8", "CCSDS Handler: Update tx data on falling edge")
|
||||||
|
defs.add_service(CustomServiceList.CCSDS_HANDLER.value, "CCSDS Handler", oce)
|
115
eive_tmtc/tmtc/com/subsystem.py
Normal file
115
eive_tmtc/tmtc/com/subsystem.py
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
import enum
|
||||||
|
|
||||||
|
from eive_tmtc.config.definitions import CustomServiceList
|
||||||
|
from eive_tmtc.config.object_ids import COM_SUBSYSTEM_ID
|
||||||
|
from eive_tmtc.tmtc.com.syrlinks_handler import Datarate
|
||||||
|
from tmtccmd.config.tmtc import (
|
||||||
|
tmtc_definitions_provider,
|
||||||
|
TmtcDefinitionWrapper,
|
||||||
|
OpCodeEntry,
|
||||||
|
)
|
||||||
|
from tmtccmd.tc import service_provider
|
||||||
|
from tmtccmd.tc.decorator import ServiceProviderParams
|
||||||
|
from tmtccmd.tc.pus_200_fsfw_mode import create_mode_command
|
||||||
|
from tmtccmd.tc.pus_20_fsfw_param import (
|
||||||
|
create_load_param_cmd,
|
||||||
|
pack_scalar_u8_parameter_app_data,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class ParameterId(enum.IntEnum):
|
||||||
|
DATARATE = 0
|
||||||
|
|
||||||
|
|
||||||
|
class Submode(enum.IntEnum):
|
||||||
|
RX_ONLY = 0
|
||||||
|
RX_AND_TX_DEF_DATARATE = 1
|
||||||
|
RX_AND_TX_LOW_DATARATE = 2
|
||||||
|
RX_AND_TX_HIGH_DATARATE = 3
|
||||||
|
RX_AND_TX_CARRIER_WAVE = 4
|
||||||
|
|
||||||
|
|
||||||
|
class OpCode:
|
||||||
|
RX_ONLY = "rx_only"
|
||||||
|
TX_AND_RX_DEF_RATE = "rx_and_tx_default_rate"
|
||||||
|
TX_AND_RX_LOW_RATE = "rx_and_tx_low_rate"
|
||||||
|
TX_AND_RX_HIGH_RATE = "rx_and_tx_high_rate"
|
||||||
|
TX_AND_RX_CARRIER_WAVE = "rx_and_tx_carrier_wave"
|
||||||
|
UPDATE_DEFAULT_DATARATE_LOW = "update_default_rate_low"
|
||||||
|
UPDATE_DEFAULT_DATARATE_HIGH = "update_default_rate_high"
|
||||||
|
|
||||||
|
|
||||||
|
class Info:
|
||||||
|
RX_ONLY = "Syrlinks RX Only"
|
||||||
|
TX_AND_RX_DEF_DATARATE = "Syrlinks with TX default datarate"
|
||||||
|
TX_AND_RX_LOW_DATARATE = "Syrlinks with TX low datarate (BPSK modulation)"
|
||||||
|
TX_AND_RX_HIGH_DATARATE = "Syrlinks with TX high datarate (0QPSK modulation)"
|
||||||
|
TX_AND_RX_CARRIER_WAVE = "Syrlinks with TX carrier wave"
|
||||||
|
UPDATE_DEFAULT_DATARATE_LOW = "Configure default low datarate (BPSK modulation)"
|
||||||
|
UPDATE_DEFAULT_DATARATE_HIGH = "Configure default high datarate (0QPSK modulation)"
|
||||||
|
|
||||||
|
|
||||||
|
@service_provider(CustomServiceList.COM_SS)
|
||||||
|
def build_com_subsystem_cmd(p: ServiceProviderParams):
|
||||||
|
q = p.queue_helper
|
||||||
|
o = p.op_code
|
||||||
|
prefix = "COM Subsystem"
|
||||||
|
if o == OpCode.RX_ONLY:
|
||||||
|
q.add_log_cmd(Info.RX_ONLY)
|
||||||
|
q.add_pus_tc(create_mode_command(COM_SUBSYSTEM_ID, Submode.RX_ONLY, 0))
|
||||||
|
elif o == OpCode.TX_AND_RX_DEF_RATE:
|
||||||
|
q.add_log_cmd(Info.TX_AND_RX_DEF_DATARATE)
|
||||||
|
q.add_pus_tc(
|
||||||
|
create_mode_command(COM_SUBSYSTEM_ID, Submode.RX_AND_TX_DEF_DATARATE, 0)
|
||||||
|
)
|
||||||
|
elif o == OpCode.TX_AND_RX_LOW_RATE:
|
||||||
|
q.add_log_cmd(Info.TX_AND_RX_LOW_DATARATE)
|
||||||
|
q.add_pus_tc(
|
||||||
|
create_mode_command(COM_SUBSYSTEM_ID, Submode.RX_AND_TX_LOW_DATARATE, 0)
|
||||||
|
)
|
||||||
|
elif o == OpCode.TX_AND_RX_HIGH_RATE:
|
||||||
|
q.add_log_cmd(Info.TX_AND_RX_HIGH_DATARATE)
|
||||||
|
q.add_pus_tc(
|
||||||
|
create_mode_command(COM_SUBSYSTEM_ID, Submode.RX_AND_TX_HIGH_DATARATE, 0)
|
||||||
|
)
|
||||||
|
if o == OpCode.UPDATE_DEFAULT_DATARATE_LOW:
|
||||||
|
q.add_log_cmd(f"{prefix}: {Info.UPDATE_DEFAULT_DATARATE_LOW}")
|
||||||
|
q.add_pus_tc(
|
||||||
|
create_load_param_cmd(
|
||||||
|
pack_scalar_u8_parameter_app_data(
|
||||||
|
COM_SUBSYSTEM_ID,
|
||||||
|
0,
|
||||||
|
ParameterId.DATARATE,
|
||||||
|
Datarate.LOW_RATE_MODULATION_BPSK,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
if o == OpCode.UPDATE_DEFAULT_DATARATE_HIGH:
|
||||||
|
q.add_log_cmd(f"{prefix}: {Info.UPDATE_DEFAULT_DATARATE_HIGH}")
|
||||||
|
q.add_pus_tc(
|
||||||
|
create_load_param_cmd(
|
||||||
|
pack_scalar_u8_parameter_app_data(
|
||||||
|
COM_SUBSYSTEM_ID,
|
||||||
|
0,
|
||||||
|
ParameterId.DATARATE,
|
||||||
|
Datarate.HIGH_RATE_MODULATION_0QPSK,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
elif o == OpCode.TX_AND_RX_CARRIER_WAVE:
|
||||||
|
q.add_log_cmd(Info.TX_AND_RX_CARRIER_WAVE)
|
||||||
|
q.add_pus_tc(
|
||||||
|
create_mode_command(COM_SUBSYSTEM_ID, Submode.RX_AND_TX_CARRIER_WAVE, 0)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@tmtc_definitions_provider
|
||||||
|
def add_com_subsystem_cmds(defs: TmtcDefinitionWrapper):
|
||||||
|
oce = OpCodeEntry()
|
||||||
|
oce.add(OpCode.RX_ONLY, Info.RX_ONLY)
|
||||||
|
oce.add(OpCode.TX_AND_RX_LOW_RATE, Info.TX_AND_RX_LOW_DATARATE)
|
||||||
|
oce.add(OpCode.TX_AND_RX_HIGH_RATE, Info.TX_AND_RX_HIGH_DATARATE)
|
||||||
|
oce.add(OpCode.TX_AND_RX_DEF_RATE, Info.TX_AND_RX_DEF_DATARATE)
|
||||||
|
oce.add(OpCode.UPDATE_DEFAULT_DATARATE_LOW, Info.UPDATE_DEFAULT_DATARATE_LOW)
|
||||||
|
oce.add(OpCode.UPDATE_DEFAULT_DATARATE_HIGH, Info.UPDATE_DEFAULT_DATARATE_HIGH)
|
||||||
|
defs.add_service(CustomServiceList.COM_SS, "COM Subsystem", oce)
|
@ -23,7 +23,8 @@ from tmtccmd.tc.pus_3_fsfw_hk import (
|
|||||||
create_disable_periodic_hk_command,
|
create_disable_periodic_hk_command,
|
||||||
)
|
)
|
||||||
from spacepackets.ecss.tc import PusTelecommand
|
from spacepackets.ecss.tc import PusTelecommand
|
||||||
from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Mode
|
from tmtccmd.tc.pus_200_fsfw_mode import Mode, create_mode_command
|
||||||
|
from eive_tmtc.config.object_ids import SYRLINKS_HANDLER_ID
|
||||||
import struct
|
import struct
|
||||||
|
|
||||||
from tmtccmd.util import ObjectIdU32
|
from tmtccmd.util import ObjectIdU32
|
||||||
@ -39,24 +40,35 @@ class SetId:
|
|||||||
class OpCode:
|
class OpCode:
|
||||||
OFF = "off"
|
OFF = "off"
|
||||||
ON = "on"
|
ON = "on"
|
||||||
NORMAL = "nml"
|
NORMAL_RX_ONLY = "nml_rx_only"
|
||||||
STANDBY = "set_tx_standby"
|
NORMAL_RX_AND_TX_CW = "nml_carrier_wave"
|
||||||
SET_CW = "set_tx_carrier_wave"
|
NORMAL_RX_AND_TX_DEF_DATARATE = "nml_default_datarate"
|
||||||
MODULATION = "modulation"
|
NORMAL_RX_AND_TX_LOW_DATARATE = "nml_low_datarate"
|
||||||
|
NORMAL_RX_AND_TX_HIGH_DATARATE = "nml_high_datarate"
|
||||||
HK_RX_REGS = "hk_rx_regs"
|
HK_RX_REGS = "hk_rx_regs"
|
||||||
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"
|
||||||
|
DISABLE_HK_TX_REGS = "disable_hk_tx"
|
||||||
HK_TX_REGS = "hk_tx_regs"
|
HK_TX_REGS = "hk_tx_regs"
|
||||||
TX_STATUS = "tx_status"
|
TX_STATUS = "tx_status"
|
||||||
RX_STATUS = "rx_status"
|
RX_STATUS = "rx_status"
|
||||||
|
|
||||||
|
|
||||||
class Info:
|
class Info:
|
||||||
|
OFF = "Switch OFF"
|
||||||
|
ON = "Switch ON"
|
||||||
|
NORMAL_RX_ONLY = "NORMAL RX Only, set TX to standby"
|
||||||
|
NORMAL_RX_AND_TX_CW = "NORMAL RX and TX, TX Carrier Wave"
|
||||||
|
NORMAL_RX_AND_TX_DEF_DATARATE = "NORMAL RX and TX, TX with default datarate"
|
||||||
|
NORMAL_RX_AND_TX_LOW_DATARATE = "NORMAL RX and TX, TX with low 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"
|
||||||
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"
|
||||||
EMABLE_HK_TX_REGS = "Enable periodic TX register HK"
|
ENABLE_HK_TX_REGS = "Enable periodic TX register HK"
|
||||||
|
DISABLE_HK_TX_REGS = "Disable periodic TX register HK"
|
||||||
TX_STATUS = "Read TX status (always read in normal mode)"
|
TX_STATUS = "Read TX status (always read in normal mode)"
|
||||||
RX_STATUS = "Read RX status (always read in normal mode)"
|
RX_STATUS = "Read RX status (always read in normal mode)"
|
||||||
SET_CW = "Set TX carrier wave"
|
SET_CW = "Set TX carrier wave"
|
||||||
@ -80,21 +92,37 @@ class CommandId(enum.IntEnum):
|
|||||||
DISABLE_DEBUG = 21
|
DISABLE_DEBUG = 21
|
||||||
|
|
||||||
|
|
||||||
|
class Submode(enum.IntEnum):
|
||||||
|
RX_ONLY = 0
|
||||||
|
RX_AND_TX_DEFAULT_DATARATE = 1
|
||||||
|
RX_AND_TX_LOW_DATARATE = 2
|
||||||
|
RX_AND_TX_HIGH_DATARATE = 3
|
||||||
|
RX_AND_TX_CW = 4
|
||||||
|
|
||||||
|
|
||||||
|
class Datarate(enum.IntEnum):
|
||||||
|
LOW_RATE_MODULATION_BPSK = 0
|
||||||
|
HIGH_RATE_MODULATION_0QPSK = 1
|
||||||
|
|
||||||
|
|
||||||
@tmtc_definitions_provider
|
@tmtc_definitions_provider
|
||||||
def add_syrlinks_cmds(defs: TmtcDefinitionWrapper):
|
def add_syrlinks_cmds(defs: TmtcDefinitionWrapper):
|
||||||
oce = OpCodeEntry()
|
oce = OpCodeEntry()
|
||||||
oce.add(OpCode.OFF, "Syrlinks Handler: Set mode off")
|
oce.add(OpCode.OFF, Info.OFF)
|
||||||
oce.add(OpCode.ON, "Syrlinks Handler: Set mode on")
|
oce.add(OpCode.ON, Info.ON)
|
||||||
oce.add(OpCode.NORMAL, "Syrlinks Handler: Set mode normal")
|
oce.add(OpCode.NORMAL_RX_ONLY, Info.NORMAL_RX_ONLY)
|
||||||
oce.add(OpCode.STANDBY, "Syrlinks Handler: Set TX standby")
|
oce.add(OpCode.NORMAL_RX_AND_TX_CW, Info.NORMAL_RX_AND_TX_CW)
|
||||||
oce.add(OpCode.MODULATION, "Syrlinks Handler: Set TX modulation")
|
oce.add(OpCode.NORMAL_RX_AND_TX_DEF_DATARATE, Info.NORMAL_RX_AND_TX_DEF_DATARATE)
|
||||||
|
oce.add(OpCode.NORMAL_RX_AND_TX_LOW_DATARATE, Info.NORMAL_RX_AND_TX_LOW_DATARATE)
|
||||||
|
oce.add(OpCode.NORMAL_RX_AND_TX_HIGH_DATARATE, Info.NORMAL_RX_AND_TX_HIGH_DATARATE)
|
||||||
oce.add(OpCode.HK_RX_REGS, Info.HK_RX_REGS)
|
oce.add(OpCode.HK_RX_REGS, Info.HK_RX_REGS)
|
||||||
oce.add(OpCode.HK_TX_REGS, Info.HK_TX_REGS)
|
oce.add(OpCode.HK_TX_REGS, Info.HK_TX_REGS)
|
||||||
oce.add(OpCode.SET_CW, Info.SET_CW)
|
|
||||||
oce.add(OpCode.TX_STATUS, Info.TX_STATUS)
|
oce.add(OpCode.TX_STATUS, Info.TX_STATUS)
|
||||||
oce.add(OpCode.RX_STATUS, Info.RX_STATUS)
|
oce.add(OpCode.RX_STATUS, Info.RX_STATUS)
|
||||||
oce.add(OpCode.ENABLE_HK_RX_REGS, Info.ENABLE_HK_RX_REGS)
|
oce.add(OpCode.ENABLE_HK_RX_REGS, Info.ENABLE_HK_RX_REGS)
|
||||||
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.DISABLE_HK_TX_REGS, Info.DISABLE_HK_TX_REGS)
|
||||||
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")
|
||||||
@ -108,6 +136,14 @@ def add_syrlinks_cmds(defs: TmtcDefinitionWrapper):
|
|||||||
defs.add_service(CustomServiceList.SYRLINKS.value, "Syrlinks Handler", oce)
|
defs.add_service(CustomServiceList.SYRLINKS.value, "Syrlinks Handler", oce)
|
||||||
|
|
||||||
|
|
||||||
|
_PREFIX = "Syrlinks"
|
||||||
|
|
||||||
|
|
||||||
|
def normal_mode_cmd(q: DefaultPusQueueHelper, info: str, submode: int):
|
||||||
|
q.add_log_cmd(f"{_PREFIX}: {info}")
|
||||||
|
q.add_pus_tc(create_mode_command(SYRLINKS_HANDLER_ID, Mode.NORMAL, submode))
|
||||||
|
|
||||||
|
|
||||||
def pack_syrlinks_command(
|
def pack_syrlinks_command(
|
||||||
object_id: ObjectIdU32, q: DefaultPusQueueHelper, op_code: str
|
object_id: ObjectIdU32, q: DefaultPusQueueHelper, op_code: str
|
||||||
):
|
):
|
||||||
@ -115,29 +151,27 @@ def pack_syrlinks_command(
|
|||||||
prefix = "Syrlinks"
|
prefix = "Syrlinks"
|
||||||
q.add_log_cmd(f"Testing Syrlinks with object id: {object_id.as_hex_string}")
|
q.add_log_cmd(f"Testing Syrlinks with object id: {object_id.as_hex_string}")
|
||||||
if op_code == OpCode.OFF:
|
if op_code == OpCode.OFF:
|
||||||
q.add_log_cmd(f"{prefix}: Set mode off")
|
q.add_log_cmd(f"{prefix}: {Info.OFF}")
|
||||||
data = pack_mode_data(obyt, Mode.OFF, 0)
|
q.add_pus_tc(create_mode_command(obyt, Mode.OFF, 0))
|
||||||
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=data))
|
|
||||||
if op_code == OpCode.ON:
|
if op_code == OpCode.ON:
|
||||||
q.add_log_cmd(f"{prefix}: Set mode on")
|
q.add_log_cmd(f"{prefix}: {Info.ON}")
|
||||||
data = pack_mode_data(obyt, Mode.ON, 0)
|
q.add_pus_tc(create_mode_command(obyt, Mode.ON, 0))
|
||||||
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=data))
|
if op_code == OpCode.NORMAL_RX_ONLY:
|
||||||
if op_code == OpCode.NORMAL:
|
normal_mode_cmd(q, Info.NORMAL_RX_ONLY, Submode.RX_ONLY)
|
||||||
q.add_log_cmd(f"{prefix}: Mode Normal")
|
if op_code == OpCode.NORMAL_RX_AND_TX_LOW_DATARATE:
|
||||||
data = pack_mode_data(obyt, Mode.NORMAL, 0)
|
normal_mode_cmd(
|
||||||
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=data))
|
q, Info.NORMAL_RX_AND_TX_LOW_DATARATE, Submode.RX_AND_TX_LOW_DATARATE
|
||||||
if op_code == OpCode.STANDBY:
|
)
|
||||||
q.add_log_cmd(f"{prefix}: Set TX mode standby")
|
if op_code == OpCode.NORMAL_RX_AND_TX_DEF_DATARATE:
|
||||||
data = obyt + struct.pack("!I", CommandId.SET_TX_MODE_STANDBY)
|
normal_mode_cmd(
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
q, Info.NORMAL_RX_AND_TX_DEF_DATARATE, Submode.RX_AND_TX_DEFAULT_DATARATE
|
||||||
if op_code == OpCode.MODULATION:
|
)
|
||||||
q.add_log_cmd(f"{prefix}: Set TX mode modulation")
|
if op_code == OpCode.NORMAL_RX_AND_TX_HIGH_DATARATE:
|
||||||
data = obyt + struct.pack("!I", CommandId.SET_TX_MODE_MODULATION)
|
normal_mode_cmd(
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
q, Info.NORMAL_RX_AND_TX_HIGH_DATARATE, Submode.RX_AND_TX_HIGH_DATARATE
|
||||||
if op_code in OpCode.SET_CW:
|
)
|
||||||
q.add_log_cmd(f"{prefix}: {Info.SET_CW}")
|
if op_code in OpCode.NORMAL_RX_AND_TX_CW:
|
||||||
data = obyt + struct.pack("!I", CommandId.SET_TX_MODE_CW)
|
normal_mode_cmd(q, Info.NORMAL_RX_AND_TX_CW, Submode.RX_AND_TX_CW)
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
|
||||||
if op_code in OpCode.HK_RX_REGS:
|
if op_code in OpCode.HK_RX_REGS:
|
||||||
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)
|
||||||
@ -145,13 +179,25 @@ def pack_syrlinks_command(
|
|||||||
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)
|
||||||
cmds = create_enable_periodic_hk_command_with_interval(True, sid, 2.0)
|
interval = float(input("HK interval in floating point seconds"))
|
||||||
|
cmds = create_enable_periodic_hk_command_with_interval(True, sid, interval)
|
||||||
for cmd in cmds:
|
for cmd in cmds:
|
||||||
q.add_pus_tc(cmd)
|
q.add_pus_tc(cmd)
|
||||||
if op_code in OpCode.DISABLE_HK_RX_REGS:
|
if op_code in OpCode.DISABLE_HK_RX_REGS:
|
||||||
q.add_log_cmd(f"{prefix}: {Info.DISABLE_HK_RX_REGS}")
|
q.add_log_cmd(f"{prefix}: {Info.DISABLE_HK_RX_REGS}")
|
||||||
sid = make_sid(obyt, SetId.RX_REGISTERS_DATASET)
|
sid = make_sid(obyt, SetId.RX_REGISTERS_DATASET)
|
||||||
q.add_pus_tc(create_disable_periodic_hk_command(True, sid))
|
q.add_pus_tc(create_disable_periodic_hk_command(True, sid))
|
||||||
|
if op_code in OpCode.ENABLE_HK_TX_REGS:
|
||||||
|
q.add_log_cmd(f"{prefix}: {Info.ENABLE_HK_TX_REGS}")
|
||||||
|
sid = make_sid(obyt, SetId.TX_REGISTERS_DATASET)
|
||||||
|
interval = float(input("HK interval in floating point seconds"))
|
||||||
|
cmds = create_enable_periodic_hk_command_with_interval(True, sid, interval)
|
||||||
|
for cmd in cmds:
|
||||||
|
q.add_pus_tc(cmd)
|
||||||
|
if op_code in OpCode.DISABLE_HK_TX_REGS:
|
||||||
|
q.add_log_cmd(f"{prefix}: {Info.DISABLE_HK_TX_REGS}")
|
||||||
|
sid = make_sid(obyt, SetId.TX_REGISTERS_DATASET)
|
||||||
|
q.add_pus_tc(create_disable_periodic_hk_command(True, sid))
|
||||||
if op_code in OpCode.HK_TX_REGS:
|
if op_code in OpCode.HK_TX_REGS:
|
||||||
q.add_log_cmd(f"{prefix}: {Info.HK_TX_REGS}")
|
q.add_log_cmd(f"{prefix}: {Info.HK_TX_REGS}")
|
||||||
sid = make_sid(obyt, SetId.TX_REGISTERS_DATASET)
|
sid = make_sid(obyt, SetId.TX_REGISTERS_DATASET)
|
||||||
@ -262,7 +308,7 @@ def handle_syrlinks_tx_registers_dataset(
|
|||||||
header_list = ["TX Status", "TX Waveform", "TX AGC value"]
|
header_list = ["TX Status", "TX Waveform", "TX AGC value"]
|
||||||
tx_status = hk_data[0]
|
tx_status = hk_data[0]
|
||||||
tx_waveform = hk_data[1]
|
tx_waveform = hk_data[1]
|
||||||
tx_agc_value = struct.unpack("!H", hk_data[2:4])
|
tx_agc_value = struct.unpack("!H", hk_data[2:4])[0]
|
||||||
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):
|
@ -2,7 +2,7 @@ from typing import Union
|
|||||||
|
|
||||||
from spacepackets.ecss.tc import PusTelecommand
|
from spacepackets.ecss.tc import PusTelecommand
|
||||||
from tmtccmd.tc import DefaultPusQueueHelper
|
from tmtccmd.tc import DefaultPusQueueHelper
|
||||||
from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Mode, Subservice
|
from tmtccmd.tc.pus_200_fsfw_mode import pack_mode_data, Mode, Subservice
|
||||||
from tmtccmd.util import ObjectIdU32
|
from tmtccmd.util import ObjectIdU32
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import enum
|
import enum
|
||||||
|
import logging
|
||||||
import struct
|
import struct
|
||||||
|
|
||||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||||
@ -15,7 +16,7 @@ from tmtccmd.config.tmtc import OpCodeEntry, tmtc_definitions_provider
|
|||||||
from eive_tmtc.config.object_ids import CORE_CONTROLLER_ID
|
from eive_tmtc.config.object_ids import CORE_CONTROLLER_ID
|
||||||
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
||||||
|
|
||||||
LOGGER = get_console_logger()
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class ActionId(enum.IntEnum):
|
class ActionId(enum.IntEnum):
|
||||||
@ -244,7 +245,7 @@ def pack_core_commands(q: DefaultPusQueueHelper, op_code: str):
|
|||||||
while True:
|
while True:
|
||||||
active_sd_card = int(input("Please specify active SD cqrd [0/1]: "))
|
active_sd_card = int(input("Please specify active SD cqrd [0/1]: "))
|
||||||
if active_sd_card not in [0, 1]:
|
if active_sd_card not in [0, 1]:
|
||||||
LOGGER.warning("Invalid SD card specified. Try again")
|
_LOGGER.warning("Invalid SD card specified. Try again")
|
||||||
break
|
break
|
||||||
q.add_log_cmd(Info.SWITCH_TO_BOTH_SD_CARDS)
|
q.add_log_cmd(Info.SWITCH_TO_BOTH_SD_CARDS)
|
||||||
q.add_pus_tc(
|
q.add_pus_tc(
|
||||||
@ -282,9 +283,9 @@ def determine_reboot_params() -> (bool, Chip, Copy):
|
|||||||
copy_select = -1
|
copy_select = -1
|
||||||
reboot_self = input("Reboot self? [y/n]: ")
|
reboot_self = input("Reboot self? [y/n]: ")
|
||||||
if reboot_self in ["y", "yes", "1"]:
|
if reboot_self in ["y", "yes", "1"]:
|
||||||
LOGGER.info("Rebooting currently running image")
|
_LOGGER.info("Rebooting currently running image")
|
||||||
return True, chip_select, copy_select
|
return True, chip_select, copy_select
|
||||||
LOGGER.info("Rebooting image specified by chip and copy")
|
_LOGGER.info("Rebooting image specified by chip and copy")
|
||||||
return False, determine_chip_and_copy()
|
return False, determine_chip_and_copy()
|
||||||
|
|
||||||
|
|
||||||
@ -298,7 +299,7 @@ def determine_chip_and_copy() -> (int, int):
|
|||||||
chip_select = Chip.CHIP_1
|
chip_select = Chip.CHIP_1
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
LOGGER.warning("Invalid chip select value. Try again")
|
_LOGGER.warning("Invalid chip select value. Try again")
|
||||||
while True:
|
while True:
|
||||||
copy_select = input("Copy select [0/1]: ")
|
copy_select = input("Copy select [0/1]: ")
|
||||||
if copy_select in ["0", "1"]:
|
if copy_select in ["0", "1"]:
|
||||||
@ -308,7 +309,7 @@ def determine_chip_and_copy() -> (int, int):
|
|||||||
copy_select = Copy.COPY_1_GOLD
|
copy_select = Copy.COPY_1_GOLD
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
LOGGER.warning("Invalid copy select value. Try again")
|
_LOGGER.warning("Invalid copy select value. Try again")
|
||||||
return chip_select, copy_select
|
return chip_select, copy_select
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
@author J. Meier
|
@author J. Meier
|
||||||
@date 06.03.2021
|
@date 06.03.2021
|
||||||
"""
|
"""
|
||||||
|
import logging
|
||||||
import struct
|
import struct
|
||||||
import enum
|
import enum
|
||||||
|
|
||||||
@ -16,15 +17,14 @@ from tmtccmd.config.tmtc import (
|
|||||||
OpCodeEntry,
|
OpCodeEntry,
|
||||||
TmtcDefinitionWrapper,
|
TmtcDefinitionWrapper,
|
||||||
)
|
)
|
||||||
from tmtccmd.logging import get_console_logger
|
|
||||||
from spacepackets.ecss.tc import PusTelecommand
|
from spacepackets.ecss.tc import PusTelecommand
|
||||||
from tmtccmd.tc import service_provider
|
from tmtccmd.tc import service_provider
|
||||||
from tmtccmd.tc.decorator import ServiceProviderParams
|
from tmtccmd.tc.decorator import ServiceProviderParams
|
||||||
from eive_tmtc.utility.input_helper import InputHelper
|
from eive_tmtc.utility.input_helper import InputHelper
|
||||||
from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Mode
|
from tmtccmd.tc.pus_200_fsfw_mode import pack_mode_data, Mode
|
||||||
|
|
||||||
|
|
||||||
LOGGER = get_console_logger()
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
MANUAL_INPUT = "1"
|
MANUAL_INPUT = "1"
|
||||||
|
|
||||||
@ -324,7 +324,7 @@ def prepare_replay_write_sequence_cmd(object_id: bytes) -> bytearray:
|
|||||||
|
|
||||||
|
|
||||||
def get_obc_file() -> str:
|
def get_obc_file() -> str:
|
||||||
LOGGER.info("Specify OBC file ")
|
_LOGGER.info("Specify OBC file ")
|
||||||
input_helper = InputHelper(flash_write_file_dict)
|
input_helper = InputHelper(flash_write_file_dict)
|
||||||
key = input_helper.get_key()
|
key = input_helper.get_key()
|
||||||
if key == MANUAL_INPUT:
|
if key == MANUAL_INPUT:
|
||||||
@ -335,7 +335,7 @@ def get_obc_file() -> str:
|
|||||||
|
|
||||||
|
|
||||||
def get_mpsoc_file() -> str:
|
def get_mpsoc_file() -> str:
|
||||||
LOGGER.info("Specify MPSoC file")
|
_LOGGER.info("Specify MPSoC file")
|
||||||
input_helper = InputHelper(mpsoc_file_dict)
|
input_helper = InputHelper(mpsoc_file_dict)
|
||||||
key = input_helper.get_key()
|
key = input_helper.get_key()
|
||||||
if key == MANUAL_INPUT:
|
if key == MANUAL_INPUT:
|
||||||
@ -346,7 +346,7 @@ def get_mpsoc_file() -> str:
|
|||||||
|
|
||||||
|
|
||||||
def get_sequence_file() -> str:
|
def get_sequence_file() -> str:
|
||||||
LOGGER.info("Specify sequence file")
|
_LOGGER.info("Specify sequence file")
|
||||||
input_helper = InputHelper(SEQ_FILE_DICT)
|
input_helper = InputHelper(SEQ_FILE_DICT)
|
||||||
key = input_helper.get_key()
|
key = input_helper.get_key()
|
||||||
if key == MANUAL_INPUT:
|
if key == MANUAL_INPUT:
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
@date 10.07.2021
|
@date 10.07.2021
|
||||||
"""
|
"""
|
||||||
import enum
|
import enum
|
||||||
|
import logging
|
||||||
import struct
|
import struct
|
||||||
|
|
||||||
from eive_tmtc.config.object_ids import PLOC_SUPV_ID, get_object_ids
|
from eive_tmtc.config.object_ids import PLOC_SUPV_ID, get_object_ids
|
||||||
@ -16,7 +17,6 @@ from spacepackets.ecss.tc import PusTelecommand
|
|||||||
from tmtccmd.tc.pus_3_fsfw_hk import generate_one_hk_command, make_sid
|
from tmtccmd.tc.pus_3_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 tmtc_definitions_provider, OpCodeEntry
|
||||||
from tmtccmd.logging import get_console_logger
|
|
||||||
from tmtccmd.tc import service_provider
|
from tmtccmd.tc import service_provider
|
||||||
from tmtccmd.tc.decorator import ServiceProviderParams
|
from tmtccmd.tc.decorator import ServiceProviderParams
|
||||||
from tmtccmd.pus.s200_fsfw_mode import pack_mode_data, Mode
|
from tmtccmd.pus.s200_fsfw_mode import pack_mode_data, Mode
|
||||||
@ -24,7 +24,7 @@ from tmtccmd.pus.s8_fsfw_funccmd import create_action_cmd
|
|||||||
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
||||||
from eive_tmtc.utility.input_helper import InputHelper
|
from eive_tmtc.utility.input_helper import InputHelper
|
||||||
|
|
||||||
LOGGER = get_console_logger()
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
latchup_id_dict = {
|
latchup_id_dict = {
|
||||||
"0": "0.85V",
|
"0": "0.85V",
|
||||||
@ -698,7 +698,7 @@ 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:
|
||||||
@ -711,7 +711,7 @@ def get_update_file() -> str:
|
|||||||
|
|
||||||
|
|
||||||
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:
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
import struct
|
import struct
|
||||||
|
|
||||||
from eive_tmtc.config.definitions import CustomServiceList
|
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 eive_tmtc.pus_tc.service_200_mode import pack_mode_data, Mode
|
from eive_tmtc.pus_tc.service_200_mode import pack_mode_data, Mode
|
||||||
@ -16,6 +17,7 @@ from tmtccmd.config.tmtc import tmtc_definitions_provider
|
|||||||
from tmtccmd.tc import DefaultPusQueueHelper
|
from tmtccmd.tc import DefaultPusQueueHelper
|
||||||
from tmtccmd.tc.pus_3_fsfw_hk import generate_one_hk_command, make_sid
|
from tmtccmd.tc.pus_3_fsfw_hk import generate_one_hk_command, make_sid
|
||||||
from tmtccmd.util import ObjectIdU32
|
from tmtccmd.util import ObjectIdU32
|
||||||
|
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
||||||
|
|
||||||
|
|
||||||
class SetId:
|
class SetId:
|
||||||
@ -95,3 +97,22 @@ def rad_sensor_mode_cmd(
|
|||||||
q.add_log_cmd(f"Rad sensor: {info}")
|
q.add_log_cmd(f"Rad sensor: {info}")
|
||||||
mode_data = pack_mode_data(object_id.as_bytes, mode, 0)
|
mode_data = pack_mode_data(object_id.as_bytes, mode, 0)
|
||||||
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=mode_data))
|
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=mode_data))
|
||||||
|
|
||||||
|
|
||||||
|
def handle_rad_sensor_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
|
||||||
|
if set_id == SetId.HK:
|
||||||
|
pw = PrintWrapper(printer)
|
||||||
|
current_idx = 0
|
||||||
|
pw.dlog("Received Radiation Sensor HK data")
|
||||||
|
fmt_str = "!fHHHHHH"
|
||||||
|
inc_len = struct.calcsize(fmt_str)
|
||||||
|
(temp, ain0, ain1, ain4, ain5, ain6, ain7) = struct.unpack(
|
||||||
|
fmt_str, hk_data[current_idx : current_idx + inc_len]
|
||||||
|
)
|
||||||
|
ain_dict = {0: ain0, 1: ain1, 4: ain4, 5: ain5, 6: ain6, 7: ain7}
|
||||||
|
pw.dlog(f"Temperature: {temp} C")
|
||||||
|
pw.dlog(f"AIN Channel | Raw Value (hex) | Raw Value (dec)")
|
||||||
|
for idx, val in ain_dict.items():
|
||||||
|
pw.dlog(f"{idx} | {val:#06x} | {str(val).ljust(5)}")
|
||||||
|
current_idx += inc_len
|
||||||
|
printer.print_validity_buffer(validity_buffer=hk_data[current_idx:], num_vars=7)
|
@ -5,7 +5,7 @@ from spacepackets.ecss import PusTelecommand
|
|||||||
|
|
||||||
from eive_tmtc.config.definitions import CustomServiceList
|
from eive_tmtc.config.definitions import CustomServiceList
|
||||||
from tmtccmd.config.tmtc import tmtc_definitions_provider
|
from tmtccmd.config.tmtc import tmtc_definitions_provider
|
||||||
from tmtccmd.tc.pus_200_fsfw_modes import Mode, pack_mode_data, Subservice
|
from tmtccmd.tc.pus_200_fsfw_mode import Mode, pack_mode_data, Subservice
|
||||||
from tmtccmd.tc import service_provider
|
from tmtccmd.tc import service_provider
|
||||||
from tmtccmd.tc.decorator import ServiceProviderParams
|
from tmtccmd.tc.decorator import ServiceProviderParams
|
||||||
from tmtccmd.pus.s8_fsfw_funccmd import create_action_cmd
|
from tmtccmd.pus.s8_fsfw_funccmd import create_action_cmd
|
@ -9,7 +9,7 @@ from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
|
|||||||
from tmtccmd.config.tmtc import tmtc_definitions_provider
|
from tmtccmd.config.tmtc import tmtc_definitions_provider
|
||||||
from tmtccmd.tc import service_provider
|
from tmtccmd.tc import service_provider
|
||||||
from tmtccmd.tc.decorator import ServiceProviderParams
|
from tmtccmd.tc.decorator import ServiceProviderParams
|
||||||
from tmtccmd.tc.pus_200_fsfw_modes import Subservice as ModeSubservice
|
from tmtccmd.tc.pus_200_fsfw_mode import Subservice as ModeSubservice
|
||||||
|
|
||||||
|
|
||||||
class OpCode(str, enum.Enum):
|
class OpCode(str, enum.Enum):
|
@ -1,3 +1,6 @@
|
|||||||
|
import struct
|
||||||
|
|
||||||
|
from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||||
from spacepackets.ecss import PusTelecommand
|
from spacepackets.ecss import PusTelecommand
|
||||||
|
|
||||||
from eive_tmtc.config.definitions import CustomServiceList
|
from eive_tmtc.config.definitions import CustomServiceList
|
||||||
@ -11,8 +14,9 @@ from tmtccmd.tc import service_provider
|
|||||||
from tmtccmd.tc.decorator import ServiceProviderParams
|
from tmtccmd.tc.decorator import ServiceProviderParams
|
||||||
from tmtccmd.pus.s8_fsfw_funccmd import create_action_cmd
|
from tmtccmd.pus.s8_fsfw_funccmd import create_action_cmd
|
||||||
from tmtccmd.tc.pus_3_fsfw_hk import generate_one_hk_command, make_sid
|
from tmtccmd.tc.pus_3_fsfw_hk import generate_one_hk_command, make_sid
|
||||||
from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Mode
|
from tmtccmd.tc.pus_200_fsfw_mode import pack_mode_data, Mode
|
||||||
from tmtccmd.tc.pus_200_fsfw_modes import Subservice as ModeSubservices
|
from tmtccmd.tc.pus_200_fsfw_mode import Subservice as ModeSubservices
|
||||||
|
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
||||||
|
|
||||||
|
|
||||||
class BpxSetId:
|
class BpxSetId:
|
||||||
@ -105,3 +109,66 @@ def pack_bpx_commands(p: ServiceProviderParams):
|
|||||||
q.add_pus_tc(
|
q.add_pus_tc(
|
||||||
create_action_cmd(object_id=BPX_HANDLER_ID, action_id=BpxActionId.REBOOT)
|
create_action_cmd(object_id=BPX_HANDLER_ID, action_id=BpxActionId.REBOOT)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
HEADER_LIST = [
|
||||||
|
"Charge Current",
|
||||||
|
"Discharge Current",
|
||||||
|
"Heater Current",
|
||||||
|
"Battery Voltage",
|
||||||
|
"Batt Temp 1",
|
||||||
|
"Batt Temp 2",
|
||||||
|
"Batt Temp 3",
|
||||||
|
"Batt Temp 4",
|
||||||
|
"Reboot Counter",
|
||||||
|
"Boot Cause",
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
def handle_bpx_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
|
||||||
|
pw = PrintWrapper(printer)
|
||||||
|
if set_id == BpxSetId.GET_HK_SET:
|
||||||
|
fmt_str = "!HHHHhhhhIB"
|
||||||
|
inc_len = struct.calcsize(fmt_str)
|
||||||
|
(
|
||||||
|
charge_current,
|
||||||
|
discharge_current,
|
||||||
|
heater_current,
|
||||||
|
batt_voltage,
|
||||||
|
batt_temp_1,
|
||||||
|
batt_temp_2,
|
||||||
|
batt_temp_3,
|
||||||
|
batt_temp_4,
|
||||||
|
reboot_cntr,
|
||||||
|
boot_cause,
|
||||||
|
) = struct.unpack(fmt_str, hk_data[0:inc_len])
|
||||||
|
content_list = [
|
||||||
|
charge_current,
|
||||||
|
discharge_current,
|
||||||
|
heater_current,
|
||||||
|
batt_voltage,
|
||||||
|
batt_temp_1,
|
||||||
|
batt_temp_2,
|
||||||
|
batt_temp_3,
|
||||||
|
batt_temp_4,
|
||||||
|
reboot_cntr,
|
||||||
|
boot_cause,
|
||||||
|
]
|
||||||
|
validity_buffer = hk_data[inc_len:]
|
||||||
|
pw.dlog(str(HEADER_LIST))
|
||||||
|
pw.dlog(str(content_list))
|
||||||
|
printer.print_validity_buffer(validity_buffer=validity_buffer, num_vars=10)
|
||||||
|
elif set_id == BpxSetId.GET_CFG_SET:
|
||||||
|
battheat_mode = hk_data[0]
|
||||||
|
battheat_low = struct.unpack("!b", hk_data[1:2])[0]
|
||||||
|
battheat_high = struct.unpack("!b", hk_data[2:3])[0]
|
||||||
|
header_list = [
|
||||||
|
"Battery Heater Mode",
|
||||||
|
"Battery Heater Low Limit",
|
||||||
|
"Battery Heater High Limit",
|
||||||
|
]
|
||||||
|
content_list = [battheat_mode, battheat_low, battheat_high]
|
||||||
|
validity_buffer = hk_data[3:]
|
||||||
|
pw.dlog(str(header_list))
|
||||||
|
pw.dlog(str(content_list))
|
||||||
|
printer.print_validity_buffer(validity_buffer=validity_buffer, num_vars=10)
|
@ -53,6 +53,7 @@ class PowerInfo:
|
|||||||
INFO_CORE = "Core Information"
|
INFO_CORE = "Core Information"
|
||||||
INFO_AUX = "Auxiliary Information"
|
INFO_AUX = "Auxiliary Information"
|
||||||
INFO_ALL = "All Information"
|
INFO_ALL = "All Information"
|
||||||
|
REQUEST_SWITCHER_SET = "Request Switcher Information"
|
||||||
ENABLE_INFO_HK = "Enable Core Info HK"
|
ENABLE_INFO_HK = "Enable Core Info HK"
|
||||||
DISABLE_INFO_HK = "Disable Core Info HK"
|
DISABLE_INFO_HK = "Disable Core Info HK"
|
||||||
RESET_ALL_GND_WDTS = "Reset all Ground Watchdogs"
|
RESET_ALL_GND_WDTS = "Reset all Ground Watchdogs"
|
||||||
@ -101,6 +102,7 @@ class PowerOpCodes:
|
|||||||
|
|
||||||
REBOOT = ["reboot"]
|
REBOOT = ["reboot"]
|
||||||
INFO_CORE = ["info"]
|
INFO_CORE = ["info"]
|
||||||
|
REQUEST_SWITCHER_SET = ["request_switchers"]
|
||||||
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"]
|
||||||
|
@ -79,7 +79,7 @@ class PDU2TestProcedure:
|
|||||||
def pack_pdu2_commands(object_id: ObjectIdU32, q: DefaultPusQueueHelper, op_code: str):
|
def pack_pdu2_commands(object_id: ObjectIdU32, q: DefaultPusQueueHelper, op_code: str):
|
||||||
q.add_log_cmd("Testing PDU2")
|
q.add_log_cmd("Testing PDU2")
|
||||||
objb = object_id.as_bytes
|
objb = object_id.as_bytes
|
||||||
pdu2_cmds(q, op_code)
|
pdu2_switch_cmds(q, op_code)
|
||||||
pdu2_req_hk_cmds(q, op_code)
|
pdu2_req_hk_cmds(q, op_code)
|
||||||
pack_common_power_cmds("PDU2", object_id, q, op_code)
|
pack_common_power_cmds("PDU2", object_id, q, op_code)
|
||||||
pack_common_gomspace_cmds("PDU2", object_id, q, op_code)
|
pack_common_gomspace_cmds("PDU2", object_id, q, op_code)
|
||||||
@ -159,7 +159,7 @@ def add_pdu2_cmds(defs: TmtcDefinitionWrapper):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def pdu2_cmds(q: DefaultPusQueueHelper, op_code: str):
|
def pdu2_switch_cmds(q: DefaultPusQueueHelper, op_code: str):
|
||||||
if op_code in PowerOpCodes.PL_PCDU_VBAT_NOM_ON:
|
if op_code in PowerOpCodes.PL_PCDU_VBAT_NOM_ON:
|
||||||
pl_pcdu_bat_nom_on_cmd(q)
|
pl_pcdu_bat_nom_on_cmd(q)
|
||||||
elif op_code in PowerOpCodes.PL_PCDU_VBAT_NOM_OFF:
|
elif op_code in PowerOpCodes.PL_PCDU_VBAT_NOM_OFF:
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
import enum
|
import enum
|
||||||
|
import logging
|
||||||
import struct
|
import struct
|
||||||
import time
|
import time
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from eive_tmtc.config.definitions import CustomServiceList
|
from eive_tmtc.config.definitions import CustomServiceList
|
||||||
|
from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||||
from tmtccmd.config import TmtcDefinitionWrapper
|
from tmtccmd.config import TmtcDefinitionWrapper
|
||||||
|
|
||||||
from tmtccmd.config.tmtc import OpCodeEntry, tmtc_definitions_provider
|
from tmtccmd.config.tmtc import OpCodeEntry, tmtc_definitions_provider
|
||||||
@ -18,17 +20,17 @@ from tmtccmd.tc.pus_11_tc_sched import (
|
|||||||
create_enable_tc_sched_cmd,
|
create_enable_tc_sched_cmd,
|
||||||
create_time_tagged_cmd,
|
create_time_tagged_cmd,
|
||||||
)
|
)
|
||||||
from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Mode, Subservice
|
from tmtccmd.tc.pus_200_fsfw_mode import pack_mode_data, Mode, Subservice
|
||||||
from tmtccmd.tc.pus_20_params import (
|
from tmtccmd.tc.pus_20_fsfw_param import (
|
||||||
pack_scalar_double_param_app_data,
|
pack_scalar_double_param_app_data,
|
||||||
pack_fsfw_load_param_cmd,
|
create_load_param_cmd,
|
||||||
pack_boolean_parameter_app_data,
|
pack_boolean_parameter_app_data,
|
||||||
)
|
)
|
||||||
from tmtccmd.logging import get_console_logger
|
|
||||||
from spacepackets.ecss.tc import PusTelecommand
|
from spacepackets.ecss.tc import PusTelecommand
|
||||||
from eive_tmtc.config.object_ids import PL_PCDU_ID
|
from eive_tmtc.config.object_ids import PL_PCDU_ID
|
||||||
|
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
||||||
|
|
||||||
LOGGER = get_console_logger()
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class OpCode:
|
class OpCode:
|
||||||
@ -369,10 +371,10 @@ def request_wait_time() -> Optional[float]:
|
|||||||
try:
|
try:
|
||||||
wait_time = float(wait_time)
|
wait_time = float(wait_time)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
LOGGER.warning("Invalid input")
|
_LOGGER.warning("Invalid input")
|
||||||
continue
|
continue
|
||||||
if wait_time <= 0:
|
if wait_time <= 0:
|
||||||
LOGGER.warning("Invalid input")
|
_LOGGER.warning("Invalid input")
|
||||||
else:
|
else:
|
||||||
return wait_time
|
return wait_time
|
||||||
|
|
||||||
@ -427,7 +429,7 @@ def pack_wait_time_cmd(q: DefaultPusQueueHelper, param_id: int, print_str: str):
|
|||||||
unique_id=param_id,
|
unique_id=param_id,
|
||||||
parameter=wait_time,
|
parameter=wait_time,
|
||||||
)
|
)
|
||||||
q.add_pus_tc(pack_fsfw_load_param_cmd(app_data=param_data))
|
q.add_pus_tc(create_load_param_cmd(app_data=param_data))
|
||||||
|
|
||||||
|
|
||||||
def pack_failure_injection_cmd(q: DefaultPusQueueHelper, param_id: int, print_str: str):
|
def pack_failure_injection_cmd(q: DefaultPusQueueHelper, param_id: int, print_str: str):
|
||||||
@ -435,7 +437,7 @@ def pack_failure_injection_cmd(q: DefaultPusQueueHelper, param_id: int, print_st
|
|||||||
param_data = pack_boolean_parameter_app_data(
|
param_data = pack_boolean_parameter_app_data(
|
||||||
object_id=PL_PCDU_ID, domain_id=0, unique_id=param_id, parameter=True
|
object_id=PL_PCDU_ID, domain_id=0, unique_id=param_id, parameter=True
|
||||||
)
|
)
|
||||||
q.add_pus_tc(pack_fsfw_load_param_cmd(app_data=param_data))
|
q.add_pus_tc(create_load_param_cmd(app_data=param_data))
|
||||||
|
|
||||||
|
|
||||||
def pack_pl_pcdu_mode_cmd(
|
def pack_pl_pcdu_mode_cmd(
|
||||||
@ -448,3 +450,50 @@ def pack_pl_pcdu_mode_cmd(
|
|||||||
service=200, subservice=Subservice.TC_MODE_COMMAND, app_data=mode_data
|
service=200, subservice=Subservice.TC_MODE_COMMAND, app_data=mode_data
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
ADC_CHANNELS_NAMED = [
|
||||||
|
"U BAT DIV 6",
|
||||||
|
"U NEG V FB",
|
||||||
|
"I HPA",
|
||||||
|
"U HPA DIV 6",
|
||||||
|
"I MPA",
|
||||||
|
"U MPA DIV 6",
|
||||||
|
"I TX",
|
||||||
|
"U TX DIV 6",
|
||||||
|
"I X8",
|
||||||
|
"U X8 DIV 6",
|
||||||
|
"I DRO",
|
||||||
|
"U DRO DIV 6",
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
def handle_plpcdu_hk(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
|
||||||
|
if set_id == SetId.ADC:
|
||||||
|
pw = PrintWrapper(printer)
|
||||||
|
current_idx = 0
|
||||||
|
pw.dlog("Received PL PCDU ADC HK data")
|
||||||
|
channels = []
|
||||||
|
ch_print = "Channels Raw (hex): ["
|
||||||
|
for i in range(12):
|
||||||
|
channels.append(
|
||||||
|
struct.unpack("!H", hk_data[current_idx : current_idx + 2])[0]
|
||||||
|
)
|
||||||
|
if i < 11:
|
||||||
|
ch_print += f"{channels[i]:06x},"
|
||||||
|
else:
|
||||||
|
ch_print += f"{channels[i]:06x}]"
|
||||||
|
current_idx += 2
|
||||||
|
processed_vals = []
|
||||||
|
for i in range(12):
|
||||||
|
processed_vals.append(
|
||||||
|
struct.unpack("!f", hk_data[current_idx : current_idx + 4])[0]
|
||||||
|
)
|
||||||
|
current_idx += 4
|
||||||
|
temp = struct.unpack("!f", hk_data[current_idx : current_idx + 4])[0]
|
||||||
|
current_idx += 4
|
||||||
|
pw.dlog(f"Temperature: {temp} C")
|
||||||
|
pw.dlog(ch_print)
|
||||||
|
for i in range(12):
|
||||||
|
pw.dlog(f"{ADC_CHANNELS_NAMED[i].ljust(24)} | {processed_vals[i]}")
|
||||||
|
printer.print_validity_buffer(validity_buffer=hk_data[current_idx:], num_vars=3)
|
@ -1,3 +1,6 @@
|
|||||||
|
import enum
|
||||||
|
import logging
|
||||||
|
|
||||||
from eive_tmtc.tmtc.power.common_power import (
|
from eive_tmtc.tmtc.power.common_power import (
|
||||||
PowerOpCodes,
|
PowerOpCodes,
|
||||||
PowerInfo,
|
PowerInfo,
|
||||||
@ -10,6 +13,7 @@ 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 (
|
||||||
@ -21,24 +25,25 @@ from eive_tmtc.tmtc.power.pdu1 import (
|
|||||||
from eive_tmtc.tmtc.power.pdu2 import (
|
from eive_tmtc.tmtc.power.pdu2 import (
|
||||||
pdu2_req_hk_cmds,
|
pdu2_req_hk_cmds,
|
||||||
add_pdu2_common_defs,
|
add_pdu2_common_defs,
|
||||||
pdu2_cmds,
|
pdu2_switch_cmds,
|
||||||
add_pdu2_cmds,
|
add_pdu2_cmds,
|
||||||
)
|
)
|
||||||
from tmtccmd import get_console_logger
|
|
||||||
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
|
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
|
||||||
|
|
||||||
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.config.tmtc import tmtc_definitions_provider
|
from tmtccmd.config.tmtc import tmtc_definitions_provider
|
||||||
from tmtccmd.tc import DefaultPusQueueHelper
|
from tmtccmd.tc import DefaultPusQueueHelper
|
||||||
|
|
||||||
|
|
||||||
LOGGER = get_console_logger()
|
class SetId(enum.IntEnum):
|
||||||
|
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_cmds(q, op_code)
|
pdu2_switch_cmds(q, op_code)
|
||||||
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])
|
||||||
@ -68,8 +73,17 @@ 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():
|
||||||
LOGGER.info(f"Queue is empty, no stack for op code {op_code}")
|
logging.getLogger(__name__).info(
|
||||||
|
f"Queue is empty, no stack for op code {op_code}"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@tmtc_definitions_provider
|
@tmtc_definitions_provider
|
||||||
@ -94,6 +108,7 @@ def add_power_cmd_defs(defs: TmtcDefinitionWrapper):
|
|||||||
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,
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
@author J. Meier
|
@author J. Meier
|
||||||
@date 15.02.2021
|
@date 15.02.2021
|
||||||
"""
|
"""
|
||||||
|
import logging
|
||||||
import struct
|
import struct
|
||||||
|
|
||||||
from eive_tmtc.config.definitions import CustomServiceList
|
from eive_tmtc.config.definitions import CustomServiceList
|
||||||
@ -18,9 +19,6 @@ from tmtccmd.config.tmtc import (
|
|||||||
from tmtccmd.tc import service_provider, DefaultPusQueueHelper
|
from tmtccmd.tc import service_provider, DefaultPusQueueHelper
|
||||||
from tmtccmd.pus.s8_fsfw_funccmd import create_action_cmd
|
from tmtccmd.pus.s8_fsfw_funccmd import create_action_cmd
|
||||||
from tmtccmd.tc.decorator import ServiceProviderParams
|
from tmtccmd.tc.decorator import ServiceProviderParams
|
||||||
from tmtccmd import get_console_logger
|
|
||||||
|
|
||||||
LOGGER = get_console_logger()
|
|
||||||
|
|
||||||
|
|
||||||
class OpCode:
|
class OpCode:
|
||||||
@ -90,7 +88,7 @@ def pack_solar_array_deployment_test_into(p: ServiceProviderParams):
|
|||||||
def prompt_burn_time() -> int:
|
def prompt_burn_time() -> int:
|
||||||
burn_time = int(input("Please specify burn time in seconds [0-120 secs]: "))
|
burn_time = int(input("Please specify burn time in seconds [0-120 secs]: "))
|
||||||
if burn_time < 0 or burn_time > 120:
|
if burn_time < 0 or burn_time > 120:
|
||||||
LOGGER.warning(f"Invalid burn time {burn_time}")
|
logging.getLogger(__name__).warning(f"Invalid burn time {burn_time}")
|
||||||
return -1
|
return -1
|
||||||
return burn_time
|
return burn_time
|
||||||
|
|
||||||
@ -102,7 +100,7 @@ def prompt_dry_run() -> int:
|
|||||||
elif dry_run in ["no", "n", "0"]:
|
elif dry_run in ["no", "n", "0"]:
|
||||||
return 0
|
return 0
|
||||||
else:
|
else:
|
||||||
LOGGER.warning("Invalid input for dry run parameter")
|
logging.getLogger(__name__).warning("Invalid input for dry run parameter")
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
|
|
||||||
|
1
eive_tmtc/tmtc/tcs/__init__.py
Normal file
1
eive_tmtc/tmtc/tcs/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
from .tm import * # noqa
|
57
eive_tmtc/tmtc/tcs/brd_assy.py
Normal file
57
eive_tmtc/tmtc/tcs/brd_assy.py
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
from eive_tmtc.config.definitions import CustomServiceList
|
||||||
|
from eive_tmtc.config.object_ids import TCS_BOARD_ASS_ID
|
||||||
|
from eive_tmtc.tmtc.common import pack_mode_cmd_with_info
|
||||||
|
from tmtccmd.config.tmtc import (
|
||||||
|
tmtc_definitions_provider,
|
||||||
|
TmtcDefinitionWrapper,
|
||||||
|
OpCodeEntry,
|
||||||
|
)
|
||||||
|
from tmtccmd.tc import DefaultPusQueueHelper
|
||||||
|
from tmtccmd.tc.pus_200_fsfw_mode import Mode
|
||||||
|
|
||||||
|
|
||||||
|
class InfoAssy:
|
||||||
|
TCS_BOARD_ASS_NORMAL = "Switching TCS board assembly on"
|
||||||
|
TCS_BOARD_ASS_OFF = "Switching TCS board assembly off"
|
||||||
|
|
||||||
|
|
||||||
|
class OpCodeAssy:
|
||||||
|
TCS_BOARD_ASS_NORMAL = ["nml"]
|
||||||
|
TCS_BOARD_ASS_OFF = ["off"]
|
||||||
|
|
||||||
|
|
||||||
|
@tmtc_definitions_provider
|
||||||
|
def add_tcs_assy_cmds(defs: TmtcDefinitionWrapper):
|
||||||
|
oce = OpCodeEntry()
|
||||||
|
oce.add(
|
||||||
|
keys=OpCodeAssy.TCS_BOARD_ASS_NORMAL,
|
||||||
|
info=InfoAssy.TCS_BOARD_ASS_NORMAL,
|
||||||
|
)
|
||||||
|
oce.add(
|
||||||
|
keys=OpCodeAssy.TCS_BOARD_ASS_OFF,
|
||||||
|
info=InfoAssy.TCS_BOARD_ASS_OFF,
|
||||||
|
)
|
||||||
|
defs.add_service(
|
||||||
|
name=CustomServiceList.TCS_ASS.value,
|
||||||
|
info="TCS Board Assembly",
|
||||||
|
op_code_entry=oce,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def pack_tcs_ass_cmds(q: DefaultPusQueueHelper, op_code: str):
|
||||||
|
if op_code in OpCodeAssy.TCS_BOARD_ASS_NORMAL:
|
||||||
|
pack_mode_cmd_with_info(
|
||||||
|
object_id=TCS_BOARD_ASS_ID,
|
||||||
|
mode=Mode.NORMAL,
|
||||||
|
submode=0,
|
||||||
|
q=q,
|
||||||
|
info=InfoAssy.TCS_BOARD_ASS_NORMAL,
|
||||||
|
)
|
||||||
|
if op_code in OpCodeAssy.TCS_BOARD_ASS_OFF:
|
||||||
|
pack_mode_cmd_with_info(
|
||||||
|
object_id=TCS_BOARD_ASS_ID,
|
||||||
|
mode=Mode.OFF,
|
||||||
|
submode=0,
|
||||||
|
q=q,
|
||||||
|
info=InfoAssy.TCS_BOARD_ASS_OFF,
|
||||||
|
)
|
7
eive_tmtc/tmtc/tcs/defs.py
Normal file
7
eive_tmtc/tmtc/tcs/defs.py
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import enum
|
||||||
|
|
||||||
|
|
||||||
|
class CtrlSetId(enum.IntEnum):
|
||||||
|
PRIMARY_SENSORS = 0
|
||||||
|
DEVICE_SENSORS = 1
|
||||||
|
SUS_TEMP_SENSORS = 2
|
@ -20,7 +20,7 @@ from tmtccmd.pus.s8_fsfw_funccmd import create_action_cmd
|
|||||||
from spacepackets.ecss.tc import PusTelecommand
|
from spacepackets.ecss.tc import PusTelecommand
|
||||||
|
|
||||||
|
|
||||||
class SwitchNumber(enum.IntEnum):
|
class Heater(enum.IntEnum):
|
||||||
HEATER_0_OBC_BRD = 0
|
HEATER_0_OBC_BRD = 0
|
||||||
HEATER_1_PLOC_PROC_BRD = 1
|
HEATER_1_PLOC_PROC_BRD = 1
|
||||||
HEATER_2_ACS_BRD = 2
|
HEATER_2_ACS_BRD = 2
|
||||||
@ -165,7 +165,7 @@ def prompt_heater() -> int:
|
|||||||
print("Heater number not a digit")
|
print("Heater number not a digit")
|
||||||
continue
|
continue
|
||||||
heater_number = int(heater_number)
|
heater_number = int(heater_number)
|
||||||
if heater_number >= SwitchNumber.NUMBER_OF_SWITCHES or heater_number < 0:
|
if heater_number >= Heater.NUMBER_OF_SWITCHES or heater_number < 0:
|
||||||
print("Invalid heater switch number")
|
print("Invalid heater switch number")
|
||||||
continue
|
continue
|
||||||
break
|
break
|
@ -2,14 +2,13 @@ from typing import Optional
|
|||||||
import struct
|
import struct
|
||||||
|
|
||||||
from eive_tmtc.config.definitions import CustomServiceList
|
from eive_tmtc.config.definitions import CustomServiceList
|
||||||
from eive_tmtc.pus_tc.devs.pdec_handler import CommandId
|
|
||||||
from spacepackets.ecss import PusTelecommand
|
from spacepackets.ecss import PusTelecommand
|
||||||
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
|
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
|
||||||
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
|
||||||
from tmtccmd.util import ObjectIdU32
|
from tmtccmd.util import ObjectIdU32
|
||||||
from tmtccmd.tc.pus_200_fsfw_modes import Mode, pack_mode_data, Subservice
|
from tmtccmd.tc.pus_200_fsfw_mode import Mode, pack_mode_data, Subservice
|
||||||
import eive_tmtc.config.object_ids as oids
|
import eive_tmtc.config.object_ids as oids
|
||||||
from eive_tmtc.config.object_ids import get_object_ids
|
from eive_tmtc.config.object_ids import get_object_ids
|
||||||
|
|
74
eive_tmtc/tmtc/tcs/subsystem.py
Normal file
74
eive_tmtc/tmtc/tcs/subsystem.py
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
from .defs import CtrlSetId
|
||||||
|
from eive_tmtc.config.definitions import CustomServiceList
|
||||||
|
from eive_tmtc.config.object_ids import TCS_CONTROLLER, TCS_SUBSYSTEM_ID
|
||||||
|
from eive_tmtc.tmtc.common import pack_mode_cmd_with_info
|
||||||
|
from eive_tmtc.tmtc.tcs.brd_assy import pack_tcs_ass_cmds
|
||||||
|
from tmtccmd.config.tmtc import (
|
||||||
|
tmtc_definitions_provider,
|
||||||
|
TmtcDefinitionWrapper,
|
||||||
|
OpCodeEntry,
|
||||||
|
)
|
||||||
|
from tmtccmd.tc import DefaultPusQueueHelper
|
||||||
|
from tmtccmd.tc.pus_200_fsfw_mode import Mode
|
||||||
|
from tmtccmd.tc.pus_3_fsfw_hk import make_sid, generate_one_hk_command
|
||||||
|
|
||||||
|
|
||||||
|
class OpCodeSys:
|
||||||
|
OFF = ["off"]
|
||||||
|
NML = ["nml"]
|
||||||
|
REQUEST_PRIMARY_TEMP_SET = ["temp"]
|
||||||
|
REQUEST_DEVICE_TEMP_SET = ["temp_devs"]
|
||||||
|
REQUEST_DEVICE_SUS_SET = ["temp_sus"]
|
||||||
|
|
||||||
|
|
||||||
|
class InfoSys:
|
||||||
|
OFF = "Switch TCS subsystem OFF"
|
||||||
|
NML = "Switch TCS subsystem NORMAL (nominal)"
|
||||||
|
REQUEST_PRIMARY_TEMP_SET = "Request HK set of primary sensor temperatures"
|
||||||
|
REQUEST_DEVICE_TEMP_SET = "Request HK set of device sensor temperatures"
|
||||||
|
REQUEST_DEVICE_SUS_SET = "Request HK set of the SUS temperatures"
|
||||||
|
|
||||||
|
|
||||||
|
def pack_tcs_sys_commands(q: DefaultPusQueueHelper, op_code: str):
|
||||||
|
if op_code in OpCodeSys.REQUEST_PRIMARY_TEMP_SET:
|
||||||
|
sensor_set_sid = make_sid(TCS_CONTROLLER, CtrlSetId.PRIMARY_SENSORS)
|
||||||
|
q.add_log_cmd(InfoSys.REQUEST_PRIMARY_TEMP_SET)
|
||||||
|
q.add_pus_tc(generate_one_hk_command(sensor_set_sid))
|
||||||
|
if op_code in OpCodeSys.REQUEST_DEVICE_TEMP_SET:
|
||||||
|
q.add_log_cmd(InfoSys.REQUEST_DEVICE_TEMP_SET)
|
||||||
|
q.add_pus_tc(
|
||||||
|
generate_one_hk_command(make_sid(TCS_CONTROLLER, CtrlSetId.DEVICE_SENSORS))
|
||||||
|
)
|
||||||
|
if op_code in OpCodeSys.REQUEST_DEVICE_SUS_SET:
|
||||||
|
q.add_log_cmd(InfoSys.REQUEST_DEVICE_SUS_SET)
|
||||||
|
q.add_pus_tc(
|
||||||
|
generate_one_hk_command(
|
||||||
|
make_sid(TCS_CONTROLLER, CtrlSetId.SUS_TEMP_SENSORS)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
if op_code in OpCodeSys.OFF:
|
||||||
|
q.add_log_cmd(InfoSys.OFF)
|
||||||
|
pack_mode_cmd_with_info(TCS_SUBSYSTEM_ID, Mode.OFF, 0, q, InfoSys.OFF)
|
||||||
|
if op_code in OpCodeSys.NML:
|
||||||
|
q.add_log_cmd(InfoSys.NML)
|
||||||
|
pack_mode_cmd_with_info(TCS_SUBSYSTEM_ID, Mode.NORMAL, 0, q, InfoSys.OFF)
|
||||||
|
pack_tcs_ass_cmds(q, op_code)
|
||||||
|
|
||||||
|
|
||||||
|
@tmtc_definitions_provider
|
||||||
|
def add_tcs_subsystem_cmds(defs: TmtcDefinitionWrapper):
|
||||||
|
oce = OpCodeEntry()
|
||||||
|
oce.add(keys=OpCodeSys.OFF, info=InfoSys.OFF)
|
||||||
|
oce.add(keys=OpCodeSys.NML, info=InfoSys.NML)
|
||||||
|
oce.add(
|
||||||
|
keys=OpCodeSys.REQUEST_PRIMARY_TEMP_SET, info=InfoSys.REQUEST_PRIMARY_TEMP_SET
|
||||||
|
)
|
||||||
|
oce.add(
|
||||||
|
keys=OpCodeSys.REQUEST_DEVICE_TEMP_SET, info=InfoSys.REQUEST_DEVICE_TEMP_SET
|
||||||
|
)
|
||||||
|
oce.add(keys=OpCodeSys.REQUEST_DEVICE_SUS_SET, info=InfoSys.REQUEST_DEVICE_SUS_SET)
|
||||||
|
defs.add_service(
|
||||||
|
name=CustomServiceList.TCS,
|
||||||
|
info="TCS Board",
|
||||||
|
op_code_entry=oce,
|
||||||
|
)
|
@ -1,135 +1,10 @@
|
|||||||
import enum
|
|
||||||
import pprint
|
import pprint
|
||||||
import struct
|
import struct
|
||||||
|
|
||||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||||
|
|
||||||
from eive_tmtc.config.definitions import CustomServiceList
|
|
||||||
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
|
|
||||||
from tmtccmd.config.tmtc import tmtc_definitions_provider
|
|
||||||
from tmtccmd.tc import DefaultPusQueueHelper
|
|
||||||
from tmtccmd.tc.pus_200_fsfw_modes import Mode
|
|
||||||
from tmtccmd.tc.pus_3_fsfw_hk import (
|
|
||||||
make_sid,
|
|
||||||
generate_one_hk_command,
|
|
||||||
)
|
|
||||||
|
|
||||||
from eive_tmtc.tmtc.common import pack_mode_cmd_with_info
|
|
||||||
from eive_tmtc.config.object_ids import (
|
|
||||||
TCS_BOARD_ASS_ID,
|
|
||||||
TCS_CONTROLLER,
|
|
||||||
TCS_SUBSYSTEM_ID,
|
|
||||||
)
|
|
||||||
from tmtccmd.util import ObjectIdU32
|
from tmtccmd.util import ObjectIdU32
|
||||||
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
||||||
|
from .defs import CtrlSetId
|
||||||
|
|
||||||
class OpCodeAssy:
|
|
||||||
TCS_BOARD_ASS_NORMAL = ["nml"]
|
|
||||||
TCS_BOARD_ASS_OFF = ["off"]
|
|
||||||
|
|
||||||
|
|
||||||
class OpCodeSys:
|
|
||||||
OFF = ["off"]
|
|
||||||
NML = ["nml"]
|
|
||||||
REQUEST_PRIMARY_TEMP_SET = ["temp"]
|
|
||||||
REQUEST_DEVICE_TEMP_SET = ["temp_devs"]
|
|
||||||
REQUEST_DEVICE_SUS_SET = ["temp_sus"]
|
|
||||||
|
|
||||||
|
|
||||||
class InfoSys:
|
|
||||||
OFF = "Switch TCS subsystem OFF"
|
|
||||||
NML = "Switch TCS subsystem NORMAL (nominal)"
|
|
||||||
REQUEST_PRIMARY_TEMP_SET = "Request HK set of primary sensor temperatures"
|
|
||||||
REQUEST_DEVICE_TEMP_SET = "Request HK set of device sensor temperatures"
|
|
||||||
REQUEST_DEVICE_SUS_SET = "Request HK set of the SUS temperatures"
|
|
||||||
|
|
||||||
|
|
||||||
class InfoAssy:
|
|
||||||
TCS_BOARD_ASS_NORMAL = "Switching TCS board assembly on"
|
|
||||||
TCS_BOARD_ASS_OFF = "Switching TCS board assembly off"
|
|
||||||
|
|
||||||
|
|
||||||
class SetId(enum.IntEnum):
|
|
||||||
PRIMARY_SENSORS = 0
|
|
||||||
DEVICE_SENSORS = 1
|
|
||||||
SUS_TEMP_SENSORS = 2
|
|
||||||
|
|
||||||
|
|
||||||
@tmtc_definitions_provider
|
|
||||||
def add_tcs_cmds(defs: TmtcDefinitionWrapper):
|
|
||||||
oce = OpCodeEntry()
|
|
||||||
oce.add(
|
|
||||||
keys=OpCodeAssy.TCS_BOARD_ASS_NORMAL,
|
|
||||||
info=InfoAssy.TCS_BOARD_ASS_NORMAL,
|
|
||||||
)
|
|
||||||
oce.add(
|
|
||||||
keys=OpCodeAssy.TCS_BOARD_ASS_OFF,
|
|
||||||
info=InfoAssy.TCS_BOARD_ASS_OFF,
|
|
||||||
)
|
|
||||||
defs.add_service(
|
|
||||||
name=CustomServiceList.TCS_ASS.value,
|
|
||||||
info="TCS Board Assembly",
|
|
||||||
op_code_entry=oce,
|
|
||||||
)
|
|
||||||
oce = OpCodeEntry()
|
|
||||||
oce.add(keys=OpCodeSys.OFF, info=InfoSys.OFF)
|
|
||||||
oce.add(keys=OpCodeSys.NML, info=InfoSys.NML)
|
|
||||||
oce.add(
|
|
||||||
keys=OpCodeSys.REQUEST_PRIMARY_TEMP_SET, info=InfoSys.REQUEST_PRIMARY_TEMP_SET
|
|
||||||
)
|
|
||||||
oce.add(
|
|
||||||
keys=OpCodeSys.REQUEST_DEVICE_TEMP_SET, info=InfoSys.REQUEST_DEVICE_TEMP_SET
|
|
||||||
)
|
|
||||||
oce.add(keys=OpCodeSys.REQUEST_DEVICE_SUS_SET, info=InfoSys.REQUEST_DEVICE_SUS_SET)
|
|
||||||
defs.add_service(
|
|
||||||
name=CustomServiceList.TCS,
|
|
||||||
info="TCS Board",
|
|
||||||
op_code_entry=oce,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def pack_tcs_sys_commands(q: DefaultPusQueueHelper, op_code: str):
|
|
||||||
if op_code in OpCodeSys.REQUEST_PRIMARY_TEMP_SET:
|
|
||||||
sensor_set_sid = make_sid(TCS_CONTROLLER, SetId.PRIMARY_SENSORS)
|
|
||||||
q.add_log_cmd(InfoSys.REQUEST_PRIMARY_TEMP_SET)
|
|
||||||
q.add_pus_tc(generate_one_hk_command(sensor_set_sid))
|
|
||||||
if op_code in OpCodeSys.REQUEST_DEVICE_TEMP_SET:
|
|
||||||
q.add_log_cmd(InfoSys.REQUEST_DEVICE_TEMP_SET)
|
|
||||||
q.add_pus_tc(
|
|
||||||
generate_one_hk_command(make_sid(TCS_CONTROLLER, SetId.DEVICE_SENSORS))
|
|
||||||
)
|
|
||||||
if op_code in OpCodeSys.REQUEST_DEVICE_SUS_SET:
|
|
||||||
q.add_log_cmd(InfoSys.REQUEST_DEVICE_SUS_SET)
|
|
||||||
q.add_pus_tc(
|
|
||||||
generate_one_hk_command(make_sid(TCS_CONTROLLER, SetId.SUS_TEMP_SENSORS))
|
|
||||||
)
|
|
||||||
if op_code in OpCodeSys.OFF:
|
|
||||||
q.add_log_cmd(InfoSys.OFF)
|
|
||||||
pack_mode_cmd_with_info(TCS_SUBSYSTEM_ID, Mode.OFF, 0, q, InfoSys.OFF)
|
|
||||||
if op_code in OpCodeSys.NML:
|
|
||||||
q.add_log_cmd(InfoSys.NML)
|
|
||||||
pack_mode_cmd_with_info(TCS_SUBSYSTEM_ID, Mode.NORMAL, 0, q, InfoSys.OFF)
|
|
||||||
pack_tcs_ass_cmds(q, op_code)
|
|
||||||
|
|
||||||
|
|
||||||
def pack_tcs_ass_cmds(q: DefaultPusQueueHelper, op_code: str):
|
|
||||||
if op_code in OpCodeAssy.TCS_BOARD_ASS_NORMAL:
|
|
||||||
pack_mode_cmd_with_info(
|
|
||||||
object_id=TCS_BOARD_ASS_ID,
|
|
||||||
mode=Mode.NORMAL,
|
|
||||||
submode=0,
|
|
||||||
q=q,
|
|
||||||
info=InfoAssy.TCS_BOARD_ASS_NORMAL,
|
|
||||||
)
|
|
||||||
if op_code in OpCodeAssy.TCS_BOARD_ASS_OFF:
|
|
||||||
pack_mode_cmd_with_info(
|
|
||||||
object_id=TCS_BOARD_ASS_ID,
|
|
||||||
mode=Mode.OFF,
|
|
||||||
submode=0,
|
|
||||||
q=q,
|
|
||||||
info=InfoAssy.TCS_BOARD_ASS_OFF,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def handle_thermal_controller_hk_data(
|
def handle_thermal_controller_hk_data(
|
||||||
@ -142,7 +17,7 @@ def handle_thermal_controller_hk_data(
|
|||||||
if TCP_TEMP_DEV_SERVER:
|
if TCP_TEMP_DEV_SERVER:
|
||||||
TCP_TEMP_DEV_SERVER = TmTcpServer("localhost", 7306)
|
TCP_TEMP_DEV_SERVER = TmTcpServer("localhost", 7306)
|
||||||
"""
|
"""
|
||||||
if set_id == SetId.PRIMARY_SENSORS:
|
if set_id == CtrlSetId.PRIMARY_SENSORS:
|
||||||
pw = PrintWrapper(printer)
|
pw = PrintWrapper(printer)
|
||||||
pw.dlog("Received sensor temperature data")
|
pw.dlog("Received sensor temperature data")
|
||||||
|
|
||||||
@ -174,7 +49,7 @@ def handle_thermal_controller_hk_data(
|
|||||||
printer.file_logger.info(str(parsed_data))
|
printer.file_logger.info(str(parsed_data))
|
||||||
pp = pprint.PrettyPrinter(depth=4)
|
pp = pprint.PrettyPrinter(depth=4)
|
||||||
pp.pprint(parsed_data)
|
pp.pprint(parsed_data)
|
||||||
elif set_id == SetId.DEVICE_SENSORS:
|
elif set_id == CtrlSetId.DEVICE_SENSORS:
|
||||||
pw = PrintWrapper(printer)
|
pw = PrintWrapper(printer)
|
||||||
pw.dlog("Received device temperature data")
|
pw.dlog("Received device temperature data")
|
||||||
fmt_str = "!fhhhhiiiifffhffffffffffffff"
|
fmt_str = "!fhhhhiiiifffhffffffffffffff"
|
||||||
@ -211,7 +86,7 @@ def handle_thermal_controller_hk_data(
|
|||||||
printer.file_logger.info(str(parsed_data))
|
printer.file_logger.info(str(parsed_data))
|
||||||
pp = pprint.PrettyPrinter(depth=4)
|
pp = pprint.PrettyPrinter(depth=4)
|
||||||
pp.pprint(parsed_data)
|
pp.pprint(parsed_data)
|
||||||
elif set_id == SetId.SUS_TEMP_SENSORS:
|
elif set_id == CtrlSetId.SUS_TEMP_SENSORS:
|
||||||
pw = PrintWrapper(printer)
|
pw = PrintWrapper(printer)
|
||||||
pw.dlog("Received SUS temperature data")
|
pw.dlog("Received SUS temperature data")
|
||||||
fmt_str = "!ffffffffffffffffff"
|
fmt_str = "!ffffffffffffffffff"
|
@ -10,7 +10,7 @@ import enum
|
|||||||
from spacepackets.ecss.tc import PusTelecommand
|
from spacepackets.ecss.tc import PusTelecommand
|
||||||
from eive_tmtc.pus_tc.service_200_mode import pack_mode_data
|
from eive_tmtc.pus_tc.service_200_mode import pack_mode_data
|
||||||
from tmtccmd.tc import DefaultPusQueueHelper
|
from tmtccmd.tc import DefaultPusQueueHelper
|
||||||
from tmtccmd.tc.pus_200_fsfw_modes import Mode
|
from tmtccmd.tc.pus_200_fsfw_mode import Mode
|
||||||
from tmtccmd.pus.s8_fsfw_funccmd import make_action_id
|
from tmtccmd.pus.s8_fsfw_funccmd import make_action_id
|
||||||
from tmtccmd.util import ObjectIdU32
|
from tmtccmd.util import ObjectIdU32
|
||||||
|
|
@ -5,10 +5,10 @@
|
|||||||
@author J. Meier
|
@author J. Meier
|
||||||
@date 13.02.2021
|
@date 13.02.2021
|
||||||
"""
|
"""
|
||||||
|
import logging
|
||||||
|
|
||||||
from tmtccmd.logging import get_console_logger
|
|
||||||
|
|
||||||
LOGGER = get_console_logger()
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class InputHelper:
|
class InputHelper:
|
||||||
@ -25,7 +25,7 @@ class InputHelper:
|
|||||||
"""
|
"""
|
||||||
key = self.menu_handler()
|
key = self.menu_handler()
|
||||||
while key not in self.menu:
|
while key not in self.menu:
|
||||||
LOGGER.info("Invalid key specified, try again.")
|
_LOGGER.info("Invalid key specified, try again.")
|
||||||
key = self.menu_handler()
|
key = self.menu_handler()
|
||||||
return key
|
return key
|
||||||
|
|
||||||
@ -36,11 +36,11 @@ class InputHelper:
|
|||||||
separator_string = separator_width * "-"
|
separator_string = separator_width * "-"
|
||||||
key_string = "Key".ljust(key_column_width)
|
key_string = "Key".ljust(key_column_width)
|
||||||
description_string = "Description".ljust(description_column_width)
|
description_string = "Description".ljust(description_column_width)
|
||||||
LOGGER.info(f"{key_string} | {description_string}")
|
_LOGGER.info(f"{key_string} | {description_string}")
|
||||||
LOGGER.info(separator_string)
|
_LOGGER.info(separator_string)
|
||||||
for key in self.menu:
|
for key in self.menu:
|
||||||
key_string = key.ljust(key_column_width)
|
key_string = key.ljust(key_column_width)
|
||||||
description_string = self.menu[key][0].ljust(description_column_width)
|
description_string = self.menu[key][0].ljust(description_column_width)
|
||||||
LOGGER.info(f"{key_string} | {description_string}")
|
_LOGGER.info(f"{key_string} | {description_string}")
|
||||||
key = input("Specify key: ")
|
key = input("Specify key: ")
|
||||||
return key
|
return key
|
||||||
|
@ -27,8 +27,8 @@ classifiers =
|
|||||||
|
|
||||||
[options]
|
[options]
|
||||||
install_requires =
|
install_requires =
|
||||||
tmtccmd @ git+https://github.com/robamu-org/tmtccmd@v4.0.0a2
|
# tmtccmd @ git+https://github.com/robamu-org/tmtccmd@v4.0.0a3
|
||||||
# tmtccmd @ git+https://github.com/robamu-org/tmtccmd@23fe1dff5e035#egg=tmtccmd
|
tmtccmd @ git+https://github.com/robamu-org/tmtccmd@d6938b2adf0c5cbf3fe8621292b805ed2a66071e#egg=tmtccmd
|
||||||
packages = find:
|
packages = find:
|
||||||
python_requires = >=3.10
|
python_requires = >=3.10
|
||||||
include_package_data = True
|
include_package_data = True
|
||||||
|
69
tmtcc.py
69
tmtcc.py
@ -6,7 +6,6 @@ import traceback
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import cast
|
from typing import cast
|
||||||
|
|
||||||
from spacepackets import SpacePacketHeader, SpacePacket
|
|
||||||
from spacepackets.ccsds import SPACE_PACKET_HEADER_SIZE
|
from spacepackets.ccsds import SPACE_PACKET_HEADER_SIZE
|
||||||
from spacepackets.cfdp import (
|
from spacepackets.cfdp import (
|
||||||
ConditionCode,
|
ConditionCode,
|
||||||
@ -17,6 +16,7 @@ from spacepackets.cfdp import (
|
|||||||
PduFactory,
|
PduFactory,
|
||||||
PduType,
|
PduType,
|
||||||
)
|
)
|
||||||
|
from tmtccmd.logging import add_colorlog_console_logger
|
||||||
from tmtccmd.cfdp import CfdpUserBase, TransactionId
|
from tmtccmd.cfdp import CfdpUserBase, TransactionId
|
||||||
from tmtccmd.cfdp.defs import CfdpRequestType
|
from tmtccmd.cfdp.defs import CfdpRequestType
|
||||||
from tmtccmd.cfdp.handler import CfdpInCcsdsHandler
|
from tmtccmd.cfdp.handler import CfdpInCcsdsHandler
|
||||||
@ -54,7 +54,7 @@ except ImportError as error:
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
from spacepackets.ecss import PusVerificator
|
from spacepackets.ecss import PusVerificator
|
||||||
from tmtccmd import get_console_logger, TcHandlerBase, BackendBase
|
from tmtccmd import TcHandlerBase, BackendBase
|
||||||
from tmtccmd.util import FileSeqCountProvider, PusFileSeqCountProvider
|
from tmtccmd.util import FileSeqCountProvider, PusFileSeqCountProvider
|
||||||
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
||||||
|
|
||||||
@ -73,6 +73,7 @@ from tmtccmd.tc import (
|
|||||||
TcProcedureType,
|
TcProcedureType,
|
||||||
TcQueueEntryType,
|
TcQueueEntryType,
|
||||||
DefaultPusQueueHelper,
|
DefaultPusQueueHelper,
|
||||||
|
QueueWrapper,
|
||||||
)
|
)
|
||||||
from tmtccmd.config import (
|
from tmtccmd.config import (
|
||||||
default_json_path,
|
default_json_path,
|
||||||
@ -95,7 +96,7 @@ from eive_tmtc.config.hook import EiveHookObject
|
|||||||
from eive_tmtc.pus_tm.factory_hook import pus_factory_hook
|
from eive_tmtc.pus_tm.factory_hook import pus_factory_hook
|
||||||
from eive_tmtc.pus_tc.procedure_packer import handle_default_procedure
|
from eive_tmtc.pus_tc.procedure_packer import handle_default_procedure
|
||||||
|
|
||||||
LOGGER = get_console_logger()
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
# Put rotating file logger parameters here for quick changes
|
# Put rotating file logger parameters here for quick changes
|
||||||
ROTATING_TIMED_LOGGER_INTERVAL_WHEN = TimedLogWhen.PER_MINUTE
|
ROTATING_TIMED_LOGGER_INTERVAL_WHEN = TimedLogWhen.PER_MINUTE
|
||||||
@ -118,13 +119,13 @@ class EiveCfdpFaultHandler(DefaultFaultHandlerBase):
|
|||||||
|
|
||||||
class EiveCfdpUser(CfdpUserBase):
|
class EiveCfdpUser(CfdpUserBase):
|
||||||
def transaction_indication(self, transaction_id: TransactionId):
|
def transaction_indication(self, transaction_id: TransactionId):
|
||||||
LOGGER.info(f"CFDP User: Start of File {transaction_id}")
|
_LOGGER.info(f"CFDP User: Start of File {transaction_id}")
|
||||||
|
|
||||||
def eof_sent_indication(self, transaction_id: TransactionId):
|
def eof_sent_indication(self, transaction_id: TransactionId):
|
||||||
LOGGER.info(f"CFDP User: EOF sent for {transaction_id}")
|
_LOGGER.info(f"CFDP User: EOF sent for {transaction_id}")
|
||||||
|
|
||||||
def transaction_finished_indication(self, params: TransactionFinishedParams):
|
def transaction_finished_indication(self, params: TransactionFinishedParams):
|
||||||
LOGGER.info(f"CFDP User: {params.transaction_id} finished")
|
_LOGGER.info(f"CFDP User: {params.transaction_id} finished")
|
||||||
|
|
||||||
def metadata_recv_indication(self, params: MetadataRecvParams):
|
def metadata_recv_indication(self, params: MetadataRecvParams):
|
||||||
pass
|
pass
|
||||||
@ -177,7 +178,7 @@ class PusHandler(SpecificApidHandlerBase):
|
|||||||
|
|
||||||
class UnknownApidHandler(GenericApidHandlerBase):
|
class UnknownApidHandler(GenericApidHandlerBase):
|
||||||
def handle_tm(self, apid: int, _packet: bytes, _user_args: any):
|
def handle_tm(self, apid: int, _packet: bytes, _user_args: any):
|
||||||
LOGGER.warning(f"Packet with unknwon APID {apid} detected")
|
_LOGGER.warning(f"Packet with unknwon APID {apid} detected")
|
||||||
|
|
||||||
|
|
||||||
class CfdpInCcsdsWrapper(SpecificApidHandlerBase):
|
class CfdpInCcsdsWrapper(SpecificApidHandlerBase):
|
||||||
@ -191,12 +192,12 @@ class CfdpInCcsdsWrapper(SpecificApidHandlerBase):
|
|||||||
pdu = packet[SPACE_PACKET_HEADER_SIZE:]
|
pdu = packet[SPACE_PACKET_HEADER_SIZE:]
|
||||||
pdu_base = PduFactory.from_raw(pdu)
|
pdu_base = PduFactory.from_raw(pdu)
|
||||||
if pdu_base.pdu_type == PduType.FILE_DATA:
|
if pdu_base.pdu_type == PduType.FILE_DATA:
|
||||||
LOGGER.info("Received File Data PDU TM")
|
_LOGGER.info("Received File Data PDU TM")
|
||||||
else:
|
else:
|
||||||
if pdu_base.directive_type == DirectiveType.FINISHED_PDU:
|
if pdu_base.directive_type == DirectiveType.FINISHED_PDU:
|
||||||
LOGGER.info(f"Received Finished PDU TM")
|
_LOGGER.info(f"Received Finished PDU TM")
|
||||||
else:
|
else:
|
||||||
LOGGER.info(
|
_LOGGER.info(
|
||||||
f"Received File Directive PDU with type {pdu_base.directive_type!r} TM"
|
f"Received File Directive PDU with type {pdu_base.directive_type!r} TM"
|
||||||
)
|
)
|
||||||
self.handler.pass_pdu_packet(pdu_base)
|
self.handler.pass_pdu_packet(pdu_base)
|
||||||
@ -221,10 +222,11 @@ class TcHandler(TcHandlerBase):
|
|||||||
self.pus_raw_logger = raw_pus_logger
|
self.pus_raw_logger = raw_pus_logger
|
||||||
self.gui = gui
|
self.gui = gui
|
||||||
self.queue_helper = DefaultPusQueueHelper(
|
self.queue_helper = DefaultPusQueueHelper(
|
||||||
queue_wrapper=None,
|
queue_wrapper=QueueWrapper.empty(),
|
||||||
pus_apid=PUS_APID,
|
default_pus_apid=PUS_APID,
|
||||||
seq_cnt_provider=seq_count_provider,
|
seq_cnt_provider=seq_count_provider,
|
||||||
pus_verificator=pus_verificator,
|
pus_verificator=pus_verificator,
|
||||||
|
tc_sched_timestamp_len=4,
|
||||||
)
|
)
|
||||||
self.cfdp_in_ccsds_wrapper = cfdp_in_ccsds_wrapper
|
self.cfdp_in_ccsds_wrapper = cfdp_in_ccsds_wrapper
|
||||||
|
|
||||||
@ -247,16 +249,11 @@ class TcHandler(TcHandlerBase):
|
|||||||
if entry_helper.is_tc:
|
if entry_helper.is_tc:
|
||||||
if entry_helper.entry_type == TcQueueEntryType.PUS_TC:
|
if entry_helper.entry_type == TcQueueEntryType.PUS_TC:
|
||||||
pus_tc_wrapper = entry_helper.to_pus_tc_entry()
|
pus_tc_wrapper = entry_helper.to_pus_tc_entry()
|
||||||
pus_tc_wrapper.pus_tc.seq_count = (
|
# pus_tc_wrapper.pus_tc.apid = PUS_APID
|
||||||
self.seq_count_provider.get_and_increment()
|
|
||||||
)
|
|
||||||
pus_tc_wrapper.pus_tc.apid = PUS_APID
|
|
||||||
# Add TC after Sequence Count stamping
|
|
||||||
self.pus_verificator.add_tc(pus_tc_wrapper.pus_tc)
|
|
||||||
raw_tc = pus_tc_wrapper.pus_tc.pack()
|
raw_tc = pus_tc_wrapper.pus_tc.pack()
|
||||||
self.pus_raw_logger.log_tc(pus_tc_wrapper.pus_tc)
|
self.pus_raw_logger.log_tc(pus_tc_wrapper.pus_tc)
|
||||||
tc_info_string = f"Sent {pus_tc_wrapper.pus_tc}"
|
tc_info_string = f"Sent {pus_tc_wrapper.pus_tc}"
|
||||||
LOGGER.info(tc_info_string)
|
_LOGGER.info(tc_info_string)
|
||||||
self.high_level_file_logger.info(
|
self.high_level_file_logger.info(
|
||||||
f"{get_current_time_string(True)}: {tc_info_string}"
|
f"{get_current_time_string(True)}: {tc_info_string}"
|
||||||
)
|
)
|
||||||
@ -276,7 +273,7 @@ class TcHandler(TcHandlerBase):
|
|||||||
# self.cfdp_counter += 1
|
# self.cfdp_counter += 1
|
||||||
elif entry_helper.entry_type == TcQueueEntryType.LOG:
|
elif entry_helper.entry_type == TcQueueEntryType.LOG:
|
||||||
log_entry = entry_helper.to_log_entry()
|
log_entry = entry_helper.to_log_entry()
|
||||||
LOGGER.info(log_entry.log_str)
|
_LOGGER.info(log_entry.log_str)
|
||||||
self.high_level_file_logger.info(log_entry.log_str)
|
self.high_level_file_logger.info(log_entry.log_str)
|
||||||
|
|
||||||
def handle_cfdp_procedure(self, info: ProcedureWrapper):
|
def handle_cfdp_procedure(self, info: ProcedureWrapper):
|
||||||
@ -288,7 +285,7 @@ class TcHandler(TcHandlerBase):
|
|||||||
):
|
):
|
||||||
put_req = cfdp_procedure.request_wrapper.to_put_request()
|
put_req = cfdp_procedure.request_wrapper.to_put_request()
|
||||||
put_req.cfg.destination_id = self.cfdp_dest_id
|
put_req.cfg.destination_id = self.cfdp_dest_id
|
||||||
LOGGER.info(
|
_LOGGER.info(
|
||||||
f"CFDP: Starting file put request with parameters:\n{put_req}"
|
f"CFDP: Starting file put request with parameters:\n{put_req}"
|
||||||
)
|
)
|
||||||
self.cfdp_in_ccsds_wrapper.handler.cfdp_handler.put_request(put_req)
|
self.cfdp_in_ccsds_wrapper.handler.cfdp_handler.put_request(put_req)
|
||||||
@ -322,31 +319,33 @@ class TcHandler(TcHandlerBase):
|
|||||||
if info is not None:
|
if info is not None:
|
||||||
if info.proc_type == TcQueueEntryType.PUS_TC:
|
if info.proc_type == TcQueueEntryType.PUS_TC:
|
||||||
def_proc = info.to_def_procedure()
|
def_proc = info.to_def_procedure()
|
||||||
LOGGER.info(
|
_LOGGER.info(
|
||||||
f"Finished queue for service {def_proc.service} and op code {def_proc.op_code}"
|
f"Finished queue for service {def_proc.service} and op code {def_proc.op_code}"
|
||||||
)
|
)
|
||||||
elif info.proc_type == TcProcedureType.CFDP:
|
elif info.proc_type == TcProcedureType.CFDP:
|
||||||
LOGGER.info(f"Finished CFDP queue")
|
_LOGGER.info(f"Finished CFDP queue")
|
||||||
|
|
||||||
|
|
||||||
def setup_params() -> SetupWrapper:
|
def setup_params() -> SetupWrapper:
|
||||||
print(f"-- eive tmtc v{__version__} --")
|
|
||||||
print(f"-- spacepackets v{spacepackets.__version__} --")
|
|
||||||
hook_obj = EiveHookObject(default_json_path())
|
hook_obj = EiveHookObject(default_json_path())
|
||||||
params = SetupParams()
|
params = SetupParams()
|
||||||
parser_wrapper = PreArgsParsingWrapper()
|
parser_wrapper = PreArgsParsingWrapper()
|
||||||
parser_wrapper.create_default_parent_parser()
|
parser_wrapper.create_default_parent_parser()
|
||||||
parser_wrapper.create_default_parser()
|
parser_wrapper.create_default_parser()
|
||||||
parser_wrapper.add_def_proc_and_cfdp_as_subparsers()
|
parser_wrapper.add_def_proc_and_cfdp_as_subparsers()
|
||||||
post_arg_parsing_wrapper = parser_wrapper.parse(hook_obj)
|
post_arg_parsing_wrapper = parser_wrapper.parse(
|
||||||
|
setup_params=params, hook_obj=hook_obj
|
||||||
|
)
|
||||||
tmtccmd.init_printout(post_arg_parsing_wrapper.use_gui)
|
tmtccmd.init_printout(post_arg_parsing_wrapper.use_gui)
|
||||||
use_prompts = not post_arg_parsing_wrapper.use_gui
|
use_prompts = not post_arg_parsing_wrapper.use_gui
|
||||||
proc_param_wrapper = ProcedureParamsWrapper()
|
proc_param_wrapper = ProcedureParamsWrapper()
|
||||||
if use_prompts:
|
if use_prompts:
|
||||||
post_arg_parsing_wrapper.set_params_with_prompts(params, proc_param_wrapper)
|
post_arg_parsing_wrapper.set_params_with_prompts(proc_param_wrapper)
|
||||||
else:
|
else:
|
||||||
post_arg_parsing_wrapper.set_params_without_prompts(params, proc_param_wrapper)
|
post_arg_parsing_wrapper.set_params_without_prompts(proc_param_wrapper)
|
||||||
params.apid = PUS_APID
|
params.apid = PUS_APID
|
||||||
|
if params.com_if is None:
|
||||||
|
raise ValueError("could not determine a COM interface.")
|
||||||
setup_wrapper = SetupWrapper(
|
setup_wrapper = SetupWrapper(
|
||||||
hook_obj=hook_obj, setup_params=params, proc_param_wrapper=proc_param_wrapper
|
hook_obj=hook_obj, setup_params=params, proc_param_wrapper=proc_param_wrapper
|
||||||
)
|
)
|
||||||
@ -394,7 +393,9 @@ def setup_tmtc_handlers(
|
|||||||
gui: bool,
|
gui: bool,
|
||||||
) -> (CcsdsTmHandler, TcHandler):
|
) -> (CcsdsTmHandler, TcHandler):
|
||||||
cfdp_in_ccsds_wrapper = setup_cfdp_handler()
|
cfdp_in_ccsds_wrapper = setup_cfdp_handler()
|
||||||
verification_wrapper = VerificationWrapper(verificator, LOGGER, printer.file_logger)
|
verification_wrapper = VerificationWrapper(
|
||||||
|
verificator, _LOGGER, printer.file_logger
|
||||||
|
)
|
||||||
pus_handler = PusHandler(verification_wrapper, printer, raw_logger)
|
pus_handler = PusHandler(verification_wrapper, printer, raw_logger)
|
||||||
ccsds_handler = CcsdsTmHandler(generic_handler=UnknownApidHandler(None))
|
ccsds_handler = CcsdsTmHandler(generic_handler=UnknownApidHandler(None))
|
||||||
ccsds_handler.add_apid_handler(pus_handler)
|
ccsds_handler.add_apid_handler(pus_handler)
|
||||||
@ -428,11 +429,15 @@ def setup_backend(
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
print(f"-- eive tmtc v{__version__} --")
|
||||||
|
print(f"-- spacepackets v{spacepackets.__version__} --")
|
||||||
|
add_colorlog_console_logger(_LOGGER)
|
||||||
try:
|
try:
|
||||||
setup_wrapper = setup_params()
|
setup_wrapper = setup_params()
|
||||||
except KeyboardInterrupt as e:
|
except KeyboardInterrupt as e:
|
||||||
LOGGER.info(f"{e}. Exiting")
|
_LOGGER.info(f"{e}. Exiting")
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
tmtc_logger = RegularTmtcLogWrapper()
|
tmtc_logger = RegularTmtcLogWrapper()
|
||||||
printer = FsfwTmTcPrinter(tmtc_logger.logger)
|
printer = FsfwTmTcPrinter(tmtc_logger.logger)
|
||||||
raw_logger = RawTmtcTimedLogWrapper(
|
raw_logger = RawTmtcTimedLogWrapper(
|
||||||
@ -455,11 +460,11 @@ def main():
|
|||||||
if state.request == BackendRequest.TERMINATION_NO_ERROR:
|
if state.request == BackendRequest.TERMINATION_NO_ERROR:
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
elif state.request == BackendRequest.DELAY_IDLE:
|
elif state.request == BackendRequest.DELAY_IDLE:
|
||||||
LOGGER.info("TMTC Client in IDLE mode")
|
_LOGGER.info("TMTC Client in IDLE mode")
|
||||||
time.sleep(3.0)
|
time.sleep(3.0)
|
||||||
elif state.request == BackendRequest.DELAY_LISTENER:
|
elif state.request == BackendRequest.DELAY_LISTENER:
|
||||||
if tc_handler.cfdp_done():
|
if tc_handler.cfdp_done():
|
||||||
LOGGER.info("CFDP transaction done, closing client")
|
_LOGGER.info("CFDP transaction done, closing client")
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
elif state.request == BackendRequest.DELAY_CUSTOM:
|
elif state.request == BackendRequest.DELAY_CUSTOM:
|
||||||
|
Reference in New Issue
Block a user