aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/argaze/utils/contexts/TobiiProGlasses2.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/argaze/utils/contexts/TobiiProGlasses2.py b/src/argaze/utils/contexts/TobiiProGlasses2.py
index fbc9d1e..ce935e9 100644
--- a/src/argaze/utils/contexts/TobiiProGlasses2.py
+++ b/src/argaze/utils/contexts/TobiiProGlasses2.py
@@ -599,6 +599,12 @@ class LiveStream(ArFeatures.DataCaptureContext):
logging.debug('> starting battery status thread...')
self.__check_battery_thread.start()
+ # Init calibration status
+ self.__calibration_status = 'uncalibrated'
+
+ # Init recording status
+ self.__recording_status = 'stopped'
+
return self
@DataFeatures.PipelineStepExit
@@ -1032,6 +1038,11 @@ class LiveStream(ArFeatures.DataCaptureContext):
self.__recording_status = self.__wait_for_recording_status(self.__recording_id, ['paused'])
def get_recording_status(self) -> str:
+ """Get recording status.
+
+ Returns:
+ status: 'init', 'starting', 'recording', 'pausing', 'paused', 'stopping', 'stopped', 'done', 'stale' or 'failed' string
+ """
return self.__recording_status
@@ -1076,7 +1087,7 @@ class LiveStream(ArFeatures.DataCaptureContext):
# Display calibration status
calibration_panel = ((int(width/2), 0), (width, 50))
- if self.__calibration_status is None:
+ if self.__calibration_status == 'uncalibrated':
cv2.rectangle(image, calibration_panel[0], calibration_panel[1], (0, 0, 0), -1)
cv2.putText(image, 'Calibration required', (calibration_panel[0][0]+20, calibration_panel[0][1]+40), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 255), 1, cv2.LINE_AA)
@@ -1089,7 +1100,7 @@ class LiveStream(ArFeatures.DataCaptureContext):
elif self.__calibration_status != 'calibrated':
cv2.rectangle(image, calibration_panel[0], calibration_panel[1], (0, 0, 127), -1)
- cv2.putText(image, f'Calibration {calibration_status}', (calibration_panel[0][0]+20, calibration_panel[0][1]+40), cv2.FONT_HERSHEY_SIMPLEX, 1, (255, 255, 255), 1, cv2.LINE_AA)
+ cv2.putText(image, f'Calibration {self.__calibration_status}', (calibration_panel[0][0]+20, calibration_panel[0][1]+40), cv2.FONT_HERSHEY_SIMPLEX, 1, (255, 255, 255), 1, cv2.LINE_AA)
else:
@@ -1114,7 +1125,7 @@ class LiveStream(ArFeatures.DataCaptureContext):
cv2.putText(image, f'Battery {self.__battery_level}%', (width - 220, 40), cv2.FONT_HERSHEY_SIMPLEX, 1, text_color, 1, cv2.LINE_AA)
# Display recording status
- if self.__recording_status is None:
+ if self.__recording_status == 'stopped':
circle_color = (0, 0, 0)