diff --git a/Tst/testing_library/testlib/tm.py b/Tst/testing_library/testlib/tm.py index 173a2db5127b65b78be6409460577fc4fe9ffaf2..0b387e27ada7b690256791ae681bfe01621af955 100644 --- a/Tst/testing_library/testlib/tm.py +++ b/Tst/testing_library/testlib/tm.py @@ -1728,6 +1728,29 @@ def get_acquisition(pool_name, tm_21_3): logger.info(meta_data[i]) return result + +def get_time_of_last_tc(pool_name="LIVE"): + """ + Finds the newest Telecommand in database with the Telemetry just before. + param pool_name: str + Name of the pool for TM/TC packets in the database + """ + + + tm_pool = cfl.get_pool_rows(pool_name) + # last_telecommand = None + tm_before_tc = None + for i in range(-1, -100, -1): + if tm_pool[i].timestamp == "": + # last_telecommand = tm_pool[i] + tm_before_tc = tm_pool[i-1] + break + timestamp = tm_before_tc.timestamp + timestamp_length = len(timestamp) + timestamp = float(timestamp[:timestamp_length -1]) + return timestamp + + def get_dpu_mode(pool_name="LIVE"): """ Get the data from the last entry in the database and check its DPU Mode. diff --git a/Tst/tst/verification_tab.py b/Tst/tst/verification_tab.py index dc189cc84ae151bc6d7e0d77c70cf18d781e6449..bb6e368c5dc7f3573ab019bf681fff102378d4f1 100644 --- a/Tst/tst/verification_tab.py +++ b/Tst/tst/verification_tab.py @@ -38,6 +38,7 @@ Verification_4 = "tm." + tm.get_frequency_of_hk.__name__ + str(inspect.signature Verification_5 = "tm." + tm.get_dpu_mode.__name__ + str(inspect.signature((tm.get_dpu_mode))) Verification_6 = "tm." + tm.get_packet_length.__name__ + str(inspect.signature((tm.get_packet_length))) Verification_7 = "tm." + tm.get_version_number.__name__ + str(inspect.signature((tm.get_version_number))) +Verification_8 = "tm." + tm.get_time_of_last_tc.__name__ + str(inspect.signature((tm.get_time_of_last_tc))) @@ -49,7 +50,8 @@ verification_list = [ ("Get HK frequency", None, None, "descr", Verification_4), ("Get DPU Mode", None, None, "descr", Verification_5), ("Get Packet Length", None, None, "descr", Verification_6), - ("Get Version Number", None, None, "descr", Verification_7) + ("Get Version Number", None, None, "descr", Verification_7), + ("Get Time before last TC", None, None, "descr", Verification_8) ]