-
Notifications
You must be signed in to change notification settings - Fork 1
/
LiveSerialPlotter.py
executable file
·48 lines (35 loc) · 1.29 KB
/
LiveSerialPlotter.py
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 15 11:42:26 2019
Live Serial Plotter
@author: ryanlittle
"""
import argparse
import logging
import sys
import tkinter
from LiveDataSource import LiveDataSource
from PlotterWindow import PlotterWindow
logger = logging.getLogger(__name__)
# =============================================================================
def main():
parser = argparse.ArgumentParser(description="loranet bridge")
parser.add_argument("-v", "--verbose", action="count", default=0, help="Increase verbosity of outut")
parser.add_argument("--max-points", default=10000, help="Maximum number of points to store (default: %(default)s)")
parser.add_argument("--max-inputs", default=5, help="Maximum number of vars to plot (default: %(default)s)")
args = parser.parse_args()
if args.verbose == 0:
level = logging.WARNING
elif args.verbose == 1:
level = logging.INFO
elif args.verbose > 1:
level = logging.DEBUG
logging.basicConfig(format="%(asctime)s.%(msecs)03d: %(message)s", level=level, stream=sys.stdout, datefmt="%H:%M:%S")
logger.debug("Running.")
pw = PlotterWindow(args)
LiveDataSource(args, pw)
pw.mainloop()
logger.debug("Quitting.")
if __name__ == "__main__":
main()