egse specific commands

This commit is contained in:
Jakob Meier 2022-02-05 15:44:50 +01:00
parent d9c71fa4b1
commit 199ffe1a32
2 changed files with 20 additions and 2 deletions

View File

@ -539,6 +539,8 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
"49": ("Star Tracker: Request limits", {OpCodeDictKeys.TIMEOUT: 2.0}), "49": ("Star Tracker: Request limits", {OpCodeDictKeys.TIMEOUT: 2.0}),
"50": ("Star Tracker: Request blob parameters", {OpCodeDictKeys.TIMEOUT: 2.0}), "50": ("Star Tracker: Request blob parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"51": ("Star Tracker: Set image processor parameters", {OpCodeDictKeys.TIMEOUT: 2.0}), "51": ("Star Tracker: Set image processor parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"52": ("Star Tracker: (EGSE only) Load image processor ground config ", {OpCodeDictKeys.TIMEOUT: 2.0}),
"53": ("Star Tracker: (EGSE only) Load image processor flight config", {OpCodeDictKeys.TIMEOUT: 2.0}),
} }
service_star_tracker_tuple = ("Star tracker", op_code_dict_srv_star_tracker) service_star_tracker_tuple = ("Star tracker", op_code_dict_srv_star_tracker)

View File

@ -76,7 +76,8 @@ class ImagePathDefs:
downloadFpgaImagePath = "/mnt/sd0/startracker" downloadFpgaImagePath = "/mnt/sd0/startracker"
downloadFpgaImageName = "testname" downloadFpgaImageName = "testname"
uploadFpgaImageName = "/mnt/sd0/startracker/fpga-image.bin" uploadFpgaImageName = "/mnt/sd0/startracker/fpga-image.bin"
egseGroundConfig = "/home/pi/arcsec/ground-config.json"
egseFlightConfig = "/home/pi/arcsec/flight-config.json"
class Region: class Region:
# Definition according to datasheet (which turned out to be partially faulty) # Definition according to datasheet (which turned out to be partially faulty)
@ -195,10 +196,13 @@ def pack_star_tracker_commands(
tc_queue.appendleft(command.pack_command_tuple()) tc_queue.appendleft(command.pack_command_tuple())
if op_code == "15": if op_code == "15":
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Download image")) tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Download image"))
path = input("Specify storage location (default - /mnt/sd0/startracker): ")
if not path:
path = ImagePathDefs.downloadPath
command = ( command = (
object_id object_id
+ struct.pack("!I", StarTrackerActionIds.DOWNLOAD_IMAGE) + struct.pack("!I", StarTrackerActionIds.DOWNLOAD_IMAGE)
+ bytearray(ImagePathDefs.downloadPath, "utf-8") + bytearray(path, "utf-8")
) )
command = PusTelecommand(service=8, subservice=128, ssc=53, app_data=command) command = PusTelecommand(service=8, subservice=128, ssc=53, app_data=command)
tc_queue.appendleft(command.pack_command_tuple()) tc_queue.appendleft(command.pack_command_tuple())
@ -506,6 +510,18 @@ def pack_star_tracker_commands(
bytearray(ImagePathDefs.jsonFile, 'utf-8') bytearray(ImagePathDefs.jsonFile, 'utf-8')
command = PusTelecommand(service=8, subservice=128, ssc=70, app_data=command) command = PusTelecommand(service=8, subservice=128, ssc=70, app_data=command)
tc_queue.appendleft(command.pack_command_tuple()) tc_queue.appendleft(command.pack_command_tuple())
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(ImagePathDefs.egseGroundConfig, 'utf-8')
command = PusTelecommand(service=8, subservice=128, ssc=71, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
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(ImagePathDefs.egseFlightConfig, 'utf-8')
command = PusTelecommand(service=8, subservice=128, ssc=72, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
def pack_write_command(object_id: bytearray) -> bytearray: def pack_write_command(object_id: bytearray) -> bytearray: