Changeset 185 for ether_megapoli
- Timestamp:
- 09/07/11 22:42:44 (13 years ago)
- Location:
- ether_megapoli/trunk
- Files:
-
- 1 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
ether_megapoli/trunk/applets/src/com/ether/AppletPlot.java
r184 r185 84 84 // add( jPaneTop, BorderLayout.NORTH ); 85 85 86 final Integer valuesNumber = megapoliPlot.getValuesNumber(); 86 // final Integer valuesNumber = megapoliPlot.getValuesNumber(); 87 final Integer valuesNumber = 10; 87 88 88 89 // Bottom Pane … … 378 379 megapoliPlot.setTimeSerie( true ); 379 380 megapoliPlot.setLegendToHide( true ); 380 megapoliPlot.setValuesNumber( ( (double[]) valuesLists.getFirstArray() ).length );381 // megapoliPlot.setValuesNumber( ( (double[]) valuesLists.getFirstArray() ).length ); 381 382 } 382 383 else … … 399 400 megapoliPlot.setTimeSerie( false ); 400 401 megapoliPlot.setLegendToHide( false ); 401 megapoliPlot.setValuesNumber( ( (double[]) valuesLists.getFirstArray() ).length );402 // megapoliPlot.setValuesNumber( ( (double[]) valuesLists.getFirstArray() ).length ); 402 403 } 403 404 return megapoliPlot; -
ether_megapoli/trunk/applets/src/com/ether/AppletTimeSerie.java
r184 r185 71 71 add( jPaneTop, BorderLayout.NORTH ); 72 72 73 final Integer valuesNumber = megapoliPlot.getValuesNumber(); 73 // final Integer valuesNumber = megapoliPlot.getValuesNumber(); 74 final Integer valuesNumber = 10; 74 75 75 76 // Bottom Pane … … 158 159 megapoliPlot.setTimeSerie( true ); 159 160 megapoliPlot.setLegendToHide( true ); 160 megapoliPlot.setValuesNumber( ( (double[]) valuesLists.getFirstArray() ).length );161 // megapoliPlot.setValuesNumber( ( (double[]) valuesLists.getFirstArray() ).length ); 161 162 } 162 163 else … … 179 180 megapoliPlot.setTimeSerie( false ); 180 181 megapoliPlot.setLegendToHide( false ); 181 megapoliPlot.setValuesNumber( ( (double[]) valuesLists.getFirstArray() ).length );182 // megapoliPlot.setValuesNumber( ( (double[]) valuesLists.getFirstArray() ).length ); 182 183 } 183 184 return megapoliPlot; -
ether_megapoli/trunk/persistence/implementation/com/ether/dao/ValueDAOImpl.java
r171 r185 46 46 criteria.addOrder( Order.asc( "measure.mesureDate" ) ); 47 47 48 //final List<Object[]> objects = selectAllByCriteria( Object[].class, criteria );48 final List<Object[]> objects = selectAllByCriteria( Object[].class, criteria ); 49 49 // TODO : remove maxResults to 10 50 final List<Object[]> objects = selectPage( null, 10, criteria );50 // final List<Object[]> objects = selectPage( null, 10, criteria ); 51 51 52 52 final double[] values = new double[objects.size()]; … … 106 106 return new Data( parameterValues, latitudeValues, longitudeValues ); 107 107 } 108 109 @NotNull 110 public Integer getNumberValuesByPlateformByParameterByPeriod( @NotNull final Integer plateformId, @NotNull final Integer parameterId, @Nullable final Date beginDate, @Nullable final Date endDate ) 111 throws PersistenceException 112 { 113 final DetachedCriteria criteria = DetachedCriteria.forClass( Valeur.class, "value" ) 114 .add( Restrictions.eq( "value.parametre.id", parameterId ) ) 115 .createCriteria( "mesure", "measure" ) 116 .add( Restrictions.eq( "measure.plateforme.id", plateformId ) ); 117 118 if( null != beginDate ) 119 criteria.add( Restrictions.ge( "measure.mesureDate", beginDate ) ); 120 if( null != endDate ) 121 criteria.add( Restrictions.le( "measure.mesureDate", endDate ) ); 122 123 criteria.setProjection( Projections.property( "value.valeurVal" ) ); 124 125 return count( criteria ); 126 } 127 128 // @NotNull 129 // public Integer getNumberValuesByPlateformByParameterByPeriod( @NotNull final List<Pair> pairs, @Nullable final Date beginDate, @Nullable final Date endDate ) 130 // throws PersistenceException 131 // { 132 // final DetachedCriteria criteria = DetachedCriteria.forClass( Valeur.class, "value" ) 133 // .add( Restrictions.eq( "value.parametre.id", parameterId ) ) 134 // .createCriteria( "mesure", "measure" ) 135 // .add( Restrictions.eq( "measure.plateforme.id", plateformId ) ); 136 // 137 // if( null != beginDate ) 138 // criteria.add( Restrictions.ge( "measure.mesureDate", beginDate ) ); 139 // if( null != endDate ) 140 // criteria.add( Restrictions.le( "measure.mesureDate", endDate ) ); 141 // 142 // criteria.setProjection( Projections.property( "value.valeurVal" ) ); 143 // 144 // return count( criteria ); 145 // } 146 108 147 } -
ether_megapoli/trunk/persistence/implementation/hibernate-domain.cfg.xml
r174 r185 7 7 <session-factory> 8 8 9 < !--<mapping resource="com/medias/objects/Adresse.hbm.xml"/>-->10 < !--<mapping resource="com/medias/objects/Bilan.hbm.xml"/>-->11 < !--<mapping resource="com/medias/objects/Capteur.hbm.xml"/>-->12 < !--<mapping resource="com/medias/objects/Categorie.hbm.xml"/>-->13 < !--<mapping resource="com/medias/objects/CategorieParam.hbm.xml"/>-->14 < !--<mapping resource="com/medias/objects/Commentaire.hbm.xml"/>-->15 < !--<mapping resource="com/medias/objects/DeltaMesure.hbm.xml"/>-->16 < !--<mapping resource="com/medias/objects/Fabriquant.hbm.xml"/>-->17 < !--<mapping resource="com/medias/objects/Fichier.hbm.xml"/>-->18 < !--<mapping resource="com/medias/objects/Flag.hbm.xml"/>-->19 < !--<mapping resource="com/medias/objects/Jeu.hbm.xml"/>-->20 < !--<mapping resource="com/medias/objects/Langue.hbm.xml"/>-->21 < !--<mapping resource="com/medias/objects/Localisation.hbm.xml"/>-->22 < !--<mapping resource="com/medias/objects/Mesure.hbm.xml"/>-->23 < !--<mapping resource="com/medias/objects/Organisme.hbm.xml"/>-->24 < !--<mapping resource="com/medias/objects/Parametre.hbm.xml"/>-->25 < !--<mapping resource="com/medias/objects/Personne.hbm.xml"/>-->26 < !--<mapping resource="com/medias/objects/Plateforme.hbm.xml"/>-->27 < !--<mapping resource="com/medias/objects/RequeteNbvalsJeu.hbm.xml"/>-->28 < !--<mapping resource="com/medias/objects/RequetePlatLoc.hbm.xml"/>-->29 < !--<mapping resource="com/medias/objects/Sequence.hbm.xml"/>-->30 < !--<mapping resource="com/medias/objects/TypeCapteur.hbm.xml"/>-->31 < !--<mapping resource="com/medias/objects/TypePlateforme.hbm.xml"/>-->32 < !--<mapping resource="com/medias/objects/Unite.hbm.xml"/>-->33 < !--<mapping resource="com/medias/objects/Valeur.hbm.xml"/>-->34 < !--<mapping resource="com/medias/objects/Zone.hbm.xml"/>-->9 <mapping resource="com/medias/objects/Adresse.hbm.xml"/> 10 <mapping resource="com/medias/objects/Bilan.hbm.xml"/> 11 <mapping resource="com/medias/objects/Capteur.hbm.xml"/> 12 <mapping resource="com/medias/objects/Categorie.hbm.xml"/> 13 <mapping resource="com/medias/objects/CategorieParam.hbm.xml"/> 14 <mapping resource="com/medias/objects/Commentaire.hbm.xml"/> 15 <mapping resource="com/medias/objects/DeltaMesure.hbm.xml"/> 16 <mapping resource="com/medias/objects/Fabriquant.hbm.xml"/> 17 <mapping resource="com/medias/objects/Fichier.hbm.xml"/> 18 <mapping resource="com/medias/objects/Flag.hbm.xml"/> 19 <mapping resource="com/medias/objects/Jeu.hbm.xml"/> 20 <mapping resource="com/medias/objects/Langue.hbm.xml"/> 21 <mapping resource="com/medias/objects/Localisation.hbm.xml"/> 22 <mapping resource="com/medias/objects/Mesure.hbm.xml"/> 23 <mapping resource="com/medias/objects/Organisme.hbm.xml"/> 24 <mapping resource="com/medias/objects/Parametre.hbm.xml"/> 25 <mapping resource="com/medias/objects/Personne.hbm.xml"/> 26 <mapping resource="com/medias/objects/Plateforme.hbm.xml"/> 27 <mapping resource="com/medias/objects/RequeteNbvalsJeu.hbm.xml"/> 28 <mapping resource="com/medias/objects/RequetePlatLoc.hbm.xml"/> 29 <mapping resource="com/medias/objects/Sequence.hbm.xml"/> 30 <mapping resource="com/medias/objects/TypeCapteur.hbm.xml"/> 31 <mapping resource="com/medias/objects/TypePlateforme.hbm.xml"/> 32 <mapping resource="com/medias/objects/Unite.hbm.xml"/> 33 <mapping resource="com/medias/objects/Valeur.hbm.xml"/> 34 <mapping resource="com/medias/objects/Zone.hbm.xml"/> 35 35 36 36 </session-factory> -
ether_megapoli/trunk/persistence/interface/com/ether/dao/ValueDAO.java
r171 r185 9 9 10 10 import java.util.Date; 11 import java.util.List; 11 12 12 13 /** … … 24 25 <T1, T2, T3> Data<T1[], T2[], T3[]> getListsByPlateformByParameterByPeriodFor2D( @NotNull final Integer plateformId, @NotNull final Integer parameterId, @Nullable final Date dateBegin, @Nullable final Date dateEnd ) 25 26 throws PersistenceException; 27 28 @NotNull 29 Integer getNumberValuesByPlateformByParameterByPeriod( @NotNull final Integer plateformId, @NotNull final Integer parameterId, @Nullable final Date beginDate, @Nullable final Date endDate ) 30 throws PersistenceException; 31 32 // @NotNull 33 // Integer getNumberValuesByPlateformByParameterByPeriod( @NotNull final List<Pair> pairs, @Nullable final Date beginDate, @Nullable final Date endDate ) 34 // throws PersistenceException; 26 35 } -
ether_megapoli/trunk/service/implementation/com/ether/EtherPlotContentServiceImpl.java
r184 r185 2 2 3 3 import com.medias.database.objects.Parametre; 4 import com.medias.database.objects. Unite;4 import com.medias.database.objects.Plateforme; 5 5 import gov.noaa.pmel.sgt.Axis; 6 6 import gov.noaa.pmel.sgt.CartesianGraph; … … 41 41 import java.awt.*; 42 42 import java.util.ArrayList; 43 import java.util.Calendar;44 43 import java.util.Date; 45 44 import java.util.List; 46 45 import java.util.Locale; 46 import java.util.Random; 47 47 import java.util.ResourceBundle; 48 48 … … 63 63 mainPane.setLayout( new StackedLayout() ); 64 64 65 final List<Pair> pIdPIdList = megapoliPlot.getpIdPIdList();66 67 /** *********** LINES ************ **/68 final List<SimpleLine> lines = createLines( pIdPIdList, megapoliPlot.getBeginDate(), megapoliPlot.getEndDate() );69 final SimpleLine firstLine = lines.get( 0 );70 71 /** *************** AXIS ************** **/72 final SoTRange xnRange = firstLine.getXRange();73 final SoTRange yRange = firstLine.getYRange();74 for( final SimpleLine line : lines )75 yRange.add( line.getYRange() );76 77 // TODO : automatiser le nb d'intervalles en fonction des valeurs de y78 final Integer intervalsNumber = 10;79 final SoTRange ynRange = Graph.computeRange( yRange, intervalsNumber );80 81 // Origin point82 final SoTPoint originPoint = new SoTPoint( ynRange.getStart(), xnRange.getStart() );83 final SoTPoint endPoint = new SoTPoint( ynRange.getStart(), xnRange.getEnd() );84 85 // Create the time axis, set its range in user units and its origin.86 final TimeAxis xbot = new TimeAxis( "X-Axis", TimeAxis.AUTO );87 xbot.setRangeU( xnRange );88 xbot.setLocationU( originPoint );89 xbot.setLabelFont( _axisFont );90 // xbot.setMinorLabelInterval( 1 );91 92 // Create the vertical axis, set its range in user units and its origin. Create the axis title.93 final PlainAxis yleft = new PlainAxis( "Y-Axis" );94 yleft.setRangeU( ynRange );95 yleft.setLocationU( originPoint );96 yleft.setLabelFont( _axisFont );97 final SGLabel ytitle = new SGLabel( "Y-Axis Title", firstLine.getYMetaData().getName(), new Point2D.Double( 0.0, 0.0 ) );98 ytitle.setFont( _axisFont );99 ytitle.setHeightP( _heightAxisFont );100 yleft.setTitle( ytitle );101 102 final PlainAxis yleft2 = new PlainAxis( "YY-Axis" );103 yleft2.setRangeU( ynRange );104 yleft2.setLocationU( endPoint );105 yleft2.setLabelFont( _axisFont );106 yleft2.setLabelPosition( Axis.POSITIVE_SIDE );107 final SGLabel ytitle2 = new SGLabel( "Y-Axis Title", "zzzz", new Point2D.Double( 0.0, 0.0 ) );108 ytitle2.setFont( _axisFont );109 ytitle2.setHeightP( _heightAxisFont );110 yleft2.setTitle( ytitle2 );111 112 /** ********************************** **/113 /** *********** FIRST LAYER ********** **/114 /** ********************************** **/115 65 // TODO : revoir les tailles ! mettre en automatique par rapport à plotWidth et plotHeight 116 66 /* … … 131 81 mainPane.add( layer ); 132 82 83 final Pair<List, List> listPairOfPIdPIdForTwoAxes = extractListPairForAxes( megapoliPlot.getpIdPIdList() ); 84 final List<Pair> pIdPIdListForFirstAxis = listPairOfPIdPIdForTwoAxes.getFirstValue(); 85 final List<Pair> pIdPIdListForSecondAxis = listPairOfPIdPIdForTwoAxes.getSecondValue(); 86 87 88 /** *********** FIRST Y-AXIS ************ **/ 89 final List<SimpleLine> linesForFirstAxis = createLines( pIdPIdListForFirstAxis, megapoliPlot.getBeginDate(), megapoliPlot.getEndDate() ); 90 final SimpleLine firstLineForFirstAxis = linesForFirstAxis.get( 0 ); 91 92 final SoTRange xnRange = firstLineForFirstAxis.getXRange(); 93 final SoTRange yRangeForFirstAxis = firstLineForFirstAxis.getYRange(); 94 for( final SimpleLine line : linesForFirstAxis ) 95 yRangeForFirstAxis.add( line.getYRange() ); 96 97 // TODO : automatiser le nb d'intervalles en fonction des valeurs de y 98 final Integer intervalsNumber = 10; 99 final SoTRange ynRangeForFirstAxis = Graph.computeRange( yRangeForFirstAxis, intervalsNumber ); 100 101 // Origin point 102 final SoTPoint originPointForFirstAxis = new SoTPoint( ynRangeForFirstAxis.getStart(), xnRange.getStart() ); 103 104 // Create the time axis, set its range in user units and its origin. 105 // Time axis is the same for the two y-axis 106 final TimeAxis xbot = new TimeAxis( "X-Axis", TimeAxis.AUTO ); 107 xbot.setRangeU( xnRange ); 108 xbot.setLocationU( originPointForFirstAxis ); 109 xbot.setLabelFont( _axisFont ); 110 // xbot.setMinorLabelInterval( 1 ); 111 112 // Create the vertical axis, set its range in user units and its origin. Create the axis title. 113 final PlainAxis yleftForFirstAxis = new PlainAxis( "Y-Axis" ); 114 yleftForFirstAxis.setRangeU( ynRangeForFirstAxis ); 115 yleftForFirstAxis.setLocationU( originPointForFirstAxis ); 116 yleftForFirstAxis.setLabelFont( _axisFont ); 117 final String yLabelForFirstAxis = firstLineForFirstAxis.getYMetaData().getName() + " (" + firstLineForFirstAxis.getYMetaData().getUnits() + ")"; 118 final SGLabel ytitleForFirstAxis = new SGLabel( "Y-Axis Title", yLabelForFirstAxis, new Point2D.Double( 0.0, 0.0 ) ); 119 ytitleForFirstAxis.setFont( _axisFont ); 120 ytitleForFirstAxis.setHeightP( _heightAxisFont ); 121 yleftForFirstAxis.setTitle( ytitleForFirstAxis ); 122 133 123 /** ************ GRAPH ********** **/ 134 124 // Create first CartesianGraph and transforms 135 125 final CartesianGraph graph = new CartesianGraph( "First Graph" ); 136 final LinearTransform xt = new LinearTransform( new Range2D( xstart, xend ), xnRange );137 graph.setXTransform( xt );138 final LinearTransform yt = new LinearTransform( new Range2D( ystart, yend ), ynRange);139 graph.setYTransform( yt );126 final LinearTransform xtForFirstAxis = new LinearTransform( new Range2D( xstart, xend ), xnRange ); 127 graph.setXTransform( xtForFirstAxis ); 128 final LinearTransform ytForFirstAxis = new LinearTransform( new Range2D( ystart, yend ), ynRangeForFirstAxis ); 129 graph.setYTransform( ytForFirstAxis ); 140 130 141 131 graph.addXAxis( xbot ); 142 graph.addYAxis( yleft ); 143 graph.addYAxis( yleft2 ); 144 145 146 /** *********** LINE ********* **/ 147 final LineAttribute attr; 148 final int lineAttributeStyle; 149 if( megapoliPlot.getAxeType().equals( AxeTypeForFixedPlateform.TIME_POINTS.toString() ) ) 150 lineAttributeStyle = LineAttribute.MARK; 151 else 152 lineAttributeStyle = LineAttribute.SOLID; 153 attr = new LineAttribute( lineAttributeStyle, 1, Color.red ); 154 attr.setMarkHeightP( _markHeight ); 155 156 graph.setData( firstLine, attr ); 157 layer.setGraph( graph ); 132 graph.addYAxis( yleftForFirstAxis ); 133 134 final LineAttribute attrForFirstAxis = createRandomLineAttrbute( megapoliPlot.getAxeType() ); 135 graph.setData( firstLineForFirstAxis, attrForFirstAxis ); 158 136 159 137 /** *********** LEGEND ********* **/ … … 162 140 { 163 141 lkey.setId( "Legend" ); 164 lkey.setLocationP( new Point2D.Double( xsize - 1, ysize - 1 ) ); 165 lkey.setVAlign( LineKey.TOP ); 166 lkey.setHAlign( LineKey.RIGHT ); 142 lkey.setLocationP( new Point2D.Double( 0.1, ysize - 0.1 ) ); 143 lkey.setBorderStyle( LineKey.NO_BORDER ); 167 144 layer.addChild( lkey ); 168 lkey.addLineGraph( (LineCartesianRenderer) graph.getRenderer(), new SGLabel( "First line", "Red Data", new Point2D.Double( 0.0, 0.0 )) );145 lkey.addLineGraph( (LineCartesianRenderer) graph.getRenderer(), firstLineForFirstAxis.getKeyTitle() ); 169 146 } 170 147 … … 172 149 /** *********** OTHER LAYERS ********* **/ 173 150 /** ********************************** **/ 174 for( final SimpleLine line : lines .subList( 1, lines.size() ) )151 for( final SimpleLine line : linesForFirstAxis.subList( 1, linesForFirstAxis.size() ) ) 175 152 { 176 153 final Layer otherLayer = new Layer( "Other Layer", new Dimension2D( xsize, ysize ) ); 177 154 mainPane.add( otherLayer ); 178 final CartesianGraph otherGraph = new CartesianGraph( "Second Graph", xt , yt);155 final CartesianGraph otherGraph = new CartesianGraph( "Second Graph", xtForFirstAxis, ytForFirstAxis ); 179 156 otherLayer.setGraph( otherGraph ); 180 157 181 final LineAttribute otherLineAttribute = new LineAttribute( lineAttributeStyle, 2, Color.blue ); 182 otherLineAttribute.setMarkHeightP( _markHeight ); 158 final LineAttribute otherLineAttribute = createRandomLineAttrbute( megapoliPlot.getAxeType() ); 183 159 otherGraph.setData( line, otherLineAttribute ); 184 lkey.addLineGraph( (LineCartesianRenderer) otherGraph.getRenderer(), new SGLabel( "Other line", "Other Data", new Point2D.Double( 0.0, 0.0 )) );160 lkey.addLineGraph( (LineCartesianRenderer) otherGraph.getRenderer(), line.getKeyTitle() ); 185 161 } 162 163 /** *********** SECOND Y-AXIS (optional) ************ **/ 164 if( !pIdPIdListForSecondAxis.isEmpty() ) 165 { 166 final List<SimpleLine> linesForSecondAxis = createLines( pIdPIdListForSecondAxis, megapoliPlot.getBeginDate(), megapoliPlot.getEndDate() ); 167 final SimpleLine firstLineForSecondAxis = linesForSecondAxis.get( 0 ); 168 169 final SoTRange yRangeForSecondAxis = firstLineForSecondAxis.getYRange(); 170 for( final SimpleLine line : linesForSecondAxis ) 171 yRangeForSecondAxis.add( line.getYRange() ); 172 173 final SoTRange ynRangeForSecondAxis = Graph.computeRange( yRangeForSecondAxis, intervalsNumber ); 174 final SoTPoint endPointForSecondAxis = new SoTPoint( ynRangeForSecondAxis.getStart(), xnRange.getEnd() ); 175 176 final PlainAxis yleftForSecondAxis = new PlainAxis( "YY-Axis" ); 177 yleftForSecondAxis.setRangeU( yRangeForSecondAxis ); 178 yleftForSecondAxis.setLocationU( endPointForSecondAxis ); 179 yleftForSecondAxis.setLabelFont( _axisFont ); 180 yleftForSecondAxis.setLabelPosition( Axis.POSITIVE_SIDE ); 181 final SGLabel ytitleForSecondAxis = new SGLabel( "Y-Axis Title", firstLineForSecondAxis.getYMetaData().getName(), new Point2D.Double( 0.0, 0.0 ) ); 182 ytitleForSecondAxis.setFont( _axisFont ); 183 ytitleForSecondAxis.setHeightP( _heightAxisFont ); 184 yleftForSecondAxis.setTitle( ytitleForSecondAxis ); 185 186 /** ************ GRAPH ********** **/ 187 final LinearTransform ytForSecondAxis = new LinearTransform( new Range2D( ystart, yend ), ynRangeForSecondAxis ); 188 graph.setYTransform( ytForSecondAxis ); 189 graph.addYAxis( yleftForSecondAxis ); 190 191 final LineAttribute attrForSecondAxis = createRandomLineAttrbute( megapoliPlot.getAxeType() ); 192 graph.setData( firstLineForSecondAxis, attrForSecondAxis ); 193 194 for( final SimpleLine line : linesForSecondAxis.subList( 1, linesForSecondAxis.size() ) ) 195 { 196 final Layer otherLayer = new Layer( "Other Layer", new Dimension2D( xsize, ysize ) ); 197 mainPane.add( otherLayer ); 198 final CartesianGraph otherGraph = new CartesianGraph( "Second Graph", xtForFirstAxis, ytForSecondAxis ); 199 otherLayer.setGraph( otherGraph ); 200 201 final LineAttribute otherLineAttribute = createRandomLineAttrbute( megapoliPlot.getAxeType() ); 202 otherGraph.setData( line, otherLineAttribute ); 203 lkey.addLineGraph( (LineCartesianRenderer) otherGraph.getRenderer(), line.getKeyTitle() ); 204 } 205 } 206 layer.setGraph( graph ); 207 186 208 return mainPane; 209 } 210 211 /** 212 * This method returns a new LineAttribute with a random color 213 * 214 * @param axeType 215 * @return 216 */ 217 @NotNull 218 private LineAttribute createRandomLineAttrbute( @NotNull final String axeType ) 219 { 220 final LineAttribute attr; 221 final Color color = new Color( new Random().nextInt( 256 ), new Random().nextInt( 256 ), new Random().nextInt( 256 ) ); 222 223 if( axeType.equals( AxeTypeForFixedPlateform.TIME_POINTS.toString() ) ) 224 attr = new LineAttribute( LineAttribute.MARK, 1, color ); 225 else 226 attr = new LineAttribute( LineAttribute.SOLID, 1, color ); 227 228 attr.setMarkHeightP( _markHeight ); 229 230 return attr; 231 } 232 233 private Pair<List, List> extractListPairForAxes( @NotNull final List<Pair> pIdPIdList ) 234 { 235 final List<Pair> pIdPIdListForFirstAxis = new ArrayList<Pair>(); 236 final List<Pair> pIdPIdListForSecondAxis = new ArrayList<Pair>(); 237 238 for( final Pair pIdPId : pIdPIdList ) 239 { 240 final List<Integer> secondValuesForFirstAxis = getSecondValues( pIdPIdListForFirstAxis ); 241 final Integer parameterId = (Integer) pIdPId.getSecondValue(); 242 243 if( pIdPIdListForFirstAxis.isEmpty() || secondValuesForFirstAxis.contains( parameterId ) ) 244 pIdPIdListForFirstAxis.add( pIdPId ); 245 else 246 pIdPIdListForSecondAxis.add( pIdPId ); 247 } 248 249 return new Pair( pIdPIdListForFirstAxis, pIdPIdListForSecondAxis ); 250 } 251 252 private List getSecondValues( @NotNull final List<Pair> pairList ) 253 { 254 final List secondValues = new ArrayList<Integer>( pairList.size() ); 255 for( final Pair pair : pairList ) 256 secondValues.add( pair.getSecondValue() ); 257 return secondValues; 258 } 259 260 /** 261 * This method extracts data from BD for the plateform and parameter given as parameters 262 * and creates the corresponded simpleLine 263 * 264 * @param pIdPIdList 265 * @param beginDate 266 * @param endDate 267 * @return 268 * @throws ServiceException 269 */ 270 @NotNull 271 private List<SimpleLine> createLines( @NotNull final List<Pair> pIdPIdList, @Nullable final Date beginDate, @Nullable final Date endDate ) 272 throws ServiceException 273 { 274 final List<SimpleLine> lines = new ArrayList<SimpleLine>( pIdPIdList.size() ); 275 boolean isFirstLine = true; 276 277 for( final Pair<Integer, Integer> pIdPId : pIdPIdList ) 278 { 279 final Integer plateformId = pIdPId.getFirstValue(); 280 final Integer parameterId = pIdPId.getSecondValue(); 281 282 final Plateforme plateform = _etherService.getPlateformById( plateformId ); 283 // final Plateforme plateform = BouchonHelper.createPlateform(); 284 if( null == plateform ) 285 throw new ServiceException( ServiceException.ServiceCode.PLATEFORM_IS_NULL, new Throwable( ServiceException.ServiceCode.PLATEFORM_IS_NULL.toString() ) ); 286 287 final Parametre parametre = _etherService.getParameterById( parameterId ); 288 // final Parametre parametre = BouchonHelper.createParameter(); 289 if( null == parametre ) 290 throw new ServiceException( ServiceException.ServiceCode.PARAMETER_IS_NULL, new Throwable( ServiceException.ServiceCode.PARAMETER_IS_NULL.toString() ) ); 291 292 final Data valuesLists = _etherService.getListsByPlateformByParameterByPeriodForTimeSerie( plateformId, parameterId, beginDate, endDate ); 293 // final Data valuesLists = BouchonHelper.createValuesTemp( 50, 5 ); 294 295 final double[] dataArray = (double[]) valuesLists.getFirstArray(); 296 final Date[] dateValues = (Date[]) valuesLists.getSecondArray(); 297 298 final SimpleLine line = new SimpleLine( new GeoDateArray( dateValues ), dataArray, "legend" ); 299 SGTMetaData meta = new SGTMetaData( "", "", false, false ); 300 line.setXMetaData( meta ); 301 line.setKeyTitle( new SGLabel( "Line", plateform.getPlateformeNom() + "-" + parametre.getParametreNom(), new Point2D.Double( 0.0, 0.0 ) ) ); 302 303 if( isFirstLine ) 304 meta = new SGTMetaData( parametre.getParametreNom(), parametre.getUnite().getUniteCode(), false, false ); 305 else 306 meta = new SGTMetaData( "", "", false, false ); 307 line.setYMetaData( meta ); 308 309 lines.add( line ); 310 isFirstLine = false; 311 } 312 return lines; 187 313 } 188 314 … … 443 569 } 444 570 445 @NotNull446 private JPlotLayout createJPlotLayoutFor2DOrig( final MegapoliPlot megapoliPlot, final Integer plotWidth, final Integer plotHeight, @Nullable final Locale locale )447 {448 final ResourceBundle bundle = WebHelper.getBundle( locale );449 450 final double[] parameterArray = (double[]) megapoliPlot.getData().getFirstArray();451 final double[] latitudeArray = (double[]) megapoliPlot.getData().getSecondArray();452 final double[] longitudeValues = (double[]) megapoliPlot.getData().getThirdArray();453 454 // final SimpleLine data = new SimpleLine( longitudeValues, latitudeArray, "legend" );455 final SimpleGrid data = new SimpleGrid( parameterArray, longitudeValues, latitudeArray, "Test Series" );456 SGTMetaData meta = new SGTMetaData( bundle.getString( "plot.longitude" ), bundle.getString( "plot.degres" ), false, true );457 // TODO : vérifier modulo = 360458 // meta.setModuloValue( 360 );459 data.setXMetaData( meta );460 461 meta = new SGTMetaData( bundle.getString( "plot.latitude" ), bundle.getString( "plot.degres" ), false, true );462 // TODO : vérifier modulo = 360463 // meta.setModuloValue( 360 );464 data.setYMetaData( meta );465 466 // Graph467 final JPlotLayout jPlotLayout = new JPlotLayout( true, false, false, "JGridDemo Pane", null, true );468 jPlotLayout.setEditClasses( false );469 /*470 * Create a GridAttribute for CONTOUR style.471 */472 final Range2D datar = new Range2D( -20.0f, 45.0f, 5.0f );473 final ContourLevels clevels = ContourLevels.getDefault( datar );474 final GridAttribute gridAttr = new GridAttribute( clevels );475 /*476 * Create a ColorMap and change the style to RASTER_CONTOUR.477 */478 final ColorMap cmap = createColorMap( datar );479 gridAttr.setColorMap( cmap );480 gridAttr.setStyle( GridAttribute.RASTER_CONTOUR );481 /*482 * Add the grid to the layout and give a label for483 * the ColorKey.484 */485 jPlotLayout.addData( data, gridAttr, "First Data" );486 487 // final JPlotLayoutEther jPlotLayout = new JPlotLayoutEther( false, megapoliPlot.isXTime(), false, "Trajectory data", null, megapoliPlot.isLegendToHide() );488 // jPlotLayout.setTitles( "", "", "" );489 490 // Replace legend491 // final String legend = megapoliPlot.getData().getTitle();492 // final Dimension2D layerSizeP = jPlotLayout.getLayerSizeP();493 // final double factorForPlotWidthInPhysicalUnits = layerSizeP.getWidth() / Double.valueOf( plotWidth );494 // final double legendSizeInPhysicalUnits = legend.length() * factorForPlotWidthInPhysicalUnits * 7;495 // jPlotLayout.setKeyLocationP( new Point2D.Double( layerSizeP.getWidth() - legendSizeInPhysicalUnits, layerSizeP.getHeight() - 0.1 ) );496 497 // Add data and legend498 // jPlotLayout.addData( megapoliPlot.getData(), legend );499 jPlotLayout.setSize( plotWidth, plotHeight );500 jPlotLayout.setVisible( true );501 502 jPlotLayout.addNotify();503 jPlotLayout.validate();504 jPlotLayout.setOpaque( true );505 return jPlotLayout;506 }571 // @NotNull 572 // private JPlotLayout createJPlotLayoutFor2DOrig( final MegapoliPlot megapoliPlot, final Integer plotWidth, final Integer plotHeight, @Nullable final Locale locale ) 573 // { 574 // final ResourceBundle bundle = WebHelper.getBundle( locale ); 575 // 576 // final double[] parameterArray = (double[]) megapoliPlot.getData().getFirstArray(); 577 // final double[] latitudeArray = (double[]) megapoliPlot.getData().getSecondArray(); 578 // final double[] longitudeValues = (double[]) megapoliPlot.getData().getThirdArray(); 579 // 580 //// final SimpleLine data = new SimpleLine( longitudeValues, latitudeArray, "legend" ); 581 // final SimpleGrid data = new SimpleGrid( parameterArray, longitudeValues, latitudeArray, "Test Series" ); 582 // SGTMetaData meta = new SGTMetaData( bundle.getString( "plot.longitude" ), bundle.getString( "plot.degres" ), false, true ); 583 // // TODO : vérifier modulo = 360 584 //// meta.setModuloValue( 360 ); 585 // data.setXMetaData( meta ); 586 // 587 // meta = new SGTMetaData( bundle.getString( "plot.latitude" ), bundle.getString( "plot.degres" ), false, true ); 588 // // TODO : vérifier modulo = 360 589 //// meta.setModuloValue( 360 ); 590 // data.setYMetaData( meta ); 591 // 592 // // Graph 593 // final JPlotLayout jPlotLayout = new JPlotLayout( true, false, false, "JGridDemo Pane", null, true ); 594 // jPlotLayout.setEditClasses( false ); 595 // /* 596 // * Create a GridAttribute for CONTOUR style. 597 // */ 598 // final Range2D datar = new Range2D( -20.0f, 45.0f, 5.0f ); 599 // final ContourLevels clevels = ContourLevels.getDefault( datar ); 600 // final GridAttribute gridAttr = new GridAttribute( clevels ); 601 // /* 602 // * Create a ColorMap and change the style to RASTER_CONTOUR. 603 // */ 604 // final ColorMap cmap = createColorMap( datar ); 605 // gridAttr.setColorMap( cmap ); 606 // gridAttr.setStyle( GridAttribute.RASTER_CONTOUR ); 607 // /* 608 // * Add the grid to the layout and give a label for 609 // * the ColorKey. 610 // */ 611 // jPlotLayout.addData( data, gridAttr, "First Data" ); 612 // 613 //// final JPlotLayoutEther jPlotLayout = new JPlotLayoutEther( false, megapoliPlot.isXTime(), false, "Trajectory data", null, megapoliPlot.isLegendToHide() ); 614 //// jPlotLayout.setTitles( "", "", "" ); 615 // 616 // // Replace legend 617 //// final String legend = megapoliPlot.getData().getTitle(); 618 //// final Dimension2D layerSizeP = jPlotLayout.getLayerSizeP(); 619 //// final double factorForPlotWidthInPhysicalUnits = layerSizeP.getWidth() / Double.valueOf( plotWidth ); 620 //// final double legendSizeInPhysicalUnits = legend.length() * factorForPlotWidthInPhysicalUnits * 7; 621 //// jPlotLayout.setKeyLocationP( new Point2D.Double( layerSizeP.getWidth() - legendSizeInPhysicalUnits, layerSizeP.getHeight() - 0.1 ) ); 622 // 623 // // Add data and legend 624 //// jPlotLayout.addData( megapoliPlot.getData(), legend ); 625 // jPlotLayout.setSize( plotWidth, plotHeight ); 626 // jPlotLayout.setVisible( true ); 627 // 628 // jPlotLayout.addNotify(); 629 // jPlotLayout.validate(); 630 // jPlotLayout.setOpaque( true ); 631 // return jPlotLayout; 632 // } 507 633 508 634 @NotNull … … 654 780 } 655 781 656 /**657 * This method extracts data from BD for the plateform and parameter given as parameters658 * and creates the corresponded simpleLine659 *660 * @param pIdPIdList661 * @param beginDate662 * @param endDate663 * @return664 * @throws ServiceException665 */666 @NotNull667 private List<SimpleLine> createLines( @NotNull final List<Pair> pIdPIdList, @Nullable final Date beginDate, @Nullable final Date endDate )668 throws ServiceException669 {670 final List<SimpleLine> lines = new ArrayList<SimpleLine>( pIdPIdList.size() );671 boolean isFirstLine = true;672 673 for( final Pair<Integer, Integer> pIdPId : pIdPIdList )674 {675 final Parametre parametre = new Parametre();676 if( isFirstLine )677 {678 // final Parametre parametre = _etherService.getParameterById( parameterId );679 parametre.setParametreNom( "Ozone" );680 final Unite unit = new Unite();681 unit.setUniteCode( "ppb" );682 parametre.setUnite( unit );683 if( null == parametre )684 throw new ServiceException( ServiceException.ServiceCode.PARAMETER_IS_NULL, new Throwable( ServiceException.ServiceCode.PARAMETER_IS_NULL.toString() ) );685 }686 687 final Integer plateformId = pIdPId.getFirstValue();688 final Integer parameterId = pIdPId.getSecondValue();689 // final Data valuesLists = _etherService.getListsByPlateformByParameterByPeriodForTimeSerie( plateformId, parameterId, beginDate, endDate );690 final Data valuesLists = createValuesTemp( 50, 5 );691 692 final double[] dataArray = (double[]) valuesLists.getFirstArray();693 final Date[] dateValues = (Date[]) valuesLists.getSecondArray();694 695 final SimpleLine line = new SimpleLine( new GeoDateArray( dateValues ), dataArray, "legend" );696 SGTMetaData meta = new SGTMetaData( "", "", false, false );697 line.setXMetaData( meta );698 699 if( isFirstLine )700 meta = new SGTMetaData( parametre.getParametreNom(), parametre.getUnite().getUniteCode(), false, false );701 else702 meta = new SGTMetaData( "", "", false, false );703 line.setYMetaData( meta );704 705 lines.add( line );706 isFirstLine = false;707 }708 return lines;709 }710 711 // TODO : remove this method712 private Data createValuesTemp( final Integer size, final Integer delta )713 {714 final double[] values = new double[size];715 final Date[] dates = new Date[size];716 final Calendar cal = Calendar.getInstance();717 718 for( int i = 0; i < size; i++ )719 {720 values[i] = (double) i * Math.random();721 cal.set( Calendar.MINUTE, (int) ( 2 + i + ( Math.random() * 8 ) ) );722 dates[i] = cal.getTime();723 }724 return new Data( values, dates );725 }726 727 782 @Required 728 783 public void setEtherService( final EtherService etherService ) 729 784 { 730 785 _etherService = etherService; 786 } 787 788 public EtherService getEtherService() 789 { 790 return _etherService; 731 791 } 732 792 -
ether_megapoli/trunk/service/implementation/com/ether/EtherPlotServiceImpl.java
r184 r185 69 69 70 70 // TODO : gérer values Number 71 final Integer valuesNumber = 10;72 // final Integer valuesNumber = megapoliPlot.getValuesNumber();71 // final Integer valuesNumber = 10; 72 final Integer valuesNumber = getEtherService().getNumberValuesByPlateformByParameterByPeriod( megapoliPlot.getpIdPIdList(), megapoliPlot.getBeginDate(), megapoliPlot.getEndDate() ); 73 73 74 74 // Bottom Pane -
ether_megapoli/trunk/service/implementation/com/ether/EtherServiceImpl.java
r171 r185 117 117 } 118 118 119 @NotNull 120 @Transactional(readOnly = true) 121 public Integer getNumberValuesByPlateformByParameterByPeriod( @NotNull final List<Pair> pairs, @Nullable final Date beginDate, @Nullable final Date endDate ) 122 throws ServiceException 123 { 124 try 125 { 126 Integer number = 0; 127 for( final Pair pair : pairs ) 128 number += _valueDAO.getNumberValuesByPlateformByParameterByPeriod( (Integer) pair.getFirstValue(), (Integer) pair.getSecondValue(), beginDate, endDate ); 129 130 return number; 131 } 132 catch( PersistenceException e ) 133 { 134 throw new ServiceException( ServiceException.ServiceCode.VALUE_NOT_FOUND, e ); 135 } 136 } 137 119 138 @Required 120 139 public void setPlateformDAO( final PlateformDAO plateformDAO ) -
ether_megapoli/trunk/service/implementation/com/ether/MegapoliPlot.java
r184 r185 77 77 } 78 78 79 // @Nullable80 // public String getParameterName()81 // {82 // return _parameterName;83 // }84 //85 // public void setParameterName( @Nullable final String parameterName )86 // {87 // _parameterName = parameterName;88 // }89 //90 // @Nullable91 // public String getParameterUnitCode()92 // {93 // return _parameterUnitCode;94 // }95 //96 // public void setParameterUnitCode( @Nullable final String parameterUnitCode )97 // {98 // _parameterUnitCode = parameterUnitCode;99 // }100 101 @NotNull102 public Integer getValuesNumber()103 {104 return _valuesNumber;105 }106 107 public void setValuesNumber( @NotNull final Integer valuesNumber )108 {109 _valuesNumber = valuesNumber;110 }111 112 79 @NotNull 113 80 public String getAxeType() … … 167 134 private boolean _legendToHide = true; 168 135 private boolean _isTimeSerie = true; 169 // @Nullable170 // private String _parameterName;171 // @Nullable172 // private String _parameterUnitCode;173 @NotNull174 private Integer _valuesNumber;175 136 @NotNull 176 137 private String _axeType; -
ether_megapoli/trunk/service/interface/com/ether/EtherService.java
r171 r185 39 39 <T1, T2, T3> Data<T1[], T2[], T3[]> getListsByPlateformByParameterByPeriodFor2D( @NotNull final Integer plateformId, @NotNull final Integer parameterId, @Nullable final Date dateBegin, @Nullable final Date dateEnd ) 40 40 throws ServiceException; 41 42 @NotNull 43 Integer getNumberValuesByPlateformByParameterByPeriod( @NotNull final List<Pair> pairs, @Nullable final Date beginDate, @Nullable final Date endDate ) 44 throws ServiceException; 41 45 } -
ether_megapoli/trunk/service/interface/com/ether/ServiceException.java
r184 r185 24 24 SERVICE_PROBLEM, 25 25 PLATEFORM_NOT_FOUND, 26 PLATEFORM_IS_NULL, 26 27 PARAMETER_NOT_FOUND, 27 28 PARAMETER_IS_NULL, -
ether_megapoli/trunk/service/test/com/ether/ServiceEtherTest.java
r89 r185 1 1 package com.ether; 2 2 3 import gov.noaa.pmel.util.GeoDateArray; 4 import org.jetbrains.annotations.NotNull; 5 import org.jetbrains.annotations.Nullable; 6 7 import java.text.ParseException; 8 import java.util.ArrayList; 9 import java.util.Date; 10 import java.util.List; 3 import com.medias.database.objects.Plateforme; 4 import com.medias.database.objects.TypePlateforme; 11 5 12 6 /** … … 28 22 afterServiceTest(); 29 23 } 30 31 24 } -
ether_megapoli/trunk/service/test/com/ether/ServiceTestHelper.java
r89 r185 3 3 import com.medias.database.objects.Parametre; 4 4 import com.medias.database.objects.Plateforme; 5 import com.medias.database.objects.TypePlateforme; 5 6 import com.medias.database.objects.Valeur; 6 7 import org.apache.commons.logging.Log; 7 8 import org.apache.commons.logging.LogFactory; 8 9 9 public abstract class ServiceTestHelper<SERVICE extends Service> 10 extendsHibernateTestHelper<SERVICE>10 public abstract class ServiceTestHelper<SERVICE extends Service> 11 extends HibernateTestHelper<SERVICE> 11 12 { 12 protected ServiceTestHelper(final String serviceBeanName) { 13 super(null, serviceBeanName, getAllDependencies(), DEFAULT_SESSION_FACTORY_BEAN_NAME); 13 protected ServiceTestHelper( final String serviceBeanName ) 14 { 15 super( null, serviceBeanName, getAllDependencies(), DEFAULT_SESSION_FACTORY_BEAN_NAME ); 14 16 } 15 17 16 protected void deleteAllKnownData() throws Exception 18 protected void deleteAllKnownData() 19 throws Exception 17 20 { 18 21 // deleteAllDatas( getAllKnownDomainClasses() ); 19 22 } 20 23 21 24 public static String[] getAllDependencies() 22 25 { 23 return new String[] { 24 25 26 "classpath:hibernate_test.cfg.xml",};26 return new String[]{ 27 "classpath:dao-context.xml", 28 "classpath:service-context.xml", 29 "classpath:hibernate_test.cfg.xml",}; 27 30 } 28 31 … … 30 33 public static Class[] getAllKnownDomainClasses() 31 34 { 32 return new Class[] {33 34 35 35 return new Class[]{ 36 Plateforme.class, 37 Parametre.class, 38 Valeur.class,}; 36 39 } 37 40 … … 39 42 * Executes operations before running test. 40 43 */ 41 protected abstract void beforeServiceTest() throws Exception; 44 protected abstract void beforeServiceTest() 45 throws Exception; 42 46 43 47 /** 44 48 * Executes operations after running test. 45 49 */ 46 protected final void afterServiceTest() throws Exception 50 protected final void afterServiceTest() 51 throws Exception 47 52 { 48 //deleteAllKnownData(); 53 //deleteAllKnownData(); 49 54 } 50 55 51 protected final void beforeHibernateTest() throws Exception 56 protected final void beforeHibernateTest() 57 throws Exception 52 58 { 53 59 beforeServiceTest(); 54 60 } 55 61 56 protected final void afterHibernateTest() throws Exception 62 protected final void afterHibernateTest() 63 throws Exception 57 64 { 58 65 afterServiceTest(); 59 66 } 60 67 61 68 protected final SERVICE getService() 62 69 { 63 70 return getBean(); 64 71 } 65 72 66 private static final Log LOGGER = LogFactory.getLog( ServiceTestHelper.class);73 private static final Log LOGGER = LogFactory.getLog( ServiceTestHelper.class ); 67 74 private static final String DEFAULT_SESSION_FACTORY_BEAN_NAME = "sessionFactory"; 68 75 } -
ether_megapoli/trunk/web/src/com/ether/Controller.java
r184 r185 51 51 throws ServiceException 52 52 { 53 //final List<Plateforme> plateforms = _etherService.getAllPlateforms();54 final List<Plateforme> plateforms = new ArrayList<Plateforme>();55 final Plateforme pf = new Plateforme();56 pf.setPlateformeId( 1 );57 pf.setPlateformeNom( "LHVP" );58 pf.setTypePlateforme( new TypePlateforme( 1, "FIXE" ) );59 plateforms.add( pf );60 final Plateforme pf2 = new Plateforme();61 pf2.setPlateformeId( 2 );62 pf2.setPlateformeNom( "SIRTA" );63 pf2.setTypePlateforme( new TypePlateforme( 1, "MOBILE" ) );64 plateforms.add( pf2 );53 final List<Plateforme> plateforms = _etherService.getAllPlateforms(); 54 // final List<Plateforme> plateforms = new ArrayList<Plateforme>(); 55 // final Plateforme pf = new Plateforme(); 56 // pf.setPlateformeId( 1 ); 57 // pf.setPlateformeNom( "LHVP" ); 58 // pf.setTypePlateforme( new TypePlateforme( 1, "FIXE" ) ); 59 // plateforms.add( pf ); 60 // final Plateforme pf2 = new Plateforme(); 61 // pf2.setPlateformeId( 2 ); 62 // pf2.setPlateformeNom( "SIRTA" ); 63 // pf2.setTypePlateforme( new TypePlateforme( 1, "FIXE" ) ); 64 // plateforms.add( pf2 ); 65 65 66 66 final Map<String, Object> model = new HashMap<String, Object>(); … … 80 80 throws ServiceException, EtherException 81 81 { 82 //final List<Parametre> parametersByPlateform = _etherService.getParametersByPlateformId( plateformId );83 final List<Parametre> parametersByPlateform = new ArrayList<Parametre>( 2 );84 final Parametre p1 = new Parametre();85 p1.setParametreId( 1 );86 p1.setParametreNom( "JNO2" );87 parametersByPlateform.add( p1 );88 final Parametre p2 = new Parametre();89 p2.setParametreId( 2 );90 p2.setParametreNom( "CO2" );91 parametersByPlateform.add( p2 );92 93 if( plateformId == 1 )94 {95 final Parametre p3 = new Parametre();96 p3.setParametreId( 3 );97 p3.setParametreNom( "Ethane" );98 parametersByPlateform.add( p3 );99 }100 else101 {102 final Parametre p3 = new Parametre();103 p3.setParametreId( 3 );104 p3.setParametreNom( "Sulfate" );105 parametersByPlateform.add( p3 );106 final Parametre p4 = new Parametre();107 p4.setParametreId( 4 );108 p4.setParametreNom( "Benzene" );109 parametersByPlateform.add( p4 );110 }82 final List<Parametre> parametersByPlateform = _etherService.getParametersByPlateformId( plateformId ); 83 // final List<Parametre> parametersByPlateform = new ArrayList<Parametre>( 2 ); 84 // final Parametre p1 = new Parametre(); 85 // p1.setParametreId( 1 ); 86 // p1.setParametreNom( "JNO2" ); 87 // parametersByPlateform.add( p1 ); 88 // final Parametre p2 = new Parametre(); 89 // p2.setParametreId( 2 ); 90 // p2.setParametreNom( "CO2" ); 91 // parametersByPlateform.add( p2 ); 92 // 93 // if( plateformId == 1 ) 94 // { 95 // final Parametre p3 = new Parametre(); 96 // p3.setParametreId( 3 ); 97 // p3.setParametreNom( "Ethane" ); 98 // parametersByPlateform.add( p3 ); 99 // } 100 // else 101 // { 102 // final Parametre p3 = new Parametre(); 103 // p3.setParametreId( 3 ); 104 // p3.setParametreNom( "Sulfate" ); 105 // parametersByPlateform.add( p3 ); 106 // final Parametre p4 = new Parametre(); 107 // p4.setParametreId( 4 ); 108 // p4.setParametreNom( "Benzene" ); 109 // parametersByPlateform.add( p4 ); 110 // } 111 111 112 112 final JSONObject result = new JSONObject(); -
ether_megapoli/trunk/web/src/com/ether/ControllerPlot.java
r184 r185 105 105 megapoliPlot.setTimeSerie( true ); 106 106 megapoliPlot.setLegendToHide( pIdPIdList.size() == 1 ); 107 // megapoliPlot.setValuesNumber( ( (double[]) valuesLists.getFirstArray() ).length );108 107 } 109 108 else … … 128 127 megapoliPlot.setTimeSerie( false ); 129 128 megapoliPlot.setLegendToHide( false ); 130 megapoliPlot.setValuesNumber( ( (double[]) valuesLists.getFirstArray() ).length );129 // megapoliPlot.setValuesNumber( ( (double[]) valuesLists.getFirstArray() ).length ); 131 130 } 132 131 … … 160 159 } 161 160 161 // TODO : supprimer cette méthode et utiliser JSON pour récupérer pIdPIdList 162 162 @Nullable 163 163 private List<Pair> extractpIdPIdListFromString( @NotNull final String pIdPIdArrayString ) -
ether_megapoli/trunk/web/visualization/visu_parameter_by_pf-script.jsp
r184 r185 70 70 labelTitle: interfaceTexts["data.visualization.selectDate"], labelYear: interfaceTexts["data.visualization.selectYear"], labelMonth: interfaceTexts["data.visualization.selectMonth"], labelDayOfMonth: interfaceTexts["data.visualization.selectDay"], 71 71 labelHour: interfaceTexts["data.visualization.selectHour"], labelMinute: interfaceTexts["data.visualization.selectMinute"], 72 methodToCall: this.onClickEndDate.bindAsEventListener( this ), 72 73 idToUpdateEarliest: "beginDate" 73 74 } ); … … 209 210 210 211 // Enable/disable addPlot's button 211 if( !this.selectPlotsPlateformType || this.selectPlotsPlateformType == this.selectedPlateform.jsonElement.type )212 if( (!this.selectPlotsPlateformType || this.selectPlotsPlateformType == this.selectedPlateform.jsonElement.type) && "MOBILE" != this.selectedPlateform.jsonElement.type ) 212 213 this.addPlotButton.enable(); 213 214 else … … 243 244 244 245 this.testAllFields(); 246 }, 247 248 onClickEndDate: function() 249 { 250 this.endDate = this.calendarConverter.parse( $( "endDate" ).value ).getTime(); 245 251 }, 246 252
Note: See TracChangeset
for help on using the changeset viewer.