Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

TxqConfigWsFrame.h

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 //
00003 // File:    TxqConfigWsFrame.h
00004 //
00005 // Purpose: Implementation of a window to control the model workspace.
00006 //
00007 // Version: $Id: TxqConfigWsFrame.h,v 1.9 2002/04/08 16:36:09 kgl Exp $
00008 //
00009 // Author:  Kelly G. Luetkemeyer
00010 //
00011 //--------------------------------------------------------------------
00012 
00013 #ifndef TXQ_CONFIG_WS_FRAME_H
00014 #define TXQ_CONFIG_WS_FRAME_H
00015 
00016 // model defines
00017 #include <TxModelDefines.h>
00018 
00019 // std inclues
00020 #include <vector.h>
00021 
00022 // Txq includes
00023 #include <Txq2dFrame.h>
00024 #include <TxAttributeSet.h>
00025 #include "TxqWsFrame.h"
00026 #include "TxqSciNumberFormat.h"
00027 #include "TxqSciNumberPattern.h"
00028 
00029 #ifdef OPENGL
00030 #include <Txq3dFrame.h>
00031 #endif
00032 
00033 // Qt includes
00034 #include <qtimer.h>
00035 #include <qstatusbar.h>
00036 #include <qlabel.h>
00037 
00050 class TxqConfigWsFrame : public TxqWsFrame
00051 {
00052   Q_OBJECT
00053 
00054 public:
00055 
00066   TxqConfigWsFrame(TxAttributeSet *windowAttrib,
00067                           QWidget* parent=0, const char *nm=0, 
00068                           WFlags f = WType_TopLevel);
00069 
00073   virtual ~TxqConfigWsFrame();
00074 
00079   void add(Txq2dFrame *f);
00080 
00085 #ifdef OPENGL
00086   void add(Txq3dFrame *f);
00087 #endif
00088 
00093   void setTimeStep(double ts);
00094 
00098    virtual void disableButtons();
00099 
00103   void setInitialState();
00104 
00109   void updateStatusLabel(const QString &label);
00110 
00117   QPushButton* addButton();
00118 
00122   void start();
00123 
00127   void stop();
00128 
00132   void destroy();
00133 
00138   void destroy(bool b, bool bb) {QWidget::destroy(b, bb); }
00139 
00143   int getModelState();
00144 
00148   void clearPlots();
00149 
00150 public slots:
00151 
00155   void startModel();
00156 
00160   void runModel();
00161 
00165   void stepModel();
00166 
00170   void stopModel();
00171 
00175   void restartModel();
00176 
00180   void updatePlots();
00181 
00185   virtual void closeWindow();
00186 
00190   void clearPlotsEvent();
00191 
00192 protected:
00193 
00198   void timerEvent(QTimerEvent *t);
00199 
00203   void addButtonSlots();
00204 
00210   void connectTrolSignals();
00211 
00216   int maxIters;
00217 
00222   int iterPerUpdate;
00223 
00227   std::vector<Txq2dFrame*> plotWindows;
00228 
00232 #ifdef OPENGL
00233   std::vector<Txq3dFrame*> plot3dWindows;
00234 #endif
00235 
00236 protected slots:
00237 
00242   bool close( bool forceKill = FALSE) ;
00243 
00244 signals:
00245 
00249   void restartEvent();
00250 
00254   void startEvent();
00255 
00259   void runEvent();
00260 
00264   void stopEvent();
00265 
00269   void updateModel();
00270 
00271 private:
00272 
00276   int timer_id;
00277 
00281   int modelState;
00282 
00286   double timeStep;
00287 
00293   int iterPerUpdateNumber;
00294 
00298   int theCurrentStep;
00299 
00303   TxAttributeSet *window;
00304  
00305 };
00306 
00307 
00308 #endif
Copyright Tech-X Corporation, all rights reserved.