|
@@ -59,25 +59,24 @@ class MainWindow(tk.Frame):
|
|
self.ac_dro_val_count += 1
|
|
self.ac_dro_val_count += 1
|
|
|
|
|
|
# graph shows all values as a line
|
|
# graph shows all values as a line
|
|
- if len(ac_positions) > 0:
|
|
|
|
- self.graph.update([ac_positions])
|
|
|
|
-
|
|
|
|
- # readouts will only be updated so often
|
|
|
|
- if self.controlsUpdateTime + 0.4 < time.time():
|
|
|
|
- self.controlsUpdateTime = time.time()
|
|
|
|
- # they display the average of all values
|
|
|
|
- if self.ac_dro_val_count > 0:
|
|
|
|
- self.ac_dro_val_sums /= self.ac_dro_val_count
|
|
|
|
- else:
|
|
|
|
- self.ac_dro_val_sums.fill(0)
|
|
|
|
-
|
|
|
|
- self.ac_dro_x.set("X: {:.1f} mm".format(self.ac_dro_val_sums[0]))
|
|
|
|
- self.ac_dro_y.set("Y: {:.1f} mm".format(self.ac_dro_val_sums[1]))
|
|
|
|
- self.ac_dro_t1.set("t1: {:.3f} ms".format(self.ac_dro_val_sums[2]/1000))
|
|
|
|
- self.ac_dro_t2.set("t2: {:.3f} ms".format(self.ac_dro_val_sums[3]/1000))
|
|
|
|
-
|
|
|
|
|
|
+ self.graph.update([ac_positions])
|
|
|
|
+
|
|
|
|
+ # readouts will only be updated so often
|
|
|
|
+ if self.controlsUpdateTime + 0.4 < time.time():
|
|
|
|
+ self.controlsUpdateTime = time.time()
|
|
|
|
+ # they display the average of all values
|
|
|
|
+ if self.ac_dro_val_count > 0:
|
|
|
|
+ self.ac_dro_val_sums /= self.ac_dro_val_count
|
|
|
|
+ else:
|
|
self.ac_dro_val_sums.fill(0)
|
|
self.ac_dro_val_sums.fill(0)
|
|
- self.ac_dro_val_count = 0
|
|
|
|
|
|
+
|
|
|
|
+ self.ac_dro_x.set("X: {:.1f} mm".format(self.ac_dro_val_sums[0]))
|
|
|
|
+ self.ac_dro_y.set("Y: {:.1f} mm".format(self.ac_dro_val_sums[1]))
|
|
|
|
+ self.ac_dro_t1.set("t1: {:.3f} ms".format(self.ac_dro_val_sums[2]/1000))
|
|
|
|
+ self.ac_dro_t2.set("t2: {:.3f} ms".format(self.ac_dro_val_sums[3]/1000))
|
|
|
|
+
|
|
|
|
+ self.ac_dro_val_sums.fill(0)
|
|
|
|
+ self.ac_dro_val_count = 0
|
|
|
|
|
|
if self.popup:
|
|
if self.popup:
|
|
self.popup.update()
|
|
self.popup.update()
|