@@ -69,7 +69,7 | |||||
69 | datarpta = self.__getConnectionStatus(cmd = cmd, rx_buffer = rx_buffer) |
|
69 | datarpta = self.__getConnectionStatus(cmd = cmd, rx_buffer = rx_buffer) | |
70 |
|
70 | |||
71 | if cmd == "MNTR": |
|
71 | if cmd == "MNTR": | |
72 |
datarpta = self.__getControlModuleStatus_new(cmd = cmd, |
|
72 | datarpta = self.__getControlModuleStatus_new(cmd = cmd, type = rx_buffer) | |
73 |
|
73 | |||
74 | self.commServerObj.sendData(cmd=cmd, data=datarpta, ipDestino = ipSource) |
|
74 | self.commServerObj.sendData(cmd=cmd, data=datarpta, ipDestino = ipSource) | |
75 |
|
75 | |||
@@ -286,40 +286,50 | |||||
286 |
|
286 | |||
287 | return self.bits |
|
287 | return self.bits | |
288 |
|
288 | |||
289 |
def __getControlModuleStatus_new(self, cmd, |
|
289 | def __getControlModuleStatus_new(self, cmd, type): | |
290 |
|
290 | |||
291 | all_mnt = [] |
|
291 | cm_lst = self.__gettingDataFromControlModules(self, cmd, rx_buffer = type) | |
292 | for id in range(1,65): |
|
292 | out_lst = self.__processingCMdata(in_data = cm_lst, type = type) | |
293 | if id not in self.enaModules: |
|
293 | ||
294 | continue |
|
294 | return "".join(lst_out) | |
295 |
|
295 | |||
296 | mnt = self.__ConnectionWithControlModules(rx_buffer,cmd,id) |
|
296 | def __gettingDataFromControlModules(self, cmd, rx_buffer): | |
297 | all_mnt.append(mnt) |
|
297 | ||
298 |
|
298 | for id in range(1,65): | ||
299 | __function1(type = rx_buffer, in_lst = all_mnt) |
|
299 | if id not in self.enaModules: | |
300 | #return "".join(all_mnt) |
|
300 | continue | |
301 |
|
301 | |||
302 | def __function1(self, type, in_lst): |
|
302 | cm = self.__ConnectionWithControlModules(rx_buffer,cmd,id) | |
303 |
|
303 | del self.test[id-1] | ||
304 | if type == "0": |
|
304 | self.test.insert(id-1, cm) | |
305 | out_str = "".join(in_lst) |
|
305 | ||
306 | elif type == "1": |
|
306 | return self.test | |
307 | out_str = "".join(in_lst) |
|
307 | ||
308 | elif type == "2": |
|
308 | def __processingCMdata(self,in_data, type): | |
309 | out_str = "".join(in_lst) |
|
309 | ||
|
310 | if (type == "0") or (type == "1") or (type == "2"): | |||
|
311 | out_str = "".join(in_data) | |||
310 | elif type == "3": |
|
312 | elif type == "3": | |
311 |
TwoComparation(in_lst = in_ |
|
313 | out_str = TwoComparation(in_lst = in_data) | |
312 | else: |
|
314 | else: | |
313 |
ThreeComparation(in_lst = in_ |
|
315 | out_str = ThreeComparation(in_lst = in_data) | |
314 |
|
316 | |||
315 | return out_str |
|
317 | return out_str | |
316 |
|
318 | |||
317 | def __TwoComparation(self, in_lst): |
|
319 | def __TwoComparation(self, in_lst): | |
|
320 | ||||
318 | cm_up =[] |
|
321 | cm_up =[] | |
319 | cm_dw =[] |
|
322 | cm_dw =[] | |
320 | relay_up =[] |
|
323 | relay_up =[] | |
321 | relay_dw =[] |
|
324 | relay_dw =[] | |
|
325 | ||||
322 | for i in in_lst: |
|
326 | for i in in_lst: | |
|
327 | if len(i) == 8: | |||
|
328 | relay_up.append("-") | |||
|
329 | relay_dw.append("-") | |||
|
330 | cm_up.append("-") | |||
|
331 | cm_dw.append("-") | |||
|
332 | continue | |||
323 | relay_up.append(i[14:17]) |
|
333 | relay_up.append(i[14:17]) | |
324 | relay_dw.append(i[17:20]) |
|
334 | relay_dw.append(i[17:20]) | |
325 | cm_up.append(i[21:24]) |
|
335 | cm_up.append(i[21:24]) | |
@@ -328,22 +338,25 | |||||
328 | comp_up = [] |
|
338 | comp_up = [] | |
329 | comp_dw = [] |
|
339 | comp_dw = [] | |
330 |
|
340 | |||
331 |
for i in range( |
|
341 | for i in range(64): | |
332 |
if |
|
342 | if len(relay_up == 1): | |
333 |
comp_up.append( |
|
343 | comp_up.append('x') | |
334 | else: |
|
344 | else: | |
335 | comp_up.append(1) |
|
345 | if cmp(relay_up[i], cm_up[i]) == 0: | |
|
346 | comp_up.append('0') | |||
|
347 | else: | |||
|
348 | comp_up.append('1') | |||
336 |
|
349 | |||
337 | for i in range(len(relay_dw)): |
|
350 | for i in range(len(relay_dw)): | |
|
351 | comp_dw.append('x') | |||
338 | if cmp(relay_dw[i], cm_dw[i]) == 0: |
|
352 | if cmp(relay_dw[i], cm_dw[i]) == 0: | |
339 | comp_dw.append(0) |
|
353 | comp_dw.append('0') | |
340 | else: |
|
354 | else: | |
341 | comp_dw.append(1) |
|
355 | comp_dw.append('1') | |
342 |
|
356 | |||
343 | print comp_up |
|
357 | print comp_up | |
344 | print comp_dw |
|
358 | print comp_dw | |
345 |
|
359 | |||
346 |
|
||||
347 |
|
360 | |||
348 | def __ThreeComparation(self, in_lst): |
|
361 | def __ThreeComparation(self, in_lst): | |
349 | pass |
|
362 | pass | |
@@ -453,6 +466,7 | |||||
453 | self.rxFile = list("------\n------\n------\n" for i in range(64)) |
|
466 | self.rxFile = list("------\n------\n------\n" for i in range(64)) | |
454 | self.bits = list("------\n------\n------\n" for i in range(64)) |
|
467 | self.bits = list("------\n------\n------\n" for i in range(64)) | |
455 | self.phase = list("----- -----\n----- -----\n----- -----\n" for i in range(64)) |
|
468 | self.phase = list("----- -----\n----- -----\n----- -----\n" for i in range(64)) | |
|
469 | self.test = list("------\n" for i in range(64)) | |||
456 |
|
470 | |||
457 | def __AutomaticControlModules(self): |
|
471 | def __AutomaticControlModules(self): | |
458 |
|
472 |
General Comments 0
You need to be logged in to leave comments.
Login now