Merge branch 'main' of https://github.com/Seal-Ammonia/Read-Sensor-Resistances
This commit is contained in:
commit
ece0630adb
|
@ -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")
|
||||||
|
|
|
@ -79,6 +79,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 = max(self.fontSize, 10))
|
plt.xticks(fontsize = max(self.fontSize, 10))
|
||||||
plt.yticks(fontsize = max(self.fontSize, 10))
|
plt.yticks(fontsize = max(self.fontSize, 10))
|
||||||
|
|
1
test.py
1
test.py
|
@ -72,6 +72,7 @@ def gen_settings(resistors, input_voltage, port, filename, window_size, font_siz
|
||||||
settings["fontSize"] = font_size
|
settings["fontSize"] = font_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