1 | <%@ page import="com.ether.Controller" %> |
---|
2 | <%@ page import="com.ether.IsotopeG03" %> |
---|
3 | <%@ page import="com.ether.IsotopeIasiG03" %> |
---|
4 | <%@ page import="com.ether.IsotopeG09" %> |
---|
5 | <%@ page import="com.ether.IsotopeIasiG09" %> |
---|
6 | |
---|
7 | <script type="text/javascript"> |
---|
8 | |
---|
9 | |
---|
10 | |
---|
11 | var InterfaceInit = Class.create( { |
---|
12 | |
---|
13 | initialize: function() |
---|
14 | { |
---|
15 | |
---|
16 | /** *********** CONTAINERS *********** **/ |
---|
17 | this.containerFormSpectralRangeLower = $( "#spectralRangeLower" ); |
---|
18 | this.containerFormSpectralRangeUpper = $( "#spectralRangeUpper" ); |
---|
19 | this.containerFormIntensityLower = $( "#intensityLower" ); |
---|
20 | this.containerFormIntensityUpper = $( "#intensityUpper" ); |
---|
21 | this.containerFormMeanValue1 = $( "#meanValue1" ); |
---|
22 | this.containerDownload = $( "#downloadContainer" ); |
---|
23 | this.containerLoading = $( "#loading" ); |
---|
24 | this.containerTabs = $("#tabs"); |
---|
25 | |
---|
26 | /** *********** VARIABLE *********** **/ |
---|
27 | //on va chercher les chemin déclaré dans le controller |
---|
28 | this.pathProcess = "<%=Controller.PATH_PROCESS%>"; |
---|
29 | this.LongPathImages = "<%=Controller.LONG_PATH_IMAGES%>"; |
---|
30 | |
---|
31 | <%--this.pathImg = <%=Controller.PATH_IMAGES%>;--%> |
---|
32 | |
---|
33 | this.initializeMolecules(); |
---|
34 | this.createForm(); |
---|
35 | |
---|
36 | var downloadButton = new Button( {value:"Download", parent:$( "#downloadContainer" ), id:"button_submit_2", className: "red_button", classNameText:"red_button_text", onClick:jQuery.proxy( this.onClickDownload, this )} ); |
---|
37 | |
---|
38 | //onglet |
---|
39 | this.ntabComparison = new Tab( {value:"Databases comparison", parent:this.containerTabs, numTab: 1, id:"tab_Comparison", className: "tab_class", onClick:jQuery.proxy( this.onClickDatabasesComparison, this )} ); |
---|
40 | this.ntabGlobal = new Tab( {value:"Global representation", parent:this.containerTabs, numTab: 1, id:"tab_Global", className: "tab_class", onClick:jQuery.proxy( this.onClickGlobalRepresentation, this )} ); |
---|
41 | this.ntabContents = new Tab( {value:"Database contents", parent:this.containerTabs, numTab: 1, id:"tab_Contents", className: "tab_class", onClick:jQuery.proxy( this.onClickDatabaseContents, this )} ); |
---|
42 | //onglet avec la couleur active par défaut |
---|
43 | this.ntabContents.active(); |
---|
44 | }, |
---|
45 | |
---|
46 | initializeMolecules: function() |
---|
47 | { |
---|
48 | this.arrayGeisa2011 = new Array(); |
---|
49 | this.arrayGeisa2003 = new Array(); |
---|
50 | this.arrayGeisaIasi2011 = new Array(); |
---|
51 | this.arrayGeisaIasi2003 = new Array(); |
---|
52 | |
---|
53 | var molecule = new Object(); |
---|
54 | molecule.id="h2o"; |
---|
55 | molecule.name="H<sub>2</sub>O"; |
---|
56 | molecule.isotopesArray = ["161", "162", "171", "181", "182", "172"]; |
---|
57 | this.arrayGeisa2011.push(molecule); |
---|
58 | this.arrayGeisa2003.push(molecule); |
---|
59 | this.arrayGeisaIasi2011.push(molecule); |
---|
60 | this.arrayGeisaIasi2003.push(molecule); |
---|
61 | |
---|
62 | var molecule = new Object(); |
---|
63 | molecule.id="co2"; |
---|
64 | molecule.name="CO<sub>2</sub>"; |
---|
65 | molecule.isotopesArray = ["626", "627", "628", "636", "637", "638", "728", "828", "838"]; |
---|
66 | this.arrayGeisa2003.push(molecule); |
---|
67 | this.arrayGeisa2011.push(molecule); |
---|
68 | this.arrayGeisaIasi2011.push(molecule); |
---|
69 | this.arrayGeisaIasi2003.push(molecule); |
---|
70 | |
---|
71 | var molecule = new Object(); |
---|
72 | molecule.id="o3"; |
---|
73 | molecule.name="O<sub>3</sub>"; |
---|
74 | molecule.isotopesArray = ["666", "668", "686", "667", "676"]; |
---|
75 | this.arrayGeisa2003.push(molecule); |
---|
76 | this.arrayGeisa2011.push(molecule); |
---|
77 | this.arrayGeisaIasi2011.push(molecule); |
---|
78 | this.arrayGeisaIasi2003.push(molecule); |
---|
79 | |
---|
80 | var molecule = new Object(); |
---|
81 | molecule.id="n2o"; |
---|
82 | molecule.name="N<sub>2</sub>O"; |
---|
83 | molecule.isotopesArray = ["446", "447", "448", "456","458", "546", "548", "556"]; |
---|
84 | this.arrayGeisa2011.push(molecule); |
---|
85 | this.arrayGeisaIasi2011.push(molecule); |
---|
86 | |
---|
87 | var molecule = new Object(); |
---|
88 | molecule.id="n2o"; |
---|
89 | molecule.name="N<sub>2</sub>O"; |
---|
90 | molecule.isotopesArray = ["446", "447", "448", "456", "546"]; |
---|
91 | this.arrayGeisa2003.push(molecule); |
---|
92 | this.arrayGeisaIasi2003.push(molecule); |
---|
93 | |
---|
94 | var molecule = new Object(); |
---|
95 | molecule.id="co"; |
---|
96 | molecule.name="CO"; |
---|
97 | molecule.isotopesArray = ["26", "36", "28", "27", "38", "37"]; |
---|
98 | this.arrayGeisa2011.push(molecule); |
---|
99 | this.arrayGeisa2003.push(molecule); |
---|
100 | this.arrayGeisaIasi2011.push(molecule); |
---|
101 | this.arrayGeisaIasi2003.push(molecule); |
---|
102 | |
---|
103 | var molecule = new Object(); |
---|
104 | molecule.id="ch4"; |
---|
105 | molecule.name="CH<sub>4</sub>"; |
---|
106 | molecule.isotopesArray = ["211", "311"]; |
---|
107 | this.arrayGeisa2011.push(molecule); |
---|
108 | this.arrayGeisa2003.push(molecule); |
---|
109 | |
---|
110 | var molecule = new Object(); |
---|
111 | molecule.id="ch4"; |
---|
112 | molecule.name="CH<sub>4</sub>"; |
---|
113 | molecule.isotopesArray = ["211", "311", "212", "312"]; |
---|
114 | this.arrayGeisaIasi2011.push(molecule); |
---|
115 | |
---|
116 | var molecule = new Object(); |
---|
117 | molecule.id="ch4"; |
---|
118 | molecule.name="CH<sub>4</sub>"; |
---|
119 | molecule.isotopesArray = ["211", "311", "212"]; |
---|
120 | this.arrayGeisaIasi2003.push(molecule); |
---|
121 | |
---|
122 | var molecule = new Object(); |
---|
123 | molecule.id="o2"; |
---|
124 | molecule.name="O<sub>2</sub>"; |
---|
125 | molecule.isotopesArray = ["66", "67", "68"]; |
---|
126 | this.arrayGeisa2011.push(molecule); |
---|
127 | this.arrayGeisa2003.push(molecule); |
---|
128 | |
---|
129 | var molecule = new Object(); |
---|
130 | molecule.id="o2"; |
---|
131 | molecule.name="O<sub>2</sub>"; |
---|
132 | molecule.isotopesArray = ["66"]; |
---|
133 | this.arrayGeisaIasi2011.push(molecule); |
---|
134 | this.arrayGeisaIasi2003.push(molecule); |
---|
135 | |
---|
136 | var molecule = new Object(); |
---|
137 | molecule.id="no"; |
---|
138 | molecule.name="NO"; |
---|
139 | molecule.isotopesArray = ["46", "48", "56"]; |
---|
140 | this.arrayGeisa2011.push(molecule); |
---|
141 | this.arrayGeisa2003.push(molecule); |
---|
142 | this.arrayGeisaIasi2011.push(molecule); |
---|
143 | this.arrayGeisaIasi2003.push(molecule); |
---|
144 | |
---|
145 | var molecule = new Object(); |
---|
146 | molecule.id="so2"; |
---|
147 | molecule.name="SO<sub>2</sub>"; |
---|
148 | molecule.isotopesArray = ["626", "646"]; |
---|
149 | this.arrayGeisa2011.push(molecule); |
---|
150 | this.arrayGeisa2003.push(molecule); |
---|
151 | this.arrayGeisaIasi2011.push(molecule); |
---|
152 | this.arrayGeisaIasi2003.push(molecule); |
---|
153 | |
---|
154 | var molecule = new Object(); |
---|
155 | molecule.id="no2"; |
---|
156 | molecule.name="NO<sub>2</sub>"; |
---|
157 | molecule.isotopesArray = ["646"]; |
---|
158 | this.arrayGeisa2011.push(molecule); |
---|
159 | this.arrayGeisa2003.push(molecule); |
---|
160 | this.arrayGeisaIasi2011.push(molecule); |
---|
161 | this.arrayGeisaIasi2003.push(molecule); |
---|
162 | |
---|
163 | var molecule = new Object(); |
---|
164 | molecule.id="nh3"; |
---|
165 | molecule.name="NH<sub>3</sub>"; |
---|
166 | molecule.isotopesArray = ["411", "511" ]; |
---|
167 | this.arrayGeisa2011.push(molecule); |
---|
168 | this.arrayGeisa2003.push(molecule); |
---|
169 | this.arrayGeisaIasi2011.push(molecule); |
---|
170 | |
---|
171 | var molecule = new Object(); |
---|
172 | molecule.id="ph3"; |
---|
173 | molecule.name="PH<sub>3</sub>"; |
---|
174 | molecule.isotopesArray = ["131" ]; |
---|
175 | this.arrayGeisa2011.push(molecule); |
---|
176 | this.arrayGeisa2003.push(molecule); |
---|
177 | |
---|
178 | var molecule = new Object(); |
---|
179 | molecule.id="hno3"; |
---|
180 | molecule.name="HNO<sub>3</sub>"; |
---|
181 | molecule.isotopesArray = ["146" ]; |
---|
182 | this.arrayGeisa2011.push(molecule); |
---|
183 | this.arrayGeisa2003.push(molecule); |
---|
184 | this.arrayGeisaIasi2011.push(molecule); |
---|
185 | this.arrayGeisaIasi2003.push(molecule); |
---|
186 | |
---|
187 | var molecule = new Object(); |
---|
188 | molecule.id="oh"; |
---|
189 | molecule.name="OH"; |
---|
190 | molecule.isotopesArray = ["61", "62", "81" ]; |
---|
191 | this.arrayGeisa2011.push(molecule); |
---|
192 | this.arrayGeisa2003.push(molecule); |
---|
193 | |
---|
194 | var molecule = new Object(); |
---|
195 | molecule.id="hf"; |
---|
196 | molecule.name="HF"; |
---|
197 | molecule.isotopesArray = ["19" ]; |
---|
198 | this.arrayGeisa2011.push(molecule); |
---|
199 | this.arrayGeisa2003.push(molecule); |
---|
200 | |
---|
201 | var molecule = new Object(); |
---|
202 | molecule.id="hcl"; |
---|
203 | molecule.name="HCL"; |
---|
204 | molecule.isotopesArray = ["15", "17" ]; |
---|
205 | this.arrayGeisa2011.push(molecule); |
---|
206 | this.arrayGeisa2003.push(molecule); |
---|
207 | |
---|
208 | var molecule = new Object(); |
---|
209 | molecule.id="hbr"; |
---|
210 | molecule.name="HBR"; |
---|
211 | molecule.isotopesArray = ["11", "19" ]; |
---|
212 | this.arrayGeisa2011.push(molecule); |
---|
213 | this.arrayGeisa2003.push(molecule); |
---|
214 | |
---|
215 | var molecule = new Object(); |
---|
216 | molecule.id="hi"; |
---|
217 | molecule.name="HI"; |
---|
218 | molecule.isotopesArray = ["17" ]; |
---|
219 | this.arrayGeisa2011.push(molecule); |
---|
220 | this.arrayGeisa2003.push(molecule); |
---|
221 | |
---|
222 | var molecule = new Object(); |
---|
223 | molecule.id="clo"; |
---|
224 | molecule.name="ClO"; |
---|
225 | molecule.isotopesArray = ["56", "76" ]; |
---|
226 | this.arrayGeisa2011.push(molecule); |
---|
227 | this.arrayGeisa2003.push(molecule); |
---|
228 | |
---|
229 | var molecule = new Object(); |
---|
230 | molecule.id="ocs"; |
---|
231 | molecule.name="OCS"; |
---|
232 | molecule.isotopesArray = ["622", "624", "632", "623", "822", "634"]; |
---|
233 | this.arrayGeisa2011.push(molecule); |
---|
234 | this.arrayGeisa2003.push(molecule); |
---|
235 | this.arrayGeisaIasi2011.push(molecule); |
---|
236 | this.arrayGeisaIasi2003.push(molecule); |
---|
237 | |
---|
238 | var molecule = new Object(); |
---|
239 | molecule.id="h2co"; |
---|
240 | molecule.name="H<sub>2</sub>CO"; |
---|
241 | molecule.isotopesArray = ["126", "128", "136"]; |
---|
242 | this.arrayGeisa2011.push(molecule); |
---|
243 | this.arrayGeisa2003.push(molecule); |
---|
244 | |
---|
245 | var molecule = new Object(); |
---|
246 | molecule.id="h2co"; |
---|
247 | molecule.name="H<sub>2</sub>CO"; |
---|
248 | molecule.isotopesArray = ["126"]; |
---|
249 | this.arrayGeisaIasi2011.push(molecule); |
---|
250 | |
---|
251 | var molecule = new Object(); |
---|
252 | molecule.id="c2h6"; |
---|
253 | molecule.name="C<sub>2</sub>H<sub>6</sub>"; |
---|
254 | molecule.isotopesArray = ["226", "236"]; |
---|
255 | this.arrayGeisa2011.push(molecule); |
---|
256 | this.arrayGeisa2003.push(molecule); |
---|
257 | |
---|
258 | var molecule = new Object(); |
---|
259 | molecule.id="ch3d"; |
---|
260 | molecule.name="CH<sub>3</sub>D"; |
---|
261 | molecule.isotopesArray = ["212", "312"]; |
---|
262 | this.arrayGeisa2011.push(molecule); |
---|
263 | |
---|
264 | var molecule = new Object(); |
---|
265 | molecule.id="ch3d"; |
---|
266 | molecule.name="CH<sub>3</sub>D"; |
---|
267 | molecule.isotopesArray = ["212"]; |
---|
268 | this.arrayGeisa2003.push(molecule); |
---|
269 | |
---|
270 | var molecule = new Object(); |
---|
271 | molecule.id="c2h2"; |
---|
272 | molecule.name="C<sub>2</sub>H<sub>2</sub>"; |
---|
273 | molecule.isotopesArray = ["221", "231"]; |
---|
274 | this.arrayGeisa2011.push(molecule); |
---|
275 | this.arrayGeisa2003.push(molecule); |
---|
276 | this.arrayGeisaIasi2011.push(molecule); |
---|
277 | this.arrayGeisaIasi2003.push(molecule); |
---|
278 | |
---|
279 | var molecule = new Object(); |
---|
280 | molecule.id="c2h4"; |
---|
281 | molecule.name="C<sub>2</sub>H<sub>4</sub>"; |
---|
282 | molecule.isotopesArray = ["211", "311"]; |
---|
283 | this.arrayGeisa2011.push(molecule); |
---|
284 | this.arrayGeisa2003.push(molecule); |
---|
285 | this.arrayGeisaIasi2011.push(molecule); |
---|
286 | |
---|
287 | var molecule = new Object(); |
---|
288 | molecule.id="geh4"; |
---|
289 | molecule.name="GeH<sub>4</sub>"; |
---|
290 | molecule.isotopesArray = ["411"]; |
---|
291 | this.arrayGeisa2011.push(molecule); |
---|
292 | this.arrayGeisa2003.push(molecule); |
---|
293 | |
---|
294 | var molecule = new Object(); |
---|
295 | molecule.id="hcn"; |
---|
296 | molecule.name="HCN"; |
---|
297 | molecule.isotopesArray = ["124", "125", "134", "224"]; |
---|
298 | this.arrayGeisa2011.push(molecule); |
---|
299 | this.arrayGeisaIasi2011.push(molecule); |
---|
300 | |
---|
301 | var molecule = new Object(); |
---|
302 | molecule.id="hcn"; |
---|
303 | molecule.name="HCN"; |
---|
304 | molecule.isotopesArray = ["124", "125", "134"]; |
---|
305 | this.arrayGeisa2003.push(molecule); |
---|
306 | |
---|
307 | var molecule = new Object(); |
---|
308 | molecule.id="c3h8"; |
---|
309 | molecule.name="C<sub>3</sub>H<sub>8</sub>"; |
---|
310 | molecule.isotopesArray = ["221"]; |
---|
311 | this.arrayGeisa2011.push(molecule); |
---|
312 | this.arrayGeisa2003.push(molecule); |
---|
313 | |
---|
314 | var molecule = new Object(); |
---|
315 | molecule.id="c2n2"; |
---|
316 | molecule.name="C<sub>2</sub>N<sub>2</sub>"; |
---|
317 | molecule.isotopesArray = ["224"]; |
---|
318 | this.arrayGeisa2011.push(molecule); |
---|
319 | this.arrayGeisa2003.push(molecule); |
---|
320 | |
---|
321 | var molecule = new Object(); |
---|
322 | molecule.id="c4h2"; |
---|
323 | molecule.name="C<sub>4</sub>H<sub>2</sub>"; |
---|
324 | molecule.isotopesArray = ["211"]; |
---|
325 | this.arrayGeisa2011.push(molecule); |
---|
326 | this.arrayGeisa2003.push(molecule); |
---|
327 | |
---|
328 | var molecule = new Object(); |
---|
329 | molecule.id="hc3n"; |
---|
330 | molecule.name="HC<sub>3</sub>N"; |
---|
331 | molecule.isotopesArray = ["124"]; |
---|
332 | this.arrayGeisa2011.push(molecule); |
---|
333 | this.arrayGeisa2003.push(molecule); |
---|
334 | |
---|
335 | var molecule = new Object(); |
---|
336 | molecule.id="hocl"; |
---|
337 | molecule.name="HOCl"; |
---|
338 | molecule.isotopesArray = ["165", "167"]; |
---|
339 | this.arrayGeisa2011.push(molecule); |
---|
340 | this.arrayGeisa2003.push(molecule); |
---|
341 | |
---|
342 | var molecule = new Object(); |
---|
343 | molecule.id="n2"; |
---|
344 | molecule.name="N<sub>2</sub>"; |
---|
345 | molecule.isotopesArray = ["44"]; |
---|
346 | this.arrayGeisa2011.push(molecule); |
---|
347 | this.arrayGeisa2003.push(molecule); |
---|
348 | this.arrayGeisaIasi2011.push(molecule); |
---|
349 | this.arrayGeisaIasi2003.push(molecule); |
---|
350 | |
---|
351 | var molecule = new Object(); |
---|
352 | molecule.id="ch3cl"; |
---|
353 | molecule.name="CH<sub>3</sub>Cl"; |
---|
354 | molecule.isotopesArray = ["215", "217"]; |
---|
355 | this.arrayGeisa2011.push(molecule); |
---|
356 | this.arrayGeisa2003.push(molecule); |
---|
357 | |
---|
358 | var molecule = new Object(); |
---|
359 | molecule.id="h2o2"; |
---|
360 | molecule.name="H<sub>2</sub>O<sub>2</sub>"; |
---|
361 | molecule.isotopesArray = ["166"]; |
---|
362 | this.arrayGeisa2011.push(molecule); |
---|
363 | this.arrayGeisa2003.push(molecule); |
---|
364 | |
---|
365 | var molecule = new Object(); |
---|
366 | molecule.id="h2s"; |
---|
367 | molecule.name="H<sub>2</sub>S"; |
---|
368 | molecule.isotopesArray = ["121", "141", "131"]; |
---|
369 | this.arrayGeisa2011.push(molecule); |
---|
370 | this.arrayGeisa2003.push(molecule); |
---|
371 | |
---|
372 | var molecule = new Object(); |
---|
373 | molecule.id="hcooh"; |
---|
374 | molecule.name="HCOOH"; |
---|
375 | molecule.isotopesArray = ["261"]; |
---|
376 | this.arrayGeisa2011.push(molecule); |
---|
377 | this.arrayGeisa2003.push(molecule); |
---|
378 | this.arrayGeisaIasi2011.push(molecule); |
---|
379 | |
---|
380 | var molecule = new Object(); |
---|
381 | molecule.id="cof2"; |
---|
382 | molecule.name="COF<sub>2</sub>"; |
---|
383 | molecule.isotopesArray = ["269"]; |
---|
384 | this.arrayGeisa2011.push(molecule); |
---|
385 | this.arrayGeisa2003.push(molecule); |
---|
386 | |
---|
387 | var molecule = new Object(); |
---|
388 | molecule.id="sf6"; |
---|
389 | molecule.name="SF<sub>6</sub>"; |
---|
390 | molecule.isotopesArray = ["29"]; |
---|
391 | this.arrayGeisa2011.push(molecule); |
---|
392 | this.arrayGeisa2003.push(molecule); |
---|
393 | |
---|
394 | var molecule = new Object(); |
---|
395 | molecule.id="c3h4"; |
---|
396 | molecule.name="C<sub>3</sub>H<sub>4</sub>"; |
---|
397 | molecule.isotopesArray = ["341"]; |
---|
398 | this.arrayGeisa2011.push(molecule); |
---|
399 | this.arrayGeisa2003.push(molecule); |
---|
400 | |
---|
401 | var molecule = new Object(); |
---|
402 | molecule.id="ho2"; |
---|
403 | molecule.name="HO<sub>2</sub>"; |
---|
404 | molecule.isotopesArray = ["166"]; |
---|
405 | this.arrayGeisa2011.push(molecule); |
---|
406 | this.arrayGeisa2003.push(molecule); |
---|
407 | |
---|
408 | var molecule = new Object(); |
---|
409 | molecule.id="clono2"; |
---|
410 | molecule.name="ClONO<sub>2</sub>"; |
---|
411 | molecule.isotopesArray = ["564", "764"]; |
---|
412 | this.arrayGeisa2011.push(molecule); |
---|
413 | this.arrayGeisa2003.push(molecule); |
---|
414 | |
---|
415 | var molecule = new Object(); |
---|
416 | molecule.id="ch3br"; |
---|
417 | molecule.name="CH<sub>3</sub>Br"; |
---|
418 | molecule.isotopesArray = ["79", "81"]; |
---|
419 | this.arrayGeisa2011.push(molecule); |
---|
420 | |
---|
421 | var molecule = new Object(); |
---|
422 | molecule.id="ch3oh"; |
---|
423 | molecule.name="CH<sub>3</sub>OH"; |
---|
424 | molecule.isotopesArray = ["216"]; |
---|
425 | this.arrayGeisa2011.push(molecule); |
---|
426 | this.arrayGeisaIasi2011.push(molecule); |
---|
427 | |
---|
428 | var molecule = new Object(); |
---|
429 | molecule.id="noplus"; |
---|
430 | molecule.name="NO<sup>+</sup>"; |
---|
431 | molecule.isotopesArray = ["46"]; |
---|
432 | this.arrayGeisa2011.push(molecule); |
---|
433 | |
---|
434 | var molecule = new Object(); |
---|
435 | molecule.id="hnc"; |
---|
436 | molecule.name="HNC"; |
---|
437 | molecule.isotopesArray = ["142"]; |
---|
438 | this.arrayGeisa2011.push(molecule); |
---|
439 | |
---|
440 | var molecule = new Object(); |
---|
441 | molecule.id="c6h6"; |
---|
442 | molecule.name="C<sub>6</sub>H<sub>6</sub>"; |
---|
443 | molecule.isotopesArray = ["266"]; |
---|
444 | this.arrayGeisa2011.push(molecule); |
---|
445 | |
---|
446 | var molecule = new Object(); |
---|
447 | molecule.id="c2hd"; |
---|
448 | molecule.name="C<sub>2</sub>HD"; |
---|
449 | molecule.isotopesArray = ["122"]; |
---|
450 | this.arrayGeisa2011.push(molecule); |
---|
451 | |
---|
452 | var molecule = new Object(); |
---|
453 | molecule.id="cf4"; |
---|
454 | molecule.name="CF<sub>4</sub>"; |
---|
455 | molecule.isotopesArray = ["291"]; |
---|
456 | this.arrayGeisa2011.push(molecule); |
---|
457 | |
---|
458 | var molecule = new Object(); |
---|
459 | molecule.id="ch3cn"; |
---|
460 | molecule.name="CH<sub>3</sub>CN"; |
---|
461 | molecule.isotopesArray = ["234"]; |
---|
462 | this.arrayGeisa2011.push(molecule); |
---|
463 | |
---|
464 | |
---|
465 | }, |
---|
466 | |
---|
467 | // CREATES ******************************************************** |
---|
468 | createForm: function() |
---|
469 | { |
---|
470 | //Titre de la page |
---|
471 | var titlePage = document.createTextNode("Graphic vizualisation of the GEISA database"); |
---|
472 | document.getElementById("titlePage").appendChild(titlePage); |
---|
473 | |
---|
474 | // Create menu deroulant choix de la base |
---|
475 | var paramDatabase = new Object(); |
---|
476 | paramDatabase.id = "selectDatabase"; |
---|
477 | paramDatabase.parent = $("#database1"); |
---|
478 | this.selectDatabase = new Select( paramDatabase ); |
---|
479 | this.selectDatabase.add( 'GEISA2011', "GEISA 2011", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeG09.class%>' ); |
---|
480 | this.selectDatabase.add( 'GEISAIASI2011', "GEISA-IASI 2011", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeIasiG09.class%>' ); |
---|
481 | this.selectDatabase.add( 'GEISA2003', "GEISA 2003", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeG03.class%>' ); |
---|
482 | this.selectDatabase.add( 'GEISAIASI2003', "GEISA-IASI 2003", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeIasiG03.class%>' ); |
---|
483 | this.selectDatabase.selectFirst( false ); |
---|
484 | var bob = this.selectDatabase.getValues(); |
---|
485 | |
---|
486 | // Create menu deroulant choix de la base2 pour l'onglet "Database comparison" |
---|
487 | var paramDatabase2 = new Object(); |
---|
488 | paramDatabase2.id = "selectDatabase2"; |
---|
489 | paramDatabase2.parent = $("#database2"); |
---|
490 | this.selectDatabase2 = new Select( paramDatabase ); |
---|
491 | this.selectDatabase2.add( 'GEISA2011', "GEISA 2011", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeG09.class%>' ); |
---|
492 | this.selectDatabase2.add( 'GEISA2003', "GEISA 2003", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeG03.class%>' ); |
---|
493 | this.selectDatabase2.selectFirst( false ); |
---|
494 | |
---|
495 | |
---|
496 | |
---|
497 | |
---|
498 | //création du bloc des molécules |
---|
499 | this.createMolecules($('#BDD-GEISA2011'), this.arrayGeisa2011, "GEISA2011"); |
---|
500 | this.createMolecules($('#BDD-GEISA2003'), this.arrayGeisa2003, "GEISA2003"); |
---|
501 | this.createMolecules($('#BDD-GEISAIASI2011'), this.arrayGeisaIasi2011, "GEISAIASI2011"); |
---|
502 | this.createMolecules($('#BDD-GEISAIASI2003'), this.arrayGeisaIasi2003, "GEISAIASI2003"); |
---|
503 | |
---|
504 | //bouton selection-deselection toutes les molécules et isotopes |
---|
505 | this.selectButton = new Button( {value:"Select all molecules", parent:$( "#selectAndShow" ), id:"buttonSelect", className: "gray_button", onClick:jQuery.proxy( this.selectAll, this )} ); |
---|
506 | //bouton montrer-cacher les isotopes |
---|
507 | this.showButton = new Button( {value:"View all isotopologues", parent:$( "#selectAndShow" ), id:"buttonShow", className: "gray_button", onClick:jQuery.proxy( this.viewAll, this )} ); |
---|
508 | |
---|
509 | |
---|
510 | |
---|
511 | //Zone texte SpectralRange |
---|
512 | //Titre général (qui changera en fonction de la base geisa choisie) |
---|
513 | document.getElementById('spectralRangeTitre').innerHTML = ""; |
---|
514 | document.getElementById('spectralRangeTitre').innerHTML = "Choosing the spectral range (0 to 35877.030506 cm<sup>-1</sup>) :"; |
---|
515 | |
---|
516 | //Titre |
---|
517 | document.getElementById("spectralRangeLower").innerHTML = "Lower value, cm<sup>-1</sup> : "; |
---|
518 | document.getElementById("spectralRangeUpper").innerHTML = "Upper value, cm<sup>-1</sup> : "; |
---|
519 | document.getElementById("samplingStep").innerHTML = "<br><a href='#' TITLE='Allows to explore the chosen spectral range by generating a graph every spectral step (in the whole chosen spectral range). The default value is equal to size of the selected spectral range.'><b>?</b></a> Sampling step : "; |
---|
520 | //zone texte SpectralRangeLower |
---|
521 | var inputSpectralRangeLower = $( document.createElement( "input" ) ); |
---|
522 | inputSpectralRangeLower.attr( {id:"rangeLower", class:"styleInputs"} ); |
---|
523 | inputSpectralRangeLower.val(0); |
---|
524 | //pour mettre à jour le menu déroulant des transitions |
---|
525 | inputSpectralRangeLower.bind( 'blur', this, jQuery.proxy( this.requestTransition, this )); |
---|
526 | this.containerFormSpectralRangeLower.append( inputSpectralRangeLower ); |
---|
527 | //zone texte SpectralRangeUpper |
---|
528 | var inputSpectralRangeUpper = $( document.createElement( "input" ) ); |
---|
529 | inputSpectralRangeUpper.attr( {id:"rangeUpper"} ); |
---|
530 | inputSpectralRangeUpper.val(35877.030506); |
---|
531 | //pour mettre à jour le menu déroulant des transitions lorsque l'on change la valeur du spectral range |
---|
532 | inputSpectralRangeUpper.bind( 'blur', this, jQuery.proxy( this.requestTransition, this )); |
---|
533 | this.containerFormSpectralRangeUpper.append( inputSpectralRangeUpper ); |
---|
534 | //zone texte Sampling step |
---|
535 | var inputSamplingStep = $( document.createElement( "input" ) ); |
---|
536 | inputSamplingStep.attr( {id:"sampStep", size:6} ); |
---|
537 | $("#samplingStep").append( inputSamplingStep ); |
---|
538 | |
---|
539 | //Zone texte Intensity |
---|
540 | //Titre |
---|
541 | document.getElementById("intensityLower").innerHTML = "Lower value, cm/mol. : " |
---|
542 | document.getElementById("intensityUpper").innerHTML = "Upper value, cm/mol. : " |
---|
543 | //zone texte IntensityLower |
---|
544 | var inputIntensityLower = $( document.createElement( "input" ) ); |
---|
545 | inputIntensityLower.attr( {id:"intensityLo", class:"styleInputs"} ); |
---|
546 | inputIntensityLower.val(0); |
---|
547 | this.containerFormIntensityLower.append( inputIntensityLower ); |
---|
548 | //zone texte IntensityUpper |
---|
549 | var inputIntensityUpper = $( document.createElement( "input" ) ); |
---|
550 | inputIntensityUpper.attr( {id:"intensityUp"} ); |
---|
551 | inputIntensityUpper.val(1e-16); |
---|
552 | this.containerFormIntensityUpper.append( inputIntensityUpper ); |
---|
553 | |
---|
554 | |
---|
555 | // Create menu deroulant 1er choix axe des y |
---|
556 | //Titre |
---|
557 | var titleAxeY1 = document.createTextNode("Select parameter (left Y-axis)"); |
---|
558 | document.getElementById("axeY1").appendChild(titleAxeY1); |
---|
559 | var spaceBr = document.createElement ("br"); |
---|
560 | document.getElementById("axeY1").appendChild(spaceBr); |
---|
561 | //menu déroulant |
---|
562 | var paramSelectAxeY1 = new Object(); |
---|
563 | paramSelectAxeY1.id = "selectAxeY1"; |
---|
564 | paramSelectAxeY1.parent = $("#axeY1"); |
---|
565 | this.selectTraceAxeY1 = new Select( paramSelectAxeY1 ); |
---|
566 | this.selectTraceAxeY1.add( 'B', "Intensity", jQuery.proxy(this.onClickSelectTraceAxeY1, this )); |
---|
567 | this.selectTraceAxeY1.add( 'C', "Air broadening pressure halfwidth", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) ); |
---|
568 | this.selectTraceAxeY1.add( 'D', "Energy of the lower transition level", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) ); |
---|
569 | this.selectTraceAxeY1.add( 'F', "Temperature of the air broadening halfwidth ", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) ); |
---|
570 | this.selectTraceAxeY1.add( 'N', "Self broadening pressure halfwidth (HWHM)", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) ); |
---|
571 | this.selectTraceAxeY1.add( 'O', "Air pressure shift of the line transition", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) ); |
---|
572 | this.selectTraceAxeY1.add( 'R', "Temperature of the air pressure shift ", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) ); |
---|
573 | this.selectTraceAxeY1.selectFirst( false ); |
---|
574 | |
---|
575 | // Create menu deroulant type de graphe |
---|
576 | //Titre |
---|
577 | var titleTypeTrace = document.createTextNode("Type of graph"); |
---|
578 | document.getElementById("nbCourbes").appendChild(titleTypeTrace); |
---|
579 | var spaceBr = document.createElement ("br"); |
---|
580 | document.getElementById("nbCourbes").appendChild(spaceBr); |
---|
581 | //menu déroulant |
---|
582 | var paramNbCourbes = new Object(); |
---|
583 | paramNbCourbes.id = "selectNbCourbes"; |
---|
584 | paramNbCourbes.parent = $("#nbCourbes"); |
---|
585 | this.selectNbCourbes = new Select( paramNbCourbes ); |
---|
586 | this.selectNbCourbes.add( 'ca', "One curve for all selection", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); |
---|
587 | this.selectNbCourbes.add( 'cm', "Separated molecules : same graph", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); |
---|
588 | this.selectNbCourbes.add( 'gm', "Separated molecules : different graphs", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); |
---|
589 | this.selectNbCourbes.add( 'gi', "Separated isotopologues : different graphs", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); |
---|
590 | this.selectNbCourbes.add( 'ci', "Separated isotopologues : same graph", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); |
---|
591 | this.selectNbCourbes.selectFirst( false ); |
---|
592 | |
---|
593 | // Create menu deroulant type d'échelle linéaire ou logarithmique pour le choix y1 |
---|
594 | //Titre |
---|
595 | var titleScaleY1 = document.createTextNode("Select the type of Scale (if intensity is choosen)"); |
---|
596 | document.getElementById("scaleY1Titre").appendChild(titleScaleY1); |
---|
597 | //menu déroulant |
---|
598 | var paramSelectScaleY1 = new Object(); |
---|
599 | paramSelectScaleY1.id = "selectScaleY1"; |
---|
600 | paramSelectScaleY1.parent = $("#scaleY1"); |
---|
601 | this.selectScaleY1 = new Select( paramSelectScaleY1 ); |
---|
602 | this.selectScaleY1.add( 'l', "Linear" ); |
---|
603 | this.selectScaleY1.add( '-log_scale', "Logarithmic" ); |
---|
604 | this.selectScaleY1.selectFirst( false ); |
---|
605 | |
---|
606 | |
---|
607 | // Create menu deroulant style de tracer Y1 |
---|
608 | //Titre |
---|
609 | var titleTypeTrace = document.createTextNode("Select the type of plot"); |
---|
610 | document.getElementById("typePlotY1").appendChild(titleTypeTrace); |
---|
611 | var spaceBr = document.createElement ("br"); |
---|
612 | document.getElementById("typePlotY1").appendChild(spaceBr); |
---|
613 | //menu déroulant |
---|
614 | var paramSelectTypeTraceY1 = new Object(); |
---|
615 | paramSelectTypeTraceY1.id = "selectTypePlotY1"; |
---|
616 | paramSelectTypeTraceY1.parent = $("#typePlotY1"); |
---|
617 | this.selectTypeTraceY1 = new Select( paramSelectTypeTraceY1 ); |
---|
618 | this.selectTypeTraceY1.add( 'l', "Lines" ); |
---|
619 | this.selectTypeTraceY1.add( 'p', "Dots" ); |
---|
620 | this.selectTypeTraceY1.add( 'i', "Peaks" ); |
---|
621 | this.selectTypeTraceY1.add( 'lp', "Lines and Dots" ); |
---|
622 | this.selectTypeTraceY1.selectFirst( false ); |
---|
623 | |
---|
624 | //menu déroulant tracé de la 2Úme base pour l'onglet "Database comparison" |
---|
625 | var paramSelectTypeTraceDatabase2 = new Object(); |
---|
626 | paramSelectTypeTraceDatabase2.id = "selectTypePlotDatabase2"; |
---|
627 | paramSelectTypeTraceDatabase2.parent = $("#typePlotDatabase2"); |
---|
628 | this.selectTypeTraceDatabase2 = new Select( paramSelectTypeTraceY1 ); |
---|
629 | this.selectTypeTraceDatabase2.add( 'l', "Lines" ); |
---|
630 | this.selectTypeTraceDatabase2.add( 'p', "Dots" ); |
---|
631 | this.selectTypeTraceDatabase2.add( 'i', "Peaks" ); |
---|
632 | this.selectTypeTraceDatabase2.add( 'lp', "Lines and Dots" ); |
---|
633 | this.selectTypeTraceDatabase2.selectFirst( false ); |
---|
634 | |
---|
635 | |
---|
636 | //lien pour montrer ou cacher le bloc "advanced options" |
---|
637 | var showHide = $(document.createElement("a")); |
---|
638 | showHide.html("Show advanced options"); |
---|
639 | showHide.attr( {id:"aShowHide", class:"fieldsetGeneralTitle"} ); |
---|
640 | showHide.bind( 'click', this, jQuery.proxy( this.onClickShowAdvancedOptions)); |
---|
641 | $("#showAdvancedOptions").append(showHide); |
---|
642 | |
---|
643 | |
---|
644 | //titre menu deroulant transition upper |
---|
645 | var titleTransitionUpper = document.createTextNode("Upper state : "); |
---|
646 | document.getElementById("transitionUpper").appendChild(titleTransitionUpper); |
---|
647 | //titre menu deroulant transition upper |
---|
648 | this.selectTransitionUpper = $( document.createElement( "select" ) ); |
---|
649 | this.selectTransitionUpper.attr( {id:"transition1"} ); |
---|
650 | //fonction sur le menu déroulant (des qu'on clique dessus) et non sur chacune des options |
---|
651 | this.selectTransitionUpper.bind( 'click', jQuery.proxy(this.OnclickVerifTransition, this)); |
---|
652 | var optTransitionUpper = $( document.createElement( "option" ) ); |
---|
653 | optTransitionUpper.attr( {value:"-1", text:"Select a molecule"} ); |
---|
654 | this.selectTransitionUpper.append(optTransitionUpper); |
---|
655 | $("#transitionUpper").append(this.selectTransitionUpper); |
---|
656 | |
---|
657 | |
---|
658 | //titre menu deroulant transition lower |
---|
659 | var titleTransitionLower = document.createTextNode("Lower state : "); |
---|
660 | document.getElementById("transitionLower").appendChild(titleTransitionLower); |
---|
661 | // Create menu deroulant transition lower |
---|
662 | this.selectTransitionLower = $( document.createElement( "select" ) ); |
---|
663 | this.selectTransitionLower.attr( {id:"transition2"} ); |
---|
664 | this.selectTransitionLower.bind( 'click', jQuery.proxy(this.OnclickVerifTransition, this)); |
---|
665 | var optTransitionLower = $( document.createElement( "option" ) ); |
---|
666 | optTransitionLower.attr( {value:"-1", text:"Select a molecule"} ); |
---|
667 | this.selectTransitionLower.append(optTransitionLower); |
---|
668 | $("#transitionLower").append(this.selectTransitionLower); |
---|
669 | |
---|
670 | //bouton reset pour les transition |
---|
671 | var resetButton = new Button( {value:"Reset", parent:$( "#transitionReset" ), id:"buttonReset", className: "gray_button", onClick:jQuery.proxy( this.requestTransition, this )} ); |
---|
672 | |
---|
673 | |
---|
674 | //Zone text Mean Value |
---|
675 | //Titre |
---|
676 | var titleMeanValue = document.createTextNode("Bin-average : "); |
---|
677 | document.getElementById("meanValue1").appendChild(titleMeanValue); |
---|
678 | //champ input |
---|
679 | var inputMeanValue = $( document.createElement( "input" ) ); |
---|
680 | inputMeanValue.attr( {id:"meanValue2", size:6} ); |
---|
681 | inputMeanValue.val(0); |
---|
682 | this.containerFormMeanValue1.append( inputMeanValue ); |
---|
683 | inputMeanValue.bind( 'blur', this, jQuery.proxy( this.onBlurInputMeanValue, this )); |
---|
684 | |
---|
685 | |
---|
686 | // Create menu deroulant 2eme choix axe des y |
---|
687 | //Titre |
---|
688 | var titleAxeY2 = document.createTextNode("Select secondary parameter (right Y-axis)"); |
---|
689 | document.getElementById("axeY2Titre").appendChild(titleAxeY2); |
---|
690 | //menu déroulant |
---|
691 | var paramSelectAxeY2 = new Object(); |
---|
692 | paramSelectAxeY2.id = "selectAxeY2"; |
---|
693 | paramSelectAxeY2.parent = $("#axeY2"); |
---|
694 | this.selectTraceAxeY2 = new Select( paramSelectAxeY2 ); |
---|
695 | this.selectTraceAxeY2.add( 'no', "None", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) ); |
---|
696 | this.selectTraceAxeY2.add( 'B', "Intensity", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) ); |
---|
697 | this.selectTraceAxeY2.add( 'C', "Air broadening pressure halfwidth", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) ); |
---|
698 | this.selectTraceAxeY2.add( 'D', "Energy of the lower transition level", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) ); |
---|
699 | this.selectTraceAxeY2.add( 'F', "Temperature of the air broadening halfwidth ", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) ); |
---|
700 | this.selectTraceAxeY2.add( 'N', "Self broadening pressure halfwidth (HWHM)", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) ); |
---|
701 | this.selectTraceAxeY2.add( 'O', "Air pressure shift of the line transition", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) ); |
---|
702 | this.selectTraceAxeY2.add( 'R', "Temperature of the air pressure shift ", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) ); |
---|
703 | this.selectTraceAxeY2.selectFirst( false ); |
---|
704 | |
---|
705 | |
---|
706 | // Create menu deroulant type d'échelle linéaire ou logarithmique pour le choix y2 |
---|
707 | //Titre |
---|
708 | var titleScaleY2 = document.createTextNode("Select the type of Scale (if intensity is choosen)"); |
---|
709 | document.getElementById("scaleY2Titre").appendChild(titleScaleY2); |
---|
710 | //menu déroulant |
---|
711 | var paramSelectScaleY2 = new Object(); |
---|
712 | paramSelectScaleY2.id = "SelectScaleY2"; |
---|
713 | paramSelectScaleY2.parent = $("#scaleY2"); |
---|
714 | this.selectScaleY2 = new Select( paramSelectScaleY2 ); |
---|
715 | this.selectScaleY2.add( 'l', "Linear" ); |
---|
716 | this.selectScaleY2.add( '-log_scale2', "Logarithmic" ); |
---|
717 | this.selectScaleY2.selectFirst( false ); |
---|
718 | //est inactif par defaut car selectTraceAxeY2 est positionne a none par defaut |
---|
719 | document.getElementById("scaleY2Titre").className = "notActiveText"; |
---|
720 | this.selectScaleY2.disable(); |
---|
721 | |
---|
722 | |
---|
723 | // Create menu deroulant style de tracer Y2 |
---|
724 | //Titre |
---|
725 | var titleTypeTrace = document.createTextNode("Select the type of plot"); |
---|
726 | document.getElementById("typePlotY2Titre").appendChild(titleTypeTrace); |
---|
727 | //menu déroulant |
---|
728 | var paramSelectTypeTraceY2 = new Object(); |
---|
729 | paramSelectTypeTraceY2.id = "selectTypePlotY2"; |
---|
730 | paramSelectTypeTraceY2.parent = $("#typePlotY2"); |
---|
731 | this.selectTypeTraceY2 = new Select( paramSelectTypeTraceY2 ); |
---|
732 | this.selectTypeTraceY2.add( 'l', "Lines" ); |
---|
733 | this.selectTypeTraceY2.add( 'p', "Dots" ); |
---|
734 | this.selectTypeTraceY2.add( 'i', "Peaks" ); |
---|
735 | this.selectTypeTraceY2.add( 'lp', "Lines and Dots" ); |
---|
736 | this.selectTypeTraceY2.selectFirst( false ); |
---|
737 | //est inactif par defaut car selectTraceAxeY2 est positionne a none par defaut |
---|
738 | document.getElementById("typePlotY2Titre").className = "notActiveText"; |
---|
739 | this.selectTypeTraceY2.disable(); |
---|
740 | |
---|
741 | // Create menu deroulant choix de la sortie pour l'onglet "Database comparison" |
---|
742 | var paramoutputDatabasecomparison = new Object(); |
---|
743 | paramoutputDatabasecomparison.id = "outputDatabaseComparisonChoice1"; |
---|
744 | paramoutputDatabasecomparison.parent = $("#outputDatabaseComparisonChoice"); |
---|
745 | this.selectOutputDatabasecomparison = new Select( paramoutputDatabasecomparison ); |
---|
746 | this.selectOutputDatabasecomparison.add( 'def', "Default output" ); |
---|
747 | this.selectOutputDatabasecomparison.add( 'diff_step', "différences moyennes" ); |
---|
748 | this.selectOutputDatabasecomparison.add( 'diff_step100', "différences moyennes en pourc" ); |
---|
749 | this.selectOutputDatabasecomparison.add( 'diff_stepboth', "diff moy et diff moy en pourc" ); |
---|
750 | this.selectOutputDatabasecomparison.selectFirst( false ); |
---|
751 | |
---|
752 | |
---|
753 | //création de l'image d'attente |
---|
754 | var param = new Object(); |
---|
755 | param.id = "loadingForGraphics"; |
---|
756 | param.parent = this.containerLoading; |
---|
757 | this.loadingGraphics = new Loading( param ); |
---|
758 | // this.loadingGraphics.display(); |
---|
759 | //this.loadingGraphics.hide(); |
---|
760 | |
---|
761 | |
---|
762 | // var submitButton = new Button( {value:"Submit", parent:$( "#boutonSubmit" ), id:"button_submit_3", className: "red_button", classNameText:"red_button_text", onClick:jQuery.proxy( this.onClickSubmit, this )} ); |
---|
763 | var submitButton = new Button( {value:"Submit", parent:$( "#boutonSubmit" ), id:"button_submit_3", className: "positive", onClick:jQuery.proxy( this.onClickSubmit, this )} ); |
---|
764 | //bouton reset pour toute la page |
---|
765 | var resetPageButton = new Button( {value:"Reset", parent:$( "#boutonSubmit" ), id:"buttonReset", className: "gray_button", onClick:jQuery.proxy( this.resetPage, this )} ); |
---|
766 | |
---|
767 | |
---|
768 | |
---|
769 | }, |
---|
770 | |
---|
771 | |
---|
772 | |
---|
773 | |
---|
774 | /** |
---|
775 | * This method creates the case to check for the moles |
---|
776 | * create cases à cocher pour les molécules |
---|
777 | * @param container |
---|
778 | * @param moleculesArray |
---|
779 | */ |
---|
780 | //createMolecules: function(container, moleculesArray) |
---|
781 | createMolecules: function(container, moleculesArray, BddVersion) |
---|
782 | { |
---|
783 | var table = $(document.createElement("table")); |
---|
784 | container.append(table); |
---|
785 | |
---|
786 | var i=0; |
---|
787 | //nombre de molecules par ligne |
---|
788 | var l=11; |
---|
789 | //taille du tableau |
---|
790 | //alert("l" +moleculesArray.length); |
---|
791 | |
---|
792 | |
---|
793 | $.each(moleculesArray, jQuery.proxy( function(index, moleculeElement ) |
---|
794 | { |
---|
795 | |
---|
796 | |
---|
797 | //this.tr et non var tr pour que tr existe encore à la sortie du if |
---|
798 | if ( index == (i*l)) |
---|
799 | { |
---|
800 | //alert(index); |
---|
801 | this.tr = $(document.createElement("tr")); |
---|
802 | this.tr.attr({valign: "top"}); |
---|
803 | table.append(this.tr); |
---|
804 | i=i+1; |
---|
805 | |
---|
806 | } |
---|
807 | var td = $(document.createElement("td")); |
---|
808 | this.tr.append(td); |
---|
809 | |
---|
810 | var span= $(document.createElement("span")); |
---|
811 | span.addClass("molecule"); |
---|
812 | td.append(span); |
---|
813 | |
---|
814 | var input = $(document.createElement("input")); |
---|
815 | input.attr({type:"checkbox", id:"all-"+moleculeElement.id+"-"+BddVersion}); |
---|
816 | input.bind( 'click', this, jQuery.proxy( this.cliquetout, [this, moleculeElement.id, BddVersion ] )); |
---|
817 | span.append(input); |
---|
818 | |
---|
819 | var a = $(document.createElement("a")); |
---|
820 | a.html("<b>"+moleculeElement.name+"</b>"); |
---|
821 | |
---|
822 | a.bind( 'click', this, jQuery.proxy( this.visibilite, [this,"Cache-"+ moleculeElement.id] )); |
---|
823 | span.append(a); |
---|
824 | |
---|
825 | var div= $(document.createElement("div")); |
---|
826 | div.addClass("divViolet"); |
---|
827 | div.attr({id:"Cache-"+moleculeElement.id, style: "display:none"}); |
---|
828 | td.append(div); |
---|
829 | |
---|
830 | var spanIsotopes= $(document.createElement("span")); |
---|
831 | spanIsotopes.addClass("isotope"); |
---|
832 | spanIsotopes.attr({id:moleculeElement.id+"Isotope"+BddVersion}); |
---|
833 | div.append(spanIsotopes); |
---|
834 | |
---|
835 | |
---|
836 | this.createIsotopes($("#"+moleculeElement.id+"Isotope"+BddVersion), moleculeElement.isotopesArray, moleculeElement.id, BddVersion); |
---|
837 | |
---|
838 | |
---|
839 | }, this) ); |
---|
840 | |
---|
841 | |
---|
842 | }, |
---|
843 | |
---|
844 | createIsotopes: function(container, isotopesArray, moleculeElement, BddVersion ) |
---|
845 | { |
---|
846 | |
---|
847 | |
---|
848 | $.each(isotopesArray, jQuery.proxy( function( index, isotopeElement ) |
---|
849 | { |
---|
850 | container.append(" "); |
---|
851 | var inputIsotopes = $(document.createElement("input")); |
---|
852 | inputIsotopes.attr({type:"checkbox", id:"chk-"+moleculeElement+"_"+isotopeElement+"-"+BddVersion, name:"moles", value:moleculeElement+"_"+isotopeElement}); |
---|
853 | inputIsotopes.bind( 'click', this, jQuery.proxy( this.cliqueIsotope, [this, moleculeElement+"_"+isotopeElement, moleculeElement, BddVersion ] )); |
---|
854 | container.append(inputIsotopes); |
---|
855 | container.append(isotopeElement); |
---|
856 | var br = $(document.createElement("br")); |
---|
857 | container.append(br); |
---|
858 | |
---|
859 | }, this) ); |
---|
860 | }, |
---|
861 | |
---|
862 | // <table><tr><td> |
---|
863 | // <span class="molecule"><input type=checkbox id=all-ch3cn-GEISA2011 onclick="cliquetout('this, ch3cn, GEISA2011');"> |
---|
864 | // <a href="javascript:visibilite('this, Cache-ch3cn');"><B>CH<sub>3</sub>CN</a></B> |
---|
865 | // </span> |
---|
866 | // <div class="divViolet" id="Cache-ch3cn" style="display:none;"> |
---|
867 | // <span class="isotope" id="ch3cnIsotopeGEISA2011"> <input type=checkbox id=chk-ch3cn_234-GEISA2011 name=moles value=ch3cn_234 onclick="cliqueIsotope('this, ch3cn_234, GEISA2011');">234<br></span> |
---|
868 | // </div> |
---|
869 | // </td></tr></table> |
---|
870 | |
---|
871 | // REQUESTS ******************************************************** |
---|
872 | //récupération de toutes les valeurs choisies par l'utilisateur et transformation de ces valeurs pour les inclure dans la requête fortran |
---|
873 | requestGeisa: function() |
---|
874 | { |
---|
875 | //temps en ms pour obtenir un nom unique de répertoire |
---|
876 | var dateTime = new Date().getTime(); |
---|
877 | this.NomRepFileOut = "graph"+dateTime+"/"; |
---|
878 | |
---|
879 | |
---|
880 | // appel ajax |
---|
881 | |
---|
882 | //sélection du fichier binaire de la base geisa sélectionnée |
---|
883 | var paramBase = ""; |
---|
884 | switch (this.selectDatabase.getValue()) { |
---|
885 | case 'GEISA2003': |
---|
886 | paramBase = " -dirin "+this.pathProcess+" -dirout "+this.LongPathImages+this.NomRepFileOut+" -filein "+this.pathProcess+"line_GEISA2003_asc_gs03_v1.0 -input_format asc -database_name GEISA2003 -database_type gs03 -type_out png"; |
---|
887 | break; |
---|
888 | case 'GEISA2011': |
---|
889 | paramBase = " -dirin "+this.pathProcess+" -dirout "+this.LongPathImages+this.NomRepFileOut+" -filein "+this.pathProcess+"line_GEISA2009_bin -database_name GEISA2011 -database_type gs08 -type_out png"; |
---|
890 | break; |
---|
891 | case 'GEISAIASI2003': |
---|
892 | paramBase = " -dirin "+this.pathProcess+" -dirout "+this.LongPathImages+this.NomRepFileOut+" -filein "+this.pathProcess+"line_GEISAIASI2003_asc_gsi03_v1.0 -input_format asc -database_name GEISAIASI2003 -database_type gsi03 -type_out png"; |
---|
893 | break; |
---|
894 | case 'GEISAIASI2011': |
---|
895 | paramBase = " -dirin "+this.pathProcess+" -dirout "+this.LongPathImages+this.NomRepFileOut+" -filein "+this.pathProcess+"line_GEISAIASI2011_bin_gsi08_v1.0 -database_name GEISAIASI2011 -database_type gsi08 -type_out png"; |
---|
896 | break; |
---|
897 | } |
---|
898 | |
---|
899 | |
---|
900 | //molécules |
---|
901 | //récupération des molécules sélectionnées |
---|
902 | var inputs = document.getElementsByTagName( 'input' ); |
---|
903 | var count = inputs.length; |
---|
904 | var isotopesSelectedName =""; |
---|
905 | // alert(this.selectDatabase.getValue()); |
---|
906 | var i=0; |
---|
907 | this.nbIsotopes = 0; |
---|
908 | this.nbMolecules = 0; |
---|
909 | this.nbGraph = 0; |
---|
910 | for( i = 0; i < count; i++ ) |
---|
911 | { |
---|
912 | var input = inputs.item( i ); |
---|
913 | //ne prendre que les isotopes sélectionnés dans la base de données sélectionnée (rechercher des id du type : "chk-ch3cn-GEISA-11") |
---|
914 | if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("chk-")!= -1 && input.id.indexOf(this.selectDatabase.getValue())!= -1) |
---|
915 | { |
---|
916 | //nombre d'isotopes sélectionnés |
---|
917 | this.nbIsotopes = this.nbIsotopes + 1; |
---|
918 | |
---|
919 | var molN=input.value; |
---|
920 | var molN1=molN.replace("_", ":"); |
---|
921 | // exemple : -moleisot h2o:161 -moleisot h2o:162 -moleisot co2:626 -moleisot co2:627 -moleisot o3:666 -moleisot o3:668 |
---|
922 | isotopesSelectedName = isotopesSelectedName+"-moleisot "+molN1+" "; |
---|
923 | } |
---|
924 | //récupération du nombre de molécules sélectionnées |
---|
925 | if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("all-")!= -1 && input.id.indexOf(this.selectDatabase.getValue())!= -1) |
---|
926 | { |
---|
927 | //nombre d'isotopes sélectionnés |
---|
928 | this.nbMolecules = this.nbMolecules + 1; |
---|
929 | } |
---|
930 | } |
---|
931 | |
---|
932 | |
---|
933 | //averti l'utilisateur qu'il faut au moins sélectionner un isotope |
---|
934 | if (this.nbIsotopes == 0) { |
---|
935 | alert("Error : no molecule or isotopoloque was selected"); |
---|
936 | return; |
---|
937 | } |
---|
938 | |
---|
939 | |
---|
940 | |
---|
941 | //sélection du nombre de courbes ou de graphs |
---|
942 | |
---|
943 | var nbCourbes = ""; |
---|
944 | |
---|
945 | switch (this.selectNbCourbes.getValue()) { |
---|
946 | //sswitch (document.getElementById('selectNbCourbes').options[document.getElementById('selectNbCourbes').selectedIndex].value) { |
---|
947 | case 'cm': |
---|
948 | nbCourbes = "-separate_mol -same_graph "; |
---|
949 | this.nbGraph = 1; |
---|
950 | this.nbCourbe = this.nbMolecules; |
---|
951 | if (this.nbCourbe > 8) { |
---|
952 | alert("Too much molecules selected to draw one curve for each molecule selected"); |
---|
953 | return; |
---|
954 | } |
---|
955 | break; |
---|
956 | case 'ci': |
---|
957 | nbCourbes = "-separate_iso -same_graph "; |
---|
958 | this.nbGraph = 1; |
---|
959 | this.nbCourbe = this.nbIsotopes; |
---|
960 | if (this.nbCourbe > 8) { |
---|
961 | alert("Too much isotopologues selected to draw one curve for each isotopologues selected"); |
---|
962 | return; |
---|
963 | } |
---|
964 | break; |
---|
965 | case 'gm': |
---|
966 | nbCourbes = "-separate_mol "; |
---|
967 | this.nbGraph = this.nbMolecules; |
---|
968 | if (this.nbGraph > 20) { |
---|
969 | alert("Too much molecules selected to draw one graph for each molecules selected"); |
---|
970 | return; |
---|
971 | } |
---|
972 | break; |
---|
973 | case 'gi': |
---|
974 | nbCourbes = "-separate_iso "; |
---|
975 | this.nbGraph = this.nbIsotopes; |
---|
976 | if (this.nbGraph > 20) { |
---|
977 | alert("Too much isotopologues selected to draw one graph for each isotopologues selected"); |
---|
978 | return; |
---|
979 | } |
---|
980 | break; |
---|
981 | default: |
---|
982 | nbCourbes = ""; |
---|
983 | this.nbGraph = 1; |
---|
984 | break; |
---|
985 | } |
---|
986 | |
---|
987 | |
---|
988 | //Spectral range |
---|
989 | var rangeLower="-wavenb_min "+$("#rangeLower").val(); |
---|
990 | var rangeUpper="-wavenb_max "+$("#rangeUpper").val(); |
---|
991 | |
---|
992 | //controle des valeurs entrées par l'utilisateur |
---|
993 | |
---|
994 | switch (this.selectDatabase.getValue()) { |
---|
995 | case 'GEISA2003': |
---|
996 | //isNaN = n'est pas un nombre |
---|
997 | if(isNaN(($("#rangeLower").val())) == true || parseFloat($("#rangeLower").val()) < 0 || parseFloat($("#rangeLower").val()) > 35877.030506) |
---|
998 | { |
---|
999 | alert("Error: Invalid value for lower spectral range area. The value must be between 0 and 35877.030506"); |
---|
1000 | return; |
---|
1001 | } |
---|
1002 | |
---|
1003 | if(isNaN(($("#rangeUpper").val())) == true || parseFloat( $("#rangeUpper").val()) == 0 || parseFloat( $("#rangeUpper").val()) < 0 || parseFloat($("#rangeUpper").val()) > 35877.030506) |
---|
1004 | { |
---|
1005 | alert("Error: Invalid value for upper spectral range area. The value must be between 0 and 35877.030506"); |
---|
1006 | return; |
---|
1007 | } |
---|
1008 | |
---|
1009 | break; |
---|
1010 | case 'GEISA2011': |
---|
1011 | //isNaN = n'est pas un nombre |
---|
1012 | if(isNaN(($("#rangeLower").val())) == true || parseFloat($("#rangeLower").val()) < 0 || parseFloat($("#rangeLower").val()) > 35877.030506) |
---|
1013 | { |
---|
1014 | alert("Error: Invalid value for lower spectral range area. The value must be between 0 and 35877.030506"); |
---|
1015 | return; |
---|
1016 | } |
---|
1017 | |
---|
1018 | if(isNaN(($("#rangeUpper").val())) == true || parseFloat( $("#rangeUpper").val()) == 0 || parseFloat( $("#rangeUpper").val()) < 0 || parseFloat($("#rangeUpper").val()) > 35877.030506) |
---|
1019 | { |
---|
1020 | alert("Error: Invalid value for upper spectral range area. The value must be between 0 and 35877.030506"); |
---|
1021 | return; |
---|
1022 | } |
---|
1023 | break; |
---|
1024 | case 'GEISAIASI2003': |
---|
1025 | //isNaN = n'est pas un nombre |
---|
1026 | if(isNaN(($("#rangeLower").val())) == true || parseFloat($("#rangeLower").val()) < 0 || parseFloat($("#rangeLower").val()) < 599.000793 || parseFloat($("#rangeLower").val()) > 3000.998767) |
---|
1027 | { |
---|
1028 | alert("Error: Invalid value for lower spectral range area. The value must be between 599.000793 and 3000.998767"); |
---|
1029 | return; |
---|
1030 | } |
---|
1031 | |
---|
1032 | if(isNaN(($("#rangeUpper").val())) == true || parseFloat( $("#rangeUpper").val()) == 0 || parseFloat( $("#rangeUpper").val()) < 0 || parseFloat($("#rangeUpper").val()) < 599.000793 || parseInt($("#rangeUpper").val()) > 3000.998767) |
---|
1033 | { |
---|
1034 | alert("Error: Invalid value for upper spectral range area. The value must be between 599.000793 and 3000.998767"); |
---|
1035 | return; |
---|
1036 | } |
---|
1037 | break; |
---|
1038 | case 'GEISAIASI2011': |
---|
1039 | //isNaN = n'est pas un nombre |
---|
1040 | if(isNaN(($("#rangeLower").val())) == true || parseFloat($("#rangeLower").val()) < 0 || parseFloat($("#rangeLower").val()) < 599.000793 || parseFloat($("#rangeLower").val()) > 3000.998767) |
---|
1041 | { |
---|
1042 | alert("Error: Invalid value for lower spectral range area. The value must be between 599.000793 and 3000.998767"); |
---|
1043 | return; |
---|
1044 | } |
---|
1045 | |
---|
1046 | if(isNaN(($("#rangeUpper").val())) == true || parseFloat( $("#rangeUpper").val()) == 0 || parseFloat( $("#rangeUpper").val()) < 0 || parseFloat($("#rangeUpper").val()) < 599.000793 || parseInt($("#rangeUpper").val()) > 3000.998767) |
---|
1047 | { |
---|
1048 | alert("Error: Invalid value for upper spectral range area. The value must be between 599.000793 and 3000.998767"); |
---|
1049 | return; |
---|
1050 | } |
---|
1051 | break; |
---|
1052 | } |
---|
1053 | |
---|
1054 | |
---|
1055 | if ($("#rangeLower").val() == "" ) |
---|
1056 | { |
---|
1057 | rangeLower=""; |
---|
1058 | } |
---|
1059 | |
---|
1060 | if ($("#rangeUpper").val() == "" ) |
---|
1061 | { |
---|
1062 | rangeUpper=""; |
---|
1063 | } |
---|
1064 | if( parseInt($("#rangeLower").val()) > parseInt($("#rangeUpper").val()) ) |
---|
1065 | { |
---|
1066 | alert("Error: lower spectral range area is superior to upper spectral range area "); |
---|
1067 | return; |
---|
1068 | } |
---|
1069 | |
---|
1070 | |
---|
1071 | |
---|
1072 | //Sampling step |
---|
1073 | if( $("#sampStep").val() > 0 ) |
---|
1074 | { |
---|
1075 | var samplingStep="-band "+$("#sampStep").val(); |
---|
1076 | //calcul du nombre de graphs générés par l'option Sampling step |
---|
1077 | this.nbGraphSamplingStep = (parseFloat($("#rangeUpper").val()) - parseFloat($("#rangeLower").val())) / parseFloat($("#sampStep").val()); |
---|
1078 | //calcul du nombre de graphs total à tracer (nbr de graph générés par "type of graph" * nbr de graph généré par "Sampling Step") |
---|
1079 | //test pour voir si "nbGraphSamplingStep" est un entier |
---|
1080 | if ((this.nbGraphSamplingStep - parseInt(this.nbGraphSamplingStep)) == 0) |
---|
1081 | { |
---|
1082 | this.nbGraph=(this.nbGraph)*(this.nbGraphSamplingStep); |
---|
1083 | } |
---|
1084 | else |
---|
1085 | { |
---|
1086 | // si "nbGraphSamplingStep" n'est pas un entier prendre le nbre entier suivant |
---|
1087 | this.nbGraph=this.nbGraph*(parseInt(this.nbGraphSamplingStep)+1); |
---|
1088 | } |
---|
1089 | } |
---|
1090 | |
---|
1091 | if(isNaN($("#sampStep").val()) == true || parseInt($("#sampStep").val()) < 0 ) |
---|
1092 | { |
---|
1093 | alert("Error: Invalid value for sampling step"); |
---|
1094 | return; |
---|
1095 | } |
---|
1096 | |
---|
1097 | if( $("#sampStep").val() == 0 ) |
---|
1098 | { |
---|
1099 | var samplingStep=""; |
---|
1100 | } |
---|
1101 | |
---|
1102 | //test sur le nombre de graphs générés |
---|
1103 | if (this.nbGraph > 20) |
---|
1104 | { |
---|
1105 | alert("Too many graphics will be drawn ("+this.nbGraph+"). Please change the value of the sampling step or change the value of the type of graph."); |
---|
1106 | return; |
---|
1107 | } |
---|
1108 | |
---|
1109 | |
---|
1110 | |
---|
1111 | //Transitions to do |
---|
1112 | //exemple de requete avec transition |
---|
1113 | //./all -filein line_GEISA2009_bin -moleisot h2o:161 -wavenb_min 1 -wavenb_max 1000 -database_name "GEISA2011" -vib_ident_lower '[000]' |
---|
1114 | var transitionUpper=document.getElementById('transition1').options[document.getElementById('transition1').selectedIndex].value; |
---|
1115 | |
---|
1116 | //certaine transitions ont plusieurs espaces à droite qui ne sont pas conservés (ex ch4 et C2HD) |
---|
1117 | //si la longueur de la chaine de caracteres n'est pas 25 on rajoute le nobre d'espace nécessaire pour arriver à 25 |
---|
1118 | var nb=0; |
---|
1119 | nb=25-transitionUpper.length |
---|
1120 | if (nb != 0) |
---|
1121 | { |
---|
1122 | for (i = 1; i <= nb; i++) { |
---|
1123 | transitionUpper=transitionUpper+" "; |
---|
1124 | } |
---|
1125 | } |
---|
1126 | |
---|
1127 | |
---|
1128 | var transitionLower=document.getElementById('transition2').options[document.getElementById('transition2').selectedIndex].value; |
---|
1129 | |
---|
1130 | //certaine transitions ont plusieurs espaces à droite qui ne sont pas conservés (ex ch4 et C2HD) |
---|
1131 | //si la longueur de la chaine de caracteres n'est pas 25 on rajoute le nobre d'espace nécessaire pour arriver à 25 |
---|
1132 | var nb=0; |
---|
1133 | nb=25-transitionLower.length |
---|
1134 | if (nb != 0) |
---|
1135 | { |
---|
1136 | for (i = 1; i <= nb; i++) { |
---|
1137 | transitionLower=transitionLower+" "; |
---|
1138 | } |
---|
1139 | } |
---|
1140 | |
---|
1141 | //pas de transition sélectionnée |
---|
1142 | |
---|
1143 | if (( document.getElementById('transition1').options[document.getElementById('transition1').selectedIndex].value == -1) || (document.getElementById('transition1').options[document.getElementById('transition1').selectedIndex].value == "transition" )) |
---|
1144 | { |
---|
1145 | transitionUpper ="no"; |
---|
1146 | } |
---|
1147 | if (( document.getElementById('transition2').options[document.getElementById('transition2').selectedIndex].value == -1) || (document.getElementById('transition2').options[document.getElementById('transition2').selectedIndex].value == "transition" )) |
---|
1148 | { |
---|
1149 | transitionLower ="no"; |
---|
1150 | } |
---|
1151 | |
---|
1152 | if ( document.getElementById('transition1').options[document.getElementById('transition1').selectedIndex].value == "") |
---|
1153 | { |
---|
1154 | transitionUpper ="noValue"; |
---|
1155 | } |
---|
1156 | |
---|
1157 | if ( document.getElementById('transition2').options[document.getElementById('transition2').selectedIndex].value == "") |
---|
1158 | { |
---|
1159 | transitionLower ="noValue"; |
---|
1160 | } |
---|
1161 | |
---|
1162 | var sel = document.getElementById('transition1'); |
---|
1163 | var idupper = sel.options[sel.selectedIndex].value; |
---|
1164 | |
---|
1165 | //Intensity range |
---|
1166 | var intensityLower="-int_min "+$("#intensityLo").val(); |
---|
1167 | var intensityUpper="-int_max "+$("#intensityUp").val(); |
---|
1168 | |
---|
1169 | //controle des valeurs entrées par l'utilisateur |
---|
1170 | if(isNaN($("#intensityLo").val()) == true || $("#intensityLo").val() < 0 ) |
---|
1171 | { |
---|
1172 | alert("Error: Invalid value for lower intensity range area. The value must be between 0 and 1E-16"); |
---|
1173 | return; |
---|
1174 | } |
---|
1175 | if ($("#intensityLo").val() == "" ) |
---|
1176 | { |
---|
1177 | intensityLower=""; |
---|
1178 | } |
---|
1179 | if(isNaN($("#intensityUp").val()) == true || $("#intensityUp").val() < 0 ) |
---|
1180 | { |
---|
1181 | alert("Error: Invalid value for upper intensity range area. The value must be between 0 and 1E-16"); |
---|
1182 | return; |
---|
1183 | } |
---|
1184 | if ($("#intensityUp").val() == "" ) |
---|
1185 | { |
---|
1186 | intensityUpper=""; |
---|
1187 | } |
---|
1188 | |
---|
1189 | //to do javascript ne sait comparer des exponenciels |
---|
1190 | // if( $("#intensityLo").val() > $("#intensityUp").val() ) |
---|
1191 | |
---|
1192 | // { |
---|
1193 | // alert("Error: lower intensity range area is superior to upper intensity range area "); |
---|
1194 | // return; |
---|
1195 | // } |
---|
1196 | |
---|
1197 | |
---|
1198 | //Valeur de mean value |
---|
1199 | var meanValue = "-step "+$("#meanValue2").val(); |
---|
1200 | //controle des valeurs entrées par l'utilisateur |
---|
1201 | //Si ce n'est pas un nombre ou si il est négatif ou si mean value est supérieur ou égal à l'interval spectral |
---|
1202 | if(isNaN($("#meanValue2").val()) == true || $("#meanValue2").val() < 0 || $("#meanValue2").val() >= (parseFloat($("#rangeUpper").val()) - parseFloat($("#rangeLower").val())) ) |
---|
1203 | { |
---|
1204 | alert("Error: Invalid value for Average calculation area"); |
---|
1205 | return; |
---|
1206 | } |
---|
1207 | //si aucune valeur |
---|
1208 | if ($("#meanValue2").val() == "" ) |
---|
1209 | { |
---|
1210 | meanValue=""; |
---|
1211 | } |
---|
1212 | |
---|
1213 | //sélection du premier choix pour l'axe des Y |
---|
1214 | var field="-field "+this.selectTraceAxeY1.getValue(); |
---|
1215 | |
---|
1216 | |
---|
1217 | //sélection du type d'échelle pour le parametre Y1 (il y a une valeur pour ce champ que si logaritmic est choisi et si l'option est activée) |
---|
1218 | if (this.selectScaleY1.getValue() == '-log_scale' && this.selectScaleY1.isDisable == false) |
---|
1219 | { |
---|
1220 | var logScale = this.selectScaleY1.getValue(); |
---|
1221 | } |
---|
1222 | else |
---|
1223 | { |
---|
1224 | var logScale = "" |
---|
1225 | } |
---|
1226 | |
---|
1227 | |
---|
1228 | |
---|
1229 | //sélection du type de tracé pour Y1 |
---|
1230 | var lineType="-line_type "+this.selectTypeTraceY1.getValue(); |
---|
1231 | //var lineType="-line_type "+document.getElementById('selectTypePlotY1').options[document.getElementById('selectTypePlotY1').selectedIndex].value; |
---|
1232 | |
---|
1233 | |
---|
1234 | //sélection ou non d'un 2eme choix pour l'axe des Y (pas de valeur pour ce champ si choix none ou si l'option n'est pas activée) |
---|
1235 | if (this.selectTraceAxeY2.getValue() == 'no' || this.selectTraceAxeY2.isDisable == true) |
---|
1236 | { |
---|
1237 | var field2 = ""; |
---|
1238 | } |
---|
1239 | else |
---|
1240 | { |
---|
1241 | var field2 = "-field2 "+this.selectTraceAxeY2.getValue(); |
---|
1242 | //var field2 = "-field2 "+document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value; |
---|
1243 | } |
---|
1244 | |
---|
1245 | //sélection du type d'échelle pour le parametre Y2 (il y a une valeur pour ce champ que si logaritmic est choisi et si l'option est activée) |
---|
1246 | if (this.selectScaleY2.getValue() == '-log_scale2' && this.selectScaleY2.isDisable == false) |
---|
1247 | { |
---|
1248 | var logScale2 =this.selectScaleY2.getValue(); |
---|
1249 | // var logScale2 = document.getElementById('selectScaleY2').options[document.getElementById('selectScaleY2').selectedIndex].value; |
---|
1250 | } |
---|
1251 | else |
---|
1252 | { |
---|
1253 | var logScale2 = ""; |
---|
1254 | } |
---|
1255 | |
---|
1256 | |
---|
1257 | //sélection du type de tracé pour Y2 (pas de valeur si l'option n'est pas activée) |
---|
1258 | if ( this.selectTypeTraceY2.isDisable == true) |
---|
1259 | { |
---|
1260 | var lineType2 = ""; |
---|
1261 | } |
---|
1262 | else |
---|
1263 | { |
---|
1264 | var lineType2 = "-line_type2 "+this.selectTypeTraceY2.getValue(); |
---|
1265 | } |
---|
1266 | |
---|
1267 | |
---|
1268 | //ouverture de la div de l'image d'attente |
---|
1269 | this.loadingGraphics.display(); |
---|
1270 | |
---|
1271 | |
---|
1272 | |
---|
1273 | |
---|
1274 | //construction de la requête Fortran |
---|
1275 | |
---|
1276 | var parameters = "&fortranRequest="+paramBase+" "+isotopesSelectedName+" "+rangeLower+" "+rangeUpper+" "+samplingStep+" "+intensityLower+" "+intensityUpper+" "+ |
---|
1277 | meanValue+" "+nbCourbes+" "+field+" "+logScale+" "+lineType+" "+field2+" "+logScale2+" "+lineType2; |
---|
1278 | |
---|
1279 | |
---|
1280 | //remplacement de espace par "EEE" pour que le shell script ne voit qu'un seul argument en entrée |
---|
1281 | parameters=parameters.replace(/ /g,"kkk"); |
---|
1282 | transitionUpper=transitionUpper.replace(/ /g,"kkk"); |
---|
1283 | //le + est interprété comme un espace (plus sera retransformé en + dans le shell) |
---|
1284 | transitionUpper=transitionUpper.replace(/\+/g,"plus"); |
---|
1285 | transitionLower=transitionLower.replace(/ /g,"kkk"); |
---|
1286 | transitionLower=transitionLower.replace(/\+/g,"plus"); |
---|
1287 | |
---|
1288 | |
---|
1289 | //construction du nom du fichier (exemple GEISA2011-0_100) |
---|
1290 | this.nomFichier=this.selectDatabase.getValue()+"-"+$("#rangeLower").val()+"_"+$("#rangeUpper").val(); |
---|
1291 | //envoie de la requête au controller |
---|
1292 | //en cas de succes appel de la fonction "handleGeisa" |
---|
1293 | $.ajax( { |
---|
1294 | url: "project?methodName=createUserRequest&"+parameters+"&transitionUpper="+ transitionUpper+"&transitionLower="+ transitionLower+"&nbGraph="+ this.nbGraph+"&nomFichier="+this.nomFichier+"&NomRepFileOut="+this.NomRepFileOut, |
---|
1295 | success:jQuery.proxy( this.handleGeisa, this ) |
---|
1296 | } ); |
---|
1297 | }, |
---|
1298 | |
---|
1299 | |
---|
1300 | //requête pour interrogation de la base de données des transitions |
---|
1301 | requestTransition: function() |
---|
1302 | { |
---|
1303 | |
---|
1304 | var nbMolecules=0; |
---|
1305 | |
---|
1306 | //Récupération du spectral range |
---|
1307 | var spectralRangeLower = $("#rangeLower").val(); |
---|
1308 | var spectralRangeUpper = $("#rangeUpper").val(); |
---|
1309 | |
---|
1310 | //Récupération des isotopes sélectionnés |
---|
1311 | var inputs = document.getElementsByTagName( 'input' ); |
---|
1312 | var count = inputs.length; |
---|
1313 | var isotopesSelectedNameArray = new Array(); |
---|
1314 | var i=0; |
---|
1315 | |
---|
1316 | for( i = 0; i < count; i++ ) |
---|
1317 | { |
---|
1318 | var input = inputs.item( i ); |
---|
1319 | //ne prendre que les isotopes sélectionnés dans la base de données sélectionnée (rechercher des id du type : "chk-ch3cn-GEISA-11") |
---|
1320 | if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("chk-")!= -1 && input.id.indexOf(this.selectDatabase.getValue())!= -1) |
---|
1321 | { |
---|
1322 | var molN=input.value; |
---|
1323 | var molN1=molN.replace("_", ":"); |
---|
1324 | //tous les isotopes sélectionnés sont placés dans un tableau |
---|
1325 | isotopesSelectedNameArray.push(molN1); |
---|
1326 | } |
---|
1327 | |
---|
1328 | //récupération du nombre de molécules sélectionnées |
---|
1329 | if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("all-")!= -1 && input.id.indexOf(this.selectDatabase.getValue())!= -1) |
---|
1330 | { |
---|
1331 | nbMolecules = nbMolecules + 1; |
---|
1332 | } |
---|
1333 | |
---|
1334 | } |
---|
1335 | //alert ("nbMolecules"+nbMolecules); |
---|
1336 | //si le nombre de molécule sélectionnées est supérieure à 1 les menus des transition sont inactifs |
---|
1337 | if (nbMolecules > 1) |
---|
1338 | { |
---|
1339 | //ajoute une classe à celle déjà existante de transitionUpper |
---|
1340 | $("#transitionUpper").addClass("notActiveText"); |
---|
1341 | $("#transitionLower").addClass("notActiveText"); |
---|
1342 | } |
---|
1343 | else |
---|
1344 | { |
---|
1345 | $("#transitionUpper").removeClass("notActiveText"); |
---|
1346 | $("#transitionLower").removeClass("notActiveText"); |
---|
1347 | } |
---|
1348 | |
---|
1349 | |
---|
1350 | //On ne fait appel à la BDD des transitions et si au plus 1 molécule est sélectionnée |
---|
1351 | if (nbMolecules == 1 ) |
---|
1352 | { |
---|
1353 | |
---|
1354 | |
---|
1355 | $.ajax( { |
---|
1356 | url: "project?methodName=getTransitionByIsotopeName&isotopesSelectedNameArray="+isotopesSelectedNameArray+"&geisaSelectedDatabase="+this.selectDatabase.getValue2()+"&spectralRangeLower="+spectralRangeLower+"&spectralRangeUpper="+spectralRangeUpper, |
---|
1357 | success:jQuery.proxy( this.handleRequestTransition, this ), |
---|
1358 | error: jQuery.proxy( this.handleErrorRequestTransition, this ) |
---|
1359 | } ); |
---|
1360 | |
---|
1361 | } |
---|
1362 | else |
---|
1363 | { |
---|
1364 | //pour réinitialiser le menu déroulant si aucune ou plusieurs molécules sont sélectionnées |
---|
1365 | document.getElementById("transition2").length=0; |
---|
1366 | //this.selectTransitionUpper.clear(); |
---|
1367 | document.getElementById("transition1").length=0; |
---|
1368 | |
---|
1369 | if (nbMolecules == 0 ) |
---|
1370 | { |
---|
1371 | this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"Select a molecule", selected:"selected"} )); |
---|
1372 | this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"Select a molecule", selected:"selected"} )); |
---|
1373 | //pour forcer à afficher le premier élément (et non le premier élément précédent) |
---|
1374 | //this.selectTransitionLower.selectFirst(); |
---|
1375 | //this.selectTransitionUpper.selectFirst(); |
---|
1376 | } |
---|
1377 | |
---|
1378 | if (nbMolecules > 1 ) |
---|
1379 | { |
---|
1380 | |
---|
1381 | this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"", selected:"selected", disabled:"disabled"} )); |
---|
1382 | this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"", selected:"selected", disabled:"disabled"} )); |
---|
1383 | //pour forcer à afficher le premier élément (et non le premier élément précédent) |
---|
1384 | //this.selectTransitionLower.selectFirst(); |
---|
1385 | //this.selectTransitionUpper.selectFirst(); |
---|
1386 | //ajoute une classe à celle déjà existante de transitionUpper |
---|
1387 | $("#transitionUpper").addClass("notActiveText"); |
---|
1388 | $("#transitionLower").addClass("notActiveText"); |
---|
1389 | } |
---|
1390 | } |
---|
1391 | }, |
---|
1392 | |
---|
1393 | |
---|
1394 | |
---|
1395 | |
---|
1396 | //requête pour interrogation de la base de données des transitions en fonction d'une transition lower |
---|
1397 | requestTransitionByTransitionLower: function() |
---|
1398 | { |
---|
1399 | var context = this[0]; |
---|
1400 | //exemple transitionLower=" 000" : il y a 25 caractÚres dans chaque transition |
---|
1401 | context.transitionLower = this[1]; |
---|
1402 | |
---|
1403 | //Récupération de la Base Geisa sélectionnée |
---|
1404 | var GeisaSelectedDatabase = context.selectDatabase.getValue(); |
---|
1405 | |
---|
1406 | //Récupération du spectral range |
---|
1407 | var spectralRangeLower = $("#rangeLower").val(); |
---|
1408 | var spectralRangeUpper = $("#rangeUpper").val(); |
---|
1409 | |
---|
1410 | //Récupération des isotopes sélectionnés |
---|
1411 | var inputs = document.getElementsByTagName( 'input' ); |
---|
1412 | var count = inputs.length; |
---|
1413 | var isotopesSelectedNameArray = new Array(); |
---|
1414 | var i=0; |
---|
1415 | |
---|
1416 | for( i = 0; i < count; i++ ) |
---|
1417 | { |
---|
1418 | var input = inputs.item( i ); |
---|
1419 | //ne prendre que les isotopes sélectionnés dans la base de données sélectionnée (rechercher des id du type : "chk-ch3cn-GEISA-11") |
---|
1420 | if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("chk-")!= -1 && input.id.indexOf(context.selectDatabase.getValue())!= -1) |
---|
1421 | { |
---|
1422 | var molN=input.value; |
---|
1423 | var molN1=molN.replace("_", ":"); |
---|
1424 | //tous les isotopes sélectionnés sont placés dans un tableau |
---|
1425 | isotopesSelectedNameArray.push(molN1); |
---|
1426 | } |
---|
1427 | |
---|
1428 | } |
---|
1429 | |
---|
1430 | //le passage de javascript à java par ajax transforme les + en espace donc transformation des + en plus et dans le controller on fait l'inverse |
---|
1431 | var transitionLowerReplaced = context.transitionLower.replace(/\+/g,"plus"); |
---|
1432 | |
---|
1433 | //Appel à la BDD |
---|
1434 | |
---|
1435 | $.ajax( { |
---|
1436 | url: "project?methodName=getTransitionByIsotopeNameByTransitionLower&isotopesSelectedNameArray="+isotopesSelectedNameArray+"&geisaSelectedDatabase="+context.selectDatabase.getValue2()+"&spectralRangeLower="+spectralRangeLower+"&spectralRangeUpper="+spectralRangeUpper+"&transitionLower="+transitionLowerReplaced, |
---|
1437 | success:jQuery.proxy( context.handleRequestTransitionByTransitionLower, context) |
---|
1438 | } ); |
---|
1439 | |
---|
1440 | |
---|
1441 | |
---|
1442 | }, |
---|
1443 | |
---|
1444 | |
---|
1445 | //requête pour interrogation de la base de données des transitions en fonction d'une transition upper |
---|
1446 | requestTransitionByTransitionUpper: function() |
---|
1447 | { |
---|
1448 | var context = this[0]; |
---|
1449 | //exemple transitionLower=" 000" : il y a 25 caractÚres dans chaque transition |
---|
1450 | context.transitionUpper = this[1]; |
---|
1451 | |
---|
1452 | //Récupération de la Base Geisa sélectionnée |
---|
1453 | var GeisaSelectedDatabase = context.selectDatabase.getValue(); |
---|
1454 | |
---|
1455 | //Récupération du spectral range |
---|
1456 | var spectralRangeLower = $("#rangeLower").val(); |
---|
1457 | var spectralRangeUpper = $("#rangeUpper").val(); |
---|
1458 | |
---|
1459 | //Récupération des isotopes sélectionnés |
---|
1460 | var inputs = document.getElementsByTagName( 'input' ); |
---|
1461 | var count = inputs.length; |
---|
1462 | var isotopesSelectedNameArray = new Array(); |
---|
1463 | var i=0; |
---|
1464 | |
---|
1465 | for( i = 0; i < count; i++ ) |
---|
1466 | { |
---|
1467 | var input = inputs.item( i ); |
---|
1468 | //ne prendre que les isotopes sélectionnés dans la base de données sélectionnée (rechercher des id du type : "chk-ch3cn-GEISA-11") |
---|
1469 | if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("chk-")!= -1 && input.id.indexOf(context.selectDatabase.getValue())!= -1) |
---|
1470 | { |
---|
1471 | var molN=input.value; |
---|
1472 | var molN1=molN.replace("_", ":"); |
---|
1473 | //tous les isotopes sélectionnés sont placés dans un tableau |
---|
1474 | isotopesSelectedNameArray.push(molN1); |
---|
1475 | } |
---|
1476 | |
---|
1477 | } |
---|
1478 | //le passage de javascript à java par ajax transforme les + en espace donc transformation des + en plus et dans le controller on fait l'inverse |
---|
1479 | var transitionUpperReplaced = context.transitionUpper.replace(/\+/g,"plus"); |
---|
1480 | |
---|
1481 | //Appel à la BDD |
---|
1482 | $.ajax( { |
---|
1483 | url: "project?methodName=getTransitionByIsotopeNameByTransitionUpper&isotopesSelectedNameArray="+isotopesSelectedNameArray+"&geisaSelectedDatabase="+context.selectDatabase.getValue2()+"&spectralRangeLower="+spectralRangeLower+"&spectralRangeUpper="+spectralRangeUpper+"&transitionUpper="+transitionUpperReplaced, |
---|
1484 | success:jQuery.proxy( context.handleRequestTransitionByTransitionUpper, context) |
---|
1485 | } ); |
---|
1486 | |
---|
1487 | |
---|
1488 | |
---|
1489 | }, |
---|
1490 | |
---|
1491 | |
---|
1492 | |
---|
1493 | // requestTransition: function() |
---|
1494 | // { |
---|
1495 | // $.ajax( { |
---|
1496 | // url: "project?methodName=transition&transitionValue="+ this.selectTransitionUpper.getValue(), |
---|
1497 | // success:jQuery.proxy( this.handleRequestTransition, this ) |
---|
1498 | // } ); |
---|
1499 | // }, |
---|
1500 | |
---|
1501 | // HANDLES ******************************************************** = retours ajax |
---|
1502 | //affichage sur l'interface |
---|
1503 | |
---|
1504 | handleGeisa: function( result ) |
---|
1505 | { |
---|
1506 | |
---|
1507 | //nom du répertoire : exemple de retour de valeur du controleur |
---|
1508 | //this.nb = jQuery.parseJSON( result ).nb; |
---|
1509 | //this.NomRepFileOut = jQuery.parseJSON( result ).NomRepFileOut; |
---|
1510 | |
---|
1511 | //chemin court de l'image |
---|
1512 | this.pathImg = "<%=Controller.PATH_IMAGES%>"+this.NomRepFileOut; |
---|
1513 | |
---|
1514 | |
---|
1515 | //Pour tracer le bon nombre de graphe et de bouton download |
---|
1516 | var i=1; |
---|
1517 | var content=""; |
---|
1518 | //bouton "Download All" si il y a plus d'un graph |
---|
1519 | if (this.nbGraph > 1) |
---|
1520 | { |
---|
1521 | content = "<a href=project?methodName=downloadFile&fileName=" +this.NomRepFileOut + "GEISA.tar&fileNameToDisplay=GEISA.tar><button class='dataProtocolDownloadButton'>Download All</button></a>"; |
---|
1522 | } |
---|
1523 | //tracer chaque graphe avec son bouton download associé |
---|
1524 | for (i=1; i<this.nbGraph+1; i++) { |
---|
1525 | //content = content + '<img src=' + this.pathImg + "graph" + this.nb +"-"+i+ ".png"+ ' /><a href="project?methodName=downloadFile&fileName=' + "graph" + this.nb+"-"+i + ".png"+ '"><button class="dataProtocolDownloadButton">Download</button></a>'; |
---|
1526 | content = content +'<img src=' + this.pathImg + this.nomFichier +"-"+i+ ".png"+ ' /><a href="project?methodName=downloadFile&fileName=' +this.NomRepFileOut + this.nomFichier+"-"+i + ".png&fileNameToDisplay="+this.nomFichier+"-"+i + ".png"+ '"><button class="dataProtocolDownloadButton">Download</button></a>'; |
---|
1527 | } |
---|
1528 | |
---|
1529 | this.displayWindow(content); |
---|
1530 | }, |
---|
1531 | |
---|
1532 | |
---|
1533 | handleRequestTransition: function( result ) |
---|
1534 | { |
---|
1535 | |
---|
1536 | |
---|
1537 | // var transitions = jQuery.parseJSON( result ).transitions; |
---|
1538 | var transitionsLower = jQuery.parseJSON( result ).transitionsLower; |
---|
1539 | var transitionsUpper = jQuery.parseJSON( result ).transitionsUpper; |
---|
1540 | |
---|
1541 | //pour vider les menus déroulant des transitions précédentes |
---|
1542 | // this.selectTransitionLower.clear(); |
---|
1543 | document.getElementById("transition2").length=0; |
---|
1544 | //this.selectTransitionUpper.clear(); |
---|
1545 | document.getElementById("transition1").length=0; |
---|
1546 | |
---|
1547 | // this.selectTransitionLower.add('transition', "Choose a transition"); |
---|
1548 | this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled", selected:"selected"} )); |
---|
1549 | // this.selectTransitionUpper.add('transition', "Choose a transition"); |
---|
1550 | this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled", selected:"selected"} )); |
---|
1551 | //pour forcer à afficher le premier élément (et non le premier élément précédent) |
---|
1552 | // this.selectTransitionLower.selectFirst(); |
---|
1553 | // this.selectTransitionUpper.selectFirst(); |
---|
1554 | |
---|
1555 | |
---|
1556 | $.each(transitionsLower, jQuery.proxy( function(index, transitionsLower ) |
---|
1557 | { |
---|
1558 | // this.selectTransitionLower.add(transitionsLower, transitionsLower,jQuery.proxy(this.requestTransitionByTransitionLower, [this, transitionsLower ])); |
---|
1559 | |
---|
1560 | |
---|
1561 | this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:transitionsLower, text:transitionsLower} ).bind( 'click', jQuery.proxy(this.requestTransitionByTransitionLower, [this, transitionsLower ]))); |
---|
1562 | |
---|
1563 | }, this)); |
---|
1564 | |
---|
1565 | $.each(transitionsUpper, jQuery.proxy( function(index, transitionsUpper ) |
---|
1566 | { |
---|
1567 | //this.selectTransitionUpper.add(transitionsUpper, transitionsUpper,jQuery.proxy(this.requestTransitionByTransitionUpper, [this, transitionsUpper ])); |
---|
1568 | this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:transitionsUpper, text:transitionsUpper} ).bind( 'click', jQuery.proxy(this.requestTransitionByTransitionUpper, [this, transitionsUpper ]))); |
---|
1569 | |
---|
1570 | }, this)); |
---|
1571 | |
---|
1572 | }, |
---|
1573 | |
---|
1574 | //en cas d'erreur dans la requête des transitions ( pas de valeur ou caractÚres à la place de nombres dans champ spectral) |
---|
1575 | handleErrorRequestTransition : function() |
---|
1576 | { |
---|
1577 | //pour vider les menus déroulant des transitions précédentes |
---|
1578 | document.getElementById("transition2").length=0; |
---|
1579 | document.getElementById("transition1").length=0; |
---|
1580 | |
---|
1581 | this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"requestError", text:"Choose a transition", disabled:"disabled", selected:"selected"} )); |
---|
1582 | this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"requestError", text:"Choose a transition", disabled:"disabled", selected:"selected"} )); |
---|
1583 | |
---|
1584 | }, |
---|
1585 | |
---|
1586 | handleRequestTransitionByTransitionLower : function( result ) |
---|
1587 | { |
---|
1588 | //alert("transitionLower"+this.transitionLower); |
---|
1589 | var transitionsUpperBis = jQuery.parseJSON( result ).transitionsUpperBis; |
---|
1590 | //alert("transitionsUpper"+transitionsUpper); |
---|
1591 | |
---|
1592 | //pour vider les menus déroulant des transitions précédentes |
---|
1593 | // this.selectTransitionLower.clear(); |
---|
1594 | document.getElementById("transition2").length=0; |
---|
1595 | //this.selectTransitionUpper.clear(); |
---|
1596 | document.getElementById("transition1").length=0; |
---|
1597 | // while(0 < document.getElementById("transition1").length) |
---|
1598 | // { |
---|
1599 | // document.getElementById("transition1").options[0] = null; |
---|
1600 | // } |
---|
1601 | |
---|
1602 | |
---|
1603 | //this.selectTransitionLower.add(this.transitionLower, this.transitionLower); |
---|
1604 | this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled"} )); |
---|
1605 | this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:this.transitionLower, text:this.transitionLower, selected:"selected"} )); |
---|
1606 | //this.selectTransitionUpper.add('transition', "Choose a transition"); |
---|
1607 | //rajout du text "Choose a transition" selectionné en premier mais on ne peut pas cliquer dessus |
---|
1608 | this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled", selected:"selected"} )); |
---|
1609 | |
---|
1610 | |
---|
1611 | //pour forcer à afficher le premier élément (et non le premier élément précédent) |
---|
1612 | //this.selectTransitionLower.selectFirst(); |
---|
1613 | //this.selectTransitionUpper.selectFirst(); |
---|
1614 | |
---|
1615 | |
---|
1616 | |
---|
1617 | $.each(transitionsUpperBis, jQuery.proxy( function(index, transitionsUpperBis ) |
---|
1618 | { |
---|
1619 | // this.selectTransitionUpper.add(transitionsUpper, transitionsUpper); |
---|
1620 | this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:transitionsUpperBis, text:transitionsUpperBis} )); |
---|
1621 | |
---|
1622 | }, this)); |
---|
1623 | |
---|
1624 | }, |
---|
1625 | |
---|
1626 | |
---|
1627 | handleRequestTransitionByTransitionUpper : function( result ) |
---|
1628 | { |
---|
1629 | // alert("transitionUpper"+this.transitionUpper); |
---|
1630 | var transitionsLowerBis = jQuery.parseJSON( result ).transitionsLowerBis; |
---|
1631 | //alert("transitionsLower"+transitionsLower); |
---|
1632 | |
---|
1633 | //pour vider les menus déroulant des transitions précédentes |
---|
1634 | // this.selectTransitionLower.clear(); |
---|
1635 | document.getElementById("transition2").length=0; |
---|
1636 | //this.selectTransitionUpper.clear(); |
---|
1637 | document.getElementById("transition1").length=0; |
---|
1638 | |
---|
1639 | // this.selectTransitionLower.add('transition', "Choose a transition"); |
---|
1640 | this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled", selected:"selected"} )); |
---|
1641 | |
---|
1642 | // this.selectTransitionUpper.add(this.transitionUpper, this.transitionUpper); |
---|
1643 | this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled"} )); |
---|
1644 | this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:this.transitionUpper, text:this.transitionUpper, selected:"selected"} )); |
---|
1645 | |
---|
1646 | |
---|
1647 | //pour forcer à afficher le premier élément (et non le premier élément précédent) |
---|
1648 | //this.selectTransitionLower.selectFirst(); |
---|
1649 | //this.selectTransitionUpper.selectFirst(); |
---|
1650 | |
---|
1651 | |
---|
1652 | |
---|
1653 | $.each(transitionsLowerBis, jQuery.proxy( function(index, transitionsLowerBis ) |
---|
1654 | { |
---|
1655 | //this.selectTransitionLower.add(transitionsLower, transitionsLower); |
---|
1656 | this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:transitionsLowerBis, text:transitionsLowerBis} )); |
---|
1657 | }, this)); |
---|
1658 | |
---|
1659 | }, |
---|
1660 | // EVENTS ******************************************************** |
---|
1661 | // |
---|
1662 | //Action quand on clique sur l'onglet DatabaseContents |
---|
1663 | onClickDatabaseContents: function() |
---|
1664 | { |
---|
1665 | //change la couleur des onglets |
---|
1666 | this.ntabContents.active(); |
---|
1667 | this.ntabGlobal.inactive(); |
---|
1668 | this.ntabComparison.inactive(); |
---|
1669 | //change le titre de la page en fonction de l'onglet cliqué |
---|
1670 | document.getElementById('titlePage').innerHTML = ""; |
---|
1671 | document.getElementById('titlePage').innerHTML = "Graphic vizualisation of the GEISA database"; |
---|
1672 | //Eléments qui apparaissent avec cette option |
---|
1673 | document.getElementById("axeY1Gene").style.display= ""; |
---|
1674 | document.getElementById("showAdvancedOptions").style.display= ""; |
---|
1675 | document.getElementById("axeY2Gene").style.display= ""; |
---|
1676 | document.getElementById("drawingOptionsY2").style.display= ""; |
---|
1677 | //Eléments qui disparaissent avec cette option |
---|
1678 | document.getElementById("database2").style.display= "none"; |
---|
1679 | document.getElementById("typePlotDatabase2").style.display= "none"; |
---|
1680 | document.getElementById("outputDatabaseComparison").style.display= "none"; |
---|
1681 | }, |
---|
1682 | //Action quand on clique sur l'onglet GlobalRepresentation |
---|
1683 | onClickGlobalRepresentation: function() |
---|
1684 | { |
---|
1685 | //change la couleur des onglets |
---|
1686 | this.ntabGlobal.active(); |
---|
1687 | this.ntabContents.inactive(); |
---|
1688 | this.ntabComparison.inactive(); |
---|
1689 | //change le titre de la page en fonction de l'onglet cliqué |
---|
1690 | document.getElementById('titlePage').innerHTML = ""; |
---|
1691 | document.getElementById('titlePage').innerHTML = "Global Representation"; |
---|
1692 | //Eléments qui disparaissent avec cette option |
---|
1693 | document.getElementById("database2").style.display= "none"; |
---|
1694 | document.getElementById("axeY1Gene").style.display= "none"; |
---|
1695 | document.getElementById("typePlotDatabase2").style.display= "none"; |
---|
1696 | document.getElementById("showAdvancedOptions").style.display= "none"; |
---|
1697 | document.getElementById("advancedOptions").style.display= "none"; |
---|
1698 | |
---|
1699 | }, |
---|
1700 | //Action quand on clique sur l'onglet DatabasesComparison |
---|
1701 | onClickDatabasesComparison: function() |
---|
1702 | { |
---|
1703 | //change la couleur des onglets |
---|
1704 | this.ntabComparison.active(); |
---|
1705 | this.ntabGlobal.inactive(); |
---|
1706 | this.ntabContents.inactive(); |
---|
1707 | //change le titre de la page en fonction de l'onglet cliqué |
---|
1708 | document.getElementById('titlePage').innerHTML = ""; |
---|
1709 | document.getElementById('titlePage').innerHTML = "Databases Comparison"; |
---|
1710 | //Eléments qui apparaissent avec cette option |
---|
1711 | document.getElementById("database2").style.display= ""; |
---|
1712 | document.getElementById("typePlotDatabase2").style.display= ""; |
---|
1713 | document.getElementById("showAdvancedOptions").style.display= ""; |
---|
1714 | document.getElementById("outputDatabaseComparison").style.display= ""; |
---|
1715 | //Eléments qui disparaissent avec cette option |
---|
1716 | document.getElementById("axeY2Gene").style.display= "none"; |
---|
1717 | document.getElementById("drawingOptionsY2").style.display= "none"; |
---|
1718 | }, |
---|
1719 | |
---|
1720 | |
---|
1721 | //affichage de la valeur du spectral range et affichage du bloc des molecules en fonction de la base de donnees selectionnee |
---|
1722 | onClickSelectDatabase: function(value) |
---|
1723 | { |
---|
1724 | |
---|
1725 | if ('GEISA2011' == value) |
---|
1726 | { |
---|
1727 | //modifier le titre en fonction de la base sélectionnée |
---|
1728 | document.getElementById('spectralRangeTitre').innerHTML = ""; |
---|
1729 | document.getElementById('spectralRangeTitre').innerHTML = "Choosing the spectral range (0 to 35877.030506 cm<sup>-1</sup>) :"; |
---|
1730 | |
---|
1731 | //remplir les valeurs par défaut |
---|
1732 | if($("#rangeLower").val()=="") |
---|
1733 | { |
---|
1734 | $("#rangeLower").val(0); |
---|
1735 | } |
---|
1736 | if($("#rangeUpper").val()=="") |
---|
1737 | { |
---|
1738 | $("#rangeUpper").val(35877.030506); |
---|
1739 | } |
---|
1740 | |
---|
1741 | //Si les valeur entrées par l'utilisateur ne sont pas correctes, on remet les valeurs des bornes |
---|
1742 | if(isNaN(($("#rangeLower").val())) == true || parseFloat( $("#rangeLower").val()) < 0 || parseFloat($("#rangeLower").val()) > 35877.030506) |
---|
1743 | { |
---|
1744 | $("#rangeLower").val(0); |
---|
1745 | } |
---|
1746 | if(isNaN(($("#rangeLower").val())) == true || parseFloat( $("#rangeUpper").val()) < 0 || parseFloat($("#rangeUpper").val()) > 35877.030506) |
---|
1747 | { |
---|
1748 | $("#rangeUpper").val(35877.030506); |
---|
1749 | } |
---|
1750 | |
---|
1751 | //afficher le bon bloc de molécules |
---|
1752 | document.getElementById( "BDD-GEISA2011" ).style.display = ""; |
---|
1753 | document.getElementById( "BDD-GEISAIASI2011" ).style.display = "none"; |
---|
1754 | document.getElementById( "BDD-GEISA2003" ).style.display = "none"; |
---|
1755 | document.getElementById( "BDD-GEISAIASI2003" ).style.display = "none"; |
---|
1756 | } |
---|
1757 | |
---|
1758 | if ('GEISAIASI2011' == value) |
---|
1759 | { |
---|
1760 | document.getElementById('spectralRangeTitre').innerHTML = ""; |
---|
1761 | document.getElementById('spectralRangeTitre').innerHTML = "Choosing spectral range (599.000793 to 3000.998767 cm<sup>-1</sup>) :"; |
---|
1762 | |
---|
1763 | |
---|
1764 | //remplir les valeurs par défaut |
---|
1765 | if($("#rangeLower").val()=="") |
---|
1766 | { |
---|
1767 | $("#rangeLower").val(599.000793); |
---|
1768 | } |
---|
1769 | if($("#rangeUpper").val()=="") |
---|
1770 | { |
---|
1771 | $("#rangeUpper").val(3000.998767); |
---|
1772 | } |
---|
1773 | //Si les valeur entrées par l'utilisateur ne sont pas correctes, on remet les valeurs des bornes |
---|
1774 | if(isNaN(($("#rangeLower").val())) == true || parseFloat( $("#rangeLower").val()) < 599.000793 || parseFloat($("#rangeLower").val()) > 3000.998767) |
---|
1775 | { |
---|
1776 | $("#rangeLower").val(599.000793); |
---|
1777 | } |
---|
1778 | if(isNaN(($("#rangeLower").val())) == true || parseFloat( $("#rangeUpper").val()) < 599.000793 || parseFloat($("#rangeUpper").val()) > 3000.998767) |
---|
1779 | { |
---|
1780 | $("#rangeUpper").val(3000.998767); |
---|
1781 | } |
---|
1782 | |
---|
1783 | document.getElementById( "BDD-GEISA2011" ).style.display = "none"; |
---|
1784 | document.getElementById( "BDD-GEISAIASI2011" ).style.display = ""; |
---|
1785 | document.getElementById( "BDD-GEISA2003" ).style.display = "none"; |
---|
1786 | document.getElementById( "BDD-GEISAIASI2003" ).style.display = "none"; |
---|
1787 | } |
---|
1788 | |
---|
1789 | if ('GEISA2003' == value) |
---|
1790 | { |
---|
1791 | document.getElementById('spectralRangeTitre').innerHTML = ""; |
---|
1792 | document.getElementById('spectralRangeTitre').innerHTML = "Choosing the spectral range (0 to 35877.030506 cm<sup>-1</sup>) :"; |
---|
1793 | |
---|
1794 | //remplir les valeurs par défaut |
---|
1795 | if($("#rangeLower").val()=="") |
---|
1796 | { |
---|
1797 | $("#rangeLower").val(0); |
---|
1798 | } |
---|
1799 | if($("#rangeUpper").val()=="") |
---|
1800 | { |
---|
1801 | $("#rangeUpper").val(35877.030506); |
---|
1802 | } |
---|
1803 | //Si les valeur entrées par l'utilisateur ne sont pas correctes, on remet les valeurs des bornes |
---|
1804 | if(isNaN(($("#rangeLower").val())) == true || parseFloat( $("#rangeLower").val()) < 0 || parseFloat($("#rangeLower").val()) > 35877.030506) |
---|
1805 | { |
---|
1806 | $("#rangeLower").val(0); |
---|
1807 | } |
---|
1808 | if(isNaN(($("#rangeLower").val())) == true || parseFloat( $("#rangeUpper").val()) < 0 || parseFloat($("#rangeUpper").val()) > 35877.030506) |
---|
1809 | { |
---|
1810 | $("#rangeUpper").val(35877.030506); |
---|
1811 | } |
---|
1812 | |
---|
1813 | document.getElementById( "BDD-GEISA2011" ).style.display = "none"; |
---|
1814 | document.getElementById( "BDD-GEISAIASI2011" ).style.display = "none"; |
---|
1815 | document.getElementById( "BDD-GEISA2003" ).style.display = ""; |
---|
1816 | document.getElementById( "BDD-GEISAIASI2003" ).style.display = "none"; |
---|
1817 | } |
---|
1818 | if ('GEISAIASI2003' == value) |
---|
1819 | { |
---|
1820 | document.getElementById('spectralRangeTitre').innerHTML = ""; |
---|
1821 | document.getElementById('spectralRangeTitre').innerHTML = "Choosing spectral range (599.000793 to 3000.998767 cm<sup>-1</sup>) :"; |
---|
1822 | |
---|
1823 | //remplir les valeurs par défaut |
---|
1824 | if($("#rangeLower").val()=="") |
---|
1825 | { |
---|
1826 | $("#rangeLower").val(599.000793); |
---|
1827 | } |
---|
1828 | if($("#rangeUpper").val()=="") |
---|
1829 | { |
---|
1830 | $("#rangeUpper").val(3000.998767); |
---|
1831 | } |
---|
1832 | //Si les valeur entrées par l'utilisateur ne sont pas correctes, on remet les valeurs des bornes |
---|
1833 | if(isNaN(($("#rangeLower").val())) == true || parseFloat( $("#rangeLower").val()) < 599.000793 || parseFloat($("#rangeLower").val()) > 3000.998767) |
---|
1834 | { |
---|
1835 | $("#rangeLower").val(599.000793); |
---|
1836 | } |
---|
1837 | if(isNaN(($("#rangeLower").val())) == true || parseFloat( $("#rangeUpper").val()) < 599.000793 || parseFloat($("#rangeUpper").val()) > 3000.998767) |
---|
1838 | { |
---|
1839 | $("#rangeUpper").val(3000.998767); |
---|
1840 | } |
---|
1841 | |
---|
1842 | document.getElementById( "BDD-GEISA2011" ).style.display = "none"; |
---|
1843 | document.getElementById( "BDD-GEISAIASI2011" ).style.display = "none"; |
---|
1844 | document.getElementById( "BDD-GEISA2003" ).style.display = "none"; |
---|
1845 | document.getElementById( "BDD-GEISAIASI2003" ).style.display = ""; |
---|
1846 | } |
---|
1847 | |
---|
1848 | //mettre a jour le menu déroulant des transitions en fonction des isotopes sélectionnés, de la longueur d'onde et de la base geisa |
---|
1849 | this.requestTransition(); |
---|
1850 | }, |
---|
1851 | |
---|
1852 | //Pour sélectionner-desélectionner tous les isotopes |
---|
1853 | selectAll: function() |
---|
1854 | { |
---|
1855 | var inputs = document.getElementsByTagName( 'input' ); |
---|
1856 | var count = inputs.length; |
---|
1857 | var i=0; |
---|
1858 | |
---|
1859 | |
---|
1860 | if( this.selectButton.getValue() == 'Select all molecules') |
---|
1861 | { |
---|
1862 | for( i = 0; i < count; i++ ) |
---|
1863 | { |
---|
1864 | var input = inputs.item( i ); |
---|
1865 | if( input.type == 'checkbox' ) |
---|
1866 | { |
---|
1867 | input.checked = true; |
---|
1868 | } |
---|
1869 | } |
---|
1870 | this.selectButton.setValue("Unselect all molecules"); |
---|
1871 | |
---|
1872 | } |
---|
1873 | else |
---|
1874 | { |
---|
1875 | for( i = 0; i < count; i++ ) |
---|
1876 | { |
---|
1877 | var input = inputs.item( i ); |
---|
1878 | if( input.type == 'checkbox' ) |
---|
1879 | { |
---|
1880 | input.checked = false; |
---|
1881 | } |
---|
1882 | } |
---|
1883 | this.selectButton.setValue("Select all molecules"); |
---|
1884 | } |
---|
1885 | |
---|
1886 | //mettre a jour le menu déroulant des transitions en fonction des isotopes sélectionnés, de la longueur d'onde et de la base geisa |
---|
1887 | this.requestTransition(); |
---|
1888 | |
---|
1889 | }, |
---|
1890 | |
---|
1891 | //Pour montrer-cacher tous les isotopes |
---|
1892 | viewAll: function() |
---|
1893 | { |
---|
1894 | var divs = document.getElementsByTagName( 'div' ); |
---|
1895 | var count = divs.length; |
---|
1896 | var i = 0; |
---|
1897 | if( this.showButton.getValue() == 'View all isotopologues') |
---|
1898 | { |
---|
1899 | for( i = 0; i < count; i++ ) |
---|
1900 | { |
---|
1901 | //ouvrir que les div dont l'id contient la chaine Cache |
---|
1902 | if (divs.item(i).id.indexOf("Cache") != -1) { |
---|
1903 | divs.item(i).style.display = "" ; |
---|
1904 | } |
---|
1905 | } |
---|
1906 | this.showButton.setValue("Hide all isotopologues"); |
---|
1907 | } |
---|
1908 | else |
---|
1909 | { |
---|
1910 | for( i = 0; i < count; i++ ) |
---|
1911 | { |
---|
1912 | //fermer que les div dont l'id contient la chaine Cache |
---|
1913 | if (divs.item(i).id.indexOf("Cache") != -1) { |
---|
1914 | divs.item(i).style.display = "none" ; |
---|
1915 | } |
---|
1916 | } |
---|
1917 | this.showButton.setValue("View all isotopologues"); |
---|
1918 | } |
---|
1919 | }, |
---|
1920 | |
---|
1921 | //Actions déclenchées quand on clique sur le nom d'une molécule |
---|
1922 | cliquetout: function() |
---|
1923 | { |
---|
1924 | var context = this[0]; |
---|
1925 | // exemple :moleculeName = ch3ch |
---|
1926 | var moleculeName = this[1]; |
---|
1927 | var bddVersion = this[2]; |
---|
1928 | var inputs = document.getElementsByTagName( 'input' ); |
---|
1929 | var count = inputs.length; |
---|
1930 | var i=0; |
---|
1931 | for( i = 0; i < count; i++ ) |
---|
1932 | { |
---|
1933 | var input = inputs.item( i ); |
---|
1934 | //cliquer toutes les molécules et isotopes du meme nom dans toutes les bases |
---|
1935 | //if( input.type == 'checkbox' && ( input.id == ('chk-' + name + '-GEISA-11') || input.id == ('chk-' + name + '-GEISA-03') || input.id == ('chk-' + name + '-GEISA-IASI-11') || input.id == ('chk-' + name + '-GEISA-IASI-03') |
---|
1936 | // || input.id == (name + '-all-GEISA-03') || input.id == (name + '-all-GEISA-11') || input.id == (name + '-all-GEISA-IASI-03') || input.id == (name + '-all-GEISA-IASI-11'))) |
---|
1937 | |
---|
1938 | if( input.type == 'checkbox' && ( input.id.indexOf('chk-' + moleculeName + '_') != -1 || input.id.indexOf('all-'+moleculeName+'-')!= -1 )) |
---|
1939 | |
---|
1940 | { |
---|
1941 | input.checked = document.getElementById( 'all-'+ moleculeName + '-' + bddVersion ).checked; |
---|
1942 | } |
---|
1943 | } |
---|
1944 | //mettre a jour le menu déroulant des transitions en fonction des isotopes sélectionnés, de la longueur d'onde et de la base geisa |
---|
1945 | context.requestTransition(); |
---|
1946 | }, |
---|
1947 | |
---|
1948 | //actions déclenchées quand on clique sur un isotope |
---|
1949 | cliqueIsotope: function() |
---|
1950 | { |
---|
1951 | var context = this[0]; |
---|
1952 | //exemple isotopeName = ch3cn_134 |
---|
1953 | var isotopeName = this[1]; |
---|
1954 | // exemple moleculeName= ch3cn |
---|
1955 | var moleculeName = this[2]; |
---|
1956 | var bddVersion = this[3]; |
---|
1957 | var inputs = document.getElementsByTagName( 'input' ); |
---|
1958 | var count = inputs.length; |
---|
1959 | var i = 0; |
---|
1960 | for( i = 0; i < count; i++ ) |
---|
1961 | { |
---|
1962 | input = inputs.item( i ); |
---|
1963 | |
---|
1964 | //id=chk-ch3cn_234-GEISA2011 |
---|
1965 | //cliquer ou decliquer le meme isotope dans toutes les bases |
---|
1966 | if( input.type == 'checkbox' && input.id.indexOf('chk-' + isotopeName) != -1) |
---|
1967 | { |
---|
1968 | input.checked = document.getElementById( 'chk-' + isotopeName + '-' + bddVersion ).checked; |
---|
1969 | |
---|
1970 | } |
---|
1971 | // id=all-ch3cn-GEISA2011 |
---|
1972 | //pour décocher la case de la molecule quand on décoche un isotope |
---|
1973 | // if( input.type == 'checkbox' && input.id.indexOf('all-'+ moleculeName) != -1 && input.checked == true ) |
---|
1974 | // { |
---|
1975 | // input.checked = false; |
---|
1976 | // } |
---|
1977 | } |
---|
1978 | |
---|
1979 | |
---|
1980 | //pour cocher molecule quand on clique sur un isotope et décocher molécule quand tous les isotopes de la molécule sont décochés |
---|
1981 | var nbIsotopeSelected=0; |
---|
1982 | var input = ""; |
---|
1983 | var j=0; |
---|
1984 | var k=0; |
---|
1985 | |
---|
1986 | //tableau contenant toutes les valeurs du menu déroulant "choosing Database" |
---|
1987 | var databaseValues=context.selectDatabase.getValues(); |
---|
1988 | //taille du menu déroulant |
---|
1989 | var nbdatabaseValues=context.selectDatabase.getSize(); |
---|
1990 | |
---|
1991 | //pour chaque base faire ... |
---|
1992 | for( j = 0; j < nbdatabaseValues ; j++ ) |
---|
1993 | { |
---|
1994 | var nbIsotopeSelected=0; |
---|
1995 | //calcul du nombre d'isotopes sélectionnés pour une molécule précise et une base de données |
---|
1996 | for( k = 0; k < count; k++ ) |
---|
1997 | { |
---|
1998 | input = inputs.item( k ); |
---|
1999 | if( input.type == 'checkbox' && input.id.indexOf('chk-'+moleculeName+'_') != -1 && input.id.indexOf(databaseValues[j]) != -1 && input.checked == true ) |
---|
2000 | { |
---|
2001 | nbIsotopeSelected=nbIsotopeSelected+1; |
---|
2002 | } |
---|
2003 | |
---|
2004 | } |
---|
2005 | //si aucun isotope est sélectionné et que la molécule existe dans cette base alors on décoche la molécule |
---|
2006 | if ( nbIsotopeSelected == 0 && document.getElementById('all-'+ moleculeName+'-'+databaseValues[j])) |
---|
2007 | { |
---|
2008 | document.getElementById('all-'+ moleculeName+'-'+databaseValues[j]).checked=false; |
---|
2009 | } |
---|
2010 | //si au moins unisotope est sélectionné et que la molécule existe dans cette base alors on coche la molécule |
---|
2011 | if ( nbIsotopeSelected > 0 && document.getElementById('all-'+ moleculeName+'-'+databaseValues[j])) |
---|
2012 | { |
---|
2013 | document.getElementById('all-'+ moleculeName+'-'+databaseValues[j]).checked=true; |
---|
2014 | } |
---|
2015 | } |
---|
2016 | |
---|
2017 | |
---|
2018 | //mettre a jour le menu déroulant des transitions en fonction des isotopes sélectionnés, de la longueur d'onde et de la base geisa |
---|
2019 | context.requestTransition(); |
---|
2020 | |
---|
2021 | }, |
---|
2022 | |
---|
2023 | |
---|
2024 | |
---|
2025 | //pour cacher ou voir les isotopes d'une molecule |
---|
2026 | visibilite: function( ) |
---|
2027 | { |
---|
2028 | var context = this[0]; |
---|
2029 | var thingId = this[1]; |
---|
2030 | var divs = document.getElementsByTagName( 'div' ); |
---|
2031 | var count = divs.length; |
---|
2032 | var i = 0; |
---|
2033 | for( i = 0; i < count; i++ ) |
---|
2034 | { |
---|
2035 | var div = divs.item( i ); |
---|
2036 | |
---|
2037 | |
---|
2038 | if ( div.id == thingId) |
---|
2039 | { |
---|
2040 | if( div.style.display == "none" ) |
---|
2041 | { |
---|
2042 | div.style.display = ""; |
---|
2043 | } |
---|
2044 | else |
---|
2045 | { |
---|
2046 | div.style.display = "none"; |
---|
2047 | } |
---|
2048 | } |
---|
2049 | } |
---|
2050 | }, |
---|
2051 | |
---|
2052 | //Faire apparatre ou disparaitre le bloc "advanced options" quand on clique sur le lien "show advanced options" |
---|
2053 | onClickShowAdvancedOptions: function() |
---|
2054 | { |
---|
2055 | //document.getElementById( "advancedOptions" ).style.display = "none"; |
---|
2056 | if( document.getElementById( "advancedOptions" ).style.display == "none" ) |
---|
2057 | { |
---|
2058 | document.getElementById( "advancedOptions" ).style.display = ""; |
---|
2059 | document.getElementById( "aShowHide" ).innerHTML = ""; |
---|
2060 | document.getElementById( "aShowHide" ).innerHTML = "Hide advanced options"; |
---|
2061 | } |
---|
2062 | else |
---|
2063 | { |
---|
2064 | document.getElementById( "advancedOptions" ).style.display = "none"; |
---|
2065 | document.getElementById( "aShowHide" ).innerHTML = ""; |
---|
2066 | document.getElementById( "aShowHide" ).innerHTML = "Show advanced options"; |
---|
2067 | } |
---|
2068 | }, |
---|
2069 | |
---|
2070 | //Alerter l'utilisateur si aucune transition n'a été trouvée |
---|
2071 | OnclickVerifTransition : function() |
---|
2072 | { |
---|
2073 | //si l'utilisateur change les valeurs de spectral range et clique directement sur le menu déroulant des transitions |
---|
2074 | //le menu déroulant ne se met pas à jour avant de faire la vérification |
---|
2075 | this.containerFormSpectralRangeLower.blur(); |
---|
2076 | this.containerFormSpectralRangeUpper.blur(); |
---|
2077 | |
---|
2078 | |
---|
2079 | |
---|
2080 | |
---|
2081 | //si il n'y a qu'un élément dans les menu déroulant transition upper et lower et que la valeur est "transition" |
---|
2082 | //cas où la requete utilisateur est correct mais il n'y a pas de transition pour cette molecule t ce domaine spectral |
---|
2083 | if (document.getElementById('transition1').length==1 && document.getElementById('transition1').options[0].value=="transition" && document.getElementById('transition2').length==1 && document.getElementById('transition2').options[0].value=="transition") |
---|
2084 | { |
---|
2085 | // document.getElementById( "transitionUpper" ).style.display = "none"; |
---|
2086 | // document.getElementById( "transitionLower" ).style.display = "none"; |
---|
2087 | this.selectTransitionUpper.blur(); |
---|
2088 | this.selectTransitionLower.blur(); |
---|
2089 | alert("Change isotopologues selection or spectral range values to obtain transition values"); |
---|
2090 | |
---|
2091 | //document.getElementById( "transitionUpper" ).style.display = ""; |
---|
2092 | //document.getElementById( "transitionLower" ).style.display = ""; |
---|
2093 | } |
---|
2094 | //si il n'y a qu'un élément dans les menu déroulant transition upper et lower et que la valeur est "transition" |
---|
2095 | //cas où la requete est fausse = les valeurs du domaine spectral sont fausses |
---|
2096 | if (document.getElementById('transition1').length==1 && document.getElementById('transition1').options[0].value=="requestError" && document.getElementById('transition2').length==1 && document.getElementById('transition2').options[0].value=="requestError") |
---|
2097 | { |
---|
2098 | this.selectTransitionUpper.blur(); |
---|
2099 | this.selectTransitionLower.blur(); |
---|
2100 | //document.getElementById( "transitionUpper" ).style.display = "none"; |
---|
2101 | // document.getElementById( "transitionLower" ).style.display = "none"; |
---|
2102 | alert("Change spectral range values to obtain transition values"); |
---|
2103 | // document.getElementById( "transitionUpper" ).style.display = ""; |
---|
2104 | // document.getElementById( "transitionLower" ).style.display = ""; |
---|
2105 | } |
---|
2106 | |
---|
2107 | |
---|
2108 | }, |
---|
2109 | |
---|
2110 | onBlurInputMeanValue: function() |
---|
2111 | { |
---|
2112 | //si step est sup a 0, ajout d'une ligne Z aux parametres Y1 et y2 si elle n'est pas déjà présente |
---|
2113 | // !this.selectTraceAxeY1.content('Z') indique que "Z" n'exite pas dans le menu déroulant selectTraceAxeY1 |
---|
2114 | if ($("#meanValue2").val() > 0 && !this.selectTraceAxeY1.content('Z')) |
---|
2115 | // if ($("#meanValue2").val() > 0 && document.getElementById('selectAxeY1').options[document.getElementById('selectAxeY1').selectedIndex].value != "Z") |
---|
2116 | { |
---|
2117 | |
---|
2118 | this.selectTraceAxeY1.add( 'Z', "Number of lines ", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) ); |
---|
2119 | this.selectTraceAxeY2.add( 'Z', "Number of lines ", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) ); |
---|
2120 | //this.selectTraceAxeY1.append($( document.createElement( "option" ) ).attr( {value:"Z", text:"Number of lines"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY1, [this, "Z" ]))); |
---|
2121 | //this.selectTraceAxeY2.append($( document.createElement( "option" ) ).attr( {value:"Z", text:"Number of lines"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY2, [this, "Z" ]))); |
---|
2122 | } |
---|
2123 | //si step = a 0 et autres valeurs (a faire) , retrait de la ligne Z aux parametres Y1 et y2 |
---|
2124 | if ($("#meanValue2").val() == 0) |
---|
2125 | { |
---|
2126 | this.selectTraceAxeY1.remove( 'Z', "Number of lines ", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) ); |
---|
2127 | this.selectTraceAxeY2.remove( 'Z', "Number of lines ", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) ); |
---|
2128 | //Selection par defaut du 1er element (pour que "Number of lines" ne soit plus selectionne par defaut si il n'existe plus) |
---|
2129 | this.selectTraceAxeY1.selectFirst(); |
---|
2130 | this.selectTraceAxeY2.selectFirst(); |
---|
2131 | } |
---|
2132 | }, |
---|
2133 | |
---|
2134 | onClickSelectNbCourbes: function(value) |
---|
2135 | { |
---|
2136 | var context = this[0]; |
---|
2137 | var optionVal = this[1]; |
---|
2138 | |
---|
2139 | //si plusieurs courbes choisis pour les isotopes et ou molecules, les choix pour Y2 sont inactifs |
---|
2140 | if ('cm' == value || 'ci' == value) |
---|
2141 | //if ('cm' == optionVal || 'ci' == optionVal) |
---|
2142 | { |
---|
2143 | //transformer le texte en gris |
---|
2144 | document.getElementById("axeY2Titre").className = "notActiveText"; |
---|
2145 | document.getElementById("scaleY2Titre").className = "notActiveText"; |
---|
2146 | document.getElementById("typePlotY2Titre").className = "notActiveText"; |
---|
2147 | //pour rendre le menu déroulant inactif |
---|
2148 | this.selectTraceAxeY2.disable(); |
---|
2149 | this.selectScaleY2.disable(); |
---|
2150 | this.selectTypeTraceY2.disable(); |
---|
2151 | //document.getElementById("selectAxeY2" ).disabled=true; |
---|
2152 | //document.getElementById("selectScaleY2" ).disabled=true; |
---|
2153 | //document.getElementById("selectTypePlotY2" ).disabled=true; |
---|
2154 | |
---|
2155 | } |
---|
2156 | //si une seule courbe choisie pour les isotopes et ou molecules, les choix pour Y2 sont actifs |
---|
2157 | if ('ca' == value || 'gm' == value || 'gi' == value) |
---|
2158 | //if ('ca' == optionVal || 'gm' == optionVal || 'gi' == optionVal) |
---|
2159 | { |
---|
2160 | //remet le texte en couleur active |
---|
2161 | document.getElementById("axeY2Titre").className = "activeText"; |
---|
2162 | //rendre actif l'echelle que si l'intensite est choisie dans les parametres |
---|
2163 | if (this.selectTraceAxeY2.getValue() == 'B') |
---|
2164 | { |
---|
2165 | document.getElementById("scaleY2Titre").className = "activeText"; |
---|
2166 | } |
---|
2167 | //rendre actif le type de plot si ce n'est pas la valeur none qui est choisie |
---|
2168 | if (this.selectTraceAxeY2.getValue() != 'no') |
---|
2169 | { |
---|
2170 | document.getElementById("typePlotY2Titre").className = "activeText"; |
---|
2171 | } |
---|
2172 | //pour rendre les menu déroulant actifs |
---|
2173 | this.selectTraceAxeY2.enable(); |
---|
2174 | //rendre actif l'echelle que si l'intensite est choisie dans les parametres |
---|
2175 | if (this.selectTraceAxeY2.getValue() == 'B') |
---|
2176 | { |
---|
2177 | this.selectScaleY2.enable(); |
---|
2178 | } |
---|
2179 | //rendre actif le type de plot si ce n'est pas la valeur none qui est choisie |
---|
2180 | if (this.selectTraceAxeY2.getValue() != 'no') |
---|
2181 | { |
---|
2182 | this.selectTypeTraceY2.enable(); |
---|
2183 | } |
---|
2184 | |
---|
2185 | //remet le texte en couleur active |
---|
2186 | // document.getElementById("axeY2Titre").className = "activeText"; |
---|
2187 | //pour rendre les menu déroulant actifs |
---|
2188 | // document.getElementById("selectAxeY2" ).disabled=false; |
---|
2189 | //rendre actif l'echelle que si l'intensite est choisie dans les parametres |
---|
2190 | // if (document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value == 'B') |
---|
2191 | // { |
---|
2192 | // document.getElementById("scaleY2Titre").className = "activeText"; |
---|
2193 | // document.getElementById("selectScaleY2" ).disabled=false; |
---|
2194 | //} |
---|
2195 | //rendre actif le type de plot si ce n'est pas la valeur none qui est choisie |
---|
2196 | // if (document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value != 'no') |
---|
2197 | //{ |
---|
2198 | // document.getElementById("typePlotY2Titre").className = "activeText"; |
---|
2199 | // document.getElementById("selectTypePlotY2" ).disabled=false; |
---|
2200 | //} |
---|
2201 | } |
---|
2202 | |
---|
2203 | |
---|
2204 | }, |
---|
2205 | |
---|
2206 | |
---|
2207 | onClickSelectTraceAxeY1: function(value) |
---|
2208 | { |
---|
2209 | //si intensite n'est pas choisi pour Y1, le type d'échelle est inactif |
---|
2210 | if (this.selectTraceAxeY1.getValue() != 'B') |
---|
2211 | // if ( document.getElementById('selectAxeY1').options[document.getElementById('selectAxeY1').selectedIndex].value != 'B') |
---|
2212 | { |
---|
2213 | //transformer le texte en gris |
---|
2214 | document.getElementById("scaleY1Titre").className = "notActiveText"; |
---|
2215 | //pour rendre le menu déroulant inactif |
---|
2216 | this.selectScaleY1.disable(); |
---|
2217 | // document.getElementById("selectScaleY1" ).disabled=true; |
---|
2218 | } |
---|
2219 | //si intensite est choisi pour Y1, le type d'échelle est actif |
---|
2220 | if (this.selectTraceAxeY1.getValue() == 'B') |
---|
2221 | //if ( document.getElementById('selectAxeY1').options[document.getElementById('selectAxeY1').selectedIndex].value == 'B') |
---|
2222 | { |
---|
2223 | //transformer le texte en gris |
---|
2224 | document.getElementById("scaleY1Titre").className = "activeText"; |
---|
2225 | //pour rendre le menu déroulant inactif |
---|
2226 | this.selectScaleY1.enable(); |
---|
2227 | // document.getElementById("selectScaleY1" ).disabled=false; |
---|
2228 | } |
---|
2229 | }, |
---|
2230 | |
---|
2231 | onClickSelectTraceAxeY2: function(value) |
---|
2232 | { |
---|
2233 | //si intensite n'est pas choisi pour Y2, le type d'échelle est inactif |
---|
2234 | if (this.selectTraceAxeY2.getValue() != 'B') |
---|
2235 | //if ( document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value != 'B') |
---|
2236 | { |
---|
2237 | //transformer le texte en gris |
---|
2238 | document.getElementById("scaleY2Titre").className = "notActiveText"; |
---|
2239 | //pour rendre le menu déroulant inactif |
---|
2240 | this.selectScaleY2.disable(); |
---|
2241 | //document.getElementById("selectScaleY2" ).disabled=true; |
---|
2242 | } |
---|
2243 | //si intensite est choisi pour Y2, le type d'échelle est actif |
---|
2244 | if (this.selectTraceAxeY2.getValue() == 'B') |
---|
2245 | //if ( document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value == 'B') |
---|
2246 | { |
---|
2247 | //transformer le texte en foncé |
---|
2248 | document.getElementById("scaleY2Titre").className = "activeText"; |
---|
2249 | //pour rendre le menu déroulant actif |
---|
2250 | this.selectScaleY2.enable(); |
---|
2251 | //document.getElementById("selectScaleY2" ).disabled=false; |
---|
2252 | } |
---|
2253 | //si aucun parametre est choisi pour Y2, le type de plot est inactif |
---|
2254 | if (this.selectTraceAxeY2.getValue() == 'no') |
---|
2255 | //if ( document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value == 'no') |
---|
2256 | { |
---|
2257 | //transformer le texte en gris |
---|
2258 | document.getElementById("typePlotY2Titre").className = "notActiveText"; |
---|
2259 | //pour rendre le menu déroulant inactif |
---|
2260 | this.selectTypeTraceY2.disable(); |
---|
2261 | // document.getElementById("selectTypePlotY2" ).disabled=true; |
---|
2262 | } |
---|
2263 | //si un parametre est choisi pour Y2, le type de plot est actif |
---|
2264 | if (this.selectTraceAxeY2.getValue() != 'no') |
---|
2265 | // if ( document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value != 'no') |
---|
2266 | { |
---|
2267 | //transformer le texte en foncé |
---|
2268 | document.getElementById("typePlotY2Titre").className = "activeText"; |
---|
2269 | //pour rendre le menu déroulant actif |
---|
2270 | this.selectTypeTraceY2.enable(); |
---|
2271 | //document.getElementById("selectTypePlotY2" ).disabled=false; |
---|
2272 | } |
---|
2273 | |
---|
2274 | }, |
---|
2275 | |
---|
2276 | //bouton reset de toute la page (rechargement de la page) |
---|
2277 | resetPage: function() |
---|
2278 | { |
---|
2279 | //location.reload(); //pas appliquée car supprime la fenêtre graphique |
---|
2280 | |
---|
2281 | //reset du choix de la base de données |
---|
2282 | // selectFirst : affiche le premier élément de la liste |
---|
2283 | //true : active la fonction associée au bouton |
---|
2284 | //this.selectDatabase.selectFirst( true ); |
---|
2285 | |
---|
2286 | //cacher tous les isotopes |
---|
2287 | var divs = document.getElementsByTagName( 'div' ); |
---|
2288 | var count = divs.length; |
---|
2289 | var i = 0; |
---|
2290 | |
---|
2291 | for( i = 0; i < count; i++ ) |
---|
2292 | { |
---|
2293 | //fermer que les div dont l'id contient la chaine Cache |
---|
2294 | if (divs.item(i).id.indexOf("Cache") != -1) { |
---|
2295 | divs.item(i).style.display = "none" ; |
---|
2296 | } |
---|
2297 | } |
---|
2298 | this.showButton.setValue("View all isotopologues"); |
---|
2299 | |
---|
2300 | //déselectionner tous les isotopes |
---|
2301 | var inputs = document.getElementsByTagName( 'input' ); |
---|
2302 | var count = inputs.length; |
---|
2303 | var i=0; |
---|
2304 | |
---|
2305 | for( i = 0; i < count; i++ ) |
---|
2306 | { |
---|
2307 | var input = inputs.item( i ); |
---|
2308 | if( input.type == 'checkbox' ) |
---|
2309 | { |
---|
2310 | input.checked = false; |
---|
2311 | } |
---|
2312 | } |
---|
2313 | this.selectButton.setValue("Select all isotopologues"); |
---|
2314 | |
---|
2315 | //spectral range |
---|
2316 | //$("#rangeLower").val(0); |
---|
2317 | //$("#rangeUpper").val(35877.030506); |
---|
2318 | $("#rangeLower").val(""); |
---|
2319 | $("#rangeUpper").val(""); |
---|
2320 | $("#sampStep").val(""); |
---|
2321 | |
---|
2322 | //intensity range |
---|
2323 | $("#intensityLo").val(0); |
---|
2324 | $("#intensityUp").val(1e-16); |
---|
2325 | |
---|
2326 | this.selectNbCourbes.selectFirst( true ); |
---|
2327 | |
---|
2328 | this.selectTraceAxeY1.selectFirst( true ); |
---|
2329 | this.selectScaleY1.selectFirst( true ); |
---|
2330 | this.selectTypeTraceY1.selectFirst( true ); |
---|
2331 | |
---|
2332 | document.getElementById("transition1").length=0; |
---|
2333 | document.getElementById("transition2").length=0; |
---|
2334 | this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"Select a molecule", selected:"selected"} )); |
---|
2335 | this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"Select a molecule", selected:"selected"} )); |
---|
2336 | $("#transitionUpper").removeClass("notActiveText"); |
---|
2337 | $("#transitionLower").removeClass("notActiveText"); |
---|
2338 | |
---|
2339 | |
---|
2340 | $("#meanValue2").val(""); |
---|
2341 | |
---|
2342 | this.selectTraceAxeY2.selectFirst( true ); |
---|
2343 | this.selectScaleY2.selectFirst( true ); |
---|
2344 | this.selectTypeTraceY2.selectFirst( true ); |
---|
2345 | |
---|
2346 | }, |
---|
2347 | |
---|
2348 | onClickSubmit: function() |
---|
2349 | { |
---|
2350 | this.requestGeisa(); |
---|
2351 | }, |
---|
2352 | |
---|
2353 | displayWindow: function(content) |
---|
2354 | { |
---|
2355 | //fermeture de la div de l'image d'attente |
---|
2356 | this.loadingGraphics.hide(); |
---|
2357 | |
---|
2358 | // var content = '<img src=' + this.pathImg + ' /><a href="project?methodName=downloadFile&fileName=' + this.nameImg + '"><button class="dataProtocolDownloadButton">Download</button></a>'; |
---|
2359 | |
---|
2360 | //alert(content); |
---|
2361 | var $dialog = $( '<div></div>' ) |
---|
2362 | |
---|
2363 | .html( content ) |
---|
2364 | |
---|
2365 | .dialog( { |
---|
2366 | autoOpen: false, |
---|
2367 | title: "GEISA : spectroscopic database", |
---|
2368 | //buttons: { "Close": function() { $(this).dialog("close"); }, "Min": function() { $(this).dialog({ height: 20, width:350 }); },"Max": function() { $(this).dialog({ height: 560, width:700 }); } }, |
---|
2369 | buttons:{ |
---|
2370 | "close":{ |
---|
2371 | id:'close', |
---|
2372 | text:'Close', |
---|
2373 | height:'30px', |
---|
2374 | width:'53px', |
---|
2375 | title :'to close the window', |
---|
2376 | click: function() { $(this).dialog("close"); }, |
---|
2377 | }, |
---|
2378 | "min" :{ |
---|
2379 | id:'Min', |
---|
2380 | text:'-', |
---|
2381 | height:'30px', |
---|
2382 | width:'30px', |
---|
2383 | title :'to reduce the window', |
---|
2384 | click: function() { $(this).dialog({ height:18, width:350 }); }, |
---|
2385 | }, |
---|
2386 | "max" :{ |
---|
2387 | id:'Max', |
---|
2388 | text:'+', |
---|
2389 | height:'30px', |
---|
2390 | width:'30px', |
---|
2391 | title :'to enlarge the window ', |
---|
2392 | click: function() { $(this).dialog({ height: 640, width:700 }); }, |
---|
2393 | }, |
---|
2394 | }, |
---|
2395 | |
---|
2396 | //minHeight: 500, |
---|
2397 | // minWidth: 660, |
---|
2398 | height: 640, |
---|
2399 | width:700, |
---|
2400 | //Exemple de valeurs possible pour position : "middle", "top", [200, 100] |
---|
2401 | position: "middle" |
---|
2402 | } ); |
---|
2403 | $dialog.dialog( 'open' ); |
---|
2404 | }, |
---|
2405 | |
---|
2406 | // displayWindow: function(coordinate) |
---|
2407 | //{ |
---|
2408 | //var content = '<img src=' + this.pathImg + ' /><a href="project?methodName=downloadFile&fileName=bib.txt"><button class="dataProtocolDownloadButton">Download</button></a>'; |
---|
2409 | // var content = '<img src=' + this.pathImg + ' /><a href="project?methodName=downloadFile&fileName=' + this.nameImg + '"><button class="dataProtocolDownloadButton">Download</button></a>'; |
---|
2410 | |
---|
2411 | //alert(content); |
---|
2412 | // var $dialog = $( '<div></div>' ) |
---|
2413 | // .html( content + content1 ) |
---|
2414 | |
---|
2415 | // .dialog( { |
---|
2416 | // autoOpen: false, |
---|
2417 | // title: "GEISA : spectroscopic database", |
---|
2418 | // minHeight: 500, |
---|
2419 | // minWidth: 660, |
---|
2420 | |
---|
2421 | //coordonnee y y |
---|
2422 | // position:coordinate |
---|
2423 | |
---|
2424 | // } ); |
---|
2425 | // $dialog.dialog( 'open' ) |
---|
2426 | //}, |
---|
2427 | |
---|
2428 | |
---|
2429 | onClickDownload: function() |
---|
2430 | { |
---|
2431 | document.location.href = "project?methodName=downloadFile&fileName=bib.txt"; |
---|
2432 | } |
---|
2433 | |
---|
2434 | |
---|
2435 | } ); |
---|
2436 | |
---|
2437 | |
---|
2438 | </script> |
---|
2439 | |
---|
2440 | |
---|
2441 | |
---|