Skip to content
Snippets Groups Projects
Commit c6b3096c authored by Robin.Mueller's avatar Robin.Mueller
Browse files

output improved

parent 1389bd50
Branches
No related tags found
No related merge requests found
......@@ -21,9 +21,9 @@ class Service3TM(PusTelemetry):
"""
# Minimal packet contains SID, which consists of object ID(4) and set ID(4)
MINIMAL_PACKET_SIZE = 8
# Minimal structure report contains SID (8), reporting status(1), validity flag (1) and
# collection interval as float (4)
STRUCTURE_REPORT_FIXED_HEADER_SIZE = MINIMAL_PACKET_SIZE + 6
# Minimal structure report contains SID (8), reporting status(1), validity flag (1),
# collection interval as float (4) and number of parameters(1)
STRUCTURE_REPORT_FIXED_HEADER_SIZE = MINIMAL_PACKET_SIZE + 7
def __init__(self, byte_array: bytearray):
super().__init__(byte_array)
......@@ -69,16 +69,12 @@ class Service3TM(PusTelemetry):
str(self.STRUCTURE_REPORT_FIXED_HEADER_SIZE) + "."
LOGGER.warning(warning)
return
self.hkHeader = ["Object ID", "Set ID", "Report Status", "Set Valid"
"Collection Interval", "Number Of IDs"]
self.hkHeader = ["Object ID", "Set ID", "Report Status", "Is valid",
"Collection Interval (s)", "Number Of IDs"]
reporting_enabled = self._tm_data[8]
print(reporting_enabled)
set_valid = self._tm_data[9]
print(set_valid)
collection_interval = struct.unpack('>f', self._tm_data[10:14])[0]
print(collection_interval)
collection_interval_seconds = struct.unpack('>f', self._tm_data[10:14])[0] / 1000.0
num_params = self._tm_data[14]
print(num_params)
if len(self._tm_data) < self.STRUCTURE_REPORT_FIXED_HEADER_SIZE + num_params * 4:
warning = "Service3TM: handle_filling_definition_arrays: Invalid structure report " \
"from " + str(hex(self.objectId)) + ", is shorter than " + \
......@@ -99,11 +95,11 @@ class Service3TM(PusTelemetry):
else:
status_string = "Off"
if set_valid:
valid_string = "On"
valid_string = "Yes"
else:
valid_string = "Off"
valid_string = "No"
self.hkContent = [hex(self.objectId), self.setId, status_string, valid_string,
collection_interval, num_params]
collection_interval_seconds, num_params]
self.hkContent.extend(parameters)
def handle_filling_hk_arrays(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment