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