Index: trunk/absroot/source/abspy/abscontrol/client.py =================================================================== diff --git a/trunk/absroot/source/abspy/abscontrol/client.py b/trunk/absroot/source/abspy/abscontrol/client.py --- a/trunk/absroot/source/abspy/abscontrol/client.py (revision 51) +++ b/trunk/absroot/source/abspy/abscontrol/client.py (revision 52) @@ -469,7 +469,7 @@ filename = "experimento1.abs" absObj = ABSClient() -# absObj.sendFile(filename) + absObj.sendFile(filename) # absObj.changeBeam("0") # absObj.changeBeam("1") # absObj.changeBeam("2") @@ -478,4 +478,4 @@ # absObj.changeBeam("5") # absObj.changeBeam("6") # absObj.changeBeam("7") - absObj.getStatus(5) \ No newline at end of file +# absObj.getStatus(5) \ No newline at end of file Index: trunk/absroot/source/abspy/abscontrol/server.py =================================================================== diff --git a/trunk/absroot/source/abspy/abscontrol/server.py b/trunk/absroot/source/abspy/abscontrol/server.py --- a/trunk/absroot/source/abspy/abscontrol/server.py (revision 51) +++ b/trunk/absroot/source/abspy/abscontrol/server.py (revision 52) @@ -73,18 +73,6 @@ self.experiment_name = experiment_name - def sendAnswer(self, cmd): - - data = "OK" - - if cmd == "SNDF": - self.commServerObj.sendData2(cmd="SNDF", data=data) - if cmd == "CHGB": - self.commServerObj.sendData2(cmd="CHGB", data=data) - if cmd == "ANST": - data = self.tx_buffer - self.commServerObj.sendData2(cmd="ANST", data=data) - def waitRequest(self): ipSource, ipDestino, cmd, self.datarx = self.commServerObj.waitData() @@ -102,8 +90,7 @@ datarpta = self.tx_buffer self.commServerObj.sendData2(cmd=cmd, data=datarpta) - - return cmd + def __writeReport(self, enaModules): @@ -247,7 +234,7 @@ # Give 5 seconds to the control modules time.sleep(seconds) # Checking the module connection - module_list = self.connection_status(10) + enaModules = self.checkAntenna() #Generating the complete report module = 1 number_of_modules = 16 @@ -255,27 +242,25 @@ line1 = "Verification_file\n" line2 = "-----------------\n" report_list = [line1, line2] - while module <= number_of_modules: - if module_list[module -1] == "1": - #Preparing and doing the tftp command - cmd = "tftp -m binary 192.168.1."+ str(base + module) +" 69 -c get " + filename1 - print cmd - os.system(cmd) - #Sub_header - if base == 10: - report_list.append("S" + str(module) + "\n") - else: - report_list.append("N" + str(module) + "\n") - # Content - fobj1 = open(filename1,"r") - file_list_1 = fobj1.readlines() - fobj1.close() - content = ''.join(file_list_1[2:-1]) -# content = "010101\n" - report_list.append(content) - #Ending - report_list.append("------\n") - module = module + 1 + + for address in range(1,65): + + if address not in enaModules: + continue + #Preparing and doing the tftp command + cmd = "tftp -m binary 192.168.1."+ str(address) +" 69 -c get " + filename1 + print cmd + os.system(cmd) + #Sub_header + report_list.append("ABS_" + str(address) + "\n") + # Content + fobj1 = open(filename1,"r") + file_list_1 = fobj1.readlines() + fobj1.close() + content = ''.join(file_list_1[2:-1]) + report_list.append(content) + #Ending + report_list.append("------\n") #print "\nFinalizado" self.tx_buffer = ''.join(report_list) @@ -332,5 +317,4 @@ absObj = ABSServer() while 1: - cmd = absObj.waitRequest() - absObj.sendAnswer(cmd) \ No newline at end of file + absObj.waitRequest() \ No newline at end of file Index: trunk/absroot/source/abspy/test/ethernet/udp.py =================================================================== diff --git a/trunk/absroot/source/abspy/test/ethernet/udp.py b/trunk/absroot/source/abspy/test/ethernet/udp.py --- a/trunk/absroot/source/abspy/test/ethernet/udp.py (revision 51) +++ b/trunk/absroot/source/abspy/test/ethernet/udp.py (revision 52) @@ -7,8 +7,9 @@ class Server: # Set the socket parameters - host = "localhost" - port = 5140 + #host = "localhost" + host = '192.168.1.255' + port = 5500 buf = 1024 addr = (host,port) @@ -91,9 +92,9 @@ print "Sending message '",data,"'....." - #data_rx, server_rx = self.socket_c.recvfrom(16) + data_rx, server_rx = self.socket_c.recvfrom(16) - #print "Data received ", data_rx, server_rx + print "Data received ", data_rx, server_rx # Close socket self.socket_c.close()