Compare commits
6 Commits
37c1a68da1
...
07601b734e
Author | SHA1 | Date | |
---|---|---|---|
07601b734e | |||
9a487c7407 | |||
9a10a12f93 | |||
e2e503bb5d | |||
d2356ac1fa | |||
2ef8f5a32e |
@@ -1,6 +1,7 @@
|
||||
from tmtccmd.config import (
|
||||
add_op_code_entry,
|
||||
add_service_op_code_entry,
|
||||
generate_op_code_options,
|
||||
ServiceOpCodeDictT,
|
||||
OpCodeDictKeys,
|
||||
)
|
||||
@@ -92,17 +93,27 @@ def add_core_controller_definitions(cmd_dict: ServiceOpCodeDictT):
|
||||
|
||||
def add_pl_pcdu_cmds(cmd_dict: ServiceOpCodeDictT):
|
||||
from pus_tc.plpcdu import OpCodes
|
||||
|
||||
op_code_dict = dict()
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=OpCodes.SWITCH_ADC_ON,
|
||||
info="Switch PL PCDU ADC on",
|
||||
keys=OpCodes.SWITCH_ON,
|
||||
info="Switch PL PCDU on"
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=OpCodes.SWITCH_ALL_ON,
|
||||
info="Switch all PL PCDU modules on",
|
||||
keys=OpCodes.SWITCH_ADC_NORMAL,
|
||||
info="Switch PL PCDU ADC normal, submode ADC ON"
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=OpCodes.SWITCH_OFF,
|
||||
info="Switch PL PCDU off"
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
keys=OpCodes.SWITCH_ALL_NORMAL,
|
||||
info="Switch all PL PCDU modules normal, submode ALL ON",
|
||||
options=generate_op_code_options(enter_listener_mode=True)
|
||||
)
|
||||
add_op_code_entry(
|
||||
op_code_dict=op_code_dict,
|
||||
|
7
config/event_handler.py
Normal file
7
config/event_handler.py
Normal file
@@ -0,0 +1,7 @@
|
||||
import config.object_ids as obj_ids
|
||||
|
||||
|
||||
def handle_event_packet(
|
||||
object_id: bytes, event_id: int, param_1: int, param_2: int
|
||||
) -> str:
|
||||
return ""
|
@@ -103,10 +103,13 @@ class EiveHookObject(TmTcHookBase):
|
||||
def handle_service_5_event(
|
||||
object_id: bytes, event_id: int, param_1: int, param_2: int
|
||||
) -> str:
|
||||
if object_id == RW1_ID:
|
||||
if event_id == 1:
|
||||
return ""
|
||||
return ""
|
||||
from config.event_handler import handle_event_packet
|
||||
return handle_event_packet(
|
||||
object_id=object_id,
|
||||
event_id=event_id,
|
||||
param_1=param_1,
|
||||
param_2=param_2
|
||||
)
|
||||
|
||||
|
||||
def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
|
||||
|
@@ -17,19 +17,21 @@ LOGGER = get_console_logger()
|
||||
|
||||
|
||||
class OpCodes:
|
||||
SWITCH_ADC_ON = ["0", "switch-adc-on"]
|
||||
SWITCH_ALL_ON = ["1", "switch-all-on"]
|
||||
UPDATE_DRO_TO_X8_WAIT = ["2", "dro-to-x8-wait"]
|
||||
UPDATE_X8_TO_TX_WAIT_TIME = ["3", "x8-to-tx-wait"]
|
||||
UPDATE_TX_TO_MPA_WAIT_TIME = ["4", "tx-to-mpa-wait"]
|
||||
UPDATE_MPA_TO_HPA_WAIT_TIME = ["5", "mpa-to-hpa-wait"]
|
||||
SWITCH_ON = ["0", "on"]
|
||||
SWITCH_ADC_NORMAL = ["1", "adc-normal"]
|
||||
SWITCH_ALL_NORMAL = ["2", "all-normal"]
|
||||
SWITCH_OFF = ["3", "off"]
|
||||
UPDATE_DRO_TO_X8_WAIT = ["6", "dro-to-x8-wait"]
|
||||
UPDATE_X8_TO_TX_WAIT_TIME = ["7", "x8-to-tx-wait"]
|
||||
UPDATE_TX_TO_MPA_WAIT_TIME = ["8", "tx-to-mpa-wait"]
|
||||
UPDATE_MPA_TO_HPA_WAIT_TIME = ["9", "mpa-to-hpa-wait"]
|
||||
|
||||
INJECT_SSR_TO_DRO_FAILURE = ["6", "inject-ssr-dro-fault"]
|
||||
INJECT_DRO_TO_X8_FAILURE = ["7", "inject-dro-x8-fault"]
|
||||
INJECT_X8_TO_TX_FAILURE = ["8", "inject-x8-tx-fault"]
|
||||
INJECT_TX_TO_MPA_FAILURE = ["9", "inject-tx-mpa-fault"]
|
||||
INJECT_MPA_TO_HPA_FAILURE = ["10", "inject-mpa-hpa-fault"]
|
||||
INJECT_ALL_ON_FAILURE = ["11", "inject-all-on-fault"]
|
||||
INJECT_SSR_TO_DRO_FAILURE = ["10", "inject-ssr-dro-fault"]
|
||||
INJECT_DRO_TO_X8_FAILURE = ["11", "inject-dro-x8-fault"]
|
||||
INJECT_X8_TO_TX_FAILURE = ["12", "inject-x8-tx-fault"]
|
||||
INJECT_TX_TO_MPA_FAILURE = ["13", "inject-tx-mpa-fault"]
|
||||
INJECT_MPA_TO_HPA_FAILURE = ["14", "inject-mpa-hpa-fault"]
|
||||
INJECT_ALL_ON_FAILURE = ["15", "inject-all-on-fault"]
|
||||
|
||||
|
||||
class Submodes(enum.IntEnum):
|
||||
@@ -76,8 +78,26 @@ class ParamIds(enum.IntEnum):
|
||||
|
||||
|
||||
def pack_pl_pcdu_commands(tc_queue: TcQueueT, op_code: str):
|
||||
if op_code in OpCodes.SWITCH_ADC_ON:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "Switching PL PCDU ADC module on"))
|
||||
if op_code in OpCodes.SWITCH_ON:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "Switching PL PCDU on"))
|
||||
mode_data = pack_mode_data(
|
||||
object_id=PL_PCDU_ID, mode=Modes.ON, submode=0
|
||||
)
|
||||
mode_cmd = PusTelecommand(
|
||||
service=200, subservice=Subservices.SWITCH_MODE, app_data=mode_data
|
||||
)
|
||||
tc_queue.appendleft(mode_cmd.pack_command_tuple())
|
||||
if op_code in OpCodes.SWITCH_OFF:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "Switching PL PCDU off"))
|
||||
mode_data = pack_mode_data(
|
||||
object_id=PL_PCDU_ID, mode=Modes.OFF, submode=0
|
||||
)
|
||||
mode_cmd = PusTelecommand(
|
||||
service=200, subservice=Subservices.SWITCH_MODE, app_data=mode_data
|
||||
)
|
||||
tc_queue.appendleft(mode_cmd.pack_command_tuple())
|
||||
if op_code in OpCodes.SWITCH_ADC_NORMAL:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "Switching PL PCDU ADC module normal, submode ADC ON"))
|
||||
mode_data = pack_mode_data(
|
||||
object_id=PL_PCDU_ID, mode=Modes.NORMAL, submode=Submodes.ADC_ON
|
||||
)
|
||||
@@ -85,8 +105,8 @@ def pack_pl_pcdu_commands(tc_queue: TcQueueT, op_code: str):
|
||||
service=200, subservice=Subservices.SWITCH_MODE, app_data=mode_data
|
||||
)
|
||||
tc_queue.appendleft(mode_cmd.pack_command_tuple())
|
||||
if op_code in OpCodes.SWITCH_ALL_ON:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "Switching all PL PCDU modules on"))
|
||||
if op_code in OpCodes.SWITCH_ALL_NORMAL:
|
||||
tc_queue.appendleft((QueueCommands.PRINT, "Switching all PL PCDU modules normal, submode ALL ON"))
|
||||
mode_data = pack_mode_data(
|
||||
object_id=PL_PCDU_ID, mode=Modes.NORMAL, submode=Submodes.ALL_ON
|
||||
)
|
||||
|
@@ -1 +1 @@
|
||||
tmtccmd>=1.12.0
|
||||
tmtccmd>=1.13.0
|
||||
|
2
tmtccmd
2
tmtccmd
Submodule tmtccmd updated: 81a88435a5...c315efe165
Reference in New Issue
Block a user