Added ability to log data when test stand is commanded

This commit is contained in:
Martin Zietz
2021-02-15 12:56:42 +01:00
parent ab2619b184
commit 24281ad9f3
3 changed files with 124 additions and 34 deletions
+6 -2
View File
@@ -23,8 +23,6 @@ class ExecCSVThread(Thread):
def run(self):
ui.ui_print("Starting Sequence Execution...")
# g.threadLock.acquire() # Get lock to synchronize threads
# ToDo: add locking/synchronization? Works without so far but might be more robust
self.execute_sequence(self.array, 0.1, self.parent, self.controller) # run sequence
# reset buttons on UI:
if not g.exitFlag: # program window is open
@@ -64,6 +62,12 @@ class ExecCSVThread(Thread):
func.set_field(field_vec) # send field vector to test stand
ui.ui_print(time.time() - t_zero)
controller.StatusDisplay.update_labels() # update status display after change
# log change to the log file if user has selected event logging in the Configure Logging window
logger = controller.pages[ui.ConfigureLogging] # get object of logging configurator
if logger.event_logging: # data should be logged when test stand is commanded
logger.log_datapoint() # log data
i = i + 1 # next row
g.threadLock.release() # allow going back to main thread now