play_nam = "play"
gdb_session_nam = "gdb_session"
ddd_session_nam = "ddd_session"
+valgrind_session_nam = "valgrind_session"
shutdown_servers_nam = "shutdown_servers"
# values in XML configuration file giving specific module parameters (<module_name> section)
dest="ddd_session", default=False,
help=help_str)
+
+ # valgrind session
+ help_str = "Launch session with valgrind $VALGRIND_OPTIONS"
+ o_valgrind = optparse.Option("--valgrind-session",
+ action="store_true",
+ dest="valgrind_session", default=False,
+ help=help_str)
+
# shutdown-servers. Default: False.
help_str = "1 to shutdown standalone servers when leaving python interpreter, "
help_str += "0 to keep the standalone servers as daemon [default]. "
o_play, # Reproducing test script with help of TestRecorder
o_gdb,
o_ddd,
+ o_valgrind,
o_shutdown,
]
if cmd_opts.ddd_session is not None:
args[ddd_session_nam] = cmd_opts.ddd_session
+ # valgrind session
+ if cmd_opts.valgrind_session is not None:
+ args[valgrind_session_nam] = cmd_opts.valgrind_session
+
# Shutdown servers
if cmd_opts.shutdown_servers is None:
args[shutdown_servers_nam] = 0
pass
pass
+ if self.args["valgrind_session"]:
+ l = ["valgrind"]
+ val = os.getenv("VALGRIND_OPTIONS")
+ if val:
+ l += val.split()
+ pass
+ self.CMD = l + self.CMD
+ pass
+
# ---
class LauncherServer(Server):
\param theObserver
*/
- void attach(in SALOME::Observer theObserver);
+ void attach(in SALOME::Observer theObserver, in boolean modify);
};
//==========================================================================
ENDIF(KERNEL_ROOT_DIR)
''')
pass
+ if self.module == "hxx2salome":
+ key = "_SRC"
+ if self.the_root[-len(key):] != key:
+ msg = "Source dir must finished with %s !"%(key)
+ raise Exception(msg)
+ hxxmodule = self.the_root[:-len(key)]
+ from os.path import basename
+ hxxmodule = basename(hxxmodule)
+ hxxmodule = hxxmodule.lower()
+ self.hxxmodule = hxxmodule
+ newlines.append(r'''
+ SET(HXXCPP_ROOT_DIR $ENV{%sCPP_ROOT_DIR})
+ SET(AM_CPPFLAGS ${AM_CPPFLAGS} -I${HXXCPP_ROOT_DIR}/include)
+ SET(AM_CXXFLAGS ${AM_CXXFLAGS} -I${HXXCPP_ROOT_DIR}/include)
+ SET(LDADD ${LDADD} -L${HXXCPP_ROOT_DIR}/lib)
+ '''%(hxxmodule.upper()))
+ pass
pass
# --
return
# --
# Treat the install targets
# --
+ resdir = self.module
+ if resdir == "hxx2salome":
+ resdir = self.hxxmodule
+ pass
d = {
"salomeadmux_DATA" : "salome_adm/unix",
"dist_salomeadmux_DATA" : "salome_adm/unix",
"dist_admlocal_cmake_DATA" : "adm_local/cmake_files",
"salomeinclude_DATA" : "include/salome",
"salomeinclude_HEADERS" : "include/salome",
- "dist_salomeres_DATA" : "share/salome/resources/%s"%(self.module),
- "nodist_salomeres_DATA" : "share/salome/resources/%s"%(self.module),
- "nodist_salomeres_SCRIPTS" : "share/salome/resources/%s"%(self.module),
+ "dist_salomeres_DATA" : "share/salome/resources/%s"%(resdir),
+ "nodist_salomeres_DATA" : "share/salome/resources/%s"%(resdir),
+ "nodist_salomeres_SCRIPTS" : "share/salome/resources/%s"%(resdir),
"dist_salomescript_SCRIPTS" : "bin/salome",
"dist_salomescript_DATA" : "bin/salome",
"dist_salomescript_PYTHON" : "bin/salome",
''')
# --
newlines.append(r'''
- SET(libs ${PLATFORM_LIBADD} ${PLATFORM_LDFLAGS} ${${amname}_LIBADD} ${${amname}_LDADD} ${${amname}_LDFLAGS})
+ SET(libs ${PLATFORM_LIBADD} ${PLATFORM_LDFLAGS} ${LDADD} ${${amname}_LIBADD} ${${amname}_LDADD} ${${amname}_LDFLAGS})
FOREACH(lib SALOMEBasics SalomeBatch)
IF(name STREQUAL lib)
SET(libs ${libs} ${PTHREAD_LIBS})
ENDIF(name STREQUAL lib)
ENDFOREACH(lib SALOMEBasics SalomeBatch)
''')
- if key == "bin_PROGRAMS":
- newlines.append(r'''
- SET(libs ${libs} ${LDADD})
- ''')
- pass
# --
newlines.append(r'''
FOREACH(lib ${libs})
from os import getcwd
the_root = getcwd()
#
+ nok = 0
+ #
from os import walk
for root, dirs, files in walk(the_root):
# --
from sys import stdout
for f in files:
if f in ["Makefile.am", "Makefile.am.cmake"]:
- stdout.write("Scanning %s %s ..."%(root, f))
- stdout.flush()
convertAmFile(the_root, root, dirs, files, f, module)
- stdout.write(" done.\n")
+ nok += 1
pass
pass
pass
#
+ if nok:
+ if nok == 1:
+ msg = "%s file has been converted to cmake"%(nok)
+ else:
+ msg = "%s files have been converted to cmake"%(nok)
+ pass
+ stdout.write(msg)
+ stdout.write("\n")
+ stdout.flush()
+ pass
pass
l.append((subname,submod))
return l
-def import_hook(name, globals=None, locals=None, fromlist=None, *args):
+def import_hook(name, globals=None, locals=None, fromlist=None, *args, **kwds):
""" Import replacement for sharing modules among multiple interpreters
Mostly update sys.modules before doing real import
"""
#print "import_hook",name,fromlist
m=get_shared_imported(name,fromlist)
- module= original_import(name, globals, locals, fromlist, *args)
+ module= original_import(name, globals, locals, fromlist, *args, **kwds)
if fromlist:
#when fromlist is specified, module is the real module
return _PTR(AttributeParameter)(AP);
}
-void SALOMEDS_Study::attach(SALOME::Observer_ptr theObserver)
+void SALOMEDS_Study::attach(SALOME::Observer_ptr theObserver,bool modify)
{
if(CORBA::is_nil(_corba_impl)) GetStudy(); //If CORBA implementation is null then retrieve it
- _corba_impl->attach(theObserver);
+ _corba_impl->attach(theObserver,modify);
}
virtual bool RenameVariable(const std::string& theVarName, const std::string& theNewVarName);
virtual bool IsVariableUsed(const std::string& theVarName);
virtual std::vector< std::vector<std::string> > ParseVariables(const std::string& theVars);
- virtual void attach(SALOME::Observer_ptr theObserver);
+ virtual void attach(SALOME::Observer_ptr theObserver,bool modify);
std::string ConvertObjectToIOR(CORBA::Object_ptr theObject);
CORBA::Object_ptr ConvertIORToObject(const std::string& theIOR);
virtual bool addSO_Notification(const SALOMEDSImpl_SObject& theSObject)
{
- //MESSAGE("Notification ADD called")
- CORBA::String_var event="ADD";
- CORBA::String_var anID=theSObject.GetID().c_str();
+ std::string anID=theSObject.GetID();
+ const char* cID=anID.c_str();
for (ObsListIter it (myObservers.begin()); it != myObservers.end(); ++it)
{
- (*it)->notifyObserver(anID,event);
+ it->first->notifyObserver(cID,"ADD");
}
return true; // NGE return always true but can be modified if needed
}
virtual bool removeSO_Notification(const SALOMEDSImpl_SObject& theSObject)
{
- //MESSAGE("Notification REMOVE called")
- CORBA::String_var event="REMOVE";
- CORBA::String_var anID=theSObject.GetID().c_str();
+ std::string anID=theSObject.GetID();
+ const char* cID=anID.c_str();
for (ObsListIter it (myObservers.begin()); it != myObservers.end(); ++it)
{
- (*it)->notifyObserver(anID,event);
+ it->first->notifyObserver(cID,"REMOVE");
}
return true; // NGE return always true but can be modified if needed
}
virtual bool modifySO_Notification(const SALOMEDSImpl_SObject& theSObject)
{
- //MESSAGE("Notification MODIFY called")
- CORBA::String_var event="MODIFY";
- CORBA::String_var anID=theSObject.GetID().c_str();
for (ObsListIter it (myObservers.begin()); it != myObservers.end(); ++it)
{
- (*it)->notifyObserver(anID,event);
+ if(it->second)
+ {
+ std::string anID=theSObject.GetID();
+ const char* cID=anID.c_str();
+ it->first->notifyObserver(cID,"MODIFY");
+ }
}
return true; // NGE return always true but can be modified if needed
}
*/
//============================================================================
- virtual void attach(SALOME::Observer_ptr theObs)
+ virtual void attach(SALOME::Observer_ptr theObs, bool modify)
{
- myObservers.push_back(SALOME::Observer::_duplicate(theObs));
+ myObservers.push_back(std::pair< SALOME::Observer_var, bool > (SALOME::Observer::_duplicate(theObs),modify));
}
private:
- typedef std::list<SALOME::Observer_var> ObsList;
+ typedef std::list< std::pair< SALOME::Observer_var, bool > > ObsList;
typedef ObsList::iterator ObsListIter;
ObsList myObservers;
};
* Purpose : This function attach an observer to the study
*/
//============================================================================
-void SALOMEDS_Study_i::attach(SALOME::Observer_ptr theObs)
+void SALOMEDS_Study_i::attach(SALOME::Observer_ptr theObs,CORBA::Boolean modify)
{
- _notifier->attach(theObs);
+ _notifier->attach(theObs,modify);
}
//===========================================================================
virtual CORBA::LongLong GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal);
- virtual void attach(SALOME::Observer_ptr theObs);
+ virtual void attach(SALOME::Observer_ptr theObs, CORBA::Boolean modify);
};
#endif
virtual std::vector< std::vector<std::string> > ParseVariables(const std::string& theVars) = 0;
- virtual void attach(SALOME::Observer_ptr theObserver) = 0;
+ virtual void attach(SALOME::Observer_ptr theObserver,bool modify) = 0;
};
if(aLabel.IsNull()) return;
SALOMEDSImpl_Study* aStudy = SALOMEDSImpl_Study::GetStudy(aLabel);
- //if(aStudy) aStudy->modifySO_Notification(GetSObject());
+ if(aStudy) aStudy->modifySO_Notification(GetSObject());
if(aStudy) aStudy->Modify();
}
//============================================================================
bool SALOMEDSImpl_Study::addSO_Notification (const SALOMEDSImpl_SObject& theSObject)
{
- START_TIMING;
+ //START_TIMING;
bool ret= _notifier->addSO_Notification(theSObject);
- END_TIMING(100);
+ //END_TIMING(100);
return ret;
}
DF_Label NL = L.NewChild();
- SALOMEDSImpl_AttributeComment::Set(NL, DataType);
-
SALOMEDSImpl_SComponent so = _study->GetSComponent (NL);
if(_callbackOnAdd) _callbackOnAdd->OnAddSObject(so);
_study->addSO_Notification(so);
+ SALOMEDSImpl_AttributeComment::Set(NL, DataType);
+
_doc->SetModified(true);
return so;