Line 70... |
Line 70... |
70 |
gauge8 = cfg.get_device("altimet8") |
70 |
gauge8 = cfg.get_device("altimet8") |
71 |
time.sleep(0.5) |
71 |
time.sleep(0.5) |
72 |
|
72 |
|
73 |
#### Data Logging ################################################### |
73 |
#### Data Logging ################################################### |
74 |
|
74 |
|
75 |
#ser = serial.Serial('/dev/ttyUSB0', 9600, timeout=1) |
- |
|
76 |
#print ser.name |
- |
|
77 |
#ser.write("hello") |
- |
|
78 |
#http://pyserial.sourceforge.net/shortintro.html |
- |
|
79 |
#line = ser.readline() # read a '\n' terminated line |
75 |
sys.stdout.write("ALTIMET data acquisition system started \n") |
80 |
#ser.close() |
76 |
|
81 |
|
77 |
|
82 |
try: |
78 |
try: |
83 |
with open("temperature.log", "a") as f: |
79 |
with open("temperature.log", "a") as f: |
84 |
while True: |
80 |
while True: |
85 |
sys.stdout.write("Start measurement now? [ENTER]") |
81 |
sys.stdout.write("Start measurement now? [ENTER]") |
Line 99... |
Line 95... |
99 |
# gauge7.route() |
95 |
# gauge7.route() |
100 |
# (t7, p7) = gauge7.get_tp() |
96 |
# (t7, p7) = gauge7.get_tp() |
101 |
gauge8.route() |
97 |
gauge8.route() |
102 |
(t8, p8) = gauge8.get_tp() |
98 |
(t8, p8) = gauge8.get_tp() |
103 |
|
99 |
|
104 |
sys.stdout.write(" Temperature: %.2f %.2f %.2f %.2f %.2f %.2f %.2f Pressure: %d %d %d %d %d %d %d Note: " % (t1, t2, t3, t4, t5, t6, t8, p1, p2, p3, p4, p5, p6, p8, )) |
100 |
sys.stdout.write(" Temperature: %.2f %.2f %.2f %.2f %.2f %.2f %.2f Pressure: %d %d %d %d %d %d %d Note: " % (t1, t2, t3, t4, t5, t6, t8, p1, p2, p3, p4, p5, p6, p8 )) |
105 |
note = sys.stdin.readline() |
101 |
note = sys.stdin.readline() |
106 |
f.write("%d\t%s\t%.2f\t%.2f\t%.2f\t%.2f\t%.2f\t%.2f\t%.2f\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%s\n" % (time.time(), datetime.datetime.now().isoformat(),t1, t2, t3, t4, t5, t6, t8, p1, p2, p3, p4, p5, p6, p8, note, )) |
102 |
f.write("%d\t%s\t%.2f\t%.2f\t%.2f\t%.2f\t%.2f\t%.2f\t%.2f\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%s\n" % (time.time(), datetime.datetime.now().isoformat(),t1, t2, t3, t4, t5, t6, t8, p1, p2, p3, p4, p5, p6, p8, note, )) |
107 |
sys.stdout.flush() |
103 |
sys.stdout.flush() |
108 |
time.sleep(0.5) |
104 |
time.sleep(0.5) |
109 |
except KeyboardInterrupt: |
105 |
except KeyboardInterrupt: |
110 |
sys.exit(0) |
106 |
sys.exit(0) |
111 |
|
107 |
|