Skip to content
Snippets Groups Projects
Commit 11d1200c authored by Kien Le's avatar Kien Le
Browse files

Documentation and type hint

parent bfc3b616
No related branches found
No related tags found
1 merge request!191Read log files generated by users
This commit is part of merge request !191. Comments created here will be created in the context of that merge request.
......@@ -70,6 +70,8 @@ class RT130(GeneralData):
def processing_data(self):
if self.creator_thread.isInterruptionRequested():
raise ThreadStopped()
# We separate the reading of log files and real data sets because their
# formats are very different.
if self.rt130_log_files:
self.read_log_files()
else:
......@@ -129,6 +131,12 @@ class RT130(GeneralData):
self.log_data[file_key]['EHET'] = [(1, reader.eh_et_lines)]
self.log_data[file_key]['SOH'] = [(1, reader.soh_lines)]
else:
# Just in case we are reading multiple files with the same key.
# We are going to assume that the log files are read in order.
# That makes dealing with multiple files a lot easier. We can
# always sort the processed SOH data if this assumption is
# wrong.
key_file_count = self.log_data[file_key]['EHET'][-1][0] + 1
self.log_data[file_key]['EHET'].append(
(key_file_count, reader.eh_et_lines)
......@@ -136,9 +144,18 @@ class RT130(GeneralData):
self.log_data[file_key]['SOH'].append(
(key_file_count, reader.soh_lines)
)
self.convert_mass_pos_log_lines_to_data(file_key, reader.masspos_lines)
self.process_mass_pos_log_lines(file_key, reader.masspos_lines)
def process_mass_pos_log_lines(self, current_key: Tuple[str, str],
masspos_lines: List[str]):
"""
Process mass-position log lines and store the result in
self.masspos_data.
def convert_mass_pos_log_lines_to_data(self, current_key, masspos_lines):
:param current_key: the current data set key
:param masspos_lines: the mass-position lines to process
"""
# Mass-position channels is suffixed by a number from 1 to 6.
for masspos_num in range(1, 7):
masspos_string = f'MassPos{masspos_num}'
current_lines = [line.split()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment