Added arduino com port to config file. Removed log spam

This commit is contained in:
2021-10-24 11:59:13 +02:00
parent 33331e829a
commit 1144e5fae9
7 changed files with 49 additions and 28 deletions
+8 -5
View File
@@ -1172,17 +1172,18 @@ class HardwareConfiguration(Frame):
port_frame.grid(row=row_counter, column=0, sticky=W)
# text for the description labels:
entry_texts = ["XY PSU Serial Port:", "Z PSU Serial Port:"]
entry_texts = ["Arduino Serial Port:", "XY PSU Serial Port:", "Z PSU Serial Port:"]
# create variables to store the port names and set to current names
self.arduino_port = StringVar(value=g.CAGE_DEVICE.com_port_arduino)
self.XY_port = StringVar(value=g.CAGE_DEVICE.com_port_psu1)
self.Z_port = StringVar(value=g.CAGE_DEVICE.com_port_psu2)
port_vars = [self.XY_port, self.Z_port] # list to store both port variables
port_vars = [self.arduino_port, self.XY_port, self.Z_port] # list to store both port variables
row = 0
for text in entry_texts: # do this for both ports
field = Entry(port_frame, textvariable=port_vars[row]) # create entry field
field.grid(row=row, column=1, sticky=W)
axis_label = Label(port_frame, text=text, padx=5, pady=10) # create description label
axis_label.grid(row=row, column=0, sticky=W)
axis_label = Label(port_frame, text=text) # create description label
axis_label.grid(row=row, column=0, padx=5, pady=5, sticky=W)
info_label = Label(port_frame, text="e.g. COM10") # add label with example of right format
info_label.grid(row=row, column=2, sticky=W)
row += 1
@@ -1278,6 +1279,7 @@ class HardwareConfiguration(Frame):
# set values for PSU serial ports:
self.XY_port.set(g.CAGE_DEVICE.com_port_psu1)
self.Z_port.set(g.CAGE_DEVICE.com_port_psu2)
self.arduino_port.set(g.CAGE_DEVICE.com_port_arduino)
for key in self.entries.keys(): # go through the main value table
for i in range(3): # go through all three axes
@@ -1300,6 +1302,7 @@ class HardwareConfiguration(Frame):
# set serial ports for PSUs:
config.edit_config("Supplies", "xy_port", self.XY_port.get())
config.edit_config("Supplies", "z_port", self.Z_port.get())
config.edit_config("Supplies", "arduino_port", self.arduino_port.get())
# set numeric values for all axes
for key in self.entries.keys(): # go through rows of entry table
@@ -1786,7 +1789,7 @@ class OutputConsole(Frame):
while True:
msg = self.print_queue.get(block=False)
# print to console
self.console.insert(END, "\n" + msg)
self.console.insert(END, msg + "\n")
except Empty:
pass
self.console.see(END) # scroll console to bottom