##// END OF EJS Templates
Export function .json file...
Fiorella Quino -
r189:9f84ec2b5e46
parent child
Show More
@@ -194,7 +194,7 class ABSConfiguration(Configuration):
194 194 parameters['name'] = self.name
195 195 parameters['beams'] = {}
196 196
197 beams = ABSBeam.objects.get(pk=self.id)
197 beams = ABSBeam.objects.filter(pk=self.id)
198 198 b=1
199 199 for beam in beams:
200 200 #absbeam = ABSBeam.objects.get(pk=beams[beam])
@@ -205,7 +205,7 class ABSConfiguration(Configuration):
205 205
206 206 def get_beams(self, **kwargs):
207 207 '''
208 This function returns ABS Configuration beams
208 This function returns ABS Configuration beams
209 209 '''
210 210 return ABSBeam.objects.filter(abs_conf=self.pk, **kwargs)
211 211
@@ -308,11 +308,11 class ABSConfiguration(Configuration):
308 308 module_port = self.device.port_address
309 309
310 310 modules_status = json.loads(self.module_status)
311
312 for i in range(1,65):
311
312 for i in range(1,65):
313 313 module_ip = dot.join(module_seq)+'.'+str(i)
314 314 print module_ip
315
315
316 316 route = 'http://'+module_ip+':'+str(module_port)+'/hello'
317 317
318 318 try:
@@ -320,9 +320,9 class ABSConfiguration(Configuration):
320 320 modules_status[str(i)] = 1
321 321 except:
322 322 modules_status[str(i)] = 0
323 pass
323 pass
324 324
325 self.message = 'ABS modules Status have been updated.'
325 self.message = 'ABS modules Status have been updated.'
326 326 self.module_status=json.dumps(modules_status)
327 327 self.save()
328 328
@@ -366,7 +366,7 class ABSConfiguration(Configuration):
366 366
367 367 #self.device.status = 1
368 368 ##
369 if answer==1:
369 if answer==1:
370 370 self.message = "ABS Beams List have been sent to ABS Modules"
371 371 else:
372 372 self.message = "Could not read ABS parameters"
@@ -758,7 +758,7 class ABSBeam(models.Model):
758 758 return
759 759
760 760
761
761
762 762 def module_6bits(self, module):
763 763 """
764 764 This function reads antenna pattern and choose 6bits (upbits-downbits) for one abs module
@@ -795,7 +795,7 class ABSBeam(models.Model):
795 795
796 796 return self.modules_conf
797 797
798
798
799 799 def active_beam(self):
800 800 """
801 801 This function set this beam as the active beam of its ABS Configuration.
General Comments 0
You need to be logged in to leave comments. Login now