This commit is contained in:
Ryan Xu 2023-03-06 21:16:17 -08:00
commit ece0630adb
3 changed files with 3 additions and 1 deletions

View File

@ -63,7 +63,7 @@ def read():
time.sleep(delay / 1000)
exit(0)
else:
controller = serial.Serial(port, baudrate=baud)
controller = serial.Serial(port, baudrate=baud) # TODO: sometimes serial port is in use, make it promt user when it happens
# open the file and add a line of header to it, then close
f = open(file_name, "a", newline="", encoding="utf-8")

View File

@ -79,6 +79,7 @@ class SerialPlotter:
self.axs.plot(self.timeStamps[i], self.sensorsData[i], color=self.colors[i],
label=f'sensor {i + 1}, latest: {np.format_float_scientific(self.sensorsData[i][-1], precision = 2)} $\Omega$')
# TODO: make the font size an UI option from the settings.json
# Make the font size of values placed on x-axis and y-aixs equal to 16 (large enough)
plt.xticks(fontsize = max(self.fontSize, 10))
plt.yticks(fontsize = max(self.fontSize, 10))

View File

@ -72,6 +72,7 @@ def gen_settings(resistors, input_voltage, port, filename, window_size, font_siz
settings["fontSize"] = font_size
settings["file_name"] = filename
settings["delay"] = delay
settings["font_size"] = frame.fontSize.GetValue()
open(name, 'w').write(json.dumps(settings, indent=4))
open(filename, "a", newline="", encoding="utf-8")