##// END OF EJS Templates
- Ampliado el formulario de edicion para el parametro only_rx y funcionalidad verificada cuando graba los datos en la BD y cuando genera el archivo para su integracion con overjro.
jsalyrosas -
r209:210
parent child
Show More
@@ -1,552 +1,564
1 1 from django.shortcuts import render_to_response, redirect
2 2 from django.http import HttpResponse
3 3 from django.conf import settings
4 4 from django.utils.encoding import smart_str
5 5 from django.core.servers.basehttp import FileWrapper
6 6 import mimetypes
7 7 from django.contrib.auth.decorators import login_required
8 8 from django.template import RequestContext
9 9
10 10 from datetime import datetime
11 11 import os
12 12 from abscontrol.models import Profile, Pattern, AntennaDown, AntennaUp
13 13
14 14 from util.readABSFile import readABSFile
15 15 from util.saveABSFile import saveABSFile
16 16 from util.ABSData import ABSData
17 17 from util.OverJRO import OverJRO
18 18 from scripts.sendFile import sendFile
19 19 from scripts.changeBeam import changeBeam
20 20 from overJroShow import overJroShow
21 21
22 22 arrayTx = [["0","0","0","0","0","0","0","0"],\
23 23 ["0","0","0","0","0","0","0","0"],\
24 24 ["0","0","0","0","0","0","0","0"],\
25 25 ["0","0","0","0","0","0","0","0"],\
26 26 ["0","0","0","0","0","0","0","0"],\
27 27 ["0","0","0","0","0","0","0","0"],\
28 28 ["0","0","0","0","0","0","0","0"],\
29 29 ["0","0","0","0","0","0","0","0"]]
30 30
31 31 arrayUes = ["0.533333","0.00000","1.06667","0.00000"]
32 32
33 33 @login_required(login_url='/accounts/login/')
34 34 def index(request):
35 35 #latest_poll_list = profileAntenna.objects.all().order_by('-pub_date')[:5]
36 36 profile_list = Profile.objects.filter(state=1)
37 37 return render_to_response('abscontrol/index.html', {'profile_list': profile_list}, context_instance=RequestContext(request))
38 38
39 39 def new(request):
40 40 profile_list = Profile.objects.filter(state=1)
41 41 txtProfile = datetime.now().strftime("%Y%m%d%H%M%S%f")
42 42 newprofile = Profile(name=txtProfile)
43 43 newprofile.save()
44 44
45 45 lsPatterns = None
46 46
47 47 return render_to_response('abscontrol/new.html', {'profile_list': profile_list,
48 48 'profile_name' : newprofile.name,
49 49 'profile_id' : newprofile.id,
50 50 'lsPatterns' : lsPatterns,
51 51 'range' : range(8), 'arrayUes' : arrayUes,
52 52 }, context_instance=RequestContext(request))
53 53
54 54 def save(request):
55 55
56 56 txtProfile = request.POST["txtProfile"]
57 57
58 58 txtAntennaUp = request.POST["txtAntennaUp"]
59 59 txtTxUp = request.POST["txtTxUp"]
60 60 txtRxUp = request.POST["txtRxUp"]
61 61 txtUesUp = request.POST["txtUesUp"]
62 62
63 63 txtAntennaDown = request.POST["txtAntennaDown"]
64 64 txtTxDown = request.POST["txtTxDown"]
65 65 txtRxDown = request.POST["txtRxDown"]
66 66 txtUesDown = request.POST["txtUesDown"]
67 67
68 68 newprofile = Profile(name=txtProfile)
69 69 newprofile.save()
70 70
71 71 newpattern = newprofile.pattern_set.create(value=1)
72 72 newpattern.antennaup_set.create(value=txtAntennaUp,tx=txtTxUp,rx=txtRxUp,ues=txtUesUp)
73 73 newpattern.antennadown_set.create(value=txtAntennaDown,tx=txtTxDown,rx=txtRxDown,ues=txtUesDown)
74 74
75 75 newurl = '/abscontrol/view/%d' % newprofile.id
76 76
77 77 return redirect(newurl)
78 78
79 79 # Update temporal experiment
80 80 def upgrade(request, profile_id):
81 81 txtAntennaUp = request.POST["txtAntennaUp"]
82 82 txtTxUp = request.POST["txtTxUp"]
83 83 txtRxUp = request.POST["txtRxUp"]
84 84 txtUesUp = request.POST["txtUesUp"]
85 85
86 86 txtAntennaDown = request.POST["txtAntennaDown"]
87 87 txtTxDown = request.POST["txtTxDown"]
88 88 txtRxDown = request.POST["txtRxDown"]
89 89 txtUesDown = request.POST["txtUesDown"]
90 90
91 91 objProfile = Profile.objects.get(pk=profile_id)
92 92 newpattern = objProfile.pattern_set.create(value=1)
93 93 newpattern.antennaup_set.create(value=txtAntennaUp,tx=txtTxUp,rx=txtRxUp,ues=txtUesUp)
94 94 newpattern.antennadown_set.create(value=txtAntennaDown,tx=txtTxDown,rx=txtRxDown,ues=txtUesDown)
95 95
96 96 newurl = '/abscontrol/%d/edit/%d' % (int(profile_id), newpattern.id)
97 97 return redirect(newurl)
98 98
99 99 def update(request, profile_id):
100 100 txtProfile = request.POST["txtProfile"]
101 101
102 102 objProfile = Profile.objects.get(pk=profile_id)
103 103 objProfile.name = txtProfile
104 104 objProfile.state = 1
105 105 objProfile.save()
106 106
107 107 newurl = '/abscontrol/view/%d' % objProfile.id
108 108 return redirect(newurl)
109 109
110 110 def changeName(request, profile_id):
111 111 profile_list = Profile.objects.filter(state=1)
112 112 objProfile = Profile.objects.get(pk=profile_id)
113 113 lsPatterns = objProfile.pattern_set.all()
114 114
115 115 return render_to_response('abscontrol/changeName.html', {'profile_list': profile_list,
116 116 'objProfile': objProfile,
117 117 'lsPatterns' : lsPatterns,
118 118 }, context_instance=RequestContext(request))
119 119
120 120 def view(request, profile_id):
121 121 objProfileActive = None
122 122 objPatternActive = None
123 123
124 124 if request.method == 'GET' and 'pattern' in request.GET:
125 125 pattern_value = request.GET["pattern"]
126 126 else:
127 127 pattern_value = 1
128 128
129 129 profile_list = Profile.objects.filter(state=1)
130 130 objProfile = Profile.objects.get(pk=profile_id)
131 131
132 132 lsPatterns = objProfile.pattern_set.all()
133 133 patternChoosen = objProfile.pattern_set.get(value=pattern_value)
134 134 objAntennaUp = patternChoosen.antennaup_set.get()
135 135 objAntennaDown = patternChoosen.antennadown_set.get()
136 136
137 137 lsProfilesActive = Profile.objects.filter(is_active=1)
138 138 if len(lsProfilesActive) > 0:
139 139 objProfileActive = Profile.objects.get(is_active=1)
140 140
141 141 lsPatternsActive = Pattern.objects.filter(is_active=1)
142 142 if len(lsPatternsActive) > 0:
143 143 objPatternActive = Pattern.objects.get(is_active=1)
144 144
145 145 return render_to_response('abscontrol/view.html', {'objProfile': objProfile, 'profile_list': profile_list,
146 146 'patternChoosen' : patternChoosen, 'lsPatterns' : lsPatterns,
147 147 'antennaUp' : objAntennaUp, 'antennaDown' : objAntennaDown,
148 148 'profileActive' : objProfileActive, 'patternActive' : objPatternActive,
149 149 }, context_instance=RequestContext(request))
150 150
151 151 def edit(request, profile_id):
152 152 if request.method == 'GET' and 'pattern' in request.GET:
153 153 pattern_value = request.GET["pattern"]
154 154 else:
155 155 pattern_value = 1
156 156
157 157 absData = ABSData()
158 158 profile_list = Profile.objects.filter(state=1)
159 159 objProfile = Profile.objects.get(pk=profile_id)
160 160
161 161 lsPatterns = objProfile.pattern_set.all()
162 162 patternChoosen = objProfile.pattern_set.get(value=pattern_value)
163 163 objAntennaUp = patternChoosen.antennaup_set.get()
164 164 objAntennaDown = patternChoosen.antennadown_set.get()
165 165
166 166 arrayAntennaUp = absData.convertStringtoList2(objAntennaUp.value)
167 167 if objAntennaUp.tx != None:
168 168 arrayTxUp = absData.convertStringtoList2(objAntennaUp.tx)
169 169 else:
170 170 arrayTxUp = arrayTx
171 171 if objAntennaUp.rx != None:
172 172 arrayRxUp = absData.convertStringtoList2(objAntennaUp.rx)
173 173 else:
174 174 arrayRxUp = arrayTx
175 175 if objAntennaUp.ues != None:
176 176 arrayUesUp = absData.convertStringtoList1(objAntennaUp.ues)
177 177 else:
178 178 arrayUesUp = arrayUes
179 179
180 180 arrayAntennaDown = absData.convertStringtoList2(objAntennaDown.value)
181 181 if objAntennaDown.tx != None:
182 182 arrayTxDown = absData.convertStringtoList2(objAntennaDown.tx)
183 183 else:
184 184 arrayTxDown = arrayTx
185 185 if objAntennaDown.rx != None:
186 186 arrayRxDown = absData.convertStringtoList2(objAntennaDown.rx)
187 187 else:
188 188 arrayRxDown = arrayTx
189 189 if objAntennaDown.ues != None:
190 190 arrayUesDown = absData.convertStringtoList1(objAntennaDown.ues)
191 191 else:
192 192 arrayUesDown = arrayUes
193 193
194 194 return render_to_response('abscontrol/edit.html', {'objProfile': objProfile, 'profile_list': profile_list,
195 195 'patternChoosen' : patternChoosen, 'lsPatterns' : lsPatterns,
196 196 'antennaUp' : objAntennaUp, 'antennaDown' : objAntennaDown,
197 197 'arrayAntennaUp' : arrayAntennaUp, 'arrayTxUp' : arrayTxUp,
198 198 'arrayRxUp' : arrayRxUp, 'arrayRxDown' : arrayRxDown,
199 199 'arrayAntennaDown' : arrayAntennaDown, 'arrayTxDown' : arrayTxDown,
200 200 'arrayUesUp' : arrayUesUp, 'arrayUesDown' : arrayUesDown,
201 201 }, context_instance=RequestContext(request))
202 202
203 203 def addPattern(request, profile_id):
204 204 profile_list = Profile.objects.filter(state=1)
205 205 objProfile = Profile.objects.get(pk=profile_id)
206 206
207 207 return render_to_response('abscontrol/addPattern.html', {'objProfile': objProfile, 'profile_list': profile_list,
208 208 'range' : range(8), 'arrayUes' : arrayUes,
209 209 }, context_instance=RequestContext(request))
210 210
211 211 def editPattern(request, profile_id, pattern_id):
212 212 absData = ABSData()
213 213 profile_list = Profile.objects.filter(state=1)
214 214 objProfile = Profile.objects.get(pk=profile_id)
215 215 lsPatterns = objProfile.pattern_set.all()
216 216 patternChoosen = Pattern.objects.get(pk=pattern_id)
217 217 objAntennaUp = patternChoosen.antennaup_set.get()
218 218 objAntennaDown = patternChoosen.antennadown_set.get()
219 219
220 220 arrayAntennaUp = absData.convertStringtoList2(objAntennaUp.value)
221 221 if objAntennaUp.tx != None:
222 222 arrayTxUp = absData.convertStringtoList2(objAntennaUp.tx)
223 223 else:
224 224 arrayTxUp = arrayTx
225 225 if objAntennaUp.rx != None:
226 226 arrayRxUp = absData.convertStringtoList2(objAntennaUp.rx)
227 227 else:
228 228 arrayRxUp = arrayTx
229 229 if objAntennaUp.ues != None:
230 230 arrayUesUp = absData.convertStringtoList1(objAntennaUp.ues)
231 231 else:
232 232 arrayUesUp = arrayUes
233 233
234 234 arrayAntennaDown = absData.convertStringtoList2(objAntennaDown.value)
235 235 if objAntennaDown.tx != None:
236 236 arrayTxDown = absData.convertStringtoList2(objAntennaDown.tx)
237 237 else:
238 238 arrayTxDown = arrayTx
239 239 if objAntennaDown.rx != None:
240 240 arrayRxDown = absData.convertStringtoList2(objAntennaDown.rx)
241 241 else:
242 242 arrayRxDown = arrayTx
243 243 if objAntennaDown.ues != None:
244 244 arrayUesDown = absData.convertStringtoList1(objAntennaDown.ues)
245 245 else:
246 246 arrayUesDown = arrayUes
247 247
248 248 return render_to_response('abscontrol/editPattern.html', {'objProfile': objProfile, 'profile_list': profile_list,
249 249 'patternChoosen' : patternChoosen, 'lsPatterns' : lsPatterns,
250 250 'antennaUp' : objAntennaUp, 'antennaDown' : objAntennaDown,
251 251 'arrayAntennaUp' : arrayAntennaUp, 'arrayTxUp' : arrayTxUp,
252 252 'arrayRxUp' : arrayRxUp, 'arrayRxDown' : arrayRxDown,
253 253 'arrayAntennaDown' : arrayAntennaDown, 'arrayTxDown' : arrayTxDown,
254 254 'arrayUesUp' : arrayUesUp, 'arrayUesDown' : arrayUesDown,
255 255 }, context_instance=RequestContext(request))
256 256
257 257 def savePattern(request, profile_id):
258 258 pattern_id = 0
259 259 method = "save"
260 260
261 261 if 'pattern_id' in request.POST:
262 262 pattern_id = request.POST["pattern_id"]
263 263 method = "update"
264 264
265 265 maxValuePattern = 0
266 266 txtAntennaUp = request.POST["txtAntennaUp"]
267 267 txtTxUp = request.POST["txtTxUp"]
268 268 txtRxUp = request.POST["txtRxUp"]
269 269 txtUesUp = request.POST["txtUesUp"]
270 if "chkOnlyRxUp" in request.POST:
271 chkOnlyRxUp = request.POST["chkOnlyRxUp"]
272 else:
273 chkOnlyRxUp = 0
270 274
271 275 txtAntennaDown = request.POST["txtAntennaDown"]
272 276 txtTxDown = request.POST["txtTxDown"]
273 277 txtRxDown = request.POST["txtRxDown"]
274 278 txtUesDown = request.POST["txtUesDown"]
279 if "chkOnlyRxDown" in request.POST:
280 chkOnlyRxDown = request.POST["chkOnlyRxDown"]
281 else:
282 chkOnlyRxDown = 0
275 283
276 284 mode = request.POST["mode"]
277 285
278 286 if method == "save":
279 287 objProfile = Profile.objects.get(pk=profile_id)
280 288 lsPatterns = objProfile.pattern_set.all()
281 289 if len(lsPatterns) > 0:
282 290 for element in lsPatterns:
283 291 if element.value > maxValuePattern:
284 292 maxPattern = element.value
285 293 else:
286 294 maxPattern = 0
287 295
288 296 if maxPattern < 10 :
289 297 newValuePattern = maxPattern + 1
290 298 newpattern = objProfile.pattern_set.create(value=newValuePattern)
291 newpattern.antennaup_set.create(value=txtAntennaUp,tx=txtTxUp,rx=txtRxUp,ues=txtUesUp)
292 newpattern.antennadown_set.create(value=txtAntennaDown,tx=txtTxDown,rx=txtRxDown,ues=txtUesDown)
299 newpattern.antennaup_set.create(value=txtAntennaUp,tx=txtTxUp,rx=txtRxUp,ues=txtUesUp,only_rx=chkOnlyRxUp)
300 newpattern.antennadown_set.create(value=txtAntennaDown,tx=txtTxDown,rx=txtRxDown,ues=txtUesDown,only_rx=chkOnlyRxDown)
293 301 error = 0
294 302 else:
295 303 error = 1 # Can not add more patterns
296 304
297 305 if mode == "e":
298 306 newurl = '/abscontrol/%d/edit/%d' % (int(profile_id), newpattern.id)
299 307 else:
300 308 newurl = '/abscontrol/%d/view/%d' % (int(profile_id), newpattern.id)
301 309 else:
302 310 txtAntennaUpId = request.POST["txtAntennaUpId"]
303 311 objAntennaUp = AntennaUp.objects.get(pk=txtAntennaUpId)
304 312 objAntennaUp.value = txtAntennaUp
305 313 objAntennaUp.tx = txtTxUp
306 314 objAntennaUp.rx = txtRxUp
307 315 objAntennaUp.ues = txtUesUp
316 objAntennaUp.only_rx = chkOnlyRxUp
308 317 objAntennaUp.save()
309 318
310 319 txtAntennaDownId = request.POST["txtAntennaDownId"]
311 320 objAntennaDown = AntennaDown.objects.get(pk=txtAntennaDownId)
312 321 objAntennaDown.value = txtAntennaDown
313 322 objAntennaDown.tx = txtTxDown
314 323 objAntennaDown.rx = txtRxDown
315 324 objAntennaDown.ues = txtUesDown
325 objAntennaDown.only_rx = chkOnlyRxDown
316 326 objAntennaDown.save()
317 327
318 328 if mode == "e":
319 329 newurl = '/abscontrol/%d/edit/%d' % (int(profile_id), int(pattern_id))
320 330 else:
321 331 newurl = '/abscontrol/%d/view/%d' % (int(profile_id), int(pattern_id))
322 332
323 333 return redirect(newurl)
324 334
325 335 def viewPattern(request, profile_id, pattern_id):
336 objProfileActive = None
337 objPatternActive = None
326 338
327 339 profile_list = Profile.objects.filter(state=1)
328 340 objProfile = Profile.objects.get(pk=profile_id)
329 341
330 342 patternChoosen = Pattern.objects.get(pk=pattern_id)
331 343
332 344 objAntennaUp = patternChoosen.antennaup_set.get()
333 345 objAntennaDown = patternChoosen.antennadown_set.get()
334 346
335 347 lsPatterns = objProfile.pattern_set.all()
336 348
337 349 lsProfilesActive = Profile.objects.filter(is_active=1)
338 350 if len(lsProfilesActive) > 0:
339 351 objProfileActive = Profile.objects.get(is_active=1)
340 352
341 353 lsPatternsActive = Pattern.objects.filter(is_active=1)
342 354 if len(lsPatternsActive) > 0:
343 355 objPatternActive = Pattern.objects.get(is_active=1)
344 356
345 357 return render_to_response('abscontrol/viewPattern.html', {'objProfile': objProfile, 'profile_list': profile_list,
346 358 'patternChoosen' : patternChoosen, 'lsPatterns' : lsPatterns,
347 359 'antennaUp' : objAntennaUp, 'antennaDown' : objAntennaDown,
348 360 'profileActive' : objProfileActive, 'patternActive' : objPatternActive,
349 361 }, context_instance=RequestContext(request))
350 362
351 363 def deletePattern(request, profile_id, pattern_id):
352 364 newurl = '/abscontrol/edit/%d' % int(profile_id)
353 365
354 366 return redirect(newurl)
355 367
356 368 def importProfile(request):
357 369 profile_list = Profile.objects.filter(state=1)
358 370 return render_to_response('abscontrol/import.html', {'profile_list': profile_list,}, context_instance=RequestContext(request))
359 371
360 372 def upload(request):
361 373 profile_list = Profile.objects.filter(state=1)
362 374 if request.method == 'POST':
363 375 txtFilename = request.FILES['txtFile']
364 376 if txtFilename:
365 377 destination = open('/tmp/'+txtFilename.name, 'wb+')
366 378 for chunk in txtFilename.chunks():
367 379 destination.write(chunk)
368 380 destination.close()
369 381 filename = '/tmp/'+txtFilename.name
370 382 readFile = readABSFile(filename)
371 383 expName, num_patterns, patterns = readFile.getMetadata()
372 384
373 385 if expName != "" and num_patterns > 0:
374 386 if len(Profile.objects.filter(name__iexact=expName)) > 0:
375 387 txtError = "Experiment's name found."
376 388 return render_to_response('abscontrol/error.html', {'profile_list': profile_list,
377 389 'txtError' : txtError, },
378 390 context_instance=RequestContext(request))
379 391 else:
380 392 newprofile = Profile(name=expName)
381 393 newprofile.save()
382 394 newprofile.state = 1
383 395
384 396 for element in patterns:
385 397 newpattern = newprofile.pattern_set.create(value=element["number"])
386 398 newpattern.antennaup_set.create(value=element["up"])
387 399 newpattern.antennadown_set.create(value=element["down"])
388 400
389 401 newprofile.save()
390 402
391 403 newurl = '/abscontrol/edit/%d' % int(newprofile.id)
392 404 return redirect(newurl)
393 405 else:
394 406 txtError = "Experiment's name not found or the number of patterns is 0."
395 407 return render_to_response('abscontrol/error.html', {'profile_list': profile_list,
396 408 'txtError' : txtError, },
397 409 context_instance=RequestContext(request))
398 410 else:
399 411 txtError = "No file."
400 412
401 413 return render_to_response('abscontrol/error.html', {'profile_list': profile_list, 'txtError' : txtError, },
402 414 context_instance=RequestContext(request))
403 415
404 416 def getImgfromOverJRO(profile_id, objAntenna):
405 417 objProfile = Profile.objects.get(pk=profile_id)
406 418 exp_name = objProfile.name
407 419 phase_tx = objAntenna.value
408 420 gain_tx = objAntenna.tx
409 421 gain_rx = objAntenna.rx
410 422 ues_tx = objAntenna.ues
411 423 just_rx = objAntenna.only_rx
412 424
413 425 overjro = OverJRO()
414 426 overjro.setParameters(settings.MEDIA_ROOT, exp_name, phase_tx, gain_tx, gain_rx, ues_tx, just_rx)
415 427 contentFile = overjro.setTextContent()
416 428 finalpath = overjro.saveFile(contentFile)
417 429
418 430 currentdate = datetime.today()
419 431 newOverJro = overJroShow()
420 432 newOverJro.setInputParameters(settings.MEDIA_ROOT, currentdate, finalpath)
421 433 newOverJro.setupParameters()
422 434 newOverJro.execute()
423 435 path = newOverJro.getPlot()
424 436
425 437 return path
426 438
427 439 def overJROUp(request, profile_id, pattern_id, antenna_id):
428 440 objAntenna = AntennaUp.objects.get(pk=antenna_id)
429 441 img_path = getImgfromOverJRO(profile_id, objAntenna)
430 442 filename = os.path.split(img_path)[1]
431 443 return render_to_response('abscontrol/overjro_up.html', {'img_up': filename,'antennaUp': objAntenna,},
432 444 context_instance=RequestContext(request))
433 445
434 446 def overJRODown(request, profile_id, pattern_id, antenna_id):
435 447 objAntenna = AntennaDown.objects.get(pk=antenna_id)
436 448 img_path = getImgfromOverJRO(profile_id, objAntenna)
437 449 filename = os.path.split(img_path)[1]
438 450 return render_to_response('abscontrol/overjro_down.html', {'img_down': filename, 'antennaDown': objAntenna,},
439 451 context_instance=RequestContext(request))
440 452
441 453 def export(request, profile_id):
442 454 listPatterns = []
443 455 objProfile = Profile.objects.get(pk=profile_id)
444 456 exp_name = objProfile.name
445 457 lsPatterns = objProfile.pattern_set.all()
446 458 for element in lsPatterns:
447 459 objAntennaUp = element.antennaup_set.get()
448 460 objAntennaDown = element.antennadown_set.get()
449 461 dicPatterns = {"number" : element.value, "up" : objAntennaUp.value, "down" : objAntennaDown.value}
450 462 listPatterns.append(dicPatterns)
451 463
452 464 absFile = saveABSFile()
453 465 absFile.setParameters(settings.MEDIA_ROOT, exp_name, listPatterns)
454 466 filename, filesize = absFile.save()
455 467
456 468 wrapper = FileWrapper( open( filename, "r" ) )
457 469 content_type = mimetypes.guess_type( filename )[0]
458 470
459 471 response = HttpResponse(wrapper, content_type = content_type)
460 472 response['Content-Description'] = 'File Transfer'
461 473 response['Content-Disposition'] = 'attachment; filename=%s' % smart_str(filename)
462 474 response['Content-Transfer-Encoding'] = 'binary'
463 475 response['Expires'] = '0'
464 476 response['Cache-Control'] = 'must-revalidate'
465 477 response['Pragma'] = 'public'
466 478 response['Content-Length'] = '%s' % str(filesize)
467 479 response['X-Sendfile'] = '%s' % smart_str(filename)
468 480
469 481 return response
470 482
471 483 def send(request, profile_id):
472 484 listPatterns = []
473 485 objProfile = Profile.objects.get(pk=profile_id)
474 486 exp_name = objProfile.name
475 487
476 488 lsPatterns = objProfile.pattern_set.all()
477 489 for element in lsPatterns:
478 490 objAntennaUp = element.antennaup_set.get()
479 491 objAntennaDown = element.antennadown_set.get()
480 492 dicPatterns = {"number" : element.value, "up" : objAntennaUp.value, "down" : objAntennaDown.value}
481 493 listPatterns.append(dicPatterns)
482 494
483 495 absFile = saveABSFile()
484 496 absFile.setParameters(settings.MEDIA_ROOT, exp_name, listPatterns)
485 497 filename, filesize = absFile.save()
486 498
487 499 apiclient = sendFile()
488 500 apiclient.execute(filename)
489 501 output = apiclient.getOutput()
490 502
491 503 if output == "OK":
492 504 message = "File sent successfully."
493 505 lsProfilesActive = Profile.objects.filter(is_active=1)
494 506 if len(lsProfilesActive) > 0:
495 507 objProfileActive = Profile.objects.get(is_active=1)
496 508 objProfileActive.is_active = 0
497 509 objProfileActive.save()
498 510
499 511 lsPatternsActive = Pattern.objects.filter(is_active=1)
500 512 if len(lsPatternsActive) > 0:
501 513 objPatternActive = Pattern.objects.get(is_active=1)
502 514 objPatternActive.is_active = 0
503 515 objPatternActive.save()
504 516
505 517 objProfile.hits += 1
506 518 objProfile.is_active = 1
507 519 objProfile.save()
508 520
509 521 pattern_value = 1
510 522 patternChoosen = objProfile.pattern_set.get(value=pattern_value)
511 523 patternChoosen.is_active = 1
512 524 patternChoosen.save()
513 525
514 526 newurl = '/abscontrol/view/%d' % int(profile_id)
515 527
516 528 return redirect(newurl)
517 529 else:
518 530 message = "Error sending file."
519 531
520 532 profile_list = Profile.objects.all()
521 533
522 534 return render_to_response('abscontrol/sendFile.html', {'message': message, "profile_list" : profile_list,
523 535 'objProfile': objProfile,
524 536 }, context_instance=RequestContext(request))
525 537
526 538 def changePattern(request, profile_id, pattern_id):
527 539 patternChoosen = Pattern.objects.get(id=pattern_id)
528 540 beam = int(patternChoosen.value)-1
529 541
530 542 apiclient = changeBeam()
531 543 apiclient.execute(str(beam))
532 544 output = apiclient.getOutput()
533 545
534 546 if output == "OK":
535 547 lsPatternsActive = Pattern.objects.filter(is_active=1)
536 548 if len(lsPatternsActive) > 0:
537 549 objPatternActive = Pattern.objects.get(is_active=1)
538 550 objPatternActive.is_active = 0
539 551 objPatternActive.save()
540 552
541 553 patternChoosen.hits += 1
542 554 patternChoosen.is_active = 1
543 555 patternChoosen.save()
544 556
545 557 newurl = '/abscontrol/%d/view/%d/' % (int(profile_id), int(pattern_id))
546 558 return redirect(newurl)
547 559 else:
548 560 message = "Error sending file."
549 561 profile_list = Profile.objects.all()
550 562 return render_to_response('abscontrol/sendFile.html', {'message': message, "profile_list" : profile_list,
551 563 }, context_instance=RequestContext(request))
552 564 No newline at end of file
@@ -1,724 +1,746
1 1 /*
2 2 * font-family: 'Droid Sans', sans-serif;
3 3 * font-family: 'Ubuntu', sans-serif;
4 4 * font-family: 'Open Sans', sans-serif;
5 5 * font-family: 'Open Sans Condensed', sans-serif;
6 6 * font-family: 'Roboto Condensed', sans-serif;
7 7 */
8 8
9 9 body {
10 10 padding: 0;
11 11 margin: 0;
12 12 font-size: 12px; }
13 13
14 14 header {
15 15 width: 980px;
16 height: 50px;
16 height: 50px;
17 17 text-align: center;
18 18 line-height: 50px;
19 19 border: 0px solid #fcc !important; }
20 20
21 21 #schema {
22 22 margin: 0 auto;
23 23 width: 980px;
24 24 padding: 10px 10px;
25 25 border: 0px solid #f00 !important; }
26 26
27 27 #content {
28 28 margin: 2px 0px 0px 0px;
29 29 border: 0px solid #1cc !important; }
30 30
31 31 #topcolumn {
32 32 float: left;
33 33 width: 980px;
34 34 height: 40px;
35 35 line-height: 35px;
36 36 margin: 2px 0px;
37 37 border: 1px solid #ddd !important;
38 38 box-shadow: 2px 2px 5px #888; }
39 39
40 40 #activeProfileBar {
41 41 float: left;
42 42 width: 980px;
43 43 margin: 0px 0px;
44 44 height: 25px;
45 45 border: 1px solid #ddd !important;
46 46 box-shadow: 1px 1px 5px #ccc; }
47 47
48 48 #maincolumn {
49 49 float: left;
50 50 width: 980px;
51 51 margin: 2px 0px 0px 0px;
52 52 padding: 2px 0px 6px 0px;
53 53 border: 1px solid #ddd !important;
54 54 box-shadow: 2px 2px 5px #666; }
55 55
56 56 footer {
57 57 height: 30px;
58 58 line-height: 30px;
59 59 text-align: center;
60 60 margin: 0px 0px;
61 61 border: 0px solid #200 !important;
62 62 box-shadow: 2px 2px 5px #888; }
63 63
64 64 .cleardivs {
65 65 clear: both;
66 66 border: 0px solid #400;
67 67 height: 0px; }
68 68
69 69 textarea {
70 70 resize: none;
71 71 overflow: hidden; }
72 72
73 73 /****************************************************************************************/
74 74 /****** ESTILOS GENERALES *****************/
75 75 /****************************************************************************************/
76 76 a {
77 77 font-family: 'Droid Sans', sans-serif;
78 78 text-decoration: none;
79 79 color: #1494F6; }
80 80
81 81 .mnu {
82 82 height: 22px;
83 83 border: 0px solid #c55 !important; }
84 84
85 85 .mnu li {
86 86 display:inline; }
87 87
88 88 .MnuVertical, .MnuHorizontal {
89 89 font-family: 'Droid Sans', sans-serif;
90 90 font-size: inherit;
91 91 font-style: normal;
92 92 text-shadow: 2px 2px #eee; }
93 93
94 94 .MnuHorizontal ul {
95 95 list-style: none;
96 96 list-style-type: none;
97 97 margin: 0; }
98 98
99 99 /*.MnuHorizontal{
100 100 display: -webkit-box;
101 101 -webkit-box-orient:horizontal; }
102 102
103 103 .MnuHorizontal a{
104 104 display:block;
105 105 padding:10px;
106 106 -webkit-box-flex:1;
107 107 text-align:center; }*/
108 108
109 109 .link-disabled {
110 110 color: #666;
111 111 text-decoration: None;
112 112 cursor: default; }
113 113
114 114 /****************************************************************************************/
115 115 /****** MENU DE NAVEGACION DE PERFILES *************/
116 116 /****************************************************************************************/
117 117 #infoProfiles {
118 118 float: left;
119 119 width: 300px;
120 120 margin: 0px;
121 121 padding: 2px 0px;
122 122 border: 0px solid #1cc !important; }
123 123
124 124 #infoProfiles label {
125 125 padding: 10px 10px 10px 12px;
126 126 margin: 10px 0;
127 127 font-family: 'Droid Sans', sans-serif;
128 128 /*font-family: 'Roboto Condensed', sans-serif;*/
129 129 /*letter-spacing: 0.046em;*/ }
130 130
131 131 #infoProfiles select {
132 132 padding: 4px 0px; margin: 0;
133 133 font-family: 'Droid Sans', sans-serif;
134 134 font-size: 12px;
135 135 letter-spacing: 0.006em;
136 136 width: 200px; }
137 137
138 138 #mnuProfiles {
139 139 margin: 0;
140 140 float: right;
141 141 padding: 2px 10px;
142 142 border: 0px solid #1494F6 !important; }
143 143
144 144 #mnuProfiles ul {
145 145 list-style: none;
146 146 list-style-type: none;
147 147 margin: 0;
148 148 padding-left: 20px;
149 149 border: 0px solid #f00 !important; }
150 150
151 151 #mnuProfiles li {
152 152 width: 80px;
153 153 float: left;
154 154 padding: 2px;
155 155 border: 0px solid #c55 !important; }
156 156
157 157 #mnuProfiles a {
158 158 font-weight: normal;
159 159 color: #1494F6;
160 160 display: block;
161 161 text-align: center;
162 162 border-bottom: 1px solid #1494F6 !important;
163 163 text-decoration: none;
164 164 padding: 0px 4px;
165 165 line-height: 18px;
166 166 margin: 6px; }
167 167
168 168 /****************************************************************************************/
169 169 /****** BARRA DE PERFILES ACTIVOS *************/
170 170 /****************************************************************************************/
171 171
172 172 #activeProfileBar label, a{
173 173 line-height: 20px;
174 174 float: left;
175 175 letter-spacing: 0.01em;
176 176 padding: 3px 12px;
177 177 border: 0px solid #f00 !important; }
178 178
179 179 .titleBar {
180 180 color: #333;
181 181 margin-left: 2px;
182 182 text-align: right; }
183 183
184 184 .ActiveProfile, .ActivePattern, .lnkActiveProfile {
185 185 color: #001bf4;
186 186 margin: 0px 2px;
187 187 text-align: left;
188 188 text-decoration: None; }
189 189
190 190 .navbarsep{
191 191 float: left; }
192 192
193 193 /****************************************************************************************/
194 194 /******** FORMULARIO DE PERFILES *************************************/
195 195 /****************************************************************************************/
196 196 #divProfile {
197 197 margin: 10px 0px;
198 198 padding: 10px 10px;
199 199 width: 500px;
200 200 border: 0px solid #dff !important; }
201 201
202 202 #divProfile label,input[type=text],input[type=file] {
203 203 font-family: 'Open Sans', sans-serif;
204 204 font-size: inherit; }
205 205
206 206 #divProfile label {
207 207 float: left;
208 208 text-align: right;
209 209 width: 120px;
210 210 padding: 3px 10px 3px 10px;
211 211 line-height: 20px;
212 212 border: 0px solid #d85 !important;
213 213 }
214 214
215 215 #divProfile input[type=text] {
216 216 letter-spacing: 0.08em;
217 217 padding: 2px 10px 2px 10px;
218 218 width: 200px;
219 219 }
220 220
221 221 #divProfile input[type=text]:FOCUS {
222 222 border: 1px solid #faa !important;
223 223 border-radius: 0.26em;
224 224 box-shadow: 2px 2px 5px #fbb;
225 225 }
226 226
227 227 .lblProfile {
228 228 width: 200px; }
229 229
230 230 #divPattern textarea,input[type=text],label,input[type=file],input[type=button],input[type=submit] {
231 231 font-family: 'Roboto Condensed', sans-serif;
232 232 font-size: inherit; }
233 233
234 234 .antenna, .NewAntenna {
235 235 box-shadow: 1px 1px 2px #666;
236 236 padding: 5px;
237 237 margin: 10px auto;
238 238 display: block;
239 239 border: 0px solid #fee !important; }
240 240
241 241 .antenna {
242 242 width: 520px; }
243 243
244 244 .NewAntenna {
245 245 width: 750px;
246 246 border: 0px solid #f00 !important; }
247 247
248 248 .flsAntenna, .NewFlsAntenna {
249 249 margin: 0;
250 250 padding: 0px;
251 251 border: 1px solid #fee !important; }
252 252
253 253 .flsAntenna {
254 254 width: 510px; }
255 255
256 256 .NewFlsAntenna {
257 257 width: 100%; }
258 258
259 259 .legendAntenna {
260 260 font-family: 'Roboto Condensed', sans-serif;
261 261 font-size: inherit;
262 262 text-align: left;
263 263 margin-left: 10px; }
264 264
265 265 .infoAntenna {
266 266 width: 500px;
267 267 float: left;
268 268 border: 0px solid #f00 !important; }
269 269
270 270 .overJRO {
271 271 width: 250px;
272 272 float: left;
273 273 margin: 0px 5px;
274 274 border: 0px solid #1cc !important; }
275 275
276 276 .divAntenna, .NewDivAntenna, .NewDivTx {
277 277 float: left;
278 278 margin: 10px;
279 279 border: 0px solid #fcc !important; }
280 280
281 281 .divAntenna {
282 282 width: 220px;
283 283 border: 0px solid #fcc !important; }
284 284
285 285 .NewDivAntenna {
286 286 border: 0px solid #fcc !important; }
287 287
288 288 .NewDivTx {
289 289 border: 0px solid #fcc !important; }
290 290
291 291 .titleField {
292 292 display: block;
293 293 text-align: center;
294 294 font-family: 'Roboto Condensed', sans-serif;
295 295 letter-spacing: 0.086em; }
296 296
297 297 .txtAntenna, .view-textAntenna {
298 298 width: 175px;
299 299 max-width: 180px;
300 300 height: 160px;
301 301 max-height: 165px;
302 302 background: #fdfdfb;
303 303 border: 2px solid #eee !important;
304 304 text-align: justify;
305 305 margin: 0 auto;
306 306 line-height: 20px; }
307 307
308 308 .txtAntenna {
309 309 padding: 4px;
310 310 }
311 311
312 312 .view-textAntenna {
313 313 padding: 2px;
314 314 font-family: "Ubuntu";
315 315 font-size: inherit; }
316 316
317 317 .boxAntenna, .boxTR {
318 318 border: 2px solid #eee !important;
319 319 text-align: center;
320 320 display: block;
321 321 float: left;
322 322 margin: 0;
323 323 padding: 0; }
324 324
325 325 .boxAntenna {
326 326 padding: 3px; }
327 327
328 328 .boxTR {
329 329 padding: 3px; }
330 330
331 331 .fullLine{
332 332 font-size: 0.95em; }
333 333
334 334 .lineInputs, .lineInputsTx {
335 335 text-align: left;
336 336 line-height: 1.4em;
337 337 padding: 0;
338 338 margin: 0px;
339 339 display: block;
340 340 float: left;
341 341 border: 0px solid #1cc !important; }
342 342
343 343 .lineInputs {
344 344 /*width: 240px;*/
345 345 border: 0px solid #1cc !important; }
346 346
347 347 .lineInputsTx {
348 348 /*width: 185px;*/
349 349 border: 0px solid #1cc !important; }
350 350
351 351 .divValuesAntenna, .divValuesTx {
352 352 float: left;
353 353 display: block;
354 354 margin: 0 auto;
355 355 border: 0px solid #bbb !important; }
356 356
357 357 .divValuesAntenna {
358 358 /*width: 230px;*/
359 359 border: 0px solid #2eb !important; }
360 360
361 361 .divValuesTx {
362 362 /*width: 175px;*/
363 363 border: 0px solid #bbb !important; }
364 364
365 365 .divValuesAntenna input[type=text], .divValuesTx input[type=text] {
366 366 border: 0px;
367 367 border-bottom: 1px solid #666 !important;
368 368 line-height: 1.1em;
369 369 font-family: 'Roboto Condensed', sans-serif; }
370 370
371 371 .divValuesAntenna input[type=text] {
372 372 width: 18px; }
373 373
374 374 .divValuesTx input[type=text]{
375 375 width: 11px; }
376 376
377 377 .lblSign, .lblSignTx {
378 378 font-family: 'Roboto Condensed', sans-serif;
379 379 color: #666;
380 380 float: left;
381 381 margin: 0px;
382 382 border: 0px solid #bbb !important; }
383 383
384 384 .lblSignLeft {
385 385 font-family: 'Roboto Condensed', sans-serif;
386 386 color: #666;
387 387 float: left;
388 388 margin: 0px 2px 0px 0px;
389 389 padding: 0;
390 390 border: 0px solid #f00 !important; }
391 391
392 392 .lblSignRight {
393 393 font-family: 'Roboto Condensed', sans-serif;
394 394 color: #666;
395 395 float: left;
396 396 margin: 0;
397 397 padding: 0;
398 398 border: 0px solid #f00 !important; }
399 399
400 400 .lblNewSignLeft, .lblNewSignRight {
401 401 font-family: 'Roboto Condensed', sans-serif;
402 402 color: #666;
403 403 float: left;
404 404 padding: 0; }
405 405
406 406 .lblNewSignLeft {
407 407 margin: 0px 2px 0px 0px;
408 408 border: 0px solid #f00 !important; }
409 409
410 410 .lblNewSignRight {
411 411 margin: 0;
412 412 border: 0px solid #f00 !important; }
413 413
414 414 .divTx {
415 415 display: block;
416 416 float: left;
417 417 margin: 10px;
418 418 border: 0px solid #f00 !important; }
419 419
420 420 .divTx label {
421 421 display: block; }
422 422
423 423 .divTx textarea {
424 424 width: 100px;
425 425 max-width: 100px;
426 426 height: 160px;
427 427 max-height: 165px;
428 428 text-align: justify;
429 429 border: 2px solid #eee !important;
430 430 font-family: "Ubuntu";
431 431 font-size: inherit;
432 432 line-height: 20px; }
433 433
434 434 .divTx p {
435 435 width: 100px;
436 436 max-width: 105px;
437 437 height: 160px;
438 438 max-height: 165px;
439 439 background: #fdfdfb;
440 440 padding: 2px;
441 441 border: 1px solid #eee !important;
442 442 font-family: 'Ubuntu', sans-serif;
443 443 font-size: inherit;
444 444 text-align: justify;
445 445 margin: 0 auto;
446 446 line-height: 20px; }
447 447
448 448 .divUes {
449 449 display: block;
450 450 margin: 10px; }
451 451
452 452 .divUes input[type=text] {
453 453 width: 240px;
454 454 max-width: 240px;
455 455 font-family: 'Ubuntu', sans-serif;
456 456 font-size: inherit; }
457 457
458 458 .divNewUes {
459 459 width: 350px;
460 460 display: block;
461 461 margin: 0px 10px;
462 462 padding: 0;
463 463 font-family: 'Roboto Condensed', sans-serif;
464 464 /*overflow: hidden;*/
465 465 border: 0px solid #f00 !important; }
466 466
467 467 .titleUes {
468 468 width: 35px;
469 469 text-align: right;
470 470 padding-right: 5px;
471 471 float: left;
472 472 line-height: 22px;
473 473 font-family: 'Roboto Condensed', sans-serif;
474 474 letter-spacing: 0.086em;
475 475 border: 0px solid #266 !important; }
476 476
477 477 .valueUes {
478 478 width: 300px;
479 479 float: left;
480 480 border: 0px solid #2f4 !important;
481 481 line-height: 22px; }
482 482
483 483 .lblUes {
484 484 font-family: 'Roboto Condensed', sans-serif;
485 485 color: #666;
486 486 font-size: 1.1em; }
487 487
488 488 .txtUnitUes {
489 489 width: 60px;
490 490 border: 0;
491 491 padding: 0px 2px;
492 492 text-align: center;
493 493 font-family: 'Roboto Condensed', sans-serif;
494 494 font-size: 0.95em;
495 495 border-bottom: 1px solid #666 !important; }
496 496 /*
497 497 .divNewUes input[type=text] {
498 498 width: 240px;
499 499 max-width: 240px;
500 500 line-height: 22px; }
501 501 */
502
503 .checkOnly, .divOnlyRx {
504 display: block;
505 line-height: 25px;
506 border: 0px solid #f00 !important; }
507
508 .divOnlyRx {
509 width: 350px;
510 margin: 5px 10px;
511 padding: 0;
512 font-family: 'Roboto Condensed', sans-serif; }
513
502 514 .checkOnly {
503 515 width: 120px;
504 float: left;
505 display: block;
506 line-height: 25px;
507 border: 0px solid #1cc !important; }
516 float: left; }
517
518 .checkOnly input[type=checkbox], .divOnlyRx input[type=checkbox] {
519 width: 1em;
520 height: 1em; }
521
522 .divOnlyRx input {
523 padding: 0px;
524 float: left;
525 margin: 5px 8px; }
526
527 .divOnlyRx label {
528 line-height: 20px;
529 border: 0px solid #f00 !important; }
508 530
509 531 .overJRO img {
510 532 width: 400px;
511 533 height: 270px;
512 534 text-align: center;
513 535 vertical-align: middle;
514 536 margin: 10px 5px 5px 5px;
515 537 display: block;
516 538 background: #fdfdfb;
517 539 border: 1px solid #eee !important; }
518 540
519 541 .overJRO a {
520 542 text-align: center;
521 543 margin-left: 160px;
522 544 display: block; }
523 545
524 546 .activeOverJRO {
525 547 width: 60px;
526 548 padding: 0px 2px;
527 549 border-bottom: 1px solid #1494F6 !important; }
528 550
529 551 /****************************************************************************************/
530 552 /****** MENU DE NAVEGACION DE PATRONES **********************************/
531 553 /****************************************************************************************/
532 554 #divMnuPattern {
533 555 width: 280px;
534 556 height: 25px;
535 557 display: block;
536 558 float: right;
537 559 margin: 5px 40px 5px 0px;
538 560 border: 0px solid #1cc !important; }
539 561
540 562 #divMnuPattern li {
541 563 float: right;
542 564 display: block;
543 565 width: 60px;
544 566 border: 0px solid #2cc !important; }
545 567
546 568 #divMnuPattern a {
547 569 display: block;
548 570 line-height: 22px;
549 571 text-decoration: none;
550 572 padding: 0px 5px;
551 573 margin: 0px 2px;
552 574 text-align: center;
553 575 color: #1494F6;
554 576 border-bottom: 1px solid #1494F6 !important; }
555 577
556 578 #infoPattern {
557 579 display: block;
558 580 margin: 0px 25px;
559 581 border: 0px solid #1494f6 !important; }
560 582
561 583 #navPatterns {
562 584 margin: 0 auto;
563 585 width: 700px;
564 586 height: 30px;
565 587 border: 0px solid #d00 !important;
566 588 font-family: 'Ubuntu', sans-serif;
567 589 font-size: 14px;
568 590 padding: 5px 0px; }
569 591
570 592 #navPatternList {
571 593 margin: 0 auto;
572 594 border: 0px solid #ecc !important; }
573 595
574 596 #navPatternList ul {
575 597 list-style: none;
576 598 list-style-type: none;
577 599 margin: 0; }
578 600
579 601 #navPatternList ul li {
580 602 float: left;
581 603 width: 50px;
582 604 border: 1px solid #eee !important; }
583 605
584 606 #navPatternList a {
585 607 width: 50px;
586 608 display: block;
587 609 text-align: center;
588 610 line-height: 30px;
589 611 padding: 1px 0px;
590 612 border: 0px solid #1cc !important; }
591 613
592 614 .lnkPattern {
593 615 background-color: #ccc !important;
594 616 color: #eee; }
595 617
596 618 .lnkPatternSelected {
597 619 background-color: #2cc !important;
598 620 color: #fff; }
599 621
600 622 .lnkPatternActive {
601 623 color: #f66;
602 624 }
603 625
604 626 .divListofPatterns {
605 627 width: 650px;
606 628 display: block;
607 629 border: 1px solid #1cc !important;
608 630 margin: 0 auto; }
609 631
610 632 .divPattern {
611 633 width: 600px;
612 634 display: block;
613 635 border: 1px solid #f00 !important;
614 636 margin: 2px auto; }
615 637
616 638 /****************************************************************************************/
617 639 /****** HEADER *************/
618 640 /****************************************************************************************/
619 641 header nav {
620 642 width: 960px;
621 643 margin: 0 auto;
622 644 height: 100%;
623 645 border: 0px solid #1cc !important; }
624 646
625 647 header nav a {
626 648 font-family: 'Roboto Condensed', sans-serif;
627 649 font-size: 1.98em;
628 650 text-transform: uppercase;
629 651 width: 232px;
630 652 padding: 2px;
631 653 text-align: center;
632 654 border: 1px solid #ddd !important;
633 655 box-shadow: 1px 1px 2px #ddd;
634 656 display: block;
635 657 float: left;
636 658 height: 45px;
637 659 text-decoration: none;
638 660 background: #eee;
639 661 line-height: 45px;
640 662 color: #15425d;
641 663 margin: 0px 1px; }
642 664
643 665 header nav a.selected {
644 666 background: #666;
645 667 color: #fff; }
646 668
647 669 #Main_Head {
648 670 margin: 0 auto;
649 671 height: 100%;
650 672 border: 1px solid #ddd !important;
651 673 box-shadow: 1px 1px 2px #ddd;
652 674 border-radius: 5px;
653 675 display: block; }
654 676
655 677 .Main_Title {
656 678 font-size: 2em;
657 679 letter-spacing: 0.06em;
658 680 color: #444;
659 681 text-shadow: 2px 2px #ccc; }
660 682
661 683 /****************************************************************************************/
662 684 /****** FOOTER *************/
663 685 /****************************************************************************************/
664 686 footer p {
665 687 font-family: 'Roboto Condensed', sans-serif;
666 688 font-size: 0.98em; }
667 689
668 690 /****************************************************************************************/
669 691 /****** LOGIN *************/
670 692 /****************************************************************************************/
671 693 #contentLogin {
672 694 margin: 0;
673 695 padding: 0;
674 696 border: 0px solid #1cc; }
675 697
676 698 #MainColumnLogin {
677 699 margin: 2px auto;
678 700 border: 0px solid #f00 !important;
679 701 box-shadow: 1px 1px 2px #ddd;
680 702 border-radius: 2px;
681 703 background-color: #eee;
682 704 width: 100%;
683 705 padding: 5px 0px;
684 706 }
685 707
686 708 .row_reg {
687 709 margin: 5px auto;
688 710 display: block;
689 711 width: 90%;
690 712 border: 0px solid #1cc !important;
691 713 line-height: 22px;
692 714 }
693 715
694 716 .row_reg label, .row_reg input[type=text] {
695 717 float: left;
696 718 line-height: 22px;
697 719 }
698 720
699 721 #id_username, #id_password {
700 722 width: 160px;
701 723 line-height: 22px;
702 724 }
703 725
704 726 .row_reg label {
705 727 width: 400px;
706 728 text-align: right;
707 729 padding-right: 10px;
708 730 border: 0px solid #d22 !important;
709 731 }
710 732
711 733 .row_reg input[type=submit], .row_reg input[type=button] {
712 734 margin-left: 410px;
713 735 width: 80px;
714 736 }
715 737
716 738 #lblTitleLogin {
717 739 width: 100%;
718 740 text-align: center;
719 741 font-size: 1.2em;
720 742 font-weight: normal;
721 743 color: #222;
722 744 border: 0px solid #f00 !important;
723 745 background-color: #ccc;
724 746 } No newline at end of file
@@ -1,254 +1,264
1 1 {% extends "abscontrol/edit.html" %}
2 2
3 3 {% block mnuPattern %}
4 4 <div class="divMenu" id="divMnuPattern">
5 5 <nav class="MnuHorizontal">
6 6 <ul class="mnu" id="mnuPattern">
7 7 <li><a href="#" id="lnkCancel">Delete</a></li>
8 8 <li><a href="#" id="lnkSavePattern">Save</a></li>
9 9 {% if lsPatterns|length < 10 %}
10 10 <li><a href="#" id="lnkAdd">Add</a></li>
11 11 {% endif %}
12 12 </ul>
13 13 </nav>
14 14 </div>
15 15 <div class="cleardivs"></div>
16 16 {% endblock %}
17 17 {% block pattern %}
18 18 <div id="divPattern">
19 19 <form action="{% url abscontrol.views.savePattern objProfile.id %}" id="frmPattern" method="post">
20 20 {% csrf_token %}
21 21 <div id="antennaUp" class="NewAntenna">
22 22 <fieldset class="NewFlsAntenna">
23 23 <legend class="legendAntenna">UP</legend>
24 24 <div class="NewDivAntenna">
25 25 <label for="lblAntenna" class="titleField">Antenna</label>
26 26 <div class="boxAntenna" id="divtxtAntenna">
27 27 {% for lines in arrayAntennaUp %}
28 28 <div class="fullLine">
29 29 {% if forloop.first %}
30 30 <label for="lblSignLeft" class="lblSignLeft">[</label>
31 31 {% else %}
32 32 <label for="lblSignLeft" class="lblSignLeft">&nbsp;</label>
33 33 {% endif %}
34 34 <div class="lineInputs">
35 35 <label for="lblSign" class="lblSign">[</label>
36 36 <div class="divValuesAntenna">
37 37 {% for line in lines %}
38 38 <input type="text" name="txtUnitAntennaUp" class="txtUnitAntenna" id="txtUnitAntennaUp_{{ forloop.parentloop.counter0 }}_{{ forloop.counter0 }}" value="{{line}}" maxlength="3" />
39 39 {% if not forloop.last %},{% endif %}
40 40 {% endfor %}
41 41 </div>
42 42 <label for="lblSign" class="lblSign">]</label>
43 43 </div>
44 44 {% if forloop.last %}
45 45 <label for="lblSignRight" class="lblSignRight">]</label>
46 46 {% else %}
47 47 <label for="lblSignRight" class="lblSignRight">,</label>
48 48 {% endif %}
49 49 </div>
50 50 <div class="cleardivs"></div>
51 51 {% endfor %}
52 52 </div>
53 53 </div>
54 54 <div class="NewDivTx">
55 55 <label for="lblTx" class="titleField">Tx</label>
56 56 <div class="boxTR" id="divtxtTR">
57 57 {% for lines in arrayTxUp %}
58 58 <div class="fullLine">
59 59 {% if forloop.first %}
60 60 <label for="lblNewSignLeft" class="lblNewSignLeft">[</label>
61 61 {% else %}
62 62 <label for="lblNewSignLeft" class="lblNewSignLeft">&nbsp;</label>
63 63 {% endif %}
64 64 <div class="lineInputsTx">
65 65 <label for="lblSign" class="lblSignTx">[</label>
66 66 <div class="divValuesTx">
67 67 {% for line in lines %}
68 68 <input type="text" name="txtUnitTxUp" class="txtUnitTx" id="txtUnitTxUp_{{ forloop.parentloop.counter0 }}_{{ forloop.counter0 }}" value="{{ line }}" maxlength="1" />
69 69 {% if not forloop.last %},{% endif %}
70 70 {% endfor %}
71 71 </div>
72 72 <label for="lblSign" class="lblSignTx">]</label>
73 73 </div>
74 74 {% if forloop.last %}
75 75 <label for="lblNewSignRight" class="lblNewSignRight">]</label>
76 76 {% else %}
77 77 <label for="lblNewSignRight" class="lblNewSignRight">,</label>
78 78 {% endif %}
79 79 </div>
80 80 <div class="cleardivs"></div>
81 81 {% endfor %}
82 82 </div>
83 83 <div class="cleardivs"></div>
84 84 </div>
85 85 <div class="NewDivTx">
86 86 <label for="lblRx" class="titleField">Rx</label>
87 87 <div class="boxTR" id="divtxtTR">
88 88 {% for lines in arrayRxUp %}
89 89 <div class="fullLine">
90 90 {% if forloop.first %}
91 91 <label for="lblNewSignLeft" class="lblNewSignLeft">[</label>
92 92 {% else %}
93 93 <label for="lblNewSignLeft" class="lblNewSignLeft">&nbsp;</label>
94 94 {% endif %}
95 95 <div class="lineInputsTx">
96 96 <label for="lblSign" class="lblSignTx">[</label>
97 97 <div class="divValuesTx">
98 98 {% for line in lines %}
99 99 <input type="text" name="txtUnitRxUp" class="txtUnitRx" id="txtUnitRxUp_{{ forloop.parentloop.counter0 }}_{{ forloop.counter0 }}" value="{{ line }}" maxlength="1" />
100 100 {% if not forloop.last %},{% endif %}
101 101 {% endfor %}
102 102 </div>
103 103 <label for="lblSign" class="lblSignTx">]</label>
104 104 </div>
105 105 {% if forloop.last %}
106 106 <label for="lblNewSignRight" class="lblNewSignRight">]</label>
107 107 {% else %}
108 108 <label for="lblNewSignRight" class="lblNewSignRight">,</label>
109 109 {% endif %}
110 110 </div>
111 111 <div class="cleardivs"></div>
112 112 {% endfor %}
113 113 </div>
114 114 <div class="cleardivs"></div>
115 115 </div>
116 116 <div class="cleardivs"></div>
117 117 <div class="divNewUes">
118 118 <label for="lblUes" class="titleUes">Ues:</label>
119 119 <div class="valueUes">
120 120 <label for="lblUes">[</label>
121 121 {% for element in arrayUesUp %}
122 122 <input type="text" name="unitUesUp_{{ forloop.counter }}" value="{{ element }}" maxlength="8" class="txtUnitUes" />
123 123 {% if not forloop.last %},{% endif %}
124 124 {% endfor %}
125 125 <label for="lblUes">]</label>
126 126 </div>
127 127 </div>
128 <div class="cleardivs"></div>
129 <div class="divOnlyRx">
130 <input type="checkbox" name="chkOnlyRxUp" value="1" {% if antennaUp.only_rx == 1 %}checked{% endif %} />
131 <label for="lblOnlyRx" class="titleOnlyRx">Only Rx</label>
132 </div>
128 133 <input type="hidden" name="txtAntennaUpId" value="{{ antennaUp.id }}" />
129 134 </fieldset>
130 135 <input type="hidden" name="txtAntennaUp" value="" />
131 136 <input type="hidden" name="txtTxUp" value="" />
132 137 <input type="hidden" name="txtRxUp" value="" />
133 138 <input type="hidden" name="txtUesUp" value="" />
134 139 </div>
135 140 <div id="antennaDown" class="NewAntenna">
136 141 <fieldset class="NewFlsAntenna">
137 142 <legend class="legendAntenna">DOWN</legend>
138 143 <div class="NewDivAntenna">
139 144 <label for="lblAntenna" class="titleField">Antenna</label>
140 145 <div class="boxAntenna" id="divtxtAntenna">
141 146 {% for lines in arrayAntennaDown %}
142 147 <div class="fullLine">
143 148 {% if forloop.first %}
144 149 <label for="lblSignLeft" class="lblSignLeft">[</label>
145 150 {% else %}
146 151 <label for="lblSignLeft" class="lblSignLeft">&nbsp;</label>
147 152 {% endif %}
148 153 <div class="lineInputs">
149 154 <label for="lblSign" class="lblSign">[</label>
150 155 <div class="divValuesAntenna">
151 156 {% for line in lines %}
152 157 <input type="text" name="txtUnitAntennaDown" class="txtUnitAntenna" id="txtUnitAntennaDown_{{ forloop.parentloop.counter0 }}_{{ forloop.counter0 }}" value="{{ line }}" maxlength="3" />
153 158 {% if not forloop.last %},{% endif %}
154 159 {% endfor %}
155 160 </div>
156 161 <label for="lblSign" class="lblSign">]</label>
157 162 </div>
158 163 {% if forloop.last %}
159 164 <label for="lblSignRight" class="lblSignRight">]</label>
160 165 {% else %}
161 166 <label for="lblSignRight" class="lblSignRight">,</label>
162 167 {% endif %}
163 168 </div>
164 169 <div class="cleardivs"></div>
165 170 {% endfor %}
166 171 </div>
167 172 </div>
168 173 <div class="NewDivTx">
169 174 <label for="lblTx" class="titleField">Tx</label>
170 175 <div class="boxTR" id="divtxtTR">
171 176 {% for lines in arrayTxDown %}
172 177 <div class="fullLine">
173 178 {% if forloop.first %}
174 179 <label for="lblNewSignLeft" class="lblNewSignLeft">[</label>
175 180 {% else %}
176 181 <label for="lblNewSignLeft" class="lblNewSignLeft">&nbsp;</label>
177 182 {% endif %}
178 183 <div class="lineInputsTx">
179 184 <label for="lblSign" class="lblSignTx">[</label>
180 185 <div class="divValuesTx">
181 186 {% for line in lines %}
182 187 <input type="text" name="txtUnitTxDown" class="txtUnitTx" id="txtUnitTxDown_{{ forloop.parentloop.counter0 }}_{{ forloop.counter0 }}" value="{{ line }}" maxlength="1" />
183 188 {% if not forloop.last %},{% endif %}
184 189 {% endfor %}
185 190 </div>
186 191 <label for="lblSign" class="lblSignTx">]</label>
187 192 </div>
188 193 {% if forloop.last %}
189 194 <label for="lblNewSignRight" class="lblNewSignRight">]</label>
190 195 {% else %}
191 196 <label for="lblNewSignRight" class="lblNewSignRight">,</label>
192 197 {% endif %}
193 198 </div>
194 199 <div class="cleardivs"></div>
195 200 {% endfor %}
196 201 </div>
197 202 <div class="cleardivs"></div>
198 203 </div>
199 204 <div class="NewDivTx">
200 205 <label for="lblRx" class="titleField">Rx</label>
201 206 <div class="boxTR" id="divtxtTR">
202 207 {% for lines in arrayRxDown %}
203 208 <div class="fullLine">
204 209 {% if forloop.first %}
205 210 <label for="lblNewSignLeft" class="lblNewSignLeft">[</label>
206 211 {% else %}
207 212 <label for="lblNewSignLeft" class="lblNewSignLeft">&nbsp;</label>
208 213 {% endif %}
209 214 <div class="lineInputsTx">
210 215 <label for="lblSign" class="lblSignTx">[</label>
211 216 <div class="divValuesTx">
212 217 {% for line in lines %}
213 218 <input type="text" name="txtUnitRxDown" class="txtUnitRx" id="txtUnitRxDown_{{ forloop.parentloop.counter0 }}_{{ forloop.counter0 }}" value="{{ line }}" />
214 219 {% if not forloop.last %},{% endif %}
215 220 {% endfor %}
216 221 </div>
217 222 <label for="lblSign" class="lblSignTx">]</label>
218 223 </div>
219 224 {% if forloop.last %}
220 225 <label for="lblNewSignRight" class="lblNewSignRight">]</label>
221 226 {% else %}
222 227 <label for="lblNewSignRight" class="lblNewSignRight">,</label>
223 228 {% endif %}
224 229 </div>
225 230 <div class="cleardivs"></div>
226 231 {% endfor %}
227 232 </div>
228 233 <div class="cleardivs"></div>
229 234 </div>
230 235 <div class="cleardivs"></div>
231 236 <div class="divNewUes">
232 237 <label for="lblUes" class="titleUes">Ues:</label>
233 238 <div class="valueUes">
234 239 <label for="lblUes">[</label>
235 240 {% for element in arrayUesDown %}
236 241 <input type="text" name="unitUesDown_{{ forloop.counter }}" value="{{ element }}" maxlength="8" class="txtUnitUes" />
237 242 {% if not forloop.last %},{% endif %}
238 243 {% endfor %}
239 244 <label for="lblUes">]</label>
240 245 </div>
241 246 </div>
247 <div class="cleardivs"></div>
248 <div class="divOnlyRx">
249 <input type="checkbox" name="chkOnlyRxDown" value="1" {% if antennaDown.only_rx == 1 %}checked{% endif %} />
250 <label for="lblOnlyRx" class="titleOnlyRx">Only Rx</label>
251 </div>
242 252 <input type="hidden" name="txtAntennaDownId" value="{{ antennaDown.id }}" />
243 253 </fieldset>
244 254 <input type="hidden" name="txtAntennaDown" value="" />
245 255 <input type="hidden" name="txtTxDown" value="" />
246 256 <input type="hidden" name="txtRxDown" value="" />
247 257 <input type="hidden" name="txtUesDown" value="" />
248 258 </div>
249 259 <input type="hidden" name="pattern_id" id="pattern_id" value="{{ patternChoosen.id }}" />
250 260 <input type="hidden" name="profile_id" id="profile_id" value="{{ objProfile.id }}" />
251 261 <input type="hidden" name="mode" value="e">
252 262 </form>
253 263 </div>
254 264 {% endblock %} No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now