mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-18 07:00:33 +05:00
0021375: EDF 1671 SMESH: Dump study of current state
+ virtual void SetOption(const char*, const char*); + virtual char* GetOption(const char*); + bool myIsHistoricalPythonDump;
This commit is contained in:
parent
f6cd6404d7
commit
2978b5432c
@ -283,6 +283,7 @@ SMESH_Gen_i::SMESH_Gen_i( CORBA::ORB_ptr orb,
|
||||
myIsEmbeddedMode = false;
|
||||
myShapeReader = NULL; // shape reader
|
||||
mySMESHGen = this;
|
||||
myIsHistoricalPythonDump = true;
|
||||
|
||||
// set it in standalone mode only
|
||||
//OSD::SetSignal( true );
|
||||
@ -805,6 +806,46 @@ void SMESH_Gen_i::SetDefaultNbSegments(CORBA::Long theNbSegments)
|
||||
THROW_SALOME_CORBA_EXCEPTION( "non-positive number of segments", SALOME::BAD_PARAM );
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
/*!
|
||||
Set an option value
|
||||
*/
|
||||
//=============================================================================
|
||||
|
||||
void SMESH_Gen_i::SetOption(const char* name, const char* value)
|
||||
{
|
||||
if ( name && value &&
|
||||
strcmp(name, "historical_python_dump") == 0 &&
|
||||
strlen( value ) > 0 )
|
||||
{
|
||||
myIsHistoricalPythonDump = ( value[0] == '1' || toupper(value[0]) == 'T' ); // 1 || true
|
||||
|
||||
// update preferences in case if SetOption() is invoked from python console
|
||||
CORBA::Object_var obj = SMESH_Gen_i::GetNS()->Resolve( "/Kernel/Session" );
|
||||
SALOME::Session_var session = SALOME::Session::_narrow( obj );
|
||||
if ( !CORBA::is_nil( session ) ) {
|
||||
string msg("preferences:SMESH:historical_python_dump:");
|
||||
msg += myIsHistoricalPythonDump ? "true" : "false";
|
||||
session->emitMessageOneWay(msg.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
/*!
|
||||
Return an option value
|
||||
*/
|
||||
//=============================================================================
|
||||
|
||||
char* SMESH_Gen_i::GetOption(const char* name)
|
||||
{
|
||||
if ( name && strcmp(name, "historical_python_dump") == 0 )
|
||||
{
|
||||
return CORBA::string_dup( myIsHistoricalPythonDump ? "true" : "false" );
|
||||
}
|
||||
return CORBA::string_dup( "" );
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
/*!
|
||||
* SMESH_Gen_i::CreateMesh
|
||||
@ -3793,6 +3834,8 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
|
||||
return false;
|
||||
}
|
||||
|
||||
TPythonDump pd; // prevent dump during loading
|
||||
|
||||
DriverMED_R_SMESHDS_Mesh myReader;
|
||||
myReader.SetFile( meshfile.ToCString() );
|
||||
|
||||
@ -4772,6 +4815,8 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
|
||||
if ( !isMultiFile )
|
||||
SALOMEDS_Tool::RemoveTemporaryFiles( tmpDir.ToCString(), aFileSeq.in(), true );
|
||||
|
||||
pd << ""; // prevent optimizing pd out
|
||||
|
||||
INFOS( "SMESH_Gen_i::Load completed" );
|
||||
return true;
|
||||
}
|
||||
|
@ -213,6 +213,15 @@ public:
|
||||
*/
|
||||
void SetDefaultNbSegments(CORBA::Long theNbSegments) throw ( SALOME::SALOME_Exception );
|
||||
|
||||
/*!
|
||||
Set an option value
|
||||
*/
|
||||
virtual void SetOption(const char*, const char*);
|
||||
/*!
|
||||
Return an option value
|
||||
*/
|
||||
virtual char* GetOption(const char*);
|
||||
|
||||
// Create empty mesh on a shape
|
||||
SMESH::SMESH_Mesh_ptr CreateMesh( GEOM::GEOM_Object_ptr theShapeObject )
|
||||
throw ( SALOME::SALOME_Exception );
|
||||
@ -439,6 +448,7 @@ public:
|
||||
Resource_DataMapOfAsciiStringAsciiString& theNames,
|
||||
bool isPublished,
|
||||
bool isMultiFile,
|
||||
bool isHistoricalDump,
|
||||
bool& aValidScript,
|
||||
const TCollection_AsciiString& theSavedTrace);
|
||||
|
||||
@ -580,6 +590,7 @@ private:
|
||||
|
||||
// Dump Python: trace of API methods calls
|
||||
std::map < int, Handle(TColStd_HSequenceOfAsciiString) > myPythonScripts;
|
||||
bool myIsHistoricalPythonDump;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user