1 | NO CONTENT: new file 10644 |
|
NO CONTENT: new file 10644 |
1 | NO CONTENT: new file 10644 |
|
NO CONTENT: new file 10644 |
@@ -1,6 +1,7 | |||||
1 |
import library3 |
|
1 | import library3 | |
|
2 | import os.path | |||
2 |
|
3 | |||
3 | class ABSClient: |
|
4 | class ABSClient(object): | |
4 |
|
5 | |||
5 | def __init__(self,ipSource="192.168.1.117", iDSource="Clnt_01", ipDestino="192.168.1.117", iDDestino = "CeCnMod", portDestino=7000): |
|
6 | def __init__(self,ipSource="192.168.1.117", iDSource="Clnt_01", ipDestino="192.168.1.117", iDDestino = "CeCnMod", portDestino=7000): | |
6 |
|
7 | |||
@@ -15,7 +16,7 | |||||
15 | def createObjects(self): |
|
16 | def createObjects(self): | |
16 |
|
17 | |||
17 | self.commObj = library3.TCPComm(self.ipSource, self.iDSource, self.ipDestino, self.iDDestino, self.portDestino) |
|
18 | self.commObj = library3.TCPComm(self.ipSource, self.iDSource, self.ipDestino, self.iDDestino, self.portDestino) | |
18 |
|
|
19 | #self.wFiles = library3.FilesStuff() | |
19 |
|
20 | |||
20 | def __ConnectionWithCentralControl(self, cmd, data): |
|
21 | def __ConnectionWithCentralControl(self, cmd, data): | |
21 |
|
22 | |||
@@ -60,7 +61,9 | |||||
60 | fobj.close() |
|
61 | fobj.close() | |
61 | tmp = "".join(listData) |
|
62 | tmp = "".join(listData) | |
62 | #Adding filename to the begining of the data |
|
63 | #Adding filename to the begining of the data | |
63 | data = filename + '\n' + tmp |
|
64 | newfilename = os.path.split(filename)[1] | |
|
65 | #data = filename + '\n' + tmp | |||
|
66 | data = newfilename + '\n' + tmp | |||
64 | return data |
|
67 | return data | |
65 |
|
68 | |||
66 |
|
69 |
@@ -278,7 +278,7 | |||||
278 | return nexp |
|
278 | return nexp | |
279 | fichero1.close() |
|
279 | fichero1.close() | |
280 |
|
280 | |||
281 | def Paridad(numero): |
|
281 | def Paridad(self, numero): | |
282 | if numero%2==0: return 'par' |
|
282 | if numero%2==0: return 'par' | |
283 | elif numero%2==1: return 'impar' |
|
283 | elif numero%2==1: return 'impar' | |
284 |
|
284 |
@@ -1,13 +1,32 | |||||
1 | import file |
|
1 | import optparse, os, sys | |
2 | from client3 import * |
|
|||
3 | import sys |
|
|||
4 |
|
2 | |||
5 | absObj = ABSClient(ipDestino="10.10.10.97") |
|
3 | pathFile = os.getcwd() | |
6 | #absObj = ABSClient() |
|
4 | sys.path.append(os.path.split(pathFile)[0]) | |
7 |
|
5 | |||
8 | if len(sys.argv) == 2: |
|
6 | from abscontrol.client3 import ABSClient | |
9 | #beam = "2" |
|
7 | ||
10 | beam = sys.argv[1] |
|
8 | class changeBeam(object): | |
11 | absObj.changeBeam(beam) |
|
9 | ||
12 | else: |
|
10 | def __init__(self): | |
13 | print "Only one argument needed" No newline at end of file |
|
11 | pass | |
|
12 | ||||
|
13 | def execute(self, beam="0"): | |||
|
14 | absObj = ABSClient(ipDestino="10.10.10.97") | |||
|
15 | absObj.changeBeam(beam) | |||
|
16 | ||||
|
17 | ||||
|
18 | usage = "::::::::::::\n" | |||
|
19 | ||||
|
20 | ||||
|
21 | if __name__ == '__main__': | |||
|
22 | ||||
|
23 | parser = optparse.OptionParser(usage=usage) | |||
|
24 | ||||
|
25 | parser.add_option("-n", "--beam", dest="pattern", type="string", default="0", help="Number of Pattern") | |||
|
26 | ||||
|
27 | (options, args) = parser.parse_args() | |||
|
28 | ||||
|
29 | beam = options.pattern | |||
|
30 | ||||
|
31 | app = changeBeam() | |||
|
32 | app.execute(beam) No newline at end of file |
@@ -1,12 +1,36 | |||||
1 | import file |
|
|||
2 | from client3 import * |
|
|||
3 | import sys |
|
|||
4 |
|
|
1 | ||
5 | absObj = ABSClient(ipDestino="10.10.10.97") |
|
2 | import optparse, os, sys | |
6 | #absObj = ABSClient() |
|
3 | ||
7 | if len(sys.argv) == 2: |
|
4 | pathFile = os.getcwd() | |
8 | #filename = "experimento1.abs" |
|
5 | sys.path.append(os.path.split(pathFile)[0]) | |
9 | filename = sys.argv[1] |
|
6 | ||
10 | absObj.sendFile(filename) |
|
7 | from abscontrol.client3 import ABSClient | |
11 | else: |
|
8 | ||
12 | print "Only one argument needed" No newline at end of file |
|
9 | class sendFile(object): | |
|
10 | ||||
|
11 | def __init__(self): | |||
|
12 | pass | |||
|
13 | ||||
|
14 | def execute(self, filename): | |||
|
15 | if os.path.exists(filename): | |||
|
16 | absObj = ABSClient(ipDestino="10.10.10.97") | |||
|
17 | absObj.sendFile(filename) | |||
|
18 | pass | |||
|
19 | else: | |||
|
20 | print "No file" | |||
|
21 | ||||
|
22 | usage = "::::::::::::\n" | |||
|
23 | ||||
|
24 | ||||
|
25 | if __name__ == '__main__': | |||
|
26 | ||||
|
27 | parser = optparse.OptionParser(usage=usage) | |||
|
28 | ||||
|
29 | parser.add_option("-f", "--filename", dest="filename", type="string", default="", help="Filename") | |||
|
30 | ||||
|
31 | (options, args) = parser.parse_args() | |||
|
32 | ||||
|
33 | filename = options.filename | |||
|
34 | ||||
|
35 | app = sendFile() | |||
|
36 | app.execute(filename) No newline at end of file |
General Comments 0
You need to be logged in to leave comments.
Login now