@@ -1,342 +1,342 | |||
|
1 | 1 | {% extends "dev_conf.html" %} {% load static %} {% load bootstrap3 %} {% load main_tags %} |
|
2 | 2 | {% block extra-head %} |
|
3 | 3 | <style> |
|
4 | 4 | .abs { |
|
5 | 5 | width: auto; |
|
6 | 6 | display: inline-block; |
|
7 | 7 | text-align: center; |
|
8 | 8 | } |
|
9 | 9 | |
|
10 | 10 | .abs td { |
|
11 | 11 | padding: 4px; |
|
12 | 12 | } |
|
13 | 13 | |
|
14 | 14 | .module td { |
|
15 | 15 | padding: 4px 15px 4px 15px; |
|
16 | 16 | font-weight: bold; |
|
17 | 17 | border: 1px solid |
|
18 | 18 | } |
|
19 | 19 | |
|
20 | 20 | .legend { |
|
21 | 21 | margin-left: 15px; |
|
22 | 22 | display: inline-block; |
|
23 | 23 | border: 2px solid; |
|
24 | 24 | vertical-align: top; |
|
25 | 25 | } |
|
26 | 26 | |
|
27 | 27 | .legend th { |
|
28 | 28 | border-bottom: 1px dashed; |
|
29 | 29 | font-weight: bold; |
|
30 | 30 | vertical-align: center; |
|
31 | 31 | text-align: center; |
|
32 | 32 | } |
|
33 | 33 | |
|
34 | 34 | .legend td { |
|
35 | 35 | padding: 2px; |
|
36 | 36 | text-align: center; |
|
37 | 37 | } |
|
38 | 38 | |
|
39 | 39 | </style> |
|
40 | 40 | {% endblock %} |
|
41 | 41 | {% block extra-menu-actions %} |
|
42 | 42 | <li> |
|
43 | 43 | <a href="{{ dev_conf.get_absolute_url_plot }}" target="_blank"> |
|
44 | 44 | <span class="glyphicon glyphicon-picture" aria-hidden="true"></span> View Patterns </a> |
|
45 | 45 | </li> |
|
46 | 46 | {% endblock %} |
|
47 | 47 | {% block extra-content %} |
|
48 | 48 | {% if beams %} |
|
49 | 49 | <h4>Beams:</h4> |
|
50 | 50 | <div class="container"> |
|
51 | 51 | <ul class="nav nav-pills"> |
|
52 | 52 | {% for beam in beams %} |
|
53 | 53 | <li {%if beam.pk == active_beam %} class="active" {% endif %}> |
|
54 | 54 | <a data-toggle="pill" href="#menu{{forloop.counter}}">{{forloop.counter}}</a> |
|
55 | 55 | </li> |
|
56 | 56 | {% endfor %} |
|
57 | 57 | </ul> |
|
58 | 58 | |
|
59 | 59 | <div class="tab-content"> |
|
60 | 60 | {% for beam in beams %} |
|
61 | 61 | <div id="menu{{forloop.counter}}" class="tab-pane fade {%if beam.pk == active_beam %}active in{% endif %}"> |
|
62 | 62 | <h3>{%if beam.pk == active_beam %}Active Beam: {%endif%}{{beam.name}}</h3> |
|
63 | 63 | <table id="abs_pattern{{forloop.counter}}" class="abs"> |
|
64 | 64 | <tr> |
|
65 | 65 | <td> |
|
66 | 66 | <b>North Quarter</b> |
|
67 | 67 | <table class="module"> |
|
68 | 68 | <tr> |
|
69 |
<td {%if beam.pk == active_beam %} {{color_status.1}} |
|
|
70 |
<td {%if beam.pk == active_beam %} {{color_status.2}} |
|
|
71 |
<td {%if beam.pk == active_beam %} {{color_status.3}} |
|
|
72 |
<td {%if beam.pk == active_beam %} {{color_status.4}} |
|
|
69 | <td title='{{module_messages.1}}'><span {%if beam.pk == active_beam %} {{color_status.1}} {%endif%}>{{beam.get_upvalues.0}}</span></td> | |
|
70 | <td title='{{module_messages.2}}'><span {%if beam.pk == active_beam %} {{color_status.2}} {%endif%}>{{beam.get_upvalues.1}}</span></td> | |
|
71 | <td title='{{module_messages.3}}'><span {%if beam.pk == active_beam %} {{color_status.3}} {%endif%}>{{beam.get_upvalues.2}}</span></td> | |
|
72 | <td title='{{module_messages.4}}'><span {%if beam.pk == active_beam %} {{color_status.4}} {%endif%}>{{beam.get_upvalues.3}}</span></td> | |
|
73 | 73 | </tr> |
|
74 | 74 | <tr> |
|
75 |
<td {%if beam.pk == active_beam %} {{color_status.1}} |
|
|
76 |
<td {%if beam.pk == active_beam %} {{color_status.2}} |
|
|
77 |
<td {%if beam.pk == active_beam %} {{color_status.3}} |
|
|
78 |
<td {%if beam.pk == active_beam %} {{color_status.4}} |
|
|
75 | <td title='{{module_messages.1}}'><span {%if beam.pk == active_beam %} {{color_status.1}} {%endif%}>{{beam.get_downvalues.0}}</span></td> | |
|
76 | <td title='{{module_messages.2}}'><span {%if beam.pk == active_beam %} {{color_status.2}} {%endif%}>{{beam.get_downvalues.1}}</span></td> | |
|
77 | <td title='{{module_messages.3}}'> <span {%if beam.pk == active_beam %} {{color_status.3}} {%endif%}>{{beam.get_downvalues.2}}</span></td> | |
|
78 | <td title='{{module_messages.4}}'> <span {%if beam.pk == active_beam %} {{color_status.4}} {%endif%}>{{beam.get_downvalues.3}}</span></td> | |
|
79 | 79 | </tr> |
|
80 | 80 | <tr> |
|
81 |
<td {%if beam.pk == active_beam %} {{color_status.9}} |
|
|
82 |
<td {%if beam.pk == active_beam %} {{color_status.10}} {%endif%} |
|
|
83 |
<td {%if beam.pk == active_beam %} {{color_status.11}} {%endif%} |
|
|
84 |
<td {%if beam.pk == active_beam %} {{color_status.12}} {%endif%} |
|
|
81 | <td title='{{module_messages.9}}'> <span {%if beam.pk == active_beam %} {{color_status.9}} {%endif%}>{{beam.get_upvalues.8}}</span></td> | |
|
82 | <td title='{{module_messages.10}}'><span {%if beam.pk == active_beam %} {{color_status.10}} {%endif%}>{{beam.get_upvalues.9}}</span></td> | |
|
83 | <td title='{{module_messages.11}}'><span {%if beam.pk == active_beam %} {{color_status.11}} {%endif%}>{{beam.get_upvalues.10}}</span></td> | |
|
84 | <td title='{{module_messages.12}}'><span {%if beam.pk == active_beam %} {{color_status.12}} {%endif%}>{{beam.get_upvalues.11}}</span></td> | |
|
85 | 85 | </tr> |
|
86 | 86 | <tr> |
|
87 |
<td {%if beam.pk == active_beam %} {{color_status.9}} |
|
|
88 |
<td {%if beam.pk == active_beam %} {{color_status.10}} {%endif%} |
|
|
89 |
<td {%if beam.pk == active_beam %} {{color_status.11}} {%endif%} |
|
|
90 |
<td {%if beam.pk == active_beam %} {{color_status.12}} {%endif%} |
|
|
87 | <td title='{{module_messages.9}}'> <span {%if beam.pk == active_beam %} {{color_status.9}} {%endif%}>{{beam.get_downvalues.8}}</span></td> | |
|
88 | <td title='{{module_messages.10}}'><span {%if beam.pk == active_beam %} {{color_status.10}} {%endif%}>{{beam.get_downvalues.9}}</span></td> | |
|
89 | <td title='{{module_messages.11}}'><span {%if beam.pk == active_beam %} {{color_status.11}} {%endif%}>{{beam.get_downvalues.10}}</span></td> | |
|
90 | <td title='{{module_messages.12}}'><span {%if beam.pk == active_beam %} {{color_status.12}} {%endif%}>{{beam.get_downvalues.11}}</span></td> | |
|
91 | 91 | </tr> |
|
92 | 92 | <tr> |
|
93 |
<td {%if beam.pk == active_beam %} {{color_status.17}} {%endif%} |
|
|
94 |
<td {%if beam.pk == active_beam %} {{color_status.18}} {%endif%} |
|
|
95 |
<td {%if beam.pk == active_beam %} {{color_status.19}} {%endif%} |
|
|
96 |
<td {%if beam.pk == active_beam %} {{color_status.20}} {%endif%} |
|
|
93 | <td title='{{module_messages.17}}'><span {%if beam.pk == active_beam %} {{color_status.17}} {%endif%}>{{beam.get_upvalues.16}}</span></td> | |
|
94 | <td title='{{module_messages.18}}'><span {%if beam.pk == active_beam %} {{color_status.18}} {%endif%}>{{beam.get_upvalues.17}}</span></td> | |
|
95 | <td title='{{module_messages.19}}'><span {%if beam.pk == active_beam %} {{color_status.19}} {%endif%}>{{beam.get_upvalues.18}}</span></td> | |
|
96 | <td title='{{module_messages.20}}'><span {%if beam.pk == active_beam %} {{color_status.20}} {%endif%}>{{beam.get_upvalues.19}}</span></td> | |
|
97 | 97 | </tr> |
|
98 | 98 | <tr> |
|
99 |
<td {%if beam.pk == active_beam %} {{color_status.17}} {%endif%} |
|
|
100 |
<td {%if beam.pk == active_beam %} {{color_status.18}} {%endif%} |
|
|
101 |
<td {%if beam.pk == active_beam %} {{color_status.19}} {%endif%} |
|
|
102 |
<td {%if beam.pk == active_beam %} {{color_status.20}} {%endif%} |
|
|
99 | <td title='{{module_messages.17}}'><span {%if beam.pk == active_beam %} {{color_status.17}} {%endif%}>{{beam.get_downvalues.16}}</span></td> | |
|
100 | <td title='{{module_messages.18}}'><span {%if beam.pk == active_beam %} {{color_status.18}} {%endif%}>{{beam.get_downvalues.17}}</span></td> | |
|
101 | <td title='{{module_messages.19}}'><span {%if beam.pk == active_beam %} {{color_status.19}} {%endif%}>{{beam.get_downvalues.18}}</span></td> | |
|
102 | <td title='{{module_messages.20}}'><span {%if beam.pk == active_beam %} {{color_status.20}} {%endif%}>{{beam.get_downvalues.19}}</span></td> | |
|
103 | 103 | </tr> |
|
104 | 104 | <tr> |
|
105 |
<td {%if beam.pk == active_beam %} {{color_status.25}} {%endif%} |
|
|
106 |
<td {%if beam.pk == active_beam %} {{color_status.26}} {%endif%} |
|
|
107 |
<td {%if beam.pk == active_beam %} {{color_status.27}} {%endif%} |
|
|
108 |
<td {%if beam.pk == active_beam %} {{color_status.28}} {%endif%} |
|
|
105 | <td title='{{module_messages.25}}'><span {%if beam.pk == active_beam %} {{color_status.25}} {%endif%}>{{beam.get_upvalues.24}}</span></td> | |
|
106 | <td title='{{module_messages.26}}'><span {%if beam.pk == active_beam %} {{color_status.26}} {%endif%}>{{beam.get_upvalues.25}}</span></td> | |
|
107 | <td title='{{module_messages.27}}'><span {%if beam.pk == active_beam %} {{color_status.27}} {%endif%}>{{beam.get_upvalues.26}}</span></td> | |
|
108 | <td title='{{module_messages.28}}'><span {%if beam.pk == active_beam %} {{color_status.28}} {%endif%}>{{beam.get_upvalues.27}}</span></td> | |
|
109 | 109 | </tr> |
|
110 | 110 | <tr> |
|
111 |
<td {%if beam.pk == active_beam %} {{color_status.25}} {%endif%} |
|
|
112 |
<td {%if beam.pk == active_beam %} {{color_status.26}} {%endif%} |
|
|
113 |
<td {%if beam.pk == active_beam %} {{color_status.27}} {%endif%} |
|
|
114 |
<td {%if beam.pk == active_beam %} {{color_status.28}} {%endif%} |
|
|
111 | <td title='{{module_messages.25}}'><span {%if beam.pk == active_beam %} {{color_status.25}} {%endif%}>{{beam.get_downvalues.24}}</span></td> | |
|
112 | <td title='{{module_messages.26}}'><span {%if beam.pk == active_beam %} {{color_status.26}} {%endif%}>{{beam.get_downvalues.25}}</span></td> | |
|
113 | <td title='{{module_messages.27}}'><span {%if beam.pk == active_beam %} {{color_status.27}} {%endif%}>{{beam.get_downvalues.26}}</span></td> | |
|
114 | <td title='{{module_messages.28}}'><span {%if beam.pk == active_beam %} {{color_status.28}} {%endif%}>{{beam.get_downvalues.27}}</span></td> | |
|
115 | 115 | </tr> |
|
116 | 116 | </table> |
|
117 | 117 | </td> |
|
118 | 118 | <td> |
|
119 | 119 | <b>East Quarter</b> |
|
120 | 120 | <table class="module"> |
|
121 | 121 | <tr> |
|
122 |
<td {%if beam.pk == active_beam %} {{color_status.5}} |
|
|
123 |
<td {%if beam.pk == active_beam %} {{color_status.6}} |
|
|
124 |
<td {%if beam.pk == active_beam %} {{color_status.7}} |
|
|
125 |
<td {%if beam.pk == active_beam %} {{color_status.8}} |
|
|
122 | <td title='{{module_messages.5}}'> <span {%if beam.pk == active_beam %} {{color_status.5}} {%endif%}>{{beam.get_upvalues.4}}</span></td> | |
|
123 | <td title='{{module_messages.6}}'> <span {%if beam.pk == active_beam %} {{color_status.6}} {%endif%}>{{beam.get_upvalues.5}}</span></td> | |
|
124 | <td title='{{module_messages.7}}'> <span {%if beam.pk == active_beam %} {{color_status.7}} {%endif%}>{{beam.get_upvalues.6}}</span></td> | |
|
125 | <td title='{{module_messages.8}}'> <span {%if beam.pk == active_beam %} {{color_status.8}} {%endif%}>{{beam.get_upvalues.7}}</span></td> | |
|
126 | 126 | </tr> |
|
127 | 127 | <tr> |
|
128 |
<td {%if beam.pk == active_beam %} {{color_status.5}} |
|
|
129 |
<td {%if beam.pk == active_beam %} {{color_status.6}} |
|
|
130 |
<td {%if beam.pk == active_beam %} {{color_status.7}} |
|
|
131 |
<td {%if beam.pk == active_beam %} {{color_status.8}} |
|
|
128 | <td title='{{module_messages.5}}'> <span {%if beam.pk == active_beam %} {{color_status.5}} {%endif%}>{{beam.get_downvalues.4}}</span></td> | |
|
129 | <td title='{{module_messages.6}}'> <span {%if beam.pk == active_beam %} {{color_status.6}} {%endif%}>{{beam.get_downvalues.5}}</span></td> | |
|
130 | <td title='{{module_messages.7}}'> <span {%if beam.pk == active_beam %} {{color_status.7}} {%endif%}>{{beam.get_downvalues.6}}</span></td> | |
|
131 | <td title='{{module_messages.8}}'> <span {%if beam.pk == active_beam %} {{color_status.8}} {%endif%}>{{beam.get_downvalues.7}}</span></td> | |
|
132 | 132 | </tr> |
|
133 | 133 | <tr> |
|
134 |
<td {%if beam.pk == active_beam %} {{color_status.13}} {%endif%} |
|
|
135 |
<td {%if beam.pk == active_beam %} {{color_status.14}} {%endif%} |
|
|
136 |
<td {%if beam.pk == active_beam %} {{color_status.15}} {%endif%} |
|
|
137 |
<td {%if beam.pk == active_beam %} {{color_status.16}} {%endif%} |
|
|
134 | <td title='{{module_messages.13}}'><span {%if beam.pk == active_beam %} {{color_status.13}} {%endif%}>{{beam.get_upvalues.12}}</span></td> | |
|
135 | <td title='{{module_messages.14}}'><span {%if beam.pk == active_beam %} {{color_status.14}} {%endif%}>{{beam.get_upvalues.13}}</span></td> | |
|
136 | <td title='{{module_messages.15}}'><span {%if beam.pk == active_beam %} {{color_status.15}} {%endif%}>{{beam.get_upvalues.14}}</span></td> | |
|
137 | <td title='{{module_messages.16}}'><span {%if beam.pk == active_beam %} {{color_status.16}} {%endif%}>{{beam.get_upvalues.15}}</span></td> | |
|
138 | 138 | </tr> |
|
139 | 139 | <tr> |
|
140 |
<td {%if beam.pk == active_beam %} {{color_status.13}} {%endif%} |
|
|
141 |
<td {%if beam.pk == active_beam %} {{color_status.14}} {%endif%} |
|
|
142 |
<td {%if beam.pk == active_beam %} {{color_status.15}} {%endif%} |
|
|
143 |
<td {%if beam.pk == active_beam %} {{color_status.16}} {%endif%} |
|
|
140 | <td title='{{module_messages.13}}'><span {%if beam.pk == active_beam %} {{color_status.13}} {%endif%}>{{beam.get_downvalues.12}}</span></td> | |
|
141 | <td title='{{module_messages.14}}'><span {%if beam.pk == active_beam %} {{color_status.14}} {%endif%}>{{beam.get_downvalues.13}}</span></td> | |
|
142 | <td title='{{module_messages.15}}'><span {%if beam.pk == active_beam %} {{color_status.15}} {%endif%}>{{beam.get_downvalues.14}}</span></td> | |
|
143 | <td title='{{module_messages.16}}'><span {%if beam.pk == active_beam %} {{color_status.16}} {%endif%}>{{beam.get_downvalues.15}}</span></td> | |
|
144 | 144 | </tr> |
|
145 | 145 | <tr> |
|
146 |
<td {%if beam.pk == active_beam %} {{color_status.21}} {%endif%} |
|
|
147 |
<td {%if beam.pk == active_beam %} {{color_status.22}} {%endif%} |
|
|
148 |
<td {%if beam.pk == active_beam %} {{color_status.23}} {%endif%} |
|
|
149 |
<td {%if beam.pk == active_beam %} {{color_status.24}} {%endif%} |
|
|
146 | <td title='{{module_messages.21}}'><span {%if beam.pk == active_beam %} {{color_status.21}} {%endif%}>{{beam.get_upvalues.20}}</span></td> | |
|
147 | <td title='{{module_messages.22}}'><span {%if beam.pk == active_beam %} {{color_status.22}} {%endif%}>{{beam.get_upvalues.21}}</span></td> | |
|
148 | <td title='{{module_messages.23}}'><span {%if beam.pk == active_beam %} {{color_status.23}} {%endif%}>{{beam.get_upvalues.22}}</span></td> | |
|
149 | <td title='{{module_messages.24}}'><span {%if beam.pk == active_beam %} {{color_status.24}} {%endif%}>{{beam.get_upvalues.23}}</span></td> | |
|
150 | 150 | </tr> |
|
151 | 151 | <tr> |
|
152 |
<td {%if beam.pk == active_beam %} {{color_status.21}} {%endif%} |
|
|
153 |
<td {%if beam.pk == active_beam %} {{color_status.22}} {%endif%} |
|
|
154 |
<td {%if beam.pk == active_beam %} {{color_status.23}} {%endif%} |
|
|
155 |
<td {%if beam.pk == active_beam %} {{color_status.24}} {%endif%} |
|
|
152 | <td title='{{module_messages.21}}'><span {%if beam.pk == active_beam %} {{color_status.21}} {%endif%}>{{beam.get_downvalues.20}}</span></td> | |
|
153 | <td title='{{module_messages.22}}'><span {%if beam.pk == active_beam %} {{color_status.22}} {%endif%}>{{beam.get_downvalues.21}}</span></td> | |
|
154 | <td title='{{module_messages.23}}'><span {%if beam.pk == active_beam %} {{color_status.23}} {%endif%}>{{beam.get_downvalues.22}}</span></td> | |
|
155 | <td title='{{module_messages.24}}'><span {%if beam.pk == active_beam %} {{color_status.24}} {%endif%}>{{beam.get_downvalues.23}}</span></td> | |
|
156 | 156 | </tr> |
|
157 | 157 | <tr> |
|
158 |
<td {%if beam.pk == active_beam %} {{color_status.29}} {%endif%} |
|
|
159 |
<td {%if beam.pk == active_beam %} {{color_status.30}} {%endif%} |
|
|
160 |
<td {%if beam.pk == active_beam %} {{color_status.31}} {%endif%} |
|
|
161 |
<td {%if beam.pk == active_beam %} {{color_status.32}} {%endif%} |
|
|
158 | <td title='{{module_messages.29}}'><span {%if beam.pk == active_beam %} {{color_status.29}} {%endif%}>{{beam.get_upvalues.28}}</span></td> | |
|
159 | <td title='{{module_messages.30}}'><span {%if beam.pk == active_beam %} {{color_status.30}} {%endif%}>{{beam.get_upvalues.29}}</span></td> | |
|
160 | <td title='{{module_messages.31}}'><span {%if beam.pk == active_beam %} {{color_status.31}} {%endif%}>{{beam.get_upvalues.30}}</span></td> | |
|
161 | <td title='{{module_messages.32}}'><span {%if beam.pk == active_beam %} {{color_status.32}} {%endif%}>{{beam.get_upvalues.31}}</span></td> | |
|
162 | 162 | </tr> |
|
163 | 163 | <tr> |
|
164 |
<td {%if beam.pk == active_beam %} {{color_status.29}} {%endif%} |
|
|
165 |
<td {%if beam.pk == active_beam %} {{color_status.30}} {%endif%} |
|
|
166 |
<td {%if beam.pk == active_beam %} {{color_status.31}} {%endif%} |
|
|
167 |
<td {%if beam.pk == active_beam %} {{color_status.32}} {%endif%} |
|
|
164 | <td title='{{module_messages.29}}'><span {%if beam.pk == active_beam %} {{color_status.29}} {%endif%}>{{beam.get_downvalues.28}}</span></td> | |
|
165 | <td title='{{module_messages.30}}'><span {%if beam.pk == active_beam %} {{color_status.30}} {%endif%}>{{beam.get_downvalues.29}}</span></td> | |
|
166 | <td title='{{module_messages.31}}'><span {%if beam.pk == active_beam %} {{color_status.31}} {%endif%}>{{beam.get_downvalues.30}}</span></td> | |
|
167 | <td title='{{module_messages.32}}'><span {%if beam.pk == active_beam %} {{color_status.32}} {%endif%}>{{beam.get_downvalues.31}}</span></td> | |
|
168 | 168 | </tr> |
|
169 | 169 | </table> |
|
170 | 170 | </td> |
|
171 | 171 | </tr> |
|
172 | 172 | <tr> |
|
173 | 173 | <td> |
|
174 | 174 | <b>West Quarter</b> |
|
175 | 175 | <table class="module"> |
|
176 | 176 | <tr> |
|
177 |
<td {%if beam.pk == active_beam %} {{color_status.33}} {%endif%} |
|
|
178 |
<td {%if beam.pk == active_beam %} {{color_status.34}} {%endif%} |
|
|
179 |
<td {%if beam.pk == active_beam %} {{color_status.35}} {%endif%} |
|
|
180 |
<td {%if beam.pk == active_beam %} {{color_status.36}} {%endif%} |
|
|
177 | <td title='{{module_messages.33}}'><span {%if beam.pk == active_beam %} {{color_status.33}} {%endif%}>{{beam.get_upvalues.32}}</span></td> | |
|
178 | <td title='{{module_messages.34}}'><span {%if beam.pk == active_beam %} {{color_status.34}} {%endif%}>{{beam.get_upvalues.33}}</span></td> | |
|
179 | <td title='{{module_messages.35}}'><span {%if beam.pk == active_beam %} {{color_status.35}} {%endif%}>{{beam.get_upvalues.34}}</span></td> | |
|
180 | <td title='{{module_messages.36}}'><span {%if beam.pk == active_beam %} {{color_status.36}} {%endif%}>{{beam.get_upvalues.35}}</span></td> | |
|
181 | 181 | </tr> |
|
182 | 182 | <tr> |
|
183 |
<td {%if beam.pk == active_beam %} {{color_status.33}} {%endif%} |
|
|
184 |
<td {%if beam.pk == active_beam %} {{color_status.34}} {%endif%} |
|
|
185 |
<td {%if beam.pk == active_beam %} {{color_status.35}} {%endif%} |
|
|
186 |
<td {%if beam.pk == active_beam %} {{color_status.36}} {%endif%} |
|
|
183 | <td title='{{module_messages.33}}'><span {%if beam.pk == active_beam %} {{color_status.33}} {%endif%}>{{beam.get_downvalues.32}}</span></td> | |
|
184 | <td title='{{module_messages.34}}'><span {%if beam.pk == active_beam %} {{color_status.34}} {%endif%}>{{beam.get_downvalues.33}}</span></td> | |
|
185 | <td title='{{module_messages.35}}'><span {%if beam.pk == active_beam %} {{color_status.35}} {%endif%}>{{beam.get_downvalues.34}}</span></td> | |
|
186 | <td title='{{module_messages.36}}'><span {%if beam.pk == active_beam %} {{color_status.36}} {%endif%}>{{beam.get_downvalues.35}}</span></td> | |
|
187 | 187 | </tr> |
|
188 | 188 | <tr> |
|
189 |
<td {%if beam.pk == active_beam %} {{color_status.41}} {%endif%} |
|
|
190 |
<td {%if beam.pk == active_beam %} {{color_status.42}} {%endif%} |
|
|
191 |
<td {%if beam.pk == active_beam %} {{color_status.43}} {%endif%} |
|
|
192 |
<td {%if beam.pk == active_beam %} {{color_status.44}} {%endif%} |
|
|
189 | <td title='{{module_messages.41}}'><span {%if beam.pk == active_beam %} {{color_status.41}} {%endif%}>{{beam.get_upvalues.40}}</span></td> | |
|
190 | <td title='{{module_messages.42}}'><span {%if beam.pk == active_beam %} {{color_status.42}} {%endif%}>{{beam.get_upvalues.41}}</span></td> | |
|
191 | <td title='{{module_messages.43}}'><span {%if beam.pk == active_beam %} {{color_status.43}} {%endif%}>{{beam.get_upvalues.42}}</span></td> | |
|
192 | <td title='{{module_messages.44}}'><span {%if beam.pk == active_beam %} {{color_status.44}} {%endif%}>{{beam.get_upvalues.43}}</span></td> | |
|
193 | 193 | </tr> |
|
194 | 194 | <tr> |
|
195 |
<td {%if beam.pk == active_beam %} {{color_status.41}} {%endif%} |
|
|
196 |
<td {%if beam.pk == active_beam %} {{color_status.42}} {%endif%} |
|
|
197 |
<td {%if beam.pk == active_beam %} {{color_status.43}} {%endif%} |
|
|
198 |
<td {%if beam.pk == active_beam %} {{color_status.44}} {%endif%} |
|
|
195 | <td title='{{module_messages.41}}'><span {%if beam.pk == active_beam %} {{color_status.41}} {%endif%}>{{beam.get_downvalues.40}}</span></td> | |
|
196 | <td title='{{module_messages.42}}'><span {%if beam.pk == active_beam %} {{color_status.42}} {%endif%}>{{beam.get_downvalues.41}}</span></td> | |
|
197 | <td title='{{module_messages.43}}'><span {%if beam.pk == active_beam %} {{color_status.43}} {%endif%}>{{beam.get_downvalues.42}}</span></td> | |
|
198 | <td title='{{module_messages.44}}'><span {%if beam.pk == active_beam %} {{color_status.44}} {%endif%}>{{beam.get_downvalues.43}}</span></td> | |
|
199 | 199 | </tr> |
|
200 | 200 | <tr> |
|
201 |
<td {%if beam.pk == active_beam %} {{color_status.49}} {%endif%} |
|
|
202 |
<td {%if beam.pk == active_beam %} {{color_status.50}} {%endif%} |
|
|
203 |
<td {%if beam.pk == active_beam %} {{color_status.51}} {%endif%} |
|
|
204 |
<td {%if beam.pk == active_beam %} {{color_status.52}} {%endif%} |
|
|
201 | <td title='{{module_messages.49}}'><span {%if beam.pk == active_beam %} {{color_status.49}} {%endif%}>{{beam.get_upvalues.48}}</span></td> | |
|
202 | <td title='{{module_messages.51}}'><span {%if beam.pk == active_beam %} {{color_status.50}} {%endif%}>{{beam.get_upvalues.49}}</span></td> | |
|
203 | <td title='{{module_messages.52}}'><span {%if beam.pk == active_beam %} {{color_status.51}} {%endif%}>{{beam.get_upvalues.50}}</span></td> | |
|
204 | <td title='{{module_messages.53}}'><span {%if beam.pk == active_beam %} {{color_status.52}} {%endif%}>{{beam.get_upvalues.51}}</span></td> | |
|
205 | 205 | </tr> |
|
206 | 206 | <tr> |
|
207 |
<td {%if beam.pk == active_beam %} {{color_status.49}} {%endif%} |
|
|
208 |
<td {%if beam.pk == active_beam %} {{color_status.50}} {%endif%} |
|
|
209 |
<td {%if beam.pk == active_beam %} {{color_status.51}} {%endif%} |
|
|
210 |
<td {%if beam.pk == active_beam %} {{color_status.52}} {%endif%} |
|
|
207 | <td title='{{module_messages.49}}'><span {%if beam.pk == active_beam %} {{color_status.49}} {%endif%}>{{beam.get_downvalues.48}}</span></td> | |
|
208 | <td title='{{module_messages.50}}'><span {%if beam.pk == active_beam %} {{color_status.50}} {%endif%}>{{beam.get_downvalues.49}}</span></td> | |
|
209 | <td title='{{module_messages.51}}'><span {%if beam.pk == active_beam %} {{color_status.51}} {%endif%}>{{beam.get_downvalues.50}}</span></td> | |
|
210 | <td title='{{module_messages.52}}'><span {%if beam.pk == active_beam %} {{color_status.52}} {%endif%}>{{beam.get_downvalues.51}}</span></td> | |
|
211 | 211 | </tr> |
|
212 | 212 | <tr> |
|
213 |
<td {%if beam.pk == active_beam %} {{color_status.57}} {%endif%} |
|
|
214 |
<td {%if beam.pk == active_beam %} {{color_status.58}} {%endif%} |
|
|
215 |
<td {%if beam.pk == active_beam %} {{color_status.59}} {%endif%} |
|
|
216 |
<td {%if beam.pk == active_beam %} {{color_status.60}} {%endif%} |
|
|
213 | <td title='{{module_messages.57}}'><span {%if beam.pk == active_beam %} {{color_status.57}} {%endif%}>{{beam.get_upvalues.56}}</span></td> | |
|
214 | <td title='{{module_messages.58}}'><span {%if beam.pk == active_beam %} {{color_status.58}} {%endif%}>{{beam.get_upvalues.57}}</span></td> | |
|
215 | <td title='{{module_messages.59}}'><span {%if beam.pk == active_beam %} {{color_status.59}} {%endif%}>{{beam.get_upvalues.58}}</span></td> | |
|
216 | <td title='{{module_messages.60}}'><span {%if beam.pk == active_beam %} {{color_status.60}} {%endif%}>{{beam.get_upvalues.59}}</span></td> | |
|
217 | 217 | </tr> |
|
218 | 218 | <tr> |
|
219 |
<td {%if beam.pk == active_beam %} {{color_status.57}} {%endif%} |
|
|
220 |
<td {%if beam.pk == active_beam %} {{color_status.58}} {%endif%} |
|
|
221 |
<td {%if beam.pk == active_beam %} {{color_status.59}} {%endif%} |
|
|
222 |
<td {%if beam.pk == active_beam %} {{color_status.60}} {%endif%} |
|
|
219 | <td title='{{module_messages.57}}'><span {%if beam.pk == active_beam %} {{color_status.57}} {%endif%}>{{beam.get_downvalues.56}}</span></td> | |
|
220 | <td title='{{module_messages.58}}'><span {%if beam.pk == active_beam %} {{color_status.58}} {%endif%}>{{beam.get_downvalues.57}}</span></td> | |
|
221 | <td title='{{module_messages.59}}'><span {%if beam.pk == active_beam %} {{color_status.59}} {%endif%}>{{beam.get_downvalues.58}}</span></td> | |
|
222 | <td title='{{module_messages.60}}'><span {%if beam.pk == active_beam %} {{color_status.60}} {%endif%}>{{beam.get_downvalues.59}}</span></td> | |
|
223 | 223 | </tr> |
|
224 | 224 | </table> |
|
225 | 225 | </td> |
|
226 | 226 | <td> |
|
227 | 227 | <b>South Quarter</b> |
|
228 | 228 | <table class="module"> |
|
229 | 229 | <tr> |
|
230 |
<td {%if beam.pk == active_beam %} {{color_status.37}} {%endif%} |
|
|
231 |
<td {%if beam.pk == active_beam %} {{color_status.38}} {%endif%} |
|
|
232 |
<td {%if beam.pk == active_beam %} {{color_status.39}} {%endif%} |
|
|
233 |
<td {%if beam.pk == active_beam %} {{color_status.40}} {%endif%} |
|
|
230 | <td title='{{module_messages.37}}'><span {%if beam.pk == active_beam %} {{color_status.37}} {%endif%}>{{beam.get_upvalues.36}}</span></td> | |
|
231 | <td title='{{module_messages.38}}'><span {%if beam.pk == active_beam %} {{color_status.38}} {%endif%}>{{beam.get_upvalues.37}}</span></td> | |
|
232 | <td title='{{module_messages.39}}'><span {%if beam.pk == active_beam %} {{color_status.39}} {%endif%}>{{beam.get_upvalues.38}}</span></td> | |
|
233 | <td title='{{module_messages.40}}'><span {%if beam.pk == active_beam %} {{color_status.40}} {%endif%}>{{beam.get_upvalues.39}}</span></td> | |
|
234 | 234 | </tr> |
|
235 | 235 | <tr> |
|
236 |
<td {%if beam.pk == active_beam %} {{color_status.37}} {%endif%} |
|
|
237 |
<td {%if beam.pk == active_beam %} {{color_status.38}} {%endif%} |
|
|
238 |
<td {%if beam.pk == active_beam %} {{color_status.39}} {%endif%} |
|
|
239 |
<td {%if beam.pk == active_beam %} {{color_status.40}} {%endif%} |
|
|
236 | <td title='{{module_messages.37}}'><span {%if beam.pk == active_beam %} {{color_status.37}} {%endif%}>{{beam.get_downvalues.36}}</span></td> | |
|
237 | <td title='{{module_messages.38}}'><span {%if beam.pk == active_beam %} {{color_status.38}} {%endif%}>{{beam.get_downvalues.37}}</span></td> | |
|
238 | <td title='{{module_messages.39}}'><span {%if beam.pk == active_beam %} {{color_status.39}} {%endif%}>{{beam.get_downvalues.38}}</span></td> | |
|
239 | <td title='{{module_messages.40}}'><span {%if beam.pk == active_beam %} {{color_status.40}} {%endif%}>{{beam.get_downvalues.39}}</span></td> | |
|
240 | 240 | </tr> |
|
241 | 241 | <tr> |
|
242 |
<td {%if beam.pk == active_beam %} {{color_status.45}} {%endif%} |
|
|
243 |
<td {%if beam.pk == active_beam %} {{color_status.46}} {%endif%} |
|
|
244 |
<td {%if beam.pk == active_beam %} {{color_status.47}} {%endif%} |
|
|
245 |
<td {%if beam.pk == active_beam %} {{color_status.48}} {%endif%} |
|
|
242 | <td title='{{module_messages.45}}'><span {%if beam.pk == active_beam %} {{color_status.45}} {%endif%}>{{beam.get_upvalues.44}}</span></td> | |
|
243 | <td title='{{module_messages.46}}'><span {%if beam.pk == active_beam %} {{color_status.46}} {%endif%}>{{beam.get_upvalues.45}}</span></td> | |
|
244 | <td title='{{module_messages.47}}'><span {%if beam.pk == active_beam %} {{color_status.47}} {%endif%}>{{beam.get_upvalues.46}}</span></td> | |
|
245 | <td title='{{module_messages.48}}'><span {%if beam.pk == active_beam %} {{color_status.48}} {%endif%}>{{beam.get_upvalues.47}}</span></td> | |
|
246 | 246 | </tr> |
|
247 | 247 | <tr> |
|
248 |
<td {%if beam.pk == active_beam %} {{color_status.45}} {%endif%} |
|
|
249 |
<td {%if beam.pk == active_beam %} {{color_status.46}} {%endif%} |
|
|
250 |
<td {%if beam.pk == active_beam %} {{color_status.47}} {%endif%} |
|
|
251 |
<td {%if beam.pk == active_beam %} {{color_status.48}} {%endif%} |
|
|
248 | <td title='{{module_messages.45}}'><span {%if beam.pk == active_beam %} {{color_status.45}} {%endif%}>{{beam.get_downvalues.44}}</span></td> | |
|
249 | <td title='{{module_messages.46}}'><span {%if beam.pk == active_beam %} {{color_status.46}} {%endif%}>{{beam.get_downvalues.45}}</span></td> | |
|
250 | <td title='{{module_messages.47}}'><span {%if beam.pk == active_beam %} {{color_status.47}} {%endif%}>{{beam.get_downvalues.46}}</span></td> | |
|
251 | <td title='{{module_messages.48}}'><span {%if beam.pk == active_beam %} {{color_status.48}} {%endif%}>{{beam.get_downvalues.47}}</span></td> | |
|
252 | 252 | </tr> |
|
253 | 253 | <tr> |
|
254 |
<td {%if beam.pk == active_beam %} {{color_status.53}} {%endif%} |
|
|
255 |
<td {%if beam.pk == active_beam %} {{color_status.54}} {%endif%} |
|
|
256 |
<td {%if beam.pk == active_beam %} {{color_status.55}} {%endif%} |
|
|
257 |
<td {%if beam.pk == active_beam %} {{color_status.56}} {%endif%} |
|
|
254 | <td title='{{module_messages.53}}'><span {%if beam.pk == active_beam %} {{color_status.53}} {%endif%}>{{beam.get_upvalues.52}}</span></td> | |
|
255 | <td title='{{module_messages.54}}'><span {%if beam.pk == active_beam %} {{color_status.54}} {%endif%}>{{beam.get_upvalues.53}}</span></td> | |
|
256 | <td title='{{module_messages.55}}'><span {%if beam.pk == active_beam %} {{color_status.55}} {%endif%}>{{beam.get_upvalues.54}}</span></td> | |
|
257 | <td title='{{module_messages.56}}'><span {%if beam.pk == active_beam %} {{color_status.56}} {%endif%}>{{beam.get_upvalues.55}}</span></td> | |
|
258 | 258 | </tr> |
|
259 | 259 | <tr> |
|
260 |
<td {%if beam.pk == active_beam %} {{color_status.53}} {%endif%} |
|
|
261 |
<td {%if beam.pk == active_beam %} {{color_status.54}} {%endif%} |
|
|
262 |
<td {%if beam.pk == active_beam %} {{color_status.55}} {%endif%} |
|
|
263 |
<td {%if beam.pk == active_beam %} {{color_status.56}} {%endif%} |
|
|
260 | <td title='{{module_messages.53}}'><span {%if beam.pk == active_beam %} {{color_status.53}} {%endif%}>{{beam.get_downvalues.52}}</span></td> | |
|
261 | <td title='{{module_messages.54}}'><span {%if beam.pk == active_beam %} {{color_status.54}} {%endif%}>{{beam.get_downvalues.53}}</span></td> | |
|
262 | <td title='{{module_messages.55}}'><span {%if beam.pk == active_beam %} {{color_status.55}} {%endif%}>{{beam.get_downvalues.54}}</span></td> | |
|
263 | <td title='{{module_messages.56}}'><span {%if beam.pk == active_beam %} {{color_status.56}} {%endif%}>{{beam.get_downvalues.55}}</span></td> | |
|
264 | 264 | </tr> |
|
265 | 265 | <tr> |
|
266 |
<td {%if beam.pk == active_beam %} {{color_status.61}} {%endif%} |
|
|
267 |
<td {%if beam.pk == active_beam %} {{color_status.62}} {%endif%} |
|
|
268 |
<td {%if beam.pk == active_beam %} {{color_status.63}} {%endif%} |
|
|
269 |
<td {%if beam.pk == active_beam %} {{color_status.64}} {%endif%} |
|
|
266 | <td title='{{module_messages.61}}'><span {%if beam.pk == active_beam %} {{color_status.61}} {%endif%}>{{beam.get_upvalues.60}}</span></td> | |
|
267 | <td title='{{module_messages.62}}'><span {%if beam.pk == active_beam %} {{color_status.62}} {%endif%}>{{beam.get_upvalues.61}}</span></td> | |
|
268 | <td title='{{module_messages.63}}'><span {%if beam.pk == active_beam %} {{color_status.63}} {%endif%}>{{beam.get_upvalues.62}}</span></td> | |
|
269 | <td title='{{module_messages.64}}'><span {%if beam.pk == active_beam %} {{color_status.64}} {%endif%}>{{beam.get_upvalues.63}}</span></td> | |
|
270 | 270 | </tr> |
|
271 | 271 | <tr> |
|
272 |
<td {%if beam.pk == active_beam %} {{color_status.61}} {%endif%} |
|
|
273 |
<td {%if beam.pk == active_beam %} {{color_status.62}} {%endif%} |
|
|
274 |
<td {%if beam.pk == active_beam %} {{color_status.63}} {%endif%} |
|
|
275 |
<td {%if beam.pk == active_beam %} {{color_status.64}} {%endif%} |
|
|
272 | <td title='{{module_messages.61}}'><span {%if beam.pk == active_beam %} {{color_status.61}} {%endif%}>{{beam.get_downvalues.60}}</span></td> | |
|
273 | <td title='{{module_messages.62}}'><span {%if beam.pk == active_beam %} {{color_status.62}} {%endif%}>{{beam.get_downvalues.61}}</span></td> | |
|
274 | <td title='{{module_messages.63}}'><span {%if beam.pk == active_beam %} {{color_status.63}} {%endif%}>{{beam.get_downvalues.62}}</span></td> | |
|
275 | <td title='{{module_messages.64}}'><span {%if beam.pk == active_beam %} {{color_status.64}} {%endif%}>{{beam.get_downvalues.63}}</span></td> | |
|
276 | 276 | </tr> |
|
277 | 277 | </table> |
|
278 | 278 | </td> |
|
279 | 279 | </tr> |
|
280 | 280 | </table> |
|
281 | 281 | |
|
282 | 282 | {% if beam.id == active_beam %} |
|
283 | 283 | <table class="legend"> |
|
284 | 284 | <tr> |
|
285 | 285 | <th colspan="2">Legend</th> |
|
286 | 286 | </tr> |
|
287 | 287 | <tr> |
|
288 | 288 | <td class="text-danger"> |
|
289 | 289 | <i>RED</i> |
|
290 | 290 | </td> |
|
291 | 291 | <td>Disconnected</td> |
|
292 | 292 | </tr> |
|
293 | 293 | <tr> |
|
294 | 294 | <td class="text-warning"> |
|
295 | 295 | <i>ORANGE</i> |
|
296 | 296 | </td> |
|
297 | 297 | <td>Connected</td> |
|
298 | 298 | </tr> |
|
299 | 299 | <tr> |
|
300 | 300 | <td class="text-success"> |
|
301 | 301 | <i>GREEN</i> |
|
302 | 302 | </td> |
|
303 | 303 | <td>Running |
|
304 | 304 | </td> |
|
305 | 305 | </tr> |
|
306 | 306 | </table> |
|
307 | 307 | {% else %} |
|
308 | 308 | <div style="vertical-align: top; display:inline-block;"> |
|
309 | 309 | <button id="send_beam{{forloop.counter}}" type="button" class="btn btn-default"> |
|
310 | 310 | <span class="glyphicon glyphicon-export" aria-hidden="true"></span> |
|
311 | 311 | Change Beam</button> |
|
312 | 312 | </div> |
|
313 | 313 | {% endif %} |
|
314 | 314 | </div> |
|
315 | 315 | {% endfor %} |
|
316 | 316 | </div> |
|
317 | 317 | </div> |
|
318 | 318 | |
|
319 | 319 | |
|
320 | 320 | {% else %} |
|
321 | 321 | <p style="color:#b4bcc2; margin-left: 5%;"> |
|
322 | 322 | <i>No Beams...</i> |
|
323 | 323 | </p> |
|
324 | 324 | {% endif %} {% endblock extra-content %} {% block extra-js%} |
|
325 | 325 | <script> |
|
326 | 326 | $(document).ready(function () { |
|
327 | 327 | |
|
328 | 328 | {% for beam in beams %} |
|
329 | 329 | |
|
330 | 330 | {% if dev_conf.operation_mode == 1 %} |
|
331 | 331 | $("#send_beam{{forloop.counter}}").prop('disabled', true) |
|
332 | 332 | {% else %} |
|
333 | 333 | $("#send_beam{{forloop.counter}}").click(function () { |
|
334 | 334 | document.location = "{% url 'url_send_beam' dev_conf.id beam.id %}"; |
|
335 | 335 | }); |
|
336 | 336 | {% endif %} |
|
337 | 337 | |
|
338 | 338 | {% endfor %} |
|
339 | 339 | |
|
340 | 340 | |
|
341 | 341 | }); |
|
342 | 342 | </script> {% endblock %} No newline at end of file |
@@ -1,389 +1,389 | |||
|
1 | 1 | import json |
|
2 | 2 | import requests |
|
3 | 3 | |
|
4 | 4 | from django.db import models |
|
5 | 5 | from django.core.validators import MinValueValidator, MaxValueValidator |
|
6 | 6 | from django.core.urlresolvers import reverse |
|
7 | 7 | |
|
8 | 8 | from apps.main.models import Configuration |
|
9 | 9 | from apps.main.utils import Params |
|
10 | 10 | from .utils import create_jarsfiles |
|
11 | 11 | |
|
12 | 12 | # Create your models here. |
|
13 | 13 | |
|
14 | 14 | EXPERIMENT_TYPE = ( |
|
15 | 15 | (0, 'RAW_DATA'), |
|
16 | 16 | (1, 'PDATA'), |
|
17 | 17 | ) |
|
18 | 18 | |
|
19 | 19 | DATA_TYPE = ( |
|
20 | 20 | (0, 'SHORT'), |
|
21 | 21 | (1, 'FLOAT'), |
|
22 | 22 | ) |
|
23 | 23 | |
|
24 | 24 | DECODE_TYPE = ( |
|
25 | 25 | (0, 'None'), |
|
26 | 26 | (1, 'TimeDomain'), |
|
27 | 27 | (2, 'FreqDomain'), |
|
28 | 28 | (3, 'InvFreqDomain'), |
|
29 | 29 | ) |
|
30 | 30 | |
|
31 | 31 | FILTER = '{"id":1, "clock": 60, "multiplier": 5, "frequency": 49.92, "f_decimal": 721554506, "fir": 2, "cic_2": 12, "cic_5": 25}' |
|
32 | 32 | |
|
33 | 33 | class JARSFilter(models.Model): |
|
34 | 34 | |
|
35 | 35 | JARS_NBITS = 32 |
|
36 | 36 | |
|
37 | 37 | name = models.CharField(verbose_name='Name', max_length=60, unique=True, default='') |
|
38 | 38 | clock = models.FloatField(verbose_name='Clock In (MHz)', validators=[ |
|
39 | 39 | MinValueValidator(5), MaxValueValidator(75)], null=True, default=60) |
|
40 | 40 | multiplier = models.PositiveIntegerField(verbose_name='Multiplier', validators=[ |
|
41 | 41 | MinValueValidator(1), MaxValueValidator(20)], default=5) |
|
42 | 42 | frequency = models.FloatField(verbose_name='Frequency (MHz)', validators=[ |
|
43 | 43 | MaxValueValidator(150)], null=True, default=49.9200) |
|
44 | 44 | f_decimal = models.BigIntegerField(verbose_name='Frequency (Decimal)', validators=[ |
|
45 | 45 | MinValueValidator(-9223372036854775808), MaxValueValidator(2**JARS_NBITS-1)], null=True, default=721554505) |
|
46 | 46 | cic_2 = models.PositiveIntegerField(verbose_name='CIC2', validators=[ |
|
47 | 47 | MinValueValidator(2), MaxValueValidator(100)], default=10) |
|
48 | 48 | scale_cic_2 = models.PositiveIntegerField(verbose_name='Scale CIC2', validators=[ |
|
49 | 49 | MinValueValidator(0), MaxValueValidator(6)], default=1) |
|
50 | 50 | cic_5 = models.PositiveIntegerField(verbose_name='CIC5', validators=[ |
|
51 | 51 | MinValueValidator(1), MaxValueValidator(100)], default=1) |
|
52 | 52 | scale_cic_5 = models.PositiveIntegerField(verbose_name='Scale CIC5', validators=[ |
|
53 | 53 | MinValueValidator(0), MaxValueValidator(20)], default=5) |
|
54 | 54 | fir = models.PositiveIntegerField(verbose_name='FIR', validators=[ |
|
55 | 55 | MinValueValidator(1), MaxValueValidator(100)], default=6) |
|
56 | 56 | scale_fir = models.PositiveIntegerField(verbose_name='Scale FIR', validators=[ |
|
57 | 57 | MinValueValidator(0), MaxValueValidator(7)], default=3) |
|
58 | 58 | number_taps = models.PositiveIntegerField(verbose_name='Number of taps', validators=[ |
|
59 | 59 | MinValueValidator(1), MaxValueValidator(256)], default=4) |
|
60 |
taps = models.CharField(verbose_name='Taps', max_length= |
|
|
60 | taps = models.CharField(verbose_name='Taps', max_length=1600, default='0') | |
|
61 | 61 | |
|
62 | 62 | class Meta: |
|
63 | 63 | db_table = 'jars_filters' |
|
64 | 64 | |
|
65 | 65 | def __unicode__(self): |
|
66 | 66 | return u'%s' % (self.name) |
|
67 | 67 | |
|
68 | 68 | def jsonify(self): |
|
69 | 69 | |
|
70 | 70 | data = {} |
|
71 | 71 | ignored = () |
|
72 | 72 | |
|
73 | 73 | for field in self._meta.fields: |
|
74 | 74 | if field.name in ignored: |
|
75 | 75 | continue |
|
76 | 76 | data[field.name] = field.value_from_object(self) |
|
77 | 77 | |
|
78 | 78 | return data |
|
79 | 79 | |
|
80 | 80 | def parms_to_dict(self): |
|
81 | 81 | |
|
82 | 82 | parameters = {} |
|
83 | 83 | |
|
84 | 84 | parameters['name'] = self.name |
|
85 | 85 | parameters['clock'] = float(self.clock) |
|
86 | 86 | parameters['multiplier'] = int(self.multiplier) |
|
87 | 87 | parameters['frequency'] = float(self.frequency) |
|
88 | 88 | parameters['f_decimal'] = int(self.frequency) |
|
89 | 89 | parameters['fir'] = int(self.fir) |
|
90 | 90 | parameters['cic_2'] = int(self.cic_2) |
|
91 | 91 | parameters['cic_5'] = int(self.cic_5) |
|
92 | 92 | |
|
93 | 93 | return parameters |
|
94 | 94 | |
|
95 | 95 | def dict_to_parms(self, parameters): |
|
96 | 96 | |
|
97 | 97 | self.name = parameters['name'] |
|
98 | 98 | self.clock = parameters['clock'] |
|
99 | 99 | self.multiplier = parameters['multiplier'] |
|
100 | 100 | self.frequency = parameters['frequency'] |
|
101 | 101 | self.f_decimal = parameters['f_decimal'] |
|
102 | 102 | self.fir = parameters['fir'] |
|
103 | 103 | self.cic_2 = parameters['cic_2'] |
|
104 | 104 | self.cic_5 = parameters['cic_5'] |
|
105 | 105 | |
|
106 | 106 | |
|
107 | 107 | class JARSConfiguration(Configuration): |
|
108 | 108 | |
|
109 | 109 | ADC_RESOLUTION = 8 |
|
110 | 110 | PCI_DIO_BUSWIDTH = 32 |
|
111 | 111 | HEADER_VERSION = 1103 |
|
112 | 112 | BEGIN_ON_START = True |
|
113 | 113 | REFRESH_RATE = 1 |
|
114 | 114 | |
|
115 | 115 | exp_type = models.PositiveIntegerField( |
|
116 | 116 | verbose_name='Experiment Type', choices=EXPERIMENT_TYPE, default=0) |
|
117 | 117 | cards_number = models.PositiveIntegerField(verbose_name='Number of Cards', validators=[ |
|
118 | 118 | MinValueValidator(1), MaxValueValidator(4)], default=1) |
|
119 | 119 | channels_number = models.PositiveIntegerField(verbose_name='Number of Channels', validators=[ |
|
120 | 120 | MinValueValidator(1), MaxValueValidator(8)], default=5) |
|
121 | 121 | channels = models.CharField( |
|
122 | 122 | verbose_name='Channels', max_length=15, default='1,2,3,4,5') |
|
123 | 123 | data_type = models.PositiveIntegerField( |
|
124 | 124 | verbose_name='Data Type', choices=DATA_TYPE, default=0) |
|
125 | 125 | raw_data_blocks = models.PositiveIntegerField( |
|
126 | 126 | verbose_name='Raw Data Blocks', validators=[MaxValueValidator(5000)], default=60) |
|
127 | 127 | profiles_block = models.PositiveIntegerField( |
|
128 | 128 | verbose_name='Profiles Per Block', default=400) |
|
129 | 129 | acq_profiles = models.PositiveIntegerField( |
|
130 | 130 | verbose_name='Acquired Profiles', default=400) |
|
131 | 131 | ftp_interval = models.PositiveIntegerField( |
|
132 | 132 | verbose_name='FTP Interval', default=60) |
|
133 | 133 | fftpoints = models.PositiveIntegerField( |
|
134 | 134 | verbose_name='FFT Points', default=16) |
|
135 | 135 | cohe_integr_str = models.PositiveIntegerField( |
|
136 | 136 | verbose_name='Coh. Int. Stride', validators=[MinValueValidator(1)], default=30) |
|
137 | 137 | cohe_integr = models.PositiveIntegerField( |
|
138 | 138 | verbose_name='Coherent Integrations', validators=[MinValueValidator(1)], default=30) |
|
139 | 139 | incohe_integr = models.PositiveIntegerField( |
|
140 | 140 | verbose_name='Incoherent Integrations', validators=[MinValueValidator(1)], default=30) |
|
141 | 141 | decode_data = models.PositiveIntegerField( |
|
142 | 142 | verbose_name='Decode Data', choices=DECODE_TYPE, default=0) |
|
143 | 143 | post_coh_int = models.BooleanField( |
|
144 | 144 | verbose_name='Post Coherent Integration', default=False) |
|
145 | 145 | spectral_number = models.PositiveIntegerField( |
|
146 | 146 | verbose_name='# Spectral Combinations', validators=[MinValueValidator(1)], default=1) |
|
147 | 147 | spectral = models.CharField( |
|
148 | 148 | verbose_name='Combinations', max_length=5000, default='[0, 0],') |
|
149 | 149 | create_directory = models.BooleanField( |
|
150 | 150 | verbose_name='Create Directory Per Day', default=True) |
|
151 | 151 | include_expname = models.BooleanField( |
|
152 | 152 | verbose_name='Experiment Name in Directory', default=False) |
|
153 | 153 | #view_raw_data = models.BooleanField(verbose_name='View Raw Data', default=True) |
|
154 | 154 | save_ch_dc = models.BooleanField( |
|
155 | 155 | verbose_name='Save Channels DC', default=True) |
|
156 | 156 | save_data = models.BooleanField(verbose_name='Save Data', default=True) |
|
157 | 157 | filter_parms = models.CharField( |
|
158 | 158 | max_length=10000, default=FILTER) |
|
159 | 159 | filter = models.ForeignKey( |
|
160 | 160 | 'JARSFilter', verbose_name='Filter', null=True, blank=True, on_delete=models.CASCADE) |
|
161 | 161 | |
|
162 | 162 | class Meta: |
|
163 | 163 | db_table = 'jars_configurations' |
|
164 | 164 | |
|
165 | 165 | def filter_resolution(self): |
|
166 | 166 | filter_parms = json.loads(self.filter_parms) |
|
167 | 167 | clock = float(filter_parms['clock']) |
|
168 | 168 | cic_2 = filter_parms['cic_2'] |
|
169 | 169 | cic_5 = filter_parms['cic_5'] |
|
170 | 170 | fir = filter_parms['fir'] |
|
171 | 171 | resolution = round((clock/(cic_2*cic_5*fir)), 2) |
|
172 | 172 | return resolution |
|
173 | 173 | |
|
174 | 174 | def dict_to_parms(self, params, id=None): |
|
175 | 175 | |
|
176 | 176 | if id is not None: |
|
177 | 177 | data = Params(params).get_conf(id_conf=id) |
|
178 | 178 | else: |
|
179 | 179 | data = Params(params).get_conf(dtype='jars') |
|
180 | 180 | data['filter_parms'] = params['filter_parms'] |
|
181 | 181 | |
|
182 | 182 | # self.name = data['name'] |
|
183 | 183 | self.exp_type = data['exp_type'] |
|
184 | 184 | #----PDATA---- |
|
185 | 185 | if self.exp_type == 1: |
|
186 | 186 | self.incohe_integr = data['incohe_integr'] |
|
187 | 187 | self.spectral_number = data['spectral_number'] |
|
188 | 188 | self.spectral = data['spectral'] |
|
189 | 189 | self.fftpoints = data['fftpoints'] |
|
190 | 190 | self.save_ch_dc = data['save_ch_dc'] |
|
191 | 191 | else: |
|
192 | 192 | self.raw_data_blocks = data['raw_data_blocks'] |
|
193 | 193 | #----PDATA---- |
|
194 | 194 | self.cards_number = data['cards_number'] |
|
195 | 195 | self.channels_number = data['channels_number'] |
|
196 | 196 | self.channels = data['channels'] |
|
197 | 197 | self.data_type = data['data_type'] |
|
198 | 198 | self.profiles_block = data['profiles_block'] |
|
199 | 199 | self.acq_profiles = data['acq_profiles'] |
|
200 | 200 | self.ftp_interval = data['ftp_interval'] |
|
201 | 201 | self.cohe_integr_str = data['cohe_integr_str'] |
|
202 | 202 | self.cohe_integr = data['cohe_integr'] |
|
203 | 203 | #----DECODE---- |
|
204 | 204 | self.decode_data = data['decode_data'] |
|
205 | 205 | self.post_coh_int = data['post_coh_int'] |
|
206 | 206 | #----DECODE---- |
|
207 | 207 | self.create_directory = data['create_directory'] |
|
208 | 208 | self.include_expname = data['include_expname'] |
|
209 | 209 | self.save_data = data['save_data'] |
|
210 | 210 | self.filter_parms = json.dumps(data['filter_parms']) |
|
211 | 211 | |
|
212 | 212 | self.save() |
|
213 | 213 | |
|
214 | 214 | def parms_to_text(self, file_format='jars'): |
|
215 | 215 | |
|
216 | 216 | data = self.experiment.parms_to_dict() |
|
217 | 217 | |
|
218 | 218 | for key in data['configurations']['allIds']: |
|
219 | 219 | if data['configurations']['byId'][key]['device_type'] in ('dds', 'cgs'): |
|
220 | 220 | data['configurations']['allIds'].remove(key) |
|
221 | 221 | data['configurations']['byId'].pop(key) |
|
222 | 222 | elif data['configurations']['byId'][key]['device_type'] == 'jars': |
|
223 | 223 | data['configurations']['byId'][key] = self.parms_to_dict( |
|
224 | 224 | )['configurations']['byId'][str(self.pk)] |
|
225 | 225 | elif data['configurations']['byId'][key]['device_type'] == 'rc': |
|
226 | 226 | data['configurations']['byId'][key]['pulses'] = '' |
|
227 | 227 | data['configurations']['byId'][key]['delays'] = '' |
|
228 | 228 | rc_ids = [pk for pk in data['configurations']['allIds'] |
|
229 | 229 | if data['configurations']['byId'][pk]['device_type'] == 'rc'] |
|
230 | 230 | mix_ids = [pk for pk in rc_ids if data['configurations'] |
|
231 | 231 | ['byId'][pk]['mix']] |
|
232 | 232 | |
|
233 | 233 | if mix_ids: |
|
234 | 234 | params = data['configurations']['byId'][mix_ids[0]]['parameters'] |
|
235 | 235 | rc = data['configurations']['byId'][params.split( |
|
236 | 236 | '-')[0].split('|')[0]] |
|
237 | 237 | rc['mix'] = True |
|
238 | 238 | data['configurations']['byId'][rc['id']] = rc |
|
239 | 239 | elif len(rc_ids) == 0: |
|
240 | 240 | self.message = 'File needs RC configuration' |
|
241 | 241 | return '' |
|
242 | 242 | |
|
243 | 243 | json_data = json.dumps(data) |
|
244 | 244 | racp_file, filter_file = create_jarsfiles(json_data) |
|
245 | 245 | if file_format == 'racp': |
|
246 | 246 | return racp_file |
|
247 | 247 | |
|
248 | 248 | return filter_file |
|
249 | 249 | |
|
250 | 250 | def request(self, cmd, method='get', **kwargs): |
|
251 | 251 | |
|
252 | 252 | req = getattr(requests, method)(self.device.url(cmd), **kwargs) |
|
253 | 253 | payload = req.json() |
|
254 | 254 | return payload |
|
255 | 255 | |
|
256 | 256 | def status_device(self): |
|
257 | 257 | |
|
258 | 258 | try: |
|
259 | 259 | payload = self.request('status', |
|
260 | 260 | params={'name': self.experiment.name}) |
|
261 | 261 | self.device.status = payload['status'] |
|
262 | 262 | self.device.save() |
|
263 | 263 | self.message = payload['message'] |
|
264 | 264 | except Exception as e: |
|
265 | 265 | self.device.status = 0 |
|
266 | 266 | self.message = str(e) |
|
267 | 267 | self.device.save() |
|
268 | 268 | return False |
|
269 | 269 | |
|
270 | 270 | return True |
|
271 | 271 | |
|
272 | 272 | def stop_device(self): |
|
273 | 273 | |
|
274 | 274 | try: |
|
275 | 275 | payload = self.request('stop', 'post') |
|
276 | 276 | self.device.status = payload['status'] |
|
277 | 277 | self.device.save() |
|
278 | 278 | self.message = payload['message'] |
|
279 | 279 | except Exception as e: |
|
280 | 280 | self.device.status = 0 |
|
281 | 281 | self.message = str(e) |
|
282 | 282 | self.device.save() |
|
283 | 283 | return False |
|
284 | 284 | |
|
285 | 285 | return True |
|
286 | 286 | |
|
287 | 287 | def read_device(self): |
|
288 | 288 | |
|
289 | 289 | try: |
|
290 | 290 | payload = self.request( |
|
291 | 291 | 'read', params={'name': self.experiment.name}) |
|
292 | 292 | self.message = 'Configuration loaded' |
|
293 | 293 | except: |
|
294 | 294 | self.device.status = 0 |
|
295 | 295 | self.device.save() |
|
296 | 296 | self.message = 'Could not read JARS configuration.' |
|
297 | 297 | return False |
|
298 | 298 | |
|
299 | 299 | return payload |
|
300 | 300 | |
|
301 | 301 | def write_device(self): |
|
302 | 302 | |
|
303 | 303 | if self.device.status == 3: |
|
304 | 304 | self.message = 'Could not configure device. Software Acquisition is running' |
|
305 | 305 | return False |
|
306 | 306 | |
|
307 | 307 | data = self.experiment.parms_to_dict() |
|
308 | 308 | |
|
309 | 309 | for key in data['configurations']['allIds']: |
|
310 | 310 | if data['configurations']['byId'][key]['device_type'] in ('dds', 'cgs'): |
|
311 | 311 | data['configurations']['allIds'].remove(key) |
|
312 | 312 | data['configurations']['byId'].pop(key) |
|
313 | 313 | elif data['configurations']['byId'][key]['device_type'] == 'rc': |
|
314 | 314 | data['configurations']['byId'][key]['pulses'] = '' |
|
315 | 315 | data['configurations']['byId'][key]['delays'] = '' |
|
316 | 316 | rc_ids = [pk for pk in data['configurations']['allIds'] |
|
317 | 317 | if data['configurations']['byId'][pk]['device_type'] == 'rc'] |
|
318 | 318 | if len(rc_ids) == 0: |
|
319 | 319 | self.message = 'Missing RC configuration' |
|
320 | 320 | return False |
|
321 | 321 | |
|
322 | 322 | json_data = json.dumps(data) |
|
323 | 323 | |
|
324 | 324 | try: |
|
325 | 325 | payload = self.request('write', 'post', json=json_data) |
|
326 | 326 | self.device.status = payload['status'] |
|
327 | 327 | self.message = payload['message'] |
|
328 | 328 | self.device.save() |
|
329 | 329 | if self.device.status == 1: |
|
330 | 330 | return False |
|
331 | 331 | |
|
332 | 332 | except Exception as e: |
|
333 | 333 | self.device.status = 0 |
|
334 | 334 | self.message = str(e) |
|
335 | 335 | self.device.save() |
|
336 | 336 | return False |
|
337 | 337 | |
|
338 | 338 | return True |
|
339 | 339 | |
|
340 | 340 | def start_device(self): |
|
341 | 341 | |
|
342 | 342 | try: |
|
343 | 343 | payload = self.request('start', 'post', |
|
344 | 344 | json={'name': self.experiment.name}) |
|
345 | 345 | self.device.status = payload['status'] |
|
346 | 346 | self.message = payload['message'] |
|
347 | 347 | self.device.save() |
|
348 | 348 | if self.device.status == 1: |
|
349 | 349 | return False |
|
350 | 350 | |
|
351 | 351 | except Exception as e: |
|
352 | 352 | self.device.status = 0 |
|
353 | 353 | self.message = str(e) |
|
354 | 354 | self.device.save() |
|
355 | 355 | return False |
|
356 | 356 | |
|
357 | 357 | return True |
|
358 | 358 | |
|
359 | 359 | def get_log(self): |
|
360 | 360 | |
|
361 | 361 | payload = None |
|
362 | 362 | |
|
363 | 363 | try: |
|
364 | 364 | payload = requests.get(self.device.url('get_log'), params={ |
|
365 | 365 | 'name': self.experiment.name}) |
|
366 | 366 | except: |
|
367 | 367 | self.device.status = 0 |
|
368 | 368 | self.device.save() |
|
369 | 369 | self.message = 'Jars API is not running.' |
|
370 | 370 | return False |
|
371 | 371 | |
|
372 | 372 | self.message = 'Jars API is running' |
|
373 | 373 | |
|
374 | 374 | return payload |
|
375 | 375 | |
|
376 | 376 | def update_from_file(self, filename): |
|
377 | 377 | |
|
378 | 378 | f = JARSFile(filename) |
|
379 | 379 | self.dict_to_parms(f.data) |
|
380 | 380 | self.save() |
|
381 | 381 | |
|
382 | 382 | def get_absolute_url_import(self): |
|
383 | 383 | return reverse('url_import_jars_conf', args=[str(self.id)]) |
|
384 | 384 | |
|
385 | 385 | def get_absolute_url_read(self): |
|
386 | 386 | return reverse('url_read_jars_conf', args=[str(self.id)]) |
|
387 | 387 | |
|
388 | 388 | def get_absolute_url_log(self): |
|
389 | 389 | return reverse('url_get_jars_log', args=[str(self.id)]) |
General Comments 0
You need to be logged in to leave comments.
Login now