if (comp->FindAttribute(anAttr, "AttributeName")) {
aName = SALOMEDS::AttributeName::_narrow(anAttr);
QString compName(aName->Value());
- if (compName.compare(STUDY_SUPERVISION) == 0) {
+ // if (compName.compare(STUDY_SUPERVISION) == 0) {
+ if (compName.compare( QAD_Application::getDesktop()->getComponentUserName( "SUPERV" ) ) == 0) {
SALOMEDS::GenericAttribute_var anAttr;
if (obj->FindAttribute(anAttr, "AttributeIOR")) {
SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
// Nom du noeud de supervision dans l'etude
// ----------------------------------------
-#define STUDY_SUPERVISION "Supervision"
+#define STUDY_SUPERVISION "SUPERV"
#define STUDY_PORT_IN "In"
#define STUDY_PORT_OUT "Out"
// To check is Supervision active?
if (myIsLocked) return;
- if (QAD_Application::getDesktop()->getActiveComponent().compare(STUDY_SUPERVISION) !=0) return;
+ // if (QAD_Application::getDesktop()->getActiveComponent().compare(STUDY_SUPERVISION) !=0) return;
+ if (QAD_Application::getDesktop()->getActiveComponent().compare( QAD_Application::getDesktop()->getComponentUserName( "SUPERV" ) ) !=0) return;
checkIsInStudy();
if (e->button() == RightButton) {
aComponent = aBuilder->NewComponent(STUDY_SUPERVISION);
anAttr = aBuilder->FindOrCreateAttribute(aComponent, "AttributeName");
aName = SALOMEDS::AttributeName::_narrow(anAttr);
- aName->SetValue(STUDY_SUPERVISION);
+ aName->SetValue( QAD_Application::getDesktop()->getComponentUserName( "SUPERV" ) );
anAttr = aBuilder->FindOrCreateAttribute(aComponent, "AttributePixMap");
aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
#include "Utils_CorbaException.hxx"
-#define STUDY_SUPERVISION "Supervision"
+#define STUDY_SUPERVISION "SUPERV"
SuperV_Impl::SuperV_Impl( CORBA::ORB_ptr orb ,
PortableServer::POA_ptr poa ,
}
char* SuperV_Impl::ComponentDataType() {
- return(strdup("Supervision"));
+ return(strdup("SUPERV"));
}
char* SuperV_Impl::IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
aFather = aBuilder->NewComponent(STUDY_SUPERVISION);
anAttr = aBuilder->FindOrCreateAttribute(aFather, "AttributeName");
aName = SALOMEDS::AttributeName::_narrow(anAttr);
- aName->SetValue(STUDY_SUPERVISION);
-
+ //NRI aName->SetValue(STUDY_SUPERVISION);
+
+ SALOME_NamingService *NamingService = new SALOME_NamingService(_Orb);
+ CORBA::Object_var objVarN = NamingService->Resolve("/Kernel/ModulCatalog");
+ SALOME_ModuleCatalog::ModuleCatalog_var Catalogue = SALOME_ModuleCatalog::ModuleCatalog::_narrow(objVarN);
+ SALOME_ModuleCatalog::Acomponent_var Comp = Catalogue->GetComponent( STUDY_SUPERVISION );
+ if ( !Comp->_is_nil() ) {
+ aName->SetValue( Comp->componentusername() );
+ }
+
anAttr = aBuilder->FindOrCreateAttribute(aFather, "AttributePixMap");
aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
aPixmap->SetPixMap( "ICON_OBJBROWSER_Supervision" );