From 63661266e9fde42d2234f0a39eb8f572c6639c67 2023-03-12 00:03:07 From: Renato Huallpa Date: 2023-03-12 00:03:07 Subject: [PATCH] Se añadió y corrigió la aplicación de colores por change beam --- diff --git a/apps/abs/models.py b/apps/abs/models.py index 1b2d09e..7064e14 100644 --- a/apps/abs/models.py +++ b/apps/abs/models.py @@ -836,16 +836,15 @@ class ABSConfiguration(Configuration): def change_beam_mqtt(self, beam_pos): """ - This function connects to a multicast group and sends the beam number - to all abs modules. + This function connects send through mqtt the order of change_beam (id of beam). """ - print ('Send beam') + print ('Change beam MQTT') print (self.active_beam) beams = ABSBeam.objects.filter(abs_conf=self) #print beams[self.active_beam-1].module_6bits(0) active = ABSActive.objects.get(pk=1) if active.conf != self: - self.message = 'La configuracion actual es la del siguiente enlace %s.' % active.conf.get_absolute_url() + self.message = 'La configuracion actual es la del siguiente enlace %s.' % active.conf.get_absolute_mqtt_url() self.message += "\n" self.message += 'Se debe realizar un write en esta configuracion para luego obtener un status valido.' @@ -907,6 +906,8 @@ class ABSConfiguration(Configuration): # pass # sock.close() + mqtt_client.publish('abs/change_beam',str(beam_pos)) + #Start DDS-RC-JARS if confdds: @@ -918,7 +919,6 @@ class ABSConfiguration(Configuration): confjars.start_device() self.message = "ABS Beam has been changed" - self.module_status = ''.join(status) self.save() return True diff --git a/apps/abs/templates/abs_conf_bad.html b/apps/abs/templates/abs_conf_bad.html new file mode 100644 index 0000000..a28f723 --- /dev/null +++ b/apps/abs/templates/abs_conf_bad.html @@ -0,0 +1,414 @@ +{% extends "dev_conf.html" %} {% load static %} {% load django_bootstrap5 %} {% load main_tags %} +{% block extra-head %} + +{% endblock %} + + +{% block extra-menu-actions %} +
  • + + View Patterns +
  • +{% endblock %} + + +{% block extra-content %} + + + + +{% if beams %} +

    Beams:

    +
    + + +
    + {% for beam in beams %} + + {% endfor %} +
    +
    + + +{% else %} +

    + No Beams... +

    +{% endif %} +{% endblock extra-content %} + +{% block extra-js%} + + + +{% endblock %} diff --git a/apps/abs/templates/abs_conf_mqtt.html b/apps/abs/templates/abs_conf_mqtt.html index abf8c17..3b1853f 100644 --- a/apps/abs/templates/abs_conf_mqtt.html +++ b/apps/abs/templates/abs_conf_mqtt.html @@ -56,7 +56,7 @@ {% if beams %} -

    Beams:

    +

    Beams MQTT: