review
This commit is contained in:
parent
8fb8ae9d4e
commit
b6332045ac
|
@ -63,7 +63,7 @@ def read():
|
||||||
time.sleep(delay / 1000)
|
time.sleep(delay / 1000)
|
||||||
exit(0)
|
exit(0)
|
||||||
else:
|
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
|
# open the file and add a line of header to it, then close
|
||||||
f = open(file_name, "a", newline="", encoding="utf-8")
|
f = open(file_name, "a", newline="", encoding="utf-8")
|
||||||
|
|
|
@ -78,6 +78,7 @@ class SerialPlotter:
|
||||||
self.axs.plot(self.timeStamps[i], self.sensorsData[i], color=self.colors[i],
|
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$')
|
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)
|
# Make the font size of values placed on x-axis and y-aixs equal to 16 (large enough)
|
||||||
plt.xticks(fontsize = 16)
|
plt.xticks(fontsize = 16)
|
||||||
plt.yticks(fontsize = 16)
|
plt.yticks(fontsize = 16)
|
||||||
|
|
1
test.py
1
test.py
|
@ -70,6 +70,7 @@ def gen_settings(resistors, input_voltage, port, filename, window_size, delay):
|
||||||
settings["winSize"] = window_size
|
settings["winSize"] = window_size
|
||||||
settings["file_name"] = filename
|
settings["file_name"] = filename
|
||||||
settings["delay"] = delay
|
settings["delay"] = delay
|
||||||
|
settings["font_size"] = frame.fontSize.GetValue()
|
||||||
open(name, 'w').write(json.dumps(settings, indent=4))
|
open(name, 'w').write(json.dumps(settings, indent=4))
|
||||||
open(filename, "a", newline="", encoding="utf-8")
|
open(filename, "a", newline="", encoding="utf-8")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue