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