Salome HOME
A new dialog class for edition of Ports of an InLine nodes is introduced. This funct...
[modules/superv.git] / src / SUPERVGUI / SUPERVGUI_Main.h
index 08692040f8072f66d921cc84aba2bdc8f257d265..eae98b578684d77ae862b00337cd7c249dddf07e 100644 (file)
@@ -34,6 +34,8 @@
 #include "SUPERVGUI_Graph.h"
 #include "QAD_Desktop.h"
 #include "SUPERVGUI_Port.h"
+#include "SUPERVGUI_Canvas.h"
+#include "SUPERVGUI_CanvasView.h"
 
 #include <qobject.h>
 #include <qapplication.h>
@@ -49,8 +51,8 @@ class SUPERVGUI_Main: public SUPERVGraph_View {
   Q_OBJECT
 
   public:
-    SUPERVGUI_Main(SUPERVGraph_ViewFrame*, QAD_Desktop*, bool fromIOR);
-    SUPERVGUI_Main(SUPERVGraph_ViewFrame*, QAD_Desktop*, bool isModify, const char* filename);
+    //SUPERVGUI_Main(SUPERVGraph_ViewFrame*, QAD_Desktop*, bool fromIOR);
+    //SUPERVGUI_Main(SUPERVGraph_ViewFrame*, QAD_Desktop*, bool isModify, const char* filename);
     SUPERVGUI_Main(SUPERVGraph_ViewFrame*, QAD_Desktop*, SUPERV_Graph);
     virtual ~SUPERVGUI_Main();
 
@@ -59,13 +61,15 @@ class SUPERVGUI_Main: public SUPERVGraph_View {
     void kill();
     void suspendResume();
     void stopRestart();
-    bool exportDataflow(QString theFile);
+    void openSubGraph(SUPERV_CNode theNode, bool correct = false);
 
     bool putDataStudy(SUPERV_Port port, const char* inout);
     void setData(SUPERVGUI_PortIn* p);
 
     SUPERVGUI_Graph* getGraph();
     SUPERVGUI_Array* getArray();
+    SUPERVGUI_Canvas* getCanvas();
+    SUPERVGUI_CanvasView* getCanvasView();
     SUPERV_Graph getDataflow();
     QAD_Message* getMessage();
     QAD_Study* getStudy();
@@ -93,11 +97,13 @@ class SUPERVGUI_Main: public SUPERVGraph_View {
     void addComputeNode(SUPERV_CNode theNode);
     void addControlNode(SUPERV_CNode theStartNode, SUPERV_CNode theEndNode, bool Update);
     void addGOTONode(SUPERV_CNode theNode);
+    void addMacroNode(SUPERV_CNode theNode);
 
     void setPaletteBackgroundColor(const QColor& color);
 
     void lockedGraph(bool theLock) { myIsLocked = theLock; }
     bool isLocked() { return myIsLocked; }
+    bool isKilled() { return myIsKilled; }
 
     SUPERV::GraphState getNodeExecState();
     void setNodeExecState(SUPERV::GraphState theNodeExecState);
@@ -118,6 +124,11 @@ class SUPERVGUI_Main: public SUPERVGraph_View {
     void startTimer();
     void executionFinished();
 
+    bool eventFilter( QObject* o, QEvent* e);
+
+  signals:
+    void KillMyThread(bool theValue);
+
   public slots:
     void execute(char * theNodeNode, SUPERV::GraphState theNodeState);
     void sync();
@@ -130,7 +141,11 @@ class SUPERVGUI_Main: public SUPERVGraph_View {
     void showTable();
     void showFullGraph();
     void showContolFlow();
+    void showCanvas();
     void filterNotification();
+    void changeDSGraphParameters();
+    void onSubGraphClosed(QAD_StudyFrame* );
+    void onSubGraphActivated(QAD_StudyFrame* );
  
   private slots:
     void chooseData(QListViewItem* item);
@@ -140,8 +155,14 @@ class SUPERVGUI_Main: public SUPERVGraph_View {
     void init(QAD_Desktop* parent);
     void syncNotification();
     bool isFiltered(char* graph, char* node, char* type, char* message, char* sender, long counter, char* date, long stamp);
+    void closeEvent(QCloseEvent*);
 
     SUPERV_Graph            dataflow;
+
+    QMap<QString, QAD_StudyFrame*> mySubGraphs;
+    QMap<QString, QString>  mySubGraphMap;
+    QAD_StudyFrame*         myLastGraph;
+
     QAD_Study*              study;
     QAD_ObjectBrowser*      objectBrowser;
     QAD_Message*            message;
@@ -149,6 +170,8 @@ class SUPERVGUI_Main: public SUPERVGraph_View {
     
     GraphViewType   myCurrentView;
     SUPERVGUI_Array*   array;
+    SUPERVGUI_Canvas*       myCanvas;
+    SUPERVGUI_CanvasView*   myCanvasView;
 
     bool               choosing;
     SUPERVGUI_PortIn*  portIn;
@@ -191,13 +214,39 @@ class SUPERVGUI_Thread : public QObject, public QThread {
   void stopThread(const char* m);
   void setMain(SUPERVGUI_Main* theMain);
 
+ public slots:
+   void KillThread(bool theValue); 
+  
  protected:
   void run();
 
  private:
   bool                myIsActive;
   SUPERVGUI_Main*     myMain;
+  QMutex              myMutex;
+
+};
+
+//**************************************************************
+class SUPERVGUI_DSGraphParameters: public QDialog {
+  Q_OBJECT
+
+  public:
+    SUPERVGUI_DSGraphParameters(SUPERV_Graph theGraph, bool isReadOnly);
+    virtual ~SUPERVGUI_DSGraphParameters();
+
+  private slots:
+    void accept();
+
+  private:
+    
+    void setData();
+    
+    QAD_SpinBoxDbl*      myDeltaTime;
+    QLineEdit*           myTimeOut;
+    QComboBox*           myDataStreamTrace;
 
+    SUPERV_Graph    myGraph;
 };
 
 #endif