EventViewer.h
Go to the documentation of this file.
00001 /*
00002         Aseba - an event-based framework for distributed robot control
00003         Copyright (C) 2007--2012:
00004                 Stephane Magnenat <stephane at magnenat dot net>
00005                 (http://stephane.magnenat.net)
00006                 and other contributors, see authors.txt for details
00007         
00008         This program is free software: you can redistribute it and/or modify
00009         it under the terms of the GNU Lesser General Public License as published
00010         by the Free Software Foundation, version 3 of the License.
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 Lesser General Public License for more details.
00016         
00017         You should have received a copy of the GNU Lesser General Public License
00018         along with this program. If not, see <http://www.gnu.org/licenses/>.
00019 */
00020 
00021 #ifndef EVENT_VIEWER_H
00022 #define EVENT_VIEWER_H
00023 
00024 #ifdef HAVE_QWT
00025 
00026 #ifdef _MSC_VER
00027 #define QWT_DLL
00028 #endif // _MSC_VER
00029 
00030 #include <deque>
00031 #include <QTime>
00032 
00033 #include "MainWindow.h"
00034 #include "../common/types.h"
00035 
00036 class QwtPlot;
00037 class QDoubleSpinBox;
00038 class QPushButton;
00039 class QCheckBox;
00040 class QLabel;
00041 
00042 namespace Aseba
00043 {
00046                 
00047         class EventViewer:  public QWidget
00048         {
00049                 Q_OBJECT
00050                 
00051         protected:
00052                 unsigned eventId;
00053                 MainWindow::EventViewers* eventsViewers;
00054                 bool isCapturing;
00055                 QwtPlot* plot;
00056                 QLabel *status;
00057                 QPushButton *pauseRunButton;
00058                 QCheckBox *timeWindowCheckBox;
00059                 QDoubleSpinBox *timeWindowLength;
00060                 
00061                 std::vector<std::deque<sint16> > values;
00062                 std::deque<double> timeStamps;
00063                 QTime startingTime;
00064         
00065         public:
00066                 EventViewer(unsigned eventId, const QString& eventName, unsigned eventVariablesCount, MainWindow::EventViewers* eventsViewers);
00067                 virtual ~EventViewer();
00068                 
00069                 void detachFromMain() { eventsViewers=0; }
00070                 void addData(const VariablesDataVector& data);
00071                 
00072         protected slots:
00073                 void pauseRunCapture();
00074                 void clearPlot();
00075                 void saveToFile();
00076         };
00077         
00079 }; // Aseba
00080 
00081 #endif // HAVE_QWT
00082 
00083 #endif // EVENT_VIEWER_H


aseba
Author(s): Stéphane Magnenat
autogenerated on Sun Oct 5 2014 23:46:38