Merge branch 'cfdp-file-downlink' of https://egit.irs.uni-stuttgart.de/eive/eive-tmtc into cfdp-file-downlink
All checks were successful
EIVE/-/pipeline/pr-main This commit looks good
All checks were successful
EIVE/-/pipeline/pr-main This commit looks good
This commit is contained in:
commit
55624f0447
@ -1018,7 +1018,7 @@ def handle_gps_data_processed(pw: PrintWrapper, hk_data: bytes):
|
|||||||
inc_len_source = struct.calcsize(fmt_source)
|
inc_len_source = struct.calcsize(fmt_source)
|
||||||
inc_len_scalar = struct.calcsize(fmt_scalar)
|
inc_len_scalar = struct.calcsize(fmt_scalar)
|
||||||
inc_len_vec = struct.calcsize(fmt_vec)
|
inc_len_vec = struct.calcsize(fmt_vec)
|
||||||
if len(hk_data) < 2 * inc_len_scalar + 2 * inc_len_vec + inc_len_source:
|
if len(hk_data) < 3 * inc_len_scalar + 2 * inc_len_vec + inc_len_source:
|
||||||
pw.dlog("Received HK set too small")
|
pw.dlog("Received HK set too small")
|
||||||
return
|
return
|
||||||
current_idx = 0
|
current_idx = 0
|
||||||
|
@ -72,9 +72,7 @@ def add_gps_cmds(defs: TmtcDefinitionWrapper):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def pack_gps_command( # noqa: C901
|
def pack_gps_command(object_id: bytes, q: DefaultPusQueueHelper, op_code: str):
|
||||||
object_id: bytes, q: DefaultPusQueueHelper, op_code: str
|
|
||||||
): # noqa: C901
|
|
||||||
if op_code in OpCode.RESET_GNSS:
|
if op_code in OpCode.RESET_GNSS:
|
||||||
# TODO: This needs to be re-implemented
|
# TODO: This needs to be re-implemented
|
||||||
_LOGGER.warning("Reset pin handling needs to be re-implemented")
|
_LOGGER.warning("Reset pin handling needs to be re-implemented")
|
||||||
@ -84,52 +82,34 @@ def pack_gps_command( # noqa: C901
|
|||||||
raise ValueError("invalid interval")
|
raise ValueError("invalid interval")
|
||||||
q.add_log_cmd(f"GPS: {Info.ENABLE_CORE_HK}")
|
q.add_log_cmd(f"GPS: {Info.ENABLE_CORE_HK}")
|
||||||
cmds = create_enable_periodic_hk_command_with_interval(
|
cmds = create_enable_periodic_hk_command_with_interval(
|
||||||
diag=False,
|
diag=False, sid=make_sid(object_id=object_id, set_id=SetId.CORE_HK), interval_seconds=interval
|
||||||
sid=make_sid(object_id=object_id, set_id=SetId.CORE_HK),
|
|
||||||
interval_seconds=interval,
|
|
||||||
)
|
)
|
||||||
for cmd in cmds:
|
for cmd in cmds:
|
||||||
q.add_pus_tc(cmd)
|
q.add_pus_tc(cmd)
|
||||||
if op_code in OpCode.DISABLE_CORE_HK:
|
if op_code in OpCode.DISABLE_CORE_HK:
|
||||||
q.add_log_cmd(f"gps: {Info.DISABLE_CORE_HK}")
|
q.add_log_cmd(f"gps: {Info.DISABLE_CORE_HK}")
|
||||||
q.add_pus_tc(
|
q.add_pus_tc(create_disable_periodic_hk_command(diag=False, sid=make_sid(object_id=object_id,
|
||||||
create_disable_periodic_hk_command(
|
set_id=SetId.CORE_HK)))
|
||||||
diag=False, sid=make_sid(object_id=object_id, set_id=SetId.CORE_HK)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
if op_code in OpCode.REQ_CORE_HK:
|
if op_code in OpCode.REQ_CORE_HK:
|
||||||
q.add_log_cmd(f"GPS: {Info.REQ_CORE_HK}")
|
q.add_log_cmd(f"GPS: {Info.REQ_CORE_HK}")
|
||||||
q.add_pus_tc(
|
q.add_pus_tc(create_request_one_hk_command(sid=make_sid(object_id=object_id, set_id=SetId.CORE_HK)))
|
||||||
create_request_one_hk_command(
|
|
||||||
sid=make_sid(object_id=object_id, set_id=SetId.CORE_HK)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
if op_code in OpCode.ENABLE_SKYVIEW_HK:
|
if op_code in OpCode.ENABLE_SKYVIEW_HK:
|
||||||
interval = float(input("Please specify interval in floating point seconds: "))
|
interval = float(input("Please specify interval in floating point seconds: "))
|
||||||
if interval <= 0:
|
if interval <= 0:
|
||||||
raise ValueError("invalid interval")
|
raise ValueError("invalid interval")
|
||||||
q.add_log_cmd(f"GPS: {Info.ENABLE_SKYVIEW_HK}")
|
q.add_log_cmd(f"GPS: {Info.ENABLE_SKYVIEW_HK}")
|
||||||
cmds = create_enable_periodic_hk_command_with_interval(
|
cmds = create_enable_periodic_hk_command_with_interval(
|
||||||
diag=False,
|
diag=False, sid=make_sid(object_id=object_id, set_id=SetId.SKYVIEW_HK), interval_seconds=interval
|
||||||
sid=make_sid(object_id=object_id, set_id=SetId.SKYVIEW_HK),
|
|
||||||
interval_seconds=interval,
|
|
||||||
)
|
)
|
||||||
for cmd in cmds:
|
for cmd in cmds:
|
||||||
q.add_pus_tc(cmd)
|
q.add_pus_tc(cmd)
|
||||||
if op_code in OpCode.DISABLE_SKYVIEW_HK:
|
if op_code in OpCode.DISABLE_SKYVIEW_HK:
|
||||||
q.add_log_cmd(f"gps: {Info.DISABLE_SKYVIEW_HK}")
|
q.add_log_cmd(f"gps: {Info.DISABLE_SKYVIEW_HK}")
|
||||||
q.add_pus_tc(
|
q.add_pus_tc(create_disable_periodic_hk_command(diag=False, sid=make_sid(object_id=object_id,
|
||||||
create_disable_periodic_hk_command(
|
set_id=SetId.SKYVIEW_HK)))
|
||||||
diag=False, sid=make_sid(object_id=object_id, set_id=SetId.SKYVIEW_HK)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
if op_code in OpCode.REQ_SKYVIEW_HK:
|
if op_code in OpCode.REQ_SKYVIEW_HK:
|
||||||
q.add_log_cmd(f"GPS: {Info.REQ_SKYVIEW_HK}")
|
q.add_log_cmd(f"GPS: {Info.REQ_SKYVIEW_HK}")
|
||||||
q.add_pus_tc(
|
q.add_pus_tc(create_request_one_hk_command(sid=make_sid(object_id=object_id, set_id=SetId.SKYVIEW_HK)))
|
||||||
create_request_one_hk_command(
|
|
||||||
sid=make_sid(object_id=object_id, set_id=SetId.SKYVIEW_HK)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
if op_code in OpCode.ON:
|
if op_code in OpCode.ON:
|
||||||
q.add_log_cmd(f"GPS: {Info.ON}")
|
q.add_log_cmd(f"GPS: {Info.ON}")
|
||||||
q.add_pus_tc(create_mode_command(object_id, Mode.ON, 0))
|
q.add_pus_tc(create_mode_command(object_id, Mode.ON, 0))
|
||||||
@ -215,46 +195,24 @@ def handle_skyview_data(pw: PrintWrapper, hk_data: bytes):
|
|||||||
inc_len_int16 = struct.calcsize(fmt_str_int16)
|
inc_len_int16 = struct.calcsize(fmt_str_int16)
|
||||||
inc_len_double = struct.calcsize(fmt_str_double)
|
inc_len_double = struct.calcsize(fmt_str_double)
|
||||||
inc_len_uint8 = struct.calcsize(fmt_str_uint8)
|
inc_len_uint8 = struct.calcsize(fmt_str_uint8)
|
||||||
unix = struct.unpack(
|
unix = struct.unpack(fmt_str_unix, hk_data[current_idx: current_idx + inc_len_unix])[0]
|
||||||
fmt_str_unix, hk_data[current_idx : current_idx + inc_len_unix]
|
|
||||||
)
|
|
||||||
current_idx += inc_len_unix
|
current_idx += inc_len_unix
|
||||||
prn_id = struct.unpack(
|
prn_id = struct.unpack(fmt_str_int16, hk_data[current_idx: current_idx + inc_len_int16])
|
||||||
fmt_str_int16, hk_data[current_idx : current_idx + inc_len_int16]
|
|
||||||
)
|
|
||||||
current_idx += inc_len_int16
|
current_idx += inc_len_int16
|
||||||
azimuth = struct.unpack(
|
azimuth = struct.unpack(fmt_str_int16, hk_data[current_idx: current_idx + inc_len_int16])
|
||||||
fmt_str_int16, hk_data[current_idx : current_idx + inc_len_int16]
|
|
||||||
)
|
|
||||||
current_idx += inc_len_int16
|
current_idx += inc_len_int16
|
||||||
elevation = struct.unpack(
|
elevation = struct.unpack(fmt_str_int16, hk_data[current_idx: current_idx + inc_len_int16])
|
||||||
fmt_str_int16, hk_data[current_idx : current_idx + inc_len_int16]
|
|
||||||
)
|
|
||||||
current_idx += inc_len_int16
|
current_idx += inc_len_int16
|
||||||
signal_to_noise = struct.unpack(
|
signal_to_noise = struct.unpack(fmt_str_double, hk_data[current_idx: current_idx + inc_len_double])
|
||||||
fmt_str_double, hk_data[current_idx : current_idx + inc_len_double]
|
|
||||||
)
|
|
||||||
current_idx += inc_len_double
|
current_idx += inc_len_double
|
||||||
used = struct.unpack(
|
used = struct.unpack(fmt_str_uint8, hk_data[current_idx: current_idx + inc_len_uint8])
|
||||||
fmt_str_uint8, hk_data[current_idx : current_idx + inc_len_uint8]
|
|
||||||
)
|
|
||||||
current_idx += inc_len_uint8
|
current_idx += inc_len_uint8
|
||||||
pw.dlog(f"Skyview Time: {unix} unix-sec")
|
pw.dlog(f"Skyview Time: {unix} unix-sec")
|
||||||
pw.dlog(
|
pw.dlog("{:<8} {:<8} {:<8} {:<8} {:<8}".format('PRN_ID', 'AZ [°]', 'EL [°]', 'S2N [dBW]', 'USED'))
|
||||||
"{:<8} {:<8} {:<8} {:<8} {:<8}".format(
|
|
||||||
"PRN_ID", "AZ [°]", "EL [°]", "S2N [dBW]", "USED"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
for idx in range(GpsInfo.MAX_SATELLITES):
|
for idx in range(GpsInfo.MAX_SATELLITES):
|
||||||
pw.dlog(
|
pw.dlog("{:<8} {:<8} {:<8} {:<8} {:<8}".format(prn_id[idx], azimuth[idx], elevation[idx], signal_to_noise[idx],
|
||||||
"{:<8} {:<8} {:<8} {:<8} {:<8}".format(
|
used[idx]))
|
||||||
prn_id[idx],
|
|
||||||
azimuth[idx],
|
|
||||||
elevation[idx],
|
|
||||||
signal_to_noise[idx],
|
|
||||||
used[idx],
|
|
||||||
)
|
|
||||||
)
|
|
||||||
FsfwTmTcPrinter.get_validity_buffer(
|
FsfwTmTcPrinter.get_validity_buffer(
|
||||||
validity_buffer=hk_data[current_idx:], num_vars=6
|
validity_buffer=hk_data[current_idx:], num_vars=6
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user