From 28c92a19bf932f94c5f9ad63c6485988e9266a62 Mon Sep 17 00:00:00 2001
From: kienle <kienle@passcal.nmt.edu>
Date: Mon, 25 Sep 2023 22:29:28 -0600
Subject: [PATCH] Create stub for log file reader

---
 .../reftek_reader/log_file_reader.py          | 53 +++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100644 sohstationviewer/model/reftek_data/reftek_reader/log_file_reader.py

diff --git a/sohstationviewer/model/reftek_data/reftek_reader/log_file_reader.py b/sohstationviewer/model/reftek_data/reftek_reader/log_file_reader.py
new file mode 100644
index 000000000..e0c1e6a99
--- /dev/null
+++ b/sohstationviewer/model/reftek_data/reftek_reader/log_file_reader.py
@@ -0,0 +1,53 @@
+from pathlib import Path
+from typing import List
+
+
+def detect_log_file_packet_format(packet: List[str]):
+    pass
+
+def read_soh_packet_base(packet: List[str]):
+    pass
+
+
+def read_soh_packet_rt2ms(packet: List[str]):
+    pass
+
+
+def read_soh_packet_rt2ms(packet: List[str]):
+    pass
+
+
+class LogFile:
+    def __init__(self, file_path: Path):
+        self.file_path = file_path
+        self.file = open(file_path)
+
+    def __iter__(self):
+        return self
+
+    def __next__(self):
+        return self.file.readline()
+
+    def __del__(self):
+        self.file.close()
+
+
+class LogFileReader:
+    """
+    Class that reads a log file.
+    """
+    def __init__(self, file_path: Path):
+        self.file_path = file_path
+        self.packet_reader = None
+        self.log_file_type: LogFileFormat
+
+    def read(self):
+        log_file = LogFile(self.file_path)
+        for packet in log_file:
+            pass
+
+
+if __name__ == '__main__':
+    pass
+a = LogFileReader(Path('/Users/kle/PycharmProjects/sohstationviewer/9BB3.log'))
+a.read()
-- 
GitLab