Ignore:
Timestamp:
04/26/10 19:12:49 (14 years ago)
Author:
cbipsl
Message:

maj eccad V3.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/metier/emission/ServiceEmission.java

    r68 r70  
    1515import org.medias.eccad.metier.generationRaster.colorMap.ColorMappingLineaire; 
    1616import org.medias.eccad.metier.statistique.GrapheCGI; 
    17 import org.medias.eccad.metier.statistique.ServiceStatistique; 
    1817import org.medias.eccad.metier.traducteur.TraducteurStat; 
    1918import org.medias.eccad.modele.ColorTab; 
     
    2928import org.medias.eccad.persistance.dao.ProduitDAO; 
    3029import org.medias.eccad.persistance.exception.PersistanceException; 
    31 import org.medias.jni.RasterDAO; 
    3230import org.springframework.beans.factory.xml.XmlBeanFactory; 
    3331 
     
    116114                        LoggerPerso.log(ServiceEmission.class, LoggerPerso.ERROR, "erreur getGazFacteurEmission parametre : ", e); 
    117115                } 
    118                 LoggerPerso.log(ServiceEmission.class, LoggerPerso.DEBUG, " get produit :"  + " " + prod + " ");                 
     116//              LoggerPerso.log(ServiceEmission.class, LoggerPerso.DEBUG, " get produit :"  + " " + prod + " ");                 
    119117                return prod; 
    120118        } 
     
    134132                        LoggerPerso.log(ServiceEmission.class, LoggerPerso.ERROR, "erreur getGazFacteurEmission parametre : ", e); 
    135133                } 
    136                 LoggerPerso.log(ServiceEmission.class, LoggerPerso.DEBUG, " getGazFacteurEmission param"  + " " + liste.size() + " " + liste);           
     134//              LoggerPerso.log(ServiceEmission.class, LoggerPerso.DEBUG, " getGazFacteurEmission param"  + " " + liste.size() + " " + liste);           
    137135                return liste; 
    138136        } 
     
    149147                        LoggerPerso.log(ServiceEmission.class, LoggerPerso.ERROR, "erreur getGazFacteurEmission produit : " + id_produit, e); 
    150148                } 
    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); 
    152150                return liste; 
    153151        } 
     
    156154         
    157155        public List<Produit> getListLand(Long facteur) { 
    158                 ProduitDAO produitdao    = (ProduitDAO) xmlbean.getBean("produitDAO"); 
     156                ProduitDAO produitdao = (ProduitDAO) xmlbean.getBean("produitDAO"); 
    159157                List<Produit> liste = null; 
    160158                 
     
    165163                        LoggerPerso.log(ServiceEmission.class, LoggerPerso.ERROR, "erreur getListLand parametre : ", e); 
    166164                } 
    167                 LoggerPerso.log(ServiceEmission.class, LoggerPerso.DEBUG, " getListLand param"  + " " + liste.size() + " " + liste);             
     165//              LoggerPerso.log(ServiceEmission.class, LoggerPerso.DEBUG, " getListLand param"  + " " + liste.size() + " " + liste);             
    168166                return liste; 
    169167        } 
     
    190188         * @return 
    191189         */ 
    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) { 
    193191                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); 
    199197                InformationLegend info_legend = new InformationLegend(); 
    200198                GenerateurLegendRaster gen_legend = new GenerateurLegendeImg(); 
    201199                gen_legend.genereLegendVertical(colormap, info_legend.getLegendDynamic(colormap.getColorTable(), reponse.getMaximal(), reponse.getMinimal()), "g(X)/m2/jour"); 
    202                 //system.out.println(reponse); 
    203200                //gen_legend.genereLegendVertical(colormap, info_legend.getLegendDynamic(colormap.getColorTable(), 150, 0), info_legend.getInfoSup(id_grille)); 
    204201                gen_legend.enregistreLegend(Donnees.getHome()  +url_images+".legend.png"); 
     
    222219        private String getRasterFacteur(RequeteFacteurEmission requete) { 
    223220                String xml = requete.toXml(); 
    224                 System.out.println(xml); 
    225                 // TODO: ATTENDRE LIB DE HAKIM 
    226221                GrapheCGI rasterdao = new GrapheCGI(); 
    227                  
    228                 //system.out.println(rasterdao.getStatistique(xml)); 
    229                  
    230222                reponse = decodeReponse(rasterdao.getStatistique(xml)); 
    231223                if (reponse.getError() != null && !reponse.getError().equals("")) 
    232224                        return "erreur"; 
    233                  
    234225                GenerateurWorldFile gen_worldfile = (GenerateurWorldFile) xmlbean.getBean("worldfile"); 
    235226                gen_worldfile.setPasX(reponse.getCarte().getPasX()); 
    236227                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)); 
    241232                String nom = reponse.getUrlImage(); 
    242                  
    243233                nom = nom.substring(0, nom.length()-4); 
    244234                gen_worldfile.writeWorldFile(nom); 
    245                  
    246                 //system.out.println("\n\n\n" + nom); 
    247235                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//      } 
    254241         
    255242        private StatReponse decodeReponse(String reponse_xml) { 
     
    258245                if (reponse.getError() != null && !reponse.getError().equals("")) 
    259246                        return null; 
    260                 LoggerPerso.log(ServiceStatistique.class, LoggerPerso.DEBUG, reponse_xml); 
     247//              LoggerPerso.log(ServiceStatistique.class, LoggerPerso.DEBUG, reponse_xml); 
    261248                return reponse; 
    262249        } 
     
    268255         * @return la table de couleur par défaut 
    269256         */ 
    270         private ColorMapping getColorMap(long colormapid) { 
     257        private ColorMapping getColorMap(long colormapid, long classdisid) { 
    271258                ColorTabDAO colorDAO = (ColorTabDAO) xmlbean.getBean("colorTabDAO"); 
    272259                 
     
    276263                // mais la j'ai un résultat chelou :/ 
    277264                try { 
    278                         colortab = colorDAO.getColorMapByID(colormapid); 
     265                        colortab = colorDAO.getColorMapByID(colormapid, classdisid); 
    279266                } catch (PersistanceException e) { 
    280267                        e.printStackTrace(); 
Note: See TracChangeset for help on using the changeset viewer.