@@ -1,496 +1,496 | |||
|
1 | 1 | # imports needed for the file convertion No newline at end of file |
|
2 | 2 | import os No newline at end of file |
|
3 | 3 | import sys No newline at end of file |
|
4 | 4 | import time No newline at end of file |
|
5 | 5 | import numpy as np No newline at end of file |
|
6 | 6 | No newline at end of file |
|
7 | 7 | import library3 No newline at end of file |
|
8 | 8 | No newline at end of file |
|
9 | 9 | class ABSClient: No newline at end of file |
|
10 | 10 | No newline at end of file |
|
11 | 11 | def __init__(self,ipSource="localhost", ipDestino="192.168.1.117", portDestino=7000): No newline at end of file |
|
12 | 12 | No newline at end of file |
|
13 | 13 | self.ipSource = ipSource No newline at end of file |
|
14 | 14 | self.ipDestino = ipDestino No newline at end of file |
|
15 | 15 | self.portDestino = portDestino No newline at end of file |
|
16 | 16 | No newline at end of file |
|
17 | 17 | self.createObjects() No newline at end of file |
|
18 | 18 | No newline at end of file |
|
19 | 19 | def createObjects(self): No newline at end of file |
|
20 | 20 | No newline at end of file |
|
21 | 21 | self.commObj = library3.TCPComm(self.ipSource, self.ipDestino, self.portDestino) No newline at end of file |
|
22 | 22 | No newline at end of file |
|
23 | 23 | def sendFile(self, filename): No newline at end of file |
|
24 | 24 | No newline at end of file |
|
25 | 25 | #From matriz to control module format No newline at end of file |
|
26 | 26 | self.FuncionMaestra_GeneraFormatoControlCentral(filename) No newline at end of file |
|
27 | 27 | FileName = "FormatoControlCentral.txt" No newline at end of file |
|
28 | 28 | F_Obj = open(FileName,"r") No newline at end of file |
|
29 | 29 | FileList = F_Obj.readlines() No newline at end of file |
|
30 | 30 | F_Obj.close() No newline at end of file |
|
31 | 31 | FileStr = "".join(FileList) No newline at end of file |
|
32 | 32 | data = FileStr No newline at end of file |
|
33 | 33 | No newline at end of file |
|
34 | 34 | self.commObj.open_socket() No newline at end of file |
|
35 | 35 | # self.commObj.sendData(cmd="SNDF", data=data, id = 117) No newline at end of file |
|
36 | 36 | self.commObj.sendData2(cmd="SNDF", data=data, ipDestino = self.ipDestino) No newline at end of file |
|
37 | 37 | # self.commObj.waitData() No newline at end of file |
|
38 | 38 | self.commObj.waitClient() No newline at end of file |
|
39 | 39 | self.commObj.close_socket() No newline at end of file |
|
40 | 40 | No newline at end of file |
|
41 | 41 | def changeBeam(self, newBeam): No newline at end of file |
|
42 | 42 | No newline at end of file |
|
43 | 43 | self.commObj.open_socket() No newline at end of file |
|
44 | 44 | # self.commObj.sendData(cmd="CHGB", data=newBeam, id = 117) No newline at end of file |
|
45 | 45 | self.commObj.sendData2(cmd="CHGB", data=newBeam, ipDestino = self.ipDestino) No newline at end of file |
|
46 | 46 | # self.commObj.waitData() No newline at end of file |
|
47 | 47 | self.commObj.waitClient() No newline at end of file |
|
48 | 48 | self.commObj.close_socket() No newline at end of file |
|
49 | 49 | No newline at end of file |
|
50 | 50 | def __writeFile(self, filename, data): No newline at end of file |
|
51 | 51 | No newline at end of file |
|
52 | 52 | fobj = open(filename,"w") No newline at end of file |
|
53 | 53 | fobj.writelines(data) No newline at end of file |
|
54 | 54 | fobj.close() No newline at end of file |
|
55 | 55 | No newline at end of file |
|
56 | 56 | def getControlModuleStatus(self, data): No newline at end of file |
|
57 | 57 | No newline at end of file |
|
58 | 58 | self.commObj.open_socket() No newline at end of file |
|
59 | 59 | # self.commObj.sendData(cmd="ANST", data = data, id = 117) No newline at end of file |
|
60 | 60 | self.commObj.sendData2(cmd="ANST", data = data, ipDestino = self.ipDestino) No newline at end of file |
|
61 | 61 | # ipSource, ipDestino, cmd, data = self.commObj.waitData() No newline at end of file |
|
62 | 62 | ipSource, ipDestino, cmd, data = self.commObj.waitClient() No newline at end of file |
|
63 | 63 | self.commObj.close_socket() No newline at end of file |
|
64 | 64 | self.__writeFile("report.txt", data) No newline at end of file |
|
65 | 65 | No newline at end of file |
|
66 | 66 | def getConnectionStatus(self): No newline at end of file |
|
67 | 67 | No newline at end of file |
|
68 | 68 | self.commObj.open_socket() No newline at end of file |
|
69 | 69 | self.commObj.sendData2(cmd="NTST", data = "none", ipDestino = "192.168.1.117") No newline at end of file |
|
70 | 70 | ipSource, ipDestino, cmd, data = self.commObj.waitClient() No newline at end of file |
|
71 | 71 | self.commObj.close_socket() No newline at end of file |
|
72 | 72 | self.__writeFile("connection_status.txt", data) No newline at end of file |
|
73 | 73 | No newline at end of file |
|
74 | 74 | ########## No newline at end of file |
|
75 | 75 | No newline at end of file |
|
76 | 76 | def FuncionMaestra_GeneraFormatoControlCentral(self,archivo): No newline at end of file |
|
77 | 77 | """ Funcion que genera un archivo para el control central""" No newline at end of file |
|
78 | 78 | No newline at end of file |
|
79 | 79 | CarpetaDeTrabajo = os.getcwd() + '/' No newline at end of file |
|
80 | 80 | No newline at end of file |
|
81 | 81 | def lst2string(lst): No newline at end of file |
|
82 | 82 | string='' No newline at end of file |
|
83 | 83 | for i in lst: No newline at end of file |
|
84 | 84 | string=string+i No newline at end of file |
|
85 | 85 | return string No newline at end of file |
|
86 | 86 | No newline at end of file |
|
87 | 87 | def string2lst(string): No newline at end of file |
|
88 | 88 | lst = [] No newline at end of file |
|
89 | 89 | for i in string: No newline at end of file |
|
90 | 90 | lst.append(i) No newline at end of file |
|
91 | 91 | return lst No newline at end of file |
|
92 | 92 | No newline at end of file |
|
93 | 93 | No newline at end of file |
|
94 | 94 | def file1(string, type): No newline at end of file |
|
95 | 95 | lst = string2lst(archivo) No newline at end of file |
|
96 | 96 | fin = -1 No newline at end of file |
|
97 | 97 | t = len(lst) No newline at end of file |
|
98 | 98 | for i in np.arange(-1,-t,-1): No newline at end of file |
|
99 | 99 | if lst[i]=='/': No newline at end of file |
|
100 | 100 | fin=i No newline at end of file |
|
101 | 101 | break No newline at end of file |
|
102 | 102 | if type == '1': No newline at end of file |
|
103 | 103 | nombre2 = lst[fin+1:] No newline at end of file |
|
104 | 104 | nombre2[-1]='s' No newline at end of file |
|
105 | 105 | nombre2 = lst2string(nombre2) No newline at end of file |
|
106 | 106 | return nombre2 No newline at end of file |
|
107 | 107 | if type == '2': No newline at end of file |
|
108 | 108 | nombre2 = lst[fin+1:] No newline at end of file |
|
109 | 109 | nombre2[-1]='1' No newline at end of file |
|
110 | 110 | nombre2 = lst2string(nombre2) No newline at end of file |
|
111 | 111 | return nombre2 No newline at end of file |
|
112 | 112 | No newline at end of file |
|
113 | 113 | No newline at end of file |
|
114 | 114 | def EliminaSaltoDeLinea(cadena): No newline at end of file |
|
115 | 115 | i = 0 No newline at end of file |
|
116 | 116 | for elemento in cadena: No newline at end of file |
|
117 | 117 | if elemento =='\n' or elemento =='\r': No newline at end of file |
|
118 | 118 | pass No newline at end of file |
|
119 | 119 | else: No newline at end of file |
|
120 | 120 | i=i+1 No newline at end of file |
|
121 | 121 | return cadena [:i] No newline at end of file |
|
122 | 122 | No newline at end of file |
|
123 | 123 | def NumeroDeExperimentos(path): No newline at end of file |
|
124 | 124 | fichero1=open(path,'r') No newline at end of file |
|
125 | 125 | cont=0 No newline at end of file |
|
126 | 126 | for cadena in fichero1: No newline at end of file |
|
127 | 127 | cont=cont+1 No newline at end of file |
|
128 | 128 | if cont==3: No newline at end of file |
|
129 | 129 | nexp='' No newline at end of file |
|
130 | 130 | pos=0 No newline at end of file |
|
131 | 131 | for elemento in cadena: No newline at end of file |
|
132 | 132 | pos=pos+1 No newline at end of file |
|
133 | 133 | if elemento=='=': No newline at end of file |
|
134 | 134 | nexp=int(cadena[pos:]) No newline at end of file |
|
135 | 135 | return nexp No newline at end of file |
|
136 | 136 | fichero1.close() No newline at end of file |
|
137 | 137 | No newline at end of file |
|
138 | 138 | def Paridad(numero): No newline at end of file |
|
139 | 139 | if numero%2==0: return 'par' No newline at end of file |
|
140 | 140 | elif numero%2==1: return 'impar' No newline at end of file |
|
141 | 141 | No newline at end of file |
|
142 | 142 | def EvaluaCadena(cadena): No newline at end of file |
|
143 | 143 | if len(cadena)>35: No newline at end of file |
|
144 | 144 | if cadena[-1]=='$': No newline at end of file |
|
145 | 145 | return cadena[-35:-2] No newline at end of file |
|
146 | 146 | elif cadena[-1]==']': No newline at end of file |
|
147 | 147 | return cadena[-34:-1] No newline at end of file |
|
148 | 148 | else: No newline at end of file |
|
149 | 149 | return None No newline at end of file |
|
150 | 150 | No newline at end of file |
|
151 | 151 | def GuardaEnLista(path): No newline at end of file |
|
152 | 152 | fichero=open(path,'r') No newline at end of file |
|
153 | 153 | lista=[] No newline at end of file |
|
154 | 154 | for cadena in fichero: No newline at end of file |
|
155 | 155 | cadena = EliminaSaltoDeLinea(cadena) No newline at end of file |
|
156 | 156 | cadena = EvaluaCadena(cadena) No newline at end of file |
|
157 | 157 | if cadena != None: No newline at end of file |
|
158 | 158 | lista.append(cadena) No newline at end of file |
|
159 | 159 | fichero.close() No newline at end of file |
|
160 | 160 | return lista No newline at end of file |
|
161 | 161 | No newline at end of file |
|
162 | 162 | def CreaFicherosPrevios(): No newline at end of file |
|
163 | 163 | vector = GuardaEnLista(archivo) No newline at end of file |
|
164 | 164 | for i in range(1,NumeroDeExperimentos(archivo)+1): No newline at end of file |
|
165 | 165 | fichero =open(CarpetaDeTrabajo+str(i)+'.txt','w') No newline at end of file |
|
166 | 166 | for j in range(0,16): No newline at end of file |
|
167 | 167 | fichero.write(vector[j+16*(i-1)]+'\n') No newline at end of file |
|
168 | 168 | fichero.close() No newline at end of file |
|
169 | 169 | No newline at end of file |
|
170 | 170 | def CapturaValoresEnArchivo(path,polarizacion='up'): No newline at end of file |
|
171 | 171 | fichero =open(path,'r') No newline at end of file |
|
172 | 172 | cnt=0 No newline at end of file |
|
173 | 173 | lstup=[] No newline at end of file |
|
174 | 174 | lstdw=[] No newline at end of file |
|
175 | 175 | for cadena in fichero: No newline at end of file |
|
176 | 176 | cnt=cnt+1 No newline at end of file |
|
177 | 177 | if cnt==5: No newline at end of file |
|
178 | 178 | su01=cadena[17:20] No newline at end of file |
|
179 | 179 | su02=cadena[21:24] No newline at end of file |
|
180 | 180 | su03=cadena[25:28] No newline at end of file |
|
181 | 181 | su04=cadena[29:32] No newline at end of file |
|
182 | 182 | if cnt==6: No newline at end of file |
|
183 | 183 | su05=cadena[17:20] No newline at end of file |
|
184 | 184 | su06=cadena[21:24] No newline at end of file |
|
185 | 185 | su07=cadena[25:28] No newline at end of file |
|
186 | 186 | su08=cadena[29:32] No newline at end of file |
|
187 | 187 | if cnt==7: No newline at end of file |
|
188 | 188 | su09=cadena[17:20] No newline at end of file |
|
189 | 189 | su10=cadena[21:24] No newline at end of file |
|
190 | 190 | su11=cadena[25:28] No newline at end of file |
|
191 | 191 | su12=cadena[29:32] No newline at end of file |
|
192 | 192 | if cnt==8: No newline at end of file |
|
193 | 193 | su13=cadena[17:20] No newline at end of file |
|
194 | 194 | su14=cadena[21:24] No newline at end of file |
|
195 | 195 | su15=cadena[25:28] No newline at end of file |
|
196 | 196 | su16=cadena[29:32] No newline at end of file |
|
197 | 197 | if cnt==13: No newline at end of file |
|
198 | 198 | sd01=cadena[17:20] No newline at end of file |
|
199 | 199 | sd02=cadena[21:24] No newline at end of file |
|
200 | 200 | sd03=cadena[25:28] No newline at end of file |
|
201 | 201 | sd04=cadena[29:32] No newline at end of file |
|
202 | 202 | if cnt==14: No newline at end of file |
|
203 | 203 | sd05=cadena[17:20] No newline at end of file |
|
204 | 204 | sd06=cadena[21:24] No newline at end of file |
|
205 | 205 | sd07=cadena[25:28] No newline at end of file |
|
206 | 206 | sd08=cadena[29:32] No newline at end of file |
|
207 | 207 | if cnt==15: No newline at end of file |
|
208 | 208 | sd09=cadena[17:20] No newline at end of file |
|
209 | 209 | sd10=cadena[21:24] No newline at end of file |
|
210 | 210 | sd11=cadena[25:28] No newline at end of file |
|
211 | 211 | sd12=cadena[29:32] No newline at end of file |
|
212 | 212 | if cnt==16: No newline at end of file |
|
213 | 213 | sd13=cadena[17:20] No newline at end of file |
|
214 | 214 | sd14=cadena[21:24] No newline at end of file |
|
215 | 215 | sd15=cadena[25:28] No newline at end of file |
|
216 | 216 | sd16=cadena[29:32] No newline at end of file |
|
217 | 217 | lstup=[su01,su02,su03,su04,su05,su06,su07,su08,su09,su10,su11,su12,su13,su14,su15,su16] No newline at end of file |
|
218 | 218 | lstdw=[sd01,sd02,sd03,sd04,sd05,sd06,sd07,sd08,sd09,sd10,sd11,sd12,sd13,sd14,sd15,sd16] No newline at end of file |
|
219 | 219 | if polarizacion=='up': No newline at end of file |
|
220 | 220 | return lstup No newline at end of file |
|
221 | 221 | elif polarizacion=='dw': No newline at end of file |
|
222 | 222 | return lstdw No newline at end of file |
|
223 | 223 | fichero.close() No newline at end of file |
|
224 | 224 | No newline at end of file |
|
225 | 225 | def CapturaValoresEnArchivo2(path,polarizacion='up'): No newline at end of file |
|
226 | 226 | fichero =open(path,'r') No newline at end of file |
|
227 | 227 | cnt=0 No newline at end of file |
|
228 | 228 | lstup=[] No newline at end of file |
|
229 | 229 | lstdw=[] No newline at end of file |
|
230 | 230 | for cadena in fichero: No newline at end of file |
|
231 | 231 | cnt=cnt+1 No newline at end of file |
|
232 | 232 | if cnt==1: No newline at end of file |
|
233 | 233 | nu01=cadena[1:4] No newline at end of file |
|
234 | 234 | nu02=cadena[5:8] No newline at end of file |
|
235 | 235 | nu03=cadena[9:12] No newline at end of file |
|
236 | 236 | nu04=cadena[13:16] No newline at end of file |
|
237 | 237 | eu01=cadena[17:20] No newline at end of file |
|
238 | 238 | eu02=cadena[21:24] No newline at end of file |
|
239 | 239 | eu03=cadena[25:28] No newline at end of file |
|
240 | 240 | eu04=cadena[29:32] No newline at end of file |
|
241 | 241 | if cnt==2: No newline at end of file |
|
242 | 242 | nu05=cadena[1:4] No newline at end of file |
|
243 | 243 | nu06=cadena[5:8] No newline at end of file |
|
244 | 244 | nu07=cadena[9:12] No newline at end of file |
|
245 | 245 | nu08=cadena[13:16] No newline at end of file |
|
246 | 246 | eu05=cadena[17:20] No newline at end of file |
|
247 | 247 | eu06=cadena[21:24] No newline at end of file |
|
248 | 248 | eu07=cadena[25:28] No newline at end of file |
|
249 | 249 | eu08=cadena[29:32] No newline at end of file |
|
250 | 250 | if cnt==3: No newline at end of file |
|
251 | 251 | nu09=cadena[1:4] No newline at end of file |
|
252 | 252 | nu10=cadena[5:8] No newline at end of file |
|
253 | 253 | nu11=cadena[9:12] No newline at end of file |
|
254 | 254 | nu12=cadena[13:16] No newline at end of file |
|
255 | 255 | eu09=cadena[17:20] No newline at end of file |
|
256 | 256 | eu10=cadena[21:24] No newline at end of file |
|
257 | 257 | eu11=cadena[25:28] No newline at end of file |
|
258 | 258 | eu12=cadena[29:32] No newline at end of file |
|
259 | 259 | if cnt==4: No newline at end of file |
|
260 | 260 | nu13=cadena[1:4] No newline at end of file |
|
261 | 261 | nu14=cadena[5:8] No newline at end of file |
|
262 | 262 | nu15=cadena[9:12] No newline at end of file |
|
263 | 263 | nu16=cadena[13:16] No newline at end of file |
|
264 | 264 | eu13=cadena[17:20] No newline at end of file |
|
265 | 265 | eu14=cadena[21:24] No newline at end of file |
|
266 | 266 | eu15=cadena[25:28] No newline at end of file |
|
267 | 267 | eu16=cadena[29:32] No newline at end of file |
|
268 | 268 | if cnt==5: No newline at end of file |
|
269 | 269 | wu01=cadena[1:4] No newline at end of file |
|
270 | 270 | wu02=cadena[5:8] No newline at end of file |
|
271 | 271 | wu03=cadena[9:12] No newline at end of file |
|
272 | 272 | wu04=cadena[13:16] No newline at end of file |
|
273 | 273 | su01=cadena[17:20] No newline at end of file |
|
274 | 274 | su02=cadena[21:24] No newline at end of file |
|
275 | 275 | su03=cadena[25:28] No newline at end of file |
|
276 | 276 | su04=cadena[29:32] No newline at end of file |
|
277 | 277 | if cnt==6: No newline at end of file |
|
278 | 278 | wu05=cadena[1:4] No newline at end of file |
|
279 | 279 | wu06=cadena[5:8] No newline at end of file |
|
280 | 280 | wu07=cadena[9:12] No newline at end of file |
|
281 | 281 | wu08=cadena[13:16] No newline at end of file |
|
282 | 282 | su05=cadena[17:20] No newline at end of file |
|
283 | 283 | su06=cadena[21:24] No newline at end of file |
|
284 | 284 | su07=cadena[25:28] No newline at end of file |
|
285 | 285 | su08=cadena[29:32] No newline at end of file |
|
286 | 286 | if cnt==7: No newline at end of file |
|
287 | 287 | wu09=cadena[1:4] No newline at end of file |
|
288 | 288 | wu10=cadena[5:8] No newline at end of file |
|
289 | 289 | wu11=cadena[9:12] No newline at end of file |
|
290 | 290 | wu12=cadena[13:16] No newline at end of file |
|
291 | 291 | su09=cadena[17:20] No newline at end of file |
|
292 | 292 | su10=cadena[21:24] No newline at end of file |
|
293 | 293 | su11=cadena[25:28] No newline at end of file |
|
294 | 294 | su12=cadena[29:32] No newline at end of file |
|
295 | 295 | if cnt==8: No newline at end of file |
|
296 | 296 | wu13=cadena[1:4] No newline at end of file |
|
297 | 297 | wu14=cadena[5:8] No newline at end of file |
|
298 | 298 | wu15=cadena[9:12] No newline at end of file |
|
299 | 299 | wu16=cadena[13:16] No newline at end of file |
|
300 | 300 | su13=cadena[17:20] No newline at end of file |
|
301 | 301 | su14=cadena[21:24] No newline at end of file |
|
302 | 302 | su15=cadena[25:28] No newline at end of file |
|
303 | 303 | su16=cadena[29:32] No newline at end of file |
|
304 | 304 | if cnt==9: No newline at end of file |
|
305 | 305 | nd01=cadena[1:4] No newline at end of file |
|
306 | 306 | nd02=cadena[5:8] No newline at end of file |
|
307 | 307 | nd03=cadena[9:12] No newline at end of file |
|
308 | 308 | nd04=cadena[13:16] No newline at end of file |
|
309 | 309 | ed01=cadena[17:20] No newline at end of file |
|
310 | 310 | ed02=cadena[21:24] No newline at end of file |
|
311 | 311 | ed03=cadena[25:28] No newline at end of file |
|
312 | 312 | ed04=cadena[29:32] No newline at end of file |
|
313 | 313 | if cnt==10: No newline at end of file |
|
314 | 314 | nd05=cadena[1:4] No newline at end of file |
|
315 | 315 | nd06=cadena[5:8] No newline at end of file |
|
316 | 316 | nd07=cadena[9:12] No newline at end of file |
|
317 | 317 | nd08=cadena[13:16] No newline at end of file |
|
318 | 318 | ed05=cadena[17:20] No newline at end of file |
|
319 | 319 | ed06=cadena[21:24] No newline at end of file |
|
320 | 320 | ed07=cadena[25:28] No newline at end of file |
|
321 | 321 | ed08=cadena[29:32] No newline at end of file |
|
322 | 322 | if cnt==11: No newline at end of file |
|
323 | 323 | nd09=cadena[1:4] No newline at end of file |
|
324 | 324 | nd10=cadena[5:8] No newline at end of file |
|
325 | 325 | nd11=cadena[9:12] No newline at end of file |
|
326 | 326 | nd12=cadena[13:16] No newline at end of file |
|
327 | 327 | ed09=cadena[17:20] No newline at end of file |
|
328 | 328 | ed10=cadena[21:24] No newline at end of file |
|
329 | 329 | ed11=cadena[25:28] No newline at end of file |
|
330 | 330 | ed12=cadena[29:32] No newline at end of file |
|
331 | 331 | if cnt==12: No newline at end of file |
|
332 | 332 | nd13=cadena[1:4] No newline at end of file |
|
333 | 333 | nd14=cadena[5:8] No newline at end of file |
|
334 | 334 | nd15=cadena[9:12] No newline at end of file |
|
335 | 335 | nd16=cadena[13:16] No newline at end of file |
|
336 | 336 | ed13=cadena[17:20] No newline at end of file |
|
337 | 337 | ed14=cadena[21:24] No newline at end of file |
|
338 | 338 | ed15=cadena[25:28] No newline at end of file |
|
339 | 339 | ed16=cadena[29:32] No newline at end of file |
|
340 | 340 | if cnt==13: No newline at end of file |
|
341 | 341 | wd01=cadena[1:4] No newline at end of file |
|
342 | 342 | wd02=cadena[5:8] No newline at end of file |
|
343 | 343 | wd03=cadena[9:12] No newline at end of file |
|
344 | 344 | wd04=cadena[13:16] No newline at end of file |
|
345 | 345 | sd01=cadena[17:20] No newline at end of file |
|
346 | 346 | sd02=cadena[21:24] No newline at end of file |
|
347 | 347 | sd03=cadena[25:28] No newline at end of file |
|
348 | 348 | sd04=cadena[29:32] No newline at end of file |
|
349 | 349 | if cnt==14: No newline at end of file |
|
350 | 350 | wd05=cadena[1:4] No newline at end of file |
|
351 | 351 | wd06=cadena[5:8] No newline at end of file |
|
352 | 352 | wd07=cadena[9:12] No newline at end of file |
|
353 | 353 | wd08=cadena[13:16] No newline at end of file |
|
354 | 354 | sd05=cadena[17:20] No newline at end of file |
|
355 | 355 | sd06=cadena[21:24] No newline at end of file |
|
356 | 356 | sd07=cadena[25:28] No newline at end of file |
|
357 | 357 | sd08=cadena[29:32] No newline at end of file |
|
358 | 358 | if cnt==15: No newline at end of file |
|
359 | 359 | wd09=cadena[1:4] No newline at end of file |
|
360 | 360 | wd10=cadena[5:8] No newline at end of file |
|
361 | 361 | wd11=cadena[9:12] No newline at end of file |
|
362 | 362 | wd12=cadena[13:16] No newline at end of file |
|
363 | 363 | sd09=cadena[17:20] No newline at end of file |
|
364 | 364 | sd10=cadena[21:24] No newline at end of file |
|
365 | 365 | sd11=cadena[25:28] No newline at end of file |
|
366 | 366 | sd12=cadena[29:32] No newline at end of file |
|
367 | 367 | if cnt==16: No newline at end of file |
|
368 | 368 | wd13=cadena[1:4] No newline at end of file |
|
369 | 369 | wd14=cadena[5:8] No newline at end of file |
|
370 | 370 | wd15=cadena[9:12] No newline at end of file |
|
371 | 371 | wd16=cadena[13:16] No newline at end of file |
|
372 | 372 | sd13=cadena[17:20] No newline at end of file |
|
373 | 373 | sd14=cadena[21:24] No newline at end of file |
|
374 | 374 | sd15=cadena[25:28] No newline at end of file |
|
375 | 375 | sd16=cadena[29:32] |
|
376 | No newline at end of file | |
|
376 | lst_n_up=[nu01,nu02,nu03,nu04,nu05,nu06,nu07,nu08,nu09,nu10,nu11,nu12,nu13,nu14,nu15,nu16] | |
|
No newline at end of file | ||
|
377 | No newline at end of file | |
|
377 | lst_n_dw=[nd01,nd02,nd03,nd04,nd05,nd06,nd07,nd08,nd09,nd10,nd11,nd12,nd13,nd14,nd15,nd16] | |
|
No newline at end of file | ||
|
378 | No newline at end of file | |
|
378 | lst_s_up=[su01,su02,su03,su04,su05,su06,su07,su08,su09,su10,su11,su12,su13,su14,su15,su16] | |
|
No newline at end of file | ||
|
379 | No newline at end of file | |
|
379 | lst_s_dw=[sd01,sd02,sd03,sd04,sd05,sd06,sd07,sd08,sd09,sd10,sd11,sd12,sd13,sd14,sd15,sd16] | |
|
No newline at end of file | ||
|
380 | No newline at end of file | |
|
380 | lst_w_up=[wu01,wu02,wu03,wu04,wu05,wu06,wu07,wu08,wu09,wu10,wu11,wu12,wu13,wu14,wu15,wu16] | |
|
No newline at end of file | ||
|
381 | No newline at end of file | |
|
381 | lst_w_dw=[wd01,wd02,wd03,wd04,wd05,wd06,wd07,wd08,wd09,wd10,wd11,wd12,wd13,wd14,wd15,wd16] | |
|
No newline at end of file | ||
|
382 | No newline at end of file | |
|
382 | lst_e_up=[eu01,eu02,eu03,eu04,eu05,eu06,eu07,eu08,eu09,eu10,eu11,eu12,eu13,eu14,eu15,eu16] | |
|
No newline at end of file | ||
|
383 | No newline at end of file | |
|
383 | lst_e_dw=[ed01,ed02,ed03,ed04,ed05,ed06,ed07,ed08,ed09,ed10,ed11,ed12,ed13,ed14,ed15,ed16] | |
|
No newline at end of file | ||
|
384 | No newline at end of file | |
|
384 | ||
|
No newline at end of file | ||
|
385 | No newline at end of file | |
|
385 | lstup = lst_n_up + lst_e_up + lst_w_up + lst_s_up | |
|
No newline at end of file | ||
|
386 | No newline at end of file | |
|
386 | lstdw = lst_n_dw + lst_e_dw + lst_w_dw + lst_s_dw No newline at end of file | |
|
387 | 387 | No newline at end of file |
|
388 | 388 | if polarizacion=='up': No newline at end of file |
|
389 | 389 | return lstup No newline at end of file |
|
390 | 390 | elif polarizacion=='dw': No newline at end of file |
|
391 | 391 | return lstdw No newline at end of file |
|
392 | 392 | fichero.close() No newline at end of file |
|
393 | 393 | No newline at end of file |
|
394 | 394 | No newline at end of file |
|
395 | 395 | def CreaFormatoFinal(): No newline at end of file |
|
396 | 396 | ne=NumeroDeExperimentos(archivo) No newline at end of file |
|
397 | 397 | No newline at end of file |
|
398 | 398 | #nombre01 = file1(archivo,'1') No newline at end of file |
|
399 | 399 | nombre02 = file1(archivo,'2') No newline at end of file |
|
400 | 400 | fichero=open(CarpetaDeTrabajo+'FormatoControlCentral.txt','w') No newline at end of file |
|
401 | 401 | fichero.write(nombre02+'\n') No newline at end of file |
|
402 | 402 | fichero.write(str(ne)+'\n') No newline at end of file |
|
403 | 403 | for i in range(1,17): No newline at end of file |
|
404 | 404 | No newline at end of file |
|
405 | 405 | if i<10: No newline at end of file |
|
406 | 406 | nmod = '0'+str(i) No newline at end of file |
|
407 | 407 | else: nmod = str(i) No newline at end of file |
|
408 | 408 | No newline at end of file |
|
409 | 409 | No newline at end of file |
|
410 | 410 | fichero.write('S'+nmod+'\n') No newline at end of file |
|
411 | 411 | for j in range(1,ne+1): No newline at end of file |
|
412 | 412 | ruta=CarpetaDeTrabajo+str(j)+'.txt' No newline at end of file |
|
413 | 413 | lu=CapturaValoresEnArchivo(ruta,polarizacion='up') No newline at end of file |
|
414 | 414 | ld=CapturaValoresEnArchivo(ruta,polarizacion='dw') No newline at end of file |
|
415 | 415 | part1='' No newline at end of file |
|
416 | 416 | part2='' No newline at end of file |
|
417 | 417 | if lu[i-1]=='1.0': part1='000' No newline at end of file |
|
418 | 418 | if lu[i-1]=='2.0': part1='001' No newline at end of file |
|
419 | 419 | if lu[i-1]=='3.0': part1='010' No newline at end of file |
|
420 | 420 | if lu[i-1]=='0.0': part1='011' No newline at end of file |
|
421 | 421 | if lu[i-1]=='0.5': part1='100' No newline at end of file |
|
422 | 422 | if lu[i-1]=='1.5': part1='101' No newline at end of file |
|
423 | 423 | if lu[i-1]=='2.5': part1='110' No newline at end of file |
|
424 | 424 | if lu[i-1]=='3.5': part1='111' No newline at end of file |
|
425 | 425 | if ld[i-1]=='1.0': part2='000' No newline at end of file |
|
426 | 426 | if ld[i-1]=='2.0': part2='001' No newline at end of file |
|
427 | 427 | if ld[i-1]=='3.0': part2='010' No newline at end of file |
|
428 | 428 | if ld[i-1]=='0.0': part2='011' No newline at end of file |
|
429 | 429 | if ld[i-1]=='0.5': part2='100' No newline at end of file |
|
430 | 430 | if ld[i-1]=='1.5': part2='101' No newline at end of file |
|
431 | 431 | if ld[i-1]=='2.5': part2='110' No newline at end of file |
|
432 | 432 | if ld[i-1]=='3.5': part2='111' No newline at end of file |
|
433 | 433 | fichero.write(part1+part2+'\n') No newline at end of file |
|
434 | 434 | fichero.write('------'+'\n') No newline at end of file |
|
435 | 435 | fichero.close() No newline at end of file |
|
436 | 436 | No newline at end of file |
|
437 | 437 | def CreaFormatoFinal2(): No newline at end of file |
|
438 | 438 | ne=NumeroDeExperimentos(archivo) No newline at end of file |
|
439 | 439 | No newline at end of file |
|
440 | 440 | #nombre01 = file1(archivo,'1') No newline at end of file |
|
441 | 441 | nombre02 = file1(archivo,'2') No newline at end of file |
|
442 | 442 | fichero=open(CarpetaDeTrabajo+'FormatoControlCentral.txt','w') No newline at end of file |
|
443 | 443 | fichero.write(nombre02+'\n') No newline at end of file |
|
444 | 444 | fichero.write(str(ne)+'\n') No newline at end of file |
|
445 | 445 | No newline at end of file |
|
446 | 446 | for i in range(1,65): No newline at end of file |
|
447 | 447 | No newline at end of file |
|
448 | 448 | if i<10: No newline at end of file |
|
449 | 449 | nmod = '0'+str(i) No newline at end of file |
|
450 | 450 | else: nmod = str(i) No newline at end of file |
|
451 | 451 | No newline at end of file |
|
452 | 452 | fichero.write("ABS_" + nmod+'\n') No newline at end of file |
|
453 | 453 | No newline at end of file |
|
454 | 454 | for j in range(1,ne+1): No newline at end of file |
|
455 | 455 | ruta=CarpetaDeTrabajo+str(j)+'.txt' No newline at end of file |
|
456 | 456 | lu=CapturaValoresEnArchivo2(ruta,polarizacion='up') No newline at end of file |
|
457 | 457 | ld=CapturaValoresEnArchivo2(ruta,polarizacion='dw') No newline at end of file |
|
458 | 458 | part1='' No newline at end of file |
|
459 | 459 | part2='' No newline at end of file |
|
460 | 460 | if lu[i-1]=='1.0': part1='000' No newline at end of file |
|
461 | 461 | if lu[i-1]=='2.0': part1='001' No newline at end of file |
|
462 | 462 | if lu[i-1]=='3.0': part1='010' No newline at end of file |
|
463 | 463 | if lu[i-1]=='0.0': part1='011' No newline at end of file |
|
464 | 464 | if lu[i-1]=='0.5': part1='100' No newline at end of file |
|
465 | 465 | if lu[i-1]=='1.5': part1='101' No newline at end of file |
|
466 | 466 | if lu[i-1]=='2.5': part1='110' No newline at end of file |
|
467 | 467 | if lu[i-1]=='3.5': part1='111' No newline at end of file |
|
468 | 468 | if ld[i-1]=='1.0': part2='000' No newline at end of file |
|
469 | 469 | if ld[i-1]=='2.0': part2='001' No newline at end of file |
|
470 | 470 | if ld[i-1]=='3.0': part2='010' No newline at end of file |
|
471 | 471 | if ld[i-1]=='0.0': part2='011' No newline at end of file |
|
472 | 472 | if ld[i-1]=='0.5': part2='100' No newline at end of file |
|
473 | 473 | if ld[i-1]=='1.5': part2='101' No newline at end of file |
|
474 | 474 | if ld[i-1]=='2.5': part2='110' No newline at end of file |
|
475 | 475 | if ld[i-1]=='3.5': part2='111' No newline at end of file |
|
476 | 476 | fichero.write(part1+part2+'\n') No newline at end of file |
|
477 | 477 | fichero.write('------'+'\n') No newline at end of file |
|
478 | 478 | fichero.close() No newline at end of file |
|
479 | 479 | No newline at end of file |
|
480 | 480 | def EliminaArchivosEnLaCarpeta(): No newline at end of file |
|
481 | 481 | ne=NumeroDeExperimentos(archivo) No newline at end of file |
|
482 | 482 | for i in range(1,ne+1): No newline at end of file |
|
483 | 483 | os.remove(CarpetaDeTrabajo+str(i)+'.txt') No newline at end of file |
|
484 | 484 | No newline at end of file |
|
485 | 485 | CreaFicherosPrevios() No newline at end of file |
|
486 | 486 | CreaFormatoFinal2() No newline at end of file |
|
487 | 487 | EliminaArchivosEnLaCarpeta() No newline at end of file |
|
488 | 488 | No newline at end of file |
|
489 | 489 | ########## No newline at end of file |
|
490 | 490 | No newline at end of file |
|
491 | 491 | if __name__ == '__main__': No newline at end of file |
|
492 | 492 | No newline at end of file |
|
493 | 493 | filename = "experimento1.abs" No newline at end of file |
|
494 | 494 | No newline at end of file |
|
495 | 495 | absObj = ABSClient() No newline at end of file |
|
496 | 496 | absObj.sendFile(filename) No newline at end of file |
General Comments 0
You need to be logged in to leave comments.
Login now