-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathospylloscope.py
More file actions
31 lines (23 loc) · 1.04 KB
/
ospylloscope.py
File metadata and controls
31 lines (23 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Based on https://learn.sparkfun.com/tutorials/graph-sensor-data-with-python-and-matplotlib/all
import matplotlib.pyplot as plt
import threading
import ospy_lib as ospy
if __name__ == '__main__':
# Creating, if necessary, the screenshots folder
ospy.init_screenshot_folder()
# Initializing the socket + connecting with the source
s = ospy.init_socket()
conn = ospy.connector(s)
# Printing useful header for the tuning phase
ospy.print_tuning_INFO()
# Stopping the data gatherer thread
dg_thread = threading.Thread(target=ospy.data_gatherer, args=(s, conn,))
dg_thread.start()
# Pre-formatting the plots based on configuration inputs
ospy.pre_format_subplots(ospy.fig, ospy.ax, ospy.line_list, ospy.thr_line_list)
# Initializing and starting animation
ospy.init_animation()
# plt.get_current_fig_manager().window.state('zoomed') # auto full screen https://stackoverflow.com/a/22418354
plt.show()
# Stopping the data gatherer thread when closing the fig window
ospy.dg_stop.set()