-// File : SUPERVGUI_Main.h
-// Created : 24 / 10 / 2001
-// Author : Francis KLOSS
-// Project : SALOME
-// Module : SUPERVGUI
-// Copyright : CEA
+// SUPERV SUPERVGUI : GUI for Supervisor component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : SUPERVGUI_Main.h
+// Author : Francis KLOSS
+// Module : SUPERV
#ifndef SUPERVGUI_Main_H
#define SUPERVGUI_Main_H
#include "QAD_Desktop.h"
#include "SUPERVGUI_Port.h"
+#include <qobject.h>
+#include <qapplication.h>
+#include <qthread.h>
+
class QAD_Study;
class QAD_ObjectBrowser;
class QAD_Message;
class NOTIFICATION_Consumer;
-
+class SUPERVGUI_Thread;
class SUPERVGUI_Main: public SUPERVGraph_View {
Q_OBJECT
void checkIsInStudy();
void addComputeNode(SUPERV_CNode theNode);
- void addControlNode(SUPERV_CNode theStartNode, SUPERV_CNode theEndNode);
+ void addControlNode(SUPERV_CNode theStartNode, SUPERV_CNode theEndNode, bool Update);
void addGOTONode(SUPERV_CNode theNode);
void setPaletteBackgroundColor(const QColor& color);
void lockedGraph(bool theLock) { myIsLocked = theLock; }
bool isLocked() { return myIsLocked; }
+ SUPERV::GraphState getNodeExecState();
+ void setNodeExecState(SUPERV::GraphState theNodeExecState);
+
+ QPtrList< char * > getEventNodes();
+ void setEventNodes(QPtrList< char * > theEventNodes);
+ bool removeFirstEN() { return myEventNodes.removeFirst(); }
+ void removeEventNodes() { myEventNodes.clear(); }
+
+ QPtrList< SUPERV::GraphState > getStates();
+ void setStates(QPtrList< SUPERV::GraphState > theStates);
+ bool removeFirstS() { return myStates.removeFirst(); }
+ void removeStates() { myStates.clear(); }
+
+ int getNodesNumber();
+ SUPERVGUI_Thread* getMyThread();
+
+ void startTimer();
+ void executionFinished();
+
public slots:
- void execute();
+ void execute(char * theNodeNode, SUPERV::GraphState theNodeState);
void sync();
void syncAsync();
bool addStudy();
private slots:
void chooseData(QListViewItem* item);
+ void checkExecution();
private:
void init(QAD_Desktop* parent);
- void StartTimer(const char* m);
- void StopTimer(const char* m);
void syncNotification();
bool isFiltered(char* graph, char* node, char* type, char* message, char* sender, long counter, char* date, long stamp);
QAD_ObjectBrowser* objectBrowser;
QAD_Message* message;
SUPERVGUI_Graph* graph;
- QTimer* timer;
-
+
GraphViewType myCurrentView;
SUPERVGUI_Array* array;
bool myVerbose;
bool myIsKilled;
bool myIsLocked;
+
+ SUPERVGUI_Thread* myThread;
+
+ QPtrList< char * > myEventNodes ;
+ QPtrList< SUPERV::GraphState > myStates ;
+ QTimer* myTimer;
+};
+
+class SUPERVGUI_Thread : public QObject, public QThread {
+ Q_OBJECT;
+ public:
+ SUPERVGUI_Thread();
+ ~SUPERVGUI_Thread();
+
+ void startThread(const char* m);
+ void stopThread(const char* m);
+ void setMain(SUPERVGUI_Main* theMain);
+
+ protected:
+ void run();
+
+ private:
+ bool myIsActive;
+ SUPERVGUI_Main* myMain;
+
};
#endif