oh no where did all the commands go
All checks were successful
EIVE/-/pipeline/pr-main This commit looks good
All checks were successful
EIVE/-/pipeline/pr-main This commit looks good
This commit is contained in:
parent
dbfe1dc0d5
commit
c12dfd06d8
@ -16,7 +16,13 @@ from eive_tmtc.utility.input_helper import InputHelper
|
||||
from spacepackets.ecss.tc import PusTelecommand
|
||||
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
|
||||
from tmtccmd.config.tmtc import tmtc_definitions_provider
|
||||
from tmtccmd.tc.pus_3_fsfw_hk import create_request_one_diag_command, make_sid
|
||||
from tmtccmd.tc.pus_3_fsfw_hk import (
|
||||
create_request_one_diag_command,
|
||||
create_request_one_hk_command,
|
||||
enable_periodic_hk_command_with_interval,
|
||||
disable_periodic_hk_command,
|
||||
make_sid,
|
||||
)
|
||||
from tmtccmd.tc import DefaultPusQueueHelper
|
||||
from tmtccmd.tc.pus_200_fsfw_mode import pack_mode_data, Mode
|
||||
from tmtccmd.util import ObjectIdU32
|
||||
@ -98,7 +104,9 @@ class OpCodes:
|
||||
NORMAL = "nml"
|
||||
OFF = "off"
|
||||
PING = "ping"
|
||||
REQUEST_SOLUTION_SET_HK = "hk_req_sol"
|
||||
ONE_SHOOT_HK = "one_shoot_hk"
|
||||
ENABLE_HK = "enable_hk"
|
||||
DISABLE_HK = "disable_hk"
|
||||
REQUEST_SOLUTION_SET_ACTION = "action_req_sol"
|
||||
TAKE_IMAGE = "take_image"
|
||||
UPLOAD_IMAGE = "upload_image"
|
||||
@ -108,7 +116,9 @@ class OpCodes:
|
||||
|
||||
|
||||
class Info:
|
||||
REQUEST_SOLUTION_SET_HK = "Request Solution Set HK once"
|
||||
ONE_SHOOT_HK = "One shoot HK Set"
|
||||
ENABLE_HK = "Enable Periodic HK"
|
||||
DISABLE_HK = "Disable Periodic HK"
|
||||
REQUEST_SOLUTION_SET_ACTION = "Request Solution Set Action"
|
||||
UPLOAD_IMAGE = "Upload Image"
|
||||
TAKE_IMAGE = "Take Image"
|
||||
@ -137,6 +147,12 @@ class SetId(enum.IntEnum):
|
||||
CENTROIDS = 94
|
||||
|
||||
|
||||
class DataSetRequest(enum.IntEnum):
|
||||
ONESHOT = 0
|
||||
ENABLE = 1
|
||||
DISABLE = 2
|
||||
|
||||
|
||||
class FileDefs:
|
||||
download_path = "/mnt/sd0/startracker"
|
||||
json_file = "/mnt/sd0/startracker/full.json"
|
||||
@ -233,9 +249,15 @@ def pack_star_tracker_commands( # noqa C901
|
||||
q.add_log_cmd("Star tracker: Mode Off")
|
||||
data = pack_mode_data(prompt_object_id_mode_cmd(), Mode.OFF, 0)
|
||||
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=data))
|
||||
if op_code == OpCodes.REQUEST_SOLUTION_SET_HK:
|
||||
q.add_log_cmd(Info.REQUEST_SOLUTION_SET_HK)
|
||||
q.add_pus_tc(create_request_one_diag_command(make_sid(obyt, SetId.SOLUTION)))
|
||||
if op_code == OpCodes.ONE_SHOOT_HK:
|
||||
q.add_log_cmd(Info.ONE_SHOOT_HK)
|
||||
request_dataset(q, DataSetRequest.ONESHOT)
|
||||
if op_code == OpCodes.ENABLE_HK:
|
||||
q.add_log_cmd(Info.ENABLE_HK)
|
||||
request_dataset(q, DataSetRequest.ENABLE)
|
||||
if op_code == OpCodes.DISABLE_HK:
|
||||
q.add_log_cmd(Info.DISABLE_HK)
|
||||
request_dataset(q, DataSetRequest.DISABLE)
|
||||
if op_code == OpCodes.REQUEST_SOLUTION_SET_ACTION:
|
||||
q.add_log_cmd("Star tracker: Request solution")
|
||||
data = obyt + struct.pack("!I", StarTrackerActionId.REQ_SOLUTION)
|
||||
@ -621,6 +643,77 @@ def pack_star_tracker_commands( # noqa C901
|
||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
|
||||
|
||||
|
||||
def request_dataset(q: DefaultPusQueueHelper, type: DataSetRequest):
|
||||
for val in SetId:
|
||||
print("{:<2}: {:<20}".format(val, val.name))
|
||||
setId = int(input("Specify the dataset \n" ""))
|
||||
match type:
|
||||
case DataSetRequest.ONESHOT:
|
||||
if setId in [SetId.SOLUTION]:
|
||||
q.add_pus_tc(
|
||||
create_request_one_diag_command(make_sid(STAR_TRACKER_ID, setId))
|
||||
)
|
||||
elif setId in [
|
||||
SetId.AUTO_BLOB,
|
||||
SetId.MATCHED_CENTROIDS,
|
||||
SetId.BLOB,
|
||||
SetId.BLOBS,
|
||||
SetId.CENTROID,
|
||||
SetId.CENTROIDS,
|
||||
]:
|
||||
q.add_pus_tc(
|
||||
create_request_one_hk_command(make_sid(STAR_TRACKER_ID, setId))
|
||||
)
|
||||
else:
|
||||
print("Not Implemented Yet")
|
||||
case DataSetRequest.ENABLE:
|
||||
interval = float(
|
||||
input("Please specify interval in floating point seconds: ")
|
||||
)
|
||||
if setId in [SetId.SOLUTION]:
|
||||
cmd_tuple = enable_periodic_hk_command_with_interval(
|
||||
True, make_sid(STAR_TRACKER_ID, setId), interval
|
||||
)
|
||||
q.add_pus_tc(cmd_tuple[0])
|
||||
q.add_pus_tc(cmd_tuple[1])
|
||||
elif setId in [
|
||||
SetId.AUTO_BLOB,
|
||||
SetId.MATCHED_CENTROIDS,
|
||||
SetId.BLOB,
|
||||
SetId.BLOBS,
|
||||
SetId.CENTROID,
|
||||
SetId.CENTROIDS,
|
||||
]:
|
||||
cmd_tuple = enable_periodic_hk_command_with_interval(
|
||||
False, make_sid(STAR_TRACKER_ID, setId), interval
|
||||
)
|
||||
q.add_pus_tc(cmd_tuple[0])
|
||||
q.add_pus_tc(cmd_tuple[1])
|
||||
else:
|
||||
print("Not Implemented Yet")
|
||||
case DataSetRequest.DISABLE:
|
||||
interval = float(
|
||||
input("Please specify interval in floating point seconds: ")
|
||||
)
|
||||
if setId in [SetId.SOLUTION]:
|
||||
q.add_pus_tc(
|
||||
disable_periodic_hk_command(True, make_sid(STAR_TRACKER_ID, setId))
|
||||
)
|
||||
elif setId in [
|
||||
SetId.AUTO_BLOB,
|
||||
SetId.MATCHED_CENTROIDS,
|
||||
SetId.BLOB,
|
||||
SetId.BLOBS,
|
||||
SetId.CENTROID,
|
||||
SetId.CENTROIDS,
|
||||
]:
|
||||
q.add_pus_tc(
|
||||
disable_periodic_hk_command(False, make_sid(STAR_TRACKER_ID, setId))
|
||||
)
|
||||
else:
|
||||
print("Not Implemented Yet")
|
||||
|
||||
|
||||
def pack_read_command(object_id: bytes) -> bytearray:
|
||||
start_region = StartRegion.STAR_TRACKER_FIRMWARE
|
||||
size = PartitionSize.STAR_TRACKER_FIRMWARE
|
||||
@ -935,59 +1028,60 @@ def add_str_cmds(defs: TmtcDefinitionWrapper):
|
||||
# oce.add("4", "Star Tracker: Mode Raw")
|
||||
oce.add(OpCodes.PING, "Star Tracker: Ping")
|
||||
oce.add(OpCodes.TAKE_IMAGE, "Take Image")
|
||||
oce.add(OpCodes.REQUEST_SOLUTION_SET_HK, Info.REQUEST_SOLUTION_SET_HK)
|
||||
oce.add(OpCodes.REQUEST_SOLUTION_SET_ACTION, Info.REQUEST_SOLUTION_SET_ACTION)
|
||||
oce.add(OpCodes.ONE_SHOOT_HK, Info.ONE_SHOOT_HK)
|
||||
oce.add(OpCodes.ENABLE_HK, Info.ENABLE_HK)
|
||||
oce.add(OpCodes.DISABLE_HK, Info.DISABLE_HK)
|
||||
oce.add(OpCodes.UPLOAD_IMAGE, Info.UPLOAD_IMAGE)
|
||||
oce.add(OpCodes.SET_IMG_PROCESSOR_MODE, Info.SET_IMG_PROCESSOR_MODE)
|
||||
oce.add("6", "Star Tracker: Switch to bootloader program")
|
||||
oce.add("7", "Star Tracker: Request temperature")
|
||||
oce.add("8", "Star Tracker: Request version")
|
||||
oce.add("9", "Star Tracker: Request interface")
|
||||
oce.add("10", "Star Tracker: Request power")
|
||||
oce.add("11", "Star Tracker: Set subscription parameters")
|
||||
oce.add("12", "Star Tracker: Boot image (requires bootloader mode)")
|
||||
oce.add("13", "Star Tracker: Request time")
|
||||
oce.add("14", "Star Tracker: Request solution")
|
||||
oce.add("16", "Star Tracker: Download image")
|
||||
oce.add("17", "Star Tracker: Set limit parameters")
|
||||
oce.add("17", "Star Tracker: Set limit parameters")
|
||||
oce.add("18", "Star Tracker: Set tracking parameters")
|
||||
oce.add("19", "Star Tracker: Set mounting parameters")
|
||||
oce.add("20", "Star Tracker: Set camera parameters")
|
||||
oce.add("22", "Star Tracker: Set centroiding parameters")
|
||||
oce.add("23", "Star Tracker: Set LISA parameters")
|
||||
oce.add("24", "Star Tracker: Set matching parameters")
|
||||
oce.add("25", "Star Tracker: Set validation parameters")
|
||||
oce.add("26", "Star Tracker: Set algo parameters")
|
||||
oce.add("28", "Star Tracker: Stop str helper")
|
||||
oce.add("30", "Star Tracker: Set name of download image")
|
||||
oce.add("31", "Star Tracker: Request histogram")
|
||||
oce.add("32", "Star Tracker: Request contrast")
|
||||
oce.add("33", "Star Tracker: Set json filename")
|
||||
oce.add("35", "Star Tracker: Flash read")
|
||||
oce.add("36", "Star Tracker: Set flash read filename")
|
||||
oce.add("37", "Star Tracker: Get checksum")
|
||||
oce.add("49", "Star Tracker: Request camera parameter")
|
||||
oce.add("50", "Star Tracker: Request limits")
|
||||
oce.add("52", "Star Tracker: (EGSE only) Load camera ground config")
|
||||
oce.add("53", "Star Tracker: (EGSE only) Load camera flight config")
|
||||
oce.add("54", "Star Tracker: Request log level parameters")
|
||||
oce.add("55", "Star Tracker: Request mounting parameters")
|
||||
oce.add("56", "Star Tracker: Request image processor parameters")
|
||||
oce.add("57", "Star Tracker: Request centroiding parameters")
|
||||
oce.add("58", "Star Tracker: Request lisa parameters")
|
||||
oce.add("59", "Star Tracker: Request matching parameters")
|
||||
oce.add("60", "Star Tracker: Request tracking parameters")
|
||||
oce.add("61", "Star Tracker: Request validation parameters")
|
||||
oce.add("62", "Star Tracker: Request algo parameters")
|
||||
oce.add("63", "Star Tracker: Request subscription parameters")
|
||||
oce.add("64", "Star Tracker: Request log subscription parameters")
|
||||
oce.add("65", "Star Tracker: Request debug camera parameters")
|
||||
oce.add("66", "Star Tracker: Set log level parameters")
|
||||
oce.add("67", "Star Tracker: Set log subscription parameters")
|
||||
oce.add("68", "Star Tracker: Set debug camera parameters")
|
||||
# oce.add("6", "Star Tracker: Switch to bootloader program")
|
||||
# oce.add("7", "Star Tracker: Request temperature")
|
||||
# oce.add("8", "Star Tracker: Request version")
|
||||
# oce.add("9", "Star Tracker: Request interface")
|
||||
# oce.add("10", "Star Tracker: Request power")
|
||||
# oce.add("11", "Star Tracker: Set subscription parameters")
|
||||
# oce.add("12", "Star Tracker: Boot image (requires bootloader mode)")
|
||||
# oce.add("13", "Star Tracker: Request time")
|
||||
# oce.add("14", "Star Tracker: Request solution")
|
||||
# oce.add("16", "Star Tracker: Download image")
|
||||
# oce.add("17", "Star Tracker: Set limit parameters")
|
||||
# oce.add("17", "Star Tracker: Set limit parameters")
|
||||
# oce.add("18", "Star Tracker: Set tracking parameters")
|
||||
# oce.add("19", "Star Tracker: Set mounting parameters")
|
||||
# oce.add("20", "Star Tracker: Set camera parameters")
|
||||
# oce.add("22", "Star Tracker: Set centroiding parameters")
|
||||
# oce.add("23", "Star Tracker: Set LISA parameters")
|
||||
# oce.add("24", "Star Tracker: Set matching parameters")
|
||||
# oce.add("25", "Star Tracker: Set validation parameters")
|
||||
# oce.add("26", "Star Tracker: Set algo parameters")
|
||||
# oce.add("28", "Star Tracker: Stop str helper")
|
||||
# oce.add("30", "Star Tracker: Set name of download image")
|
||||
# oce.add("31", "Star Tracker: Request histogram")
|
||||
# oce.add("32", "Star Tracker: Request contrast")
|
||||
# oce.add("33", "Star Tracker: Set json filename")
|
||||
# oce.add("35", "Star Tracker: Flash read")
|
||||
# oce.add("36", "Star Tracker: Set flash read filename")
|
||||
# oce.add("37", "Star Tracker: Get checksum")
|
||||
# oce.add("49", "Star Tracker: Request camera parameter")
|
||||
# oce.add("50", "Star Tracker: Request limits")
|
||||
# oce.add("52", "Star Tracker: (EGSE only) Load camera ground config")
|
||||
# oce.add("53", "Star Tracker: (EGSE only) Load camera flight config")
|
||||
# oce.add("54", "Star Tracker: Request log level parameters")
|
||||
# oce.add("55", "Star Tracker: Request mounting parameters")
|
||||
# oce.add("56", "Star Tracker: Request image processor parameters")
|
||||
# oce.add("57", "Star Tracker: Request centroiding parameters")
|
||||
# oce.add("58", "Star Tracker: Request lisa parameters")
|
||||
# oce.add("59", "Star Tracker: Request matching parameters")
|
||||
# oce.add("60", "Star Tracker: Request tracking parameters")
|
||||
# oce.add("61", "Star Tracker: Request validation parameters")
|
||||
# oce.add("62", "Star Tracker: Request algo parameters")
|
||||
# oce.add("63", "Star Tracker: Request subscription parameters")
|
||||
# oce.add("64", "Star Tracker: Request log subscription parameters")
|
||||
# oce.add("65", "Star Tracker: Request debug camera parameters")
|
||||
# oce.add("66", "Star Tracker: Set log level parameters")
|
||||
# oce.add("67", "Star Tracker: Set log subscription parameters")
|
||||
# oce.add("68", "Star Tracker: Set debug camera parameters")
|
||||
oce.add(OpCodes.FW_UPDATE, Info.FW_UPDATE)
|
||||
oce.add("70", "Star Tracker: Disable timestamp generation")
|
||||
oce.add("71", "Star Tracker: Enable timestamp generation")
|
||||
# oce.add("70", "Star Tracker: Disable timestamp generation")
|
||||
# oce.add("71", "Star Tracker: Enable timestamp generation")
|
||||
oce.add(OpCodes.SET_TIME_FROM_SYS_TIME, Info.SET_TIME_FROM_SYS_TIME)
|
||||
defs.add_service(CustomServiceList.STAR_TRACKER.value, "Star Tracker", oce)
|
||||
|
Loading…
x
Reference in New Issue
Block a user