diff --git a/.env b/.env index ff07766..696b718 100644 --- a/.env +++ b/.env @@ -18,8 +18,8 @@ TZ=America/Lima DOCKER_DATA=/data/dockers/radarsys/ LOCAL_IP=192.168.1.128 -# MQTT_SERVER=10.10.10.200 -MQTT_SERVER = 192.168.100.5 +MQTT_SERVER=10.10.10.200 +# MQTT_SERVER = 192.168.100.5 MQTT_PORT = 1883 MQTT_KEEPALIVE = 3660 diff --git a/apps/atrad/models.py b/apps/atrad/models.py index 8864f76..d90dde2 100644 --- a/apps/atrad/models.py +++ b/apps/atrad/models.py @@ -115,6 +115,11 @@ class ATRADConfiguration(Configuration): if self.device.status == 2: #Configured self.message = 'TX device is already stopped.' return False + + # Se crea el modo ocupado para una vez inicia el STOP + self.device.status = 5 + self.device.save() + # Por si se demora deteniendo, que su estado sea busy post_data = {"topic":0} route = "http://" + str(ip) + ":" + str(port) + "/write/" diff --git a/apps/cgs/models.py b/apps/cgs/models.py index 26c458d..2c23776 100644 --- a/apps/cgs/models.py +++ b/apps/cgs/models.py @@ -85,6 +85,11 @@ class CGSConfiguration(Configuration): if self.device.status == 2: #Configured self.message = 'CGS device is already stopped.' return False + + # Se crea el modo ocupado para una vez inicia el STOP + self.device.status = 5 + self.device.save() + # Por si se demora deteniendo, que su estado sea busy post_data = {"freq0":0, "freq1":0, "freq2":0, "freq3":0} route = "http://" + str(ip) + ":" + str(port) + "/write/" diff --git a/apps/dds/models.py b/apps/dds/models.py index 1edbe1c..0c91770 100644 --- a/apps/dds/models.py +++ b/apps/dds/models.py @@ -113,6 +113,11 @@ class DDSConfiguration(Configuration): def stop_device(self): + # Se crea el modo ocupado para una vez inicia el STOP + self.device.status = 5 + self.device.save() + # Por si se demora deteniendo, que su estado sea busy + try: answer = api.disable_rf(ip = self.device.ip_address, port = self.device.port_address) diff --git a/apps/dds_rest/models.py b/apps/dds_rest/models.py index db05bbb..c22e004 100644 --- a/apps/dds_rest/models.py +++ b/apps/dds_rest/models.py @@ -139,6 +139,11 @@ class DDSRestConfiguration(Configuration): def stop_device(self): + # Se crea el modo ocupado para una vez inicia el STOP + self.device.status = 5 + self.device.save() + # Por si se demora deteniendo, que su estado sea busy + try: payload = self.request('stop', 'post',data=json.dumps({'_rf_enable':0})) self.message = 'DDS REST: {}'.format(payload['stop']) diff --git a/apps/jars/models.py b/apps/jars/models.py index 663a083..3b79b8d 100644 --- a/apps/jars/models.py +++ b/apps/jars/models.py @@ -286,6 +286,11 @@ class JARSConfiguration(Configuration): def stop_device(self): + # Se crea el modo ocupado para una vez inicia el STOP + self.device.status = 5 + self.device.save() + # Por si se demora deteniendo, que su estado sea busy + try: payload = self.request('stop', 'post') self.device.status = payload['status'] diff --git a/apps/main/models.py b/apps/main/models.py index f1fb29d..7c5ff88 100644 --- a/apps/main/models.py +++ b/apps/main/models.py @@ -83,6 +83,7 @@ EXP_STATES = ( (2,'Running'), #GREEN (3,'Scheduled'), #BLUE (4,'Unknown'), #WHITE + (5,'Busy'), ) CONF_TYPES = ( @@ -427,7 +428,7 @@ class Experiment(models.Model): ''' self.status=5 #Busy self.save() - # print("Guardando STATUS: {}".format(self.status)) + print("Realizando operación. \nEXPERIMENT STATUS : {}".format(self.status)) confs = [] allconfs = Configuration.objects.filter(experiment=self, type = 0).order_by('-device__device_type__sequence') @@ -442,10 +443,8 @@ class Experiment(models.Model): for conf in confs: - print("conf->",conf) - print(conf.device) - print(conf.device.status) print("--------------",flush=True) + print("STATUS: {}".format(conf.device.status)) print("Stop ",conf.name,flush=True) if conf.stop_device() ==False: print("Falló Stop ",conf.name) @@ -817,6 +816,7 @@ class Configuration(PolymorphicModel): return reverse('url_%s_conf' % self.device.device_type.name, args=[str(self.id)]) def get_absolute_mqtt_url(self): + print("----------------- {} ----------------------".format(self.device.device_type.name),flush=True) if self.device.device_type.name=='abs': return reverse('url_%s_conf_mqtt' % self.device.device_type.name, args=[str(self.id)]) else: diff --git a/apps/main/templates/base_list.html b/apps/main/templates/base_list.html index ae651e1..a9f3f11 100644 --- a/apps/main/templates/base_list.html +++ b/apps/main/templates/base_list.html @@ -40,7 +40,7 @@ {% endfor%} {% for object in objects %} -