forked from zietzm/Helmholtz_Test_Bench
minor UI tweaks
- fixed bug where log data could not be cleared after saving to file - added description for coil constant in settings page - minor message tweaks
This commit is contained in:
+10
-4
@@ -574,7 +574,8 @@ class Configuration(Frame):
|
||||
# Setup dictionary to generate entry table from
|
||||
# {Key: [[x-value,y-value,z-value], unit, description, config file key, unit conversion factor]}
|
||||
self.entries = {
|
||||
"Coil Constants:": [[DoubleVar() for _ in range(3)], "\u03BCT/A", "", "coil_const", 1e6],
|
||||
"Coil Constants:": [[DoubleVar() for _ in range(3)], "\u03BCT/A", "Field generated per applied current",
|
||||
"coil_const", 1e6],
|
||||
"Ambient Field:": [[DoubleVar() for _ in range(3)], "\u03BCT",
|
||||
"Field to be compensated", "ambient_field", 1e6],
|
||||
"Resistances:": [[DoubleVar() for _ in range(3)], "\u03A9",
|
||||
@@ -958,18 +959,22 @@ class ConfigureLogging(Frame):
|
||||
|
||||
def clear_data(self): # called on button press, asks user if he want to save logged data and then deletes it
|
||||
if log.unsaved_data: # there is logged data that has not been written to a file yet
|
||||
# open pop-up to ask user if he wants to save the data:
|
||||
# open pop-up to ask user if he wants to save the data or cancel clearing it:
|
||||
save_log = messagebox.askyesnocancel("Save log data?", "There seems to be unsaved logging data. "
|
||||
"Do you wish to write it to a file before deleting?")
|
||||
if save_log: # user has chosen yes
|
||||
self.write_to_file() # run write to file function to save data
|
||||
if save_log is not None:
|
||||
if save_log is not None: # user has chosen yes or no (not cancel)
|
||||
log.clear_logged_data() # delete the logged data
|
||||
log.unsaved_data = False # tell everything that there is no unsaved data remaining
|
||||
self.logged_datapoints.set(len(log.log_data)) # update the label showing how much data has been logged
|
||||
ui_print("Log data cleared.")
|
||||
else:
|
||||
else: # user has chosen to cancel
|
||||
ui_print("Log data not cleared.")
|
||||
else: # there is no unsaved data
|
||||
log.clear_logged_data() # delete the logged data
|
||||
self.logged_datapoints.set(len(log.log_data)) # update the label showing how much data has been logged
|
||||
ui_print("Log data cleared.")
|
||||
|
||||
def update_choices(self): # updates the list storing which checkboxes are currently ticked
|
||||
# (this is passed to logging functions and determines which data is logged)
|
||||
@@ -1092,6 +1097,7 @@ class StatusDisplay(Frame):
|
||||
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)
|
||||
print(axis.name, axis.polarity_switched)
|
||||
i += 1
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user