acu current and voltage printout command

This commit is contained in:
Jakob Meier 2021-12-17 15:09:25 +01:00
parent 3377243c07
commit f5613e5e80
5 changed files with 24 additions and 15 deletions

View File

@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="ACU Test" type="PythonConfigurationType" factoryName="Python" folderName="Devices">
<configuration default="false" name="ACU" type="PythonConfigurationType" factoryName="Python" folderName="Devices">
<module name="tmtc" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
@ -13,7 +13,7 @@
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtc_client_cli.py" />
<option name="PARAMETERS" value="-s acu -l" />
<option name="PARAMETERS" value="-s acu -l -t 6" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />

View File

@ -112,7 +112,8 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
service_op_code_dict[CustomServiceList.GPS_1.value] = service_tuple
op_code_dict = {
"0": ("ACU Tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
"0": ("ACU: Tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
"51": ("ACU: Print channel statistics", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_tuple = ("ACU Devices", op_code_dict)
service_op_code_dict[CustomServiceList.ACU.value] = service_tuple
@ -312,6 +313,7 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
"27": ("Star Tracker: Stop image loader", {OpCodeDictKeys.TIMEOUT: 2.0}),
"28": ("Star Tracker: Reset error signal", {OpCodeDictKeys.TIMEOUT: 2.0}),
"29": ("Star Tracker: Set name of download image", {OpCodeDictKeys.TIMEOUT: 2.0}),
"30": ("Star Tracker: Request histogram", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_star_tracker_tuple = ("Star tracker", op_code_dict_srv_star_tracker)

View File

@ -5,6 +5,7 @@
@author J. Meier
@date 21.12.2020
"""
import struct
from tmtccmd.tc.packer import TcQueueT
from tmtccmd.config.definitions import QueueCommands
from gomspace.gomspace_common import *
@ -51,19 +52,19 @@ class ACUHkTable:
wdt_gnd_left = TableEntry(bytearray([0x00, 0x74]), TableEntry.uint32_size)
def pack_acu_test_into(object_id: bytearray, tc_queue: TcQueueT):
class CommandId:
PRINT_CHANNEL_STATS = 51
def pack_acu_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str) -> TcQueueT:
tc_queue.appendleft((QueueCommands.PRINT, "Testing ACU"))
tc_queue.appendleft(
(QueueCommands.PRINT, "P60 Dock: Enabling ACU connected to X1 slot (channel 0)")
)
p60dock_object_id = P60_DOCK_HANDLER
command = pack_set_param_command(
p60dock_object_id, P60DockConfigTable.out_en_0.parameter_address,
P60DockConfigTable.out_en_0.parameter_size, Channel.on
)
# command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "51":
tc_queue.appendleft((QueueCommands.PRINT, "ACU: Print channel stats"))
command = object_id + struct.pack('!I', CommandId.PRINT_CHANNEL_STATS)
command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
return
if ACUTestProcedure.all or ACUTestProcedure.reboot:
tc_queue.appendleft((QueueCommands.PRINT, "ACU: Reboot"))

View File

@ -27,6 +27,7 @@ class StarTrackerActionIds:
SUBSCRIBE_TO_TM = 18
REQ_SOLUTION = 24
REQ_TEMPERATURE = 25
REQ_HISTOGRAM = 28
LIMITS = 40
MOUNTING = 41
CAMERA = 42
@ -222,3 +223,8 @@ def pack_star_tracker_commands(object_id: bytearray, tc_queue: TcQueueT, op_code
bytearray(filename, 'utf-8')
command = PusTelecommand(service=8, subservice=128, ssc=54, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "30":
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())

View File

@ -60,7 +60,7 @@ def pack_service_queue_user(service: Union[str, int], op_code: str, service_queu
return pack_pdu2_commands(object_id=object_id, tc_queue=service_queue, op_code=op_code)
if service == CustomServiceList.ACU.value:
object_id = ACU_HANDLER_ID
return pack_acu_test_into(object_id=object_id, tc_queue=service_queue)
return pack_acu_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code)
if service == CustomServiceList.TMP1075_1.value:
object_id = TMP_1075_1_HANDLER_ID
return pack_tmp1075_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code)