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