update submodes

This commit is contained in:
Robin Müller 2023-01-26 15:45:25 +01:00
parent 2ac182e753
commit 0fe6cec54c
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC

View File

@ -44,7 +44,6 @@ class SetId:
class OpCode:
OFF = "off"
ON = "on"
NORMAL = "nml"
NORMAL_RX_ONLY = "nml_rx_only"
NORMAL_RX_AND_TX_CW = "nml_carrier_wave"
NORMAL_RX_AND_TX_LOW_DATARATE = "nml_low_datarate"
@ -64,7 +63,6 @@ class OpCode:
class Info:
OFF = "Switch OFF"
ON = "Switch ON"
NORMAL = "Switch NORMAL"
NORMAL_RX_ONLY = "NORMAL RX Only, set TX to standby"
NORMAL_RX_AND_TX_CW = "NORMAL RX and TX, TX Carrier Wave"
NORMAL_RX_AND_TX_DEFAULT_DATARATE = "NORMAL RX and TX, TX with default datarate"
@ -102,8 +100,8 @@ class CommandId(enum.IntEnum):
class Submode(enum.IntEnum):
DEFAULT = 0
RX_ONLY = 1
RX_ONLY = 0
RX_AND_TX_DEFAULT_DATARATE = 1
RX_AND_TX_LOW_DATARATE = 2
RX_AND_TX_HIGH_DATARATE = 3
RX_AND_TX_CW = 4
@ -123,7 +121,6 @@ def add_syrlinks_cmds(defs: TmtcDefinitionWrapper):
oce = OpCodeEntry()
oce.add(OpCode.OFF, Info.OFF)
oce.add(OpCode.ON, Info.ON)
oce.add(OpCode.NORMAL, Info.NORMAL)
oce.add(OpCode.NORMAL_RX_ONLY, Info.NORMAL_RX_ONLY)
oce.add(OpCode.NORMAL_RX_AND_TX_CW, Info.NORMAL_RX_AND_TX_CW)
oce.add(OpCode.NORMAL_RX_AND_TX_LOW_DATARATE, Info.NORMAL_RX_AND_TX_LOW_DATARATE)
@ -175,14 +172,16 @@ def pack_syrlinks_command(
if op_code == OpCode.ON:
q.add_log_cmd(f"{prefix}: {Info.ON}")
q.add_pus_tc(create_mode_command(obyt, Mode.ON, 0))
if op_code == OpCode.NORMAL:
normal_mode_cmd(q, Info.NORMAL, Submode.DEFAULT)
if op_code == OpCode.NORMAL_RX_ONLY:
normal_mode_cmd(q, Info.NORMAL, Submode.RX_ONLY)
normal_mode_cmd(q, Info.NORMAL_RX_ONLY, Submode.RX_ONLY)
if op_code == OpCode.NORMAL_RX_AND_TX_LOW_DATARATE:
normal_mode_cmd(q, Info.NORMAL, Submode.RX_AND_TX_LOW_DATARATE)
normal_mode_cmd(
q, Info.NORMAL_RX_AND_TX_LOW_DATARATE, Submode.RX_AND_TX_LOW_DATARATE
)
if op_code == OpCode.NORMAL_RX_AND_TX_HIGH_DATARATE:
normal_mode_cmd(q, Info.NORMAL, Submode.RX_AND_TX_HIGH_DATARATE)
normal_mode_cmd(
q, Info.NORMAL_RX_AND_TX_HIGH_DATARATE, Submode.RX_AND_TX_HIGH_DATARATE
)
if op_code == OpCode.UPDATE_DEFAULT_DATARATE_LOW_RATE:
q.add_log_cmd(f"{prefix}: {Info.UPDATE_DEFAULT_DATARATE_LOW_RATE}")
create_load_param_cmd(
@ -198,7 +197,7 @@ def pack_syrlinks_command(
)
)
if op_code in OpCode.NORMAL_RX_AND_TX_CW:
normal_mode_cmd(q, Info.NORMAL, Submode.RX_AND_TX_CW)
normal_mode_cmd(q, Info.NORMAL_RX_AND_TX_CW, Submode.RX_AND_TX_CW)
if op_code in OpCode.HK_RX_REGS:
q.add_log_cmd(f"{prefix}: {Info.HK_RX_REGS}")
sid = make_sid(obyt, SetId.RX_REGISTERS_DATASET)