v1.9.0 #53
@ -16,6 +16,7 @@ class CustomServiceList(enum.Enum):
|
|||||||
PDU1 = "pdu1"
|
PDU1 = "pdu1"
|
||||||
PDU2 = "pdu2"
|
PDU2 = "pdu2"
|
||||||
ACU = "acu"
|
ACU = "acu"
|
||||||
|
ACS = "acs"
|
||||||
TMP1075_1 = "tmp1075_1"
|
TMP1075_1 = "tmp1075_1"
|
||||||
TMP1075_2 = "tmp1075_2"
|
TMP1075_2 = "tmp1075_2"
|
||||||
HEATER = "heater"
|
HEATER = "heater"
|
||||||
|
@ -5,32 +5,53 @@
|
|||||||
"""
|
"""
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
|
||||||
PUS_SERVICE_17_ID = bytes([0x53, 0x00, 0x00, 0x17])
|
# Core Object IDs
|
||||||
TEST_DEVICE_ID = bytes([0x54, 0x00, 0xAF, 0xFE])
|
CORE_CONTROLLER_ID = bytes([0x43, 0x00, 0x00, 0x03])
|
||||||
|
SOLAR_ARRAY_DEPLOYMENT_ID = bytes([0x44, 0x41, 0x10, 0xA2])
|
||||||
|
|
||||||
|
# Power Object IDs
|
||||||
|
PCDU_HANDLER_ID = bytes([0x44, 0x20, 0x00, 0xA1])
|
||||||
P60_DOCK_HANDLER = bytes([0x44, 0x25, 0x00, 0x00])
|
P60_DOCK_HANDLER = bytes([0x44, 0x25, 0x00, 0x00])
|
||||||
PDU_1_HANDLER_ID = bytes([0x44, 0x25, 0x00, 0x01])
|
PDU_1_HANDLER_ID = bytes([0x44, 0x25, 0x00, 0x01])
|
||||||
PDU_2_HANDLER_ID = bytes([0x44, 0x25, 0x00, 0x02])
|
PDU_2_HANDLER_ID = bytes([0x44, 0x25, 0x00, 0x02])
|
||||||
ACU_HANDLER_ID = bytes([0x44, 0x25, 0x00, 0x03])
|
ACU_HANDLER_ID = bytes([0x44, 0x25, 0x00, 0x03])
|
||||||
|
|
||||||
|
# Thermal Object IDs
|
||||||
|
HEATER_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])
|
||||||
HEATER_ID = bytes([0x44, 0x41, 0x00, 0xA4])
|
|
||||||
PCDU_HANDLER_ID = bytes([0x44, 0x20, 0x00, 0xA1])
|
# Communication Object IDs
|
||||||
SOLAR_ARRAY_DEPLOYMENT_ID = bytes([0x44, 0x41, 0x10, 0xA2])
|
|
||||||
SYRLINKS_HANDLER = bytes([0x44, 0x53, 0x00, 0xA3])
|
SYRLINKS_HANDLER = bytes([0x44, 0x53, 0x00, 0xA3])
|
||||||
IMTQ_HANDLER_ID = bytes([0x44, 0x14, 0x00, 0x14])
|
|
||||||
PLOC_MPSOC_ID = bytes([0x44, 0x33, 0x00, 0x15])
|
# ACS Object IDs
|
||||||
|
MGM_0_HANDLER_ID = bytes([0x44, 0x12, 0x00, 0x06])
|
||||||
|
MGM_1_HANDLER_ID = bytes([0x44, 0x12, 0x01, 0x07])
|
||||||
|
MGM_2_HANDLER_ID = bytes([0x44, 0x12, 0x02, 0x08])
|
||||||
|
MGM_3_HANDLER_ID = bytes([0x44, 0x12, 0x03, 0x09])
|
||||||
|
GYRO_0_HANDLER_ID = bytes([0x44, 0x12, 0x00, 0x10])
|
||||||
|
GYRO_1_HANDLER_ID = bytes([0x44, 0x12, 0x01, 0x11])
|
||||||
|
GYRO_2_HANDLER_ID = bytes([0x44, 0x12, 0x02, 0x12])
|
||||||
|
GYRO_3_HANDLER_ID = bytes([0x44, 0x12, 0x03, 0x13])
|
||||||
GPS_HANDLER_0_ID = bytes([0x44, 0x13, 0x00, 0x45])
|
GPS_HANDLER_0_ID = bytes([0x44, 0x13, 0x00, 0x45])
|
||||||
GPS_HANDLER_1_ID = bytes([0x44, 0x13, 0x01, 0x46])
|
GPS_HANDLER_1_ID = bytes([0x44, 0x13, 0x01, 0x46])
|
||||||
RW1_ID = bytes([0x44, 0x12, 0x00, 0x47])
|
RW1_ID = bytes([0x44, 0x12, 0x00, 0x47])
|
||||||
RW2_ID = bytes([0x44, 0x12, 0x01, 0x48])
|
RW2_ID = bytes([0x44, 0x12, 0x01, 0x48])
|
||||||
RW3_ID = bytes([0x44, 0x12, 0x02, 0x49])
|
RW3_ID = bytes([0x44, 0x12, 0x02, 0x49])
|
||||||
RW4_ID = bytes([0x44, 0x12, 0x03, 0x50])
|
RW4_ID = bytes([0x44, 0x12, 0x03, 0x50])
|
||||||
|
IMTQ_HANDLER_ID = bytes([0x44, 0x14, 0x00, 0x14])
|
||||||
|
|
||||||
|
# Misc Object IDs
|
||||||
|
PUS_SERVICE_17_ID = bytes([0x53, 0x00, 0x00, 0x17])
|
||||||
|
TEST_DEVICE_ID = bytes([0x54, 0x00, 0xAF, 0xFE])
|
||||||
|
|
||||||
|
# Payload Object IDs
|
||||||
STAR_TRACKER_ID = bytes([0x44, 0x13, 0x00, 0x1])
|
STAR_TRACKER_ID = bytes([0x44, 0x13, 0x00, 0x1])
|
||||||
RAD_SENSOR_ID = bytes([0x44, 0x32, 0x00, 0xA5])
|
RAD_SENSOR_ID = bytes([0x44, 0x32, 0x00, 0xA5])
|
||||||
PLOC_SUPV_ID = bytes([0x44, 0x33, 0x00, 0x16])
|
PLOC_SUPV_ID = bytes([0x44, 0x33, 0x00, 0x16])
|
||||||
PLOC_UPDATER_ID = bytes([0x44, 0x33, 0x00, 0x00])
|
PLOC_UPDATER_ID = bytes([0x44, 0x33, 0x00, 0x00])
|
||||||
CORE_CONTROLLER_ID = bytes([0x43, 0x00, 0x00, 0x03])
|
|
||||||
PLOC_MEMORY_DUMPER_ID = bytes([0x44, 0x33, 0x00, 0x01])
|
PLOC_MEMORY_DUMPER_ID = bytes([0x44, 0x33, 0x00, 0x01])
|
||||||
|
PLOC_MPSOC_ID = bytes([0x44, 0x33, 0x00, 0x15])
|
||||||
|
|
||||||
|
|
||||||
def get_object_ids() -> Dict[bytes, list]:
|
def get_object_ids() -> Dict[bytes, list]:
|
||||||
|
25
pus_tc/acs.py
Normal file
25
pus_tc/acs.py
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import enum
|
||||||
|
from tmtccmd.tc.definitions import TcQueueT
|
||||||
|
from tmtccmd.pus.service_list import PusServices
|
||||||
|
from tmtccmd.tc.service_200_mode import pack_mode_data, Modes
|
||||||
|
from tmtccmd.tc.packer import PusTelecommand
|
||||||
|
from config.object_ids import MGM_0_HANDLER_ID, MGM_1_HANDLER_ID, MGM_2_HANDLER_ID, MGM_3_HANDLER_ID
|
||||||
|
|
||||||
|
|
||||||
|
class AcsOpCodes(enum.Enum):
|
||||||
|
# Switch on A side
|
||||||
|
ON_MGM_0 = "0"
|
||||||
|
ON_MGM_1 = "1"
|
||||||
|
ON_GYRO_0 = "2"
|
||||||
|
ON_GYRO_1 = "3"
|
||||||
|
# Switch on B side
|
||||||
|
ON_MGM_2 = "4"
|
||||||
|
ON_MGM_3 = "5"
|
||||||
|
ON_GYRO_2 = "6"
|
||||||
|
ON_GYRO_3 = "7"
|
||||||
|
|
||||||
|
|
||||||
|
def pack_acs_command(tc_queue: TcQueueT, op_code: str):
|
||||||
|
if op_code == AcsOpCodes.ON_MGM_0.value:
|
||||||
|
app_data = pack_mode_data(object_id=MGM_0_HANDLER_ID, mode=Modes.ON, submode=0)
|
||||||
|
# return PusTelecommand(service=PusServices.SERVICE_200_MODE, subservice=)
|
@ -1,9 +1,5 @@
|
|||||||
|
"""Hook function which packs telecommands based on service and operation code string
|
||||||
"""
|
"""
|
||||||
@brief This file transfers control of TC packing to the user
|
|
||||||
@details Template configuration file. Copy this folder to the TMTC commander root and adapt
|
|
||||||
it to your needs.
|
|
||||||
"""
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from collections import deque
|
from collections import deque
|
||||||
from typing import Union
|
from typing import Union
|
||||||
@ -31,6 +27,7 @@ from pus_tc.ploc_memory_dumper import pack_ploc_memory_dumper_cmd
|
|||||||
from pus_tc.core import pack_core_commands
|
from pus_tc.core import pack_core_commands
|
||||||
from pus_tc.star_tracker import pack_star_tracker_commands_into
|
from pus_tc.star_tracker import pack_star_tracker_commands_into
|
||||||
from pus_tc.gps import pack_gps_command
|
from pus_tc.gps import pack_gps_command
|
||||||
|
from pus_tc.acs import pack_acs_command
|
||||||
from config.definitions import CustomServiceList
|
from config.definitions import CustomServiceList
|
||||||
from config.object_ids import P60_DOCK_HANDLER, PDU_1_HANDLER_ID, PDU_2_HANDLER_ID, \
|
from config.object_ids import P60_DOCK_HANDLER, PDU_1_HANDLER_ID, PDU_2_HANDLER_ID, \
|
||||||
ACU_HANDLER_ID, TMP_1075_1_HANDLER_ID, TMP_1075_2_HANDLER_ID, HEATER_ID, IMTQ_HANDLER_ID, \
|
ACU_HANDLER_ID, TMP_1075_1_HANDLER_ID, TMP_1075_2_HANDLER_ID, HEATER_ID, IMTQ_HANDLER_ID, \
|
||||||
@ -114,6 +111,8 @@ def pack_service_queue_user(service: Union[str, int], op_code: str, service_queu
|
|||||||
return pack_ploc_memory_dumper_cmd(
|
return pack_ploc_memory_dumper_cmd(
|
||||||
object_id=object_id, tc_queue=service_queue, op_code=op_code
|
object_id=object_id, tc_queue=service_queue, op_code=op_code
|
||||||
)
|
)
|
||||||
|
if service == CustomServiceList.ACS.value:
|
||||||
|
return pack_acs_command(tc_queue=service_queue, op_code=op_code)
|
||||||
if service == CustomServiceList.GPS_0.value:
|
if service == CustomServiceList.GPS_0.value:
|
||||||
return pack_gps_command(object_id=GPS_HANDLER_0_ID, tc_queue=service_queue, op_code=op_code)
|
return pack_gps_command(object_id=GPS_HANDLER_0_ID, tc_queue=service_queue, op_code=op_code)
|
||||||
if service == CustomServiceList.GPS_1.value:
|
if service == CustomServiceList.GPS_1.value:
|
||||||
|
2
tmtccmd
2
tmtccmd
@ -1 +1 @@
|
|||||||
Subproject commit 0d858a8e96398f46f054f63c1d2d4225c192b330
|
Subproject commit 38be11cab16c036fb0968f01d46d198be4cd058f
|
Loading…
Reference in New Issue
Block a user