##// END OF EJS Templates
Monitoring test: reception buffer of the client is increasing from 1024 to 2048
Monitoring test: reception buffer of the client is increasing from 1024 to 2048

File last commit:

r245:246
r257:258
Show More
client3.py
119 lines | 3.7 KiB | text/x-python | PythonLexer
jsalyrosas
- Las carpetas se han convertido en paquetes de Python para poder importar adecuadamente las clases....
r164 import library3
import os.path
Implementation of the client and library using TCP.
r75
jsalyrosas
- Las carpetas se han convertido en paquetes de Python para poder importar adecuadamente las clases....
r164 class ABSClient(object):
Implementation of the client and library using TCP.
r75
Trying frame without semicolon.
r101 def __init__(self,ipSource="192.168.1.117", iDSource="Clnt_01", ipDestino="192.168.1.117", iDDestino = "CeCnMod", portDestino=7000):
Implementation of the client and library using TCP.
r75
self.ipSource = ipSource
Trying frame without semicolon.
r101 self.iDSource = iDSource
Implementation of the client and library using TCP.
r75 self.ipDestino = ipDestino
Trying frame without semicolon.
r101 self.iDDestino = iDDestino
Implementation of the client and library using TCP.
r75 self.portDestino = portDestino
self.createObjects()
def createObjects(self):
Trying frame without semicolon.
r101 self.commObj = library3.TCPComm(self.ipSource, self.iDSource, self.ipDestino, self.iDDestino, self.portDestino)
jsalyrosas
- Las carpetas se han convertido en paquetes de Python para poder importar adecuadamente las clases....
r164 #self.wFiles = library3.FilesStuff()
Implementation of the client and library using TCP.
r75
improvement at the client3
r89 def __ConnectionWithCentralControl(self, cmd, data):
self.commObj.open_socket()
self.commObj.sendData(cmd = cmd, data = data, ipDestino = self.ipDestino)
ipSource, ipDestino, cmd, output = self.commObj.waitData()
self.commObj.close_socket()
return output
changes to integrate to the web interface
r138 # def abs2ControlModuleFormatFile(self, filename):
#
# #From matriz to control module format
# self.wFiles.toCentralControlFormat(filename)
# FileName = "CentralControlFormat.txt"
# F_Obj = open(FileName,"r")
# FileList = F_Obj.readlines()
# F_Obj.close()
# FileStr = "".join(FileList)
#
# return FileStr
improvement at the client3
r89
def sendFile(self, filename):
changes to integrate to the web interface
r141 data = self.__readFile(filename)
Client changes to return answer to the web page.
r166 answer = self.__ConnectionWithCentralControl(cmd = "SNDF", data = data)
return answer
new script for reading files from the antenna
r232
r235 def readFile(self,filename):
Implementation of the client and library using TCP.
r75
r235 data = filename
new script for reading files from the antenna
r232 file = self.__ConnectionWithCentralControl(cmd = "GETF", data = data)
r243 self.__writeFile(filename, file)
new script for reading files from the antenna
r232 return file
Implementation of the client and library using TCP.
r75 def changeBeam(self, newBeam):
Client changes to return answer to the web page.
r166 answer = self.__ConnectionWithCentralControl(cmd = "CHGB", data = newBeam)
return answer
Implementation of the client and library using TCP.
r75
def __writeFile(self, filename, data):
fobj = open(filename,"w")
fobj.writelines(data)
fobj.close()
changes to integrate to the web interface
r138
def __readFile(self, filename):
fobj = open(filename,"r")
listData = fobj.readlines()
fobj.close()
changes to integrate to the web interface
r141 tmp = "".join(listData)
#Adding filename to the begining of the data
jsalyrosas
- Las carpetas se han convertido en paquetes de Python para poder importar adecuadamente las clases....
r164 newfilename = os.path.split(filename)[1]
#data = filename + '\n' + tmp
data = newfilename + '\n' + tmp
changes to integrate to the web interface
r138 return data
Implementation of the client and library using TCP.
r75
changes to integrate to the web interface
r138
getConnectionStatus function added.
r80 def getControlModuleStatus(self, data):
Implementation of the client and library using TCP.
r75
r223 bits = self.__ConnectionWithCentralControl(cmd = "ANST", data = data)
#self.__writeFile("report.txt", data)
r245 print "Report:"
print "======:"
r223 print bits
r127
Monitoring test
r244 def getControlModuleStatus_test(self, data):
mnt = self.__ConnectionWithCentralControl(cmd = "MNTR", data = data)
#self.__writeFile("report.txt", data)
r245 print "MNTR:"
print "======:"
Monitoring test
r244 print mnt
ABS Monitoring changes
r146 def getControlModulePhase(self, opt, u = "50", pw = "10"):
r127
ABS Monitoring changes
r146 if opt == '0':
data = self.__ConnectionWithCentralControl(cmd = "LWPH", data = u + '/' + pw + '/')
elif opt == '1':
data = self.__ConnectionWithCentralControl(cmd = "BGPH", data = u + '/' + pw + '/')
elif opt == '2':
data = self.__ConnectionWithCentralControl(cmd = "cBPH", data = u + '/' + pw + '/')
else:
data = self.__ConnectionWithCentralControl(cmd = "cLPH", data = u + '/' + pw + '/')
r127 # self.__writeFile("report.txt", data)
improvement at the client3
r89
getConnectionStatus function added.
r80 def getConnectionStatus(self):
improvement at the client3
r89 data = self.__ConnectionWithCentralControl(cmd = "NTST", data = "none")
getConnectionStatus function added.
r80 self.__writeFile("connection_status.txt", data)
improvement at the client3
r89
Implementation of the client and library using TCP.
r75 if __name__ == '__main__':
filename = "experimento1.abs"
absObj = ABSClient()
Client changes to return answer to the web page.
r168 print absObj.sendFile(filename)