Skip to content
Snippets Groups Projects
Commit 6c2fe53d authored by jtkenny's avatar jtkenny
Browse files

begin read log block file

parent ae9599eb
No related branches found
No related tags found
5 merge requests!106Adding Pycrocart 2.1,!104adding cflib to this branch,!103Updating develop to current state of master branch,!98Pycrocart 2.1 will,!94Merge cflib adapter into main
......@@ -60,7 +60,7 @@ class LogfileHandler:
self.scf.cf.log.add_config(self.logging_configs[-1])
def refresh_logging_configs() :
def refresh_logging_configs(self):
raise Exception
def load_logging_configs() :
......@@ -103,3 +103,29 @@ class LogfileHandler:
for i in range(0, len(self.logging_configs)):
self.logging_configs[i].stop()
def read_all_active_blocks(self):
active_blocks = []
logBlockFile = open("/home/bitcraze/Desktop/groundstation/crazyflie_groundstation/loggingBlocks.txt", "r")
line = "BEGIN"
while line != "":
line = logBlockFile.readline()
formatLine = line.strip()
if len(formatLine) == 0 or formatLine[0] == '#':
continue
elif formatLine == "START BLOCK":
print(line)
data = []
for i in range(0,6):
newLine = logBlockFile.readline().strip()
if newLine == "" or newLine == "END BLOCK":
raise Exception("loggingBlocks.txt is not formatted correctly")
if i == 0 or i == 2:
data.append(int(newLine))
else:
data.append(newLine)
if len(data) != 6 or logBlockFile.readline().strip() != "END BLOCK":
raise Exception("loggingBlocks.txt is not formatted correctly")
File added
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
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