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 | |
---|
488 | var paramDatabase2 = new Object(); |
---|
489 | paramDatabase2.id = "selectDatabase2"; |
---|
490 | paramDatabase2.parent = $("#database2"); |
---|
491 | this.selectDatabase2 = new Select( paramDatabase2 ); |
---|
492 | this.selectDatabase2.add( 'GEISA2011', "GEISA 2011"); |
---|
493 | this.selectDatabase2.add( 'GEISA2003', "GEISA 2003"); |
---|
494 | this.selectDatabase2.add( 'HITRAN2009', "HITRAN 2009" ); |
---|
495 | this.selectDatabase2.selectFirst( false ); |
---|
496 | |
---|
497 | |
---|
498 | |
---|
499 | |
---|
500 | //création du bloc des molécules |
---|
501 | this.createMolecules($('#BDD-GEISA2011'), this.arrayGeisa2011, "GEISA2011"); |
---|
502 | this.createMolecules($('#BDD-GEISA2003'), this.arrayGeisa2003, "GEISA2003"); |
---|
503 | this.createMolecules($('#BDD-GEISAIASI2011'), this.arrayGeisaIasi2011, "GEISAIASI2011"); |
---|
504 | this.createMolecules($('#BDD-GEISAIASI2003'), this.arrayGeisaIasi2003, "GEISAIASI2003"); |
---|
505 | |
---|
506 | //bouton selection-deselection toutes les molécules et isotopes |
---|
507 | this.selectButton = new Button( {value:"Select all molecules", parent:$( "#selectAndShow" ), id:"buttonSelect", className: "gray_button", onClick:jQuery.proxy( this.selectAll, this )} ); |
---|
508 | //bouton montrer-cacher les isotopes |
---|
509 | this.showButton = new Button( {value:"View all isotopologues", parent:$( "#selectAndShow" ), id:"buttonShow", className: "gray_button", onClick:jQuery.proxy( this.viewAll, this )} ); |
---|
510 | |
---|
511 | |
---|
512 | |
---|
513 | //Zone texte SpectralRange |
---|
514 | //Titre général (qui changera en fonction de la base geisa choisie) |
---|
515 | document.getElementById('spectralRangeTitre').innerHTML = ""; |
---|
516 | document.getElementById('spectralRangeTitre').innerHTML = "Choosing the spectral range (0 to 35877.030506 cm<sup>-1</sup>) :"; |
---|
517 | |
---|
518 | //Titre |
---|
519 | document.getElementById("spectralRangeLower").innerHTML = "Lower value, cm<sup>-1</sup> : "; |
---|
520 | document.getElementById("spectralRangeUpper").innerHTML = "Upper value, cm<sup>-1</sup> : "; |
---|
521 | document.getElementById("samplingStep").innerHTML = "<br> Splitting step, cm<sup>-1</sup> : <a href='#' TITLE='Split equally the selected spectral range for generating a series of graphs. Default case: one graph for the whole spectral range.'><img src='resources/images/elements/index.jpeg' height='16px' width='16px'></a> "; |
---|
522 | //zone texte SpectralRangeLower |
---|
523 | var inputSpectralRangeLower = $( document.createElement( "input" ) ); |
---|
524 | inputSpectralRangeLower.attr( {id:"rangeLower", class:"styleInputs"} ); |
---|
525 | inputSpectralRangeLower.val(0); |
---|
526 | //pour mettre à jour le menu déroulant des transitions |
---|
527 | inputSpectralRangeLower.bind( 'blur', this, jQuery.proxy( this.requestTransition, this )); |
---|
528 | this.containerFormSpectralRangeLower.append( inputSpectralRangeLower ); |
---|
529 | //zone texte SpectralRangeUpper |
---|
530 | var inputSpectralRangeUpper = $( document.createElement( "input" ) ); |
---|
531 | inputSpectralRangeUpper.attr( {id:"rangeUpper"} ); |
---|
532 | inputSpectralRangeUpper.val(35877.030506); |
---|
533 | //pour mettre à jour le menu déroulant des transitions lorsque l'on change la valeur du spectral range |
---|
534 | inputSpectralRangeUpper.bind( 'blur', this, jQuery.proxy( this.requestTransition, this )); |
---|
535 | this.containerFormSpectralRangeUpper.append( inputSpectralRangeUpper ); |
---|
536 | //zone texte Sampling step Splitting step |
---|
537 | var inputSamplingStep = $( document.createElement( "input" ) ); |
---|
538 | inputSamplingStep.attr( {id:"sampStep", size:6} ); |
---|
539 | $("#samplingStep").append( inputSamplingStep ); |
---|
540 | |
---|
541 | |
---|
542 | |
---|
543 | |
---|
544 | //Zone texte Intensity |
---|
545 | //Titre |
---|
546 | document.getElementById("intensityLower").innerHTML = "Lower value, cm/mol. : " |
---|
547 | document.getElementById("intensityUpper").innerHTML = "Upper value, cm/mol. : " |
---|
548 | //zone texte IntensityLower |
---|
549 | var inputIntensityLower = $( document.createElement( "input" ) ); |
---|
550 | inputIntensityLower.attr( {id:"intensityLo", class:"styleInputs"} ); |
---|
551 | inputIntensityLower.val(0); |
---|
552 | this.containerFormIntensityLower.append( inputIntensityLower ); |
---|
553 | //zone texte IntensityUpper |
---|
554 | var inputIntensityUpper = $( document.createElement( "input" ) ); |
---|
555 | inputIntensityUpper.attr( {id:"intensityUp"} ); |
---|
556 | inputIntensityUpper.val(1e-16); |
---|
557 | this.containerFormIntensityUpper.append( inputIntensityUpper ); |
---|
558 | |
---|
559 | |
---|
560 | // Create menu deroulant 1er choix axe des y |
---|
561 | //Titre |
---|
562 | var titleAxeY1 = document.createTextNode("Select parameter (left Y-axis)"); |
---|
563 | document.getElementById("axeY1").appendChild(titleAxeY1); |
---|
564 | var spaceBr = document.createElement ("br"); |
---|
565 | document.getElementById("axeY1").appendChild(spaceBr); |
---|
566 | //menu déroulant |
---|
567 | var paramSelectAxeY1 = new Object(); |
---|
568 | paramSelectAxeY1.id = "selectAxeY1"; |
---|
569 | paramSelectAxeY1.parent = $("#axeY1"); |
---|
570 | this.selectTraceAxeY1 = new Select( paramSelectAxeY1 ); |
---|
571 | this.selectTraceAxeY1.add( 'B', "Intensity", jQuery.proxy(this.onClickSelectTraceAxeY1, this )); |
---|
572 | this.selectTraceAxeY1.add( 'C', "Air broadening pressure halfwidth HWHM", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) ); |
---|
573 | this.selectTraceAxeY1.add( 'D', "Energy of the lower transition level", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) ); |
---|
574 | this.selectTraceAxeY1.add( 'F', "Temperature dependence coefficient n of HWHM", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) ); |
---|
575 | this.selectTraceAxeY1.add( 'N', "Self broadening pressure halfwidth (HWHMself)", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) ); |
---|
576 | this.selectTraceAxeY1.add( 'O', "Air pressure shift of the line transition", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) ); |
---|
577 | this.selectTraceAxeY1.add( 'R', "Temperature dependence coeff. of the air pressure shift", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) ); |
---|
578 | this.selectTraceAxeY1.selectFirst( false ); |
---|
579 | |
---|
580 | // Create menu deroulant type de graphe |
---|
581 | //Titre |
---|
582 | var titleTypeTrace = document.createTextNode("Type of graph"); |
---|
583 | document.getElementById("nbCourbes").appendChild(titleTypeTrace); |
---|
584 | var spaceBr = document.createElement ("br"); |
---|
585 | document.getElementById("nbCourbes").appendChild(spaceBr); |
---|
586 | //menu déroulant |
---|
587 | var paramNbCourbes = new Object(); |
---|
588 | paramNbCourbes.id = "selectNbCourbes"; |
---|
589 | paramNbCourbes.parent = $("#nbCourbes"); |
---|
590 | this.selectNbCourbes = new Select( paramNbCourbes ); |
---|
591 | this.selectNbCourbes.add( 'ca', "One curve for all selection", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); |
---|
592 | this.selectNbCourbes.add( 'cm', "Separated molecules : same graph", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); |
---|
593 | this.selectNbCourbes.add( 'gm', "Separated molecules : different graphs", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); |
---|
594 | this.selectNbCourbes.add( 'gi', "Separated isotopologues : different graphs", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); |
---|
595 | this.selectNbCourbes.add( 'ci', "Separated isotopologues : same graph", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); |
---|
596 | this.selectNbCourbes.selectFirst( false ); |
---|
597 | |
---|
598 | // Create menu deroulant type d'échelle linéaire ou logarithmique pour le choix y1 |
---|
599 | //Titre |
---|
600 | var titleScaleY1 = document.createTextNode("Select the type of Scale (if intensity is choosen)"); |
---|
601 | document.getElementById("scaleY1Titre").appendChild(titleScaleY1); |
---|
602 | //menu déroulant |
---|
603 | var paramSelectScaleY1 = new Object(); |
---|
604 | paramSelectScaleY1.id = "selectScaleY1"; |
---|
605 | paramSelectScaleY1.parent = $("#scaleY1"); |
---|
606 | this.selectScaleY1 = new Select( paramSelectScaleY1 ); |
---|
607 | this.selectScaleY1.add( 'l', "Linear" ); |
---|
608 | this.selectScaleY1.add( '-log_scale', "Logarithmic" ); |
---|
609 | this.selectScaleY1.selectFirst( false ); |
---|
610 | |
---|
611 | |
---|
612 | // Create menu deroulant style de tracer Y1 |
---|
613 | //Titre |
---|
614 | var titleTypeTrace = document.createTextNode("Select the type of plot"); |
---|
615 | document.getElementById("typePlotY1Titre").appendChild(titleTypeTrace); |
---|
616 | var spaceBr = document.createElement ("br"); |
---|
617 | document.getElementById("typePlotY1Titre").appendChild(spaceBr); |
---|
618 | //menu déroulant |
---|
619 | var paramSelectTypeTraceY1 = new Object(); |
---|
620 | paramSelectTypeTraceY1.id = "selectTypePlotY1"; |
---|
621 | paramSelectTypeTraceY1.parent = $("#typePlotY1"); |
---|
622 | this.selectTypeTraceY1 = new Select( paramSelectTypeTraceY1 ); |
---|
623 | this.selectTypeTraceY1.add( 'l', "Lines" ); |
---|
624 | this.selectTypeTraceY1.add( 'p', "Dots" ); |
---|
625 | this.selectTypeTraceY1.add( 'i', "Peaks" ); |
---|
626 | this.selectTypeTraceY1.add( 'lp', "Lines and Dots" ); |
---|
627 | this.selectTypeTraceY1.selectFirst( false ); |
---|
628 | |
---|
629 | //menu déroulant tracé de la 2Úme base pour l'onglet "Database comparison" |
---|
630 | var paramSelectTypeTraceDatabase2 = new Object(); |
---|
631 | paramSelectTypeTraceDatabase2.id = "selectTypePlotDatabase2"; |
---|
632 | paramSelectTypeTraceDatabase2.parent = $("#typePlotDatabase2"); |
---|
633 | this.selectTypeTraceDatabase2 = new Select( paramSelectTypeTraceDatabase2 ); |
---|
634 | this.selectTypeTraceDatabase2.add( 'l', "Lines" ); |
---|
635 | this.selectTypeTraceDatabase2.add( 'p', "Dots" ); |
---|
636 | this.selectTypeTraceDatabase2.add( 'i', "Peaks" ); |
---|
637 | this.selectTypeTraceDatabase2.add( 'lp', "Lines and Dots" ); |
---|
638 | this.selectTypeTraceDatabase2.selectFirst( false ); |
---|
639 | |
---|
640 | |
---|
641 | //lien pour montrer ou cacher le bloc "advanced options" |
---|
642 | var showHide = $(document.createElement("a")); |
---|
643 | showHide.html("Show advanced options"); |
---|
644 | showHide.attr( {id:"aShowHide", class:"fieldsetGeneralTitle"} ); |
---|
645 | showHide.bind( 'click', this, jQuery.proxy( this.onClickShowAdvancedOptions)); |
---|
646 | $("#showAdvancedOptions").append(showHide); |
---|
647 | |
---|
648 | |
---|
649 | //titre menu deroulant transition upper |
---|
650 | var titleTransitionUpper = document.createTextNode("Upper state : "); |
---|
651 | document.getElementById("transitionUpper").appendChild(titleTransitionUpper); |
---|
652 | //titre menu deroulant transition upper |
---|
653 | this.selectTransitionUpper = $( document.createElement( "select" ) ); |
---|
654 | this.selectTransitionUpper.attr( {id:"transition1"} ); |
---|
655 | //fonction sur le menu déroulant (des qu'on clique dessus) et non sur chacune des options |
---|
656 | this.selectTransitionUpper.bind( 'click', jQuery.proxy(this.OnclickVerifTransition, this)); |
---|
657 | var optTransitionUpper = $( document.createElement( "option" ) ); |
---|
658 | optTransitionUpper.attr( {value:"-1", text:"Select a molecule"} ); |
---|
659 | this.selectTransitionUpper.append(optTransitionUpper); |
---|
660 | $("#transitionUpper").append(this.selectTransitionUpper); |
---|
661 | |
---|
662 | |
---|
663 | //titre menu deroulant transition lower |
---|
664 | var titleTransitionLower = document.createTextNode("Lower state : "); |
---|
665 | document.getElementById("transitionLower").appendChild(titleTransitionLower); |
---|
666 | // Create menu deroulant transition lower |
---|
667 | this.selectTransitionLower = $( document.createElement( "select" ) ); |
---|
668 | this.selectTransitionLower.attr( {id:"transition2"} ); |
---|
669 | this.selectTransitionLower.bind( 'click', jQuery.proxy(this.OnclickVerifTransition, this)); |
---|
670 | var optTransitionLower = $( document.createElement( "option" ) ); |
---|
671 | optTransitionLower.attr( {value:"-1", text:"Select a molecule"} ); |
---|
672 | this.selectTransitionLower.append(optTransitionLower); |
---|
673 | $("#transitionLower").append(this.selectTransitionLower); |
---|
674 | |
---|
675 | //bouton reset pour les transition |
---|
676 | var resetButton = new Button( {value:"Reset", parent:$( "#transitionReset" ), id:"buttonReset", className: "gray_button", onClick:jQuery.proxy( this.requestTransition, this )} ); |
---|
677 | |
---|
678 | |
---|
679 | //Zone text Mean Value Bin-average |
---|
680 | //Titre |
---|
681 | var titleMeanValue = document.createTextNode("Bin-average : "); |
---|
682 | document.getElementById("meanValue1").appendChild(titleMeanValue); |
---|
683 | //champ input |
---|
684 | var inputMeanValue = $( document.createElement( "input" ) ); |
---|
685 | inputMeanValue.attr( {id:"meanValue2", size:6} ); |
---|
686 | inputMeanValue.val(0); |
---|
687 | this.containerFormMeanValue1.append( inputMeanValue ); |
---|
688 | inputMeanValue.bind( 'blur', this, jQuery.proxy( this.onBlurInputMeanValue, this )); |
---|
689 | |
---|
690 | |
---|
691 | // Create menu deroulant 2eme choix axe des y |
---|
692 | //Titre |
---|
693 | var titleAxeY2 = document.createTextNode("Select secondary parameter (right Y-axis)"); |
---|
694 | document.getElementById("axeY2Titre").appendChild(titleAxeY2); |
---|
695 | //menu déroulant |
---|
696 | var paramSelectAxeY2 = new Object(); |
---|
697 | paramSelectAxeY2.id = "selectAxeY2"; |
---|
698 | paramSelectAxeY2.parent = $("#axeY2"); |
---|
699 | this.selectTraceAxeY2 = new Select( paramSelectAxeY2 ); |
---|
700 | this.selectTraceAxeY2.add( 'no', "None", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) ); |
---|
701 | this.selectTraceAxeY2.add( 'B', "Intensity", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) ); |
---|
702 | this.selectTraceAxeY2.add( 'C', "Air broadening pressure halfwidth HWHM", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) ); |
---|
703 | this.selectTraceAxeY2.add( 'D', "Energy of the lower transition level", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) ); |
---|
704 | this.selectTraceAxeY2.add( 'F', "Temperature dependence coefficient n of HWHM", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) ); |
---|
705 | this.selectTraceAxeY2.add( 'N', "Self broadening pressure halfwidth (HWHMself)", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) ); |
---|
706 | this.selectTraceAxeY2.add( 'O', "Air pressure shift of the line transition", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) ); |
---|
707 | this.selectTraceAxeY2.add( 'R', "Temperature dependence coeff. of the air pressure shift", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) ); |
---|
708 | this.selectTraceAxeY2.selectFirst( false ); |
---|
709 | |
---|
710 | |
---|
711 | // Create menu deroulant type d'échelle linéaire ou logarithmique pour le choix y2 |
---|
712 | //Titre |
---|
713 | var titleScaleY2 = document.createTextNode("Select the type of Scale (if intensity is choosen)"); |
---|
714 | document.getElementById("scaleY2Titre").appendChild(titleScaleY2); |
---|
715 | //menu déroulant |
---|
716 | var paramSelectScaleY2 = new Object(); |
---|
717 | paramSelectScaleY2.id = "SelectScaleY2"; |
---|
718 | paramSelectScaleY2.parent = $("#scaleY2"); |
---|
719 | this.selectScaleY2 = new Select( paramSelectScaleY2 ); |
---|
720 | this.selectScaleY2.add( 'l', "Linear" ); |
---|
721 | this.selectScaleY2.add( '-log_scale2', "Logarithmic" ); |
---|
722 | this.selectScaleY2.selectFirst( false ); |
---|
723 | //est inactif par defaut car selectTraceAxeY2 est positionne a none par defaut |
---|
724 | document.getElementById("scaleY2Titre").className = "notActiveText"; |
---|
725 | this.selectScaleY2.disable(); |
---|
726 | |
---|
727 | |
---|
728 | // Create menu deroulant style de tracer Y2 |
---|
729 | //Titre |
---|
730 | var titleTypeTrace = document.createTextNode("Select the type of plot"); |
---|
731 | document.getElementById("typePlotY2Titre").appendChild(titleTypeTrace); |
---|
732 | //menu déroulant |
---|
733 | var paramSelectTypeTraceY2 = new Object(); |
---|
734 | paramSelectTypeTraceY2.id = "selectTypePlotY2"; |
---|
735 | paramSelectTypeTraceY2.parent = $("#typePlotY2"); |
---|
736 | this.selectTypeTraceY2 = new Select( paramSelectTypeTraceY2 ); |
---|
737 | this.selectTypeTraceY2.add( 'l', "Lines" ); |
---|
738 | this.selectTypeTraceY2.add( 'p', "Dots" ); |
---|
739 | this.selectTypeTraceY2.add( 'i', "Peaks" ); |
---|
740 | this.selectTypeTraceY2.add( 'lp', "Lines and Dots" ); |
---|
741 | this.selectTypeTraceY2.selectFirst( false ); |
---|
742 | //est inactif par defaut car selectTraceAxeY2 est positionne a none par defaut |
---|
743 | document.getElementById("typePlotY2Titre").className = "notActiveText"; |
---|
744 | this.selectTypeTraceY2.disable(); |
---|
745 | |
---|
746 | // Create menu deroulant choix de la sortie pour l'onglet "Database comparison" |
---|
747 | var paramoutputDatabasecomparison = new Object(); |
---|
748 | paramoutputDatabasecomparison.id = "outputDatabaseComparisonChoice1"; |
---|
749 | paramoutputDatabasecomparison.parent = $("#outputDatabaseComparisonChoice"); |
---|
750 | this.selectOutputDatabasecomparison = new Select( paramoutputDatabasecomparison ); |
---|
751 | this.selectOutputDatabasecomparison.add( 'def', "Default output" ); |
---|
752 | this.selectOutputDatabasecomparison.add( 'diff_step', "Mean difference" ); |
---|
753 | this.selectOutputDatabasecomparison.add( 'diff_step100', "Mean difference in percentage" ); |
---|
754 | this.selectOutputDatabasecomparison.add( 'diff_stepboth', "Both mean difference" ); |
---|
755 | this.selectOutputDatabasecomparison.selectFirst( false ); |
---|
756 | |
---|
757 | |
---|
758 | //création de l'image d'attente |
---|
759 | var param = new Object(); |
---|
760 | param.id = "loadingForGraphics"; |
---|
761 | param.parent = this.containerLoading; |
---|
762 | this.loadingGraphics = new Loading( param ); |
---|
763 | // this.loadingGraphics.display(); |
---|
764 | //this.loadingGraphics.hide(); |
---|
765 | |
---|
766 | |
---|
767 | // 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 )} ); |
---|
768 | var submitButton = new Button( {value:"Submit", parent:$( "#boutonSubmit" ), id:"button_submit_3", className: "positive", onClick:jQuery.proxy( this.onClickSubmit, this )} ); |
---|
769 | //bouton reset pour toute la page |
---|
770 | var resetPageButton = new Button( {value:"Reset", parent:$( "#boutonSubmit" ), id:"buttonReset", className: "gray_button", onClick:jQuery.proxy( this.resetPage, this )} ); |
---|
771 | |
---|
772 | |
---|
773 | |
---|
774 | }, |
---|
775 | |
---|
776 | |
---|
777 | |
---|
778 | |
---|
779 | /** |
---|
780 | * This method creates the case to check for the moles |
---|
781 | * create cases à cocher pour les molécules |
---|
782 | * @param container |
---|
783 | * @param moleculesArray |
---|
784 | */ |
---|
785 | //createMolecules: function(container, moleculesArray) |
---|
786 | createMolecules: function(container, moleculesArray, BddVersion) |
---|
787 | { |
---|
788 | var table = $(document.createElement("table")); |
---|
789 | container.append(table); |
---|
790 | |
---|
791 | var i=0; |
---|
792 | //nombre de molecules par ligne |
---|
793 | var l=11; |
---|
794 | //taille du tableau |
---|
795 | //alert("l" +moleculesArray.length); |
---|
796 | |
---|
797 | |
---|
798 | $.each(moleculesArray, jQuery.proxy( function(index, moleculeElement ) |
---|
799 | { |
---|
800 | |
---|
801 | |
---|
802 | //this.tr et non var tr pour que tr existe encore à la sortie du if |
---|
803 | if ( index == (i*l)) |
---|
804 | { |
---|
805 | //alert(index); |
---|
806 | this.tr = $(document.createElement("tr")); |
---|
807 | this.tr.attr({valign: "top"}); |
---|
808 | table.append(this.tr); |
---|
809 | i=i+1; |
---|
810 | |
---|
811 | } |
---|
812 | var td = $(document.createElement("td")); |
---|
813 | this.tr.append(td); |
---|
814 | |
---|
815 | var span= $(document.createElement("span")); |
---|
816 | span.addClass("molecule"); |
---|
817 | td.append(span); |
---|
818 | |
---|
819 | var input = $(document.createElement("input")); |
---|
820 | input.attr({type:"checkbox", id:"all-"+moleculeElement.id+"-"+BddVersion}); |
---|
821 | input.bind( 'click', this, jQuery.proxy( this.cliquetout, [this, moleculeElement.id, BddVersion ] )); |
---|
822 | span.append(input); |
---|
823 | |
---|
824 | var a = $(document.createElement("a")); |
---|
825 | a.html("<b>"+moleculeElement.name+"</b>"); |
---|
826 | |
---|
827 | a.bind( 'click', this, jQuery.proxy( this.visibilite, [this,"Cache-"+ moleculeElement.id] )); |
---|
828 | span.append(a); |
---|
829 | |
---|
830 | var div= $(document.createElement("div")); |
---|
831 | div.addClass("divViolet"); |
---|
832 | div.attr({id:"Cache-"+moleculeElement.id, style: "display:none"}); |
---|
833 | td.append(div); |
---|
834 | |
---|
835 | var spanIsotopes= $(document.createElement("span")); |
---|
836 | spanIsotopes.addClass("isotope"); |
---|
837 | spanIsotopes.attr({id:moleculeElement.id+"Isotope"+BddVersion}); |
---|
838 | div.append(spanIsotopes); |
---|
839 | |
---|
840 | |
---|
841 | this.createIsotopes($("#"+moleculeElement.id+"Isotope"+BddVersion), moleculeElement.isotopesArray, moleculeElement.id, BddVersion); |
---|
842 | |
---|
843 | |
---|
844 | }, this) ); |
---|
845 | |
---|
846 | |
---|
847 | }, |
---|
848 | |
---|
849 | createIsotopes: function(container, isotopesArray, moleculeElement, BddVersion ) |
---|
850 | { |
---|
851 | |
---|
852 | |
---|
853 | $.each(isotopesArray, jQuery.proxy( function( index, isotopeElement ) |
---|
854 | { |
---|
855 | container.append(" "); |
---|
856 | var inputIsotopes = $(document.createElement("input")); |
---|
857 | inputIsotopes.attr({type:"checkbox", id:"chk-"+moleculeElement+"_"+isotopeElement+"-"+BddVersion, name:"moles", value:moleculeElement+"_"+isotopeElement}); |
---|
858 | inputIsotopes.bind( 'click', this, jQuery.proxy( this.cliqueIsotope, [this, moleculeElement+"_"+isotopeElement, moleculeElement, BddVersion ] )); |
---|
859 | container.append(inputIsotopes); |
---|
860 | container.append(isotopeElement); |
---|
861 | var br = $(document.createElement("br")); |
---|
862 | container.append(br); |
---|
863 | |
---|
864 | }, this) ); |
---|
865 | }, |
---|
866 | |
---|
867 | // <table><tr><td> |
---|
868 | // <span class="molecule"><input type=checkbox id=all-ch3cn-GEISA2011 onclick="cliquetout('this, ch3cn, GEISA2011');"> |
---|
869 | // <a href="javascript:visibilite('this, Cache-ch3cn');"><B>CH<sub>3</sub>CN</a></B> |
---|
870 | // </span> |
---|
871 | // <div class="divViolet" id="Cache-ch3cn" style="display:none;"> |
---|
872 | // <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> |
---|
873 | // </div> |
---|
874 | // </td></tr></table> |
---|
875 | |
---|
876 | // REQUESTS ******************************************************** |
---|
877 | //récupération de toutes les valeurs choisies par l'utilisateur et transformation de ces valeurs pour les inclure dans la requête fortran |
---|
878 | requestGeisa: function() |
---|
879 | { |
---|
880 | //temps en ms pour obtenir un nom unique de répertoire |
---|
881 | var dateTime = new Date().getTime(); |
---|
882 | this.NomRepFileOut = "graph"+dateTime+"/"; |
---|
883 | |
---|
884 | |
---|
885 | // appel ajax |
---|
886 | |
---|
887 | //sélection du fichier binaire de la base geisa sélectionnée |
---|
888 | var paramBase = ""; |
---|
889 | switch (this.selectDatabase.getValue()) { |
---|
890 | case 'GEISA2003': |
---|
891 | 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"; |
---|
892 | break; |
---|
893 | case 'GEISA2011': |
---|
894 | paramBase = " -dirin "+this.pathProcess+" -dirout "+this.LongPathImages+this.NomRepFileOut+" -filein "+this.pathProcess+"line_GEISA2009_bin -database_name GEISA2011 -database_type gs08 -type_out png"; |
---|
895 | break; |
---|
896 | case 'GEISAIASI2003': |
---|
897 | 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"; |
---|
898 | break; |
---|
899 | case 'GEISAIASI2011': |
---|
900 | 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"; |
---|
901 | break; |
---|
902 | } |
---|
903 | |
---|
904 | //sélection du fichier binaire de deuxiÚme base geisa sélectionnée pour l'option graphique "databases comparison" |
---|
905 | var paramBase2 = ""; |
---|
906 | switch (this.selectDatabase2.getValue()) { |
---|
907 | case 'GEISA2003': |
---|
908 | paramBase2 = " -filein2 "+this.pathProcess+"line_GEISA2003_bin_gs08_v1.0 -database_name2 GEISA2003"; |
---|
909 | break; |
---|
910 | case 'GEISA2011': |
---|
911 | paramBase2 = " -filein2 "+this.pathProcess+"line_GEISA2009_bin -database_name2 GEISA2011 -database_type gs08"; |
---|
912 | break; |
---|
913 | case 'HITRAN2009': |
---|
914 | paramBase2 = " -filein2 "+this.pathProcess+"HITRAN_2009_bin -database_name2 HITRAN2009"; |
---|
915 | break; |
---|
916 | } |
---|
917 | |
---|
918 | |
---|
919 | //molécules |
---|
920 | //récupération des molécules sélectionnées |
---|
921 | var inputs = document.getElementsByTagName( 'input' ); |
---|
922 | var count = inputs.length; |
---|
923 | var isotopesSelectedName =""; |
---|
924 | // alert(this.selectDatabase.getValue()); |
---|
925 | var i=0; |
---|
926 | this.nbIsotopes = 0; |
---|
927 | this.nbMolecules = 0; |
---|
928 | this.nbGraph = 0; |
---|
929 | for( i = 0; i < count; i++ ) |
---|
930 | { |
---|
931 | var input = inputs.item( i ); |
---|
932 | //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") |
---|
933 | if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("chk-")!= -1 && input.id.indexOf(this.selectDatabase.getValue())!= -1) |
---|
934 | { |
---|
935 | //nombre d'isotopes sélectionnés |
---|
936 | this.nbIsotopes = this.nbIsotopes + 1; |
---|
937 | |
---|
938 | var molN=input.value; |
---|
939 | var molN1=molN.replace("_", ":"); |
---|
940 | // exemple : -moleisot h2o:161 -moleisot h2o:162 -moleisot co2:626 -moleisot co2:627 -moleisot o3:666 -moleisot o3:668 |
---|
941 | isotopesSelectedName = isotopesSelectedName+"-moleisot "+molN1+" "; |
---|
942 | } |
---|
943 | //récupération du nombre de molécules sélectionnées |
---|
944 | if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("all-")!= -1 && input.id.indexOf(this.selectDatabase.getValue())!= -1) |
---|
945 | { |
---|
946 | //nombre d'isotopes sélectionnés |
---|
947 | this.nbMolecules = this.nbMolecules + 1; |
---|
948 | } |
---|
949 | } |
---|
950 | |
---|
951 | |
---|
952 | //averti l'utilisateur qu'il faut au moins sélectionner un isotope |
---|
953 | if (this.nbIsotopes == 0) { |
---|
954 | alert("Error : no molecule or isotopoloque was selected"); |
---|
955 | return; |
---|
956 | } |
---|
957 | |
---|
958 | |
---|
959 | |
---|
960 | //sélection du nombre de courbes ou de graphs |
---|
961 | |
---|
962 | var nbCourbes = ""; |
---|
963 | //dans le cas de l'option "Global representation" tous les 10 isotopes ou molecules un nouveau graph est construit |
---|
964 | if ($("#graphicOptionChoice").val() =="global" ) |
---|
965 | { |
---|
966 | switch (this.selectNbCourbes.getValue()) { |
---|
967 | case 'cm': |
---|
968 | nbCourbes = "-separate_mol "; |
---|
969 | //si c'est un entier |
---|
970 | if((parseFloat(this.nbMolecules/10) == parseInt(this.nbMolecules/10))){ |
---|
971 | this.nbGraph = parseInt(this.nbMolecules/10); |
---|
972 | } |
---|
973 | //si ce n'est pas un entier |
---|
974 | else{ |
---|
975 | this.nbGraph = parseInt(this.nbMolecules/10)+1; |
---|
976 | } |
---|
977 | break; |
---|
978 | case 'ci': |
---|
979 | nbCourbes = "-separate_iso "; |
---|
980 | //si c'est un entier |
---|
981 | if((parseFloat(this.nbIsotopes/10) == parseInt(this.nbIsotopes/10))){ |
---|
982 | this.nbGraph = parseInt(this.nbIsotopes/10); |
---|
983 | } |
---|
984 | else{ |
---|
985 | this.nbGraph = parseInt(this.nbIsotopes/10)+1; |
---|
986 | } |
---|
987 | break; |
---|
988 | } |
---|
989 | } |
---|
990 | else |
---|
991 | //dans les 2 autres cas |
---|
992 | { |
---|
993 | switch (this.selectNbCourbes.getValue()) { |
---|
994 | //sswitch (document.getElementById('selectNbCourbes').options[document.getElementById('selectNbCourbes').selectedIndex].value) { |
---|
995 | case 'cm': |
---|
996 | nbCourbes = "-separate_mol -same_graph "; |
---|
997 | this.nbGraph = 1; |
---|
998 | this.nbCourbe = this.nbMolecules; |
---|
999 | if (this.nbCourbe > 8) { |
---|
1000 | alert("Too much molecules selected to draw one curve for each molecule selected (>8)"); |
---|
1001 | return; |
---|
1002 | } |
---|
1003 | break; |
---|
1004 | case 'ci': |
---|
1005 | nbCourbes = "-separate_iso -same_graph "; |
---|
1006 | this.nbGraph = 1; |
---|
1007 | this.nbCourbe = this.nbIsotopes; |
---|
1008 | if (this.nbCourbe > 8) { |
---|
1009 | alert("Too much isotopologues selected to draw one curve for each isotopologues selected (>8)"); |
---|
1010 | return; |
---|
1011 | } |
---|
1012 | break; |
---|
1013 | case 'gm': |
---|
1014 | nbCourbes = "-separate_mol "; |
---|
1015 | this.nbGraph = this.nbMolecules; |
---|
1016 | if (this.nbGraph > 20) { |
---|
1017 | alert("Too much molecules selected to draw one graph for each molecules selected (>20)"); |
---|
1018 | return; |
---|
1019 | } |
---|
1020 | break; |
---|
1021 | case 'gi': |
---|
1022 | nbCourbes = "-separate_iso "; |
---|
1023 | this.nbGraph = this.nbIsotopes; |
---|
1024 | if (this.nbGraph > 20) { |
---|
1025 | alert("Too much isotopologues selected to draw one graph for each isotopologues selected (>20)"); |
---|
1026 | return; |
---|
1027 | } |
---|
1028 | break; |
---|
1029 | default: |
---|
1030 | nbCourbes = ""; |
---|
1031 | this.nbGraph = 1; |
---|
1032 | break; |
---|
1033 | } |
---|
1034 | } |
---|
1035 | |
---|
1036 | //Spectral range |
---|
1037 | var rangeLower="-wavenb_min "+$("#rangeLower").val(); |
---|
1038 | var rangeUpper="-wavenb_max "+$("#rangeUpper").val(); |
---|
1039 | |
---|
1040 | //controle des valeurs entrées par l'utilisateur |
---|
1041 | |
---|
1042 | switch (this.selectDatabase.getValue()) { |
---|
1043 | case 'GEISA2003': |
---|
1044 | //isNaN = n'est pas un nombre |
---|
1045 | if(isNaN(($("#rangeLower").val())) == true || parseFloat($("#rangeLower").val()) < 0 || parseFloat($("#rangeLower").val()) > 35877.030506) |
---|
1046 | { |
---|
1047 | alert("Error: Invalid value for lower spectral range area. The value must be between 0 and 35877.030506"); |
---|
1048 | return; |
---|
1049 | } |
---|
1050 | |
---|
1051 | if(isNaN(($("#rangeUpper").val())) == true || parseFloat( $("#rangeUpper").val()) == 0 || parseFloat( $("#rangeUpper").val()) < 0 || parseFloat($("#rangeUpper").val()) > 35877.030506) |
---|
1052 | { |
---|
1053 | alert("Error: Invalid value for upper spectral range area. The value must be between 0 and 35877.030506"); |
---|
1054 | return; |
---|
1055 | } |
---|
1056 | |
---|
1057 | break; |
---|
1058 | case 'GEISA2011': |
---|
1059 | //isNaN = n'est pas un nombre |
---|
1060 | if(isNaN(($("#rangeLower").val())) == true || parseFloat($("#rangeLower").val()) < 0 || parseFloat($("#rangeLower").val()) > 35877.030506) |
---|
1061 | { |
---|
1062 | alert("Error: Invalid value for lower spectral range area. The value must be between 0 and 35877.030506"); |
---|
1063 | return; |
---|
1064 | } |
---|
1065 | |
---|
1066 | if(isNaN(($("#rangeUpper").val())) == true || parseFloat( $("#rangeUpper").val()) == 0 || parseFloat( $("#rangeUpper").val()) < 0 || parseFloat($("#rangeUpper").val()) > 35877.030506) |
---|
1067 | { |
---|
1068 | alert("Error: Invalid value for upper spectral range area. The value must be between 0 and 35877.030506"); |
---|
1069 | return; |
---|
1070 | } |
---|
1071 | break; |
---|
1072 | case 'GEISAIASI2003': |
---|
1073 | //isNaN = n'est pas un nombre |
---|
1074 | if(isNaN(($("#rangeLower").val())) == true || parseFloat($("#rangeLower").val()) < 0 || parseFloat($("#rangeLower").val()) < 599.000793 || parseFloat($("#rangeLower").val()) > 3000.998767) |
---|
1075 | { |
---|
1076 | alert("Error: Invalid value for lower spectral range area. The value must be between 599.000793 and 3000.998767"); |
---|
1077 | return; |
---|
1078 | } |
---|
1079 | |
---|
1080 | if(isNaN(($("#rangeUpper").val())) == true || parseFloat( $("#rangeUpper").val()) == 0 || parseFloat( $("#rangeUpper").val()) < 0 || parseFloat($("#rangeUpper").val()) < 599.000793 || parseInt($("#rangeUpper").val()) > 3000.998767) |
---|
1081 | { |
---|
1082 | alert("Error: Invalid value for upper spectral range area. The value must be between 599.000793 and 3000.998767"); |
---|
1083 | return; |
---|
1084 | } |
---|
1085 | break; |
---|
1086 | case 'GEISAIASI2011': |
---|
1087 | //isNaN = n'est pas un nombre |
---|
1088 | if(isNaN(($("#rangeLower").val())) == true || parseFloat($("#rangeLower").val()) < 0 || parseFloat($("#rangeLower").val()) < 599.000793 || parseFloat($("#rangeLower").val()) > 3000.998767) |
---|
1089 | { |
---|
1090 | alert("Error: Invalid value for lower spectral range area. The value must be between 599.000793 and 3000.998767"); |
---|
1091 | return; |
---|
1092 | } |
---|
1093 | |
---|
1094 | if(isNaN(($("#rangeUpper").val())) == true || parseFloat( $("#rangeUpper").val()) == 0 || parseFloat( $("#rangeUpper").val()) < 0 || parseFloat($("#rangeUpper").val()) < 599.000793 || parseInt($("#rangeUpper").val()) > 3000.998767) |
---|
1095 | { |
---|
1096 | alert("Error: Invalid value for upper spectral range area. The value must be between 599.000793 and 3000.998767"); |
---|
1097 | return; |
---|
1098 | } |
---|
1099 | break; |
---|
1100 | } |
---|
1101 | |
---|
1102 | |
---|
1103 | if ($("#rangeLower").val() == "" ) |
---|
1104 | { |
---|
1105 | rangeLower=""; |
---|
1106 | } |
---|
1107 | |
---|
1108 | if ($("#rangeUpper").val() == "" ) |
---|
1109 | { |
---|
1110 | rangeUpper=""; |
---|
1111 | } |
---|
1112 | if( parseInt($("#rangeLower").val()) > parseInt($("#rangeUpper").val()) ) |
---|
1113 | { |
---|
1114 | alert("Error: lower spectral range area is superior to upper spectral range area "); |
---|
1115 | return; |
---|
1116 | } |
---|
1117 | |
---|
1118 | |
---|
1119 | |
---|
1120 | //Sampling step Splitting step |
---|
1121 | if( $("#sampStep").val() > 0 ) |
---|
1122 | { |
---|
1123 | var samplingStep="-band "+$("#sampStep").val(); |
---|
1124 | //calcul du nombre de graphs générés par l'option Sampling step |
---|
1125 | this.nbGraphSamplingStep = (parseFloat($("#rangeUpper").val()) - parseFloat($("#rangeLower").val())) / parseFloat($("#sampStep").val()); |
---|
1126 | //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") |
---|
1127 | //test pour voir si "nbGraphSamplingStep" est un entier |
---|
1128 | if ((this.nbGraphSamplingStep - parseInt(this.nbGraphSamplingStep)) == 0) |
---|
1129 | { |
---|
1130 | this.nbGraph=(this.nbGraph)*(this.nbGraphSamplingStep); |
---|
1131 | } |
---|
1132 | else |
---|
1133 | { |
---|
1134 | // si "nbGraphSamplingStep" n'est pas un entier prendre le nbre entier suivant |
---|
1135 | this.nbGraph=this.nbGraph*(parseInt(this.nbGraphSamplingStep)+1); |
---|
1136 | } |
---|
1137 | } |
---|
1138 | |
---|
1139 | if(isNaN($("#sampStep").val()) == true || parseInt($("#sampStep").val()) < 0 ) |
---|
1140 | { |
---|
1141 | alert("Error: Invalid value for sampling step"); |
---|
1142 | return; |
---|
1143 | } |
---|
1144 | |
---|
1145 | //Splitting step |
---|
1146 | if( $("#sampStep").val() == 0 ) |
---|
1147 | { |
---|
1148 | var samplingStep=""; |
---|
1149 | } |
---|
1150 | |
---|
1151 | //test sur le nombre de graphs générés |
---|
1152 | if (this.nbGraph > 20) |
---|
1153 | { |
---|
1154 | alert("Too many graphics will be drawn ("+this.nbGraph+"). Please change the value of the sampling step or change the type of graph."); |
---|
1155 | return; |
---|
1156 | } |
---|
1157 | |
---|
1158 | |
---|
1159 | |
---|
1160 | //Transitions to do |
---|
1161 | //exemple de requete avec transition |
---|
1162 | //./all -filein line_GEISA2009_bin -moleisot h2o:161 -wavenb_min 1 -wavenb_max 1000 -database_name "GEISA2011" -vib_ident_lower '[000]' |
---|
1163 | var transitionUpper=document.getElementById('transition1').options[document.getElementById('transition1').selectedIndex].value; |
---|
1164 | |
---|
1165 | //certaine transitions ont plusieurs espaces à droite qui ne sont pas conservés (ex ch4 et C2HD) |
---|
1166 | //si la longueur de la chaine de caracteres n'est pas 25 on rajoute le nobre d'espace nécessaire pour arriver à 25 |
---|
1167 | var nb=0; |
---|
1168 | nb=25-transitionUpper.length |
---|
1169 | if (nb != 0) |
---|
1170 | { |
---|
1171 | for (i = 1; i <= nb; i++) { |
---|
1172 | transitionUpper=transitionUpper+" "; |
---|
1173 | } |
---|
1174 | } |
---|
1175 | |
---|
1176 | |
---|
1177 | var transitionLower=document.getElementById('transition2').options[document.getElementById('transition2').selectedIndex].value; |
---|
1178 | |
---|
1179 | //certaine transitions ont plusieurs espaces à droite qui ne sont pas conservés (ex ch4 et C2HD) |
---|
1180 | //si la longueur de la chaine de caracteres n'est pas 25 on rajoute le nobre d'espace nécessaire pour arriver à 25 |
---|
1181 | var nb=0; |
---|
1182 | nb=25-transitionLower.length |
---|
1183 | if (nb != 0) |
---|
1184 | { |
---|
1185 | for (i = 1; i <= nb; i++) { |
---|
1186 | transitionLower=transitionLower+" "; |
---|
1187 | } |
---|
1188 | } |
---|
1189 | |
---|
1190 | //pas de transition sélectionnée |
---|
1191 | |
---|
1192 | if (( document.getElementById('transition1').options[document.getElementById('transition1').selectedIndex].value == -1) || (document.getElementById('transition1').options[document.getElementById('transition1').selectedIndex].value == "transition" )) |
---|
1193 | { |
---|
1194 | transitionUpper ="no"; |
---|
1195 | } |
---|
1196 | if (( document.getElementById('transition2').options[document.getElementById('transition2').selectedIndex].value == -1) || (document.getElementById('transition2').options[document.getElementById('transition2').selectedIndex].value == "transition" )) |
---|
1197 | { |
---|
1198 | transitionLower ="no"; |
---|
1199 | } |
---|
1200 | |
---|
1201 | if ( document.getElementById('transition1').options[document.getElementById('transition1').selectedIndex].value == "") |
---|
1202 | { |
---|
1203 | transitionUpper ="noValue"; |
---|
1204 | } |
---|
1205 | |
---|
1206 | if ( document.getElementById('transition2').options[document.getElementById('transition2').selectedIndex].value == "") |
---|
1207 | { |
---|
1208 | transitionLower ="noValue"; |
---|
1209 | } |
---|
1210 | |
---|
1211 | var sel = document.getElementById('transition1'); |
---|
1212 | var idupper = sel.options[sel.selectedIndex].value; |
---|
1213 | |
---|
1214 | //Intensity range |
---|
1215 | var intensityLower="-int_min "+$("#intensityLo").val(); |
---|
1216 | var intensityUpper="-int_max "+$("#intensityUp").val(); |
---|
1217 | |
---|
1218 | //controle des valeurs entrées par l'utilisateur |
---|
1219 | if(isNaN($("#intensityLo").val()) == true || $("#intensityLo").val() < 0 ) |
---|
1220 | { |
---|
1221 | alert("Error: Invalid value for lower intensity range area. The value must be between 0 and 1E-16"); |
---|
1222 | return; |
---|
1223 | } |
---|
1224 | if ($("#intensityLo").val() == "" ) |
---|
1225 | { |
---|
1226 | intensityLower=""; |
---|
1227 | } |
---|
1228 | if(isNaN($("#intensityUp").val()) == true || $("#intensityUp").val() < 0 ) |
---|
1229 | { |
---|
1230 | alert("Error: Invalid value for upper intensity range area. The value must be between 0 and 1E-16"); |
---|
1231 | return; |
---|
1232 | } |
---|
1233 | if ($("#intensityUp").val() == "" ) |
---|
1234 | { |
---|
1235 | intensityUpper=""; |
---|
1236 | } |
---|
1237 | |
---|
1238 | //to do javascript ne sait comparer des exponenciels |
---|
1239 | // if( $("#intensityLo").val() > $("#intensityUp").val() ) |
---|
1240 | |
---|
1241 | // { |
---|
1242 | // alert("Error: lower intensity range area is superior to upper intensity range area "); |
---|
1243 | // return; |
---|
1244 | // } |
---|
1245 | |
---|
1246 | |
---|
1247 | //Valeur de mean value Bin-average |
---|
1248 | var meanValue = "-step "+$("#meanValue2").val(); |
---|
1249 | //controle des valeurs entrées par l'utilisateur |
---|
1250 | //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 |
---|
1251 | if(isNaN($("#meanValue2").val()) == true || $("#meanValue2").val() < 0 || $("#meanValue2").val() >= (parseFloat($("#rangeUpper").val()) - parseFloat($("#rangeLower").val())) ) |
---|
1252 | { |
---|
1253 | alert("Error: Invalid value for Average calculation area"); |
---|
1254 | return; |
---|
1255 | } |
---|
1256 | //si aucune valeur |
---|
1257 | if ($("#meanValue2").val() == "" ) |
---|
1258 | { |
---|
1259 | meanValue=""; |
---|
1260 | } |
---|
1261 | |
---|
1262 | //sélection du premier choix pour l'axe des Y |
---|
1263 | var field="-field "+this.selectTraceAxeY1.getValue(); |
---|
1264 | |
---|
1265 | |
---|
1266 | //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) |
---|
1267 | if (this.selectScaleY1.getValue() == '-log_scale' && this.selectScaleY1.isDisable == false) |
---|
1268 | { |
---|
1269 | var logScale = this.selectScaleY1.getValue(); |
---|
1270 | } |
---|
1271 | else |
---|
1272 | { |
---|
1273 | var logScale = "" |
---|
1274 | } |
---|
1275 | |
---|
1276 | |
---|
1277 | |
---|
1278 | //sélection du type de tracé pour Y1 |
---|
1279 | var lineType="-line_type "+this.selectTypeTraceY1.getValue(); |
---|
1280 | //var lineType="-line_type "+document.getElementById('selectTypePlotY1').options[document.getElementById('selectTypePlotY1').selectedIndex].value; |
---|
1281 | |
---|
1282 | // sélection du type de tracé pour la deuxiÚme base dans l'option "databases comparison" |
---|
1283 | //var lineType3="-line_type3 "+this.selectTypeTraceDatabase2.getValue(); |
---|
1284 | |
---|
1285 | //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) |
---|
1286 | if (this.selectTraceAxeY2.getValue() == 'no' || this.selectTraceAxeY2.isDisable == true) |
---|
1287 | { |
---|
1288 | var field2 = ""; |
---|
1289 | } |
---|
1290 | else |
---|
1291 | { |
---|
1292 | var field2 = "-field2 "+this.selectTraceAxeY2.getValue(); |
---|
1293 | //var field2 = "-field2 "+document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value; |
---|
1294 | } |
---|
1295 | |
---|
1296 | |
---|
1297 | |
---|
1298 | //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) |
---|
1299 | if (this.selectScaleY2.getValue() == '-log_scale2' && this.selectScaleY2.isDisable == false) |
---|
1300 | { |
---|
1301 | var logScale2 =this.selectScaleY2.getValue(); |
---|
1302 | // var logScale2 = document.getElementById('selectScaleY2').options[document.getElementById('selectScaleY2').selectedIndex].value; |
---|
1303 | } |
---|
1304 | else |
---|
1305 | { |
---|
1306 | var logScale2 = ""; |
---|
1307 | } |
---|
1308 | |
---|
1309 | |
---|
1310 | //sélection du type de tracé pour Y2 (pas de valeur si l'option n'est pas activée) |
---|
1311 | if ( this.selectTypeTraceY2.isDisable == true) |
---|
1312 | { |
---|
1313 | var lineType2 = ""; |
---|
1314 | } |
---|
1315 | else |
---|
1316 | { |
---|
1317 | var lineType2 = "-line_type2 "+this.selectTypeTraceY2.getValue(); |
---|
1318 | } |
---|
1319 | |
---|
1320 | //choix du type de sortie pour l'option graphique 'databases comparison" |
---|
1321 | var diffStep=""; |
---|
1322 | switch (this.selectOutputDatabasecomparison.getValue()) { |
---|
1323 | case 'def': |
---|
1324 | diffStep = ""; |
---|
1325 | break; |
---|
1326 | case 'diff_step': |
---|
1327 | diffStep = "-diff_step"; |
---|
1328 | break; |
---|
1329 | case 'diff_step100': |
---|
1330 | diffStep = "-diff_step100"; |
---|
1331 | break; |
---|
1332 | case 'diff_stepboth': |
---|
1333 | diffStep = "-diff_stepboth"; |
---|
1334 | break; |
---|
1335 | } |
---|
1336 | |
---|
1337 | //Dans l'option graphique "databases comparison", pour les sorties par différence moyenne le champ "Bin-average" doit être supérieur à 0 |
---|
1338 | if ($("#graphicOptionChoice").val() =="comparison" && $("#meanValue2").val() == 0 && this.selectOutputDatabasecomparison.getValue() != "def" ) |
---|
1339 | { |
---|
1340 | alert("For average output, the Bin-average field must be > 0"); |
---|
1341 | return; |
---|
1342 | } |
---|
1343 | |
---|
1344 | |
---|
1345 | //ouverture de la div de l'image d'attente |
---|
1346 | this.loadingGraphics.display(); |
---|
1347 | |
---|
1348 | |
---|
1349 | //construction du nom du fichier (exemple GEISA2011-0_100) |
---|
1350 | //this.nomFichier=this.selectDatabase.getValue()+"-"+$("#rangeLower").val()+"_"+$("#rangeUpper").val(); |
---|
1351 | switch ($("#graphicOptionChoice").val()) { |
---|
1352 | //(exemple GEISA2011-0_100) |
---|
1353 | case 'contents': |
---|
1354 | this.nomFichier=this.selectDatabase.getValue()+"-"+$("#rangeLower").val()+"_"+$("#rangeUpper").val(); |
---|
1355 | break; |
---|
1356 | case 'global': |
---|
1357 | this.nomFichier=this.selectDatabase.getValue()+"-"+$("#rangeLower").val()+"_"+$("#rangeUpper").val(); |
---|
1358 | break; |
---|
1359 | //(exemple GEISA2011_GEISA2003-0_100) |
---|
1360 | case 'comparison': |
---|
1361 | this.nomFichier=this.selectDatabase.getValue()+"_"+this.selectDatabase2.getValue()+"-"+$("#rangeLower").val()+"_"+$("#rangeUpper").val(); |
---|
1362 | break; |
---|
1363 | } |
---|
1364 | |
---|
1365 | |
---|
1366 | //Submit pour l'option graphique "Database contents" |
---|
1367 | if ($("#graphicOptionChoice").val() == "contents" ) |
---|
1368 | { |
---|
1369 | //construction de la requête Fortran |
---|
1370 | var parameters = "&fortranRequest="+paramBase+" "+isotopesSelectedName+" "+rangeLower+" "+rangeUpper+" "+samplingStep+" "+intensityLower+" "+intensityUpper+" "+ |
---|
1371 | meanValue+" "+nbCourbes+" "+field+" "+logScale+" "+lineType+" "+field2+" "+logScale2+" "+lineType2; |
---|
1372 | |
---|
1373 | |
---|
1374 | //remplacement de espace par "EEE" pour que le shell script ne voit qu'un seul argument en entrée |
---|
1375 | parameters=parameters.replace(/ /g,"kkk"); |
---|
1376 | transitionUpper=transitionUpper.replace(/ /g,"kkk"); |
---|
1377 | //le + est interprété comme un espace (plus sera retransformé en + dans le shell) |
---|
1378 | transitionUpper=transitionUpper.replace(/\+/g,"plus"); |
---|
1379 | transitionLower=transitionLower.replace(/ /g,"kkk"); |
---|
1380 | transitionLower=transitionLower.replace(/\+/g,"plus"); |
---|
1381 | |
---|
1382 | //envoie de la requête au controller |
---|
1383 | //en cas de succes appel de la fonction "handleGeisa" |
---|
1384 | $.ajax( { |
---|
1385 | url: "project?methodName=createUserRequest&"+parameters+"&transitionUpper="+ transitionUpper+"&transitionLower="+ transitionLower+"&nbGraph="+ this.nbGraph+"&nomFichier="+this.nomFichier+"&NomRepFileOut="+this.NomRepFileOut, |
---|
1386 | success:jQuery.proxy( this.handleGeisa, this ) |
---|
1387 | } ); |
---|
1388 | |
---|
1389 | } |
---|
1390 | |
---|
1391 | //Submit pour l'option graphique "Global representation" |
---|
1392 | if ($("#graphicOptionChoice").val() =="global" ) |
---|
1393 | { |
---|
1394 | //construction de la requête Fortran |
---|
1395 | |
---|
1396 | var parameters = "&fortranRequest="+paramBase+" "+isotopesSelectedName+" "+rangeLower+" "+rangeUpper+" "+samplingStep+" "+intensityLower+" "+intensityUpper+" "+ |
---|
1397 | nbCourbes+" "+logScale+" "+lineType+" -global_position"; |
---|
1398 | |
---|
1399 | |
---|
1400 | //remplacement de espace par "EEE" pour que le shell script ne voit qu'un seul argument en entrée |
---|
1401 | parameters=parameters.replace(/ /g,"kkk"); |
---|
1402 | |
---|
1403 | //pas de transition dans cette option |
---|
1404 | transitionUpper ="no"; |
---|
1405 | transitionLower ="no"; |
---|
1406 | |
---|
1407 | //envoie de la requête au controller |
---|
1408 | //en cas de succes appel de la fonction "handleGeisa" |
---|
1409 | $.ajax( { |
---|
1410 | url: "project?methodName=createUserRequest&"+parameters+"&transitionUpper="+ transitionUpper+"&transitionLower="+ transitionLower+"&nbGraph="+ this.nbGraph+"&nomFichier="+this.nomFichier+"&NomRepFileOut="+this.NomRepFileOut, |
---|
1411 | success:jQuery.proxy( this.handleGeisa, this ) |
---|
1412 | } ); |
---|
1413 | |
---|
1414 | } |
---|
1415 | |
---|
1416 | //ParamÚtres à prendre en compte pour l'option "Databases comparison" |
---|
1417 | |
---|
1418 | //Submit pour l'option graphique "Databases comparison" |
---|
1419 | if ($("#graphicOptionChoice").val() =="comparison" ) |
---|
1420 | { |
---|
1421 | //sélection du type de tracé pour pour la 2Úme base de données pour l'option "database comparison" |
---|
1422 | var lineType2="-line_type2 "+this.selectTypeTraceDatabase2.getValue(); |
---|
1423 | |
---|
1424 | |
---|
1425 | //construction de la requête Fortran |
---|
1426 | var parameters = "&fortranRequest="+paramBase+" "+paramBase2+" "+isotopesSelectedName+" "+rangeLower+" "+rangeUpper+" "+samplingStep+" "+intensityLower+" "+intensityUpper+" "+ |
---|
1427 | meanValue+" "+nbCourbes+" "+field+" "+logScale+" "+lineType+" "+lineType2+" "+diffStep; |
---|
1428 | |
---|
1429 | |
---|
1430 | //remplacement de espace par "EEE" pour que le shell script ne voit qu'un seul argument en entrée |
---|
1431 | parameters=parameters.replace(/ /g,"kkk"); |
---|
1432 | transitionUpper=transitionUpper.replace(/ /g,"kkk"); |
---|
1433 | //le + est interprété comme un espace (plus sera retransformé en + dans le shell) |
---|
1434 | transitionUpper=transitionUpper.replace(/\+/g,"plus"); |
---|
1435 | transitionLower=transitionLower.replace(/ /g,"kkk"); |
---|
1436 | transitionLower=transitionLower.replace(/\+/g,"plus"); |
---|
1437 | |
---|
1438 | //envoie de la requête au controller |
---|
1439 | //en cas de succes appel de la fonction "handleGeisa" |
---|
1440 | $.ajax( { |
---|
1441 | url: "project?methodName=createUserRequest&"+parameters+"&transitionUpper="+ transitionUpper+"&transitionLower="+ transitionLower+"&nbGraph="+ this.nbGraph+"&nomFichier="+this.nomFichier+"&NomRepFileOut="+this.NomRepFileOut, |
---|
1442 | success:jQuery.proxy( this.handleGeisa, this ) |
---|
1443 | } ); |
---|
1444 | |
---|
1445 | } |
---|
1446 | |
---|
1447 | }, |
---|
1448 | |
---|
1449 | |
---|
1450 | //requête pour interrogation de la base de données des transitions |
---|
1451 | requestTransition: function() |
---|
1452 | { |
---|
1453 | |
---|
1454 | var nbMolecules=0; |
---|
1455 | |
---|
1456 | //Récupération du spectral range |
---|
1457 | var spectralRangeLower = $("#rangeLower").val(); |
---|
1458 | var spectralRangeUpper = $("#rangeUpper").val(); |
---|
1459 | |
---|
1460 | //Récupération des isotopes sélectionnés |
---|
1461 | var inputs = document.getElementsByTagName( 'input' ); |
---|
1462 | var count = inputs.length; |
---|
1463 | var isotopesSelectedNameArray = new Array(); |
---|
1464 | var i=0; |
---|
1465 | |
---|
1466 | for( i = 0; i < count; i++ ) |
---|
1467 | { |
---|
1468 | var input = inputs.item( i ); |
---|
1469 | //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") |
---|
1470 | if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("chk-")!= -1 && input.id.indexOf(this.selectDatabase.getValue())!= -1) |
---|
1471 | { |
---|
1472 | var molN=input.value; |
---|
1473 | var molN1=molN.replace("_", ":"); |
---|
1474 | //tous les isotopes sélectionnés sont placés dans un tableau |
---|
1475 | isotopesSelectedNameArray.push(molN1); |
---|
1476 | } |
---|
1477 | |
---|
1478 | //récupération du nombre de molécules sélectionnées |
---|
1479 | if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("all-")!= -1 && input.id.indexOf(this.selectDatabase.getValue())!= -1) |
---|
1480 | { |
---|
1481 | nbMolecules = nbMolecules + 1; |
---|
1482 | } |
---|
1483 | |
---|
1484 | } |
---|
1485 | //alert ("nbMolecules"+nbMolecules); |
---|
1486 | //si le nombre de molécule sélectionnées est supérieure à 1 les menus des transition sont inactifs |
---|
1487 | if (nbMolecules > 1) |
---|
1488 | { |
---|
1489 | //ajoute une classe à celle déjà existante de transitionUpper |
---|
1490 | $("#transitionUpper").addClass("notActiveText"); |
---|
1491 | $("#transitionLower").addClass("notActiveText"); |
---|
1492 | } |
---|
1493 | else |
---|
1494 | { |
---|
1495 | $("#transitionUpper").removeClass("notActiveText"); |
---|
1496 | $("#transitionLower").removeClass("notActiveText"); |
---|
1497 | } |
---|
1498 | |
---|
1499 | |
---|
1500 | //On ne fait appel à la BDD des transitions et si au plus 1 molécule est sélectionnée |
---|
1501 | if (nbMolecules == 1 ) |
---|
1502 | { |
---|
1503 | |
---|
1504 | |
---|
1505 | $.ajax( { |
---|
1506 | url: "project?methodName=getTransitionByIsotopeName&isotopesSelectedNameArray="+isotopesSelectedNameArray+"&geisaSelectedDatabase="+this.selectDatabase.getValue2()+"&spectralRangeLower="+spectralRangeLower+"&spectralRangeUpper="+spectralRangeUpper, |
---|
1507 | success:jQuery.proxy( this.handleRequestTransition, this ), |
---|
1508 | error: jQuery.proxy( this.handleErrorRequestTransition, this ) |
---|
1509 | } ); |
---|
1510 | |
---|
1511 | } |
---|
1512 | else |
---|
1513 | { |
---|
1514 | //pour réinitialiser le menu déroulant si aucune ou plusieurs molécules sont sélectionnées |
---|
1515 | document.getElementById("transition2").length=0; |
---|
1516 | //this.selectTransitionUpper.clear(); |
---|
1517 | document.getElementById("transition1").length=0; |
---|
1518 | |
---|
1519 | if (nbMolecules == 0 ) |
---|
1520 | { |
---|
1521 | this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"Select a molecule", selected:"selected"} )); |
---|
1522 | this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"Select a molecule", selected:"selected"} )); |
---|
1523 | //pour forcer à afficher le premier élément (et non le premier élément précédent) |
---|
1524 | //this.selectTransitionLower.selectFirst(); |
---|
1525 | //this.selectTransitionUpper.selectFirst(); |
---|
1526 | } |
---|
1527 | |
---|
1528 | if (nbMolecules > 1 ) |
---|
1529 | { |
---|
1530 | |
---|
1531 | this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"", selected:"selected", disabled:"disabled"} )); |
---|
1532 | this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"", selected:"selected", disabled:"disabled"} )); |
---|
1533 | //pour forcer à afficher le premier élément (et non le premier élément précédent) |
---|
1534 | //this.selectTransitionLower.selectFirst(); |
---|
1535 | //this.selectTransitionUpper.selectFirst(); |
---|
1536 | //ajoute une classe à celle déjà existante de transitionUpper |
---|
1537 | $("#transitionUpper").addClass("notActiveText"); |
---|
1538 | $("#transitionLower").addClass("notActiveText"); |
---|
1539 | } |
---|
1540 | } |
---|
1541 | }, |
---|
1542 | |
---|
1543 | |
---|
1544 | |
---|
1545 | |
---|
1546 | //requête pour interrogation de la base de données des transitions en fonction d'une transition lower |
---|
1547 | requestTransitionByTransitionLower: function() |
---|
1548 | { |
---|
1549 | var context = this[0]; |
---|
1550 | //exemple transitionLower=" 000" : il y a 25 caractÚres dans chaque transition |
---|
1551 | context.transitionLower = this[1]; |
---|
1552 | |
---|
1553 | //Récupération de la Base Geisa sélectionnée |
---|
1554 | var GeisaSelectedDatabase = context.selectDatabase.getValue(); |
---|
1555 | |
---|
1556 | //Récupération du spectral range |
---|
1557 | var spectralRangeLower = $("#rangeLower").val(); |
---|
1558 | var spectralRangeUpper = $("#rangeUpper").val(); |
---|
1559 | |
---|
1560 | //Récupération des isotopes sélectionnés |
---|
1561 | var inputs = document.getElementsByTagName( 'input' ); |
---|
1562 | var count = inputs.length; |
---|
1563 | var isotopesSelectedNameArray = new Array(); |
---|
1564 | var i=0; |
---|
1565 | |
---|
1566 | for( i = 0; i < count; i++ ) |
---|
1567 | { |
---|
1568 | var input = inputs.item( i ); |
---|
1569 | //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") |
---|
1570 | if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("chk-")!= -1 && input.id.indexOf(context.selectDatabase.getValue())!= -1) |
---|
1571 | { |
---|
1572 | var molN=input.value; |
---|
1573 | var molN1=molN.replace("_", ":"); |
---|
1574 | //tous les isotopes sélectionnés sont placés dans un tableau |
---|
1575 | isotopesSelectedNameArray.push(molN1); |
---|
1576 | } |
---|
1577 | |
---|
1578 | } |
---|
1579 | |
---|
1580 | //le passage de javascript à java par ajax transforme les + en espace donc transformation des + en plus et dans le controller on fait l'inverse |
---|
1581 | var transitionLowerReplaced = context.transitionLower.replace(/\+/g,"plus"); |
---|
1582 | |
---|
1583 | //Appel à la BDD |
---|
1584 | |
---|
1585 | $.ajax( { |
---|
1586 | url: "project?methodName=getTransitionByIsotopeNameByTransitionLower&isotopesSelectedNameArray="+isotopesSelectedNameArray+"&geisaSelectedDatabase="+context.selectDatabase.getValue2()+"&spectralRangeLower="+spectralRangeLower+"&spectralRangeUpper="+spectralRangeUpper+"&transitionLower="+transitionLowerReplaced, |
---|
1587 | success:jQuery.proxy( context.handleRequestTransitionByTransitionLower, context) |
---|
1588 | } ); |
---|
1589 | |
---|
1590 | |
---|
1591 | |
---|
1592 | }, |
---|
1593 | |
---|
1594 | |
---|
1595 | //requête pour interrogation de la base de données des transitions en fonction d'une transition upper |
---|
1596 | requestTransitionByTransitionUpper: function() |
---|
1597 | { |
---|
1598 | var context = this[0]; |
---|
1599 | //exemple transitionLower=" 000" : il y a 25 caractÚres dans chaque transition |
---|
1600 | context.transitionUpper = this[1]; |
---|
1601 | |
---|
1602 | //Récupération de la Base Geisa sélectionnée |
---|
1603 | var GeisaSelectedDatabase = context.selectDatabase.getValue(); |
---|
1604 | |
---|
1605 | //Récupération du spectral range |
---|
1606 | var spectralRangeLower = $("#rangeLower").val(); |
---|
1607 | var spectralRangeUpper = $("#rangeUpper").val(); |
---|
1608 | |
---|
1609 | //Récupération des isotopes sélectionnés |
---|
1610 | var inputs = document.getElementsByTagName( 'input' ); |
---|
1611 | var count = inputs.length; |
---|
1612 | var isotopesSelectedNameArray = new Array(); |
---|
1613 | var i=0; |
---|
1614 | |
---|
1615 | for( i = 0; i < count; i++ ) |
---|
1616 | { |
---|
1617 | var input = inputs.item( i ); |
---|
1618 | //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") |
---|
1619 | if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("chk-")!= -1 && input.id.indexOf(context.selectDatabase.getValue())!= -1) |
---|
1620 | { |
---|
1621 | var molN=input.value; |
---|
1622 | var molN1=molN.replace("_", ":"); |
---|
1623 | //tous les isotopes sélectionnés sont placés dans un tableau |
---|
1624 | isotopesSelectedNameArray.push(molN1); |
---|
1625 | } |
---|
1626 | |
---|
1627 | } |
---|
1628 | //le passage de javascript à java par ajax transforme les + en espace donc transformation des + en plus et dans le controller on fait l'inverse |
---|
1629 | var transitionUpperReplaced = context.transitionUpper.replace(/\+/g,"plus"); |
---|
1630 | |
---|
1631 | //Appel à la BDD |
---|
1632 | $.ajax( { |
---|
1633 | url: "project?methodName=getTransitionByIsotopeNameByTransitionUpper&isotopesSelectedNameArray="+isotopesSelectedNameArray+"&geisaSelectedDatabase="+context.selectDatabase.getValue2()+"&spectralRangeLower="+spectralRangeLower+"&spectralRangeUpper="+spectralRangeUpper+"&transitionUpper="+transitionUpperReplaced, |
---|
1634 | success:jQuery.proxy( context.handleRequestTransitionByTransitionUpper, context) |
---|
1635 | } ); |
---|
1636 | |
---|
1637 | |
---|
1638 | |
---|
1639 | }, |
---|
1640 | |
---|
1641 | |
---|
1642 | |
---|
1643 | // requestTransition: function() |
---|
1644 | // { |
---|
1645 | // $.ajax( { |
---|
1646 | // url: "project?methodName=transition&transitionValue="+ this.selectTransitionUpper.getValue(), |
---|
1647 | // success:jQuery.proxy( this.handleRequestTransition, this ) |
---|
1648 | // } ); |
---|
1649 | // }, |
---|
1650 | |
---|
1651 | // HANDLES ******************************************************** = retours ajax |
---|
1652 | //affichage sur l'interface |
---|
1653 | |
---|
1654 | handleGeisa: function( result ) |
---|
1655 | { |
---|
1656 | |
---|
1657 | //nom du répertoire : exemple de retour de valeur du controleur |
---|
1658 | //this.nb = jQuery.parseJSON( result ).nb; |
---|
1659 | //this.NomRepFileOut = jQuery.parseJSON( result ).NomRepFileOut; |
---|
1660 | //liste des fichiers png crées par le programme fortran. |
---|
1661 | var fileList = jQuery.parseJSON( result ).fileList; |
---|
1662 | |
---|
1663 | |
---|
1664 | |
---|
1665 | //chemin court de l'image |
---|
1666 | this.pathImg = "<%=Controller.PATH_IMAGES%>"+this.NomRepFileOut; |
---|
1667 | |
---|
1668 | |
---|
1669 | //Pour tracer le bon nombre de graphs et de bouton download |
---|
1670 | var i=1; |
---|
1671 | var content=""; |
---|
1672 | //bouton "Download All" si il y a plus d'un graph |
---|
1673 | if (this.nbGraph > 1) |
---|
1674 | { |
---|
1675 | content = "<a href=project?methodName=downloadFile&fileName=" +this.NomRepFileOut + "GEISA.tar&fileNameToDisplay=GEISA.tar><button class='dataProtocolDownloadButton'>Download All</button></a>"; |
---|
1676 | } |
---|
1677 | // //tracer chaque graphe avec son bouton download associé |
---|
1678 | // // for (i=1; i<this.nbGraph+1; i++) { |
---|
1679 | //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>'; |
---|
1680 | // // 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>'; |
---|
1681 | // // } |
---|
1682 | |
---|
1683 | |
---|
1684 | $.each( fileList, jQuery.proxy(function( index, fileElement ) |
---|
1685 | { |
---|
1686 | content = content +'<img src=' + this.pathImg + fileElement + ' /><a href="project?methodName=downloadFile&fileName=' +this.NomRepFileOut + fileElement+"&fileNameToDisplay="+fileElement+ '"><button class="dataProtocolDownloadButton">Download</button></a>'; |
---|
1687 | }, this) ); |
---|
1688 | |
---|
1689 | |
---|
1690 | |
---|
1691 | |
---|
1692 | |
---|
1693 | this.displayWindow(content); |
---|
1694 | }, |
---|
1695 | |
---|
1696 | |
---|
1697 | handleRequestTransition: function( result ) |
---|
1698 | { |
---|
1699 | |
---|
1700 | |
---|
1701 | // var transitions = jQuery.parseJSON( result ).transitions; |
---|
1702 | var transitionsLower = jQuery.parseJSON( result ).transitionsLower; |
---|
1703 | var transitionsUpper = jQuery.parseJSON( result ).transitionsUpper; |
---|
1704 | |
---|
1705 | //pour vider les menus déroulant des transitions précédentes |
---|
1706 | // this.selectTransitionLower.clear(); |
---|
1707 | document.getElementById("transition2").length=0; |
---|
1708 | //this.selectTransitionUpper.clear(); |
---|
1709 | document.getElementById("transition1").length=0; |
---|
1710 | |
---|
1711 | // this.selectTransitionLower.add('transition', "Choose a transition"); |
---|
1712 | this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled", selected:"selected"} )); |
---|
1713 | // this.selectTransitionUpper.add('transition', "Choose a transition"); |
---|
1714 | this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled", selected:"selected"} )); |
---|
1715 | //pour forcer à afficher le premier élément (et non le premier élément précédent) |
---|
1716 | // this.selectTransitionLower.selectFirst(); |
---|
1717 | // this.selectTransitionUpper.selectFirst(); |
---|
1718 | |
---|
1719 | |
---|
1720 | $.each(transitionsLower, jQuery.proxy( function(index, transitionsLower ) |
---|
1721 | { |
---|
1722 | // this.selectTransitionLower.add(transitionsLower, transitionsLower,jQuery.proxy(this.requestTransitionByTransitionLower, [this, transitionsLower ])); |
---|
1723 | |
---|
1724 | |
---|
1725 | this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:transitionsLower, text:transitionsLower} ).bind( 'click', jQuery.proxy(this.requestTransitionByTransitionLower, [this, transitionsLower ]))); |
---|
1726 | |
---|
1727 | }, this)); |
---|
1728 | |
---|
1729 | $.each(transitionsUpper, jQuery.proxy( function(index, transitionsUpper ) |
---|
1730 | { |
---|
1731 | //this.selectTransitionUpper.add(transitionsUpper, transitionsUpper,jQuery.proxy(this.requestTransitionByTransitionUpper, [this, transitionsUpper ])); |
---|
1732 | this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:transitionsUpper, text:transitionsUpper} ).bind( 'click', jQuery.proxy(this.requestTransitionByTransitionUpper, [this, transitionsUpper ]))); |
---|
1733 | |
---|
1734 | }, this)); |
---|
1735 | |
---|
1736 | }, |
---|
1737 | |
---|
1738 | //en cas d'erreur dans la requête des transitions ( pas de valeur ou caractÚres à la place de nombres dans champ spectral) |
---|
1739 | handleErrorRequestTransition : function() |
---|
1740 | { |
---|
1741 | //pour vider les menus déroulant des transitions précédentes |
---|
1742 | document.getElementById("transition2").length=0; |
---|
1743 | document.getElementById("transition1").length=0; |
---|
1744 | |
---|
1745 | this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"requestError", text:"Choose a transition", disabled:"disabled", selected:"selected"} )); |
---|
1746 | this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"requestError", text:"Choose a transition", disabled:"disabled", selected:"selected"} )); |
---|
1747 | |
---|
1748 | }, |
---|
1749 | |
---|
1750 | handleRequestTransitionByTransitionLower : function( result ) |
---|
1751 | { |
---|
1752 | //alert("transitionLower"+this.transitionLower); |
---|
1753 | var transitionsUpperBis = jQuery.parseJSON( result ).transitionsUpperBis; |
---|
1754 | //alert("transitionsUpper"+transitionsUpper); |
---|
1755 | |
---|
1756 | //pour vider les menus déroulant des transitions précédentes |
---|
1757 | // this.selectTransitionLower.clear(); |
---|
1758 | document.getElementById("transition2").length=0; |
---|
1759 | //this.selectTransitionUpper.clear(); |
---|
1760 | document.getElementById("transition1").length=0; |
---|
1761 | // while(0 < document.getElementById("transition1").length) |
---|
1762 | // { |
---|
1763 | // document.getElementById("transition1").options[0] = null; |
---|
1764 | // } |
---|
1765 | |
---|
1766 | |
---|
1767 | //this.selectTransitionLower.add(this.transitionLower, this.transitionLower); |
---|
1768 | this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled"} )); |
---|
1769 | this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:this.transitionLower, text:this.transitionLower, selected:"selected"} )); |
---|
1770 | //this.selectTransitionUpper.add('transition', "Choose a transition"); |
---|
1771 | //rajout du text "Choose a transition" selectionné en premier mais on ne peut pas cliquer dessus |
---|
1772 | this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled", selected:"selected"} )); |
---|
1773 | |
---|
1774 | |
---|
1775 | //pour forcer à afficher le premier élément (et non le premier élément précédent) |
---|
1776 | //this.selectTransitionLower.selectFirst(); |
---|
1777 | //this.selectTransitionUpper.selectFirst(); |
---|
1778 | |
---|
1779 | |
---|
1780 | |
---|
1781 | $.each(transitionsUpperBis, jQuery.proxy( function(index, transitionsUpperBis ) |
---|
1782 | { |
---|
1783 | // this.selectTransitionUpper.add(transitionsUpper, transitionsUpper); |
---|
1784 | this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:transitionsUpperBis, text:transitionsUpperBis} )); |
---|
1785 | |
---|
1786 | }, this)); |
---|
1787 | |
---|
1788 | }, |
---|
1789 | |
---|
1790 | |
---|
1791 | handleRequestTransitionByTransitionUpper : function( result ) |
---|
1792 | { |
---|
1793 | // alert("transitionUpper"+this.transitionUpper); |
---|
1794 | var transitionsLowerBis = jQuery.parseJSON( result ).transitionsLowerBis; |
---|
1795 | //alert("transitionsLower"+transitionsLower); |
---|
1796 | |
---|
1797 | //pour vider les menus déroulant des transitions précédentes |
---|
1798 | // this.selectTransitionLower.clear(); |
---|
1799 | document.getElementById("transition2").length=0; |
---|
1800 | //this.selectTransitionUpper.clear(); |
---|
1801 | document.getElementById("transition1").length=0; |
---|
1802 | |
---|
1803 | // this.selectTransitionLower.add('transition', "Choose a transition"); |
---|
1804 | this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled", selected:"selected"} )); |
---|
1805 | |
---|
1806 | // this.selectTransitionUpper.add(this.transitionUpper, this.transitionUpper); |
---|
1807 | this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled"} )); |
---|
1808 | this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:this.transitionUpper, text:this.transitionUpper, selected:"selected"} )); |
---|
1809 | |
---|
1810 | |
---|
1811 | //pour forcer à afficher le premier élément (et non le premier élément précédent) |
---|
1812 | //this.selectTransitionLower.selectFirst(); |
---|
1813 | //this.selectTransitionUpper.selectFirst(); |
---|
1814 | |
---|
1815 | |
---|
1816 | |
---|
1817 | $.each(transitionsLowerBis, jQuery.proxy( function(index, transitionsLowerBis ) |
---|
1818 | { |
---|
1819 | //this.selectTransitionLower.add(transitionsLower, transitionsLower); |
---|
1820 | this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:transitionsLowerBis, text:transitionsLowerBis} )); |
---|
1821 | }, this)); |
---|
1822 | |
---|
1823 | }, |
---|
1824 | // EVENTS ******************************************************** |
---|
1825 | // |
---|
1826 | //Action quand on clique sur l'onglet DatabaseContents |
---|
1827 | onClickDatabaseContents: function() |
---|
1828 | { |
---|
1829 | |
---|
1830 | //change la couleur des onglets |
---|
1831 | this.ntabContents.active(); |
---|
1832 | this.ntabGlobal.inactive(); |
---|
1833 | this.ntabComparison.inactive(); |
---|
1834 | //rempli la valeur d'une variable cachée pour indiquée quelle option graphique est choisi par l'utilisateur au moment du submit |
---|
1835 | $("#graphicOptionChoice").val("contents"); |
---|
1836 | //change le titre de la page en fonction de l'onglet cliqué |
---|
1837 | document.getElementById('titlePage').innerHTML = ""; |
---|
1838 | document.getElementById('titlePage').innerHTML = "Graphic vizualisation of the GEISA database"; |
---|
1839 | //Eléments qui apparaissent avec cette option |
---|
1840 | document.getElementById("informationContents").style.display= ""; |
---|
1841 | document.getElementById("axeY1Gene").style.display= ""; |
---|
1842 | document.getElementById("showAdvancedOptions").style.display= ""; |
---|
1843 | document.getElementById("axeY2Gene").style.display= ""; |
---|
1844 | document.getElementById("drawingOptionsY2").style.display= ""; |
---|
1845 | //Eléments qui disparaissent avec cette option |
---|
1846 | document.getElementById("informationGlobal").style.display= "none"; |
---|
1847 | document.getElementById("informationComparison").style.display= "none"; |
---|
1848 | document.getElementById("titreDatabase1").style.display= "none"; |
---|
1849 | document.getElementById("titreDatabase2").style.display= "none"; |
---|
1850 | document.getElementById("database2").style.display= "none"; |
---|
1851 | document.getElementById("titreTypePlotDatabase1").style.display= "none"; |
---|
1852 | document.getElementById("titreTypePlotDatabase2").style.display= "none"; |
---|
1853 | document.getElementById("typePlotDatabase2").style.display= "none"; |
---|
1854 | document.getElementById("outputDatabaseComparison").style.display= "none"; |
---|
1855 | //modification de titre d'option |
---|
1856 | document.getElementById('scaleY1Titre').innerHTML = ""; |
---|
1857 | document.getElementById('scaleY1Titre').innerHTML = "Select the type of scale (if intensity is choosen)"; |
---|
1858 | //ProblÚme de marge avec le bord du fieldset |
---|
1859 | $("#database1").removeClass("containerDatabase"); |
---|
1860 | $("#database1").addClass("containerBeginDatabase"); |
---|
1861 | $("#typePlotY1").removeClass("containerPlot"); |
---|
1862 | $("#typePlotY1").addClass("containerInsideOptions"); |
---|
1863 | //Pour que le lien show/hide advanced option et le bloc "advanced option" fonctionnent correctement ensemble |
---|
1864 | if( document.getElementById( "aShowHide" ).innerHTML == "Show advanced options" ) |
---|
1865 | { |
---|
1866 | document.getElementById( "advancedOptions" ).style.display = "none"; |
---|
1867 | |
---|
1868 | } |
---|
1869 | if( document.getElementById( "aShowHide" ).innerHTML == "Hide advanced options" ) |
---|
1870 | |
---|
1871 | { |
---|
1872 | document.getElementById( "advancedOptions" ).style.display = ""; |
---|
1873 | |
---|
1874 | } |
---|
1875 | //modification du contenu des menus déroulants |
---|
1876 | this.selectDatabase.clear(); |
---|
1877 | this.selectDatabase.add( 'GEISA2011', "GEISA 2011", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeG09.class%>' ); |
---|
1878 | this.selectDatabase.add( 'GEISAIASI2011', "GEISA-IASI 2011", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeIasiG09.class%>' ); |
---|
1879 | this.selectDatabase.add( 'GEISA2003', "GEISA 2003", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeG03.class%>' ); |
---|
1880 | this.selectDatabase.add( 'GEISAIASI2003', "GEISA-IASI 2003", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeIasiG03.class%>' ); |
---|
1881 | this.selectDatabase.selectFirst(); |
---|
1882 | |
---|
1883 | //pour effacer le menu déroulant |
---|
1884 | this.selectNbCourbes.clear(); |
---|
1885 | this.selectNbCourbes.add( 'ca', "One curve for all selection", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); |
---|
1886 | this.selectNbCourbes.add( 'cm', "Separated molecules : same graph", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); |
---|
1887 | this.selectNbCourbes.add( 'gm', "Separated molecules : different graphs", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); |
---|
1888 | this.selectNbCourbes.add( 'gi', "Separated isotopologues : different graphs", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); |
---|
1889 | this.selectNbCourbes.add( 'ci', "Separated isotopologues : same graph", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); |
---|
1890 | //pour remettre par défaut le premier de la liste |
---|
1891 | this.selectNbCourbes.selectFirst(); |
---|
1892 | |
---|
1893 | this.selectTypeTraceY1.clear(); |
---|
1894 | this.selectTypeTraceY1.add( 'l', "Lines" ); |
---|
1895 | this.selectTypeTraceY1.add( 'p', "Dots" ); |
---|
1896 | this.selectTypeTraceY1.add( 'i', "Peaks" ); |
---|
1897 | this.selectTypeTraceY1.add( 'lp', "Lines and Dots" ); |
---|
1898 | this.selectTypeTraceY1.selectFirst(); |
---|
1899 | |
---|
1900 | }, |
---|
1901 | //Action quand on clique sur l'onglet GlobalRepresentation |
---|
1902 | onClickGlobalRepresentation: function() |
---|
1903 | { |
---|
1904 | //change la couleur des onglets |
---|
1905 | this.ntabGlobal.active(); |
---|
1906 | this.ntabContents.inactive(); |
---|
1907 | this.ntabComparison.inactive(); |
---|
1908 | //rempli la valeur d'une variable cachée pour indiquée quelle option graphique est choisi par l'utilisateur au moment du submit |
---|
1909 | $("#graphicOptionChoice").val("global"); |
---|
1910 | //change le titre de la page en fonction de l'onglet cliqué |
---|
1911 | document.getElementById('titlePage').innerHTML = ""; |
---|
1912 | document.getElementById('titlePage').innerHTML = "Global Representation"; |
---|
1913 | //Eléments qui apparaissent avec cette option |
---|
1914 | document.getElementById("informationGlobal").style.display= ""; |
---|
1915 | //Eléments qui disparaissent avec cette option |
---|
1916 | document.getElementById("informationContents").style.display= "none"; |
---|
1917 | document.getElementById("informationComparison").style.display= "none"; |
---|
1918 | document.getElementById("titreDatabase1").style.display= "none"; |
---|
1919 | document.getElementById("titreDatabase2").style.display= "none"; |
---|
1920 | document.getElementById("database2").style.display= "none"; |
---|
1921 | document.getElementById("axeY1Gene").style.display= "none"; |
---|
1922 | document.getElementById("titreTypePlotDatabase1").style.display= "none"; |
---|
1923 | document.getElementById("titreTypePlotDatabase2").style.display= "none"; |
---|
1924 | document.getElementById("typePlotDatabase2").style.display= "none"; |
---|
1925 | document.getElementById("showAdvancedOptions").style.display= "none"; |
---|
1926 | document.getElementById("advancedOptions").style.display= "none"; |
---|
1927 | //modification de titre d'option |
---|
1928 | document.getElementById('scaleY1Titre').innerHTML = ""; |
---|
1929 | document.getElementById('scaleY1Titre').innerHTML = "Select the type of scale"; |
---|
1930 | //ProblÚme de marge avec le bord du fieldset |
---|
1931 | $("#database1").removeClass("containerDatabase"); |
---|
1932 | $("#database1").addClass("containerBeginDatabase"); |
---|
1933 | $("#typePlotY1").removeClass("containerPlot"); |
---|
1934 | $("#typePlotY1").addClass("containerInsideOptions"); |
---|
1935 | //modification du contenu des menus déroulants |
---|
1936 | this.selectDatabase.clear(); |
---|
1937 | this.selectDatabase.add( 'GEISA2011', "GEISA 2011", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeG09.class%>' ); |
---|
1938 | this.selectDatabase.add( 'GEISAIASI2011', "GEISA-IASI 2011", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeIasiG09.class%>' ); |
---|
1939 | this.selectDatabase.add( 'GEISA2003', "GEISA 2003", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeG03.class%>' ); |
---|
1940 | this.selectDatabase.add( 'GEISAIASI2003', "GEISA-IASI 2003", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeIasiG03.class%>' ); |
---|
1941 | this.selectDatabase.selectFirst(); |
---|
1942 | |
---|
1943 | this.selectNbCourbes.clear(); |
---|
1944 | this.selectNbCourbes.add( 'cm', "Separated molecules : same graph", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); |
---|
1945 | this.selectNbCourbes.add( 'ci', "Separated isotopologues : same graph", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); |
---|
1946 | this.selectNbCourbes.selectFirst(); |
---|
1947 | |
---|
1948 | this.selectTypeTraceY1.clear(); |
---|
1949 | this.selectTypeTraceY1.add( 'i', "Peaks" ); |
---|
1950 | this.selectTypeTraceY1.add( 'l', "Lines" ); |
---|
1951 | this.selectTypeTraceY1.add( 'p', "Dots" ); |
---|
1952 | this.selectTypeTraceY1.add( 'lp', "Lines and Dots" ); |
---|
1953 | this.selectTypeTraceY1.selectFirst(); |
---|
1954 | |
---|
1955 | }, |
---|
1956 | //Action quand on clique sur l'onglet DatabasesComparison |
---|
1957 | onClickDatabasesComparison: function() |
---|
1958 | { |
---|
1959 | //change la couleur des onglets |
---|
1960 | this.ntabComparison.active(); |
---|
1961 | this.ntabGlobal.inactive(); |
---|
1962 | this.ntabContents.inactive(); |
---|
1963 | //rempli la valeur d'une variable cachée pour indiquée quelle option graphique est choisi par l'utilisateur au moment du submit |
---|
1964 | $("#graphicOptionChoice").val("comparison"); |
---|
1965 | //change le titre de la page en fonction de l'onglet cliqué |
---|
1966 | document.getElementById('titlePage').innerHTML = ""; |
---|
1967 | document.getElementById('titlePage').innerHTML = "Databases Comparison"; |
---|
1968 | //Eléments qui apparaissent avec cette option |
---|
1969 | document.getElementById("informationComparison").style.display= ""; |
---|
1970 | document.getElementById("titreDatabase1").style.display= ""; |
---|
1971 | document.getElementById("titreDatabase2").style.display= ""; |
---|
1972 | document.getElementById("database2").style.display= ""; |
---|
1973 | document.getElementById("axeY1Gene").style.display= ""; |
---|
1974 | document.getElementById("titreTypePlotDatabase1").style.display= ""; |
---|
1975 | document.getElementById("titreTypePlotDatabase2").style.display= ""; |
---|
1976 | document.getElementById("typePlotDatabase2").style.display= ""; |
---|
1977 | document.getElementById("showAdvancedOptions").style.display= ""; |
---|
1978 | document.getElementById("outputDatabaseComparison").style.display= ""; |
---|
1979 | //Eléments qui disparaissent avec cette option |
---|
1980 | document.getElementById("informationContents").style.display= "none"; |
---|
1981 | document.getElementById("informationGlobal").style.display= "none"; |
---|
1982 | document.getElementById("axeY2Gene").style.display= "none"; |
---|
1983 | document.getElementById("drawingOptionsY2").style.display= "none"; |
---|
1984 | //modification de titre d'option |
---|
1985 | document.getElementById('scaleY1Titre').innerHTML = ""; |
---|
1986 | document.getElementById('scaleY1Titre').innerHTML = "Select the type of scale (if intensity is choosen)"; |
---|
1987 | //ProblÚme de marge avec le bord du fieldset |
---|
1988 | $("#database1").removeClass("containerBeginDatabase"); |
---|
1989 | $("#database1").addClass("containerDatabase"); |
---|
1990 | $("#typePlotY1").removeClass("containerInsideOptions"); |
---|
1991 | $("#typePlotY1").addClass("containerPlot"); |
---|
1992 | |
---|
1993 | //Pour que le lien show/hide advanced option et le bloc "advanced option" fonctionnent correctement ensemble |
---|
1994 | if( document.getElementById( "aShowHide" ).innerHTML == "Show advanced options" ) |
---|
1995 | |
---|
1996 | { |
---|
1997 | document.getElementById( "advancedOptions" ).style.display = "none"; |
---|
1998 | } |
---|
1999 | if( document.getElementById( "aShowHide" ).innerHTML == "Hide advanced options" ) |
---|
2000 | |
---|
2001 | { |
---|
2002 | document.getElementById( "advancedOptions" ).style.display = ""; |
---|
2003 | } |
---|
2004 | //modification du contenu des menus déroulants |
---|
2005 | this.selectDatabase.clear(); |
---|
2006 | this.selectDatabase.add( 'GEISA2011', "GEISA 2011", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeG09.class%>' ); |
---|
2007 | this.selectDatabase.add( 'GEISA2003', "GEISA 2003", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeG03.class%>' ); |
---|
2008 | this.selectDatabase.selectFirst(); |
---|
2009 | |
---|
2010 | this.selectNbCourbes.clear(); |
---|
2011 | this.selectNbCourbes.add( 'ca', "One curve for all selection", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); |
---|
2012 | this.selectNbCourbes.add( 'gm', "Separated molecules : different graphs", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); |
---|
2013 | this.selectNbCourbes.add( 'gi', "Separated isotopologues : different graphs", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); |
---|
2014 | this.selectNbCourbes.selectFirst(); |
---|
2015 | |
---|
2016 | this.selectTypeTraceY1.clear(); |
---|
2017 | this.selectTypeTraceY1.add( 'l', "Lines" ); |
---|
2018 | this.selectTypeTraceY1.add( 'p', "Dots" ); |
---|
2019 | this.selectTypeTraceY1.add( 'i', "Peaks" ); |
---|
2020 | this.selectTypeTraceY1.add( 'lp', "Lines and Dots" ); |
---|
2021 | this.selectTypeTraceY1.selectFirst(); |
---|
2022 | }, |
---|
2023 | |
---|
2024 | |
---|
2025 | //affichage de la valeur du spectral range et affichage du bloc des molecules en fonction de la base de donnees selectionnee |
---|
2026 | onClickSelectDatabase: function(value) |
---|
2027 | { |
---|
2028 | |
---|
2029 | if ('GEISA2011' == value) |
---|
2030 | { |
---|
2031 | //modifier le titre en fonction de la base sélectionnée |
---|
2032 | document.getElementById('spectralRangeTitre').innerHTML = ""; |
---|
2033 | document.getElementById('spectralRangeTitre').innerHTML = "Choosing the spectral range (0 to 35877.030506 cm<sup>-1</sup>) :"; |
---|
2034 | |
---|
2035 | //remplir les valeurs par défaut |
---|
2036 | if($("#rangeLower").val()=="") |
---|
2037 | { |
---|
2038 | $("#rangeLower").val(0); |
---|
2039 | } |
---|
2040 | if($("#rangeUpper").val()=="") |
---|
2041 | { |
---|
2042 | $("#rangeUpper").val(35877.030506); |
---|
2043 | } |
---|
2044 | |
---|
2045 | //Si les valeur entrées par l'utilisateur ne sont pas correctes, on remet les valeurs des bornes |
---|
2046 | if(isNaN(($("#rangeLower").val())) == true || parseFloat( $("#rangeLower").val()) < 0 || parseFloat($("#rangeLower").val()) > 35877.030506) |
---|
2047 | { |
---|
2048 | $("#rangeLower").val(0); |
---|
2049 | } |
---|
2050 | if(isNaN(($("#rangeLower").val())) == true || parseFloat( $("#rangeUpper").val()) < 0 || parseFloat($("#rangeUpper").val()) > 35877.030506) |
---|
2051 | { |
---|
2052 | $("#rangeUpper").val(35877.030506); |
---|
2053 | } |
---|
2054 | |
---|
2055 | //afficher le bon bloc de molécules |
---|
2056 | document.getElementById( "BDD-GEISA2011" ).style.display = ""; |
---|
2057 | document.getElementById( "BDD-GEISAIASI2011" ).style.display = "none"; |
---|
2058 | document.getElementById( "BDD-GEISA2003" ).style.display = "none"; |
---|
2059 | document.getElementById( "BDD-GEISAIASI2003" ).style.display = "none"; |
---|
2060 | } |
---|
2061 | |
---|
2062 | if ('GEISAIASI2011' == value) |
---|
2063 | { |
---|
2064 | document.getElementById('spectralRangeTitre').innerHTML = ""; |
---|
2065 | document.getElementById('spectralRangeTitre').innerHTML = "Choosing spectral range (599.000793 to 3000.998767 cm<sup>-1</sup>) :"; |
---|
2066 | |
---|
2067 | |
---|
2068 | //remplir les valeurs par défaut |
---|
2069 | if($("#rangeLower").val()=="") |
---|
2070 | { |
---|
2071 | $("#rangeLower").val(599.000793); |
---|
2072 | } |
---|
2073 | if($("#rangeUpper").val()=="") |
---|
2074 | { |
---|
2075 | $("#rangeUpper").val(3000.998767); |
---|
2076 | } |
---|
2077 | //Si les valeur entrées par l'utilisateur ne sont pas correctes, on remet les valeurs des bornes |
---|
2078 | if(isNaN(($("#rangeLower").val())) == true || parseFloat( $("#rangeLower").val()) < 599.000793 || parseFloat($("#rangeLower").val()) > 3000.998767) |
---|
2079 | { |
---|
2080 | $("#rangeLower").val(599.000793); |
---|
2081 | } |
---|
2082 | if(isNaN(($("#rangeLower").val())) == true || parseFloat( $("#rangeUpper").val()) < 599.000793 || parseFloat($("#rangeUpper").val()) > 3000.998767) |
---|
2083 | { |
---|
2084 | $("#rangeUpper").val(3000.998767); |
---|
2085 | } |
---|
2086 | |
---|
2087 | document.getElementById( "BDD-GEISA2011" ).style.display = "none"; |
---|
2088 | document.getElementById( "BDD-GEISAIASI2011" ).style.display = ""; |
---|
2089 | document.getElementById( "BDD-GEISA2003" ).style.display = "none"; |
---|
2090 | document.getElementById( "BDD-GEISAIASI2003" ).style.display = "none"; |
---|
2091 | } |
---|
2092 | |
---|
2093 | if ('GEISA2003' == value) |
---|
2094 | { |
---|
2095 | document.getElementById('spectralRangeTitre').innerHTML = ""; |
---|
2096 | document.getElementById('spectralRangeTitre').innerHTML = "Choosing the spectral range (0 to 35877.030506 cm<sup>-1</sup>) :"; |
---|
2097 | |
---|
2098 | //remplir les valeurs par défaut |
---|
2099 | if($("#rangeLower").val()=="") |
---|
2100 | { |
---|
2101 | $("#rangeLower").val(0); |
---|
2102 | } |
---|
2103 | if($("#rangeUpper").val()=="") |
---|
2104 | { |
---|
2105 | $("#rangeUpper").val(35877.030506); |
---|
2106 | } |
---|
2107 | //Si les valeur entrées par l'utilisateur ne sont pas correctes, on remet les valeurs des bornes |
---|
2108 | if(isNaN(($("#rangeLower").val())) == true || parseFloat( $("#rangeLower").val()) < 0 || parseFloat($("#rangeLower").val()) > 35877.030506) |
---|
2109 | { |
---|
2110 | $("#rangeLower").val(0); |
---|
2111 | } |
---|
2112 | if(isNaN(($("#rangeLower").val())) == true || parseFloat( $("#rangeUpper").val()) < 0 || parseFloat($("#rangeUpper").val()) > 35877.030506) |
---|
2113 | { |
---|
2114 | $("#rangeUpper").val(35877.030506); |
---|
2115 | } |
---|
2116 | |
---|
2117 | document.getElementById( "BDD-GEISA2011" ).style.display = "none"; |
---|
2118 | document.getElementById( "BDD-GEISAIASI2011" ).style.display = "none"; |
---|
2119 | document.getElementById( "BDD-GEISA2003" ).style.display = ""; |
---|
2120 | document.getElementById( "BDD-GEISAIASI2003" ).style.display = "none"; |
---|
2121 | } |
---|
2122 | if ('GEISAIASI2003' == value) |
---|
2123 | { |
---|
2124 | document.getElementById('spectralRangeTitre').innerHTML = ""; |
---|
2125 | document.getElementById('spectralRangeTitre').innerHTML = "Choosing spectral range (599.000793 to 3000.998767 cm<sup>-1</sup>) :"; |
---|
2126 | |
---|
2127 | //remplir les valeurs par défaut |
---|
2128 | if($("#rangeLower").val()=="") |
---|
2129 | { |
---|
2130 | $("#rangeLower").val(599.000793); |
---|
2131 | } |
---|
2132 | if($("#rangeUpper").val()=="") |
---|
2133 | { |
---|
2134 | $("#rangeUpper").val(3000.998767); |
---|
2135 | } |
---|
2136 | //Si les valeur entrées par l'utilisateur ne sont pas correctes, on remet les valeurs des bornes |
---|
2137 | if(isNaN(($("#rangeLower").val())) == true || parseFloat( $("#rangeLower").val()) < 599.000793 || parseFloat($("#rangeLower").val()) > 3000.998767) |
---|
2138 | { |
---|
2139 | $("#rangeLower").val(599.000793); |
---|
2140 | } |
---|
2141 | if(isNaN(($("#rangeLower").val())) == true || parseFloat( $("#rangeUpper").val()) < 599.000793 || parseFloat($("#rangeUpper").val()) > 3000.998767) |
---|
2142 | { |
---|
2143 | $("#rangeUpper").val(3000.998767); |
---|
2144 | } |
---|
2145 | |
---|
2146 | document.getElementById( "BDD-GEISA2011" ).style.display = "none"; |
---|
2147 | document.getElementById( "BDD-GEISAIASI2011" ).style.display = "none"; |
---|
2148 | document.getElementById( "BDD-GEISA2003" ).style.display = "none"; |
---|
2149 | document.getElementById( "BDD-GEISAIASI2003" ).style.display = ""; |
---|
2150 | } |
---|
2151 | |
---|
2152 | //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 |
---|
2153 | this.requestTransition(); |
---|
2154 | }, |
---|
2155 | |
---|
2156 | //Pour sélectionner-desélectionner tous les isotopes |
---|
2157 | selectAll: function() |
---|
2158 | { |
---|
2159 | var inputs = document.getElementsByTagName( 'input' ); |
---|
2160 | var count = inputs.length; |
---|
2161 | var i=0; |
---|
2162 | |
---|
2163 | |
---|
2164 | if( this.selectButton.getValue() == 'Select all molecules') |
---|
2165 | { |
---|
2166 | for( i = 0; i < count; i++ ) |
---|
2167 | { |
---|
2168 | var input = inputs.item( i ); |
---|
2169 | if( input.type == 'checkbox' ) |
---|
2170 | { |
---|
2171 | input.checked = true; |
---|
2172 | } |
---|
2173 | } |
---|
2174 | this.selectButton.setValue("Unselect all molecules"); |
---|
2175 | |
---|
2176 | } |
---|
2177 | else |
---|
2178 | { |
---|
2179 | for( i = 0; i < count; i++ ) |
---|
2180 | { |
---|
2181 | var input = inputs.item( i ); |
---|
2182 | if( input.type == 'checkbox' ) |
---|
2183 | { |
---|
2184 | input.checked = false; |
---|
2185 | } |
---|
2186 | } |
---|
2187 | this.selectButton.setValue("Select all molecules"); |
---|
2188 | } |
---|
2189 | |
---|
2190 | //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 |
---|
2191 | this.requestTransition(); |
---|
2192 | |
---|
2193 | }, |
---|
2194 | |
---|
2195 | //Pour montrer-cacher tous les isotopes |
---|
2196 | viewAll: function() |
---|
2197 | { |
---|
2198 | var divs = document.getElementsByTagName( 'div' ); |
---|
2199 | var count = divs.length; |
---|
2200 | var i = 0; |
---|
2201 | if( this.showButton.getValue() == 'View all isotopologues') |
---|
2202 | { |
---|
2203 | for( i = 0; i < count; i++ ) |
---|
2204 | { |
---|
2205 | //ouvrir que les div dont l'id contient la chaine Cache |
---|
2206 | if (divs.item(i).id.indexOf("Cache") != -1) { |
---|
2207 | divs.item(i).style.display = "" ; |
---|
2208 | } |
---|
2209 | } |
---|
2210 | this.showButton.setValue("Hide all isotopologues"); |
---|
2211 | } |
---|
2212 | else |
---|
2213 | { |
---|
2214 | for( i = 0; i < count; i++ ) |
---|
2215 | { |
---|
2216 | //fermer que les div dont l'id contient la chaine Cache |
---|
2217 | if (divs.item(i).id.indexOf("Cache") != -1) { |
---|
2218 | divs.item(i).style.display = "none" ; |
---|
2219 | } |
---|
2220 | } |
---|
2221 | this.showButton.setValue("View all isotopologues"); |
---|
2222 | } |
---|
2223 | }, |
---|
2224 | |
---|
2225 | //Actions déclenchées quand on clique sur le nom d'une molécule |
---|
2226 | cliquetout: function() |
---|
2227 | { |
---|
2228 | var context = this[0]; |
---|
2229 | // exemple :moleculeName = ch3ch |
---|
2230 | var moleculeName = this[1]; |
---|
2231 | var bddVersion = this[2]; |
---|
2232 | var inputs = document.getElementsByTagName( 'input' ); |
---|
2233 | var count = inputs.length; |
---|
2234 | var i=0; |
---|
2235 | for( i = 0; i < count; i++ ) |
---|
2236 | { |
---|
2237 | var input = inputs.item( i ); |
---|
2238 | //cliquer toutes les molécules et isotopes du meme nom dans toutes les bases |
---|
2239 | //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') |
---|
2240 | // || 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'))) |
---|
2241 | |
---|
2242 | if( input.type == 'checkbox' && ( input.id.indexOf('chk-' + moleculeName + '_') != -1 || input.id.indexOf('all-'+moleculeName+'-')!= -1 )) |
---|
2243 | |
---|
2244 | { |
---|
2245 | input.checked = document.getElementById( 'all-'+ moleculeName + '-' + bddVersion ).checked; |
---|
2246 | } |
---|
2247 | } |
---|
2248 | //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 |
---|
2249 | context.requestTransition(); |
---|
2250 | }, |
---|
2251 | |
---|
2252 | //actions déclenchées quand on clique sur un isotope |
---|
2253 | cliqueIsotope: function() |
---|
2254 | { |
---|
2255 | var context = this[0]; |
---|
2256 | //exemple isotopeName = ch3cn_134 |
---|
2257 | var isotopeName = this[1]; |
---|
2258 | // exemple moleculeName= ch3cn |
---|
2259 | var moleculeName = this[2]; |
---|
2260 | var bddVersion = this[3]; |
---|
2261 | var inputs = document.getElementsByTagName( 'input' ); |
---|
2262 | var count = inputs.length; |
---|
2263 | var i = 0; |
---|
2264 | for( i = 0; i < count; i++ ) |
---|
2265 | { |
---|
2266 | input = inputs.item( i ); |
---|
2267 | |
---|
2268 | //id=chk-ch3cn_234-GEISA2011 |
---|
2269 | //cliquer ou decliquer le meme isotope dans toutes les bases |
---|
2270 | if( input.type == 'checkbox' && input.id.indexOf('chk-' + isotopeName) != -1) |
---|
2271 | { |
---|
2272 | input.checked = document.getElementById( 'chk-' + isotopeName + '-' + bddVersion ).checked; |
---|
2273 | |
---|
2274 | } |
---|
2275 | // id=all-ch3cn-GEISA2011 |
---|
2276 | //pour décocher la case de la molecule quand on décoche un isotope |
---|
2277 | // if( input.type == 'checkbox' && input.id.indexOf('all-'+ moleculeName) != -1 && input.checked == true ) |
---|
2278 | // { |
---|
2279 | // input.checked = false; |
---|
2280 | // } |
---|
2281 | } |
---|
2282 | |
---|
2283 | |
---|
2284 | //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 |
---|
2285 | var nbIsotopeSelected=0; |
---|
2286 | var input = ""; |
---|
2287 | var j=0; |
---|
2288 | var k=0; |
---|
2289 | |
---|
2290 | //tableau contenant toutes les valeurs du menu déroulant "choosing Database" |
---|
2291 | var databaseValues=context.selectDatabase.getValues(); |
---|
2292 | //taille du menu déroulant |
---|
2293 | var nbdatabaseValues=context.selectDatabase.getSize(); |
---|
2294 | |
---|
2295 | //pour chaque base faire ... |
---|
2296 | for( j = 0; j < nbdatabaseValues ; j++ ) |
---|
2297 | { |
---|
2298 | var nbIsotopeSelected=0; |
---|
2299 | //calcul du nombre d'isotopes sélectionnés pour une molécule précise et une base de données |
---|
2300 | for( k = 0; k < count; k++ ) |
---|
2301 | { |
---|
2302 | input = inputs.item( k ); |
---|
2303 | if( input.type == 'checkbox' && input.id.indexOf('chk-'+moleculeName+'_') != -1 && input.id.indexOf(databaseValues[j]) != -1 && input.checked == true ) |
---|
2304 | { |
---|
2305 | nbIsotopeSelected=nbIsotopeSelected+1; |
---|
2306 | } |
---|
2307 | |
---|
2308 | } |
---|
2309 | //si aucun isotope est sélectionné et que la molécule existe dans cette base alors on décoche la molécule |
---|
2310 | if ( nbIsotopeSelected == 0 && document.getElementById('all-'+ moleculeName+'-'+databaseValues[j])) |
---|
2311 | { |
---|
2312 | document.getElementById('all-'+ moleculeName+'-'+databaseValues[j]).checked=false; |
---|
2313 | } |
---|
2314 | //si au moins unisotope est sélectionné et que la molécule existe dans cette base alors on coche la molécule |
---|
2315 | if ( nbIsotopeSelected > 0 && document.getElementById('all-'+ moleculeName+'-'+databaseValues[j])) |
---|
2316 | { |
---|
2317 | document.getElementById('all-'+ moleculeName+'-'+databaseValues[j]).checked=true; |
---|
2318 | } |
---|
2319 | } |
---|
2320 | |
---|
2321 | |
---|
2322 | //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 |
---|
2323 | context.requestTransition(); |
---|
2324 | |
---|
2325 | }, |
---|
2326 | |
---|
2327 | |
---|
2328 | |
---|
2329 | //pour cacher ou voir les isotopes d'une molecule |
---|
2330 | visibilite: function( ) |
---|
2331 | { |
---|
2332 | var context = this[0]; |
---|
2333 | var thingId = this[1]; |
---|
2334 | var divs = document.getElementsByTagName( 'div' ); |
---|
2335 | var count = divs.length; |
---|
2336 | var i = 0; |
---|
2337 | for( i = 0; i < count; i++ ) |
---|
2338 | { |
---|
2339 | var div = divs.item( i ); |
---|
2340 | |
---|
2341 | |
---|
2342 | if ( div.id == thingId) |
---|
2343 | { |
---|
2344 | if( div.style.display == "none" ) |
---|
2345 | { |
---|
2346 | div.style.display = ""; |
---|
2347 | } |
---|
2348 | else |
---|
2349 | { |
---|
2350 | div.style.display = "none"; |
---|
2351 | } |
---|
2352 | } |
---|
2353 | } |
---|
2354 | }, |
---|
2355 | |
---|
2356 | //Faire apparatre ou disparaitre le bloc "advanced options" quand on clique sur le lien "show advanced options" |
---|
2357 | onClickShowAdvancedOptions: function() |
---|
2358 | { |
---|
2359 | //document.getElementById( "advancedOptions" ).style.display = "none"; |
---|
2360 | if( document.getElementById( "advancedOptions" ).style.display == "none" ) |
---|
2361 | { |
---|
2362 | document.getElementById( "advancedOptions" ).style.display = ""; |
---|
2363 | document.getElementById( "aShowHide" ).innerHTML = ""; |
---|
2364 | document.getElementById( "aShowHide" ).innerHTML = "Hide advanced options"; |
---|
2365 | } |
---|
2366 | else |
---|
2367 | { |
---|
2368 | document.getElementById( "advancedOptions" ).style.display = "none"; |
---|
2369 | document.getElementById( "aShowHide" ).innerHTML = ""; |
---|
2370 | document.getElementById( "aShowHide" ).innerHTML = "Show advanced options"; |
---|
2371 | } |
---|
2372 | }, |
---|
2373 | |
---|
2374 | //Alerter l'utilisateur si aucune transition n'a été trouvée |
---|
2375 | OnclickVerifTransition : function() |
---|
2376 | { |
---|
2377 | //si l'utilisateur change les valeurs de spectral range et clique directement sur le menu déroulant des transitions |
---|
2378 | //le menu déroulant ne se met pas à jour avant de faire la vérification |
---|
2379 | this.containerFormSpectralRangeLower.blur(); |
---|
2380 | this.containerFormSpectralRangeUpper.blur(); |
---|
2381 | |
---|
2382 | |
---|
2383 | |
---|
2384 | |
---|
2385 | //si il n'y a qu'un élément dans les menu déroulant transition upper et lower et que la valeur est "transition" |
---|
2386 | //cas où la requete utilisateur est correct mais il n'y a pas de transition pour cette molecule t ce domaine spectral |
---|
2387 | 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") |
---|
2388 | { |
---|
2389 | // document.getElementById( "transitionUpper" ).style.display = "none"; |
---|
2390 | // document.getElementById( "transitionLower" ).style.display = "none"; |
---|
2391 | this.selectTransitionUpper.blur(); |
---|
2392 | this.selectTransitionLower.blur(); |
---|
2393 | alert("Change isotopologues selection or spectral range values to obtain transition values"); |
---|
2394 | |
---|
2395 | //document.getElementById( "transitionUpper" ).style.display = ""; |
---|
2396 | //document.getElementById( "transitionLower" ).style.display = ""; |
---|
2397 | } |
---|
2398 | //si il n'y a qu'un élément dans les menu déroulant transition upper et lower et que la valeur est "transition" |
---|
2399 | //cas où la requete est fausse = les valeurs du domaine spectral sont fausses |
---|
2400 | 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") |
---|
2401 | { |
---|
2402 | this.selectTransitionUpper.blur(); |
---|
2403 | this.selectTransitionLower.blur(); |
---|
2404 | //document.getElementById( "transitionUpper" ).style.display = "none"; |
---|
2405 | // document.getElementById( "transitionLower" ).style.display = "none"; |
---|
2406 | alert("Change spectral range values to obtain transition values"); |
---|
2407 | // document.getElementById( "transitionUpper" ).style.display = ""; |
---|
2408 | // document.getElementById( "transitionLower" ).style.display = ""; |
---|
2409 | } |
---|
2410 | |
---|
2411 | |
---|
2412 | }, |
---|
2413 | |
---|
2414 | onBlurInputMeanValue: function() |
---|
2415 | { |
---|
2416 | //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 |
---|
2417 | // !this.selectTraceAxeY1.content('Z') indique que "Z" n'exite pas dans le menu déroulant selectTraceAxeY1 |
---|
2418 | if ($("#meanValue2").val() > 0 && !this.selectTraceAxeY1.content('Z')) |
---|
2419 | // if ($("#meanValue2").val() > 0 && document.getElementById('selectAxeY1').options[document.getElementById('selectAxeY1').selectedIndex].value != "Z") |
---|
2420 | { |
---|
2421 | |
---|
2422 | this.selectTraceAxeY1.add( 'Z', "Number of lines ", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) ); |
---|
2423 | this.selectTraceAxeY2.add( 'Z', "Number of lines ", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) ); |
---|
2424 | //this.selectTraceAxeY1.append($( document.createElement( "option" ) ).attr( {value:"Z", text:"Number of lines"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY1, [this, "Z" ]))); |
---|
2425 | //this.selectTraceAxeY2.append($( document.createElement( "option" ) ).attr( {value:"Z", text:"Number of lines"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY2, [this, "Z" ]))); |
---|
2426 | } |
---|
2427 | //si step = a 0 et autres valeurs (a faire) , retrait de la ligne Z aux parametres Y1 et y2 |
---|
2428 | if ($("#meanValue2").val() == 0) |
---|
2429 | { |
---|
2430 | this.selectTraceAxeY1.remove( 'Z', "Number of lines ", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) ); |
---|
2431 | this.selectTraceAxeY2.remove( 'Z', "Number of lines ", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) ); |
---|
2432 | //Selection par defaut du 1er element (pour que "Number of lines" ne soit plus selectionne par defaut si il n'existe plus) |
---|
2433 | this.selectTraceAxeY1.selectFirst(); |
---|
2434 | this.selectTraceAxeY2.selectFirst(); |
---|
2435 | } |
---|
2436 | }, |
---|
2437 | |
---|
2438 | onClickSelectNbCourbes: function(value) |
---|
2439 | { |
---|
2440 | var context = this[0]; |
---|
2441 | var optionVal = this[1]; |
---|
2442 | |
---|
2443 | //si plusieurs courbes choisis pour les isotopes et ou molecules, les choix pour Y2 sont inactifs |
---|
2444 | if ('cm' == value || 'ci' == value) |
---|
2445 | //if ('cm' == optionVal || 'ci' == optionVal) |
---|
2446 | { |
---|
2447 | //transformer le texte en gris |
---|
2448 | document.getElementById("axeY2Titre").className = "notActiveText"; |
---|
2449 | document.getElementById("scaleY2Titre").className = "notActiveText"; |
---|
2450 | document.getElementById("typePlotY2Titre").className = "notActiveText"; |
---|
2451 | //pour rendre le menu déroulant inactif |
---|
2452 | this.selectTraceAxeY2.disable(); |
---|
2453 | this.selectScaleY2.disable(); |
---|
2454 | this.selectTypeTraceY2.disable(); |
---|
2455 | //document.getElementById("selectAxeY2" ).disabled=true; |
---|
2456 | //document.getElementById("selectScaleY2" ).disabled=true; |
---|
2457 | //document.getElementById("selectTypePlotY2" ).disabled=true; |
---|
2458 | |
---|
2459 | } |
---|
2460 | //si une seule courbe choisie pour les isotopes et ou molecules, les choix pour Y2 sont actifs |
---|
2461 | if ('ca' == value || 'gm' == value || 'gi' == value) |
---|
2462 | //if ('ca' == optionVal || 'gm' == optionVal || 'gi' == optionVal) |
---|
2463 | { |
---|
2464 | //remet le texte en couleur active |
---|
2465 | document.getElementById("axeY2Titre").className = "activeText"; |
---|
2466 | //rendre actif l'echelle que si l'intensite est choisie dans les parametres |
---|
2467 | if (this.selectTraceAxeY2.getValue() == 'B') |
---|
2468 | { |
---|
2469 | document.getElementById("scaleY2Titre").className = "activeText"; |
---|
2470 | } |
---|
2471 | //rendre actif le type de plot si ce n'est pas la valeur none qui est choisie |
---|
2472 | if (this.selectTraceAxeY2.getValue() != 'no') |
---|
2473 | { |
---|
2474 | document.getElementById("typePlotY2Titre").className = "activeText"; |
---|
2475 | } |
---|
2476 | //pour rendre les menu déroulant actifs |
---|
2477 | this.selectTraceAxeY2.enable(); |
---|
2478 | //rendre actif l'echelle que si l'intensite est choisie dans les parametres |
---|
2479 | if (this.selectTraceAxeY2.getValue() == 'B') |
---|
2480 | { |
---|
2481 | this.selectScaleY2.enable(); |
---|
2482 | } |
---|
2483 | //rendre actif le type de plot si ce n'est pas la valeur none qui est choisie |
---|
2484 | if (this.selectTraceAxeY2.getValue() != 'no') |
---|
2485 | { |
---|
2486 | this.selectTypeTraceY2.enable(); |
---|
2487 | } |
---|
2488 | |
---|
2489 | //remet le texte en couleur active |
---|
2490 | // document.getElementById("axeY2Titre").className = "activeText"; |
---|
2491 | //pour rendre les menu déroulant actifs |
---|
2492 | // document.getElementById("selectAxeY2" ).disabled=false; |
---|
2493 | //rendre actif l'echelle que si l'intensite est choisie dans les parametres |
---|
2494 | // if (document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value == 'B') |
---|
2495 | // { |
---|
2496 | // document.getElementById("scaleY2Titre").className = "activeText"; |
---|
2497 | // document.getElementById("selectScaleY2" ).disabled=false; |
---|
2498 | //} |
---|
2499 | //rendre actif le type de plot si ce n'est pas la valeur none qui est choisie |
---|
2500 | // if (document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value != 'no') |
---|
2501 | //{ |
---|
2502 | // document.getElementById("typePlotY2Titre").className = "activeText"; |
---|
2503 | // document.getElementById("selectTypePlotY2" ).disabled=false; |
---|
2504 | //} |
---|
2505 | } |
---|
2506 | |
---|
2507 | |
---|
2508 | }, |
---|
2509 | |
---|
2510 | |
---|
2511 | onClickSelectTraceAxeY1: function(value) |
---|
2512 | { |
---|
2513 | //si intensite n'est pas choisi pour Y1, le type d'échelle est inactif |
---|
2514 | if (this.selectTraceAxeY1.getValue() != 'B') |
---|
2515 | // if ( document.getElementById('selectAxeY1').options[document.getElementById('selectAxeY1').selectedIndex].value != 'B') |
---|
2516 | { |
---|
2517 | //transformer le texte en gris |
---|
2518 | document.getElementById("scaleY1Titre").className = "notActiveText"; |
---|
2519 | //pour rendre le menu déroulant inactif |
---|
2520 | this.selectScaleY1.disable(); |
---|
2521 | // document.getElementById("selectScaleY1" ).disabled=true; |
---|
2522 | } |
---|
2523 | //si intensite est choisi pour Y1, le type d'échelle est actif |
---|
2524 | if (this.selectTraceAxeY1.getValue() == 'B') |
---|
2525 | //if ( document.getElementById('selectAxeY1').options[document.getElementById('selectAxeY1').selectedIndex].value == 'B') |
---|
2526 | { |
---|
2527 | //transformer le texte en gris |
---|
2528 | document.getElementById("scaleY1Titre").className = "activeText"; |
---|
2529 | //pour rendre le menu déroulant inactif |
---|
2530 | this.selectScaleY1.enable(); |
---|
2531 | // document.getElementById("selectScaleY1" ).disabled=false; |
---|
2532 | } |
---|
2533 | }, |
---|
2534 | |
---|
2535 | onClickSelectTraceAxeY2: function(value) |
---|
2536 | { |
---|
2537 | //si intensite n'est pas choisi pour Y2, le type d'échelle est inactif |
---|
2538 | if (this.selectTraceAxeY2.getValue() != 'B') |
---|
2539 | //if ( document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value != 'B') |
---|
2540 | { |
---|
2541 | //transformer le texte en gris |
---|
2542 | document.getElementById("scaleY2Titre").className = "notActiveText"; |
---|
2543 | //pour rendre le menu déroulant inactif |
---|
2544 | this.selectScaleY2.disable(); |
---|
2545 | //document.getElementById("selectScaleY2" ).disabled=true; |
---|
2546 | } |
---|
2547 | //si intensite est choisi pour Y2, le type d'échelle est actif |
---|
2548 | if (this.selectTraceAxeY2.getValue() == 'B') |
---|
2549 | //if ( document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value == 'B') |
---|
2550 | { |
---|
2551 | //transformer le texte en foncé |
---|
2552 | document.getElementById("scaleY2Titre").className = "activeText"; |
---|
2553 | //pour rendre le menu déroulant actif |
---|
2554 | this.selectScaleY2.enable(); |
---|
2555 | //document.getElementById("selectScaleY2" ).disabled=false; |
---|
2556 | } |
---|
2557 | //si aucun parametre est choisi pour Y2, le type de plot est inactif |
---|
2558 | if (this.selectTraceAxeY2.getValue() == 'no') |
---|
2559 | //if ( document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value == 'no') |
---|
2560 | { |
---|
2561 | //transformer le texte en gris |
---|
2562 | document.getElementById("typePlotY2Titre").className = "notActiveText"; |
---|
2563 | //pour rendre le menu déroulant inactif |
---|
2564 | this.selectTypeTraceY2.disable(); |
---|
2565 | // document.getElementById("selectTypePlotY2" ).disabled=true; |
---|
2566 | } |
---|
2567 | //si un parametre est choisi pour Y2, le type de plot est actif |
---|
2568 | if (this.selectTraceAxeY2.getValue() != 'no') |
---|
2569 | // if ( document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value != 'no') |
---|
2570 | { |
---|
2571 | //transformer le texte en foncé |
---|
2572 | document.getElementById("typePlotY2Titre").className = "activeText"; |
---|
2573 | //pour rendre le menu déroulant actif |
---|
2574 | this.selectTypeTraceY2.enable(); |
---|
2575 | //document.getElementById("selectTypePlotY2" ).disabled=false; |
---|
2576 | } |
---|
2577 | |
---|
2578 | }, |
---|
2579 | |
---|
2580 | //bouton reset de toute la page (rechargement de la page) |
---|
2581 | resetPage: function() |
---|
2582 | { |
---|
2583 | //location.reload(); //pas appliquée car supprime la fenêtre graphique |
---|
2584 | |
---|
2585 | //reset du choix de la base de données |
---|
2586 | // selectFirst : affiche le premier élément de la liste |
---|
2587 | //true : active la fonction associée au bouton |
---|
2588 | //this.selectDatabase.selectFirst( true ); |
---|
2589 | |
---|
2590 | //cacher tous les isotopes |
---|
2591 | var divs = document.getElementsByTagName( 'div' ); |
---|
2592 | var count = divs.length; |
---|
2593 | var i = 0; |
---|
2594 | |
---|
2595 | for( i = 0; i < count; i++ ) |
---|
2596 | { |
---|
2597 | //fermer que les div dont l'id contient la chaine Cache |
---|
2598 | if (divs.item(i).id.indexOf("Cache") != -1) { |
---|
2599 | divs.item(i).style.display = "none" ; |
---|
2600 | } |
---|
2601 | } |
---|
2602 | this.showButton.setValue("View all isotopologues"); |
---|
2603 | |
---|
2604 | //déselectionner tous les isotopes |
---|
2605 | var inputs = document.getElementsByTagName( 'input' ); |
---|
2606 | var count = inputs.length; |
---|
2607 | var i=0; |
---|
2608 | |
---|
2609 | for( i = 0; i < count; i++ ) |
---|
2610 | { |
---|
2611 | var input = inputs.item( i ); |
---|
2612 | if( input.type == 'checkbox' ) |
---|
2613 | { |
---|
2614 | input.checked = false; |
---|
2615 | } |
---|
2616 | } |
---|
2617 | this.selectButton.setValue("Select all isotopologues"); |
---|
2618 | |
---|
2619 | //spectral range |
---|
2620 | //remettre les valeurs par défaut en fonction de la base sélectionnée : |
---|
2621 | switch (this.selectDatabase.getValue()) { |
---|
2622 | case 'GEISA2003': |
---|
2623 | $("#rangeLower").val(0); |
---|
2624 | $("#rangeUpper").val(35877.030506); |
---|
2625 | break; |
---|
2626 | case 'GEISA2011': |
---|
2627 | $("#rangeLower").val(0); |
---|
2628 | $("#rangeUpper").val(35877.030506); |
---|
2629 | break; |
---|
2630 | case 'GEISAIASI2003': |
---|
2631 | $("#rangeLower").val(599.000793); |
---|
2632 | $("#rangeUpper").val(3000.998767); |
---|
2633 | break; |
---|
2634 | case 'GEISAIASI2011': |
---|
2635 | $("#rangeLower").val(599.000793); |
---|
2636 | $("#rangeUpper").val(3000.998767); |
---|
2637 | break; |
---|
2638 | } |
---|
2639 | |
---|
2640 | $("#sampStep").val(""); |
---|
2641 | |
---|
2642 | //intensity range |
---|
2643 | $("#intensityLo").val(0); |
---|
2644 | $("#intensityUp").val(1e-16); |
---|
2645 | |
---|
2646 | this.selectNbCourbes.selectFirst( true ); |
---|
2647 | |
---|
2648 | this.selectTraceAxeY1.selectFirst( true ); |
---|
2649 | this.selectScaleY1.selectFirst( true ); |
---|
2650 | this.selectTypeTraceY1.selectFirst( true ); |
---|
2651 | |
---|
2652 | document.getElementById("transition1").length=0; |
---|
2653 | document.getElementById("transition2").length=0; |
---|
2654 | this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"Select a molecule", selected:"selected"} )); |
---|
2655 | this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"Select a molecule", selected:"selected"} )); |
---|
2656 | $("#transitionUpper").removeClass("notActiveText"); |
---|
2657 | $("#transitionLower").removeClass("notActiveText"); |
---|
2658 | |
---|
2659 | |
---|
2660 | $("#meanValue2").val(""); |
---|
2661 | |
---|
2662 | this.selectTraceAxeY2.selectFirst( true ); |
---|
2663 | this.selectScaleY2.selectFirst( true ); |
---|
2664 | this.selectTypeTraceY2.selectFirst( true ); |
---|
2665 | |
---|
2666 | }, |
---|
2667 | |
---|
2668 | onClickSubmit: function() |
---|
2669 | { |
---|
2670 | this.requestGeisa(); |
---|
2671 | }, |
---|
2672 | |
---|
2673 | displayWindow: function(content) |
---|
2674 | { |
---|
2675 | //fermeture de la div de l'image d'attente |
---|
2676 | this.loadingGraphics.hide(); |
---|
2677 | |
---|
2678 | // var content = '<img src=' + this.pathImg + ' /><a href="project?methodName=downloadFile&fileName=' + this.nameImg + '"><button class="dataProtocolDownloadButton">Download</button></a>'; |
---|
2679 | |
---|
2680 | //alert(content); |
---|
2681 | var $dialog = $( '<div></div>' ) |
---|
2682 | |
---|
2683 | .html( content ) |
---|
2684 | |
---|
2685 | .dialog( { |
---|
2686 | autoOpen: false, |
---|
2687 | title: "GEISA : spectroscopic database", |
---|
2688 | //buttons: { "Close": function() { $(this).dialog("close"); }, "Min": function() { $(this).dialog({ height: 20, width:350 }); },"Max": function() { $(this).dialog({ height: 560, width:700 }); } }, |
---|
2689 | buttons:{ |
---|
2690 | "close":{ |
---|
2691 | id:'close', |
---|
2692 | text:'Close', |
---|
2693 | height:'30px', |
---|
2694 | width:'53px', |
---|
2695 | title :'to close the window', |
---|
2696 | click: function() { $(this).dialog("close"); }, |
---|
2697 | }, |
---|
2698 | "min" :{ |
---|
2699 | id:'Min', |
---|
2700 | text:'-', |
---|
2701 | height:'30px', |
---|
2702 | width:'30px', |
---|
2703 | title :'to reduce the window', |
---|
2704 | click: function() { $(this).dialog({ height:18, width:350 }); }, |
---|
2705 | }, |
---|
2706 | "max" :{ |
---|
2707 | id:'Max', |
---|
2708 | text:'+', |
---|
2709 | height:'30px', |
---|
2710 | width:'30px', |
---|
2711 | title :'to enlarge the window ', |
---|
2712 | click: function() { $(this).dialog({ height: 640, width:700 }); }, |
---|
2713 | }, |
---|
2714 | }, |
---|
2715 | |
---|
2716 | //minHeight: 500, |
---|
2717 | // minWidth: 660, |
---|
2718 | height: 640, |
---|
2719 | width:700, |
---|
2720 | //Exemple de valeurs possible pour position : "middle", "top", [200, 100] |
---|
2721 | position: "middle" |
---|
2722 | } ); |
---|
2723 | $dialog.dialog( 'open' ); |
---|
2724 | }, |
---|
2725 | |
---|
2726 | // displayWindow: function(coordinate) |
---|
2727 | //{ |
---|
2728 | //var content = '<img src=' + this.pathImg + ' /><a href="project?methodName=downloadFile&fileName=bib.txt"><button class="dataProtocolDownloadButton">Download</button></a>'; |
---|
2729 | // var content = '<img src=' + this.pathImg + ' /><a href="project?methodName=downloadFile&fileName=' + this.nameImg + '"><button class="dataProtocolDownloadButton">Download</button></a>'; |
---|
2730 | |
---|
2731 | //alert(content); |
---|
2732 | // var $dialog = $( '<div></div>' ) |
---|
2733 | // .html( content + content1 ) |
---|
2734 | |
---|
2735 | // .dialog( { |
---|
2736 | // autoOpen: false, |
---|
2737 | // title: "GEISA : spectroscopic database", |
---|
2738 | // minHeight: 500, |
---|
2739 | // minWidth: 660, |
---|
2740 | |
---|
2741 | //coordonnee y y |
---|
2742 | // position:coordinate |
---|
2743 | |
---|
2744 | // } ); |
---|
2745 | // $dialog.dialog( 'open' ) |
---|
2746 | //}, |
---|
2747 | |
---|
2748 | |
---|
2749 | onClickDownload: function() |
---|
2750 | { |
---|
2751 | document.location.href = "project?methodName=downloadFile&fileName=bib.txt"; |
---|
2752 | } |
---|
2753 | |
---|
2754 | |
---|
2755 | } ); |
---|
2756 | |
---|
2757 | |
---|
2758 | </script> |
---|
2759 | |
---|
2760 | |
---|
2761 | |
---|