#include <boost/shared_ptr.hpp>
using namespace boost;
+// mkr : PAL8150
+#define SYNCPUTINSTUDY(NodesName) \
+ for ( int n = 0; n < nodes->NodesName.length(); n++ ) { \
+ SUPERV_CNode aCNode = SUPERV::CNode::_narrow(nodes->NodesName[n]); \
+ SUPERV_Ports aPortList = aCNode->Ports(); \
+ for (int p = 0; p < aPortList->length(); p++) { \
+ SUPERV::Port_ptr aPort = aPortList[p].in(); \
+ if ( !aPort->IsInput() && !aPort->IsGate() ) { \
+ bool aInStudy = dynamic_cast<SUPERVGUI_CanvasPortOut*>( aMain->getCanvas()->getPort(aPort) )->isInStudy(); \
+ dynamic_cast<SUPERVGUI_CanvasPortOut*>( getCanvas()->getPort( getDataflow()->Node(aCNode->Name())->Port(aPort->Name()) ) )->setStudyState(aInStudy); \
+ } \
+ } \
+ }
+
SUPERVGUI_Main::SUPERVGUI_Main( SUPERVGraph_ViewFrame* theParent,
SUIT_Desktop* theDesktop, SUPERV_Graph theDataFlow )
: SUPERVGraph_View(theParent),
} else {
init(theDesktop);
}
+
+ syncPutInStudy(); // mkr : PAL8150
+
// mkr : IPAL11362
connect(this, SIGNAL(EventToSync()), this, SLOT(onObjectCreatedDeleted()));
}
}
}
+// 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;
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
void SUPERVGUI_Main::run( const bool andSuspend ) {
Trace("SUPERVGUI_Main::run");
if ( SUPERV_isNull(dataflow) )
virtual void resizeView( QResizeEvent* theEvent );
+ // mkr : PAL8150
+ void setRunTime( QDateTime theRunTime ) { myRunTime = theRunTime; }
+ QDateTime getRunTime() const { return myRunTime; }
+
signals:
void KillMyThread(bool theValue);
void EventToSync(); // mkr : IPAL11362
void onShowToolbar();
void onObjectCreatedDeleted(); // mkr : PAL8237
+ void onPutInStudy( QString* ); // mkr : PAL8150
private slots:
void chooseData(QListViewItem* item);
void syncNotification();
bool isFiltered(char* graph, char* node, char* type, char* message, char* sender, long counter, char* date, long stamp);
void closeEvent(QCloseEvent*);
-
+ void syncPutInStudy(); // mkr : PAL8150
+
SUPERV_Graph dataflow;
QMap<QString, SUIT_ViewWindow*> mySubGraphs;