star tracker commands and input helper #36
24
.idea/runConfigurations/Star_Tracker.xml
generated
24
.idea/runConfigurations/Star_Tracker.xml
generated
@ -1,24 +0,0 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
|
||||||
<configuration default="false" name="Star Tracker" type="PythonConfigurationType" factoryName="Python" folderName="Devices">
|
|
||||||
<module name="tmtc" />
|
|
||||||
<option name="INTERPRETER_OPTIONS" value="" />
|
|
||||||
<option name="PARENT_ENVS" value="true" />
|
|
||||||
<envs>
|
|
||||||
<env name="PYTHONUNBUFFERED" value="1" />
|
|
||||||
</envs>
|
|
||||||
<option name="SDK_HOME" value="C:\Users\jakob\AppData\Local\Programs\Python\Python39\python.exe" />
|
|
||||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
|
||||||
<option name="IS_MODULE_SDK" value="false" />
|
|
||||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
|
||||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
|
||||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
|
||||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
|
|
||||||
<option name="PARAMETERS" value="-s star_tracker -l -t 6" />
|
|
||||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
|
||||||
<option name="EMULATE_TERMINAL" value="true" />
|
|
||||||
<option name="MODULE_MODE" value="false" />
|
|
||||||
<option name="REDIRECT_INPUT" value="false" />
|
|
||||||
<option name="INPUT_FILE" value="" />
|
|
||||||
<method v="2" />
|
|
||||||
</configuration>
|
|
||||||
</component>
|
|
@ -302,7 +302,10 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
|
|||||||
service_ploc_updater_tuple = ("Ploc Updater", op_code_dict_srv_ploc_updater)
|
service_ploc_updater_tuple = ("Ploc Updater", op_code_dict_srv_ploc_updater)
|
||||||
|
|
||||||
op_code_dict_srv_star_tracker = {
|
op_code_dict_srv_star_tracker = {
|
||||||
"0": ("Star Tracker: Mode On, Submode Bootloader", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"0": (
|
||||||
|
"Star Tracker: Mode On, Submode Bootloader",
|
||||||
|
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||||
|
),
|
||||||
"1": ("Star Tracker: Mode On, Submode Firmware", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"1": ("Star Tracker: Mode On, Submode Firmware", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
"2": ("Star Tracker: Mode Normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"2": ("Star Tracker: Mode Normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
"3": ("Star Tracker: Mode Off", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"3": ("Star Tracker: Mode Off", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
@ -316,7 +319,10 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
|
|||||||
"8": ("Star Tracker: Request version", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"8": ("Star Tracker: Request version", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
"9": ("Star Tracker: Request interface", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"9": ("Star Tracker: Request interface", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
"10": ("Star Tracker: Request power", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"10": ("Star Tracker: Request power", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
"11": ("Star Tracker: Subscribe to telemetry", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"11": (
|
||||||
|
"Star Tracker: Set subscription parameters",
|
||||||
|
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||||
|
),
|
||||||
"12": (
|
"12": (
|
||||||
"Star Tracker: Boot image (requires bootloader mode)",
|
"Star Tracker: Boot image (requires bootloader mode)",
|
||||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||||
@ -325,19 +331,23 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
|
|||||||
"14": ("Star Tracker: Request solution", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"14": ("Star Tracker: Request solution", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
"15": ("Star Tracker: Upload image", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"15": ("Star Tracker: Upload image", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
"16": ("Star Tracker: Download image", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"16": ("Star Tracker: Download image", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
"17": ("Star Tracker: Limits", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"17": ("Star Tracker: Set limit parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
"18": ("Star Tracker: Tracking", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"18": ("Star Tracker: Set tracking parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
"19": ("Star Tracker: Mounting", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"19": ("Star Tracker: Set mounting parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
"20": ("Star Tracker: Camera", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"20": ("Star Tracker: Set camera parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
"21": ("Star Tracker: Blob", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"22": (
|
||||||
"22": ("Star Tracker: Centroiding", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"Star Tracker: Set centroiding parameters",
|
||||||
"23": ("Star Tracker: LISA", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||||
"24": ("Star Tracker: Matching", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
),
|
||||||
"25": ("Star Tracker: Validation", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"23": ("Star Tracker: Set LISA parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
"26": ("Star Tracker: Algo", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"24": ("Star Tracker: Set matching parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
|
"25": (
|
||||||
|
"Star Tracker: Set validation parameters",
|
||||||
|
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||||
|
),
|
||||||
|
"26": ("Star Tracker: Set algo parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
"27": ("Star Tracker: Take image", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"27": ("Star Tracker: Take image", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
"28": ("Star Tracker: Stop str helper", {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": (
|
"30": (
|
||||||
"Star Tracker: Set name of download image",
|
"Star Tracker: Set name of download image",
|
||||||
{OpCodeDictKeys.TIMEOUT: 2.0},
|
{OpCodeDictKeys.TIMEOUT: 2.0},
|
||||||
@ -345,47 +355,74 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
|
|||||||
"31": ("Star Tracker: Request histogram", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"31": ("Star Tracker: Request histogram", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
"32": ("Star Tracker: Request contrast", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"32": ("Star Tracker: Request contrast", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
"33": ("Star Tracker: Set json filename", {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: Flash read", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
"35": ("Star Tracker: Read", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"36": ("Star Tracker: Set flash read filename", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
"36": ("Star Tracker: Set Read filename", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
|
||||||
"37": ("Star Tracker: Get checksum", {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},
|
|
||||||
),
|
|
||||||
"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},
|
|
||||||
),
|
|
||||||
"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}),
|
"49": ("Star Tracker: Request camera parameter", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
"50": ("Star Tracker: Request limits", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"50": ("Star Tracker: Request limits", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
"51": ("Star Tracker: Set image processor parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"51": (
|
||||||
"52": ("Star Tracker: (EGSE only) Load camera ground config ", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"Star Tracker: Set image processor parameters",
|
||||||
"53": ("Star Tracker: (EGSE only) Load camera flight config", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
{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}),
|
"52": (
|
||||||
"56": ("Star Tracker: Request image processor parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"Star Tracker: (EGSE only) Load camera ground config ",
|
||||||
"57": ("Star Tracker: Request centroiding parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
{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}),
|
"58": ("Star Tracker: Request lisa parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
"59": ("Star Tracker: Request matching parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"59": (
|
||||||
"60": ("Star Tracker: Request tracking parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"Star Tracker: Request matching parameters",
|
||||||
"61": ("Star Tracker: Request validation parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
{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}),
|
"62": ("Star Tracker: Request algo parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
"63": ("Star Tracker: Request subscription parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"63": (
|
||||||
"64": ("Star Tracker: Request log subscription parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"Star Tracker: Request subscription parameters",
|
||||||
"65": ("Star Tracker: Request debug camera parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
{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}),
|
"66": ("Star Tracker: Set log level parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
||||||
"67": ("Star Tracker: Set log subscription parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"67": (
|
||||||
"68": ("Star Tracker: Set debug camera parameters", {OpCodeDictKeys.TIMEOUT: 2.0}),
|
"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}),
|
"69": ("Star Tracker: Firmware update", {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)
|
||||||
|
@ -134,7 +134,9 @@ def pack_pdu1_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
|||||||
)
|
)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
if op_code == Pdu1OpCodes.SCEX_ON.value:
|
if op_code == Pdu1OpCodes.SCEX_ON.value:
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn Solar Cell Experiment on"))
|
tc_queue.appendleft(
|
||||||
|
(QueueCommands.PRINT, "PDU1: Turn Solar Cell Experiment on")
|
||||||
|
)
|
||||||
command = pack_set_param_command(
|
command = pack_set_param_command(
|
||||||
object_id,
|
object_id,
|
||||||
PDUConfigTable.out_en_5.parameter_address,
|
PDUConfigTable.out_en_5.parameter_address,
|
||||||
@ -143,7 +145,9 @@ def pack_pdu1_commands(object_id: bytearray, tc_queue: TcQueueT, op_code: str):
|
|||||||
)
|
)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
if op_code == Pdu1OpCodes.SCEX_OFF.value:
|
if op_code == Pdu1OpCodes.SCEX_OFF.value:
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn Solar Cell Experiment off"))
|
tc_queue.appendleft(
|
||||||
|
(QueueCommands.PRINT, "PDU1: Turn Solar Cell Experiment off")
|
||||||
|
)
|
||||||
command = pack_set_param_command(
|
command = pack_set_param_command(
|
||||||
object_id,
|
object_id,
|
||||||
PDUConfigTable.out_en_5.parameter_address,
|
PDUConfigTable.out_en_5.parameter_address,
|
||||||
|
@ -49,14 +49,14 @@ class StarTrackerActionIds:
|
|||||||
VALIDATION = 48
|
VALIDATION = 48
|
||||||
ALGO = 49
|
ALGO = 49
|
||||||
CHECKSUM = 50
|
CHECKSUM = 50
|
||||||
READ = 51
|
FLASH_READ = 51
|
||||||
WRITE = 52
|
FLASH_WRITE = 52
|
||||||
DOWNLOAD_MATCHED_STAR = 53
|
DOWNLOAD_MATCHED_STAR = 53
|
||||||
STOP_STR_HELPER = 55
|
STOP_STR_HELPER = 55
|
||||||
RESET_ERROR = 56
|
RESET_ERROR = 56
|
||||||
CHANGE_DOWNLOAD_IMAGE = 57
|
CHANGE_DOWNLOAD_IMAGE = 57
|
||||||
SET_JSON_FILE_NAME = 58
|
SET_JSON_FILE_NAME = 58
|
||||||
SET_READ_FILENAME = 59
|
SET_FLASH_READ_FILENAME = 59
|
||||||
SET_TIME = 60
|
SET_TIME = 60
|
||||||
DOWNLOAD_DBIMAGE = 61
|
DOWNLOAD_DBIMAGE = 61
|
||||||
DOWNLOAD_BLOBPIXEL = 62
|
DOWNLOAD_BLOBPIXEL = 62
|
||||||
@ -85,30 +85,31 @@ class StarTrackerActionIds:
|
|||||||
|
|
||||||
|
|
||||||
class FileDefs:
|
class FileDefs:
|
||||||
uploadFile = "/mnt/sd0/startracker/gemma.bin"
|
download_path = "/mnt/sd0/startracker"
|
||||||
downloadFile = "test_image.bin"
|
json_file = "/mnt/sd0/startracker/full.json"
|
||||||
downloadPath = "/mnt/sd0/startracker"
|
egse_ground_config = "/home/pi/arcsec/json/ground-config.json"
|
||||||
jsonFile = "/mnt/sd0/startracker/full.json"
|
egse_flight_config = "/home/pi/arcsec/json/flight-config.json"
|
||||||
flashFile = "/mnt/sd0/startracker/flash.bin"
|
egse_solution_upload_img_config = "/home/pi/arcsec/json/upload-image-solution.json"
|
||||||
flashReadPath = "/mnt/sd0/startracker"
|
egse_histogram_upload_img_config = (
|
||||||
uploadCentroidJson = "/mnt/sd0/startracker/upload-centroid.json"
|
"/home/pi/arcsec/json/upload-image-histogram.json"
|
||||||
downloadFpgaImagePath = "/mnt/sd0/startracker"
|
)
|
||||||
downloadFpgaImageName = "testname"
|
q7s_ground_config = "/mnt/sd0/startracker/json/ground-config.json"
|
||||||
uploadFpgaImageName = "/mnt/sd0/startracker/fpga-image.bin"
|
q7s_flight_config = "/mnt/sd0/startracker/flight-config.json"
|
||||||
egseGroundConfig = "/home/pi/arcsec/ground-config.json"
|
|
||||||
egseFlightConfig = "/home/pi/arcsec/flight-config.json"
|
|
||||||
q7sGroundConfig = "/mnt/sd0/startracker/ground-config.json"
|
|
||||||
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 = {
|
json_dict = {
|
||||||
"1": ["Q7S flight config", FileDefs.q7sFlightConfig],
|
"1": ["Q7S flight config", FileDefs.q7s_flight_config],
|
||||||
"2": ["Q7S ground config", FileDefs.q7sGroundConfig],
|
"2": ["Q7S ground config", FileDefs.q7s_ground_config],
|
||||||
"3": ["EGSE flight config", FileDefs.egseFlightConfig],
|
"3": ["EGSE flight config", FileDefs.egse_flight_config],
|
||||||
"4": ["EGSE ground config", FileDefs.egseGroundConfig]
|
"4": ["EGSE ground config", FileDefs.egse_ground_config],
|
||||||
|
"5": [
|
||||||
|
"EGSE get solution, upload image config",
|
||||||
|
FileDefs.egse_solution_upload_img_config,
|
||||||
|
],
|
||||||
|
"6": [
|
||||||
|
"EGSE get histogram, upload image config",
|
||||||
|
FileDefs.egse_solution_upload_img_config,
|
||||||
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
firmware_dict = {
|
firmware_dict = {
|
||||||
@ -117,20 +118,23 @@ firmware_dict = {
|
|||||||
"3": ["Firmware Origin", FileDefs.firmware_origin],
|
"3": ["Firmware Origin", FileDefs.firmware_origin],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
upload_image_dict = {
|
||||||
|
"1": ["q7s gemma", "/mnt/sd0/startracker/gemma.bin"],
|
||||||
|
"2": ["egse gemma", "/home/pi/arcsec/star-images/gemma.bin"],
|
||||||
|
"3": ["q7s polaris", "/mnt/sd0/startracker/polaris.bin"],
|
||||||
|
"4": ["egse polaris", "/home/pi/arcsec/star-images/polaris.bin"],
|
||||||
|
}
|
||||||
|
|
||||||
class Region:
|
|
||||||
|
class StartRegion:
|
||||||
# Definition according to datasheet (which turned out to be partially faulty)
|
# Definition according to datasheet (which turned out to be partially faulty)
|
||||||
BOOTLOADER = 0
|
BOOTLOADER = 0
|
||||||
STAR_TRACKER_FIRMWARE = 1
|
STAR_TRACKER_FIRMWARE = 1
|
||||||
FREE_1 = 2
|
|
||||||
FREE_2 = 3
|
|
||||||
|
|
||||||
|
|
||||||
class PartitionSize:
|
class PartitionSize:
|
||||||
BOOTLOADER = 128000
|
# Size of most recent firmware image
|
||||||
STAR_TRACKER_FIRMWARE = 896000
|
STAR_TRACKER_FIRMWARE = 464572
|
||||||
FREE_1 = 128000
|
|
||||||
FREE_2 = 896000
|
|
||||||
|
|
||||||
|
|
||||||
class Submode:
|
class Submode:
|
||||||
@ -149,12 +153,16 @@ def pack_star_tracker_commands(
|
|||||||
)
|
)
|
||||||
|
|
||||||
if op_code == "0":
|
if op_code == "0":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Mode On, Submode Bootloader"))
|
tc_queue.appendleft(
|
||||||
|
(QueueCommands.PRINT, "Star tracker: Mode On, Submode Bootloader")
|
||||||
|
)
|
||||||
command = pack_mode_data(object_id, Modes.ON, Submode.BOOTLOADER)
|
command = pack_mode_data(object_id, Modes.ON, Submode.BOOTLOADER)
|
||||||
command = PusTelecommand(service=200, subservice=1, ssc=9, app_data=command)
|
command = PusTelecommand(service=200, subservice=1, ssc=9, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
if op_code == "1":
|
if op_code == "1":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Mode On, Submode Firmware"))
|
tc_queue.appendleft(
|
||||||
|
(QueueCommands.PRINT, "Star tracker: Mode On, Submode Firmware")
|
||||||
|
)
|
||||||
command = pack_mode_data(object_id, Modes.ON, Submode.FIRMWARE)
|
command = pack_mode_data(object_id, Modes.ON, Submode.FIRMWARE)
|
||||||
command = PusTelecommand(service=200, subservice=1, ssc=10, app_data=command)
|
command = PusTelecommand(service=200, subservice=1, ssc=10, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
@ -211,11 +219,11 @@ def pack_star_tracker_commands(
|
|||||||
tc_queue.appendleft(
|
tc_queue.appendleft(
|
||||||
(QueueCommands.PRINT, "Star tracker: Set subscription parameters")
|
(QueueCommands.PRINT, "Star tracker: Set subscription parameters")
|
||||||
)
|
)
|
||||||
jsonfile = get_config_file()
|
json_file = get_config_file()
|
||||||
command = (
|
command = (
|
||||||
object_id
|
object_id
|
||||||
+ struct.pack("!I", StarTrackerActionIds.SUBSCRIPTION)
|
+ struct.pack("!I", StarTrackerActionIds.SUBSCRIPTION)
|
||||||
+ bytearray(jsonfile, "utf-8")
|
+ bytearray(json_file, "utf-8")
|
||||||
)
|
)
|
||||||
command = PusTelecommand(service=8, subservice=128, ssc=36, app_data=command)
|
command = PusTelecommand(service=8, subservice=128, ssc=36, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
@ -236,10 +244,11 @@ 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: Upload image"))
|
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Upload image"))
|
||||||
|
image = get_upload_image()
|
||||||
command = (
|
command = (
|
||||||
object_id
|
object_id
|
||||||
+ struct.pack("!I", StarTrackerActionIds.UPLOAD_IMAGE)
|
+ struct.pack("!I", StarTrackerActionIds.UPLOAD_IMAGE)
|
||||||
+ bytearray(FileDefs.uploadFile, "utf-8")
|
+ bytearray(image, "utf-8")
|
||||||
)
|
)
|
||||||
command = PusTelecommand(service=8, subservice=128, ssc=40, app_data=command)
|
command = PusTelecommand(service=8, subservice=128, ssc=40, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
@ -247,7 +256,7 @@ def pack_star_tracker_commands(
|
|||||||
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): ")
|
path = input("Specify storage location (default - /mnt/sd0/startracker): ")
|
||||||
if not path:
|
if not path:
|
||||||
path = FileDefs.downloadPath
|
path = FileDefs.download_path
|
||||||
command = (
|
command = (
|
||||||
object_id
|
object_id
|
||||||
+ struct.pack("!I", StarTrackerActionIds.DOWNLOAD_IMAGE)
|
+ struct.pack("!I", StarTrackerActionIds.DOWNLOAD_IMAGE)
|
||||||
@ -257,10 +266,11 @@ def pack_star_tracker_commands(
|
|||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
if op_code == "17":
|
if op_code == "17":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Set limits"))
|
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Set limits"))
|
||||||
|
json_file = get_config_file()
|
||||||
command = (
|
command = (
|
||||||
object_id
|
object_id
|
||||||
+ struct.pack("!I", StarTrackerActionIds.LIMITS)
|
+ struct.pack("!I", StarTrackerActionIds.LIMITS)
|
||||||
+ bytearray(FileDefs.jsonFile, "utf-8")
|
+ bytearray(json_file, "utf-8")
|
||||||
)
|
)
|
||||||
command = PusTelecommand(service=8, subservice=128, ssc=42, app_data=command)
|
command = PusTelecommand(service=8, subservice=128, ssc=42, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
@ -268,89 +278,87 @@ def pack_star_tracker_commands(
|
|||||||
tc_queue.appendleft(
|
tc_queue.appendleft(
|
||||||
(QueueCommands.PRINT, "Star tracker: Set tracking parameters")
|
(QueueCommands.PRINT, "Star tracker: Set tracking parameters")
|
||||||
)
|
)
|
||||||
|
json_file = get_config_file()
|
||||||
command = (
|
command = (
|
||||||
object_id
|
object_id
|
||||||
+ struct.pack("!I", StarTrackerActionIds.TRACKING)
|
+ struct.pack("!I", StarTrackerActionIds.TRACKING)
|
||||||
+ bytearray(FileDefs.jsonFile, "utf-8")
|
+ bytearray(json_file, "utf-8")
|
||||||
)
|
)
|
||||||
command = PusTelecommand(service=8, subservice=128, ssc=43, app_data=command)
|
command = PusTelecommand(service=8, subservice=128, ssc=43, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
if op_code == "19":
|
if op_code == "19":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Mounting"))
|
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Mounting"))
|
||||||
|
json_file = get_config_file()
|
||||||
command = (
|
command = (
|
||||||
object_id
|
object_id
|
||||||
+ struct.pack("!I", StarTrackerActionIds.MOUNTING)
|
+ struct.pack("!I", StarTrackerActionIds.MOUNTING)
|
||||||
+ bytearray(FileDefs.jsonFile, "utf-8")
|
+ bytearray(json_file, "utf-8")
|
||||||
)
|
)
|
||||||
command = PusTelecommand(service=8, subservice=128, ssc=44, app_data=command)
|
command = PusTelecommand(service=8, subservice=128, ssc=44, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
if op_code == "20":
|
if op_code == "20":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Camera"))
|
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Camera"))
|
||||||
|
json_file = get_config_file()
|
||||||
command = (
|
command = (
|
||||||
object_id
|
object_id
|
||||||
+ struct.pack("!I", StarTrackerActionIds.CAMERA)
|
+ struct.pack("!I", StarTrackerActionIds.CAMERA)
|
||||||
+ bytearray(FileDefs.jsonFile, "utf-8")
|
+ bytearray(json_file, "utf-8")
|
||||||
)
|
)
|
||||||
command = PusTelecommand(service=8, subservice=128, ssc=45, app_data=command)
|
command = PusTelecommand(service=8, subservice=128, ssc=45, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
if op_code == "21":
|
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Blob"))
|
|
||||||
command = (
|
|
||||||
object_id
|
|
||||||
+ struct.pack("!I", StarTrackerActionIds.BLOB)
|
|
||||||
+ bytearray(FileDefs.jsonFile, "utf-8")
|
|
||||||
)
|
|
||||||
command = PusTelecommand(service=8, subservice=128, ssc=46, app_data=command)
|
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
|
||||||
if op_code == "22":
|
if op_code == "22":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Centroiding"))
|
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Centroiding"))
|
||||||
|
json_file = get_config_file()
|
||||||
command = (
|
command = (
|
||||||
object_id
|
object_id
|
||||||
+ struct.pack("!I", StarTrackerActionIds.CENTROIDING)
|
+ struct.pack("!I", StarTrackerActionIds.CENTROIDING)
|
||||||
+ bytearray(FileDefs.jsonFile, "utf-8")
|
+ bytearray(json_file, "utf-8")
|
||||||
)
|
)
|
||||||
command = PusTelecommand(service=8, subservice=128, ssc=47, app_data=command)
|
command = PusTelecommand(service=8, subservice=128, ssc=47, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
if op_code == "23":
|
if op_code == "23":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: LISA"))
|
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: LISA"))
|
||||||
|
json_file = get_config_file()
|
||||||
command = (
|
command = (
|
||||||
object_id
|
object_id
|
||||||
+ struct.pack("!I", StarTrackerActionIds.LISA)
|
+ struct.pack("!I", StarTrackerActionIds.LISA)
|
||||||
+ bytearray(FileDefs.jsonFile, "utf-8")
|
+ bytearray(json_file, "utf-8")
|
||||||
)
|
)
|
||||||
command = PusTelecommand(service=8, subservice=128, ssc=48, app_data=command)
|
command = PusTelecommand(service=8, subservice=128, ssc=48, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
if op_code == "24":
|
if op_code == "24":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Matching"))
|
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Matching"))
|
||||||
|
json_file = get_config_file()
|
||||||
command = (
|
command = (
|
||||||
object_id
|
object_id
|
||||||
+ struct.pack("!I", StarTrackerActionIds.MATCHING)
|
+ struct.pack("!I", StarTrackerActionIds.MATCHING)
|
||||||
+ bytearray(FileDefs.jsonFile, "utf-8")
|
+ bytearray(json_file, "utf-8")
|
||||||
)
|
)
|
||||||
command = PusTelecommand(service=8, subservice=128, ssc=49, app_data=command)
|
command = PusTelecommand(service=8, subservice=128, ssc=49, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
if op_code == "25":
|
if op_code == "25":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Validation"))
|
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Validation"))
|
||||||
|
json_file = get_config_file()
|
||||||
command = (
|
command = (
|
||||||
object_id
|
object_id
|
||||||
+ struct.pack("!I", StarTrackerActionIds.VALIDATION)
|
+ struct.pack("!I", StarTrackerActionIds.VALIDATION)
|
||||||
+ bytearray(FileDefs.jsonFile, "utf-8")
|
+ bytearray(json_file, "utf-8")
|
||||||
)
|
)
|
||||||
command = PusTelecommand(service=8, subservice=128, ssc=50, app_data=command)
|
command = PusTelecommand(service=8, subservice=128, ssc=50, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
if op_code == "26":
|
if op_code == "26":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Algo"))
|
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Algo"))
|
||||||
jsonfile = get_config_file()
|
json_file = get_config_file()
|
||||||
command = (
|
command = (
|
||||||
object_id
|
object_id
|
||||||
+ struct.pack("!I", StarTrackerActionIds.ALGO)
|
+ struct.pack("!I", StarTrackerActionIds.ALGO)
|
||||||
+ bytearray(jsonfile, "utf-8")
|
+ bytearray(json_file, "utf-8")
|
||||||
)
|
)
|
||||||
command = PusTelecommand(service=8, subservice=128, ssc=51, app_data=command)
|
command = PusTelecommand(service=8, subservice=128, ssc=51, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
if op_code == "27":
|
if op_code == "27":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Take image"))
|
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Take image"))
|
||||||
actionid = int(input("Specify parameter ID (nominal - 4): "))
|
actionid = int(input("Specify parameter ID (take image - 4): "))
|
||||||
command = (
|
command = (
|
||||||
object_id
|
object_id
|
||||||
+ struct.pack("!I", StarTrackerActionIds.TAKE_IMAGE)
|
+ struct.pack("!I", StarTrackerActionIds.TAKE_IMAGE)
|
||||||
@ -363,11 +371,6 @@ def pack_star_tracker_commands(
|
|||||||
command = object_id + struct.pack("!I", StarTrackerActionIds.STOP_STR_HELPER)
|
command = object_id + struct.pack("!I", StarTrackerActionIds.STOP_STR_HELPER)
|
||||||
command = PusTelecommand(service=8, subservice=128, ssc=54, app_data=command)
|
command = PusTelecommand(service=8, subservice=128, ssc=54, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
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 == "30":
|
if op_code == "30":
|
||||||
tc_queue.appendleft(
|
tc_queue.appendleft(
|
||||||
(QueueCommands.PRINT, "Star tracker: Set name of download image")
|
(QueueCommands.PRINT, "Star tracker: Set name of download image")
|
||||||
@ -392,29 +395,27 @@ def pack_star_tracker_commands(
|
|||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
if op_code == "33":
|
if op_code == "33":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Set json filename"))
|
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Set json filename"))
|
||||||
|
json_file = get_config_file()
|
||||||
command = (
|
command = (
|
||||||
object_id
|
object_id
|
||||||
+ struct.pack("!I", StarTrackerActionIds.SET_JSON_FILE_NAME)
|
+ struct.pack("!I", StarTrackerActionIds.SET_JSON_FILE_NAME)
|
||||||
+ bytearray(FileDefs.jsonFile, "utf-8")
|
+ bytearray(json_file, "utf-8")
|
||||||
)
|
)
|
||||||
command = PusTelecommand(service=8, subservice=128, ssc=57, app_data=command)
|
command = PusTelecommand(service=8, subservice=128, ssc=57, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
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 == "35":
|
if op_code == "35":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Read"))
|
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Flash read"))
|
||||||
command = pack_read_command(object_id)
|
command = pack_read_command(object_id)
|
||||||
command = PusTelecommand(service=8, subservice=128, ssc=59, app_data=command)
|
command = PusTelecommand(service=8, subservice=128, ssc=59, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
if op_code == "36":
|
if op_code == "36":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Set read filename"))
|
tc_queue.appendleft(
|
||||||
|
(QueueCommands.PRINT, "Star tracker: Set flash read filename")
|
||||||
|
)
|
||||||
filename = input("Specify filename: ")
|
filename = input("Specify filename: ")
|
||||||
command = (
|
command = (
|
||||||
object_id
|
object_id
|
||||||
+ StarTrackerActionIds.SET_READ_FILENAME
|
+ struct.pack("!I", StarTrackerActionIds.SET_FLASH_READ_FILENAME)
|
||||||
+ bytearray(filename, "utf-8")
|
+ bytearray(filename, "utf-8")
|
||||||
)
|
)
|
||||||
command = PusTelecommand(service=8, subservice=128, ssc=60, app_data=command)
|
command = PusTelecommand(service=8, subservice=128, ssc=60, app_data=command)
|
||||||
@ -444,15 +445,6 @@ def pack_star_tracker_commands(
|
|||||||
)
|
)
|
||||||
command = PusTelecommand(service=8, subservice=128, ssc=62, app_data=command)
|
command = PusTelecommand(service=8, subservice=128, ssc=62, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
if op_code == "40":
|
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Upload Centroid"))
|
|
||||||
command = (
|
|
||||||
object_id
|
|
||||||
+ struct.pack("!I", StarTrackerActionIds.UPLOAD_CENTROID)
|
|
||||||
+ bytearray(FileDefs.uploadCentroidJson, "utf-8")
|
|
||||||
)
|
|
||||||
command = PusTelecommand(service=8, subservice=128, ssc=63, app_data=command)
|
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
|
||||||
if op_code == "41":
|
if op_code == "41":
|
||||||
tc_queue.appendleft(
|
tc_queue.appendleft(
|
||||||
(QueueCommands.PRINT, "Star tracker: Download matched star")
|
(QueueCommands.PRINT, "Star tracker: Download matched star")
|
||||||
@ -548,145 +540,223 @@ def pack_star_tracker_commands(
|
|||||||
command = PusTelecommand(service=8, subservice=128, ssc=72, app_data=command)
|
command = PusTelecommand(service=8, subservice=128, ssc=72, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
if op_code == "51":
|
if op_code == "51":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Set image processor parameters"))
|
tc_queue.appendleft(
|
||||||
command = object_id + struct.pack('!I', StarTrackerActionIds.IMAGE_PROCESSOR) + \
|
(QueueCommands.PRINT, "Star tracker: Set image processor parameters")
|
||||||
bytearray(FileDefs.jsonFile, 'utf-8')
|
)
|
||||||
|
json_file = get_config_file()
|
||||||
|
command = (
|
||||||
|
object_id
|
||||||
|
+ struct.pack("!I", StarTrackerActionIds.IMAGE_PROCESSOR)
|
||||||
|
+ bytearray(json_file, "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":
|
if op_code == "52":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: EGSE load ground config camera parameters"))
|
tc_queue.appendleft(
|
||||||
command = object_id + struct.pack('!I', StarTrackerActionIds.CAMERA) + \
|
(
|
||||||
bytearray(FileDefs.egseGroundConfig, 'utf-8')
|
QueueCommands.PRINT,
|
||||||
|
"Star tracker: EGSE load ground config camera parameters",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
command = (
|
||||||
|
object_id
|
||||||
|
+ struct.pack("!I", StarTrackerActionIds.CAMERA)
|
||||||
|
+ bytearray(FileDefs.egse_ground_config, "utf-8")
|
||||||
|
)
|
||||||
command = PusTelecommand(service=8, subservice=128, ssc=71, app_data=command)
|
command = PusTelecommand(service=8, subservice=128, ssc=71, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
if op_code == "53":
|
if op_code == "53":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: EGSE load flight config camera parameters"))
|
tc_queue.appendleft(
|
||||||
command = object_id + struct.pack('!I', StarTrackerActionIds.CAMERA) + \
|
(
|
||||||
bytearray(FileDefs.egseFlightConfig, 'utf-8')
|
QueueCommands.PRINT,
|
||||||
|
"Star tracker: EGSE load flight config camera parameters",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
command = (
|
||||||
|
object_id
|
||||||
|
+ struct.pack("!I", StarTrackerActionIds.CAMERA)
|
||||||
|
+ bytearray(FileDefs.egse_flight_config, "utf-8")
|
||||||
|
)
|
||||||
command = PusTelecommand(service=8, subservice=128, ssc=72, app_data=command)
|
command = PusTelecommand(service=8, subservice=128, ssc=72, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
if op_code == "54":
|
if op_code == "54":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request log level parameters"))
|
tc_queue.appendleft(
|
||||||
command = object_id + struct.pack('!I', StarTrackerActionIds.REQ_LOG_LEVEL)
|
(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)
|
command = PusTelecommand(service=8, subservice=128, ssc=74, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
if op_code == "55":
|
if op_code == "55":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request mounting parameters"))
|
tc_queue.appendleft(
|
||||||
command = object_id + struct.pack('!I', StarTrackerActionIds.REQ_MOUNTING)
|
(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)
|
command = PusTelecommand(service=8, subservice=128, ssc=75, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
if op_code == "56":
|
if op_code == "56":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request image processor parameters"))
|
tc_queue.appendleft(
|
||||||
command = object_id + struct.pack('!I', StarTrackerActionIds.REQ_IMAGE_PROCESSOR)
|
(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)
|
command = PusTelecommand(service=8, subservice=128, ssc=76, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
if op_code == "57":
|
if op_code == "57":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request centroiding parameters"))
|
tc_queue.appendleft(
|
||||||
command = object_id + struct.pack('!I', StarTrackerActionIds.REQ_CENTROIDING)
|
(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)
|
command = PusTelecommand(service=8, subservice=128, ssc=75, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
if op_code == "58":
|
if op_code == "58":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request lisa parameters"))
|
tc_queue.appendleft(
|
||||||
command = object_id + struct.pack('!I', StarTrackerActionIds.REQ_LISA)
|
(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)
|
command = PusTelecommand(service=8, subservice=128, ssc=76, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
if op_code == "59":
|
if op_code == "59":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request matching parameters"))
|
tc_queue.appendleft(
|
||||||
command = object_id + struct.pack('!I', StarTrackerActionIds.REQ_MATCHING)
|
(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)
|
command = PusTelecommand(service=8, subservice=128, ssc=77, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
if op_code == "60":
|
if op_code == "60":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request tracking parameters"))
|
tc_queue.appendleft(
|
||||||
command = object_id + struct.pack('!I', StarTrackerActionIds.REQ_TRACKING)
|
(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)
|
command = PusTelecommand(service=8, subservice=128, ssc=78, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
if op_code == "61":
|
if op_code == "61":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request validation parameters"))
|
tc_queue.appendleft(
|
||||||
command = object_id + struct.pack('!I', StarTrackerActionIds.REQ_VALIDATION)
|
(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)
|
command = PusTelecommand(service=8, subservice=128, ssc=79, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
if op_code == "62":
|
if op_code == "62":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request algo parameters"))
|
tc_queue.appendleft(
|
||||||
command = object_id + struct.pack('!I', StarTrackerActionIds.REQ_ALGO)
|
(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)
|
command = PusTelecommand(service=8, subservice=128, ssc=80, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
if op_code == "63":
|
if op_code == "63":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request subscription parameters"))
|
tc_queue.appendleft(
|
||||||
command = object_id + struct.pack('!I', StarTrackerActionIds.REQ_SUBSCRIPTION)
|
(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)
|
command = PusTelecommand(service=8, subservice=128, ssc=81, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
if op_code == "64":
|
if op_code == "64":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request log subscription parameters"))
|
tc_queue.appendleft(
|
||||||
command = object_id + struct.pack('!I', StarTrackerActionIds.REQ_LOG_SUBSCRIPTION)
|
(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)
|
command = PusTelecommand(service=8, subservice=128, ssc=82, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
if op_code == "65":
|
if op_code == "65":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request debug camera parameters"))
|
tc_queue.appendleft(
|
||||||
command = object_id + struct.pack('!I', StarTrackerActionIds.REQ_DEBUG_CAMERA)
|
(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)
|
command = PusTelecommand(service=8, subservice=128, ssc=83, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
if op_code == "66":
|
if op_code == "66":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Set log level parameters"))
|
tc_queue.appendleft(
|
||||||
jsonfile = get_config_file()
|
(QueueCommands.PRINT, "Star tracker: Set log level parameters")
|
||||||
command = object_id + struct.pack('!I', StarTrackerActionIds.LOGLEVEL) + bytearray(jsonfile, "utf-8")
|
)
|
||||||
|
json_file = get_config_file()
|
||||||
|
command = (
|
||||||
|
object_id
|
||||||
|
+ struct.pack("!I", StarTrackerActionIds.LOGLEVEL)
|
||||||
|
+ bytearray(json_file, "utf-8")
|
||||||
|
)
|
||||||
command = PusTelecommand(service=8, subservice=128, ssc=84, app_data=command)
|
command = PusTelecommand(service=8, subservice=128, ssc=84, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
if op_code == "67":
|
if op_code == "67":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Set log subscription parameters"))
|
tc_queue.appendleft(
|
||||||
jsonfile = get_config_file()
|
(QueueCommands.PRINT, "Star tracker: Set log subscription parameters")
|
||||||
command = object_id + struct.pack('!I', StarTrackerActionIds.LOG_SUBSCRIPTION) + bytearray(jsonfile, "utf-8")
|
)
|
||||||
|
json_file = get_config_file()
|
||||||
|
command = (
|
||||||
|
object_id
|
||||||
|
+ struct.pack("!I", StarTrackerActionIds.LOG_SUBSCRIPTION)
|
||||||
|
+ bytearray(json_file, "utf-8")
|
||||||
|
)
|
||||||
command = PusTelecommand(service=8, subservice=128, ssc=85, app_data=command)
|
command = PusTelecommand(service=8, subservice=128, ssc=85, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
if op_code == "68":
|
if op_code == "68":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Set debug camera parameters"))
|
tc_queue.appendleft(
|
||||||
jsonfile = get_config_file()
|
(QueueCommands.PRINT, "Star tracker: Set debug camera parameters")
|
||||||
command = object_id + struct.pack('!I', StarTrackerActionIds.DEBUG_CAMERA) + bytearray(jsonfile, "utf-8")
|
)
|
||||||
|
json_file = get_config_file()
|
||||||
|
command = (
|
||||||
|
object_id
|
||||||
|
+ struct.pack("!I", StarTrackerActionIds.DEBUG_CAMERA)
|
||||||
|
+ bytearray(json_file, "utf-8")
|
||||||
|
)
|
||||||
command = PusTelecommand(service=8, subservice=128, ssc=86, app_data=command)
|
command = PusTelecommand(service=8, subservice=128, ssc=86, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
if op_code == "69":
|
if op_code == "69":
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Firmware update"))
|
tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Firmware update"))
|
||||||
firmware = get_firmware()
|
firmware = get_firmware()
|
||||||
command = object_id + struct.pack('!I', StarTrackerActionIds.FIRMWARE_UPDATE) + bytearray(firmware, "utf-8")
|
command = (
|
||||||
|
object_id
|
||||||
|
+ struct.pack("!I", StarTrackerActionIds.FIRMWARE_UPDATE)
|
||||||
|
+ bytearray(firmware, "utf-8")
|
||||||
|
)
|
||||||
command = PusTelecommand(service=8, subservice=128, ssc=87, app_data=command)
|
command = PusTelecommand(service=8, subservice=128, ssc=87, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
|
if op_code == "70":
|
||||||
|
tc_queue.appendleft(
|
||||||
|
(QueueCommands.PRINT, "Star tracker: Disable timestamp generation")
|
||||||
|
)
|
||||||
|
command = object_id + struct.pack(
|
||||||
|
"!I", StarTrackerActionIds.DISBALE_TIMESTAMP_GENERATION
|
||||||
|
)
|
||||||
|
command = PusTelecommand(service=8, subservice=128, ssc=88, app_data=command)
|
||||||
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
|
if op_code == "71":
|
||||||
|
tc_queue.appendleft(
|
||||||
|
(QueueCommands.PRINT, "Star tracker: Enable timestamp generation")
|
||||||
|
)
|
||||||
|
command = object_id + struct.pack(
|
||||||
|
"!I", StarTrackerActionIds.ENABLE_TIMESTAMP_GENERATION
|
||||||
|
)
|
||||||
|
command = PusTelecommand(service=8, subservice=128, ssc=89, app_data=command)
|
||||||
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
|
|
||||||
|
|
||||||
def pack_write_command(object_id: bytearray) -> bytearray:
|
|
||||||
region = Region.FREE_1
|
|
||||||
address = 0
|
|
||||||
command = (
|
|
||||||
object_id
|
|
||||||
+ struct.pack("!I", StarTrackerActionIds.WRITE)
|
|
||||||
+ struct.pack("!B", region)
|
|
||||||
+ struct.pack("!I", address)
|
|
||||||
+ bytearray(FileDefs.flashFile, "utf-8")
|
|
||||||
)
|
|
||||||
return command
|
|
||||||
|
|
||||||
|
|
||||||
def pack_read_command(object_id: bytearray) -> bytearray:
|
def pack_read_command(object_id: bytearray) -> bytearray:
|
||||||
region = Region.STAR_TRACKER_FIRMWARE
|
start_region = StartRegion.STAR_TRACKER_FIRMWARE
|
||||||
address = 0
|
|
||||||
size = PartitionSize.STAR_TRACKER_FIRMWARE
|
size = PartitionSize.STAR_TRACKER_FIRMWARE
|
||||||
|
path = input("Specify storage location (default - /mnt/sd0/startracker): ")
|
||||||
|
if not path:
|
||||||
|
path = FileDefs.download_path
|
||||||
command = (
|
command = (
|
||||||
object_id
|
object_id
|
||||||
+ struct.pack("!I", StarTrackerActionIds.READ)
|
+ struct.pack("!I", StarTrackerActionIds.FLASH_READ)
|
||||||
+ struct.pack("!B", region)
|
+ struct.pack("!B", start_region)
|
||||||
+ struct.pack("!I", address)
|
|
||||||
+ struct.pack("!I", size)
|
+ struct.pack("!I", size)
|
||||||
+ bytearray(FileDefs.flashReadPath, "utf-8")
|
+ bytearray(path, "utf-8")
|
||||||
)
|
)
|
||||||
return command
|
return command
|
||||||
|
|
||||||
|
|
||||||
def pack_checksum_command(object_id: bytearray) -> bytearray:
|
def pack_checksum_command(object_id: bytearray) -> bytearray:
|
||||||
region = Region.STAR_TRACKER_FIRMWARE
|
start_region = StartRegion.STAR_TRACKER_FIRMWARE
|
||||||
address = 0
|
address = 0
|
||||||
size = PartitionSize.STAR_TRACKER_FIRMWARE
|
size = PartitionSize.STAR_TRACKER_FIRMWARE
|
||||||
command = (
|
command = (
|
||||||
object_id
|
object_id
|
||||||
+ struct.pack("!I", StarTrackerActionIds.CHECKSUM)
|
+ struct.pack("!I", StarTrackerActionIds.CHECKSUM)
|
||||||
+ struct.pack("!B", region)
|
+ struct.pack("!B", start_region)
|
||||||
+ struct.pack("!I", address)
|
+ struct.pack("!I", address)
|
||||||
+ struct.pack("!I", size)
|
+ struct.pack("!I", size)
|
||||||
)
|
)
|
||||||
@ -697,8 +767,8 @@ 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()
|
||||||
jsonfile = json_dict[key][1]
|
json_file = json_dict[key][1]
|
||||||
return jsonfile
|
return json_file
|
||||||
|
|
||||||
|
|
||||||
def get_firmware() -> str:
|
def get_firmware() -> str:
|
||||||
@ -707,3 +777,11 @@ def get_firmware() -> str:
|
|||||||
key = input_helper.get_key()
|
key = input_helper.get_key()
|
||||||
firmware = firmware_dict[key][1]
|
firmware = firmware_dict[key][1]
|
||||||
return firmware
|
return firmware
|
||||||
|
|
||||||
|
|
||||||
|
def get_upload_image() -> str:
|
||||||
|
LOGGER.info("Specify image to upload")
|
||||||
|
input_helper = InputHelper(upload_image_dict)
|
||||||
|
key = input_helper.get_key()
|
||||||
|
image = upload_image_dict[key][1]
|
||||||
|
return image
|
||||||
|
@ -12,17 +12,16 @@ LOGGER = get_console_logger()
|
|||||||
|
|
||||||
|
|
||||||
class InputHelper:
|
class InputHelper:
|
||||||
|
|
||||||
def __init__(self, menu: dict):
|
def __init__(self, menu: dict):
|
||||||
"""
|
"""
|
||||||
@brief Constructor
|
@brief Constructor
|
||||||
@param menu The describing the input options
|
@param menu The menu describing the input options
|
||||||
"""
|
"""
|
||||||
self.menu = menu
|
self.menu = menu
|
||||||
|
|
||||||
def get_key(self) -> str:
|
def get_key(self) -> str:
|
||||||
"""
|
"""
|
||||||
@brief Ask the user for input and returns the chosen key
|
@brief Asks the user for input and returns the chosen key
|
||||||
"""
|
"""
|
||||||
key = self.menu_handler()
|
key = self.menu_handler()
|
||||||
while key not in self.menu:
|
while key not in self.menu:
|
||||||
@ -45,5 +44,3 @@ class InputHelper:
|
|||||||
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
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user