]> SALOME platform Git repositories - tools/eficas.git/commitdiff
Salome HOME
Further corrections for Telemac beforeMergeMDM
authorYoann Audouin <B61570@dsp0919998.atlas.edf.fr>
Wed, 7 Jul 2021 06:22:01 +0000 (08:22 +0200)
committerYoann Audouin <B61570@dsp0919998.atlas.edf.fr>
Wed, 7 Jul 2021 06:22:01 +0000 (08:22 +0200)
Editeur/catadesc.py
InterfaceQT4/editorSsIhm.py
InterfaceQT4/readercata.py

index d99e1c3b9ba71e7958e17df373ebde804e5b96f5..2f43cc37f0b55a1ebdd72c93db757bc8cac56885 100644 (file)
@@ -65,6 +65,7 @@ class CatalogDescription(object):
         self.file_format = file_format
         self.default = default
         self.code = code
+        self.ssCode = ss_code
         if user_name is None:
             self.user_name = identifier
         else:
@@ -76,14 +77,22 @@ class CatalogDescription(object):
     def create_from_tuple(cata_tuple):
         #print "Warning: Describing a catalog with a tuple is deprecated. " \
         #      "Please create a CatalogDescription instance directly."
-        desc = CatalogDescription(code = cata_tuple[0],
-                                  identifier = cata_tuple[1],
-                                  cata_file_path = cata_tuple[2],
-                                  file_format = cata_tuple[3])
-        
-        if len(cata_tuple) == 5:
-            if cata_tuple[4] == "defaut":
-                desc.default = True
-            else:
-                desc.file_format_in = cata_tuple[4]
+        if cata_tuple[0] == 'TELEMAC':
+            desc = CatalogDescription(code = cata_tuple[0],
+                                      ss_code = cata_tuple[1],
+                                      identifier = cata_tuple[0]+cata_tuple[1],
+                                      cata_file_path = cata_tuple[2],
+                                      file_format = cata_tuple[3],
+                                      file_format_in = cata_tuple[4])
+        else:
+            desc = CatalogDescription(code = cata_tuple[0],
+                                      identifier = cata_tuple[1],
+                                      cata_file_path = cata_tuple[2],
+                                      file_format = cata_tuple[3])
+
+            if len(cata_tuple) == 5:
+                if cata_tuple[4] == "defaut":
+                    desc.default = True
+                else:
+                    desc.file_format_in = cata_tuple[4]
         return desc
index d6b507c04792d761073b6c78183b22c65ecf393b..84ec478f03c0ec2036cb3d90322878edf71d9de6 100644 (file)
@@ -636,9 +636,10 @@ class JDCEditorSsIhm :
         except :
           ok=0
         if not ok :
-           QMessageBox.information( self,
-                      tr("Import texte"),
-                      tr("Impossible d importer le texte"))
+           self.afficheInfos("Impossible d importer le texte")
+           #QMessageBox.information( self,
+           #           tr("Import texte"),
+           #           tr("Impossible d importer le texte"))
         self.tree.racine.build_children()
         return ok
 
index 14b3811a33f02852030f58124b1c71f1478de82e..ba8ea4bb4dae1301e8f30bbc37a311bda65cc14c 100644 (file)
@@ -106,12 +106,14 @@ class ReaderCataCommun(object):
       if self.ssCode is None: liste_cata_possibles = all_cata_list
       else:
           for catalogue in all_cata_list:
-              if catalogue.code == self.code and catalogue.file_format == self.ssCode: liste_cata_possibles.append(catalogue)
+              if catalogue.code == self.code and catalogue.ssCode == self.ssCode:
+                  liste_cata_possibles.append(catalogue)
 
       if len(liste_cata_possibles)==0:
-          QMessageBox.critical(self.QWParent, tr("Import du catalogue"),
-                               tr("Pas de catalogue defini pour le code ") + self.code)
-          self.appliEficas.close()
+          print("Pas de catalogue defini pour le code " + self.code)
+          #QMessageBox.critical(self.QWParent, tr("Import du catalogue"),
+          #                     tr("Pas de catalogue defini pour le code ") + self.code)
+          #self.appliEficas.close()
           if self.appliEficas.salome == 0 : sys.exit(1)
           return
 
@@ -131,9 +133,10 @@ class ReaderCataCommun(object):
                   else            : cata_choice_list.append(cata)
 
           if len(cata_choice_list) == 0:
-              QMessageBox.critical(self.QWParent, tr("Import du catalogue"),
-                                   tr("Aucun catalogue trouve"))
-              self.appliEficas.close()
+              print("Aucun catalogue trouve")
+              #QMessageBox.critical(self.QWParent, tr("Import du catalogue"),
+              #                     tr("Aucun catalogue trouve"))
+              #self.appliEficas.close()
               if self.appliEficas.salome == 0 : sys.exit(1)
 
           elif len(cata_choice_list) == 1:
@@ -153,7 +156,7 @@ class ReaderCataCommun(object):
              print(("Pas de catalogue pour code %s, version %s" %(self.code,self.versionCode)))
              sys.exit(1)
           else :
-             self.appliEficas.close()
+             #self.appliEficas.close()
              return
 
 
@@ -204,7 +207,8 @@ class ReaderCata (ReaderCataCommun):
       self.cata = self.importCata(self.fic_cata)
       self.cata.modeleMetier = modeleMetier
       if not self.cata :
-          QMessageBox.critical( self.QWParent, tr("Import du catalogue"),tr("Impossible d'importer le catalogue ")+ self.fic_cata)
+          print("Impossible d'importer le catalogue "+ self.fic_cata)
+          #QMessageBox.critical( self.QWParent, tr("Import du catalogue"),tr("Impossible d'importer le catalogue ")+ self.fic_cata)
           self.appliEficas.close()
           if self.appliEficas.salome == 0 :
              sys.exit(1)