Ignore:
Timestamp:
06/15/12 12:07:46 (12 years ago)
Author:
npipsl
Message:

Interface 15/06/2012

File:
1 edited

Legend:

Unmodified
Added
Removed
  • geisa/web/initGeisa_script.jsp

    r525 r526  
    550550                paramNbCourbes.parent = $("#NbCourbes"); 
    551551                this.SelectNbCourbes = new Select( paramNbCourbes ); 
    552                 this.SelectNbCourbes.add( 'ca', "One curve for all selection", jQuery.proxy(this.onClickSelectNbCourbes, this )); 
     552                this.SelectNbCourbes.add( 'ca', "One curve for all selection", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); 
    553553                this.SelectNbCourbes.add( 'cm', "One curve for each molecule selected", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); 
    554554                this.SelectNbCourbes.add( 'ci', "One curve for each isotopologue selected", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); 
    555                 this.SelectNbCourbes.add( 'gm', "One graphe for each molecule selected", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); 
    556                 this.SelectNbCourbes.add( 'gi', "One graphe for each isotopologue selected", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); 
     555                this.SelectNbCourbes.add( 'gm', "One graph for each molecule selected", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); 
     556                this.SelectNbCourbes.add( 'gi', "One graph for each isotopologue selected", jQuery.proxy(this.onClickSelectNbCourbes, this ) ); 
    557557                this.SelectNbCourbes.selectFirst( false ); 
    558558 
     
    727727                    a.html("<b>"+moleculeElement.name+"</b>"); 
    728728 
    729                     //a.bind( 'click', this, jQuery.proxy( this.visibilite, [this,"Cache-"+ moleculeElement.id+"-"+BddVersion] )); 
    730729                    a.bind( 'click', this, jQuery.proxy( this.visibilite, [this,"Cache-"+ moleculeElement.id] )); 
    731730                    span.append(a); 
     
    733732                    var div= $(document.createElement("div")); 
    734733                    div.addClass("divViolet"); 
    735                     //div.attr({id:"Cache-"+moleculeElement.id+"-"+BddVersion, style: "display:none"}); 
    736                    div.attr({id:"Cache-"+moleculeElement.id, style: "display:none"}); 
     734                    div.attr({id:"Cache-"+moleculeElement.id, style: "display:none"}); 
    737735                    td.append(div); 
    738736 
     
    761759                    inputIsotopes.attr({type:"checkbox", id:"chk-"+moleculeElement+"_"+isotopeElement+"-"+BddVersion, name:"moles", value:moleculeElement+"_"+isotopeElement}); 
    762760                    inputIsotopes.bind( 'click', this, jQuery.proxy( this.cliqueIsotope, [this, moleculeElement+"_"+isotopeElement, BddVersion ] )); 
    763                     //inputIsotopes.bind( 'click', this, jQuery.proxy( this.decliquemol(moleculeElement), [this, moleculeElement.id] )); 
    764761                    container.append(inputIsotopes); 
    765762                    container.append(isotopeElement); 
     
    772769            // <table><tr><td> 
    773770            // <span class="molecule"><input type=checkbox id=all-ch3cn-GEISA-11 onclick="cliquetout('this, ch3cn, GEISA-11');"> 
    774             //          <a href="javascript:visibilite('this, Cache-ch3cn-GEISA-11');"><B>CH<sub>3</sub>CN</a></B> 
     771            //          <a href="javascript:visibilite('this, Cache-ch3cn');"><B>CH<sub>3</sub>CN</a></B> 
    775772            // </span> 
    776             // <div class="divViolet" id="Cache-ch3cn-GEISA-11" style="display:none;"> 
     773            // <div class="divViolet" id="Cache-ch3cn" style="display:none;"> 
    777774            //          <span class="isotope" id="ch3cnIsotopeGEISA-11">&nbsp;&nbsp;&nbsp;<input type=checkbox id=chk-ch3cn_234-GEISA-11 name=moles value=ch3cn_234 onclick="cliqueIsotope('this, ch3cn_234, GEISA-11');">234<br></span> 
    778775            // </div> 
     
    782779            requestGeisa: function() 
    783780            { 
    784                 // alert(this.selectTypeTrace.getValue()); 
    785                 // alert(this.selectTraceAxeY.getValue()); 
    786                 //alert(valSelect); 
     781 
    787782                // var parameters = "check1="+$("#chk-h2o_Bob").attr('checked')+"&check2="+$("#chk-h2o_Bob").val()+"&valselectTypeTrace="+this.selectTypeTrace.getValue()+"&valselectTraceAxeY="+this.selectTraceAxeY.getValue(); 
    788783                var parameters = "&valselectTraceAxeY1="+this.selectTraceAxeY1.getValue()+"&valselectTraceAxeY2="+this.selectTraceAxeY2.getValue()+ 
     
    803798                var molName =""; 
    804799                alert(this.selectDatabase.getValue()); 
    805  
     800                var i=0; 
     801                this.nbIsotopes = 0; 
     802                this.nbMolecules = 0; 
    806803                for( i = 0; i < count; i++ ) 
    807804                { 
    808                     input = inputs.item( i ); 
     805                    var input = inputs.item( i ); 
    809806                    //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") 
    810807                    if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("chk-")!= -1 && input.id.indexOf(this.selectDatabase.getValue())!= -1) 
    811808                    { 
     809                        //nombre d'isotopes sélectionnés 
     810                        this.nbIsotopes =  this.nbIsotopes + 1; 
     811 
    812812                        var molN=input.value; 
    813813                        var molN1=molN.replace("_", ":"); 
    814                         molName = molName+"-moleisotEEE"+molN1+".EEE"; 
     814                        // exemple : -moleisotEEEh2o:161EEE-moleisotEEEh2o:162EEE-moleisotEEEco2:626EEE-moleisotEEEco2:627EEE-moleisotEEEo3:666EEE-moleisotEEEo3:668 
     815                        molName = molName+"-moleisotEEE"+molN1+"EEE"; 
    815816                    } 
    816                 } 
    817  
    818                 //remplacement de "_" par ":" 
    819                 //alert(molN); 
    820  
    821                 //alert(molN1); 
    822                 //var molName = "-moleisotEEEh2o:161,162.EEE-moleisotEEEco2:626,627.EEE-moleisotEEE"+molN1+"."; 
    823                 // alert(molName); 
    824  
    825                 //sélection du type d'échelle pour le parametre Y1 
    826                 if  (this.selectScaleY1.getValue() == '-log_scale' ) 
     817                    //récupération du nombre de molécules sélectionnées 
     818                    if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("all-")!= -1 && input.id.indexOf(this.selectDatabase.getValue())!= -1) 
     819                    { 
     820                        //nombre d'isotopes sélectionnés 
     821                        this.nbMolecules =  this.nbMolecules + 1; 
     822                    } 
     823                } 
     824 
     825 
     826 
     827                //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) 
     828                if  (this.selectScaleY1.getValue() == '-log_scale' && this.selectScaleY1.isDisable == false) 
    827829                { 
    828830                    var logScale = this.selectScaleY1.getValue(); 
     
    833835                } 
    834836 
    835                 //sélection 1 courbe ou 1 courbe par mol/iso 
    836                 if  (this.SelectNbCourbes.getValue() == 'mc' ) 
    837                 { 
    838                     var nbCourbes = "EEE-separate_molEEE-same_graphEEE"; 
     837                //sélection du nombre de courbes ou de graphs 
     838 
     839                var nbCourbes = ""; 
     840                switch (this.SelectNbCourbes.getValue()) { 
     841                    case 'cm': 
     842                        nbCourbes = "EEE-separate_molEEE-same_graphEEE"; 
     843                        this.nbGraph = 1; 
     844                        this.nbCourbe =  this.nbMolecules; 
     845                        if (this.nbCourbe > 8) {alert("Too much molecules selected to draw one curve for each molecule selected");} 
     846                        break; 
     847                    case 'ci': 
     848                        nbCourbes = "EEE-separate_isoEEE-same_graphEEE"; 
     849                        this.nbGraph = 1; 
     850                        this.nbCourbe =  this.nbIsotopes; 
     851                        if (this.nbCourbe > 8) {alert("Too much isotopologues selected to draw one curve for each isotopologues selected");} 
     852                        break; 
     853                    case 'gm': 
     854                        nbCourbes = "EEE-separate_molEEE"; 
     855                        this.nbGraph = this.nbMolecules; 
     856                        if (this.nbGraph > 20) {alert("Too much molecules selected to draw one graph for each molecules selected");} 
     857                        break; 
     858                    case 'gi': 
     859                        nbCourbes = "EEE-separate_isoEEE"; 
     860                        this.nbGraph = this.nbIsotopes; 
     861                        if (this.nbGraph > 20) {alert("Too much isotopologues selected to draw one graph for each isotopologues selected");} 
     862                        break; 
     863                    default: 
     864                        nbCourbes = ""; 
     865                        this.nbGraph = 1; 
     866                        break; 
     867                } 
     868 
     869 
     870                //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) 
     871                if  (this.selectTraceAxeY2.getValue() == 'no' ||  this.selectTraceAxeY2.isDisable == true) 
     872                { 
     873                    var field2 = ""; 
    839874                } 
    840875                else 
    841876                { 
    842                     var nbCourbes = ""; 
    843                 } 
    844  
    845  
    846                 //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 visible) 
    847                 if  (this.selectTraceAxeY2.getValue() == 'no' ||  document.getElementById( "axeY2" ).style.display == "none") 
    848                 { 
    849                     var field2 = ""; 
     877                    var field2 = "-field2EEE"+this.selectTraceAxeY2.getValue(); 
     878                } 
     879 
     880                //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) 
     881                if  (this.selectScaleY2.getValue() == '-log_scale2' && this.selectScaleY2.isDisable == false) 
     882                { 
     883                    var logScale2 =this.selectScaleY2.getValue(); 
    850884                } 
    851885                else 
    852886                { 
    853                     var field2 = "-field2EEE"+this.selectTraceAxeY2.getValue(); 
    854                 } 
    855  
    856                 //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 visible) 
    857                 if  (this.selectScaleY2.getValue() == '-log_scale2' && document.getElementById( "typeScaleY2" ).style.display == "") 
    858                 { 
    859                     var logScale2 =this.selectScaleY2.getValue(); 
     887                    var logScale2 = ""; 
     888                } 
     889 
     890 
     891                //sélection du type de tracé pour Y2  (pas de valeur  si l'option n'est pas activée) 
     892                if  ( this.selectTypeTraceY2.isDisable == true) 
     893                { 
     894                    var lineType = ""; 
    860895                } 
    861896                else 
    862897                { 
    863                     var logScale2 = ""; 
    864                 } 
    865  
    866                 //on ne prend la valeur de mean value que  si l'option est visible 
    867                 if  ( document.getElementById( "meanValue" ).style.display == "") 
    868                 { 
     898                    var lineType = "-line_type2EEE"+this.selectTypeTraceY2.getValue(); 
     899                } 
     900 
     901                //Valeur de mean value (a faire test sur la valeur à ne prendre que si val >=0 sinon afficher message) 
    869902                    var meanValue = "EEE-stepEEE"+$("#meanValue2").val(); 
    870                 } 
    871                 else 
    872                 { 
    873                     var meanValue = "" 
    874                 } 
     903 
    875904 
    876905 
     
    880909 
    881910 
    882                 var parameters2 = "&fortranRequest=-fieldEEE"+this.selectTraceAxeY1.getValue()+"EEE"+logScale+"EEE"+field2+"EEE"+logScale2+"EEE"+"EEE-wavenb_minEEE"+$("#RangeLower").val()+ 
    883                         "EEE-wavenb_maxEEE"+$("#RangeUpper").val()+"EEE-int_minEEE"+$("#intensityLo").val()+"EEE-int_maxEEE"+$("#intensityUp").val()+"EEE-line_typeEEE"+this.selectTypeTraceY1.getValue()+"EEE"+molName+meanValue+nbCourbes; 
    884  
     911                //var parameters2 = "&fortranRequest=-fieldEEE"+this.selectTraceAxeY1.getValue()+"EEE"+logScale+"EEE"+field2+"EEE"+logScale2+"EEE"+"EEE-wavenb_minEEE"+$("#RangeLower").val()+ 
     912                      //  "EEE-wavenb_maxEEE"+$("#RangeUpper").val()+"EEE-int_minEEE"+$("#intensityLo").val()+"EEE-int_maxEEE"+$("#intensityUp").val()+"EEE-line_typeEEE"+this.selectTypeTraceY1.getValue()+"EEE"+molName+meanValue+nbCourbes; 
     913 
     914                var parameters2 = "&fortranRequest="+molName+"EEE-wavenb_minEEE"+$("#RangeLower").val()+"EEE-wavenb_maxEEE"+$("#RangeUpper").val()+"EEE-int_minEEE"+$("#intensityLo").val()+"EEE-int_maxEEE"+$("#intensityUp").val()+ 
     915                                   meanValue+nbCourbes+"EEE-fieldEEE"+this.selectTraceAxeY1.getValue()+"EEE"+logScale+"EEE-line_typeEEE"+this.selectTypeTraceY1.getValue()+"EEE"+field2+"EEE"+logScale2+"EEE"+lineType; 
    885916 
    886917                alert(parameters2); 
     
    893924 
    894925 // HANDLES ******************************************************** = retours ajax 
     926 
     927 
    895928            handleGeisa: function( result ) 
    896929            { 
    897930                // var bob = jQuery.parseJSON( result ).resultAjax; 
    898                 //chemin de l'image avec le nom 
     931                //chemin de l'image 
    899932                this.pathImg = jQuery.parseJSON( result ).pathImg; 
    900                 alert(this.pathImg); 
     933                //alert("this.pathImg="+this.pathImg); 
     934                //numéro unique pour le nom du graph 
     935                this.nb = jQuery.parseJSON( result ).nb; 
     936                alert("this.nb="+this.nb); 
    901937                //nom de l'image 
    902                 this.nameImg = jQuery.parseJSON( result ).nameImg; 
    903                 alert(this.nameImg); 
    904  
    905                 //to do 
     938                //this.nameImg = jQuery.parseJSON( result ).nameImg; 
     939 
     940 
     941 
     942                var coordinate = [200, 100]; 
     943 
     944                //Pour tracer le bon nombre de graphe et de bouton download 
     945                var i=1; 
     946                var content = ''; 
     947                    for (i=1; i<this.nbGraph+1; i++) { 
     948                        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>'; 
     949                    } 
     950 
     951 
     952               //to do 
    906953                if( !this.pathImg ) 
    907954                    setTimeout( jQuery.proxy( this.displayWindow, this ), 1000 ); 
    908955                else 
    909                     this.displayWindow(); 
     956                    this.displayWindow(coordinate,content); 
     957 
    910958            }, 
    911959 
     
    9611009                for( i = 0; i < count; i++ ) 
    9621010                { 
    963                     input = inputs.item( i ); 
     1011                   var input = inputs.item( i ); 
    9641012                    //cliquer toutes les molécules et isotopes du meme nom dans toutes les bases 
    9651013                    //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') 
     
    10391087            onBlurInputMeanValue: function() 
    10401088            { 
    1041  
    10421089                //si step est sup a 0,   ajout d'une ligne Z aux parametres Y1 et y2 
    10431090                if  ($("#meanValue2").val() > 0) 
    10441091                { 
    1045                     this.selectTraceAxeY1.add( 'Z', "Number of lines " ); 
    1046                     this.selectTraceAxeY2.add( 'Z', "Number of lines " ); 
     1092                    this.selectTraceAxeY1.add( 'Z', "Number of lines ", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) ); 
     1093                    this.selectTraceAxeY2.add( 'Z', "Number of lines ", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) ); 
    10471094                } 
    10481095                //si step = a 0     et autres valeurs (a faire) , retrait de la ligne Z aux parametres Y1 et y2 
     
    10501097                { 
    10511098                    //alert($("#meanValue2").val()); 
    1052                     this.selectTraceAxeY1.remove( 'Z', "Number of lines " ); 
    1053                     this.selectTraceAxeY2.remove( 'Z', "Number of lines " ); 
     1099                    this.selectTraceAxeY1.remove( 'Z', "Number of lines ", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) ); 
     1100                    this.selectTraceAxeY2.remove( 'Z', "Number of lines ", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) ); 
    10541101                } 
    10551102            }, 
     
    10691116                    this.selectScaleY2.disable(); 
    10701117                    this.selectTypeTraceY2.disable(); 
    1071  
    10721118                } 
    10731119                //si une seule courbe choisie pour les isotopes et ou molecules, les choix pour Y2 sont actifs 
     
    11571203                } 
    11581204 
    1159  
    11601205            }, 
    11611206 
     
    11651210            }, 
    11661211 
    1167             displayWindow: function() 
    1168             { 
    1169                 //var content = '<img src=' + this.pathImg + ' /><a href="project?methodName=downloadFile&fileName=bib.txt"><button class="dataProtocolDownloadButton">Download</button></a>'; 
    1170                 var content = '<img src=' + this.pathImg + ' /><a href="project?methodName=downloadFile&fileName='  + this.nameImg + '"><button class="dataProtocolDownloadButton">Download</button></a>'; 
     1212            displayWindow: function(coordinate, content) 
     1213            { 
     1214                // var content = '<img src=' + this.pathImg + ' /><a href="project?methodName=downloadFile&fileName='  + this.nameImg + '"><button class="dataProtocolDownloadButton">Download</button></a>'; 
     1215 
    11711216                //alert(content); 
    11721217                var $dialog = $( '<div></div>' ) 
     1218 
    11731219                        .html( content ) 
     1220 
    11741221                        .dialog( { 
    11751222                            autoOpen: false, 
    11761223                            title: "GEISA : spectroscopic database", 
    1177                             minHeight: 500, 
    1178                             minWidth: 660 
     1224                            //minHeight: 500, 
     1225                            // minWidth: 660, 
     1226                            height: 560, 
     1227                            width:700, 
     1228                            //Exemple de  valeurs possible pour position : "middle", "top",  [200, 100] 
     1229                            position: "middle" 
     1230 
    11791231                        } ); 
    11801232                $dialog.dialog( 'open' ) 
    11811233            }, 
    11821234 
     1235            // displayWindow: function(coordinate) 
     1236            //{ 
     1237                //var content = '<img src=' + this.pathImg + ' /><a href="project?methodName=downloadFile&fileName=bib.txt"><button class="dataProtocolDownloadButton">Download</button></a>'; 
     1238               // var content = '<img src=' + this.pathImg + ' /><a href="project?methodName=downloadFile&fileName='  + this.nameImg + '"><button class="dataProtocolDownloadButton">Download</button></a>'; 
     1239 
     1240                //alert(content); 
     1241               // var $dialog = $( '<div></div>' ) 
     1242                       // .html( content + content1 ) 
     1243 
     1244                       // .dialog( { 
     1245                        //    autoOpen: false, 
     1246                        //    title: "GEISA : spectroscopic database", 
     1247                        //    minHeight: 500, 
     1248                        //    minWidth: 660, 
     1249 
     1250                            //coordonnee y y 
     1251                         //   position:coordinate 
     1252 
     1253                       // } ); 
     1254               // $dialog.dialog( 'open' ) 
     1255            //}, 
     1256 
     1257 
    11831258              onClickDownload: function() 
    11841259            { 
Note: See TracChangeset for help on using the changeset viewer.