Line 71... |
Line 71... |
71 |
time.sleep(0.5) |
71 |
time.sleep(0.5) |
72 |
|
72 |
|
73 |
#### Data Logging ################################################### |
73 |
#### Data Logging ################################################### |
74 |
|
74 |
|
75 |
sys.stdout.write("ALTIMET data acquisition system started \n") |
75 |
sys.stdout.write("ALTIMET data acquisition system started \n") |
76 |
|
- |
|
- |
|
76 |
ser = serial.Serial('/dev/ttyUSB0', 9600, timeout=1) |
77 |
|
77 |
|
78 |
try: |
78 |
try: |
79 |
with open("temperature.log", "a") as f: |
79 |
with open("temperature.log", "a") as f: |
80 |
while True: |
80 |
while True: |
81 |
sys.stdout.write("Start measurement now? [ENTER]") |
81 |
sys.stdout.write("Start measurement now? [ENTER]") |
82 |
sys.stdin.readline() |
82 |
sys.stdin.readline() |
- |
|
83 |
|
- |
|
84 |
ser.write(':DISP?\n') |
- |
|
85 |
Prefstart = ser.readline(100) |
- |
|
86 |
|
83 |
gauge1.route() |
87 |
gauge1.route() |
84 |
(t1, p1) = gauge1.get_tp() |
88 |
(t1, p1) = gauge1.get_tp() |
85 |
gauge2.route() |
89 |
gauge2.route() |
86 |
(t2, p2) = gauge2.get_tp() |
90 |
(t2, p2) = gauge2.get_tp() |
87 |
gauge3.route() |
91 |
gauge3.route() |
Line 95... |
Line 99... |
95 |
# gauge7.route() |
99 |
# gauge7.route() |
96 |
# (t7, p7) = gauge7.get_tp() |
100 |
# (t7, p7) = gauge7.get_tp() |
97 |
gauge8.route() |
101 |
gauge8.route() |
98 |
(t8, p8) = gauge8.get_tp() |
102 |
(t8, p8) = gauge8.get_tp() |
99 |
|
103 |
|
- |
|
104 |
ser.write(':DISP?\n') |
- |
|
105 |
Prefstop = ser.readline(100) |
- |
|
106 |
|
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 )) |
107 |
sys.stdout.write(" Temperature: %.2f %.2f %.2f %.2f %.2f %.2f %.2f Pressure: %d %d %d %d %d %d %d %s %s Note: " % (t1, t2, t3, t4, t5, t6, t8, p1, p2, p3, p4, p5, p6, p8, Prefstart, Prefstop )) |
101 |
note = sys.stdin.readline() |
108 |
note = sys.stdin.readline() |
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, )) |
109 |
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\t%s\t%s\n" % (time.time(), datetime.datetime.now().isoformat(),t1, t2, t3, t4, t5, t6, t8, p1, p2, p3, p4, p5, p6, p8, Prefstart, Prefstop, note, )) |
103 |
sys.stdout.flush() |
110 |
sys.stdout.flush() |
104 |
time.sleep(0.5) |
111 |
# time.sleep(0.5) |
- |
|
112 |
|
105 |
except KeyboardInterrupt: |
113 |
except KeyboardInterrupt: |
- |
|
114 |
ser.close() |
106 |
sys.exit(0) |
115 |
sys.exit(0) |
107 |
|
116 |
|