v1.9.0 #53
@ -3,10 +3,15 @@ import enum
|
|||||||
from tmtccmd.config import QueueCommands
|
from tmtccmd.config import QueueCommands
|
||||||
from tmtccmd.tc.definitions import TcQueueT
|
from tmtccmd.tc.definitions import TcQueueT
|
||||||
from tmtccmd.tc.service_200_mode import pack_mode_data, Modes, Subservices
|
from tmtccmd.tc.service_200_mode import pack_mode_data, Modes, Subservices
|
||||||
from tmtccmd.tc.service_20_parameter import pack_boolean_parameter_command
|
from tmtccmd.tc.service_20_parameter import (
|
||||||
|
pack_scalar_double_param_app_data,
|
||||||
|
pack_fsfw_load_param_cmd
|
||||||
|
)
|
||||||
|
from tmtccmd.utility.logger import get_console_logger
|
||||||
from spacepackets.ecss.tc import PusTelecommand
|
from spacepackets.ecss.tc import PusTelecommand
|
||||||
from config.object_ids import PL_PCDU_ID
|
from config.object_ids import PL_PCDU_ID
|
||||||
|
|
||||||
|
LOGGER = get_console_logger()
|
||||||
|
|
||||||
class OpCodes:
|
class OpCodes:
|
||||||
SWITCH_ADC_ON = ["0", "switch-adc-on"]
|
SWITCH_ADC_ON = ["0", "switch-adc-on"]
|
||||||
@ -19,6 +24,10 @@ class Submodes(enum.IntEnum):
|
|||||||
ALL_ON = 1
|
ALL_ON = 1
|
||||||
|
|
||||||
|
|
||||||
|
class ParamIds(enum.IntEnum):
|
||||||
|
DRO_TO_X8_WAIT_TIME = 17
|
||||||
|
|
||||||
|
|
||||||
def pack_pl_pcdu_commands(tc_queue: TcQueueT, op_code: str):
|
def pack_pl_pcdu_commands(tc_queue: TcQueueT, op_code: str):
|
||||||
if op_code in OpCodes.SWITCH_ADC_ON:
|
if op_code in OpCodes.SWITCH_ADC_ON:
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Switching PL PCDU ADC module on"))
|
tc_queue.appendleft((QueueCommands.PRINT, "Switching PL PCDU ADC module on"))
|
||||||
@ -40,4 +49,23 @@ def pack_pl_pcdu_commands(tc_queue: TcQueueT, op_code: str):
|
|||||||
tc_queue.appendleft(mode_cmd.pack_command_tuple())
|
tc_queue.appendleft(mode_cmd.pack_command_tuple())
|
||||||
if op_code in OpCodes.UPDATE_DRO_TO_X8_WAIT:
|
if op_code in OpCodes.UPDATE_DRO_TO_X8_WAIT:
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Updating DRO to X8 wait time"))
|
tc_queue.appendleft((QueueCommands.PRINT, "Updating DRO to X8 wait time"))
|
||||||
param_data =
|
while True:
|
||||||
|
wait_time = input("Please enter DRO to X8 wait time in seconds, x to cancel")
|
||||||
|
if wait_time.lower() == "x":
|
||||||
|
return
|
||||||
|
if not wait_time.isnumeric():
|
||||||
|
LOGGER.warning("Invalid input")
|
||||||
|
continue
|
||||||
|
wait_time = float(wait_time)
|
||||||
|
if wait_time <= 0:
|
||||||
|
LOGGER.warning("Invalid input")
|
||||||
|
else:
|
||||||
|
break
|
||||||
|
param_data = pack_scalar_double_param_app_data(
|
||||||
|
object_id=PL_PCDU_ID,
|
||||||
|
domain_id=0,
|
||||||
|
unique_id=ParamIds.DRO_TO_X8_WAIT_TIME,
|
||||||
|
parameter=wait_time
|
||||||
|
)
|
||||||
|
cmd = pack_fsfw_load_param_cmd(ssc=0, app_data=param_data)
|
||||||
|
tc_queue.appendleft(cmd.pack_command_tuple())
|
||||||
|
Loading…
Reference in New Issue
Block a user