##// END OF EJS Templates
imanay -
r54:55
parent child
Show More
@@ -39,10 +39,17
39 39 self.commObj.sendData(cmd="CHGB", data=newBeam) No newline at end of file
40 40 self.commObj.waitData() No newline at end of file
41 41 No newline at end of file
42 def __writeFile(self, filename, data):
No newline at end of file
43
No newline at end of file
44 fobj = open(filename,"w")
No newline at end of file
45 fobj.writelines(data)
No newline at end of file
46 fobj.close()
No newline at end of file
47 No newline at end of file
42 48 def getStatus(self, data): No newline at end of file
43 49 No newline at end of file
44 50 self.commObj.sendData(cmd="ANST", data = data)
51 No newline at end of file
45 self.commObj.waitData2() No newline at end of file
No newline at end of file
52 self.__writeFile("report.txt", data) No newline at end of file
46 53 No newline at end of file
47 54 ########## No newline at end of file
48 55 No newline at end of file
@@ -12,6 +12,7
12 12 self.portDestino = portDestino No newline at end of file
13 13 self.addr = (ipDestino,portDestino) No newline at end of file
14 14 self.answer = ipDestino #test No newline at end of file
15 self.mode = "none" No newline at end of file
15 16 No newline at end of file
16 17 self.openSocket(asServer) No newline at end of file
17 18 No newline at end of file
@@ -26,52 +26,6
26 26 self.commClientObj = library.UDPComm(self.ipSource, self.ipDestino2, self.portDestino2) No newline at end of file
27 27 #self.ftpCommObj = library.FTPComm(self.ipSource, self.ipDestino, self.ftpPortDestino) No newline at end of file
28 28
No newline at end of file
29 def sendFile(self, base):
No newline at end of file
30
No newline at end of file
31 #Needed for the loop
No newline at end of file
32 rx_frame_list = self.datarx.split('\n',2)
No newline at end of file
33
No newline at end of file
34 experiment_name = rx_frame_list[0]
No newline at end of file
35 experiment_number = rx_frame_list[1]
No newline at end of file
36 str_control_modules = rx_frame_list[2]
No newline at end of file
37
No newline at end of file
38 lst_control_modules = str_control_modules.split("------\n")
No newline at end of file
39 #Setting variables of the loop
No newline at end of file
40 i =3
No newline at end of file
41 module = 1
No newline at end of file
42 number_of_modules = 16
No newline at end of file
43 number_of_beams = int (experiment_number)
No newline at end of file
44 module_list = self.connection_status(10)
No newline at end of file
45 #Loop for creating and sending the control module files
No newline at end of file
46 while module <= number_of_modules:
No newline at end of file
47 #Generating the control modules files
No newline at end of file
48 fobj = open(experiment_name,"w")
No newline at end of file
49 fobj.write(experiment_name + "\n")
No newline at end of file
50 fobj.write("------\n")
No newline at end of file
51 # tmp_list = rx_frame_list[i:i + number_of_beams + 1]
No newline at end of file
52 fobj.write(lst_control_modules[module-1])
No newline at end of file
53 fobj.write("------\n")
No newline at end of file
54 fobj.close()
No newline at end of file
55 if module_list[module -1] == "1":
No newline at end of file
56 #Preparing and doing the tftp command
No newline at end of file
57 cmd = "tftp -m binary 192.168.1."+ str(base + module) +" 69 -c put " + experiment_name
No newline at end of file
58 print cmd
No newline at end of file
59 os.system(cmd)
No newline at end of file
60 #Updating variables of the loop
No newline at end of file
61 i = i + number_of_beams + 2
No newline at end of file
62 module += 1
No newline at end of file
63 #Working with the UDP socket
No newline at end of file
64 # self.commClientObj.sendData2ControlModules("CARGA:" + experiment_name + ":")
No newline at end of file
65 # self.commClientObj.sendData2ControlModules("CAMBIA:0:")
No newline at end of file
66 #Another tftp way
No newline at end of file
67 # self.ftpCommObj.sendFile(filename)
No newline at end of file
68 # rpta = self.commClientObj.sendTxRxCommand(cmd# filename2 = "report.txt"
No newline at end of file
69 #fobj2 = open(filename2,"w")
No newline at end of file
70 #fobj2.write("Verification_file\n")
No newline at end of file
71 #fobj2.write("-----------------\n")
No newline at end of file
72 #fobj2.close()='CARGA', data=filename)
No newline at end of file
73 self.experiment_name = experiment_name
No newline at end of file
74 No newline at end of file
75 29 No newline at end of file
76 30 def waitRequest(self): No newline at end of file
77 31 No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now