##// END OF EJS Templates
Removing unnecesary code
imanay -
r269:270
parent child
Show More
@@ -320,27 +320,23
320 320
321 321 def __TwoComparation(self, in_lst):
322 322
323
324 323 file = []
325 324 relay = []
326 325 status = []
327 mode = '0'
328
329 if mode == '0':
330
331 for i in in_lst:
332 if len(i) == 7:
333 file.append("xxxxxx")
334 relay.append("xxxxxx")
335 else:
336 file.append(i[16:22])
337 relay.append(i[23:29])
338 #Loop to generate a status
339 for i in range(64):
340 cnt = 0
341 if file[i] == "xxxxxx":
342 status.append("xx")
343 continue
326
327 for i in in_lst:
328 if len(i) == 7:
329 file.append("xxxxxx")
330 relay.append("xxxxxx")
331 else:
332 file.append(i[16:22])
333 relay.append(i[23:29])
334 #Loop to generate a status
335 for i in range(64):
336 cnt = 0
337 if file[i] == "xxxxxx":
338 status.append("xx")
339 continue
344 340
345 341 if cmp(file[i],relay[i]) == 0:
346 342 cnt = cnt + 1
@@ -350,9 +346,7
350 346
351 347 if cmp(file[i][3:6],relay[i][3:6]) == 0:
352 348 cnt = cnt + 2
353
354
355
349
356 350 if cnt == 4:
357 351 status.append("00")
358 352 elif cnt == 0:
@@ -361,52 +355,6
361 355 status.append("01")
362 356 else:
363 357 status.append("10")
364
365 else:
366
367 cm_up =[]
368 cm_dw =[]
369 relay_up =[]
370 relay_dw =[]
371
372 for i in in_lst:
373 if len(i) == 8:
374 relay_up.append("-")
375 relay_dw.append("-")
376 cm_up.append("-")
377 cm_dw.append("-")
378 continue
379 relay_up.append(i[14:17])
380 relay_dw.append(i[17:20])
381 cm_up.append(i[21:24])
382 cm_dw.append(i[24:27])
383
384 comp_up = []
385 comp_dw = []
386
387 for i in range(64):
388 if len(relay_up == 1):
389 comp_up.append('x')
390 else:
391 if cmp(relay_up[i], cm_up[i]) == 0:
392 comp_up.append('0')
393 else:
394 comp_up.append('1')
395
396 for i in range(64):
397 if len(relay_dw == 1):
398 comp_dw.append('x')
399 else:
400 if cmp(relay_dw[i], cm_dw[i]) == 0:
401 comp_dw.append('0')
402 else:
403 comp_dw.append('1')
404
405 # Example:
406 # comp_up = [1,0,x,1,1,1 ..,1,0,1,x]
407 #
408 print comp_up
409 print comp_dw
410 358
411 359 #Doing final format
412 360 return self.__FinalFormat(data1 = file, data2 = relay, data3 = status)
General Comments 0
You need to be logged in to leave comments. Login now