void UndoPostponed(in long theWay);
- boolean DumpStudy(in string thePath, in string theBaseName, in boolean isPublished);
+ boolean DumpStudy(in string thePath, in string theBaseName, in boolean isPublished, in string thePrefix);
/*!
Returns an AttributeParameter used to store common parameters for given %theSavePoint.
_AP_LISTS_LIST_ = "AP_LISTS_LIST"
_AP_ENTRIES_LIST_ = "AP_ENTRIES_LIST"
_AP_PROPERTIES_LIST_ = "AP_PROPERTIES_LIST"
+_AP_DUMP_PYTHON_ = "AP_DUMP_PYTHON"
vp_session = None
v.append(part2)
return v
+ def setDumpPython(self, isDumping):
+ """Enables/Disables the dumping to Python"""
+ if self._ap is None: return
+ _ap.SetBool(_AP_DUMP_PYTHON_, isDumping)
+ pass
+
+ def isDumpPython(self):
+ """Returns whether there is the dumping to Python"""
+ if self._ap is None: return 0
+ if self._ap.IsSet(_AP_DUMP_PYTHON_, PT_BOOLEAN) == 0: return 0
+ return self._ap.GetBool(_AP_DUMP_PYTHON_)
+
pass
#define _AP_LISTS_LIST_ "AP_LISTS_LIST"
#define _AP_ENTRIES_LIST_ "AP_ENTRIES_LIST"
#define _AP_PROPERTIES_LIST_ "AP_PROPERTIES_LIST"
-
+#define _AP_DUMP_PYTHON_ "AP_DUMP_PYTHON"
/*!
Constructor
v.push_back(part2.ToCString());
return v;
}
+
+void SALOMEDS_IParameters::setDumpPython(bool isDumping)
+{
+ if(!_ap) return;
+ _ap->SetBool(_AP_DUMP_PYTHON_, isDumping);
+}
+
+bool SALOMEDS_IParameters::isDumpPython()
+{
+ if(!_ap) return false;
+ if(!_ap->IsSet(_AP_DUMP_PYTHON_, PT_BOOLEAN)) return false;
+ return (bool)_ap->GetBool(_AP_DUMP_PYTHON_);
+}
std::vector<std::string> parseValue(const std::string& value, const char separator, bool fromEnd = true);
+ /*!
+ Enables/Disables the dumping visual parameters
+ */
+ void setDumpPython(bool isDumping);
+
+ /*!
+ Returns whether there is the dumping visual parameters
+ */
+ bool isDumpPython();
+
+
private:
_PTR(AttributeParameter) _ap;
else _corba_impl->EnableUseCaseAutoFilling(isEnabled);
}
-bool SALOMEDS_Study::DumpStudy(const std::string& thePath, const std::string& theBaseName, bool isPublished)
+bool SALOMEDS_Study::DumpStudy(const string& thePath, const string& theBaseName, bool isPublished, const string& thePrefix)
{
//SRN: Pure CORBA DumpStudy as it does more cleaning than the local one
- bool ret = _corba_impl->DumpStudy((char*)thePath.c_str(), (char*)theBaseName.c_str(), isPublished);
+ bool ret = _corba_impl->DumpStudy(thePath.c_str(), theBaseName.c_str(), isPublished, thePrefix.c_str());
return ret;
}
virtual _PTR(UseCaseBuilder) GetUseCaseBuilder();
virtual void Close();
virtual void EnableUseCaseAutoFilling(bool isEnabled);
- virtual bool DumpStudy(const std::string& thePath, const std::string& theBaseName, bool isPublished);
+ virtual bool DumpStudy(const std::string& thePath,const std::string& theBaseName,bool isPublished,const std::string& thePrefix);
virtual _PTR(AttributeParameter) GetCommonParameters(const std::string& theID, int theSavePoint);
virtual _PTR(AttributeParameter) GetModuleParameters(const std::string& theID,
const std::string& theModuleName, int theSavePoint);
* Purpose :
*/
//============================================================================
-CORBA::Boolean SALOMEDS_Study_i::DumpStudy(const char* thePath, const char* theBaseName, CORBA::Boolean isPublished)
+CORBA::Boolean SALOMEDS_Study_i::DumpStudy(const char* thePath,
+ const char* theBaseName,
+ CORBA::Boolean isPublished,
+ const char* thePrefix)
{
SALOMEDS::Locker lock;
- TCollection_AsciiString aPath((char*)thePath), aBaseName((char*)theBaseName);
+ TCollection_AsciiString aPath((char*)thePath), aBaseName((char*)theBaseName), aPrefix((char*)thePrefix);
SALOMEDS_DriverFactory_i* factory = new SALOMEDS_DriverFactory_i(_orb);
- CORBA::Boolean ret = _impl->DumpStudy(aPath, aBaseName, isPublished, factory);
+ CORBA::Boolean ret = _impl->DumpStudy(aPath, aBaseName, isPublished, factory, aPrefix);
delete factory;
return ret;
}
const char* theModuleName,
CORBA::Long theSavePoint);
- virtual CORBA::Boolean DumpStudy(const char* thePath, const char* theBaseName, CORBA::Boolean isPublished);
+ virtual CORBA::Boolean DumpStudy(const char* thePath, const char* theBaseName, CORBA::Boolean isPublished, const char* thePrefix);
virtual Handle(SALOMEDSImpl_Study) GetImpl() { return _impl; }
virtual _PTR(UseCaseBuilder) GetUseCaseBuilder() = 0;
virtual void Close() = 0;
virtual void EnableUseCaseAutoFilling(bool isEnabled) = 0;
- virtual bool DumpStudy(const std::string& thePath, const std::string& theBaseName, bool isPublished) = 0;
+ virtual bool DumpStudy(const std::string& thePath,
+ const std::string& theBaseName,
+ bool isPublished,
+ const std::string& thePrefix) = 0;
virtual _PTR(AttributeParameter) GetCommonParameters(const std::string& theID, int theSavePoint) = 0;
virtual _PTR(AttributeParameter) GetModuleParameters(const std::string& theID,
const std::string& theModuleName, int theSavePoint) = 0;
bool SALOMEDSImpl_Study::DumpStudy(const TCollection_AsciiString& thePath,
const TCollection_AsciiString& theBaseName,
bool isPublished,
- SALOMEDSImpl_DriverFactory* theFactory)
+ SALOMEDSImpl_DriverFactory* theFactory,
+ const TCollection_AsciiString& thePrefix)
{
_errorCode = "";
fp << "import " << aBatchModeScript << "\n" << endl;
fp << "sys.path.insert( 0, \'" << thePath << "\')\n" << endl;
+ //Output the prefix if there is any
+ if(thePrefix.Length() > 0) {
+ fp << thePrefix;
+ fp << "\n" << endl;
+ }
+
Handle(TColStd_HSequenceOfAsciiString) aSeqOfFileNames = new TColStd_HSequenceOfAsciiString;
//Iterate all components and create the componponents specific scripts.
Standard_EXPORT virtual bool HasCurrentContext() { return !_current.IsNull(); }
Standard_EXPORT virtual bool DumpStudy(const TCollection_AsciiString& thePath,
- const TCollection_AsciiString& theBaseName,
- bool isPublished,
- SALOMEDSImpl_DriverFactory* theFactory);
+ const TCollection_AsciiString& theBaseName,
+ bool isPublished,
+ SALOMEDSImpl_DriverFactory* theFactory,
+ const TCollection_AsciiString& thePrefix = "");
Standard_EXPORT static TCollection_AsciiString GetDumpStudyComment(const char* theComponentName = 0);