Skip to content

Commit

Permalink
Once records have been collected set the flag to terminate
Browse files Browse the repository at this point in the history
  • Loading branch information
misko committed Mar 8, 2024
1 parent 53bcb2d commit 9a0b281
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion spf/data_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def __init__(self, yaml_config, filename_npy, position_controller, tag=""):
self.filename_npy = filename_npy
self.record_matrix = None
self.position_controller = position_controller
self.finished_collecting = False

def radios_to_online(self):
# record matrix
Expand Down Expand Up @@ -281,7 +282,7 @@ def run_collector_thread(self):
raise NotImplementedError

def is_collecting(self):
return True
return not self.finished_collecting


class DroneDataCollector(DataCollector):
Expand Down Expand Up @@ -310,6 +311,8 @@ def run_collector_thread(self):

read_thread.read_lock.release()

self.finished_collecting = True


class GrblDataCollector(DataCollector):
def __init__(self, *args, **kwargs):
Expand Down Expand Up @@ -339,3 +342,4 @@ def run_collector_thread(self):
)

read_thread.read_lock.release()
self.finished_collecting = True

0 comments on commit 9a0b281

Please sign in to comment.