bool SUPERVGUI_Main::putDataStudy( SUPERV_Port p, const char* inout ) {
Trace("SUPERVGUI_Main::putDataStudy");
+ bool PublishOtherComponent = false;
+
// static variable to ensure that only one instance (thread) is executing this function
static bool isIn = false;
if (isIn) return true;
if ( !aSStudy ) return false;
aTmpSO = aDriver->PublishInStudy( aSStudy->GetStudy(), aTmpSO, anObject, "" );
aBuilder->Addreference(aSO, _PTR(SObject)(new SALOMEDS_SObject( aTmpSO )) );
+ PublishOtherComponent = true;
}
else { // can't publish object: abort transaction
MESSAGE( "CanPublishInStudy() returned FALSE. ok, AbortCommand.." );
aBuilder->CommitCommand();
else
aBuilder->AbortCommand();
-
- if ( !myThread->running() ) {
+
+ if ( p->State() == SUPERV::ReadyState ) {
SUPERVGUI* aSupMod = SUPERVGUI::Supervision();
- if ( aSupMod )
- aSupMod->updateObjBrowser();
+ if ( aSupMod ) {
+ if ( PublishOtherComponent )
+ dynamic_cast<SalomeApp_Application*>( study->application() )->updateObjectBrowser(true);
+ else
+ aSupMod->updateObjBrowser();
+ }
else MESSAGE("NULL Supervision module!");
}
-
+
isIn = false;
return true;
}
long stamp;
while (notification->Receive(&graph, &node, &type, &message, &sender, &counter, &date, &stamp)) {
- if (isFiltered(graph, node, type, message, sender, counter, date, stamp)) {
+// if (isFiltered(graph, node, type, message, sender, counter, date, stamp)) {
QString mess("");
mess += "NOTIF: "; mess += graph;
mess += " / " ; mess += node;
mess += " / " ; mess += type;
mess += " / " ; mess += message;
getMessage()->putMessage(mess.latin1());
- };
+// };
};
}
// blocking function of Engine. Return from there only after anEvent happens on node aNode
myMain->getDataflow()->Event(aNode, aEvent, aState);
+ // in case node "said" something during changing state through notification mechanism - output it
+ myMain->syncNotification();
+
// "kill" or undefined event came
if (( aEvent == SUPERV::UndefinedEvent && aState == SUPERV::UndefinedState ) ||
( aEvent == SUPERV::NoEvent && aState == SUPERV::NoState ) ||