@@ -364,10 +364,11 class ABSConfiguration(Configuration): | |||||
364 | This function sends the beams list to every abs module. |
|
364 | This function sends the beams list to every abs module. | |
365 | It needs 'module_conf' function |
|
365 | It needs 'module_conf' function | |
366 | """ |
|
366 | """ | |
367 | print("Write") |
|
367 | print("Write 3") | |
|
368 | ||||
368 | beams = ABSBeam.objects.filter(abs_conf=self) |
|
369 | beams = ABSBeam.objects.filter(abs_conf=self) | |
369 | nbeams = len(beams) |
|
370 | nbeams = len(beams) | |
370 |
|
371 | |||
371 | # Se manda a cero RC para poder realizar cambio de beam |
|
372 | # Se manda a cero RC para poder realizar cambio de beam | |
372 | if self.experiment is None: |
|
373 | if self.experiment is None: | |
373 | confs = [] |
|
374 | confs = [] | |
@@ -412,7 +413,9 class ABSConfiguration(Configuration): | |||||
412 | message += ''.join([fromBinary2Char(beam.module_6bits(i)) for beam in beams]) |
|
413 | message += ''.join([fromBinary2Char(beam.module_6bits(i)) for beam in beams]) | |
413 | status = ['0'] * 64 |
|
414 | status = ['0'] * 64 | |
414 | n = 0 |
|
415 | n = 0 | |
415 | print("Llega una antes entrar a multicast") |
|
416 | ||
|
417 | print("Llega una antes entrar a multicast4") | |||
|
418 | ||||
416 | sock = self.send_multicast(message) |
|
419 | sock = self.send_multicast(message) | |
417 |
|
420 | |||
418 | while True: |
|
421 | while True: | |
@@ -561,7 +564,10 class ABSConfiguration(Configuration): | |||||
561 | # Create the datagram socket |
|
564 | # Create the datagram socket | |
562 | sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) |
|
565 | sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
563 | sock.settimeout(1) |
|
566 | sock.settimeout(1) | |
564 |
local_ip = os.environ.get('LOCAL_IP', ' |
|
567 | local_ip = os.environ.get('LOCAL_IP', '0.0.0.0') | |
|
568 | local_ip = '0.0.0.0' | |||
|
569 | print("He llegado a IP local") | |||
|
570 | ||||
565 | sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_IF, socket.inet_aton(local_ip)) |
|
571 | sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_IF, socket.inet_aton(local_ip)) | |
566 | sock.sendto(message.encode(), multicast_group) |
|
572 | sock.sendto(message.encode(), multicast_group) | |
567 | print('Sending ' + message) |
|
573 | print('Sending ' + message) |
General Comments 0
You need to be logged in to leave comments.
Login now