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 MONITORWINDOW_H 00024 #define MONITORWINDOW_H 00025 00026 //SpikeStream includes 00027 #include "NetworkMonitor.h" 00028 #include "SimulationManager.h" 00029 00030 //Qt includes 00031 #include <qwidget.h> 00032 #include <qdockwindow.h> 00033 #include <qstring.h> 00034 00035 //------------------------- Monitor Window -------------------------------- 00036 /*! Displays the activity of a neuron group for both live simulation 00037 monitoring and the playback of archived neuron and spike patterns. */ 00038 //------------------------------------------------------------------------- 00039 00040 class MonitorWindow : public QDockWindow{ 00041 Q_OBJECT 00042 00043 public: 00044 /* Two different constructors depending on whether this is for 00045 live monitoring or archive playback. */ 00046 MonitorWindow(SimulationManager*, QWidget *parent); 00047 MonitorWindow(QWidget* parent); 00048 ~MonitorWindow(); 00049 unsigned int getNeuronGrpID(); 00050 void setMonitorType(bool monitorNeurons); 00051 void setNeuronGrpID(unsigned int); 00052 00053 00054 protected: 00055 //Inherited from QDockWindow 00056 void moveEvent(QMoveEvent*); 00057 void resizeEvent(QResizeEvent*); 00058 00059 00060 private slots: 00061 void windowPlaceChanged(QDockWindow::Place p); 00062 void windowVisibilityChanged(bool); 00063 00064 00065 private: 00066 //============================ VARIABLES ============================== 00067 /*! Use simulation manager reference to stop or start monitoring of a 00068 neuron group when corresponding qdockwindow is made visible */ 00069 SimulationManager *simulationManager; 00070 00071 /*! Records whether this window is being used for live monitoring or playing 00072 back a simulation */ 00073 bool simulationMode; 00074 00075 /*! Store neuron group ID. 00076 Needed so that simulation widget can show or hide windows monitoring 00077 particular neuron groups. */ 00078 unsigned int neuronGrpID; 00079 00080 /*! Records whether this window is monitoring the neuron patterns 00081 or the spike patterns from the neuron group. The spike patterns 00082 will be spread out in time because of the delay */ 00083 bool monitorNeurons; 00084 00085 /*! Store window width to save effort resizing window after undocking.*/ 00086 int windowWidth; 00087 00088 /*! Store window height to save effort resizing window after undocking.*/ 00089 int windowHeight; 00090 00091 /*! Store the location of the window so that it can be moved back to this 00092 location when the window is undocked. */ 00093 int xPos; 00094 00095 /*! Store the location of the window so that it can be moved back to this 00096 location when the window is undocked. */ 00097 int yPos; 00098 00099 /*! Set miniumum height of window to allow space for the time update above 00100 the neural networks.*/ 00101 static const int minimumHeight = 100; 00102 00103 /*! Records when the process of undocking the window is complete */ 00104 bool finishedUndockingWindow; 00105 00106 /*! Records previous visiblity status 00107 This prevents constant requests to simulation manager to cancel messages 00108 when none are being sent. */ 00109 bool oldVisibility; 00110 00111 00112 //============================= METHODS ================================ 00113 /*! Declare copy constructor private so it cannot be used inadvertently.*/ 00114 MonitorWindow (const MonitorWindow&); 00115 00116 /*! Declare assignment private so it cannot be used inadvertently.*/ 00117 MonitorWindow operator = (const MonitorWindow&); 00118 00119 }; 00120 00121 00122 #endif //MONITORWINDOW_H 00123 00124 00125
1.4.4