Commit a621482e38867a65305089b296b1e2832a5c0210
1 parent
a63df0ea
Exists in
master
Minor cleaning up after earlier changes
Showing
2 changed files
with
9 additions
and
8 deletions
Show diff stats
robots/little_john/telemetry/code/monitor/graph_plotter_rewrite.py
1 | 1 | #!/usr/bin/env python3 |
2 | +# Note that this should mostly work with python2, if necessary | |
2 | 3 | |
3 | 4 | # Tool to draw live graphs of data coming in from serial port |
4 | 5 | # Written as a telemetry tool by: |
... | ... | @@ -6,32 +7,31 @@ |
6 | 7 | |
7 | 8 | # This code is incomplete, and is missing core features |
8 | 9 | |
9 | -import pyglet | |
10 | 10 | #import math |
11 | 11 | #import time |
12 | 12 | #import serial |
13 | + | |
14 | +import pyglet | |
13 | 15 | import numpy |
14 | 16 | import os |
15 | 17 | import platform |
16 | 18 | import sys |
17 | 19 | import easygui |
18 | 20 | import logging |
19 | -from serialselect import selectserial | |
20 | 21 | |
22 | +from serialselect import selectserial | |
21 | 23 | from colours import * |
22 | 24 | |
23 | -logging.basicConfig(format='%(levelname)s:\t%(message)s', | |
24 | - level=logging.DEBUG) | |
25 | +logging.basicConfig(format='%(levelname)s:\t%(message)s', level=logging.DEBUG) | |
25 | 26 | logging.info("Logging system active") |
26 | 27 | |
27 | 28 | datafeed = selectserial() |
28 | 29 | |
29 | 30 | if datafeed == None: |
30 | - message = "Failed to open serial port" | |
31 | - logging.critical(message) | |
31 | + logging.critical("Failed to open serial port") | |
32 | 32 | sys.exit() |
33 | 33 | |
34 | -if platform.system()=='Windows': #easier than passing vars | |
34 | +if platform.system()=='Windows': | |
35 | 35 | os='Windows' |
36 | 36 | else: |
37 | 37 | os='Other' |
... | ... | @@ -168,7 +168,7 @@ def pollSerial(elapsed): |
168 | 168 | if os=='Windows': |
169 | 169 | values = datafeed.readline().strip().split(b", ") |
170 | 170 | else: |
171 | - values = datafeed.readline().strip()#.split(', ') | |
171 | + values = datafeed.readline().strip() | |
172 | 172 | values = str(values).split(", ") |
173 | 173 | testseries.addpoint(values) |
174 | 174 | ... | ... |
robots/little_john/telemetry/code/monitor/serialselect.py