bugfix tm parsing syrlinks

This commit is contained in:
Robin Müller 2023-02-10 16:31:58 +01:00
parent 9178251ed7
commit 8d23f29f94
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814

View File

@ -319,6 +319,7 @@ def handle_syrlinks_rx_registers_dataset(printer: FsfwTmTcPrinter, hk_data: byte
validity_buffer = hk_data[22:]
for header, content in zip(header_list, content_list):
pw.dlog(f"{header}: {content}")
printer.print_validity_buffer(validity_buffer=validity_buffer, num_vars=8)
pw.dlog(f"Carrier Detect: {carrier_detect}")
pw.dlog(f"Carrier Lock: {carrier_lock}")
pw.dlog(f"Data Lock (data clock recovery loop lock status): {data_lock}")
@ -327,7 +328,6 @@ def handle_syrlinks_rx_registers_dataset(printer: FsfwTmTcPrinter, hk_data: byte
pw.dlog(f"RX AGC Inhibit: {rx_agc_inhibit}")
pw.dlog(f"RX AGC: {rx_agc}")
pw.dlog(f"Eb / E0RX [dB]: {eb_to_n0}")
printer.print_validity_buffer(validity_buffer=validity_buffer, num_vars=8)
class TxConv(enum.IntEnum):
@ -335,6 +335,18 @@ class TxConv(enum.IntEnum):
VITERBI_HALF_G1G2INV = 0b010
VITERBI_HALF = 0b111
class TxStatus(enum.IntEnum):
NOT_AVAILABLE = 0b00
MODULATION = 0b01
CW = 0b10
STANDBY = 0b11
class TxCfgSet(enum.IntEnum):
START_WITH_CURRENT_CFG = 0b00
START_WITH_CONF_0 = 0b01
START_WITH_CONF_1 = 0b10
WAVEFORM_STRINGS = ["OFF", "CW", "QPSK", "0QPSK", "PCM/PM", "PSK/PM", "BPSK"]
@ -346,14 +358,23 @@ def handle_syrlinks_tx_registers_dataset(
pw = PrintWrapper(printer)
header_list = ["TX Status Raw", "TX Waveform", "TX AGC value"]
tx_status = hk_data[0]
"""
try:
tx_conv = TxConv(tx_status & 0b111)
except IndexError:
except ValueError:
logging.getLogger(__name__).warning(
f"invalid TX conv value {tx_status & 0b111}"
)
tx_conv = -1
tx_diff_encoder_enable = (tx_status >> 3) & 0b1
"""
tx_status_status = TxStatus(tx_status & 0b11)
try:
tx_conf_set = TxCfgSet((tx_status >> 2) & 0b11)
except ValueError:
logging.getLogger(__name__).warning(f"invalid TX conf set {(tx_status >> 2) & 0b11}")
tx_conf_set = -1
tx_clock_detect = (tx_status >> 4) & 0b1
tx_waveform = hk_data[1]
waveform = tx_waveform & 0b1111
try:
@ -369,10 +390,13 @@ def handle_syrlinks_tx_registers_dataset(
validity_buffer = hk_data[4:]
for header, content in zip(header_list, content_list):
pw.dlog(f"{header}: {content}")
pw.dlog(f"TX CONV: {tx_conv!r}")
pw.dlog(f"TX DIFF (differential encoder enable): {tx_diff_encoder_enable}")
printer.print_validity_buffer(validity_buffer=validity_buffer, num_vars=3)
# pw.dlog(f"TX CONV: {tx_conv!r}")
# pw.dlog(f"TX DIFF (differential encoder enable): {tx_diff_encoder_enable}")
pw.dlog(f"TX Status: {tx_status_status!r}")
pw.dlog(f"TX Config Set: {tx_conf_set!r}")
pw.dlog(f"TX Clock Detect: {tx_clock_detect}")
pw.dlog(f"Waveform: {waveform_str}")
pw.dlog(f"PCM Mode: {pcm_mode}")
pw.dlog(f"TX AGC Inhibit: {tx_agc_inhibit}")
pw.dlog(f"TX AGC: {tx_agc}")
printer.print_validity_buffer(validity_buffer=validity_buffer, num_vars=3)