@@ -17,7 +17,7 class ABSConfigurationForm(forms.ModelForm): | |||
|
17 | 17 | |
|
18 | 18 | class Meta: |
|
19 | 19 | model = ABSConfiguration |
|
20 |
exclude = ('type', 'status', 'parameters', 'beam |
|
|
20 | exclude = ('type', 'status', 'parameters', 'active_beam', 'module_status') | |
|
21 | 21 | |
|
22 | 22 | class ABSBeamAddForm(forms.Form): |
|
23 | 23 |
@@ -175,48 +175,8 def fromChar2Binary(char): | |||
|
175 | 175 | return bits |
|
176 | 176 | |
|
177 | 177 | |
|
178 | def change_beam_for_multiprocessing(module): | |
|
179 | ||
|
180 | for i in range (1,50): | |
|
181 | beam_pos = 0 | |
|
182 | module_address = ('192.168.1.'+str(module), 5500) | |
|
183 | header = 'JROABSCeCnModCnMod0100000' | |
|
184 | numbers = len(str(beam_pos)) | |
|
185 | function = 'CHGB' | |
|
186 | ||
|
187 | message_tx = header+str(numbers)+function+str(beam_pos)+'0' | |
|
188 | ||
|
189 | # Create the datagram socket | |
|
190 | sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
|
191 | sock.connect(module_address) | |
|
192 | ||
|
193 | sock.send(message_tx) | |
|
194 | #t = sock.recv(1024) | |
|
195 | sock.close() | |
|
196 | sock = None | |
|
197 | ||
|
198 | ||
|
199 | time.sleep(0.2) | |
|
200 | ||
|
201 | ||
|
202 | beam_pos = 1 | |
|
203 | numbers = len(str(beam_pos)) | |
|
204 | ||
|
205 | message_tx = header+str(numbers)+function+str(beam_pos)+'0' | |
|
206 | ||
|
207 | # Create the datagram socket | |
|
208 | sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
|
209 | sock.connect(module_address) | |
|
210 | sock.send(message_tx) | |
|
211 | sock.close() | |
|
212 | sock = None | |
|
213 | ||
|
214 | time.sleep(0.2) | |
|
215 | ||
|
216 | ||
|
217 | ||
|
218 | 178 | class ABSConfiguration(Configuration): |
|
219 |
beam |
|
|
179 | active_beam = models.CharField(verbose_name='Active Beam', max_length=20000, default="{}") | |
|
220 | 180 | module_status = models.CharField(verbose_name='Module Status', max_length=10000, default=json.dumps(status_default)) |
|
221 | 181 | |
|
222 | 182 | class Meta: |
@@ -234,11 +194,11 class ABSConfiguration(Configuration): | |||
|
234 | 194 | parameters['name'] = self.name |
|
235 | 195 | parameters['beams'] = {} |
|
236 | 196 | |
|
237 | beams = ast.literal_eval(self.beams) | |
|
197 | beams = ABSBeam.objects.get(pk=self.id) | |
|
238 | 198 | b=1 |
|
239 | 199 | for beam in beams: |
|
240 | absbeam = ABSBeam.objects.get(pk=beams[beam]) | |
|
241 |
parameters['beams']['beam'+str(b)] = |
|
|
200 | #absbeam = ABSBeam.objects.get(pk=beams[beam]) | |
|
201 | parameters['beams']['beam'+str(b)] = beam.parms_to_dict()#absbeam.parms_to_dict() | |
|
242 | 202 | b+=1 |
|
243 | 203 | |
|
244 | 204 | return parameters |
@@ -336,6 +296,38 class ABSConfiguration(Configuration): | |||
|
336 | 296 | |
|
337 | 297 | return module_bits |
|
338 | 298 | |
|
299 | def status_device(self): | |
|
300 | """ | |
|
301 | This function gets the status of each abs module. It sends GET method to Web Application | |
|
302 | in Python Bottle. | |
|
303 | """ | |
|
304 | ip_address = self.device.ip_address | |
|
305 | ip_address = ip_address.split('.') | |
|
306 | module_seq = (ip_address[0],ip_address[1],ip_address[2]) | |
|
307 | dot = '.' | |
|
308 | module_port = self.device.port_address | |
|
309 | ||
|
310 | modules_status = json.loads(self.module_status) | |
|
311 | ||
|
312 | for i in range(1,65): | |
|
313 | module_ip = dot.join(module_seq)+'.'+str(i) | |
|
314 | print module_ip | |
|
315 | ||
|
316 | route = 'http://'+module_ip+':'+str(module_port)+'/hello' | |
|
317 | ||
|
318 | try: | |
|
319 | r = requests.get(route, timeout=0.7) | |
|
320 | modules_status[str(i)] = 1 | |
|
321 | except: | |
|
322 | modules_status[str(i)] = 0 | |
|
323 | pass | |
|
324 | ||
|
325 | self.message = 'ABS modules Status have been updated.' | |
|
326 | self.module_status=json.dumps(modules_status) | |
|
327 | self.save() | |
|
328 | ||
|
329 | return | |
|
330 | ||
|
339 | 331 | |
|
340 | 332 | def write_device(self): |
|
341 | 333 | """ |
@@ -438,7 +430,7 class ABSConfiguration(Configuration): | |||
|
438 | 430 | |
|
439 | 431 | #El indice del apunte debe ser menor que el numero total de apuntes |
|
440 | 432 | #El servidor tcp en el embebido comienza a contar desde 0 |
|
441 |
beams_list = |
|
|
433 | beams_list = ABSBeam.objects.filter(abs_conf=self) | |
|
442 | 434 | if len(beams_list) < beam_pos: |
|
443 | 435 | return 0 |
|
444 | 436 | |
@@ -496,7 +488,7 class ABSConfiguration(Configuration): | |||
|
496 | 488 | |
|
497 | 489 | #El indice del apunte debe ser menor que el numero total de apuntes |
|
498 | 490 | #El servidor tcp en el embebido comienza a contar desde 0 |
|
499 |
beams_list = |
|
|
491 | beams_list = ABSBeam.objects.filter(abs_conf=self) | |
|
500 | 492 | if len(beams_list) < beam_pos: |
|
501 | 493 | return 0 |
|
502 | 494 | |
@@ -684,10 +676,6 class ABSConfiguration(Configuration): | |||
|
684 | 676 | return 1 |
|
685 | 677 | |
|
686 | 678 | |
|
687 | def status_device(self): | |
|
688 | ||
|
689 | return 1 | |
|
690 | ||
|
691 | 679 | |
|
692 | 680 | |
|
693 | 681 | class ABSBeam(models.Model): |
@@ -758,74 +746,7 class ABSBeam(models.Model): | |||
|
758 | 746 | return self |
|
759 | 747 | |
|
760 | 748 | |
|
761 | def change_beam(self, beam_pos=0): | |
|
762 | ||
|
763 | module_63 = ('192.168.1.63', 5500) | |
|
764 | header = 'JROABSCeCnModCnMod0100000' | |
|
765 | numbers = len(str(beam_pos)) | |
|
766 | function = 'CHGB' | |
|
767 | ||
|
768 | message_tx = header+str(numbers)+function+str(beam_pos)+'0' | |
|
769 | ||
|
770 | # Create the datagram socket | |
|
771 | sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
|
772 | sock.connect(module_63) | |
|
773 | sock.send(message_tx) | |
|
774 | sock.close() | |
|
775 | return message_tx | |
|
776 | ||
|
777 | def change_module_beam(self, module=61,beam_pos=0): | |
|
778 | ||
|
779 | module_address = ('192.168.1.'+str(module), 5500) | |
|
780 | header = 'JROABSCeCnModCnMod0100000' | |
|
781 | numbers = len(str(beam_pos)) | |
|
782 | function = 'CHGB' | |
|
783 | ||
|
784 | message_tx = header+str(numbers)+function+str(beam_pos)+'0' | |
|
785 | ||
|
786 | # Create the datagram socket | |
|
787 | try: | |
|
788 | sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
|
789 | sock.connect(module_address) | |
|
790 | sock.send(message_tx) | |
|
791 | sock.close() | |
|
792 | except: | |
|
793 | return 0 | |
|
794 | return message_tx | |
|
795 | ||
|
796 | def write_device(self): | |
|
797 | ||
|
798 | parameters = {} | |
|
799 | ||
|
800 | module_ip = '192.168.1.63' | |
|
801 | write_route = 'http://192.168.1.63:8080/configure' | |
|
802 | ||
|
803 | header = 'JROABSCeCnModCnMod01000108SNDFexperimento1.ab1' | |
|
804 | module = 'ABS_63' | |
|
805 | beams = {1: '001000', 2: '010001', 3: '010010', 4: '000011', 5: '101100', 6: '101101', | |
|
806 | 7: '110110', 8: '111111', 9: '000000', 10: '001001', 11: '010010', 12: '011011'} | |
|
807 | ||
|
808 | parameters['header'] = header | |
|
809 | parameters['module'] = module | |
|
810 | parameters['beams'] = json.dumps(beams) | |
|
811 | ||
|
812 | answer = '' | |
|
813 | ||
|
814 | try: | |
|
815 | r_write = requests.post(write_route, parameters, timeout=0.5) | |
|
816 | answer = r_write.json() | |
|
817 | self.message = answer['message'] | |
|
818 | except: | |
|
819 | self.message = "Could not write ABS parameters" | |
|
820 | return 0 | |
|
821 | ||
|
822 | ||
|
823 | #self.device.status = int(answer['status']) | |
|
824 | ||
|
825 | return 1 | |
|
826 | ||
|
827 | ||
|
828 | ||
|
749 | ||
|
829 | 750 | def module_6bits(self, module): |
|
830 | 751 | """ |
|
831 | 752 | This function reads antenna pattern and choose 6bits (upbits-downbits) for one abs module |
@@ -862,44 +783,13 class ABSBeam(models.Model): | |||
|
862 | 783 | |
|
863 | 784 | return self.modules_conf |
|
864 | 785 | |
|
865 | def add_beam2list(self): | |
|
866 | """ | |
|
867 | This function adds a beam to the beams list of ABS Configuration. | |
|
868 | """ | |
|
869 | beams = ast.literal_eval(self.abs_conf.beams) | |
|
870 | if any(beams): | |
|
871 | for beam in beams: | |
|
872 | if beams[beam] == self.id: | |
|
873 | return | |
|
874 | i = len(beams)+1 | |
|
875 | beams['beam'+str(i)] = self.id | |
|
876 | else: | |
|
877 | beams['beam1'] = self.id | |
|
878 | ||
|
879 | self.abs_conf.beams = json.dumps(beams) | |
|
880 | self.abs_conf.save() | |
|
881 | ||
|
882 | return | |
|
883 | ||
|
884 | def remove_beamfromlist(self): | |
|
786 | ||
|
787 | def active_beam(self): | |
|
885 | 788 | """ |
|
886 |
This function |
|
|
789 | This function set this beam as the active beam of its ABS Configuration. | |
|
887 | 790 | """ |
|
888 | beams = ast.literal_eval(self.abs_conf.beams) | |
|
889 | dict_position = '' | |
|
890 | ||
|
891 | if any(beams): | |
|
892 | for beam in beams: | |
|
893 | if beams[beam] == self.id: | |
|
894 | dict_position = beam | |
|
895 | if dict_position != '': | |
|
896 | beams.pop(str(dict_position),None) | |
|
897 | else: | |
|
898 | return | |
|
899 | ||
|
900 | self.abs_conf.beams = json.dumps(beams) | |
|
791 | self.abs_conf.active_beam = json.dumps({'active_beam': self.id}) | |
|
901 | 792 | self.abs_conf.save() |
|
902 | ||
|
903 | 793 | return |
|
904 | 794 | |
|
905 | 795 | @property |
This diff has been collapsed as it changes many lines, (627 lines changed) Show them Hide them | |||
@@ -51,7 +51,7 | |||
|
51 | 51 | } |
|
52 | 52 | .north tr{ |
|
53 | 53 | border: 1px solid #ffffff; |
|
54 | background-color: #FF0000; | |
|
54 | ||
|
55 | 55 | } |
|
56 | 56 | .north td{ |
|
57 | 57 | border: 2px solid #e2e2e7; |
@@ -71,14 +71,6 | |||
|
71 | 71 | border-bottom: 3px solid #e2e2e7; |
|
72 | 72 | } |
|
73 | 73 | |
|
74 | .north tr:nth-child(2) td:nth-child(2){ | |
|
75 | background-color: #00cc00; | |
|
76 | } | |
|
77 | ||
|
78 | .north tr:nth-child(2) td:nth-child(4){ | |
|
79 | background-color: #ee902c; | |
|
80 | } | |
|
81 | ||
|
82 | 74 | |
|
83 | 75 | |
|
84 | 76 | .east { |
@@ -88,7 +80,6 | |||
|
88 | 80 | } |
|
89 | 81 | .east tr{ |
|
90 | 82 | border: 1px solid #ffffff; |
|
91 | background-color: #FF0000; | |
|
92 | 83 | } |
|
93 | 84 | .east td{ |
|
94 | 85 | border: 2px solid #e2e2e7; |
@@ -108,13 +99,7 | |||
|
108 | 99 | border-bottom: 3px solid #e2e2e7; |
|
109 | 100 | } |
|
110 | 101 | |
|
111 | .east tr:nth-child(2) td:nth-child(2){ | |
|
112 | background-color: #00cc00; | |
|
113 | } | |
|
114 | 102 | |
|
115 | .east tr:nth-child(2) td:nth-child(4){ | |
|
116 | background-color: #ee902c; | |
|
117 | } | |
|
118 | 103 | |
|
119 | 104 | |
|
120 | 105 | .west { |
@@ -124,7 +109,6 | |||
|
124 | 109 | } |
|
125 | 110 | .west tr{ |
|
126 | 111 | border: 1px solid #ffffff; |
|
127 | background-color: #FF0000; | |
|
128 | 112 | } |
|
129 | 113 | .west td{ |
|
130 | 114 | border: 2px solid #e2e2e7; |
@@ -144,13 +128,7 | |||
|
144 | 128 | border-bottom: 3px solid #e2e2e7; |
|
145 | 129 | } |
|
146 | 130 | |
|
147 | .west tr:nth-child(2) td:nth-child(2){ | |
|
148 | background-color: #00cc00; | |
|
149 | } | |
|
150 | 131 | |
|
151 | .west tr:nth-child(2) td:nth-child(4){ | |
|
152 | background-color: #ee902c; | |
|
153 | } | |
|
154 | 132 | |
|
155 | 133 | |
|
156 | 134 | .south { |
@@ -160,7 +138,6 | |||
|
160 | 138 | } |
|
161 | 139 | .south tr{ |
|
162 | 140 | border: 1px solid #ffffff; |
|
163 | background-color: #FF0000; | |
|
164 | 141 | } |
|
165 | 142 | .south td{ |
|
166 | 143 | border: 2px solid #e2e2e7; |
@@ -180,279 +157,373 | |||
|
180 | 157 | border-bottom: 3px solid #e2e2e7; |
|
181 | 158 | } |
|
182 | 159 | |
|
183 | .south tr:nth-child(2) td:nth-child(2){ | |
|
184 | background-color: #00cc00; | |
|
185 | } | |
|
186 | ||
|
187 | .south tr:nth-child(2) td:nth-child(4){ | |
|
188 | background-color: #ee902c; | |
|
189 | } | |
|
190 | 160 | |
|
191 | 161 | |
|
192 | 162 | |
|
193 | 163 | </style> |
|
194 | 164 | |
|
195 | <h4>Beams:</h4> | |
|
165 | ||
|
196 | 166 | {% if beams %} |
|
197 | 167 | |
|
198 | <div class="container"> | |
|
199 | <ul class="nav nav-pills"> | |
|
200 | 168 | |
|
201 | {% for beam in beams %} | |
|
202 | <li {% if forloop.counter == 1 %} class="active" {% endif %}> | |
|
203 | <a data-toggle="pill" id="button-{{ forloop.counter }}" href="#">{{ forloop.counter }}</a> | |
|
204 | </li> | |
|
205 | {% endfor %} | |
|
206 | 169 | |
|
207 | </ul> | |
|
208 | </div> | |
|
170 | <h4>Beams:</h4> | |
|
171 | <div class="container"> | |
|
172 | <ul class="nav nav-pills"> | |
|
173 | {% for beam in beams %} | |
|
174 | <li > | |
|
175 | <a data-toggle="pill" href="#menu{{forloop.counter}}">{{forloop.counter}}</a> | |
|
176 | </li> | |
|
177 | {% endfor %} | |
|
178 | </ul> | |
|
179 | ||
|
180 | ||
|
181 | <div class="tab-content"> | |
|
182 | <div id="home" class="tab-pane fade in active"> | |
|
183 | <!----> | |
|
184 | {% if active_beam %} | |
|
185 | <h3>Active Beam: {{active_beam.name}}</h3> | |
|
186 | ||
|
187 | <table id="abs_pattern" class="abs"> | |
|
188 | <tr> | |
|
189 | <td> <b>North Quarter</b> | |
|
190 | <table class="north "> | |
|
191 | <tr> | |
|
192 | <td {{color_status.1}}>{{active_beam.get_upvalues.0}}</td> <td {{color_status.2}}>{{active_beam.get_upvalues.1}}</td> <td {{color_status.3}}>{{active_beam.get_upvalues.2}}</td> <td {{color_status.4}}>{{active_beam.get_upvalues.3}}</td> | |
|
193 | </tr> | |
|
194 | <tr> | |
|
195 | <td {{color_status.1}}>{{active_beam.get_downvalues.0}}</td> <td {{color_status.2}}>{{active_beam.get_downvalues.1}}</td> <td {{color_status.3}}>{{active_beam.get_downvalues.2}}</td> <td {{color_status.4}}>{{active_beam.get_downvalues.3}}</td> | |
|
196 | </tr> | |
|
197 | <tr> | |
|
198 | <td {{color_status.9}}>{{active_beam.get_upvalues.8}}</td> <td {{color_status.10}}>{{active_beam.get_upvalues.9}}</td> <td {{color_status.11}}>{{active_beam.get_upvalues.10}}</td> <td {{color_status.12}}>{{active_beam.get_upvalues.11}}</td> | |
|
199 | </tr> | |
|
200 | <tr> | |
|
201 | <td {{color_status.9}}>{{active_beam.get_downvalues.8}}</td> <td {{color_status.10}}>{{active_beam.get_downvalues.9}}</td> <td {{color_status.11}}>{{active_beam.get_downvalues.10}}</td> <td {{color_status.12}}>{{active_beam.get_downvalues.11}}</td> | |
|
202 | </tr> | |
|
203 | <tr> | |
|
204 | <td {{color_status.17}}>{{active_beam.get_upvalues.16}}</td> <td {{color_status.18}}>{{active_beam.get_upvalues.17}}</td> <td {{color_status.19}}>{{active_beam.get_upvalues.18}}</td> <td {{color_status.20}}>{{active_beam.get_upvalues.19}}</td> | |
|
205 | </tr> | |
|
206 | <tr> | |
|
207 | <td {{color_status.17}}>{{active_beam.get_downvalues.16}}</td> <td {{color_status.18}}>{{active_beam.get_downvalues.17}}</td> <td {{color_status.19}}>{{active_beam.get_downvalues.18}}</td> <td {{color_status.20}}>{{active_beam.get_downvalues.19}}</td> | |
|
208 | </tr> | |
|
209 | <tr> | |
|
210 | <td {{color_status.25}}>{{active_beam.get_upvalues.24}}</td> <td {{color_status.26}}>{{active_beam.get_upvalues.25}}</td> <td {{color_status.27}}>{{active_beam.get_upvalues.26}}</td> <td {{color_status.28}}>{{active_beam.get_upvalues.27}}</td> | |
|
211 | </tr> | |
|
212 | <tr> | |
|
213 | <td {{color_status.25}}>{{active_beam.get_downvalues.24}}</td> <td {{color_status.26}}>{{active_beam.get_downvalues.25}}</td> <td {{color_status.27}}>{{active_beam.get_downvalues.26}}</td> <td {{color_status.28}}>{{active_beam.get_downvalues.27}}</td> | |
|
214 | </tr> | |
|
215 | </table> | |
|
216 | </td> | |
|
217 | <td> <b>East Quarter</b> | |
|
218 | <table class="east "> | |
|
219 | <tr> | |
|
220 | <td {{color_status.5}}>{{active_beam.get_upvalues.4}}</td> <td {{color_status.6}}>{{active_beam.get_upvalues.5}}</td> <td {{color_status.7}}>{{active_beam.get_upvalues.6}}</td> <td {{color_status.8}}>{{active_beam.get_upvalues.7}}</td> | |
|
221 | </tr> | |
|
222 | <tr> | |
|
223 | <td {{color_status.5}}>{{active_beam.get_downvalues.4}}</td> <td {{color_status.6}}>{{active_beam.get_downvalues.5}}</td> <td {{color_status.7}}>{{active_beam.get_downvalues.6}}</td> <td {{color_status.8}}>{{active_beam.get_downvalues.7}}</td> | |
|
224 | </tr> | |
|
225 | <tr> | |
|
226 | <td {{color_status.13}}>{{active_beam.get_upvalues.12}}</td> <td {{color_status.14}}>{{active_beam.get_upvalues.13}}</td> <td {{color_status.15}}>{{active_beam.get_upvalues.14}}</td> <td {{color_status.16}}>{{active_beam.get_upvalues.15}}</td> | |
|
227 | </tr> | |
|
228 | <tr> | |
|
229 | <td {{color_status.13}}>{{active_beam.get_downvalues.12}}</td> <td {{color_status.14}}>{{active_beam.get_downvalues.13}}</td> <td {{color_status.15}}>{{active_beam.get_downvalues.14}}</td> <td {{color_status.16}}>{{active_beam.get_downvalues.15}}</td> | |
|
230 | </tr> | |
|
231 | <tr> | |
|
232 | <td {{color_status.21}}>{{active_beam.get_upvalues.20}}</td> <td {{color_status.22}}>{{active_beam.get_upvalues.21}}</td> <td {{color_status.23}}>{{active_beam.get_upvalues.22}}</td> <td {{color_status.24}}>{{active_beam.get_upvalues.23}}</td> | |
|
233 | </tr> | |
|
234 | <tr> | |
|
235 | <td {{color_status.21}}>{{active_beam.get_downvalues.20}}</td> <td {{color_status.22}}>{{active_beam.get_downvalues.21}}</td> <td {{color_status.23}}>{{active_beam.get_downvalues.22}}</td> <td {{color_status.24}}>{{active_beam.get_downvalues.23}}</td> | |
|
236 | </tr> | |
|
237 | <tr> | |
|
238 | <td {{color_status.29}}>{{active_beam.get_upvalues.28}}</td> <td {{color_status.30}}>{{active_beam.get_upvalues.29}}</td> <td {{color_status.31}}>{{active_beam.get_upvalues.30}}</td> <td {{color_status.32}}>{{active_beam.get_upvalues.31}}</td> | |
|
239 | </tr> | |
|
240 | <tr> | |
|
241 | <td {{color_status.29}}>{{active_beam.get_downvalues.28}}</td> <td {{color_status.30}}>{{active_beam.get_downvalues.29}}</td> <td {{color_status.31}}>{{active_beam.get_downvalues.30}}</td> <td {{color_status.32}}>{{active_beam.get_downvalues.31}}</td> | |
|
242 | </tr> | |
|
243 | </table> | |
|
244 | </td> | |
|
245 | </tr> | |
|
246 | <tr> | |
|
247 | <td> <b>West Quarter</b> | |
|
248 | <table class="west "> | |
|
249 | <tr> | |
|
250 | <td {{color_status.33}}>{{active_beam.get_upvalues.32}}</td> <td {{color_status.34}}>{{active_beam.get_upvalues.33}}</td> <td {{color_status.35}}>{{active_beam.get_upvalues.34}}</td> <td {{color_status.36}}>{{active_beam.get_upvalues.35}}</td> | |
|
251 | </tr> | |
|
252 | <tr> | |
|
253 | <td {{color_status.33}}>{{active_beam.get_downvalues.32}}</td> <td {{color_status.34}}>{{active_beam.get_downvalues.33}}</td> <td {{color_status.35}}>{{active_beam.get_downvalues.34}}</td> <td {{color_status.36}}>{{active_beam.get_downvalues.35}}</td> | |
|
254 | </tr> | |
|
255 | <tr> | |
|
256 | <td {{color_status.41}}>{{active_beam.get_upvalues.40}}</td> <td {{color_status.42}}>{{active_beam.get_upvalues.41}}</td> <td {{color_status.43}}>{{active_beam.get_upvalues.42}}</td> <td {{color_status.44}}>{{active_beam.get_upvalues.43}}</td> | |
|
257 | </tr> | |
|
258 | <tr> | |
|
259 | <td {{color_status.41}}>{{active_beam.get_downvalues.40}}</td> <td {{color_status.42}}>{{active_beam.get_downvalues.41}}</td> <td {{color_status.43}}>{{active_beam.get_downvalues.42}}</td> <td {{color_status.44}}>{{active_beam.get_downvalues.43}}</td> | |
|
260 | </tr> | |
|
261 | <tr> | |
|
262 | <td {{color_status.49}}>{{active_beam.get_upvalues.48}}</td> <td {{color_status.50}}>{{active_beam.get_upvalues.49}}</td> <td {{color_status.51}}>{{active_beam.get_upvalues.50}}</td> <td {{color_status.52}}>{{active_beam.get_upvalues.51}}</td> | |
|
263 | </tr> | |
|
264 | <tr> | |
|
265 | <td {{color_status.49}}>{{active_beam.get_downvalues.48}}</td> <td {{color_status.50}}>{{active_beam.get_downvalues.49}}</td> <td {{color_status.51}}>{{active_beam.get_downvalues.50}}</td> <td {{color_status.52}}>{{active_beam.get_downvalues.51}}</td> | |
|
266 | </tr> | |
|
267 | <tr> | |
|
268 | <td {{color_status.57}}>{{active_beam.get_upvalues.56}}</td> <td {{color_status.58}}>{{active_beam.get_upvalues.57}}</td> <td {{color_status.59}}>{{active_beam.get_upvalues.58}}</td> <td {{color_status.60}}>{{active_beam.get_upvalues.59}}</td> | |
|
269 | </tr> | |
|
270 | <tr> | |
|
271 | <td {{color_status.57}}>{{active_beam.get_downvalues.56}}</td> <td {{color_status.58}}>{{active_beam.get_downvalues.57}}</td> <td {{color_status.59}}>{{active_beam.get_downvalues.58}}</td> <td {{color_status.60}}>{{active_beam.get_downvalues.59}}</td> | |
|
272 | </tr> | |
|
273 | </table> | |
|
274 | </td> | |
|
275 | <td> <b>South Quarter</b> | |
|
276 | <table class="south "> | |
|
277 | <tr> | |
|
278 | <td {{color_status.37}}>{{active_beam.get_upvalues.36}}</td> <td {{color_status.38}}>{{active_beam.get_upvalues.37}}</td> <td {{color_status.39}}>{{active_beam.get_upvalues.38}}</td> <td {{color_status.40}}>{{active_beam.get_upvalues.39}}</td> | |
|
279 | </tr> | |
|
280 | <tr> | |
|
281 | <td {{color_status.37}}>{{active_beam.get_downvalues.36}}</td> <td {{color_status.38}}>{{active_beam.get_downvalues.37}}</td> <td {{color_status.39}}>{{active_beam.get_downvalues.38}}</td> <td {{color_status.40}}>{{active_beam.get_downvalues.39}}</td> | |
|
282 | </tr> | |
|
283 | <tr> | |
|
284 | <td {{color_status.45}}>{{active_beam.get_upvalues.44}}</td> <td {{color_status.46}}>{{active_beam.get_upvalues.45}}</td> <td {{color_status.47}}>{{active_beam.get_upvalues.46}}</td> <td {{color_status.48}}>{{active_beam.get_upvalues.47}}</td> | |
|
285 | </tr> | |
|
286 | <tr> | |
|
287 | <td {{color_status.45}}>{{active_beam.get_downvalues.44}}</td> <td {{color_status.46}}>{{active_beam.get_downvalues.45}}</td> <td {{color_status.47}}>{{active_beam.get_downvalues.46}}</td> <td {{color_status.48}}>{{active_beam.get_downvalues.47}}</td> | |
|
288 | </tr> | |
|
289 | <tr> | |
|
290 | <td {{color_status.53}}>{{active_beam.get_upvalues.52}}</td> <td {{color_status.54}}>{{active_beam.get_upvalues.53}}</td> <td {{color_status.55}}>{{active_beam.get_upvalues.54}}</td> <td {{color_status.56}}>{{active_beam.get_upvalues.55}}</td> | |
|
291 | </tr> | |
|
292 | <tr> | |
|
293 | <td {{color_status.53}}>{{active_beam.get_downvalues.52}}</td> <td {{color_status.54}}>{{active_beam.get_downvalues.53}}</td> <td {{color_status.55}}>{{active_beam.get_downvalues.54}}</td> <td {{color_status.56}}>{{active_beam.get_downvalues.55}}</td> | |
|
294 | </tr> | |
|
295 | <tr> | |
|
296 | <td {{color_status.61}}>{{active_beam.get_upvalues.60}}</td> <td {{color_status.62}}>{{active_beam.get_upvalues.61}}</td> <td {{color_status.63}}>{{active_beam.get_upvalues.62}}</td> <td {{color_status.64}}>{{active_beam.get_upvalues.63}}</td> | |
|
297 | </tr> | |
|
298 | <tr> | |
|
299 | <td {{color_status.61}}>{{active_beam.get_downvalues.60}}</td> <td {{color_status.62}}>{{active_beam.get_downvalues.61}}</td> <td {{color_status.63}}>{{active_beam.get_downvalues.62}}</td> <td {{color_status.64}}>{{active_beam.get_downvalues.63}}</td> | |
|
300 | </tr> | |
|
301 | </table> | |
|
302 | </td> | |
|
303 | </tr> | |
|
304 | </table> | |
|
305 | ||
|
306 | ||
|
307 | ||
|
308 | <table class="legend"> | |
|
309 | <tr> | |
|
310 | <th colspan="2">Legend</th> | |
|
311 | </tr> | |
|
312 | <tr> | |
|
313 | <td style="color:#ff0000;"><i>RED</i></td><td>Disconnected</td> | |
|
314 | </tr> | |
|
315 | <tr> | |
|
316 | <td style="color:#ee902c;"><i>ORANGE</i></td><td>Connected</td> | |
|
317 | </tr> | |
|
318 | <tr> | |
|
319 | <td style="color:#00cc00;"><i>GREEN</i></td><td>Running | |
|
320 | </td> | |
|
321 | </tr> | |
|
322 | <!-- | |
|
323 | <tr> | |
|
324 | <td colspan="2"> | |
|
325 | <button style="margin: 10px;" id="sendbeam" type="button" class="btn btn-default"> | |
|
326 | <span class="glyphicon glyphicon-export" aria-hidden="true"></span> | |
|
327 | Change Beam</button> | |
|
328 | </td> | |
|
329 | </tr> | |
|
330 | --> | |
|
331 | </table> | |
|
332 | ||
|
333 | ||
|
334 | ||
|
335 | ||
|
336 | {% else %} | |
|
337 | <p><i>This ABS Configuration does not have a current active ABS Beam...<br> | |
|
338 | Please send Beam List to ABS modules. </i></p> | |
|
339 | ||
|
340 | {% endif %} | |
|
341 | ||
|
342 | ||
|
343 | </div> | |
|
344 | ||
|
345 | ||
|
346 | ||
|
347 | {% for beam in beams %} | |
|
348 | <div id="menu{{forloop.counter}}" class="tab-pane fade"> | |
|
349 | <h3>{%if active_beam.id == beam.id%}Active Beam: {%endif%}{{beam.name}}</h3> | |
|
350 | <!--<p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>--> | |
|
351 | <table id="abs_pattern{{forloop.counter}}" class="abs"> | |
|
352 | <tr> | |
|
353 | <td> <b>North Quarter</b> | |
|
354 | <table class="north "> | |
|
355 | <tr> | |
|
356 | <td {{beam.color_status.1}}>{{beam.get_upvalues.0}}</td> <td {{beam.color_status.2}}>{{beam.get_upvalues.1}}</td> <td {{beam.color_status.3}}>{{beam.get_upvalues.2}}</td> <td {{beam.color_status.4}}>{{beam.get_upvalues.3}}</td> | |
|
357 | </tr> | |
|
358 | <tr> | |
|
359 | <td {{beam.color_status.1}}>{{beam.get_downvalues.0}}</td> <td {{beam.color_status.2}}>{{beam.get_downvalues.1}}</td> <td {{beam.color_status.3}}>{{beam.get_downvalues.2}}</td> <td {{beam.color_status.4}}>{{beam.get_downvalues.3}}</td> | |
|
360 | </tr> | |
|
361 | <tr> | |
|
362 | <td {{beam.color_status.9}}>{{beam.get_upvalues.8}}</td> <td {{beam.color_status.10}}>{{beam.get_upvalues.9}}</td> <td {{beam.color_status.11}}>{{beam.get_upvalues.10}}</td> <td {{beam.color_status.12}}>{{beam.get_upvalues.11}}</td> | |
|
363 | </tr> | |
|
364 | <tr> | |
|
365 | <td {{beam.color_status.9}}>{{beam.get_downvalues.8}}</td> <td {{beam.color_status.10}}>{{beam.get_downvalues.9}}</td> <td {{beam.color_status.11}}>{{beam.get_downvalues.10}}</td> <td {{beam.color_status.12}}>{{beam.get_downvalues.11}}</td> | |
|
366 | </tr> | |
|
367 | <tr> | |
|
368 | <td {{beam.color_status.17}}>{{beam.get_upvalues.16}}</td> <td {{beam.color_status.18}}>{{beam.get_upvalues.17}}</td> <td {{beam.color_status.19}}>{{beam.get_upvalues.18}}</td> <td {{beam.color_status.20}}>{{beam.get_upvalues.19}}</td> | |
|
369 | </tr> | |
|
370 | <tr> | |
|
371 | <td {{beam.color_status.17}}>{{beam.get_downvalues.16}}</td> <td {{beam.color_status.18}}>{{beam.get_downvalues.17}}</td> <td {{beam.color_status.19}}>{{beam.get_downvalues.18}}</td> <td {{beam.color_status.20}}>{{beam.get_downvalues.19}}</td> | |
|
372 | </tr> | |
|
373 | <tr> | |
|
374 | <td {{beam.color_status.25}}>{{beam.get_upvalues.24}}</td> <td {{beam.color_status.26}}>{{beam.get_upvalues.25}}</td> <td {{beam.color_status.27}}>{{beam.get_upvalues.26}}</td> <td {{beam.color_status.28}}>{{beam.get_upvalues.27}}</td> | |
|
375 | </tr> | |
|
376 | <tr> | |
|
377 | <td {{beam.color_status.25}}>{{beam.get_downvalues.24}}</td> <td {{beam.color_status.26}}>{{beam.get_downvalues.25}}</td> <td {{beam.color_status.27}}>{{beam.get_downvalues.26}}</td> <td {{beam.color_status.28}}>{{beam.get_downvalues.27}}</td> | |
|
378 | </tr> | |
|
379 | </table> | |
|
380 | </td> | |
|
381 | <td> <b>East Quarter</b> | |
|
382 | <table class="east "> | |
|
383 | <tr> | |
|
384 | <td {{beam.color_status.5}}>{{beam.get_upvalues.4}}</td> <td {{beam.color_status.6}}>{{beam.get_upvalues.5}}</td> <td {{beam.color_status.7}}>{{beam.get_upvalues.6}}</td> <td {{beam.color_status.8}}>{{beam.get_upvalues.7}}</td> | |
|
385 | </tr> | |
|
386 | <tr> | |
|
387 | <td {{beam.color_status.5}}>{{beam.get_downvalues.4}}</td> <td {{beam.color_status.6}}>{{beam.get_downvalues.5}}</td> <td {{beam.color_status.7}}>{{beam.get_downvalues.6}}</td> <td {{beam.color_status.8}}>{{beam.get_downvalues.7}}</td> | |
|
388 | </tr> | |
|
389 | <tr> | |
|
390 | <td {{beam.color_status.13}}>{{beam.get_upvalues.12}}</td> <td {{beam.color_status.14}}>{{beam.get_upvalues.13}}</td> <td {{beam.color_status.15}}>{{beam.get_upvalues.14}}</td> <td {{beam.color_status.16}}>{{beam.get_upvalues.15}}</td> | |
|
391 | </tr> | |
|
392 | <tr> | |
|
393 | <td {{beam.color_status.13}}>{{beam.get_downvalues.12}}</td> <td {{beam.color_status.14}}>{{beam.get_downvalues.13}}</td> <td {{beam.color_status.15}}>{{beam.get_downvalues.14}}</td> <td {{beam.color_status.16}}>{{beam.get_downvalues.15}}</td> | |
|
394 | </tr> | |
|
395 | <tr> | |
|
396 | <td {{beam.color_status.21}}>{{beam.get_upvalues.20}}</td> <td {{beam.color_status.22}}>{{beam.get_upvalues.21}}</td> <td {{beam.color_status.23}}>{{beam.get_upvalues.22}}</td> <td {{beam.color_status.24}}>{{beam.get_upvalues.23}}</td> | |
|
397 | </tr> | |
|
398 | <tr> | |
|
399 | <td {{beam.color_status.21}}>{{beam.get_downvalues.20}}</td> <td {{beam.color_status.22}}>{{beam.get_downvalues.21}}</td> <td {{beam.color_status.23}}>{{beam.get_downvalues.22}}</td> <td {{beam.color_status.24}}>{{beam.get_downvalues.23}}</td> | |
|
400 | </tr> | |
|
401 | <tr> | |
|
402 | <td {{beam.color_status.29}}>{{beam.get_upvalues.28}}</td> <td {{beam.color_status.30}}>{{beam.get_upvalues.29}}</td> <td {{beam.color_status.31}}>{{beam.get_upvalues.30}}</td> <td {{beam.color_status.32}}>{{beam.get_upvalues.31}}</td> | |
|
403 | </tr> | |
|
404 | <tr> | |
|
405 | <td {{beam.color_status.29}}>{{beam.get_downvalues.28}}</td> <td {{beam.color_status.30}}>{{beam.get_downvalues.29}}</td> <td {{beam.color_status.31}}>{{beam.get_downvalues.30}}</td> <td {{beam.color_status.32}}>{{beam.get_downvalues.31}}</td> | |
|
406 | </tr> | |
|
407 | </table> | |
|
408 | </td> | |
|
409 | </tr> | |
|
410 | <tr> | |
|
411 | <td> <b>West Quarter</b> | |
|
412 | <table class="west "> | |
|
413 | <tr> | |
|
414 | <td {{beam.color_status.33}}>{{beam.get_upvalues.32}}</td> <td {{beam.color_status.34}}>{{beam.get_upvalues.33}}</td> <td {{beam.color_status.35}}>{{beam.get_upvalues.34}}</td> <td {{beam.color_status.36}}>{{beam.get_upvalues.35}}</td> | |
|
415 | </tr> | |
|
416 | <tr> | |
|
417 | <td {{beam.color_status.33}}>{{beam.get_downvalues.32}}</td> <td {{beam.color_status.34}}>{{beam.get_downvalues.33}}</td> <td {{beam.color_status.35}}>{{beam.get_downvalues.34}}</td> <td {{beam.color_status.36}}>{{beam.get_downvalues.35}}</td> | |
|
418 | </tr> | |
|
419 | <tr> | |
|
420 | <td {{beam.color_status.41}}>{{beam.get_upvalues.40}}</td> <td {{beam.color_status.42}}>{{beam.get_upvalues.41}}</td> <td {{beam.color_status.43}}>{{beam.get_upvalues.42}}</td> <td {{beam.color_status.44}}>{{beam.get_upvalues.43}}</td> | |
|
421 | </tr> | |
|
422 | <tr> | |
|
423 | <td {{beam.color_status.41}}>{{beam.get_downvalues.40}}</td> <td {{beam.color_status.42}}>{{beam.get_downvalues.41}}</td> <td {{beam.color_status.43}}>{{beam.get_downvalues.42}}</td> <td {{beam.color_status.44}}>{{beam.get_downvalues.43}}</td> | |
|
424 | </tr> | |
|
425 | <tr> | |
|
426 | <td {{beam.color_status.49}}>{{beam.get_upvalues.48}}</td> <td {{beam.color_status.50}}>{{beam.get_upvalues.49}}</td> <td {{beam.color_status.51}}>{{beam.get_upvalues.50}}</td> <td {{beam.color_status.52}}>{{beam.get_upvalues.51}}</td> | |
|
427 | </tr> | |
|
428 | <tr> | |
|
429 | <td {{beam.color_status.49}}>{{beam.get_downvalues.48}}</td> <td {{beam.color_status.50}}>{{beam.get_downvalues.49}}</td> <td {{beam.color_status.51}}>{{beam.get_downvalues.50}}</td> <td {{beam.color_status.52}}>{{beam.get_downvalues.51}}</td> | |
|
430 | </tr> | |
|
431 | <tr> | |
|
432 | <td {{beam.color_status.57}}>{{beam.get_upvalues.56}}</td> <td {{beam.color_status.58}}>{{beam.get_upvalues.57}}</td> <td {{beam.color_status.59}}>{{beam.get_upvalues.58}}</td> <td {{beam.color_status.60}}>{{beam.get_upvalues.59}}</td> | |
|
433 | </tr> | |
|
434 | <tr> | |
|
435 | <td {{beam.color_status.57}}>{{beam.get_downvalues.56}}</td> <td {{beam.color_status.58}}>{{beam.get_downvalues.57}}</td> <td {{beam.color_status.59}}>{{beam.get_downvalues.58}}</td> <td {{beam.color_status.60}}>{{beam.get_downvalues.59}}</td> | |
|
436 | </tr> | |
|
437 | </table> | |
|
438 | </td> | |
|
439 | <td> <b>South Quarter</b> | |
|
440 | <table class="south "> | |
|
441 | <tr> | |
|
442 | <td {{beam.color_status.37}}>{{beam.get_upvalues.36}}</td> <td {{beam.color_status.38}}>{{beam.get_upvalues.37}}</td> <td {{beam.color_status.39}}>{{beam.get_upvalues.38}}</td> <td {{beam.color_status.40}}>{{beam.get_upvalues.39}}</td> | |
|
443 | </tr> | |
|
444 | <tr> | |
|
445 | <td {{beam.color_status.37}}>{{beam.get_downvalues.36}}</td> <td {{beam.color_status.38}}>{{beam.get_downvalues.37}}</td> <td {{beam.color_status.39}}>{{beam.get_downvalues.38}}</td> <td {{beam.color_status.40}}>{{beam.get_downvalues.39}}</td> | |
|
446 | </tr> | |
|
447 | <tr> | |
|
448 | <td {{beam.color_status.45}}>{{beam.get_upvalues.44}}</td> <td {{beam.color_status.46}}>{{beam.get_upvalues.45}}</td> <td {{beam.color_status.47}}>{{beam.get_upvalues.46}}</td> <td {{beam.color_status.48}}>{{beam.get_upvalues.47}}</td> | |
|
449 | </tr> | |
|
450 | <tr> | |
|
451 | <td {{beam.color_status.45}}>{{beam.get_downvalues.44}}</td> <td {{beam.color_status.46}}>{{beam.get_downvalues.45}}</td> <td {{beam.color_status.47}}>{{beam.get_downvalues.46}}</td> <td {{beam.color_status.48}}>{{beam.get_downvalues.47}}</td> | |
|
452 | </tr> | |
|
453 | <tr> | |
|
454 | <td {{beam.color_status.53}}>{{beam.get_upvalues.52}}</td> <td {{beam.color_status.54}}>{{beam.get_upvalues.53}}</td> <td {{beam.color_status.55}}>{{beam.get_upvalues.54}}</td> <td {{beam.color_status.56}}>{{beam.get_upvalues.55}}</td> | |
|
455 | </tr> | |
|
456 | <tr> | |
|
457 | <td {{beam.color_status.53}}>{{beam.get_downvalues.52}}</td> <td {{beam.color_status.54}}>{{beam.get_downvalues.53}}</td> <td {{beam.color_status.55}}>{{beam.get_downvalues.54}}</td> <td {{beam.color_status.56}}>{{beam.get_downvalues.55}}</td> | |
|
458 | </tr> | |
|
459 | <tr> | |
|
460 | <td {{beam.color_status.61}}>{{beam.get_upvalues.60}}</td> <td {{beam.color_status.62}}>{{beam.get_upvalues.61}}</td> <td {{beam.color_status.63}}>{{beam.get_upvalues.62}}</td> <td {{beam.color_status.64}}>{{beam.get_upvalues.63}}</td> | |
|
461 | </tr> | |
|
462 | <tr> | |
|
463 | <td {{beam.color_status.61}}>{{beam.get_downvalues.60}}</td> <td {{beam.color_status.62}}>{{beam.get_downvalues.61}}</td> <td {{beam.color_status.63}}>{{beam.get_downvalues.62}}</td> <td {{beam.color_status.64}}>{{beam.get_downvalues.63}}</td> | |
|
464 | </tr> | |
|
465 | </table> | |
|
466 | </td> | |
|
467 | </tr> | |
|
468 | </table> | |
|
469 | ||
|
470 | {% if active_beam.id != beam.id %} | |
|
471 | <div style="vertical-align: top; display:inline-block;"> | |
|
472 | <button style="" id="sendbeam" type="button" class="btn btn-default"> | |
|
473 | <span class="glyphicon glyphicon-export" aria-hidden="true"></span> | |
|
474 | Change Beam</button> | |
|
475 | </div> | |
|
476 | {% endif %} | |
|
477 | ||
|
478 | ||
|
479 | ||
|
480 | ||
|
481 | {% if active_beam %} | |
|
482 | {% if active_beam.id == beam.id %} | |
|
483 | <table class="legend"> | |
|
484 | <tr> | |
|
485 | <th colspan="2">Legend</th> | |
|
486 | </tr> | |
|
487 | <tr> | |
|
488 | <td style="color:#ff0000;"><i>RED</i></td><td>Disconnected</td> | |
|
489 | </tr> | |
|
490 | <tr> | |
|
491 | <td style="color:#ee902c;"><i>ORANGE</i></td><td>Connected</td> | |
|
492 | </tr> | |
|
493 | <tr> | |
|
494 | <td style="color:#00cc00;"><i>GREEN</i></td><td>Running | |
|
495 | </td> | |
|
496 | </tr> | |
|
497 | </table> | |
|
498 | ||
|
499 | {% endif %} | |
|
500 | {% endif %} | |
|
501 | ||
|
502 | ||
|
503 | </div> | |
|
504 | ||
|
505 | ||
|
506 | {% endfor %} | |
|
507 | ||
|
508 | ||
|
509 | ||
|
510 | </div> | |
|
511 | </div> | |
|
512 | ||
|
513 | ||
|
209 | 514 | |
|
210 | 515 | |
|
211 | 516 | <script> |
|
212 | 517 | $(document).ready(function() { |
|
213 | 518 | |
|
214 | {% for beam in beams %} | |
|
215 | $( "#button-{{ forloop.counter }}" ).click(function() { | |
|
216 | //$(this).addClass('active'); | |
|
217 | ||
|
218 | var beam_upvalues = {{beam.get_upvalues}}; | |
|
219 | var beam_downvalues = {{beam.get_downvalues}}; | |
|
220 | //alert(beam_upvalues) | |
|
221 | var table = document.getElementById('abs_pattern'); | |
|
222 | var cells = table.getElementsByTagName('td'); | |
|
223 | //alert(cells[99].textContent); | |
|
224 | ||
|
225 | for (var i = 1, len = 30; i < len; i++) { | |
|
226 | if ((i > 24) && (i<29)){ | |
|
227 | cells[i].innerHTML = beam_upvalues[i-1].toFixed(1); | |
|
228 | cells[i+4].innerHTML = beam_downvalues[i-1].toFixed(1); | |
|
229 | } | |
|
230 | else if ((i > 16) && (i<21)){ | |
|
231 | cells[i].innerHTML = beam_upvalues[i-1].toFixed(1); | |
|
232 | cells[i+4].innerHTML = beam_downvalues[i-1].toFixed(1); | |
|
233 | } | |
|
234 | else if ((i > 8) && (i<13)){ | |
|
235 | cells[i].innerHTML = beam_upvalues[i-1].toFixed(1); | |
|
236 | cells[i+4].innerHTML = beam_downvalues[i-1].toFixed(1); | |
|
237 | } | |
|
238 | else if (i < 5) { | |
|
239 | cells[i].innerHTML = beam_upvalues[i-1].toFixed(1); | |
|
240 | cells[i+4].innerHTML = beam_downvalues[i-1].toFixed(1); | |
|
241 | } | |
|
242 | } | |
|
243 | ||
|
244 | for (var i = 34, len = 63; i < len; i++) { | |
|
245 | if ((i > 57) && (i<62)) { | |
|
246 | cells[i].innerHTML = beam_upvalues[i-30].toFixed(1); | |
|
247 | cells[i+4].innerHTML = beam_downvalues[i-30].toFixed(1); | |
|
248 | } | |
|
249 | if ((i > 49) && (i<54)) { | |
|
250 | cells[i].innerHTML = beam_upvalues[i-30].toFixed(1); | |
|
251 | cells[i+4].innerHTML = beam_downvalues[i-30].toFixed(1); | |
|
252 | } | |
|
253 | else if ((i > 41) && (i<46)) { | |
|
254 | cells[i].innerHTML = beam_upvalues[i-30].toFixed(1); | |
|
255 | cells[i+4].innerHTML = beam_downvalues[i-30].toFixed(1); | |
|
256 | } | |
|
257 | else if (i < 38) { | |
|
258 | cells[i].innerHTML = beam_upvalues[i-30].toFixed(1); | |
|
259 | cells[i+4].innerHTML = beam_downvalues[i-30].toFixed(1); | |
|
260 | } | |
|
261 | } | |
|
262 | ||
|
263 | for (var i = 67, len = 96; i < len; i++) { | |
|
264 | if ((i > 90) && (i<95)) { | |
|
265 | cells[i].innerHTML = beam_upvalues[i-35].toFixed(1); | |
|
266 | cells[i+4].innerHTML = beam_downvalues[i-35].toFixed(1); | |
|
267 | } | |
|
268 | else if ((i > 82) && (i<87)) { | |
|
269 | cells[i].innerHTML = beam_upvalues[i-35].toFixed(1); | |
|
270 | cells[i+4].innerHTML = beam_downvalues[i-35].toFixed(1); | |
|
271 | } | |
|
272 | else if ((i > 74) && (i<79)) { | |
|
273 | cells[i].innerHTML = beam_upvalues[i-35].toFixed(1); | |
|
274 | cells[i+4].innerHTML = beam_downvalues[i-35].toFixed(1); | |
|
275 | } | |
|
276 | else if (i < 71) { | |
|
277 | cells[i].innerHTML = beam_upvalues[i-35].toFixed(1); | |
|
278 | cells[i+4].innerHTML = beam_downvalues[i-35].toFixed(1); | |
|
279 | } | |
|
280 | } | |
|
281 | ||
|
282 | for (var i = 100, len = 129; i < len; i++) { | |
|
283 | if ((i > 123) && (i<128)) { | |
|
284 | cells[i].innerHTML = beam_upvalues[i-64].toFixed(1); | |
|
285 | cells[i+4].innerHTML = beam_downvalues[i-64].toFixed(1); | |
|
286 | } | |
|
287 | else if ((i > 115) && (i<120)) { | |
|
288 | cells[i].innerHTML = beam_upvalues[i-64].toFixed(1); | |
|
289 | cells[i+4].innerHTML = beam_downvalues[i-64].toFixed(1); | |
|
290 | } | |
|
291 | else if ((i > 107) && (i<112)) { | |
|
292 | cells[i].innerHTML = beam_upvalues[i-64].toFixed(1); | |
|
293 | cells[i+4].innerHTML = beam_downvalues[i-64].toFixed(1); | |
|
294 | } | |
|
295 | else if (i < 104) { | |
|
296 | cells[i].innerHTML = beam_upvalues[i-64].toFixed(1); | |
|
297 | cells[i+4].innerHTML = beam_downvalues[i-64].toFixed(1); | |
|
298 | } | |
|
299 | } | |
|
300 | ||
|
301 | //$('#button-1').addClass("active"); | |
|
302 | ||
|
303 | }); | |
|
304 | ||
|
305 | {% endfor %} | |
|
306 | ||
|
307 | ||
|
308 | ||
|
309 | ||
|
310 | //}) | |
|
311 | ||
|
312 | //function ChangeColor() { | |
|
313 | // document.getElementById("button_1").style.backgroundColor = "#2c3e50"; | |
|
314 | // document.getElementById("button_1").style.color = "#ecf0f1"; | |
|
315 | //} | |
|
519 | ||
|
316 | 520 | }); |
|
317 | 521 | </script> |
|
318 | 522 | |
|
319 | 523 | |
|
320 | 524 | |
|
321 | <br> | |
|
322 | ||
|
323 | <table id="abs_pattern" class="abs"> | |
|
324 | <tr> | |
|
325 | <td> <b>North Quarter</b> | |
|
326 | <table class="north "> | |
|
327 | <tr> | |
|
328 | <td>{{beams.0.get_upvalues.0}}</td> <td>{{beams.0.get_upvalues.1}}</td> <td>{{beams.0.get_upvalues.2}}</td> <td>{{beams.0.get_upvalues.3}}</td> | |
|
329 | </tr> | |
|
330 | <tr> | |
|
331 | <td>{{beams.0.get_downvalues.0}}</td> <td>{{beams.0.get_downvalues.1}}</td> <td>{{beams.0.get_downvalues.2}}</td> <td>{{beams.0.get_downvalues.3}}</td> | |
|
332 | </tr> | |
|
333 | <tr> | |
|
334 | <td>{{beams.0.get_upvalues.8}}</td> <td>{{beams.0.get_upvalues.9}}</td> <td>{{beams.0.get_upvalues.10}}</td> <td>{{beams.0.get_upvalues.11}}</td> | |
|
335 | </tr> | |
|
336 | <tr> | |
|
337 | <td>{{beams.0.get_downvalues.8}}</td> <td>{{beams.0.get_downvalues.9}}</td> <td>{{beams.0.get_downvalues.10}}</td> <td>{{beams.0.get_downvalues.11}}</td> | |
|
338 | </tr> | |
|
339 | <tr> | |
|
340 | <td>{{beams.0.get_upvalues.16}}</td> <td>{{beams.0.get_upvalues.17}}</td> <td>{{beams.0.get_upvalues.18}}</td> <td>{{beams.0.get_upvalues.19}}</td> | |
|
341 | </tr> | |
|
342 | <tr> | |
|
343 | <td>{{beams.0.get_downvalues.16}}</td> <td>{{beams.0.get_downvalues.17}}</td> <td>{{beams.0.get_downvalues.18}}</td> <td>{{beams.0.get_downvalues.19}}</td> | |
|
344 | </tr> | |
|
345 | <tr> | |
|
346 | <td>{{beams.0.get_upvalues.24}}</td> <td>{{beams.0.get_upvalues.25}}</td> <td>{{beams.0.get_upvalues.26}}</td> <td>{{beams.0.get_upvalues.27}}</td> | |
|
347 | </tr> | |
|
348 | <tr> | |
|
349 | <td>{{beams.0.get_downvalues.24}}</td> <td>{{beams.0.get_downvalues.25}}</td> <td>{{beams.0.get_downvalues.26}}</td> <td>{{beams.0.get_downvalues.27}}</td> | |
|
350 | </tr> | |
|
351 | </table> | |
|
352 | </td> | |
|
353 | <td> <b>East Quarter</b> | |
|
354 | <table class="east "> | |
|
355 | <tr> | |
|
356 | <td>{{beams.0.get_upvalues.4}}</td> <td>{{beams.0.get_upvalues.5}}</td> <td>{{beams.0.get_upvalues.6}}</td> <td>{{beams.0.get_upvalues.7}}</td> | |
|
357 | </tr> | |
|
358 | <tr> | |
|
359 | <td>{{beams.0.get_downvalues.4}}</td> <td>{{beams.0.get_downvalues.5}}</td> <td>{{beams.0.get_downvalues.6}}</td> <td>{{beams.0.get_downvalues.7}}</td> | |
|
360 | </tr> | |
|
361 | <tr> | |
|
362 | <td>{{beams.0.get_upvalues.12}}</td> <td>{{beams.0.get_upvalues.13}}</td> <td>{{beams.0.get_upvalues.14}}</td> <td>{{beams.0.get_upvalues.15}}</td> | |
|
363 | </tr> | |
|
364 | <tr> | |
|
365 | <td>{{beams.0.get_downvalues.12}}</td> <td>{{beams.0.get_downvalues.13}}</td> <td>{{beams.0.get_downvalues.14}}</td> <td>{{beams.0.get_downvalues.15}}</td> | |
|
366 | </tr> | |
|
367 | <tr> | |
|
368 | <td>{{beams.0.get_upvalues.20}}</td> <td>{{beams.0.get_upvalues.21}}</td> <td>{{beams.0.get_upvalues.22}}</td> <td>{{beams.0.get_upvalues.23}}</td> | |
|
369 | </tr> | |
|
370 | <tr> | |
|
371 | <td>{{beams.0.get_downvalues.20}}</td> <td>{{beams.0.get_downvalues.21}}</td> <td>{{beams.0.get_downvalues.22}}</td> <td>{{beams.0.get_downvalues.23}}</td> | |
|
372 | </tr> | |
|
373 | <tr> | |
|
374 | <td>{{beams.0.get_upvalues.28}}</td> <td>{{beams.0.get_upvalues.29}}</td> <td>{{beams.0.get_upvalues.30}}</td> <td>{{beams.0.get_upvalues.31}}</td> | |
|
375 | </tr> | |
|
376 | <tr> | |
|
377 | <td>{{beams.0.get_downvalues.28}}</td> <td>{{beams.0.get_downvalues.29}}</td> <td>{{beams.0.get_downvalues.30}}</td> <td>{{beams.0.get_downvalues.31}}</td> | |
|
378 | </tr> | |
|
379 | </table> | |
|
380 | </td> | |
|
381 | </tr> | |
|
382 | <tr> | |
|
383 | <td> <b>West Quarter</b> | |
|
384 | <table class="west "> | |
|
385 | <tr> | |
|
386 | <td>{{beams.0.get_upvalues.32}}</td> <td>{{beams.0.get_upvalues.33}}</td> <td>{{beams.0.get_upvalues.34}}</td> <td>{{beams.0.get_upvalues.35}}</td> | |
|
387 | </tr> | |
|
388 | <tr> | |
|
389 | <td>{{beams.0.get_downvalues.32}}</td> <td>{{beams.0.get_downvalues.33}}</td> <td>{{beams.0.get_downvalues.34}}</td> <td>{{beams.0.get_downvalues.35}}</td> | |
|
390 | </tr> | |
|
391 | <tr> | |
|
392 | <td>{{beams.0.get_upvalues.40}}</td> <td>{{beams.0.get_upvalues.41}}</td> <td>{{beams.0.get_upvalues.42}}</td> <td>{{beams.0.get_upvalues.43}}</td> | |
|
393 | </tr> | |
|
394 | <tr> | |
|
395 | <td>{{beams.0.get_downvalues.40}}</td> <td>{{beams.0.get_downvalues.41}}</td> <td>{{beams.0.get_downvalues.42}}</td> <td>{{beams.0.get_downvalues.43}}</td> | |
|
396 | </tr> | |
|
397 | <tr> | |
|
398 | <td>{{beams.0.get_upvalues.48}}</td> <td>{{beams.0.get_upvalues.49}}</td> <td>{{beams.0.get_upvalues.50}}</td> <td>{{beams.0.get_upvalues.51}}</td> | |
|
399 | </tr> | |
|
400 | <tr> | |
|
401 | <td>{{beams.0.get_downvalues.48}}</td> <td>{{beams.0.get_downvalues.49}}</td> <td>{{beams.0.get_downvalues.50}}</td> <td>{{beams.0.get_downvalues.51}}</td> | |
|
402 | </tr> | |
|
403 | <tr> | |
|
404 | <td>{{beams.0.get_upvalues.56}}</td> <td>{{beams.0.get_upvalues.57}}</td> <td>{{beams.0.get_upvalues.58}}</td> <td>{{beams.0.get_upvalues.59}}</td> | |
|
405 | </tr> | |
|
406 | <tr> | |
|
407 | <td>{{beams.0.get_downvalues.56}}</td> <td>{{beams.0.get_downvalues.57}}</td> <td>{{beams.0.get_downvalues.58}}</td> <td>{{beams.0.get_downvalues.59}}</td> | |
|
408 | </tr> | |
|
409 | </table> | |
|
410 | </td> | |
|
411 | <td> <b>South Quarter</b> | |
|
412 | <table class="south "> | |
|
413 | <tr> | |
|
414 | <td>{{beams.0.get_upvalues.36}}</td> <td>{{beams.0.get_upvalues.37}}</td> <td>{{beams.0.get_upvalues.38}}</td> <td>{{beams.0.get_upvalues.39}}</td> | |
|
415 | </tr> | |
|
416 | <tr> | |
|
417 | <td>{{beams.0.get_downvalues.36}}</td> <td>{{beams.0.get_downvalues.37}}</td> <td>{{beams.0.get_downvalues.38}}</td> <td>{{beams.0.get_downvalues.39}}</td> | |
|
418 | </tr> | |
|
419 | <tr> | |
|
420 | <td>{{beams.0.get_upvalues.44}}</td> <td>{{beams.0.get_upvalues.45}}</td> <td>{{beams.0.get_upvalues.46}}</td> <td>{{beams.0.get_upvalues.47}}</td> | |
|
421 | </tr> | |
|
422 | <tr> | |
|
423 | <td>{{beams.0.get_downvalues.44}}</td> <td>{{beams.0.get_downvalues.45}}</td> <td>{{beams.0.get_downvalues.46}}</td> <td>{{beams.0.get_downvalues.47}}</td> | |
|
424 | </tr> | |
|
425 | <tr> | |
|
426 | <td>{{beams.0.get_upvalues.52}}</td> <td>{{beams.0.get_upvalues.53}}</td> <td>{{beams.0.get_upvalues.54}}</td> <td>{{beams.0.get_upvalues.55}}</td> | |
|
427 | </tr> | |
|
428 | <tr> | |
|
429 | <td>{{beams.0.get_downvalues.52}}</td> <td>{{beams.0.get_downvalues.53}}</td> <td>{{beams.0.get_downvalues.54}}</td> <td>{{beams.0.get_downvalues.55}}</td> | |
|
430 | </tr> | |
|
431 | <tr> | |
|
432 | <td>{{beams.0.get_upvalues.60}}</td> <td>{{beams.0.get_upvalues.61}}</td> <td>{{beams.0.get_upvalues.62}}</td> <td>{{beams.0.get_upvalues.63}}</td> | |
|
433 | </tr> | |
|
434 | <tr> | |
|
435 | <td>{{beams.0.get_downvalues.60}}</td> <td>{{beams.0.get_downvalues.61}}</td> <td>{{beams.0.get_downvalues.62}}</td> <td>{{beams.0.get_downvalues.63}}</td> | |
|
436 | </tr> | |
|
437 | </table> | |
|
438 | </td> | |
|
439 | </tr> | |
|
440 | </table> | |
|
441 | ||
|
442 | <table class="legend"> | |
|
443 | <tr> | |
|
444 | <th colspan="2">Legend</th> | |
|
445 | </tr> | |
|
446 | <tr> | |
|
447 | <td style="color:#ff0000;"><i>RED</i></td><td>Disconnected</td> | |
|
448 | </tr> | |
|
449 | <tr> | |
|
450 | <td style="color:#ee902c;"><i>ORANGE</i></td><td>Connected</td> | |
|
451 | </tr> | |
|
452 | <tr> | |
|
453 | <td style="color:#00cc00;"><i>GREEN</i></td><td>Running</td> | |
|
454 | </tr> | |
|
455 | </table> | |
|
525 | ||
|
526 | ||
|
456 | 527 | |
|
457 | 528 | {% else %} |
|
458 | 529 | <p style="color:#b4bcc2; margin-left: 5%;"><i>No Beams...</i></p> |
@@ -121,18 +121,22 def get_values_from_form(form_data): | |||
|
121 | 121 | |
|
122 | 122 | def abs_conf(request, id_conf): |
|
123 | 123 | |
|
124 | conf = get_object_or_404(ABSConfiguration, pk=id_conf) | |
|
125 | beams = ABSBeam.objects.filter(abs_conf=conf) | |
|
126 | #beams_dict = ast.literal_eval(conf.beams) | |
|
127 | #beams = [] | |
|
128 | #for beam_id in range(1,len(beams_dict)+1): | |
|
129 | # beam = ABSBeam.objects.get(pk=beams_dict['beam'+str(beam_id)]) | |
|
130 | # beams.append(beam) | |
|
131 | ||
|
132 | #beams_id = ast.literal_eval(conf.beams) | |
|
133 | ||
|
134 | ip=conf.device.ip_address | |
|
135 | port=conf.device.port_address | |
|
124 | conf = get_object_or_404(ABSConfiguration, pk=id_conf) | |
|
125 | beams = ABSBeam.objects.filter(abs_conf=conf) | |
|
126 | active_beam_id = json.loads(conf.active_beam) | |
|
127 | ||
|
128 | #------------Colors for Active Beam:------------- | |
|
129 | modules_status = json.loads(conf.module_status) | |
|
130 | ||
|
131 | color_status = {} | |
|
132 | for status in modules_status: | |
|
133 | if modules_status[status] == 2: #Running background-color: #ff0000; | |
|
134 | color_status[status] = 'bgcolor=#00cc00' | |
|
135 | elif modules_status[status] == 1: #Connected background-color: #ee902c; | |
|
136 | color_status[status] = 'bgcolor=#ee902c' | |
|
137 | else: #Disconnected background-color: #00cc00; | |
|
138 | color_status[status] = 'bgcolor=#FF0000' | |
|
139 | #------------------------------------------------ | |
|
136 | 140 | |
|
137 | 141 | kwargs = {} |
|
138 | 142 | kwargs['status'] = conf.device.get_status_display() |
@@ -146,12 +150,20 def abs_conf(request, id_conf): | |||
|
146 | 150 | kwargs['no_play'] = True |
|
147 | 151 | |
|
148 | 152 | kwargs['button'] = 'Edit Configuration' |
|
149 | ||
|
150 | #kwargs['no_play'] = True | |
|
151 | #kwargs['beams_id'] = beams_id | |
|
153 | #------------------Active Beam----------------------- | |
|
154 | try: | |
|
155 | active_beam_id = active_beam_id['active_beam'] | |
|
156 | active_beam = ABSBeam.objects.get(pk=active_beam_id) | |
|
157 | kwargs['active_beam'] = active_beam | |
|
158 | for beam in beams: | |
|
159 | if beam.id == active_beam.id: | |
|
160 | beam.color_status=color_status | |
|
161 | except: | |
|
162 | active_beam = '' | |
|
163 | #---------------------------------------------------- | |
|
152 | 164 | kwargs['beams'] = beams |
|
153 | kwargs['beam_selector'] = 0 | |
|
154 | #kwargs['my_data'] = simplejson.dumps(beams) | |
|
165 | kwargs['modules_status'] = modules_status | |
|
166 | kwargs['color_status'] = color_status | |
|
155 | 167 | |
|
156 | 168 | kwargs['only_stop'] = True |
|
157 | 169 | |
@@ -163,14 +175,7 def abs_conf(request, id_conf): | |||
|
163 | 175 | def abs_conf_edit(request, id_conf): |
|
164 | 176 | |
|
165 | 177 | conf = get_object_or_404(ABSConfiguration, pk=id_conf) |
|
166 | #beams_list = ast.literal_eval(conf.beams) | |
|
167 | #i = 1 | |
|
168 | #beams = [] | |
|
169 | #for b in beams_list: | |
|
170 | # beam = ABSBeam.objects.get(pk=beams_list['beam'+str(i)]) | |
|
171 | # beams.append(beam) | |
|
172 | # i=i+1 | |
|
173 | ||
|
178 | ||
|
174 | 179 | beams = ABSBeam.objects.filter(abs_conf=conf) |
|
175 | 180 | print beams |
|
176 | 181 | |
@@ -230,7 +235,7 def add_beam(request, id_conf): | |||
|
230 | 235 | new_beam.save() |
|
231 | 236 | #---Update 6bits configuration and add beam to abs configuration beams list. |
|
232 | 237 | new_beam.modules_6bits() |
|
233 | new_beam.add_beam2list() | |
|
238 | #new_beam.add_beam2list() | |
|
234 | 239 | messages.success(request, 'Beam: "%s" has been added.' % new_beam.name) |
|
235 | 240 | |
|
236 | 241 | return redirect('url_edit_abs_conf', conf.id) |
General Comments 0
You need to be logged in to leave comments.
Login now