forked from zietzm/Helmholtz_Test_Bench
workaround for thread end problem on program close
This commit is contained in:
+5
-3
@@ -56,15 +56,17 @@ class ExecCSVThread(Thread):
|
||||
|
||||
t = time.time() - t_zero # get relative time
|
||||
if t >= array[i, 0]: # time for this row has come
|
||||
# g.threadLock.acquire(0)
|
||||
g.threadLock.acquire() # execute the next few lines before going back to the main thread
|
||||
|
||||
field_vec = array[i, 1:4] # extract desired field vector
|
||||
ui.ui_print("%f s: t = %0.2f s, target field vector = "
|
||||
ui.ui_print("%f s: t = %0.2f s, target field vector = " # ToDo: better printing
|
||||
% (time.time() - t_zero, array[i, 0]), field_vec * 1e6, "\u03BCT")
|
||||
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
|
||||
i = i + 1 # next row
|
||||
# g.threadLock.release()
|
||||
|
||||
g.threadLock.release() # allow going back to main thread now
|
||||
|
||||
elif t >= array[i, 0] - delay - 0.02: # next change time is close, not enough time to sleep
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user