v1.9.0 #53

Merged
muellerr merged 354 commits from develop into master 2022-04-07 17:39:42 +02:00
3 changed files with 160 additions and 144 deletions
Showing only changes of commit 14c6d7a525 - Show all commits

View File

@ -302,90 +302,91 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
service_ploc_updater_tuple = ("Ploc Updater", op_code_dict_srv_ploc_updater)
op_code_dict_srv_star_tracker = {
"0": ("Star Tracker: Mode On", {OpCodeDictKeys.TIMEOUT: 2.0}),
"1": ("Star Tracker: Mode Normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
"2": ("Star Tracker: Mode Off", {OpCodeDictKeys.TIMEOUT: 2.0}),
"3": ("Star Tracker: Mode Raw", {OpCodeDictKeys.TIMEOUT: 2.0}),
"4": ("Star Tracker: Ping", {OpCodeDictKeys.TIMEOUT: 2.0}),
"5": (
"0": ("Star Tracker: Mode On, Submode Bootloader", {OpCodeDictKeys.TIMEOUT: 2.0}),
"1": ("Star Tracker: Mode On, Submode Firmware", {OpCodeDictKeys.TIMEOUT: 2.0}),
"2": ("Star Tracker: Mode Normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
"3": ("Star Tracker: Mode Off", {OpCodeDictKeys.TIMEOUT: 2.0}),
"4": ("Star Tracker: Mode Raw", {OpCodeDictKeys.TIMEOUT: 2.0}),
"5": ("Star Tracker: Ping", {OpCodeDictKeys.TIMEOUT: 2.0}),
"6": (
"Star Tracker: Switch to bootloader program",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"6": ("Star Tracker: Request temperature", {OpCodeDictKeys.TIMEOUT: 2.0}),
"7": ("Star Tracker: Request version", {OpCodeDictKeys.TIMEOUT: 2.0}),
"8": ("Star Tracker: Request interface", {OpCodeDictKeys.TIMEOUT: 2.0}),
"9": ("Star Tracker: Request power", {OpCodeDictKeys.TIMEOUT: 2.0}),
"10": ("Star Tracker: Subscribe to telemetry", {OpCodeDictKeys.TIMEOUT: 2.0}),
"11": (
"7": ("Star Tracker: Request temperature", {OpCodeDictKeys.TIMEOUT: 2.0}),
"8": ("Star Tracker: Request version", {OpCodeDictKeys.TIMEOUT: 2.0}),
"9": ("Star Tracker: Request interface", {OpCodeDictKeys.TIMEOUT: 2.0}),
"10": ("Star Tracker: Request power", {OpCodeDictKeys.TIMEOUT: 2.0}),
"11": ("Star Tracker: Subscribe to telemetry", {OpCodeDictKeys.TIMEOUT: 2.0}),
"12": (
"Star Tracker: Boot image (requires bootloader mode)",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"12": ("Star Tracker: Request time", {OpCodeDictKeys.TIMEOUT: 2.0}),
"13": ("Star Tracker: Request solution", {OpCodeDictKeys.TIMEOUT: 2.0}),
"14": ("Star Tracker: Upload image", {OpCodeDictKeys.TIMEOUT: 2.0}),
"15": ("Star Tracker: Download image", {OpCodeDictKeys.TIMEOUT: 2.0}),
"16": ("Star Tracker: Limits", {OpCodeDictKeys.TIMEOUT: 2.0}),
"17": ("Star Tracker: Tracking", {OpCodeDictKeys.TIMEOUT: 2.0}),
"18": ("Star Tracker: Mounting", {OpCodeDictKeys.TIMEOUT: 2.0}),
"19": ("Star Tracker: Camera", {OpCodeDictKeys.TIMEOUT: 2.0}),
"20": ("Star Tracker: Blob", {OpCodeDictKeys.TIMEOUT: 2.0}),
"21": ("Star Tracker: Centroiding", {OpCodeDictKeys.TIMEOUT: 2.0}),
"22": ("Star Tracker: LISA", {OpCodeDictKeys.TIMEOUT: 2.0}),
"23": ("Star Tracker: Matching", {OpCodeDictKeys.TIMEOUT: 2.0}),
"24": ("Star Tracker: Validation", {OpCodeDictKeys.TIMEOUT: 2.0}),
"25": ("Star Tracker: Algo", {OpCodeDictKeys.TIMEOUT: 2.0}),
"26": ("Star Tracker: Take image", {OpCodeDictKeys.TIMEOUT: 2.0}),
"27": ("Star Tracker: Stop str helper", {OpCodeDictKeys.TIMEOUT: 2.0}),
"28": ("Star Tracker: Reset error signal", {OpCodeDictKeys.TIMEOUT: 2.0}),
"29": (
"13": ("Star Tracker: Request time", {OpCodeDictKeys.TIMEOUT: 2.0}),
"14": ("Star Tracker: Request solution", {OpCodeDictKeys.TIMEOUT: 2.0}),
"15": ("Star Tracker: Upload image", {OpCodeDictKeys.TIMEOUT: 2.0}),
"16": ("Star Tracker: Download image", {OpCodeDictKeys.TIMEOUT: 2.0}),
"17": ("Star Tracker: Limits", {OpCodeDictKeys.TIMEOUT: 2.0}),
"18": ("Star Tracker: Tracking", {OpCodeDictKeys.TIMEOUT: 2.0}),
"19": ("Star Tracker: Mounting", {OpCodeDictKeys.TIMEOUT: 2.0}),
"20": ("Star Tracker: Camera", {OpCodeDictKeys.TIMEOUT: 2.0}),
"21": ("Star Tracker: Blob", {OpCodeDictKeys.TIMEOUT: 2.0}),
"22": ("Star Tracker: Centroiding", {OpCodeDictKeys.TIMEOUT: 2.0}),
"23": ("Star Tracker: LISA", {OpCodeDictKeys.TIMEOUT: 2.0}),
"24": ("Star Tracker: Matching", {OpCodeDictKeys.TIMEOUT: 2.0}),
"25": ("Star Tracker: Validation", {OpCodeDictKeys.TIMEOUT: 2.0}),
"26": ("Star Tracker: Algo", {OpCodeDictKeys.TIMEOUT: 2.0}),
"27": ("Star Tracker: Take image", {OpCodeDictKeys.TIMEOUT: 2.0}),
"28": ("Star Tracker: Stop str helper", {OpCodeDictKeys.TIMEOUT: 2.0}),
"29": ("Star Tracker: Reset error signal", {OpCodeDictKeys.TIMEOUT: 2.0}),
"30": (
"Star Tracker: Set name of download image",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"30": ("Star Tracker: Request histogram", {OpCodeDictKeys.TIMEOUT: 2.0}),
"31": ("Star Tracker: Request contrast", {OpCodeDictKeys.TIMEOUT: 2.0}),
"32": ("Star Tracker: Set json filename", {OpCodeDictKeys.TIMEOUT: 2.0}),
"33": ("Star Tracker: Write", {OpCodeDictKeys.TIMEOUT: 2.0}),
"34": ("Star Tracker: Read", {OpCodeDictKeys.TIMEOUT: 2.0}),
"35": ("Star Tracker: Set Read filename", {OpCodeDictKeys.TIMEOUT: 2.0}),
"36": ("Star Tracker: Get checksum", {OpCodeDictKeys.TIMEOUT: 2.0}),
"37": ("Star Tracker: Set time", {OpCodeDictKeys.TIMEOUT: 2.0}),
"38": ("Star Tracker: Download centroid", {OpCodeDictKeys.TIMEOUT: 2.0}),
"39": (
"31": ("Star Tracker: Request histogram", {OpCodeDictKeys.TIMEOUT: 2.0}),
"32": ("Star Tracker: Request contrast", {OpCodeDictKeys.TIMEOUT: 2.0}),
"33": ("Star Tracker: Set json filename", {OpCodeDictKeys.TIMEOUT: 2.0}),
"34": ("Star Tracker: Write", {OpCodeDictKeys.TIMEOUT: 2.0}),
"35": ("Star Tracker: Read", {OpCodeDictKeys.TIMEOUT: 2.0}),
"36": ("Star Tracker: Set Read filename", {OpCodeDictKeys.TIMEOUT: 2.0}),
"37": ("Star Tracker: Get checksum", {OpCodeDictKeys.TIMEOUT: 2.0}),
"38": ("Star Tracker: Set time", {OpCodeDictKeys.TIMEOUT: 2.0}),
"39": ("Star Tracker: Download centroid", {OpCodeDictKeys.TIMEOUT: 2.0}),
"40": (
"Star Tracker: Upload centroid (not implemented?)",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"40": ("Star Tracker: Download matched star", {OpCodeDictKeys.TIMEOUT: 2.0}),
"41": ("Star Tracker: Download DB Image", {OpCodeDictKeys.TIMEOUT: 2.0}),
"42": ("Star Tracker: Download Blob Pixel", {OpCodeDictKeys.TIMEOUT: 2.0}),
"43": ("Star Tracker: Download FPGA Image", {OpCodeDictKeys.TIMEOUT: 2.0}),
"44": (
"41": ("Star Tracker: Download matched star", {OpCodeDictKeys.TIMEOUT: 2.0}),
"42": ("Star Tracker: Download DB Image", {OpCodeDictKeys.TIMEOUT: 2.0}),
"43": ("Star Tracker: Download Blob Pixel", {OpCodeDictKeys.TIMEOUT: 2.0}),
"44": ("Star Tracker: Download FPGA Image", {OpCodeDictKeys.TIMEOUT: 2.0}),
"45": (
"Star Tracker: Change download FPGA image name",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"45": ("Star Tracker: Upload FPGA image", {OpCodeDictKeys.TIMEOUT: 2.0}),
"46": ("Star Tracker: FPGA action", {OpCodeDictKeys.TIMEOUT: 2.0}),
"47": ("Star Tracker: Unlock", {OpCodeDictKeys.TIMEOUT: 2.0}),
"48": ("Star Tracker: Request camera parameter", {OpCodeDictKeys.TIMEOUT: 2.0}),
"49": ("Star Tracker: Request limits", {OpCodeDictKeys.TIMEOUT: 2.0}),
"50": ("Star Tracker: Set image processor parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"51": ("Star Tracker: (EGSE only) Load camera ground config ", {OpCodeDictKeys.TIMEOUT: 2.0}),
"52": ("Star Tracker: (EGSE only) Load camera flight config", {OpCodeDictKeys.TIMEOUT: 2.0}),
"53": ("Star Tracker: Request log level parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"54": ("Star Tracker: Request mounting parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"55": ("Star Tracker: Request image processor parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"56": ("Star Tracker: Request centroiding parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"57": ("Star Tracker: Request lisa parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"58": ("Star Tracker: Request matching parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"59": ("Star Tracker: Request tracking parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"60": ("Star Tracker: Request validation parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"61": ("Star Tracker: Request algo parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"62": ("Star Tracker: Request subscription parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"63": ("Star Tracker: Request log subscription parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"64": ("Star Tracker: Request debug camera parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"65": ("Star Tracker: Set log level parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"66": ("Star Tracker: Set log subscription parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"67": ("Star Tracker: Set debug camera parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"68": ("Star Tracker: Firmware update", {OpCodeDictKeys.TIMEOUT: 2.0}),
"46": ("Star Tracker: Upload FPGA image", {OpCodeDictKeys.TIMEOUT: 2.0}),
"47": ("Star Tracker: FPGA action", {OpCodeDictKeys.TIMEOUT: 2.0}),
"48": ("Star Tracker: Unlock", {OpCodeDictKeys.TIMEOUT: 2.0}),
"49": ("Star Tracker: Request camera parameter", {OpCodeDictKeys.TIMEOUT: 2.0}),
"50": ("Star Tracker: Request limits", {OpCodeDictKeys.TIMEOUT: 2.0}),
"51": ("Star Tracker: Set image processor parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"52": ("Star Tracker: (EGSE only) Load camera ground config ", {OpCodeDictKeys.TIMEOUT: 2.0}),
"53": ("Star Tracker: (EGSE only) Load camera flight config", {OpCodeDictKeys.TIMEOUT: 2.0}),
"54": ("Star Tracker: Request log level parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"55": ("Star Tracker: Request mounting parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"56": ("Star Tracker: Request image processor parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"57": ("Star Tracker: Request centroiding parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"58": ("Star Tracker: Request lisa parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"59": ("Star Tracker: Request matching parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"60": ("Star Tracker: Request tracking parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"61": ("Star Tracker: Request validation parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"62": ("Star Tracker: Request algo parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"63": ("Star Tracker: Request subscription parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"64": ("Star Tracker: Request log subscription parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"65": ("Star Tracker: Request debug camera parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"66": ("Star Tracker: Set log level parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"67": ("Star Tracker: Set log subscription parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"68": ("Star Tracker: Set debug camera parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"69": ("Star Tracker: Firmware update", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_star_tracker_tuple = ("Star tracker", op_code_dict_srv_star_tracker)

View File

@ -11,7 +11,7 @@ from tmtccmd.config.definitions import QueueCommands
from tmtccmd.tc.packer import TcQueueT
from spacepackets.ecss.tc import PusTelecommand
from pus_tc.service_200_mode import pack_mode_data
from tmtccmd.tc.service_200_mode import pack_mode_data, Modes
from tmtccmd.utility.logger import get_console_logger
from utility.input_helper import InputHelper
@ -101,6 +101,7 @@ class FileDefs:
q7sFlightConfig = "/mnt/sd0/startracker/flight-config.json"
firmware2_1 = "/home/pi/arcsec/firmware/sagitta2-1.bin"
firmware22_1 = "/home/pi/arcsec/firmware/sagitta-22.1.bin"
firmware_origin = "/home/arcsec/21-921600/sagitta.bin"
json_dict = {
@ -113,6 +114,7 @@ json_dict = {
firmware_dict = {
"1": ["Firmware Major = 2, Minor = 1", FileDefs.firmware2_1],
"2": ["Firmware Major = 22, Minor = 1", FileDefs.firmware22_1],
"3": ["Firmware Origin", FileDefs.firmware_origin],
}
@ -131,6 +133,11 @@ class PartitionSize:
FREE_2 = 896000
class Submode:
BOOTLOADER = 1
FIRMWARE = 2
def pack_star_tracker_commands(
object_id: bytearray, tc_queue: TcQueueT, op_code: str
) -> TcQueueT:
@ -142,31 +149,36 @@ def pack_star_tracker_commands(
)
if op_code == "0":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Mode On"))
command = pack_mode_data(object_id, 1, 0)
command = PusTelecommand(service=200, subservice=1, ssc=10, app_data=command)
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Mode On, Submode Bootloader"))
command = pack_mode_data(object_id, Modes.ON, Submode.BOOTLOADER)
command = PusTelecommand(service=200, subservice=1, ssc=9, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "1":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Mode Normal"))
command = pack_mode_data(object_id, 2, 0)
command = PusTelecommand(service=200, subservice=1, ssc=11, app_data=command)
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Mode On, Submode Firmware"))
command = pack_mode_data(object_id, Modes.ON, Submode.FIRMWARE)
command = PusTelecommand(service=200, subservice=1, ssc=10, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "2":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Mode Off"))
command = pack_mode_data(object_id, 0, 0)
command = PusTelecommand(service=200, subservice=1, ssc=12, app_data=command)
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Mode Normal"))
command = pack_mode_data(object_id, Modes.NORMAL, 0)
command = PusTelecommand(service=200, subservice=1, ssc=11, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "3":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Mode Off"))
command = pack_mode_data(object_id, Modes.OFF, 0)
command = PusTelecommand(service=200, subservice=1, ssc=12, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "4":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Mode Raw"))
command = pack_mode_data(object_id, 3, 0)
command = PusTelecommand(service=200, subservice=1, ssc=13, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "4":
if op_code == "5":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Ping"))
command = object_id + struct.pack("!I", StarTrackerActionIds.PING)
command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "5":
if op_code == "6":
tc_queue.appendleft(
(QueueCommands.PRINT, "Star tracker: Switch to bootloader program")
)
@ -175,27 +187,27 @@ def pack_star_tracker_commands(
)
command = PusTelecommand(service=8, subservice=128, ssc=31, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "6":
if op_code == "7":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Temperature request"))
command = object_id + struct.pack("!I", StarTrackerActionIds.REQ_TEMPERATURE)
command = PusTelecommand(service=8, subservice=128, ssc=32, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "7":
if op_code == "8":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request version"))
command = object_id + struct.pack("!I", StarTrackerActionIds.REQ_VERSION)
command = PusTelecommand(service=8, subservice=128, ssc=33, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "8":
if op_code == "9":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request interface"))
command = object_id + struct.pack("!I", StarTrackerActionIds.REQ_INTERFACE)
command = PusTelecommand(service=8, subservice=128, ssc=34, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "9":
if op_code == "10":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request power"))
command = object_id + struct.pack("!I", StarTrackerActionIds.REQ_POWER)
command = PusTelecommand(service=8, subservice=128, ssc=35, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "10":
if op_code == "11":
tc_queue.appendleft(
(QueueCommands.PRINT, "Star tracker: Set subscription parameters")
)
@ -207,22 +219,22 @@ def pack_star_tracker_commands(
)
command = PusTelecommand(service=8, subservice=128, ssc=36, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "11":
if op_code == "12":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Boot"))
command = object_id + struct.pack("!I", StarTrackerActionIds.BOOT)
command = PusTelecommand(service=8, subservice=128, ssc=37, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "12":
if op_code == "13":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request time"))
command = object_id + struct.pack("!I", StarTrackerActionIds.REQ_TIME)
command = PusTelecommand(service=8, subservice=128, ssc=38, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "13":
if op_code == "14":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request solution"))
command = object_id + struct.pack("!I", StarTrackerActionIds.REQ_SOLUTION)
command = PusTelecommand(service=8, subservice=128, ssc=39, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "14":
if op_code == "15":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Upload image"))
command = (
object_id
@ -231,7 +243,7 @@ def pack_star_tracker_commands(
)
command = PusTelecommand(service=8, subservice=128, ssc=40, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "15":
if op_code == "16":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Download image"))
path = input("Specify storage location (default - /mnt/sd0/startracker): ")
if not path:
@ -243,7 +255,7 @@ def pack_star_tracker_commands(
)
command = PusTelecommand(service=8, subservice=128, ssc=53, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "16":
if op_code == "17":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Set limits"))
command = (
object_id
@ -252,7 +264,7 @@ def pack_star_tracker_commands(
)
command = PusTelecommand(service=8, subservice=128, ssc=42, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "17":
if op_code == "18":
tc_queue.appendleft(
(QueueCommands.PRINT, "Star tracker: Set tracking parameters")
)
@ -263,7 +275,7 @@ def pack_star_tracker_commands(
)
command = PusTelecommand(service=8, subservice=128, ssc=43, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "18":
if op_code == "19":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Mounting"))
command = (
object_id
@ -272,7 +284,7 @@ def pack_star_tracker_commands(
)
command = PusTelecommand(service=8, subservice=128, ssc=44, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "19":
if op_code == "20":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Camera"))
command = (
object_id
@ -281,7 +293,7 @@ def pack_star_tracker_commands(
)
command = PusTelecommand(service=8, subservice=128, ssc=45, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "20":
if op_code == "21":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Blob"))
command = (
object_id
@ -290,7 +302,7 @@ def pack_star_tracker_commands(
)
command = PusTelecommand(service=8, subservice=128, ssc=46, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "21":
if op_code == "22":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Centroiding"))
command = (
object_id
@ -299,7 +311,7 @@ def pack_star_tracker_commands(
)
command = PusTelecommand(service=8, subservice=128, ssc=47, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "22":
if op_code == "23":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: LISA"))
command = (
object_id
@ -308,7 +320,7 @@ def pack_star_tracker_commands(
)
command = PusTelecommand(service=8, subservice=128, ssc=48, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "23":
if op_code == "24":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Matching"))
command = (
object_id
@ -317,7 +329,7 @@ def pack_star_tracker_commands(
)
command = PusTelecommand(service=8, subservice=128, ssc=49, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "24":
if op_code == "25":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Validation"))
command = (
object_id
@ -326,7 +338,7 @@ def pack_star_tracker_commands(
)
command = PusTelecommand(service=8, subservice=128, ssc=50, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "25":
if op_code == "26":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Algo"))
jsonfile = get_config_file()
command = (
@ -336,7 +348,7 @@ def pack_star_tracker_commands(
)
command = PusTelecommand(service=8, subservice=128, ssc=51, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "26":
if op_code == "27":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Take image"))
actionid = int(input("Specify parameter ID (nominal - 4): "))
command = (
@ -346,17 +358,17 @@ def pack_star_tracker_commands(
)
command = PusTelecommand(service=8, subservice=128, ssc=52, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "27":
if op_code == "28":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Stop str helper"))
command = object_id + struct.pack("!I", StarTrackerActionIds.STOP_STR_HELPER)
command = PusTelecommand(service=8, subservice=128, ssc=54, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "28":
if op_code == "29":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Reset error signal"))
command = object_id + struct.pack("!I", StarTrackerActionIds.RESET_ERROR)
command = PusTelecommand(service=8, subservice=128, ssc=54, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "29":
if op_code == "30":
tc_queue.appendleft(
(QueueCommands.PRINT, "Star tracker: Set name of download image")
)
@ -368,17 +380,17 @@ def pack_star_tracker_commands(
)
command = PusTelecommand(service=8, subservice=128, ssc=54, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "30":
if op_code == "31":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request histogram"))
command = object_id + struct.pack("!I", StarTrackerActionIds.REQ_HISTOGRAM)
command = PusTelecommand(service=8, subservice=128, ssc=55, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "31":
if op_code == "32":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request contrast"))
command = object_id + struct.pack("!I", StarTrackerActionIds.REQ_CONTRAST)
command = PusTelecommand(service=8, subservice=128, ssc=56, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "32":
if op_code == "33":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Set json filename"))
command = (
object_id
@ -387,17 +399,17 @@ def pack_star_tracker_commands(
)
command = PusTelecommand(service=8, subservice=128, ssc=57, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "33":
if op_code == "34":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Write"))
command = pack_write_command(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=58, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "34":
if op_code == "35":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Read"))
command = pack_read_command(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=59, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "35":
if op_code == "36":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Set read filename"))
filename = input("Specify filename: ")
command = (
@ -407,12 +419,12 @@ def pack_star_tracker_commands(
)
command = PusTelecommand(service=8, subservice=128, ssc=60, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "36":
if op_code == "37":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Get checksum"))
command = pack_checksum_command(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=61, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "37":
if op_code == "38":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Set time"))
unix_time = 1640783543
command = (
@ -422,7 +434,7 @@ def pack_star_tracker_commands(
)
command = PusTelecommand(service=8, subservice=128, ssc=61, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "38":
if op_code == "39":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Download Centroid"))
id = 0
command = (
@ -432,7 +444,7 @@ def pack_star_tracker_commands(
)
command = PusTelecommand(service=8, subservice=128, ssc=62, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "39":
if op_code == "40":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Upload Centroid"))
command = (
object_id
@ -441,7 +453,7 @@ def pack_star_tracker_commands(
)
command = PusTelecommand(service=8, subservice=128, ssc=63, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "40":
if op_code == "41":
tc_queue.appendleft(
(QueueCommands.PRINT, "Star tracker: Download matched star")
)
@ -453,7 +465,7 @@ def pack_star_tracker_commands(
)
command = PusTelecommand(service=8, subservice=128, ssc=64, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "41":
if op_code == "42":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Download DB Image"))
id = 0
command = (
@ -463,7 +475,7 @@ def pack_star_tracker_commands(
)
command = PusTelecommand(service=8, subservice=128, ssc=65, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "42":
if op_code == "43":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Download Blob Pixel"))
id = 0
type = 1 # 0 - normal, 1 - fast
@ -475,7 +487,7 @@ def pack_star_tracker_commands(
)
command = PusTelecommand(service=8, subservice=128, ssc=65, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "43":
if op_code == "44":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Download FPGA Image"))
position = int(input("Start position: "))
length = int(input("Size to download: "))
@ -488,7 +500,7 @@ def pack_star_tracker_commands(
)
command = PusTelecommand(service=8, subservice=128, ssc=66, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "44":
if op_code == "45":
tc_queue.appendleft(
(QueueCommands.PRINT, "Star tracker: Change donwload FPGA image file name")
)
@ -499,7 +511,7 @@ def pack_star_tracker_commands(
)
command = PusTelecommand(service=8, subservice=128, ssc=67, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "45":
if op_code == "46":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Upload FPGA image"))
command = (
object_id
@ -508,7 +520,7 @@ def pack_star_tracker_commands(
)
command = PusTelecommand(service=8, subservice=128, ssc=68, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "46":
if op_code == "47":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: FPGA action"))
id = 3
command = (
@ -518,120 +530,120 @@ def pack_star_tracker_commands(
)
command = PusTelecommand(service=8, subservice=128, ssc=69, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "47":
if op_code == "48":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Unlock"))
command = object_id + struct.pack("!I", StarTrackerActionIds.UNLOCK)
command = PusTelecommand(service=8, subservice=128, ssc=70, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "48":
if op_code == "49":
tc_queue.appendleft(
(QueueCommands.PRINT, "Star tracker: Request camera parameters")
)
command = object_id + struct.pack("!I", StarTrackerActionIds.REQ_CAMERA_PARAMS)
command = PusTelecommand(service=8, subservice=128, ssc=71, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "49":
if op_code == "50":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request limits"))
command = object_id + struct.pack("!I", StarTrackerActionIds.REQ_LIMITS)
command = PusTelecommand(service=8, subservice=128, ssc=72, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "50":
if op_code == "51":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Set image processor parameters"))
command = object_id + struct.pack('!I', StarTrackerActionIds.IMAGE_PROCESSOR) + \
bytearray(FileDefs.jsonFile, 'utf-8')
command = PusTelecommand(service=8, subservice=128, ssc=70, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "51":
if op_code == "52":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: EGSE load ground config camera parameters"))
command = object_id + struct.pack('!I', StarTrackerActionIds.CAMERA) + \
bytearray(FileDefs.egseGroundConfig, 'utf-8')
command = PusTelecommand(service=8, subservice=128, ssc=71, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "52":
if op_code == "53":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: EGSE load flight config camera parameters"))
command = object_id + struct.pack('!I', StarTrackerActionIds.CAMERA) + \
bytearray(FileDefs.egseFlightConfig, 'utf-8')
command = PusTelecommand(service=8, subservice=128, ssc=72, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "53":
if op_code == "54":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request log level parameters"))
command = object_id + struct.pack('!I', StarTrackerActionIds.REQ_LOG_LEVEL)
command = PusTelecommand(service=8, subservice=128, ssc=74, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "54":
if op_code == "55":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request mounting parameters"))
command = object_id + struct.pack('!I', StarTrackerActionIds.REQ_MOUNTING)
command = PusTelecommand(service=8, subservice=128, ssc=75, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "55":
if op_code == "56":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request image processor parameters"))
command = object_id + struct.pack('!I', StarTrackerActionIds.REQ_IMAGE_PROCESSOR)
command = PusTelecommand(service=8, subservice=128, ssc=76, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "56":
if op_code == "57":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request centroiding parameters"))
command = object_id + struct.pack('!I', StarTrackerActionIds.REQ_CENTROIDING)
command = PusTelecommand(service=8, subservice=128, ssc=75, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "57":
if op_code == "58":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request lisa parameters"))
command = object_id + struct.pack('!I', StarTrackerActionIds.REQ_LISA)
command = PusTelecommand(service=8, subservice=128, ssc=76, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "58":
if op_code == "59":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request matching parameters"))
command = object_id + struct.pack('!I', StarTrackerActionIds.REQ_MATCHING)
command = PusTelecommand(service=8, subservice=128, ssc=77, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "59":
if op_code == "60":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request tracking parameters"))
command = object_id + struct.pack('!I', StarTrackerActionIds.REQ_TRACKING)
command = PusTelecommand(service=8, subservice=128, ssc=78, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "60":
if op_code == "61":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request validation parameters"))
command = object_id + struct.pack('!I', StarTrackerActionIds.REQ_VALIDATION)
command = PusTelecommand(service=8, subservice=128, ssc=79, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "61":
if op_code == "62":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request algo parameters"))
command = object_id + struct.pack('!I', StarTrackerActionIds.REQ_ALGO)
command = PusTelecommand(service=8, subservice=128, ssc=80, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "62":
if op_code == "63":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request subscription parameters"))
command = object_id + struct.pack('!I', StarTrackerActionIds.REQ_SUBSCRIPTION)
command = PusTelecommand(service=8, subservice=128, ssc=81, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "63":
if op_code == "64":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request log subscription parameters"))
command = object_id + struct.pack('!I', StarTrackerActionIds.REQ_LOG_SUBSCRIPTION)
command = PusTelecommand(service=8, subservice=128, ssc=82, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "64":
if op_code == "65":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request debug camera parameters"))
command = object_id + struct.pack('!I', StarTrackerActionIds.REQ_DEBUG_CAMERA)
command = PusTelecommand(service=8, subservice=128, ssc=83, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "65":
if op_code == "66":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Set log level parameters"))
jsonfile = get_config_file()
command = object_id + struct.pack('!I', StarTrackerActionIds.LOGLEVEL) + bytearray(jsonfile, "utf-8")
command = PusTelecommand(service=8, subservice=128, ssc=84, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "66":
if op_code == "67":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Set log subscription parameters"))
jsonfile = get_config_file()
command = object_id + struct.pack('!I', StarTrackerActionIds.LOG_SUBSCRIPTION) + bytearray(jsonfile, "utf-8")
command = PusTelecommand(service=8, subservice=128, ssc=85, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "67":
if op_code == "68":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Set debug camera parameters"))
jsonfile = get_config_file()
command = object_id + struct.pack('!I', StarTrackerActionIds.DEBUG_CAMERA) + bytearray(jsonfile, "utf-8")
command = PusTelecommand(service=8, subservice=128, ssc=86, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "68":
if op_code == "69":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Firmware update"))
firmware = get_firmware()
command = object_id + struct.pack('!I', StarTrackerActionIds.FIRMWARE_UPDATE) + bytearray(firmware, "utf-8")

View File

@ -11,6 +11,7 @@ from tmtccmd.pus.service_1_verification import Service1TMExtended
from tmtccmd.pus.service_17_test import Service17TMExtended
from tmtccmd.tm.service_3_housekeeping import Service3TM
from tmtccmd.tm.service_5_event import Service5TM
from tmtccmd.tm.service_200_mode import Service200TM
from tmtccmd.utility.tmtc_printer import TmTcPrinter, PrintFormats
from config.definitions import PUS_APID
@ -44,6 +45,8 @@ def pus_factory_hook(raw_tm_packet: bytearray, tmtc_printer: TmTcPrinter):
tm_packet = Service8TM.unpack(raw_telemetry=raw_tm_packet)
if service_type == 17:
tm_packet = Service17TMExtended.unpack(raw_telemetry=raw_tm_packet)
if service_type == 200:
tm_packet = Service200TM.unpack(raw_telemetry=raw_tm_packet)
if tm_packet is None:
LOGGER.info(
f"The service {service_type} is not implemented in Telemetry Factory"