+// mkr : PAL8150 : synchronize many views of the same dataflow ("Put In Study"/"Not In Study" operation)
+void SUPERVGUI_Main::onPutInStudy( QString* theNodePortName )
+{
+ if ( study ) {
+ if ( STD_Application* app = dynamic_cast<STD_Application*>( study->application() ) ) {
+ ViewManagerList aVMList;
+ app->viewManagers( SUPERVGraph_Viewer::Type(), aVMList );
+ SUIT_ViewManager* aVM;
+ for ( aVM = aVMList.first(); aVM; aVM = aVMList.next() ) {
+ QPtrVector<SUIT_ViewWindow> aVWList = aVM->getViews();
+ for ( int i = 0; i < aVWList.count(); i++ ) {
+ SUPERVGraph_ViewFrame* aVW = dynamic_cast<SUPERVGraph_ViewFrame*>( aVWList[i] );
+ QObjectList* aMainList = aVW->queryList("SUPERVGUI_Main");
+ if ( aMainList->count() == 1 ) {
+ SUPERVGUI_Main* aMain = dynamic_cast<SUPERVGUI_Main*>( aMainList->first() );
+ if ( aMain )
+ if ( !QString(aMain->getDataflow()->getIOR()).compare(getDataflow()->getIOR()) // equal dataflows
+ &&
+ aMain != this ) { // not equal mains
+ QString aNodeName = theNodePortName->left( theNodePortName->find('_') );
+ QString aPortName = theNodePortName->right( theNodePortName->length() - theNodePortName->find('_') - 1 );
+ bool anIsInStudy = dynamic_cast<SUPERVGUI_CanvasPortOut*>( getCanvas()->getPort( getDataflow()->Node( aNodeName )->GetOutPort( aPortName ) ) )->isInStudy();
+ dynamic_cast<SUPERVGUI_CanvasPortOut*>( aMain->getCanvas()->getPort( aMain->getDataflow()->Node( aNodeName )->GetOutPort( aPortName ) ) )->setStudyState( anIsInStudy );
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+// mkr : PAL8150 : synchronize many views of the same dataflow ("Display" operation for dataflow)
+void SUPERVGUI_Main::syncPutInStudy()
+{
+ if ( study ) {
+ if ( STD_Application* app = dynamic_cast<STD_Application*>( study->application() ) ) {
+ ViewManagerList aVMList;
+ app->viewManagers( SUPERVGraph_Viewer::Type(), aVMList );
+ SUIT_ViewManager* aVM;
+ for ( aVM = aVMList.first(); aVM; aVM = aVMList.next() ) {
+ QPtrVector<SUIT_ViewWindow> aVWList = aVM->getViews();
+ for ( int i = 0; i < aVWList.count(); i++ ) {
+ SUPERVGraph_ViewFrame* aVW = dynamic_cast<SUPERVGraph_ViewFrame*>( aVWList[i] );
+ QObjectList* aMainList = aVW->queryList("SUPERVGUI_Main");
+ if ( aMainList->count() == 1 ) {
+ SUPERVGUI_Main* aMain = dynamic_cast<SUPERVGUI_Main*>( aMainList->first() );
+ if ( aMain )
+ if ( !CORBA::is_nil( aMain->getDataflow() )
+ &&
+ !QString(aMain->getDataflow()->getIOR()).compare(getDataflow()->getIOR()) // equal dataflows
+ &&
+ aMain != this ) { // not equal mains
+
+ // check "myInStudy" field of output ports of original main (i.e. this main)
+ // and synchronize this property for nodes' output ports of dublicate main (i.e. of aMain)
+ SUPERV_Nodes nodes = aMain->getDataflow()->Nodes();
+
+ SYNCPUTINSTUDY(CNodes);
+ SYNCPUTINSTUDY(FNodes);
+ SYNCPUTINSTUDY(INodes);
+ SYNCPUTINSTUDY(GNodes);
+ SYNCPUTINSTUDY(LNodes);
+ SYNCPUTINSTUDY(ELNodes);
+ SYNCPUTINSTUDY(SNodes);
+ SYNCPUTINSTUDY(ESNodes);
+ SYNCPUTINSTUDY(Graphs);
+
+ setRunTime( aMain->getRunTime() );
+
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+}
+