Rev 554 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 554 | Rev 556 | ||
---|---|---|---|
Line 114... | Line 114... | ||
114 | print "Opening comPort... " |
114 | print "Opening comPort... " |
115 | mk = mkProto.MkComm() |
115 | mk = mkProto.MkComm() |
116 | mk.open(comPort=parComPort) |
116 | mk.open(comPort=parComPort) |
Line 117... | Line 117... | ||
117 | 117 | ||
118 | msg = mk.getVersionMsg() |
118 | msg = mk.getVersionMsg() |
119 | voltage = 0 |
119 | version = msg.getVersion() |
120 | if parVerbose: |
120 | if parVerbose: |
- | 121 | print "Version: %d.%d" % version |
|
- | 122 | if version != (0,74): |
|
- | 123 | print "INVALID VERSION", version |
|
- | 124 | sys.exit(2) |
|
Line 121... | Line 125... | ||
121 | print "Version: %d.%d" % msg.getVersion() |
125 | |
- | 126 | ||
122 | 127 | msg = mk.getDebugMsg() |
|
123 | msg = mk.getDebugMsg() |
128 | voltage = msg.getVoltage() |
124 | if (voltage > 4.2*3): |
129 | if (voltage > 4.2*3): |
125 | minVoltage = 4*3.5 |
130 | minVoltage = 4*3.5 |
Line 159... | Line 164... | ||
159 | for channel in parChannels: |
164 | for channel in parChannels: |
160 | channelName = CHANNEL_NAMES[channel] |
165 | channelName = CHANNEL_NAMES[channel] |
161 | if parVerbose: |
166 | if parVerbose: |
162 | print "Getting data... " , |
167 | print "Getting data... " , |
163 | data = mk.doVibrationTest(motorSpeeds, parNbSamples, channel) |
168 | data = mk.doVibrationTest(motorSpeeds, parNbSamples, channel) |
- | 169 | #data = (0,1,2) |
|
164 | minval = min(data[1:]) |
170 | minval = min(data[1:]) |
165 | maxval = max(data[1:]) |
171 | maxval = max(data[1:]) |
166 | if (maxval-minval)>100: print data |
172 | #if (maxval-minval)>100: print data |
- | 173 | time.sleep(.1) |
|
167 | msg = mk.getDebugMsg() |
174 | msg = mk.getDebugMsg() |
168 | voltage = msg.getVoltage() |
175 | voltage = msg.getVoltage() |
Line 169... | Line 176... | ||
169 | 176 | ||
170 | if voltage<minVoltage: |
177 | if voltage<minVoltage: |
171 | print "VOLTAGE TOO LOW, TEST ABORTED" |
178 | print "VOLTAGE TOO LOW, TEST ABORTED" |
172 | sys.exit(2) |
179 | sys.exit(2) |
- | 180 | ||
173 | 181 | pp = maxval-minval; |
|
- | 182 | print "%10s Speed=%3d U=%2.1fV Channel=%-10s Min=%3d Max=%3d pp=%3d" % (parTestName, speed, voltage, channelName, minval, maxval, pp), |
|
Line 174... | Line 183... | ||
174 | print "%s Speed=%3d U=%2.1fV Channel=%-10s Min=%3d Max=%3d pp=%3d" % (parTestName, speed, voltage, channelName, minval, maxval, maxval-minval) |
183 | print "*"*(min(pp,200)/5) |
175 | 184 | ||
176 | if parFileName != None: |
185 | if parFileName != None: |
177 | try: |
186 | try: |