@@ -18,8 +18,8 TZ=America/Lima | |||
|
18 | 18 | DOCKER_DATA=/data/dockers/radarsys/ |
|
19 | 19 | LOCAL_IP=192.168.1.128 |
|
20 | 20 | |
|
21 |
|
|
|
22 | MQTT_SERVER = 192.168.100.5 | |
|
21 | MQTT_SERVER=10.10.10.200 | |
|
22 | # MQTT_SERVER = 192.168.100.5 | |
|
23 | 23 | MQTT_PORT = 1883 |
|
24 | 24 | MQTT_KEEPALIVE = 3660 |
|
25 | 25 |
@@ -115,6 +115,11 class ATRADConfiguration(Configuration): | |||
|
115 | 115 | if self.device.status == 2: #Configured |
|
116 | 116 | self.message = 'TX device is already stopped.' |
|
117 | 117 | return False |
|
118 | ||
|
119 | # Se crea el modo ocupado para una vez inicia el STOP | |
|
120 | self.device.status = 5 | |
|
121 | self.device.save() | |
|
122 | # Por si se demora deteniendo, que su estado sea busy | |
|
118 | 123 | |
|
119 | 124 | post_data = {"topic":0} |
|
120 | 125 | route = "http://" + str(ip) + ":" + str(port) + "/write/" |
@@ -85,6 +85,11 class CGSConfiguration(Configuration): | |||
|
85 | 85 | if self.device.status == 2: #Configured |
|
86 | 86 | self.message = 'CGS device is already stopped.' |
|
87 | 87 | return False |
|
88 | ||
|
89 | # Se crea el modo ocupado para una vez inicia el STOP | |
|
90 | self.device.status = 5 | |
|
91 | self.device.save() | |
|
92 | # Por si se demora deteniendo, que su estado sea busy | |
|
88 | 93 | |
|
89 | 94 | post_data = {"freq0":0, "freq1":0, "freq2":0, "freq3":0} |
|
90 | 95 | route = "http://" + str(ip) + ":" + str(port) + "/write/" |
@@ -113,6 +113,11 class DDSConfiguration(Configuration): | |||
|
113 | 113 | |
|
114 | 114 | def stop_device(self): |
|
115 | 115 | |
|
116 | # Se crea el modo ocupado para una vez inicia el STOP | |
|
117 | self.device.status = 5 | |
|
118 | self.device.save() | |
|
119 | # Por si se demora deteniendo, que su estado sea busy | |
|
120 | ||
|
116 | 121 | try: |
|
117 | 122 | answer = api.disable_rf(ip = self.device.ip_address, |
|
118 | 123 | port = self.device.port_address) |
@@ -139,6 +139,11 class DDSRestConfiguration(Configuration): | |||
|
139 | 139 | |
|
140 | 140 | def stop_device(self): |
|
141 | 141 | |
|
142 | # Se crea el modo ocupado para una vez inicia el STOP | |
|
143 | self.device.status = 5 | |
|
144 | self.device.save() | |
|
145 | # Por si se demora deteniendo, que su estado sea busy | |
|
146 | ||
|
142 | 147 | try: |
|
143 | 148 | payload = self.request('stop', 'post',data=json.dumps({'_rf_enable':0})) |
|
144 | 149 | self.message = 'DDS REST: {}'.format(payload['stop']) |
@@ -286,6 +286,11 class JARSConfiguration(Configuration): | |||
|
286 | 286 | |
|
287 | 287 | def stop_device(self): |
|
288 | 288 | |
|
289 | # Se crea el modo ocupado para una vez inicia el STOP | |
|
290 | self.device.status = 5 | |
|
291 | self.device.save() | |
|
292 | # Por si se demora deteniendo, que su estado sea busy | |
|
293 | ||
|
289 | 294 | try: |
|
290 | 295 | payload = self.request('stop', 'post') |
|
291 | 296 | self.device.status = payload['status'] |
@@ -83,6 +83,7 EXP_STATES = ( | |||
|
83 | 83 | (2,'Running'), #GREEN |
|
84 | 84 | (3,'Scheduled'), #BLUE |
|
85 | 85 | (4,'Unknown'), #WHITE |
|
86 | (5,'Busy'), | |
|
86 | 87 | ) |
|
87 | 88 | |
|
88 | 89 | CONF_TYPES = ( |
@@ -427,7 +428,7 class Experiment(models.Model): | |||
|
427 | 428 | ''' |
|
428 | 429 | self.status=5 #Busy |
|
429 | 430 | self.save() |
|
430 |
|
|
|
431 | print("Realizando operación. \nEXPERIMENT STATUS : {}".format(self.status)) | |
|
431 | 432 | |
|
432 | 433 | confs = [] |
|
433 | 434 | allconfs = Configuration.objects.filter(experiment=self, type = 0).order_by('-device__device_type__sequence') |
@@ -442,10 +443,8 class Experiment(models.Model): | |||
|
442 | 443 | |
|
443 | 444 | |
|
444 | 445 | for conf in confs: |
|
445 | print("conf->",conf) | |
|
446 | print(conf.device) | |
|
447 | print(conf.device.status) | |
|
448 | 446 | print("--------------",flush=True) |
|
447 | print("STATUS: {}".format(conf.device.status)) | |
|
449 | 448 | print("Stop ",conf.name,flush=True) |
|
450 | 449 | if conf.stop_device() ==False: |
|
451 | 450 | print("Falló Stop ",conf.name) |
@@ -817,6 +816,7 class Configuration(PolymorphicModel): | |||
|
817 | 816 | return reverse('url_%s_conf' % self.device.device_type.name, args=[str(self.id)]) |
|
818 | 817 | |
|
819 | 818 | def get_absolute_mqtt_url(self): |
|
819 | print("----------------- {} ----------------------".format(self.device.device_type.name),flush=True) | |
|
820 | 820 | if self.device.device_type.name=='abs': |
|
821 | 821 | return reverse('url_%s_conf_mqtt' % self.device.device_type.name, args=[str(self.id)]) |
|
822 | 822 | else: |
@@ -40,7 +40,7 | |||
|
40 | 40 | {% endfor%} |
|
41 | 41 | </tr> |
|
42 | 42 | {% for object in objects %} |
|
43 |
<tr class="clickable-row" data-href="{{object.get_absolute_ |
|
|
43 | <tr class="clickable-row" data-href="{{object.get_absolute_url}}"> | |
|
44 | 44 | <td>{{ forloop.counter|add:offset }}</td> |
|
45 | 45 | {% for key in keys %} |
|
46 | 46 | {% if key == 'actions' %} |
@@ -65,7 +65,7 | |||
|
65 | 65 | {% endfor%} |
|
66 | 66 | </tr> |
|
67 | 67 | {% for item in experiments %} |
|
68 | <tr class="clickable-row" data-href="{% url 'url_experiment' item.id %}"> | |
|
68 | <tr class="clickable-row" s data-href="{% url 'url_experiment' item.id %}"> | |
|
69 | 69 | <td>{{ forloop.counter }}</td> |
|
70 | 70 | {% for key in experiment_keys %} |
|
71 | 71 | <td>{{ item|attr:key }}</td> |
@@ -510,7 +510,10 class RCConfiguration(Configuration): | |||
|
510 | 510 | return True |
|
511 | 511 | |
|
512 | 512 | def stop_device(self): |
|
513 | ||
|
513 | # Se crea el modo ocupado para una vez inicia el STOP | |
|
514 | self.device.status = 5 | |
|
515 | self.device.save() | |
|
516 | # Por si se demora deteniendo, que su estado sea busy | |
|
514 | 517 | try: |
|
515 | 518 | payload = self.request('stop', 'post') |
|
516 | 519 | self.message = 'RC stop: {}'.format(payload['stop']) |
General Comments 0
You need to be logged in to leave comments.
Login now