forked from zietzm/Helmholtz_Test_Bench
implemented readouts in status display
This commit is contained in:
+18
-5
@@ -81,7 +81,10 @@ class StatusDisplay(Frame):
|
||||
col = col + 1 # move to next column
|
||||
rowCounter = rowCounter + 1 # increase row counter to place future stuff below header
|
||||
|
||||
TextLabels = ["Port:", "Channel:", "Output:"] # define content of row entries
|
||||
# define content of row entries
|
||||
TextLabels = ["Serial Port:", "PSU Channel:", "Connection Status:", "Output:", "Remote Control:",
|
||||
"Voltage Setpoint:", "Actual Voltage:", "Current Setpoint:", "Actual Current:", " ",
|
||||
"Target Field:", "Trgt. Field Raw:", "Target Current:", "Inverted:"]
|
||||
self.rowNo = len(TextLabels) # get number of label rows
|
||||
|
||||
self.columnNo = 6 # number of label columns
|
||||
@@ -98,7 +101,7 @@ class StatusDisplay(Frame):
|
||||
col = 0
|
||||
for LabelCol in self.Labels: # place row entries in grid layout for all columns
|
||||
for row in range(self.rowNo): # place row entries
|
||||
LabelCol[row].grid(row=row+rowCounter, column=col, sticky="w")
|
||||
LabelCol[row].grid(row=row+rowCounter, column=col, sticky="w", padx=10)
|
||||
col = col + 1
|
||||
rowCounter = rowCounter + self.rowNo # increase row counter to place future stuff below this
|
||||
|
||||
@@ -106,12 +109,22 @@ class StatusDisplay(Frame):
|
||||
|
||||
def update_labels(self, controller):
|
||||
i = 0
|
||||
for axis in g.AXES: # ToDo: switch to proper axes when PSU connected
|
||||
for axis in g.AXES:
|
||||
if axis.device is not None:
|
||||
axis.update_values()
|
||||
self.label_dict["Port:"][i].set(g.ports[i])
|
||||
self.label_dict["Channel:"][i].set(axis.channel)
|
||||
self.label_dict["Serial Port:"][i].set(g.ports[i])
|
||||
self.label_dict["PSU Channel:"][i].set(axis.channel)
|
||||
self.label_dict["Connection Status:"][i].set(axis.connected)
|
||||
self.label_dict["Output:"][i].set(axis.output_active)
|
||||
self.label_dict["Remote Control:"][i].set(axis.remote_ctrl_active)
|
||||
self.label_dict["Voltage Setpoint:"][i].set("%0.3f V" % axis.voltage_setpoint)
|
||||
self.label_dict["Actual Voltage:"][i].set("%0.3f V" % axis.voltage)
|
||||
self.label_dict["Current Setpoint:"][i].set("%0.3f A" % axis.current_setpoint)
|
||||
self.label_dict["Actual Current:"][i].set("%0.3f A" % axis.current)
|
||||
self.label_dict["Target Field:"][i].set("%0.3f \u03BCT" % (axis.target_field*1e6))
|
||||
self.label_dict["Trgt. Field Raw:"][i].set("%0.3f \u03BCT" % (axis.target_field_comp*1e6))
|
||||
self.label_dict["Target Current:"][i].set("%0.3f A" % axis.target_current)
|
||||
self.label_dict["Inverted:"][i].set(axis.polarity_switched)
|
||||
i = i+1
|
||||
controller.after(2000, lambda: self.update_labels(controller))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user