From 428a4fa383e8da3117f723c6e99699eefff81f02 Mon Sep 17 00:00:00 2001 From: jfa Date: Tue, 31 Jan 2006 12:52:35 +0000 Subject: [PATCH] Debug of DumpStudy() method. --- src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx index b181b0fb2..b3452db04 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx @@ -1265,14 +1265,18 @@ bool SALOMEDSImpl_Study::DumpStudy(const TCollection_AsciiString& thePath, Handle(SALOMEDSImpl_SComponent) sco = itcomponent.Value(); aCompType = sco->ComponentDataType(); //GEOM and MED are independent components - if(aCompType == "GEOM" || aCompType == "MED") aSeq.Prepend(TCollection_ExtendedString(aCompType)); - else aSeq.Append(TCollection_ExtendedString(aCompType)); + if (aCompType == "GEOM" || aCompType == "MED") + aSeq.Prepend(TCollection_ExtendedString(aCompType)); + else + aSeq.Append(TCollection_ExtendedString(aCompType)); } #ifdef WIN32 - TCollection_AsciiString aFileName=thePath+TCollection_AsciiString("\\")+theBaseName+TCollection_AsciiString(".py"); + TCollection_AsciiString aFileName = + thePath + TCollection_AsciiString("\\") + theBaseName + TCollection_AsciiString(".py"); #else - TCollection_AsciiString aFileName=thePath+TCollection_AsciiString("/")+theBaseName+TCollection_AsciiString(".py"); + TCollection_AsciiString aFileName = + thePath + TCollection_AsciiString("/") + theBaseName + TCollection_AsciiString(".py"); #endif //Create a file that will contain a main Study script @@ -1292,7 +1296,8 @@ bool SALOMEDSImpl_Study::DumpStudy(const TCollection_AsciiString& thePath, TCollection_AsciiString aBatchModeScript = "salome"; - //Output to the main Study script required Python modules import, set sys.path and add a creation of the study. + //Output to the main Study script required Python modules import, + //set sys.path and add a creation of the study. fp << GetDumpStudyComment().ToCString() << endl << endl; fp << "import sys" << endl; fp << "import " << aBatchModeScript << "\n" << endl; @@ -1362,9 +1367,9 @@ bool SALOMEDSImpl_Study::DumpStudy(const TCollection_AsciiString& thePath, fp2.open(aFileName.ToCString(), ios::out); #ifdef WIN32 - isOpened = fp.is_open(); + isOpened = fp2.is_open(); #else - isOpened = fp.rdbuf()->is_open(); + isOpened = fp2.rdbuf()->is_open(); #endif if(!isOpened) { @@ -1377,6 +1382,8 @@ bool SALOMEDSImpl_Study::DumpStudy(const TCollection_AsciiString& thePath, fp2 << aStream; fp2.close(); + if (aStream != NULL) delete [] aStream; + //Add to the main script a call to RebuildData of the generated by the component the Python script fp << "import " << aScriptName << endl; fp << aScriptName << ".RebuildData(" << aBatchModeScript << ".myStudy)" << endl; -- 2.39.2