Changeset 70 for ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/metier/emission/ServiceEmission.java
- Timestamp:
- 04/26/10 19:12:49 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/metier/emission/ServiceEmission.java
r68 r70 15 15 import org.medias.eccad.metier.generationRaster.colorMap.ColorMappingLineaire; 16 16 import org.medias.eccad.metier.statistique.GrapheCGI; 17 import org.medias.eccad.metier.statistique.ServiceStatistique;18 17 import org.medias.eccad.metier.traducteur.TraducteurStat; 19 18 import org.medias.eccad.modele.ColorTab; … … 29 28 import org.medias.eccad.persistance.dao.ProduitDAO; 30 29 import org.medias.eccad.persistance.exception.PersistanceException; 31 import org.medias.jni.RasterDAO;32 30 import org.springframework.beans.factory.xml.XmlBeanFactory; 33 31 … … 116 114 LoggerPerso.log(ServiceEmission.class, LoggerPerso.ERROR, "erreur getGazFacteurEmission parametre : ", e); 117 115 } 118 LoggerPerso.log(ServiceEmission.class, LoggerPerso.DEBUG, " get produit :" + " " + prod + " ");116 // LoggerPerso.log(ServiceEmission.class, LoggerPerso.DEBUG, " get produit :" + " " + prod + " "); 119 117 return prod; 120 118 } … … 134 132 LoggerPerso.log(ServiceEmission.class, LoggerPerso.ERROR, "erreur getGazFacteurEmission parametre : ", e); 135 133 } 136 LoggerPerso.log(ServiceEmission.class, LoggerPerso.DEBUG, " getGazFacteurEmission param" + " " + liste.size() + " " + liste);134 // LoggerPerso.log(ServiceEmission.class, LoggerPerso.DEBUG, " getGazFacteurEmission param" + " " + liste.size() + " " + liste); 137 135 return liste; 138 136 } … … 149 147 LoggerPerso.log(ServiceEmission.class, LoggerPerso.ERROR, "erreur getGazFacteurEmission produit : " + id_produit, e); 150 148 } 151 LoggerPerso.log(ServiceEmission.class, LoggerPerso.DEBUG, " getGazFacteurEmission produit : " + id_produit + " " + liste.size() + " " + liste);149 // LoggerPerso.log(ServiceEmission.class, LoggerPerso.DEBUG, " getGazFacteurEmission produit : " + id_produit + " " + liste.size() + " " + liste); 152 150 return liste; 153 151 } … … 156 154 157 155 public List<Produit> getListLand(Long facteur) { 158 ProduitDAO produitdao 156 ProduitDAO produitdao = (ProduitDAO) xmlbean.getBean("produitDAO"); 159 157 List<Produit> liste = null; 160 158 … … 165 163 LoggerPerso.log(ServiceEmission.class, LoggerPerso.ERROR, "erreur getListLand parametre : ", e); 166 164 } 167 LoggerPerso.log(ServiceEmission.class, LoggerPerso.DEBUG, " getListLand param" + " " + liste.size() + " " + liste);165 // LoggerPerso.log(ServiceEmission.class, LoggerPerso.DEBUG, " getListLand param" + " " + liste.size() + " " + liste); 168 166 return liste; 169 167 } … … 190 188 * @return 191 189 */ 192 public String getCarte(RequeteFacteurEmission requete, Zone affiche, String id_unique ) {190 public String getCarte(RequeteFacteurEmission requete, Zone affiche, String id_unique, boolean zoom, boolean firstAff) { 193 191 String temp = getRasterFacteur(requete); 194 return carte.gestionImageCarte(temp, affiche, id_unique );195 } 196 197 public String getLegend(long id_colormap, long id_ grille, String url_images) {198 ColorMapping colormap = getColorMap(id_colormap );192 return carte.gestionImageCarte(temp, affiche, id_unique, zoom, firstAff); 193 } 194 195 public String getLegend(long id_colormap, long id_classdis, long id_grille, String url_images) { 196 ColorMapping colormap = getColorMap(id_colormap,id_classdis); 199 197 InformationLegend info_legend = new InformationLegend(); 200 198 GenerateurLegendRaster gen_legend = new GenerateurLegendeImg(); 201 199 gen_legend.genereLegendVertical(colormap, info_legend.getLegendDynamic(colormap.getColorTable(), reponse.getMaximal(), reponse.getMinimal()), "g(X)/m2/jour"); 202 //system.out.println(reponse);203 200 //gen_legend.genereLegendVertical(colormap, info_legend.getLegendDynamic(colormap.getColorTable(), 150, 0), info_legend.getInfoSup(id_grille)); 204 201 gen_legend.enregistreLegend(Donnees.getHome() +url_images+".legend.png"); … … 222 219 private String getRasterFacteur(RequeteFacteurEmission requete) { 223 220 String xml = requete.toXml(); 224 System.out.println(xml);225 // TODO: ATTENDRE LIB DE HAKIM226 221 GrapheCGI rasterdao = new GrapheCGI(); 227 228 //system.out.println(rasterdao.getStatistique(xml));229 230 222 reponse = decodeReponse(rasterdao.getStatistique(xml)); 231 223 if (reponse.getError() != null && !reponse.getError().equals("")) 232 224 return "erreur"; 233 234 225 GenerateurWorldFile gen_worldfile = (GenerateurWorldFile) xmlbean.getBean("worldfile"); 235 226 gen_worldfile.setPasX(reponse.getCarte().getPasX()); 236 227 gen_worldfile.setPasY(reponse.getCarte().getPasY()); 237 gen_worldfile.setPixelY(reponse.getZone().getNorthbc() - (reponse.getCarte().getPasY()/2));238 gen_worldfile.setPixelX(reponse.getZone().getWestbc() + (reponse.getCarte().getPasY()/2));239 240 228 gen_worldfile.setPixelY(reponse.getZone().getNorthbc()); 229 gen_worldfile.setPixelX(reponse.getZone().getWestbc()); 230 // gen_worldfile.setPixelY(reponse.getZone().getNorthbc() - (reponse.getCarte().getPasY()/2)); 231 // gen_worldfile.setPixelX(reponse.getZone().getWestbc() + (reponse.getCarte().getPasX()/2)); 241 232 String nom = reponse.getUrlImage(); 242 243 233 nom = nom.substring(0, nom.length()-4); 244 234 gen_worldfile.writeWorldFile(nom); 245 246 //system.out.println("\n\n\n" + nom);247 235 return reponse.getUrlImage(); 248 //return "/tmp/4113.31.png"; 249 } 250 251 private String encodeData() { 252 return ""; 253 } 236 } 237 238 // private String encodeData() { 239 // return ""; 240 // } 254 241 255 242 private StatReponse decodeReponse(String reponse_xml) { … … 258 245 if (reponse.getError() != null && !reponse.getError().equals("")) 259 246 return null; 260 LoggerPerso.log(ServiceStatistique.class, LoggerPerso.DEBUG, reponse_xml);247 // LoggerPerso.log(ServiceStatistique.class, LoggerPerso.DEBUG, reponse_xml); 261 248 return reponse; 262 249 } … … 268 255 * @return la table de couleur par défaut 269 256 */ 270 private ColorMapping getColorMap(long colormapid ) {257 private ColorMapping getColorMap(long colormapid, long classdisid) { 271 258 ColorTabDAO colorDAO = (ColorTabDAO) xmlbean.getBean("colorTabDAO"); 272 259 … … 276 263 // mais la j'ai un résultat chelou :/ 277 264 try { 278 colortab = colorDAO.getColorMapByID(colormapid );265 colortab = colorDAO.getColorMapByID(colormapid, classdisid); 279 266 } catch (PersistanceException e) { 280 267 e.printStackTrace();
Note: See TracChangeset
for help on using the changeset viewer.