From: adv Date: Mon, 20 Jan 2014 06:05:07 +0000 (+0000) Subject: Additional changes for dump HYDRO to python script. X-Git-Tag: BR_hydro_v_1_0~62 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=71e1222fa3e97b82e37ab7a8a7003db5daef8565;p=modules%2Fhydro.git Additional changes for dump HYDRO to python script. --- 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; }