00001 /*************************************************************************** 00002 * SpikeStream Application * 00003 * Copyright (C) 2007 by David Gamez * 00004 * david@davidgamez.eu * 00005 * Version 0.1 * 00006 * * 00007 * This program is free software; you can redistribute it and/or modify * 00008 * it under the terms of the GNU General Public License as published by * 00009 * the Free Software Foundation; either version 2 of the License, or * 00010 * (at your option) any later version. * 00011 * * 00012 * This program is distributed in the hope that it will be useful, * 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00015 * GNU General Public License for more details. * 00016 * * 00017 * You should have received a copy of the GNU General Public License * 00018 * along with this program; if not, write to the * 00019 * Free Software Foundation, Inc., * 00020 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00021 ***************************************************************************/ 00022 00023 #ifndef MONITORAREA_H 00024 #define MONITORAREA_H 00025 00026 //SpikeStream includes 00027 #include "DBInterface.h" 00028 #include "MonitorWindow.h" 00029 #include "NetworkMonitor.h" 00030 #include "SimulationManager.h" 00031 #include "ArchiveManager.h" 00032 #include "NeuronGroup.h" 00033 #include "SpikeStreamApplication.h" 00034 00035 //Qt includes 00036 #include <qwidget.h> 00037 #include <qdockarea.h> 00038 #include <qstring.h> 00039 00040 00041 //------------------------- Monitor Area ---------------------------------- 00042 /*! Extends QDockArea and holds a number of monitor windows with the 00043 possibility of arranging them and undocking them, etc. 00044 00045 NOTE Had problems creating QDockWindows at runtime, so instead create 00046 all of them at once and then add NetworkMonitors to them and hide/show 00047 them as required.This creates a limit on the number of monitoring windows 00048 that can be used at one time, which is set in GlobalVariables.h. */ 00049 //------------------------------------------------------------------------- 00050 00051 class MonitorArea : public QDockArea { 00052 Q_OBJECT 00053 00054 public: 00055 MonitorArea(DBInterface*, SimulationManager*, QWidget *parent); 00056 MonitorArea(ArchiveManager*, QWidget *parent); 00057 ~MonitorArea(); 00058 void addMonitorWindow(NeuronGroup neurGrp); 00059 void connectToManager(); 00060 void dockMonitorWindows(); 00061 void hideMonitorWindows(); 00062 void loadSimulation(); 00063 void resetMonitorWindows(); 00064 void rewindNetworkMonitors(); 00065 void showAllMonitorWindows(bool monitorType); 00066 void showMonitorWindow(unsigned int neuronGrpID, bool monitorType); 00067 void undockMonitorWindows(); 00068 00069 00070 private: 00071 //========================== VARIABLES =========================== 00072 //References 00073 DBInterface *networkDBInterface; 00074 SimulationManager *simulationManager; 00075 ArchiveManager *archiveManager; 00076 SpikeStreamApplication *spikeStrApp; 00077 00078 /*! Array holding references to all the monitor windows.*/ 00079 MonitorWindow **monitorWindowArray; 00080 00081 /*! The insertion point in the monitorWindowArray */ 00082 int endPos; 00083 00084 /*! Holds references to all the network monitors.*/ 00085 map<unsigned int, NetworkMonitor*> networkMonitorMap; 00086 00087 /*! Records whether this monitor area is monitoring a simulation 00088 or playing back an archive */ 00089 bool simulationMode; 00090 00091 /*! Used to determine whether the windows should be arranged 00092 automatically, this records whether this is the first undock 00093 of the monitor area. */ 00094 bool firstTimeUndock; 00095 00096 00097 //========================== METHODS ============================= 00098 /*! Declare copy constructor private so it cannot be used inadvertently.*/ 00099 MonitorArea (const MonitorArea&); 00100 00101 /*! Declare assignment private so it cannot be used inadvertently.*/ 00102 MonitorArea operator = (const MonitorArea&); 00103 00104 }; 00105 00106 00107 #endif //MONITORAREA_H 00108 00109
1.4.4