Skip to content
Snippets Groups Projects
Commit 098f67ac authored by Daalen, Tim van's avatar Daalen, Tim van
Browse files

added memory check for hdd

parent 7cf619c4
Branches
No related tags found
No related merge requests found
......@@ -17,7 +17,6 @@ class take_img(Thread):
self.save_IMGS = CONFIG['save-IMGS']
self.save_GPS = CONFIG['save-GPS']
self.usb = USB_class(CONFIG['save-every-x'])
self.freememory = free_gbs()
self.GPS_check = CONFIG['GPS-checks']
# connecting to the first available camera
self.camera = pylon.InstantCamera(pylon.TlFactory.GetInstance().CreateFirstDevice())
......@@ -36,6 +35,8 @@ class take_img(Thread):
def run(self):
global GPS_lock, GPS_ringbuf, to_process_deque, to_display_queue
while self.camera.IsGrabbing() and self._running:
usbgb = self.usb.free_USBGBs
freememory = free_gbs()
grabResult = self.camera.RetrieveResult(5000, pylon.TimeoutHandling_ThrowException)
if grabResult.GrabSucceeded():
timestamp = datetime.utcnow()
......@@ -44,7 +45,7 @@ class take_img(Thread):
img = image.GetArray()
with GPS_lock:
(data_obj, is_moving) = GPS_ringbuf.get_dataobject(timestamp)
to_display_deque.append({'data': data_obj, 'free_mem': self.freememory, 'is_moving':is_moving})
to_display_deque.append({'data': data_obj, 'free_mem': freememory, 'free_mem_hdd': usbgb, 'is_moving':is_moving})
#save GPS data
if (self.GPS_check == False) or (self.save_GPS == True) and (is_moving == True):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment