|
@@ -58,12 +58,14 @@ class MainWindow(tk.Frame):
|
|
tk.Label(self.controls, textvariable=self.opt_dro_offset, anchor="nw").pack(side="top", fill="both", expand=False)
|
|
tk.Label(self.controls, textvariable=self.opt_dro_offset, anchor="nw").pack(side="top", fill="both", expand=False)
|
|
tk.Label(self.controls, textvariable=self.opt_dro_size, anchor="nw").pack(side="top", fill="both", expand=False)
|
|
tk.Label(self.controls, textvariable=self.opt_dro_size, anchor="nw").pack(side="top", fill="both", expand=False)
|
|
|
|
|
|
|
|
+ self.mag_dro_val_sums = np.ndarray((4), dtype=np.float)
|
|
|
|
+ self.mag_dro_val_count = 0
|
|
self.mag_label = tk.Label(self.controls, text="Magnetic Sensor", anchor="c", font=("Helvatica", 10, 'bold'))
|
|
self.mag_label = tk.Label(self.controls, text="Magnetic Sensor", anchor="c", font=("Helvatica", 10, 'bold'))
|
|
self.mag_label.pack(side="top", fill="both", expand=False)
|
|
self.mag_label.pack(side="top", fill="both", expand=False)
|
|
self.mag_dro_x = tk.StringVar()
|
|
self.mag_dro_x = tk.StringVar()
|
|
self.mag_dro_y = tk.StringVar()
|
|
self.mag_dro_y = tk.StringVar()
|
|
- self.mag_dro_val_sums = tk.StringVar()
|
|
|
|
- self.mag_dro_val_count = tk.StringVar()
|
|
|
|
|
|
+ self.mag_dro_offset_x = tk.StringVar()
|
|
|
|
+ self.mag_dro_offset_y = tk.StringVar()
|
|
tk.Label(self.controls, textvariable=self.mag_dro_x, anchor = "nw").pack(side = "top", fill = "both", expand = False)
|
|
tk.Label(self.controls, textvariable=self.mag_dro_x, anchor = "nw").pack(side = "top", fill = "both", expand = False)
|
|
tk.Label(self.controls, textvariable=self.mag_dro_y, anchor = "nw").pack(side = "top", fill = "both", expand = False)
|
|
tk.Label(self.controls, textvariable=self.mag_dro_y, anchor = "nw").pack(side = "top", fill = "both", expand = False)
|
|
tk.Label(self.controls, textvariable=self.mag_dro_x, anchor = "nw").pack(side = "top", fill = "both", expand = False)
|
|
tk.Label(self.controls, textvariable=self.mag_dro_x, anchor = "nw").pack(side = "top", fill = "both", expand = False)
|
|
@@ -138,7 +140,7 @@ class MainWindow(tk.Frame):
|
|
else:
|
|
else:
|
|
self.opt_label.config(fg="black", bg="yellow")
|
|
self.opt_label.config(fg="black", bg="yellow")
|
|
|
|
|
|
- if not self.mag_sensor.:
|
|
|
|
|
|
+ if not self.mag_sensor.success:
|
|
self.mag_label.config(fg="white", bg="red")
|
|
self.mag_label.config(fg="white", bg="red")
|
|
elif len(mag_positions) > 0:
|
|
elif len(mag_positions) > 0:
|
|
self.mag_label.config(fg="white", bg="green")
|
|
self.mag_label.config(fg="white", bg="green")
|
|
@@ -160,7 +162,7 @@ class MainWindow(tk.Frame):
|
|
self.ac_dro_t1.set("t1: {:.3f} ms".format(self.ac_dro_val_sums[2]/1000))
|
|
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_t2.set("t2: {:.3f} ms".format(self.ac_dro_val_sums[3]/1000))
|
|
|
|
|
|
- self.ac_dro_val_sums.fill(0)
|
|
|
|
|
|
+ self.ac_dro_val_sums.fill(0)
|
|
self.ac_dro_val_count = 0
|
|
self.ac_dro_val_count = 0
|
|
|
|
|
|
if self.opt_dro_val_count > 0:
|
|
if self.opt_dro_val_count > 0:
|
|
@@ -170,12 +172,22 @@ class MainWindow(tk.Frame):
|
|
|
|
|
|
self.opt_dro_x.set("X: {:.1f} mm".format(self.opt_dro_val_sums[0]))
|
|
self.opt_dro_x.set("X: {:.1f} mm".format(self.opt_dro_val_sums[0]))
|
|
self.opt_dro_y.set("Y: {:.1f} mm".format(self.opt_dro_val_sums[1]))
|
|
self.opt_dro_y.set("Y: {:.1f} mm".format(self.opt_dro_val_sums[1]))
|
|
- self.opt_dro_offset.set("offset: {:.1f} %".format(self.opt_dro_val_sums[2]*100))
|
|
|
|
- self.opt_dro_size.set("size: {:.1f} %".format(self.opt_dro_val_sums[3]*100))
|
|
|
|
|
|
+ self.opt_dro_offset.set("X Offset: {:.1f} %".format(self.opt_dro_val_sums[2]*100))
|
|
|
|
+ self.opt_dro_size.set("Y Offset: {:.1f} %".format(self.opt_dro_val_sums[3]*100))
|
|
|
|
|
|
self.opt_dro_val_sums.fill(0)
|
|
self.opt_dro_val_sums.fill(0)
|
|
self.opt_dro_val_count = 0
|
|
self.opt_dro_val_count = 0
|
|
|
|
|
|
|
|
+ if self.mag_dro_val_count > 0:
|
|
|
|
+ self.mag_dro_val_sums /= self.mag_dro_val_count
|
|
|
|
+ else:
|
|
|
|
+ self.mag_dro_val_sums.fill(0)
|
|
|
|
+
|
|
|
|
+ self.mag_dro_x.set("X: {:.1f} mm".format(self.opt_dro_val_sums[0]))
|
|
|
|
+ self.mag_dro_y.set("Y: {:.1f} mm".format(self.opt_dro_val_sums[1]))
|
|
|
|
+ self.mag_dro_offset_x.set("offset: {:.1f} %".format(self.opt_dro_val_sums[2]*100))
|
|
|
|
+ self.mag_dro_offset_y.set("size: {:.1f} %".format(self.opt_dro_val_sums[3]*100))
|
|
|
|
+
|
|
if self.popup_window:
|
|
if self.popup_window:
|
|
self.popup_window.update()
|
|
self.popup_window.update()
|
|
|
|
|