]> SALOME platform Git repositories - tools/eficas.git/commitdiff
Salome HOME
ajout de unit pour les includes
authorPascale Noyret <pascale.noyret@edf.fr>
Mon, 29 Oct 2007 12:44:14 +0000 (12:44 +0000)
committerPascale Noyret <pascale.noyret@edf.fr>
Mon, 29 Oct 2007 12:44:14 +0000 (12:44 +0000)
InterfaceQT/editor.py

index a1a079fa3769e92bcb82e51ceaf1d0f626f75693..f2031a85236bb704c4b179244526cab352b8cd2d 100644 (file)
@@ -30,8 +30,8 @@ class JDCEditor(QSplitter):
        Editeur de jdc
     """        
 
-    def __init__(self,fn = None, jdc = None ,parent=None, editor = None):          
-    #-------------------------------------------------------------------#
+    def __init__(self,fn = None, jdc = None ,parent=None, editor = None, units = None):          
+    #--------------------------------------------------------------------------------#
 
         QSplitter.__init__(self, parent,'')
         
@@ -79,6 +79,11 @@ class JDCEditor(QSplitter):
             self.fileInfo.setCaching(0)
             if editor is None:
                 self.jdc = self.readFile(self.fileName)
+                print "uuuuuuuuuuuuuuuuuuuuuuuuuuuu"
+                print self.fileName
+                if units is not None:
+                   self.jdc.recorded_units=units
+                   self.jdc.old_recorded_units=units
             else:
                 self.top            = editor.top
                 self.code           = editor.code
@@ -96,7 +101,7 @@ class JDCEditor(QSplitter):
             self.jdc = editor.jdc            
         else: 
             if not self.jdc:                   #  nouveau jdc
-                self.jdc = self._newJDC()
+                self.jdc = self._newJDC(units=units)
         
         if self.jdc:            
             self.jdc.appli = self
@@ -170,9 +175,9 @@ class JDCEditor(QSplitter):
         self.setCaption(cap)
         self.emit(PYSIGNAL('captionChanged'), (cap, self))
         
-    #-------------------#
-    def _newJDC( self ):        
-    #-------------------#
+    #--------------------------------#
+    def _newJDC( self ,units = None):        
+    #--------------------------------#
         """
         Initialise un nouveau JDC vierge
         """
@@ -183,6 +188,9 @@ class JDCEditor(QSplitter):
                                          cata_ord_dico=self.readercata.cata_ordonne_dico,
                                          rep_mat=self.CONFIGURATION.rep_mat
                                         )                         
+        if units is not None:
+           jdc.recorded_units=units
+           jdc.old_recorded_units=units
         jdc.analyse()        
         return jdc
         
@@ -615,9 +623,6 @@ class JDCEditor(QSplitter):
         """
         return self.saveFile(1, path)
 
-
-
-
    
 if __name__=='__main__':    
     if hasattr(prefs,'encoding'):