| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 
 |  
 public void ecritureNoeudHM(Noeud NOEUD) throws IOException {
 
  System.out.println("Début de la fonction ecrireNoeudHM   Hydroworks Mouse \n ");
 
  System.out.println("Création du flux de lecture \n");
 
  fluxlecture = new FileReader(fichierPRN);
 
  System.out.println("Fin de création du flux de lecture \n");
 
  BufferedReader tamponLecture = new BufferedReader(fluxlecture);
  String ligne;
 
  fichierDestination = new String(chemDest1.getText());
  fichierDestination = fichierDestination.trim();
     writer = new FileWriter(fichierDestination);  
 
 
     //Chapeau des noeuds
     writer.write("[MOUSE_NODES]"+"\r\n");
     writer.write("   SYNTAX_VERSION = 2"+"\r\n");
     writer.write("   UNIT_TYPE = 1"+"\r\n");
     writer.write("   NODEHeader = 'NODEID', 'TYPENO', 'X', 'Y', 'DIAMETER', 'INVERTLEVEL', 'GROUNDLEVEL', 'WATERLEVEL',"+"\r\n"); 
     writer.write("'OUTLETSHAPENO', 'DATASETID', 'RMNODETYPENO', 'RMPRESSURELEVEL', 'TOPTYPENO', 'BUFFERPRESSLEVEL', 'RELWEIRCOEFF',"); 
     writer.write("'DQTN_GROUNDLEVEL', 'DQTN_INVERTLEVEL', 'DQTN_DIAMETER'"+"\r\n");
 
     while((ligne=tamponLecture.readLine())!=null)
   {
      cont3++;
      System.out.println("Le nombre de boucles est de : "+cont3+"\r\n");
       //mise a 1 du compteur cont1 quand on rencontre m AD 
 
      if(ligne.startsWith("                       (m AD)    (ha)             (m AD)    (m2)  (m AD)    (m2)        (m AD)    (ha)  (m AD)    (ha)"))
         {
          System.out.println(" LA LIGNE DES UNITES  EST :"+ligne+"\n");
          cont1=1;
          System.out.println(" LE COMPTEUR 1 A BIEN ETE MIS A : "+cont1+"\n");
         }
 
         //mise a 1 du compteur cont2 quand on rencontre la fin du bloc noeud
 
     /*
      if(ligne.startsWith("  Nodes marked '*' are outfalls"));
      {
       System.out.println(" la fin du bloc noeud a ete atteinte "+"\n");
       System.out.println(" la DERNIERE ligne lue est : "+ligne);
       cont2=1;
      }
      */
      if(cont1==1)
 
      {
       if (ligne.charAt(23)!='(')
 
       {
        if ((ligne.charAt(8)!='*'))
        System.out.println(" 8 ME CARACTERE -------> PAS EXUTOIRE "+"\n");
        {
         if (ligne.charAt(30)!='P')
         System.out.println(" 30 EME CARACTERE-----------> PAS POND "+"\n");
          { 
           if (ligne.charAt(30)!='L')
             {
              System.out.println("DEBUT DE L'ECRITURE DES NOEUDS"+"\n");
              //les espaces sont les séparateurs
              System.out.println(" La LIGNE EST :"+ligne+"\n");
              System.out.println(" le 23 eme CARACTERE EST :"+ligne.charAt(23)+"\n");
              noeudTypeHw = ligne.split("\\ "); | 
Partager