]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Additional changes for dump HYDRO to python script.
authoradv <adv@opencascade.com>
Mon, 20 Jan 2014 06:05:07 +0000 (06:05 +0000)
committeradv <adv@opencascade.com>
Mon, 20 Jan 2014 06:05:07 +0000 (06:05 +0000)
src/HYDROData/HYDROData_Document.cxx

index 4c2fb49f33ef636d89915bd5d66f183fd7f80325..c237aa93ce74ee8bd42d403ae2cd96fc8abab4df 100644 (file)
@@ -15,7 +15,7 @@
 IMPLEMENT_STANDARD_HANDLE(HYDROData_Document,MMgt_TShared)
 IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Document,MMgt_TShared)
 
-#define PYTHON_DOC_NAME "doc"
+#define PYTHON_DOC_NAME "hydro_doc"
 
 static const int UNDO_LIMIT = 10; // number of possible undo operations in the module
 
@@ -212,9 +212,11 @@ QString HYDROData_Document::GetDocPyName() const
 {
   QString aDocName = PYTHON_DOC_NAME;
   
+  /*
   int aDocId = 1;
   if ( DocumentId( this, aDocId ) )
     aDocName += "_" + QString::number( aDocId );
+  */
   
   return aDocName;
 }
@@ -235,8 +237,9 @@ QStringList HYDROData_Document::DumpToPython( MapOfTreatedObjects& theTreatedObj
   aResScript << QString( "from HYDROPy import *" );
   aResScript << QString( "from PyQt4.QtCore import *" );
   aResScript << QString( "from PyQt4.QtGui import *" );
+  aResScript << QString( "import salome" );
   aResScript << QString( "" );
-  aResScript << QString( "%1 = HYDROData_Document.Document( %2 );" ).arg( aDocName ).arg( aDocId );
+  aResScript << QString( "%1 = HYDROData_Document.Document( salome.sg.getActiveStudyId() );" ).arg( aDocName );
 
   return aResScript;
 }