move and improve syrlinks module
This commit is contained in:
parent
db0cbf620e
commit
8001156a02
@ -1,7 +1,7 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
<component name="ProjectRunConfigurationManager">
|
||||||
<configuration default="false" name="tmtccli" type="PythonConfigurationType" factoryName="Python">
|
<configuration default="false" name="tmtccli" type="PythonConfigurationType" factoryName="Python">
|
||||||
<module name="tmtc" />
|
<module name="tmtc" />
|
||||||
<option name="INTERPRETER_OPTIONS" value="" />
|
<option name="INTERPRETER_OPTIONS" value="-X dev" />
|
||||||
<option name="PARENT_ENVS" value="true" />
|
<option name="PARENT_ENVS" value="true" />
|
||||||
<envs>
|
<envs>
|
||||||
<env name="PYTHONUNBUFFERED" value="1" />
|
<env name="PYTHONUNBUFFERED" value="1" />
|
||||||
|
@ -8,6 +8,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
|
|||||||
The [milestone](https://egit.irs.uni-stuttgart.de/eive/eive-obsw/milestones)
|
The [milestone](https://egit.irs.uni-stuttgart.de/eive/eive-obsw/milestones)
|
||||||
list yields a list of all related PRs for each release.
|
list yields a list of all related PRs for each release.
|
||||||
|
|
||||||
|
# [unreleased]
|
||||||
|
|
||||||
|
- Unify and move Syrlinks module, some bugfixes
|
||||||
|
|
||||||
# [v2.3.0] and [v2.3.1] 18.01.2023
|
# [v2.3.0] and [v2.3.1] 18.01.2023
|
||||||
|
|
||||||
- Bumped `tmtccmd` version to new alpha release, use some new features
|
- Bumped `tmtccmd` version to new alpha release, use some new features
|
||||||
|
@ -1,67 +0,0 @@
|
|||||||
import struct
|
|
||||||
|
|
||||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
|
||||||
from eive_tmtc.pus_tc.devs.syrlinks_hk_handler import SetId
|
|
||||||
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
|
||||||
|
|
||||||
|
|
||||||
def handle_syrlinks_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
|
|
||||||
if set_id == SetId.RX_REGISTERS_DATASET:
|
|
||||||
return handle_syrlinks_rx_registers_dataset(printer, hk_data)
|
|
||||||
elif set_id == SetId.TX_REGISTERS_DATASET:
|
|
||||||
return handle_syrlinks_tx_registers_dataset(printer, hk_data)
|
|
||||||
else:
|
|
||||||
pw = PrintWrapper(printer)
|
|
||||||
pw.dlog(f"Service 3 TM: Syrlinks handler reply with unknown set ID {set_id}")
|
|
||||||
|
|
||||||
|
|
||||||
def handle_syrlinks_rx_registers_dataset(printer: FsfwTmTcPrinter, hk_data: bytes):
|
|
||||||
pw = PrintWrapper(printer)
|
|
||||||
header_list = [
|
|
||||||
"RX Status",
|
|
||||||
"RX Sensitivity",
|
|
||||||
"RX Frequency Shift",
|
|
||||||
"RX IQ Power",
|
|
||||||
"RX AGC Value",
|
|
||||||
"RX Demod Eb",
|
|
||||||
"RX Demod N0",
|
|
||||||
"RX Datarate",
|
|
||||||
]
|
|
||||||
rx_status = hk_data[0]
|
|
||||||
rx_sensitivity = struct.unpack("!I", hk_data[1:5])
|
|
||||||
rx_frequency_shift = struct.unpack("!I", hk_data[5:9])
|
|
||||||
rx_iq_power = struct.unpack("!H", hk_data[9:11])
|
|
||||||
rx_agc_value = struct.unpack("!H", hk_data[11:13])
|
|
||||||
rx_demod_eb = struct.unpack("!I", hk_data[13:17])
|
|
||||||
rx_demod_n0 = struct.unpack("!I", hk_data[17:21])
|
|
||||||
rx_data_rate = hk_data[21]
|
|
||||||
content_list = [
|
|
||||||
rx_status,
|
|
||||||
rx_sensitivity,
|
|
||||||
rx_frequency_shift,
|
|
||||||
rx_iq_power,
|
|
||||||
rx_agc_value,
|
|
||||||
rx_demod_eb,
|
|
||||||
rx_demod_n0,
|
|
||||||
rx_data_rate,
|
|
||||||
]
|
|
||||||
validity_buffer = hk_data[22:]
|
|
||||||
pw.dlog(str(header_list))
|
|
||||||
pw.dlog(str(content_list))
|
|
||||||
printer.print_validity_buffer(validity_buffer=validity_buffer, num_vars=8)
|
|
||||||
|
|
||||||
|
|
||||||
def handle_syrlinks_tx_registers_dataset(
|
|
||||||
printer: FsfwTmTcPrinter,
|
|
||||||
hk_data: bytes,
|
|
||||||
):
|
|
||||||
pw = PrintWrapper(printer)
|
|
||||||
header_list = ["TX Status", "TX Waveform", "TX AGC value"]
|
|
||||||
tx_status = hk_data[0]
|
|
||||||
tx_waveform = hk_data[1]
|
|
||||||
tx_agc_value = struct.unpack("!H", hk_data[2:4])
|
|
||||||
content_list = [tx_status, tx_waveform, tx_agc_value]
|
|
||||||
validity_buffer = hk_data[4:]
|
|
||||||
pw.dlog(str(header_list))
|
|
||||||
pw.dlog(str(content_list))
|
|
||||||
printer.print_validity_buffer(validity_buffer=validity_buffer, num_vars=3)
|
|
@ -6,6 +6,7 @@ from eive_tmtc.pus_tm.devs.rad_sensor import handle_rad_sensor_data
|
|||||||
from eive_tmtc.pus_tm.devs.sus import handle_sus_hk
|
from eive_tmtc.pus_tm.devs.sus import handle_sus_hk
|
||||||
from eive_tmtc.tmtc.payload.ploc_supervisor import handle_supv_hk_data
|
from eive_tmtc.tmtc.payload.ploc_supervisor import handle_supv_hk_data
|
||||||
from eive_tmtc.tmtc.acs.reaction_wheels import handle_rw_hk_data
|
from eive_tmtc.tmtc.acs.reaction_wheels import handle_rw_hk_data
|
||||||
|
from eive_tmtc.tmtc.syrlinks_hk_handler import handle_syrlinks_hk_data
|
||||||
from eive_tmtc.tmtc.tcs import handle_thermal_controller_hk_data
|
from eive_tmtc.tmtc.tcs import handle_thermal_controller_hk_data
|
||||||
from tmtccmd.tm.pus_3_fsfw_hk import (
|
from tmtccmd.tm.pus_3_fsfw_hk import (
|
||||||
Service3Base,
|
Service3Base,
|
||||||
@ -23,7 +24,6 @@ from eive_tmtc.tmtc.power.tm import (
|
|||||||
handle_p60_hk_data,
|
handle_p60_hk_data,
|
||||||
handle_acu_hk_data,
|
handle_acu_hk_data,
|
||||||
)
|
)
|
||||||
from eive_tmtc.pus_tm.devs.syrlinks import handle_syrlinks_hk_data
|
|
||||||
from eive_tmtc.tmtc.acs.imtq import (
|
from eive_tmtc.tmtc.acs.imtq import (
|
||||||
ImtqSetId,
|
ImtqSetId,
|
||||||
handle_self_test_data,
|
handle_self_test_data,
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
"""
|
"""
|
||||||
import enum
|
import enum
|
||||||
|
|
||||||
|
from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||||
|
|
||||||
from eive_tmtc.config.definitions import CustomServiceList
|
from eive_tmtc.config.definitions import CustomServiceList
|
||||||
from tmtccmd.config.tmtc import (
|
from tmtccmd.config.tmtc import (
|
||||||
tmtc_definitions_provider,
|
tmtc_definitions_provider,
|
||||||
@ -23,6 +25,7 @@ from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Mode
|
|||||||
import struct
|
import struct
|
||||||
|
|
||||||
from tmtccmd.util import ObjectIdU32
|
from tmtccmd.util import ObjectIdU32
|
||||||
|
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
||||||
|
|
||||||
|
|
||||||
class SetId:
|
class SetId:
|
||||||
@ -182,3 +185,65 @@ def pack_syrlinks_command(
|
|||||||
q.add_log_cmd("Syrlinks: Disable debug printout")
|
q.add_log_cmd("Syrlinks: Disable debug printout")
|
||||||
command = obyt + struct.pack("!I", CommandId.DISABLE_DEBUG)
|
command = obyt + struct.pack("!I", CommandId.DISABLE_DEBUG)
|
||||||
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
|
||||||
|
|
||||||
|
|
||||||
|
def handle_syrlinks_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
|
||||||
|
if set_id == SetId.RX_REGISTERS_DATASET:
|
||||||
|
return handle_syrlinks_rx_registers_dataset(printer, hk_data)
|
||||||
|
elif set_id == SetId.TX_REGISTERS_DATASET:
|
||||||
|
return handle_syrlinks_tx_registers_dataset(printer, hk_data)
|
||||||
|
else:
|
||||||
|
pw = PrintWrapper(printer)
|
||||||
|
pw.dlog(f"Service 3 TM: Syrlinks handler reply with unknown set ID {set_id}")
|
||||||
|
|
||||||
|
|
||||||
|
def handle_syrlinks_rx_registers_dataset(printer: FsfwTmTcPrinter, hk_data: bytes):
|
||||||
|
pw = PrintWrapper(printer)
|
||||||
|
header_list = [
|
||||||
|
"RX Status",
|
||||||
|
"RX Sensitivity",
|
||||||
|
"RX Frequency Shift",
|
||||||
|
"RX IQ Power",
|
||||||
|
"RX AGC Value",
|
||||||
|
"RX Demod Eb",
|
||||||
|
"RX Demod N0",
|
||||||
|
"RX Datarate",
|
||||||
|
]
|
||||||
|
rx_status = hk_data[0]
|
||||||
|
rx_sensitivity = struct.unpack("!I", hk_data[1:5])
|
||||||
|
rx_frequency_shift = struct.unpack("!I", hk_data[5:9])
|
||||||
|
rx_iq_power = struct.unpack("!H", hk_data[9:11])
|
||||||
|
rx_agc_value = struct.unpack("!H", hk_data[11:13])
|
||||||
|
rx_demod_eb = struct.unpack("!I", hk_data[13:17])
|
||||||
|
rx_demod_n0 = struct.unpack("!I", hk_data[17:21])
|
||||||
|
rx_data_rate = hk_data[21]
|
||||||
|
content_list = [
|
||||||
|
rx_status,
|
||||||
|
rx_sensitivity,
|
||||||
|
rx_frequency_shift,
|
||||||
|
rx_iq_power,
|
||||||
|
rx_agc_value,
|
||||||
|
rx_demod_eb,
|
||||||
|
rx_demod_n0,
|
||||||
|
rx_data_rate,
|
||||||
|
]
|
||||||
|
validity_buffer = hk_data[22:]
|
||||||
|
pw.dlog(str(header_list))
|
||||||
|
pw.dlog(str(content_list))
|
||||||
|
printer.print_validity_buffer(validity_buffer=validity_buffer, num_vars=8)
|
||||||
|
|
||||||
|
|
||||||
|
def handle_syrlinks_tx_registers_dataset(
|
||||||
|
printer: FsfwTmTcPrinter,
|
||||||
|
hk_data: bytes,
|
||||||
|
):
|
||||||
|
pw = PrintWrapper(printer)
|
||||||
|
header_list = ["TX Status", "TX Waveform", "TX AGC value"]
|
||||||
|
tx_status = hk_data[0]
|
||||||
|
tx_waveform = hk_data[1]
|
||||||
|
tx_agc_value = struct.unpack("!H", hk_data[2:4])
|
||||||
|
content_list = [tx_status, tx_waveform, tx_agc_value]
|
||||||
|
validity_buffer = hk_data[4:]
|
||||||
|
pw.dlog(str(header_list))
|
||||||
|
pw.dlog(str(content_list))
|
||||||
|
printer.print_validity_buffer(validity_buffer=validity_buffer, num_vars=3)
|
Loading…
x
Reference in New Issue
Block a user