##// END OF EJS Templates
improvement at the client3
imanay -
r89:90
parent child
Show More
@@ -19,8 +19,18
19 def createObjects(self):
19 def createObjects(self):
20
20
21 self.commObj = library3.TCPComm(self.ipSource, self.ipDestino, self.portDestino)
21 self.commObj = library3.TCPComm(self.ipSource, self.ipDestino, self.portDestino)
22
22 # self.wFiles = library3.FilesStuff()
23 def sendFile(self, filename):
23
24 def __ConnectionWithCentralControl(self, cmd, data):
25
26 self.commObj.open_socket()
27 self.commObj.sendData(cmd = cmd, data = data, ipDestino = self.ipDestino)
28 ipSource, ipDestino, cmd, output = self.commObj.waitData()
29 self.commObj.close_socket()
30
31 return output
32
33 def abs2ControlModuleFormatFile(self, filename):
24
34
25 #From matriz to control module format
35 #From matriz to control module format
26 self.FuncionMaestra_GeneraFormatoControlCentral(filename)
36 self.FuncionMaestra_GeneraFormatoControlCentral(filename)
@@ -29,19 +39,18
29 FileList = F_Obj.readlines()
39 FileList = F_Obj.readlines()
30 F_Obj.close()
40 F_Obj.close()
31 FileStr = "".join(FileList)
41 FileStr = "".join(FileList)
32 data = FileStr
42
33
43 return FileStr
34 self.commObj.open_socket()
44
35 self.commObj.sendData(cmd="SNDF", data=data, ipDestino = self.ipDestino)
45 def sendFile(self, filename):
36 self.commObj.waitData()
46
37 self.commObj.close_socket()
47 data = self.abs2ControlModuleFormatFile(filename)
48
49 self.__ConnectionWithCentralControl(cmd = "SNDF", data = data)
38
50
39 def changeBeam(self, newBeam):
51 def changeBeam(self, newBeam):
40
52
41 self.commObj.open_socket()
53 self.__ConnectionWithCentralControl(cmd = "CHGB", data = newBeam)
42 self.commObj.sendData(cmd="CHGB", data=newBeam, ipDestino = self.ipDestino)
43 self.commObj.waitData()
44 self.commObj.close_socket()
45
54
46 def __writeFile(self, filename, data):
55 def __writeFile(self, filename, data):
47
56
@@ -51,20 +60,14
51
60
52 def getControlModuleStatus(self, data):
61 def getControlModuleStatus(self, data):
53
62
54 self.commObj.open_socket()
63 data = self.__ConnectionWithCentralControl(cmd = "ANST", data = data)
55 self.commObj.sendData(cmd="ANST", data = data, ipDestino = self.ipDestino)
56 ipSource, ipDestino, cmd, data = self.commObj.waitData()
57 self.commObj.close_socket()
58 self.__writeFile("report.txt", data)
64 self.__writeFile("report.txt", data)
59
65
60 def getConnectionStatus(self):
66 def getConnectionStatus(self):
61
67
62 self.commObj.open_socket()
68 data = self.__ConnectionWithCentralControl(cmd = "NTST", data = "none")
63 self.commObj.sendData(cmd="NTST", data = "none", ipDestino = "192.168.1.117")
64 ipSource, ipDestino, cmd, data = self.commObj.waitData()
65 self.commObj.close_socket()
66 self.__writeFile("connection_status.txt", data)
69 self.__writeFile("connection_status.txt", data)
67
70
68 ##########
71 ##########
69
72
70 def FuncionMaestra_GeneraFormatoControlCentral(self,archivo):
73 def FuncionMaestra_GeneraFormatoControlCentral(self,archivo):
General Comments 0
You need to be logged in to leave comments. Login now