Changeset 549 for ether_megapoli


Ignore:
Timestamp:
09/11/12 16:31:02 (12 years ago)
Author:
vmipsl
Message:

simulation _ dates

Location:
ether_megapoli/trunk
Files:
13 edited
1 copied

Legend:

Unmodified
Added
Removed
  • ether_megapoli/trunk/domain/interface/com/ether/simulation/Simulation.java

    r538 r549  
    8585    } 
    8686 
     87    @NotNull 
     88    public String getDates() 
     89    { 
     90        return _dates; 
     91    } 
     92 
     93    public void setDates( @NotNull final String dates ) 
     94    { 
     95        _dates = dates; 
     96    } 
     97 
    8798    private Integer _id; 
    8899 
     
    107118    @XmlElement(name = "variable") 
    108119    private Set<Variable> _variable; 
     120 
     121    @NotNull 
     122    private String _dates; 
    109123} 
  • ether_megapoli/trunk/persistence/implementation/com/ether/dao/simulation/Simulation.hbm.xml

    r538 r549  
    5757        </set> 
    5858 
     59        <property name="dates"> 
     60            <column name="dates"/> 
     61        </property> 
     62 
    5963    </class> 
    6064</hibernate-mapping> 
  • ether_megapoli/trunk/persistence/implementation/com/ether/dao/simulation/SimulationDAOImpl.java

    r547 r549  
    5757            values.add( (String) title[1] ); 
    5858            values.add( version ); 
     59            values.add( (String) title[2] ); 
    5960            i++; 
    6061            modelsList.add( values ); 
     
    9798                        .add( Projections.property( "simulation.id" ) ) 
    9899                        .add( Projections.property( "attribute.value" ) ) 
     100                        .add( Projections.property( "simulation.dates" ) ) 
    99101                ).addOrder( Order.asc( "simulation.id" ) ); 
    100102    } 
  • ether_megapoli/trunk/persistence/sql/create.sql

    r538 r549  
    4545'The default translation of the element' 
    4646/* GO */ 
    47  
    48  
    49 /* ****************************************************************** */ 
    50 /* **************** TABLES DE RELATION DE SIMULATION **************** */ 
    51 /* ****************************************************************** */ 
    52 /* Création des tables via navicat, puis des index et clefs étrangÚres en mode commande, car gros bug via navicat */ 
    53  
    54 /* REL_SIMULATION_DIMENSION */ 
    55 CREATE INDEX "ind_rel_simulation_dimension_simulationkey" ON "public"."rel_simulation_dimension" ("simulation_id"  ); 
    56 CREATE INDEX "ind_rel_simulation_dimension_dimensionkey" ON "public"."rel_simulation_dimension" ("dimension_id"  ); 
    57 ALTER TABLE rel_simulation_dimension ADD FOREIGN KEY(simulation_id) REFERENCES simulation ON DELETE CASCADE; 
    58 ALTER TABLE rel_simulation_dimension ADD FOREIGN KEY(dimension_id) REFERENCES simulation_dimension ON DELETE CASCADE; 
    59  
    60 /* REL_SIMULATION_ATTRIBUTE */ 
    61 CREATE INDEX "ind_rel_simulation_attribute_simulationkey" ON "public"."rel_simulation_attribute" ("simulation_id"  ); 
    62 CREATE INDEX "ind_rel_simulation_attribute_attributekey" ON "public"."rel_simulation_attribute" ("attribute_id"  ); 
    63 ALTER TABLE rel_simulation_attribute ADD FOREIGN KEY(simulation_id) REFERENCES simulation ON DELETE CASCADE; 
    64 ALTER TABLE rel_simulation_attribute ADD FOREIGN KEY(attribute_id) REFERENCES simulation_attribute ON DELETE CASCADE; 
    65  
    66 /* REL_SIMULATION_VARIABLE */ 
    67 CREATE INDEX "ind_rel_simulation_variable_simulationkey" ON "public"."rel_simulation_variable" ("simulation_id"  ); 
    68 CREATE INDEX "ind_rel_simulation_variable_variablekey" ON "public"."rel_simulation_variable" ("variable_id"  ); 
    69 ALTER TABLE rel_simulation_variable ADD FOREIGN KEY(simulation_id) REFERENCES simulation ON DELETE CASCADE; 
    70 ALTER TABLE rel_simulation_variable ADD FOREIGN KEY(variable_id) REFERENCES simulation_variable ON DELETE CASCADE; 
  • ether_megapoli/trunk/persistence/sql/vmipsl_createSimulation.sql

    r423 r549  
    1 CREATE SEQUENCE S_USER 
    2 /* GO */ 
     1-- ---------------------------- 
     2-- Table structure for "simulation" 
     3-- ---------------------------- 
     4DROP TABLE "simulation"; 
     5CREATE TABLE "public"."simulation" ( 
     6"id" int4 DEFAULT NULL NOT NULL, 
     7"location" varchar(1000) DEFAULT NULL, 
     8"xmlnsheader" varchar(1000) DEFAULT NULL, 
     9CONSTRAINT "simulation_pkey" PRIMARY KEY ("id") 
     10) 
     11WITH (OIDS=FALSE); 
     12 
     13ALTER TABLE "public"."simulation" OWNER TO "postgres";; 
     14 
     15-- ---------------------------- 
     16-- Table structure for "simulation_attribute" 
     17-- ---------------------------- 
     18DROP TABLE "simulation_attribute"; 
     19CREATE TABLE "public"."simulation_attribute" ( 
     20"id" int4 DEFAULT NULL NOT NULL, 
     21"name" varchar(100) DEFAULT NULL::character varying, 
     22"value" varchar(1000) DEFAULT NULL::character varying, 
     23CONSTRAINT "simulation_attribute_copy_pkey" PRIMARY KEY ("id") 
     24) 
     25WITH (OIDS=FALSE); 
     26 
     27ALTER TABLE "public"."simulation_attribute" OWNER TO "postgres";; 
     28 
     29-- ---------------------------- 
     30-- Table structure for "simulation_dimension" 
     31-- ---------------------------- 
     32DROP TABLE "simulation_dimension"; 
     33CREATE TABLE "public"."simulation_dimension" ( 
     34"id" int4 DEFAULT NULL NOT NULL, 
     35"name" varchar(100) DEFAULT NULL::character varying NOT NULL, 
     36"length" varchar(40) DEFAULT NULL::character varying NOT NULL, 
     37"isunlimited" bool DEFAULT NULL, 
     38CONSTRAINT "simulation_dimension_copy_pkey" PRIMARY KEY ("id") 
     39) 
     40WITH (OIDS=FALSE); 
     41 
     42ALTER TABLE "public"."simulation_dimension" OWNER TO "postgres";; 
     43 
     44-- ---------------------------- 
     45-- Table structure for "simulation_variable" 
     46-- ---------------------------- 
     47DROP TABLE "simulation_variable"; 
     48CREATE TABLE "public"."simulation_variable" ( 
     49"id" int4 DEFAULT NULL NOT NULL, 
     50"name" varchar(40) DEFAULT NULL::character varying NOT NULL, 
     51"shape" varchar(100) DEFAULT NULL::character varying, 
     52"type" varchar(40) DEFAULT NULL::character varying, 
     53"units" varchar(40) DEFAULT NULL::character varying, 
     54"long_name" varchar(100) DEFAULT NULL::character varying, 
     55CONSTRAINT "simulation_variable_copy_pkey" PRIMARY KEY ("id") 
     56) 
     57WITH (OIDS=FALSE); 
     58 
     59ALTER TABLE "public"."simulation_variable" OWNER TO "postgres";; 
     60 
     61-- ---------------------------- 
     62-- Table structure for "rel_simulation_attribute" 
     63-- ---------------------------- 
     64DROP TABLE "rel_simulation_attribute"; 
     65CREATE TABLE "public"."rel_simulation_attribute" ( 
     66"simulation_id" int4 DEFAULT NULL NOT NULL, 
     67"attribute_id" int4 DEFAULT NULL NOT NULL, 
     68CONSTRAINT "rel_simulation_attribute_pkey" PRIMARY KEY ("simulation_id", "attribute_id"), 
     69CONSTRAINT "rel_simulation_attribute_simulation_id_fkey" FOREIGN KEY ("simulation_id") REFERENCES "public"."simulation" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, 
     70CONSTRAINT "rel_simulation_attribute_attribute_id_fkey" FOREIGN KEY ("attribute_id") REFERENCES "public"."simulation_attribute" ("id") ON DELETE CASCADE ON UPDATE NO ACTION 
     71) 
     72WITH (OIDS=FALSE); 
     73 
     74ALTER TABLE "public"."rel_simulation_attribute" OWNER TO "postgres"; 
     75 
     76CREATE INDEX "ind_rel_simulation_attribute_attributekey" ON "public"."rel_simulation_attribute" USING btree ("attribute_id"); 
     77CREATE INDEX "ind_rel_simulation_attribute_simulationkey" ON "public"."rel_simulation_attribute" USING btree ("simulation_id");; 
    378 
    479 
    5 /*==============================================================*/ 
    6 /* Table : USER                                                 */ 
    7 /*==============================================================*/ 
    8 CREATE TABLE USER  ( 
    9    USER_ID              NUMBER(9,0)                     NOT NULL, 
    10    LASTNAME             NVARCHAR2(100)                  NOT NULL, 
    11    FIRSTNAME            NVARCHAR2(100), 
    12    EMAIL                NVARCHAR2(100)                  NOT NULL, 
    13    PASSWORD             NVARCHAR2(40)                   NOT NULL,   
    14    ROLE                 NVARCHAR2(40), 
    15    CREATION_DATE        TIMESTAMP                       NOT NULL, 
    16    STATE                NVARCHAR2(40)                   NOT NULL,    
    17    HAS_ACCESS_TO_BO     NUMBER(1,0)           DEFAULT 0 NOT NULL 
    18       CONSTRAINT CKC_HAS_ACCESS_TO_BO_USER CHECK (HAS_ACCESS_TO_BO IN (0,1)), 
     80-- ---------------------------- 
     81-- Table structure for "rel_simulation_dimension" 
     82-- ---------------------------- 
     83DROP TABLE "rel_simulation_dimension"; 
     84CREATE TABLE "public"."rel_simulation_dimension" ( 
     85"simulation_id" int4 DEFAULT NULL, 
     86"dimension_id" int4 DEFAULT NULL, 
     87CONSTRAINT "rel_simulation_dimension_simulation_id_fkey" FOREIGN KEY ("simulation_id") REFERENCES "public"."simulation" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, 
     88CONSTRAINT "rel_simulation_dimension_dimension_id_fkey" FOREIGN KEY ("dimension_id") REFERENCES "public"."simulation_dimension" ("id") ON DELETE CASCADE ON UPDATE NO ACTION 
     89) 
     90WITH (OIDS=FALSE); 
    1991 
    20    CONSTRAINT PK_USER PRIMARY KEY (USER_ID) 
    21    CONSTRAINT AK_USER_EMAIL UNIQUE (EMAIL) 
    22 ) 
    23 /* GO */ 
     92ALTER TABLE "public"."rel_simulation_dimension" OWNER TO "postgres"; 
     93 
     94CREATE INDEX "ind_rel_simulation_dimension_dimensionkey" ON "public"."rel_simulation_dimension" USING btree ("dimension_id"); 
     95CREATE INDEX "ind_rel_simulation_dimension_simulationkey" ON "public"."rel_simulation_dimension" USING btree ("simulation_id");; 
    2496 
    2597 
    26 COMMENT ON TABLE USER IS 
    27 'An user represent a people who can download and export data and eventually access to the backoffice.' 
    28 /* GO */ 
     98-- ---------------------------- 
     99-- Table structure for "rel_simulation_variable" 
     100-- ---------------------------- 
     101DROP TABLE "rel_simulation_variable"; 
     102CREATE TABLE "public"."rel_simulation_variable" ( 
     103"simulation_id" int4 DEFAULT NULL NOT NULL, 
     104"variable_id" int4 DEFAULT NULL NOT NULL, 
     105CONSTRAINT "rel_simulation_variable_pkey" PRIMARY KEY ("simulation_id", "variable_id"), 
     106CONSTRAINT "rel_simulation_variable_simulation_id_fkey" FOREIGN KEY ("simulation_id") REFERENCES "public"."simulation" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, 
     107CONSTRAINT "rel_simulation_variable_variable_id_fkey" FOREIGN KEY ("variable_id") REFERENCES "public"."simulation_variable" ("id") ON DELETE CASCADE ON UPDATE NO ACTION 
     108) 
     109WITH (OIDS=FALSE); 
    29110 
     111ALTER TABLE "public"."rel_simulation_variable" OWNER TO "postgres"; 
    30112 
    31 COMMENT ON COLUMN USER.USER_ID IS 'The identifier of the user' 
    32 /* GO */ 
    33  
    34 COMMENT ON COLUMN USER.LASTNAME IS 'The lastname of the user' 
    35 /* GO */ 
    36  
    37 COMMENT ON COLUMN USER.FIRSTNAME IS 'The firstname of the user' 
    38 /* GO */ 
    39  
    40 COMMENT ON COLUMN USER.EMAIL IS 'The email of the user. It must be unique' 
    41 /* GO */ 
    42  
    43 COMMENT ON COLUMN USER.PASSWORD_CODE IS 'The password of the user. Encoded in SHA-1' 
    44 /* GO */ 
    45  
    46 COMMENT ON COLUMN USER.ROLE IS 'The role of the user. Examples : coordinateur, administrateur, ...' 
    47 /* GO */ 
    48  
    49 COMMENT ON COLUMN USER.CREATION_DATE IS 'The creation date of the user. It never changes even the user state will be modified' 
    50 /* GO */ 
    51  
    52 COMMENT ON COLUMN USER.STATE IS 'The state of the user. Examples : waiting, accepted, refused, ...' 
    53 /* GO */ 
    54  
    55 COMMENT ON COLUMN USER.HAS_ACCESS_TO_BO IS 'Indicates if the user has access to the backoffice' 
    56 /* GO */ 
     113CREATE INDEX "ind_rel_simulation_variable_simulationkey" ON "public"."rel_simulation_variable" USING btree ("simulation_id"); 
     114CREATE INDEX "ind_rel_simulation_variable_variablekey" ON "public"."rel_simulation_variable" USING btree ("variable_id");; 
    57115 
    58116 
    59117 
     118/* ****************************************************************** */ 
     119/* **************** TABLES DE RELATION DE SIMULATION **************** */ 
     120/* ****************************************************************** */ 
     121/* Création des tables via navicat, puis index et clefs étrangÚres en mode commande, car gros bug via navicat */ 
    60122 
    61 /*==============================================================*/ 
    62 /* VERSION POSTGRES                                             */ 
    63 /*==============================================================*/ 
    64 CREATE TABLE "public"."USER" ( 
    65 "USER_ID" int4 DEFAULT NULL NOT NULL, 
    66 "LASTNAME" varchar(100) DEFAULT NULL NOT NULL, 
    67 "FIRSTNAME" varchar(100) DEFAULT NULL, 
    68 "EMAIL" varchar(100) DEFAULT NULL NOT NULL, 
    69 "PASSWORD" varchar(40) DEFAULT NULL NOT NULL, 
    70 "ROLE" varchar(40) DEFAULT NULL, 
    71 "CREATION_DATE" timestamp(6) DEFAULT NULL NOT NULL, 
    72 "STATE" varchar(40) DEFAULT NULL NOT NULL, 
    73 "HAS_ACCESS_TO_BO" numeric(1) DEFAULT 0 NOT NULL, 
    74 CONSTRAINT "USER_pkey" PRIMARY KEY ("USER_ID"), 
    75 CONSTRAINT "AK_USER_EMAIL" UNIQUE ("EMAIL") 
    76 ) 
    77 WITH (OIDS=FALSE) 
    78 ; 
     123/* REL_SIMULATION_DIMENSION */ 
     124CREATE INDEX "ind_rel_simulation_dimension_simulationkey" ON "public"."rel_simulation_dimension" ("simulation_id"  ); 
     125CREATE INDEX "ind_rel_simulation_dimension_dimensionkey" ON "public"."rel_simulation_dimension" ("dimension_id"  ); 
     126ALTER TABLE rel_simulation_dimension ADD FOREIGN KEY(simulation_id) REFERENCES simulation ON DELETE CASCADE; 
     127ALTER TABLE rel_simulation_dimension ADD FOREIGN KEY(dimension_id) REFERENCES simulation_dimension ON DELETE CASCADE; 
    79128 
    80 ALTER TABLE "public"."USER" OWNER TO "postgres"; 
     129/* REL_SIMULATION_ATTRIBUTE */ 
     130CREATE INDEX "ind_rel_simulation_attribute_simulationkey" ON "public"."rel_simulation_attribute" ("simulation_id"  ); 
     131CREATE INDEX "ind_rel_simulation_attribute_attributekey" ON "public"."rel_simulation_attribute" ("attribute_id"  ); 
     132ALTER TABLE rel_simulation_attribute ADD FOREIGN KEY(simulation_id) REFERENCES simulation ON DELETE CASCADE; 
     133ALTER TABLE rel_simulation_attribute ADD FOREIGN KEY(attribute_id) REFERENCES simulation_attribute ON DELETE CASCADE; 
    81134 
    82 COMMENT ON TABLE "public"."USER" IS 'An user represent a people who can download and export data and eventually access to the backoffice.'; 
    83  
    84 COMMENT ON COLUMN "public"."USER"."USER_ID" IS 'The identifier of the user'; 
    85  
    86 COMMENT ON COLUMN "public"."USER"."LASTNAME" IS 'The lastname of the user'; 
    87  
    88 COMMENT ON COLUMN "public"."USER"."FIRSTNAME" IS 'The firstname of the user'; 
    89  
    90 COMMENT ON COLUMN "public"."USER"."EMAIL" IS 'The email of the user. It must be unique'; 
    91  
    92 COMMENT ON COLUMN "public"."USER"."PASSWORD" IS 'The password of the user. Encoded in SHA-1'; 
    93  
    94 COMMENT ON COLUMN "public"."USER"."ROLE" IS 'The role of the user. Examples : coordinateur, administrateur, ...'; 
    95  
    96 COMMENT ON COLUMN "public"."USER"."CREATION_DATE" IS 'The creation date of the user. It never changes even the user state will be modified'; 
    97  
    98 COMMENT ON COLUMN "public"."USER"."STATE" IS 'The state of the user. Examples : waiting, accepted, refused, ...'; 
    99  
    100 COMMENT ON COLUMN "public"."USER"."HAS_ACCESS_TO_BO" IS 'Indicates if the user has access to the backoffice'; 
     135/* REL_SIMULATION_VARIABLE */ 
     136CREATE INDEX "ind_rel_simulation_variable_simulationkey" ON "public"."rel_simulation_variable" ("simulation_id"  ); 
     137CREATE INDEX "ind_rel_simulation_variable_variablekey" ON "public"."rel_simulation_variable" ("variable_id"  ); 
     138ALTER TABLE rel_simulation_variable ADD FOREIGN KEY(simulation_id) REFERENCES simulation ON DELETE CASCADE; 
     139ALTER TABLE rel_simulation_variable ADD FOREIGN KEY(variable_id) REFERENCES simulation_variable ON DELETE CASCADE; 
  • ether_megapoli/trunk/service/implementation/com/ether/EtherPlotContentServiceImpl.java

    r547 r549  
    258258        final ResourceBundle bundle = WebHelper.getBundle( locale ); 
    259259 
    260 //        final List<Double> parameterValues = (List<Double>) megapoliPlot.getData().getFirstArray(); 
    261 //        final List<Double> latitudeValues = (List<Double>) megapoliPlot.getData().getSecondArray(); 
    262 //        final List<Double> longitudeValues = (List<Double>) megapoliPlot.getData().getThirdArray(); 
    263 //        final double[] parameterValuesArray = EtherHelper.convertListDoubleToDoubleArray( parameterValues ); 
    264 //        final double[] latitudeValuesArray = EtherHelper.convertListDoubleToDoubleArray( latitudeValues ); 
    265 //        final double[] longitudeValuesArray = EtherHelper.convertListDoubleToDoubleArray( longitudeValues ); 
    266  
    267         final double[] parameterValuesArray = _etherService.extractValuesByModelByVariableFromFile( megapoliPlot.getModelId(), megapoliPlot.getVariableName(), true ); 
    268         final double[] latitudeValuesArray = _etherService.extractValuesByModelByVariableFromFile( megapoliPlot.getModelId(), "lat", true ); 
    269         final double[] longitudeValuesArray = _etherService.extractValuesByModelByVariableFromFile( megapoliPlot.getModelId(), "lon", true ); 
     260        final double[] parameterValuesArray = (double[]) megapoliPlot.getData().getFirstArray(); 
     261        final double[] latitudeValuesArray = (double[]) megapoliPlot.getData().getSecondArray(); 
     262        final double[] longitudeValuesArray = (double[]) megapoliPlot.getData().getThirdArray(); 
    270263 
    271264        // Create the grid 
     
    279272 
    280273        // Create the contour levels and color map 
    281         List<Double> parameterValues = EtherHelper.convertArrayDoubleToListDouble( parameterValuesArray ); 
     274        final List<Double> parameterValues = EtherHelper.convertArrayDoubleToListDouble( parameterValuesArray ); 
    282275        final Double min = Collections.min( parameterValues ); 
    283276        final Double max = Collections.max( parameterValues ); 
  • ether_megapoli/trunk/service/implementation/com/ether/EtherServiceImpl.java

    r547 r549  
    668668        for( final String fileName : simulationsDirectory.list() ) 
    669669        { 
    670             if( fileName.endsWith( ".nc" ) ) 
     670            if( fileName.endsWith( FORMAT_FILE ) ) 
    671671            { 
    672672                // Create directory and move simulation file into 
     
    703703 
    704704    /** 
    705      * This method insert the header in database 
     705     * This method insert the header and the dates (variable "Times") in database 
     706     * The dates are saved in database as a unique String (use to split when we need to have the real values) 
    706707     * The new variables are separatly created in the table .... 
    707708     * The metadata are saved in the table .... 
     
    724725            final Simulation simulation = (Simulation) uMarshaller.unmarshal( new File( fileName ) ); 
    725726 
     727            // Extract dates for the simulation 
     728            final Runtime runtime = Runtime.getRuntime(); 
     729            final String[] argsNcdump = {"/bin/sh", "-c", "ncdump -v Times " + simulationPath + File.separatorChar + directoryName + File.separatorChar + directoryName + FORMAT_FILE + " | sed -e '1,/data:/d' -e '1,/Times/d' -e '$d'"}; 
     730            final Process exec = runtime.exec( argsNcdump ); 
     731 
     732            final BufferedReader bufferedReader = new BufferedReader( new InputStreamReader( exec.getInputStream() ) ); 
     733            final StringBuffer stringBuffer = new StringBuffer(); 
     734            String line; 
     735            while( ( line = bufferedReader.readLine() ) != null ) 
     736                stringBuffer.append( line ); 
     737 
     738            final String dates = stringBuffer.toString().replaceAll( "\"", "" ).replaceAll( " ", "" ).replaceAll( ";", "" ); 
     739            simulation.setDates( dates ); 
     740 
    726741            final Integer simulationId = insertSimulation( simulation ); 
    727742        } 
     
    733748        { 
    734749            throw new ServiceException( ServiceException.ServiceCode.ERROR_JAXB, e ); 
     750        } 
     751        catch( IOException e ) 
     752        { 
     753            throw new ServiceException( ServiceException.ServiceCode.ERROR_PROCESS_SIMULATION_NCDUMP, e ); 
    735754        } 
    736755    } 
     
    11331152 
    11341153    private static String FILE_HEADER_NAME = "header.xml"; 
     1154    private static String FORMAT_FILE = ".nc"; 
    11351155 
    11361156    private PlateformDAO _plateformDAO; 
  • ether_megapoli/trunk/service/implementation/com/ether/SimulationPlot.java

    r547 r549  
    22 
    33import org.jetbrains.annotations.NotNull; 
     4import org.jetbrains.annotations.Nullable; 
    45 
    56/** 
     
    4344    } 
    4445 
     46    @Nullable 
     47    public Data getData() 
     48    { 
     49        return _data; 
     50    } 
     51 
     52    public void setData( @Nullable final Data data ) 
     53    { 
     54        _data = data; 
     55    } 
     56 
    4557    @NotNull 
    4658    private Integer _modelId; 
    47  
    4859    @NotNull 
    4960    private Integer _variableId; 
    5061    @NotNull 
    5162    private String _variableName; 
     63    @Nullable 
     64    private Data _data; 
    5265} 
  • ether_megapoli/trunk/web/src/ApplicationResources.properties

    r545 r549  
    539539simulation.selectVariable=Variables 
    540540simulation.noVariable=Pas de variable 
     541simulation.level=Niveau 
    541542 
    542543################################################################ 
  • ether_megapoli/trunk/web/src/ApplicationResources_en.properties

    r545 r549  
    540540simulation.selectVariable=Variables 
    541541simulation.noVariable=No variable 
    542  
     542simulation.level=Level 
    543543 
    544544################################################################ 
  • ether_megapoli/trunk/web/src/com/ether/ControllerSimulation.java

    r545 r549  
    7878            jsonModel.put( "name", model.get( 1 ) ); 
    7979            jsonModel.put( "version", model.get( 2 ) ); 
     80            jsonModel.put( "dates", model.get( 3 ).split( "," ) ); 
    8081            jsonArray.add( jsonModel ); 
    8182        } 
  • ether_megapoli/trunk/web/src/com/ether/ControllerSimulationPlot.java

    r547 r549  
    9292            megapoliPlot.setBeginDate( formatedDateBegin ); 
    9393            megapoliPlot.setEndDate( formatedDateEnd ); 
    94             // TODO : calculer le nombre de valeurs 
    95             megapoliPlot.setValuesNumber( 10 ); 
     94 
     95            final double[] parameterValuesArray = _etherService.extractValuesByModelByVariableFromFile( megapoliPlot.getModelId(), megapoliPlot.getVariableName(), false ); 
     96            final double[] latitudeValuesArray = _etherService.extractValuesByModelByVariableFromFile( megapoliPlot.getModelId(), "lat", false ); 
     97            final double[] longitudeValuesArray = _etherService.extractValuesByModelByVariableFromFile( megapoliPlot.getModelId(), "lon", false ); 
     98 
     99            final Data valuesLists = new Data( parameterValuesArray, latitudeValuesArray, longitudeValuesArray ); 
     100            megapoliPlot.setData( valuesLists ); 
     101            megapoliPlot.setValuesNumber( parameterValuesArray.length ); 
    96102 
    97103            final BufferedImage bufferedImage = _etherPlotService.createMainPane( megapoliPlot, Context.getLocale( request ) ); 
    98104            ImageIO.write( bufferedImage, "png", response.getOutputStream() ); 
    99105        } 
    100 //        catch( ServiceException se ) 
    101 //        { 
    102 //            try 
    103 //            { 
    104 //                if( !flagException ) 
    105 //                    createErrorPane( response, request, se.getLocalizedMessage(), se ); 
    106 //            } 
    107 //            catch( Exception e2 ) 
    108 //            { 
    109 //                throw new ServletException( "Error : no possibity to write image in response", e2 ); 
    110 //            } 
    111 //        } 
    112106        catch( Exception e1 ) 
    113107        { 
  • ether_megapoli/trunk/web/visualization/visu_simulation-script.jsp

    r547 r549  
    1616        this.containerVariables = $( "#containerVariables" ); 
    1717        this.containerButtons = $( "#containerButtons" ); 
    18         this.containerOptionCalendar = $( "#containerOptionCalendarSimulation" ); 
     18        this.containerOptionDates = $( "#containerOptionDates" ); 
     19//        this.containerOptionCalendar = $( "#containerOptionCalendarSimulation" ); 
    1920 
    2021        /** *********** LOADING *********** **/ 
     
    3637    createOptions: function() 
    3738    { 
     39        this.visualizeButton = new Button( {value:interfaceTexts["simulation.button.visualize"], parent:this.containerButtons, id:"button_visualize", onClick:jQuery.proxy( this.onClickVisualize, this )} ); 
     40        this.visualizeButton.disable(); 
     41    }, 
     42 
     43    createCalendar: function() 
     44    { 
    3845        // Calendar 
    3946        this.calendarFormat = "%Y-%m-%d %H:%i"; 
     
    5461 
    5562        this.clearCalendarButton = new Button( {value:interfaceTexts["simulation.button.clear"], parent:this.containerOptionCalendar, id:"button_clear_calendar_simulation", className:"small", onClick:jQuery.proxy( this.onClickClear, this )} ); 
    56  
    57         this.createButtons(); 
    58     }, 
    59  
    60     createButtons: function() 
    61     { 
    62         this.visualizeButton = new Button( {value:interfaceTexts["simulation.button.visualize"], parent:this.containerButtons, id:"button_visualize", onClick:jQuery.proxy( this.onClickVisualize, this )} ); 
    63         this.visualizeButton.disable(); 
     63    }, 
     64 
     65    createSelectDates: function() 
     66    { 
     67        if( !this.selectedModel ) 
     68            return; 
     69 
     70        this.containerOptionDates.empty(); 
     71 
     72        var paramSelect = new Object(); 
     73        paramSelect.parent = this.containerOptionDates; 
     74        this.selectDates = new Select( paramSelect ); 
     75        jQuery.each( this.selectedModel.jsonElement.dates, jQuery.proxy( function ( i, date ) 
     76        { 
     77            this.selectDates.add( date, date ); 
     78        }, this ) ); 
     79        this.selectDates.selectFirst( false ); 
    6480    }, 
    6581 
     
    125141            this.selectedVariable = false; 
    126142 
     143        this.createSelectDates(); 
    127144        this.requestVariablesByModel(); 
    128145        this.testAllFields(); 
  • ether_megapoli/trunk/web/visualization/visu_simulation.jsp

    r546 r549  
    2020        <ether:htmlJsp jspFile="visu_simulation-script"/> 
    2121        <ether:htmlJs jsFile="classesForJQuery/Loading"/> 
     22        <ether:htmlJs jsFile="classesForJQuery/Select"/> 
    2223        <ether:htmlJs jsFile="calendar/anytime"/> 
    2324        <ether:htmlJs jsFile="jquery-ui-1.8.16.custom/js/jquery-ui-1.8.16.custom.min"/> 
     
    5051 
    5152        <div id="generalContainerOptions" class="span-9 last"> 
    52             <div id="containerOptionCalendarSimulation"> 
    53                 <div id="messages" class="messagesHeight"><bean:message key="visualization.selectPeriod"/></div> 
    54                 <bean:message key="data.access.loc.inter"/>&nbsp;<input type="text" id="beginDate" size="15"/> 
    55                 <bean:message key="data.access.loc.inter2"/>&nbsp;&nbsp;<input type="text" id="endDate" size="15"/> 
    56             </div> 
     53            <div id="messages" class="messagesHeight"><bean:message key="simulation.selectDate"/></div> 
     54            <div id="containerOptionDates"></div> 
     55            <BR/> 
     56 
     57            <div id="messages" class="messagesHeight"><bean:message key="simulation.level"/></div> 
     58            <div id="containerOptionDates"></div> 
     59            <BR/> 
     60 
     61                <%--<div id="containerOptionCalendarSimulation">--%> 
     62                <%--<div id="messages" class="messagesHeight"><bean:message key="visualization.selectPeriod"/></div>--%> 
     63                <%--<bean:message key="data.access.loc.inter"/>&nbsp;<input type="text" id="beginDate" size="15"/>--%> 
     64                <%--<bean:message key="data.access.loc.inter2"/>&nbsp;&nbsp;<input type="text" id="endDate" size="15"/>--%> 
     65                <%--</div>--%> 
    5766 
    5867            <div id="containerOptionTitle"> 
     
    7887            interfaceTexts["simulation.button.clear"] = "<bean:message key="visualization.button.clear"/>"; 
    7988            interfaceTexts["simulation.button.visualize"] = '<bean:message key="visualization.button.visualize"/>'; 
     89            interfaceTexts["simulation.quicklook"] = "<bean:message key="visualization.quicklook"/>"; 
    8090 
    8191            new InterfaceSimulation( ${simulations} ); 
Note: See TracChangeset for help on using the changeset viewer.