@@ -149,9 +149,6 @@ def sendMessage(self, message, timeout=0.1):
149149 continue
150150 else :
151151 # line without any eol chars
152- #myLine=thisLine.encode('ascii')
153- #myLine=thisLine.rstrip(eol.encode('ascii'))
154- #lines.append(thisLine)
155152 lines .append (thisLine .rstrip (eol .encode ('ascii' )))
156153 nEmpty = 0
157154
@@ -180,7 +177,7 @@ def measure(self):
180177 """
181178 # use a long timeout for measurement:
182179 val = self .sendMessage (b'MES' , timeout = 5 )
183- valstrip = val .strip (b'\n \r >' )
180+ valstrip = val .strip (b'\n \r >' )
184181 vals = valstrip .split (b',' )
185182 ok = (vals [0 ] == 'OK00' )
186183 # transform raw x,y,z by calibration matrix
@@ -210,15 +207,14 @@ def getInfo(self):
210207
211208 """
212209 val = self .sendMessage (b'IDR' )
213- valstrip = val .strip (b'\n \r >' )
214- val = valstrip .split (b',' )
210+ valstrip = val .strip (b'\n \r >' )
211+ val = valstrip .split (b',' )
215212 ok = (val [0 ] == b'OK00' )
216213 if ok :
217214 firmware = val [2 ]
218215 serialNum = val [4 ]
219216 firmBuild = val [- 1 ]
220217 else :
221- print ('not ok' )
222218 firmware = 0
223219 serialNum = 0
224220 firmBuild = 0
@@ -290,7 +286,7 @@ def getCalibMatrix(self):
290286 for rowN in range (3 ):
291287 rowName = 'r0%i' % (rowN + 1 )
292288 val = self .sendMessage (rowName .encode ('ascii' ), timeout = 1.0 )
293- valstrip = val .strip (b'\n \r >' )
289+ valstrip = val .strip (b'\n \r >' )
294290 vals = valstrip .split (b',' ) # convert to list of values
295291 if vals [0 ] == b'OK00' and len (vals ) > 1 :
296292 # convert to numpy array
0 commit comments