@@ -655,7 +655,7 class ABSConfiguration(Configuration): | |||||
655 | print ('Send beam') |
|
655 | print ('Send beam') | |
656 | print (self.active_beam) |
|
656 | print (self.active_beam) | |
657 | beams = ABSBeam.objects.filter(abs_conf=self) |
|
657 | beams = ABSBeam.objects.filter(abs_conf=self) | |
658 | #print beams[self.active_beam-1].module_6bits(0) |
|
658 | ||
659 | active = ABSActive.objects.get(pk=1) |
|
659 | active = ABSActive.objects.get(pk=1) | |
660 | if active.conf != self: |
|
660 | if active.conf != self: | |
661 | self.message = 'La configuracion actual es la del siguiente enlace %s.' % active.conf.get_absolute_url() |
|
661 | self.message = 'La configuracion actual es la del siguiente enlace %s.' % active.conf.get_absolute_url() |
@@ -249,9 +249,12 def import_file(request, id_conf): | |||||
249 | def start(request, id_conf, id_beam): |
|
249 | def start(request, id_conf, id_beam): | |
250 |
|
250 | |||
251 | conf = get_object_or_404(ABSConfiguration, pk=id_conf) |
|
251 | conf = get_object_or_404(ABSConfiguration, pk=id_conf) | |
252 | conf.start_device(id_beam) |
|
|||
253 | beams_list = ABSBeam.objects.filter(abs_conf=conf) |
|
252 | beams_list = ABSBeam.objects.filter(abs_conf=conf) | |
254 |
f |
|
253 | if id_beam>=len(beams_list): | |
|
254 | return HttpResponse(json.dumps({'result':0}), content_type='application/json') | |||
|
255 | conf.start_device(id_beam) | |||
|
256 | ||||
|
257 | for i, beam in enumerate(beams_list): | |||
255 | if i==int(id_beam): |
|
258 | if i==int(id_beam): | |
256 | conf.active_beam = beam.pk |
|
259 | conf.active_beam = beam.pk | |
257 | break |
|
260 | break |
General Comments 0
You need to be logged in to leave comments.
Login now