From 71e1222fa3e97b82e37ab7a8a7003db5daef8565 Mon Sep 17 00:00:00 2001 From: adv Date: Mon, 20 Jan 2014 06:05:07 +0000 Subject: [PATCH] Additional changes for dump HYDRO to python script. --- src/HYDROData/HYDROData_Document.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/HYDROData/HYDROData_Document.cxx b/src/HYDROData/HYDROData_Document.cxx index 4c2fb49f..c237aa93 100644 --- a/src/HYDROData/HYDROData_Document.cxx +++ b/src/HYDROData/HYDROData_Document.cxx @@ -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; } -- 2.39.2