datastreamswidget.h
1 /********************************************************************************
2  * FARSA DataStreamsWidget UI *
3  * Copyright (C) 2012-2013 *
4  * Gianluca Massera <emmegian@yahoo.it> *
5  * *
6  * This program is free software; you can redistribute it and/or modify *
7  * it under the terms of the GNU General Public License as published by *
8  * the Free Software Foundation; either version 2 of the License, or *
9  * (at your option) any later version. *
10  * *
11  * This program is distributed in the hope that it will be useful, *
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14  * GNU General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU General Public License *
17  * along with this program; if not, write to the Free Software *
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *
19  ********************************************************************************/
20 
21 #ifndef DATASTREAMSWIDGET_H
22 #define DATASTREAMSWIDGET_H
23 
24 #include "datastreamplot.h"
25 #include "utilitiesconfig.h"
26 #include <QWidget>
27 #include <QMutex>
28 #include <QTimer>
29 #include <QList>
30 #include <QQueue>
31 #include <QLabel>
32 #include <QStringList>
33 
34 namespace farsa {
35 
38 class FARSA_UTIL_API DataStreamsWidget : public QWidget {
39  Q_OBJECT
40 public:
42  DataStreamsWidget( QWidget* parent = 0 );
44  virtual ~DataStreamsWidget();
49  int addPlot( QString name );
51  DataStreamPlot* getPlot( int plotID );
53  int getNumPlots();
60  void appendDatas( int plotID, QVector<float> values );
61 private slots:
63  void updatePlots();
65  void enableAutomaticUpdates( bool );
67  void dequeueAllData();
68 private:
70  QList<DataStreamPlot*> plots;
72  QStringList plotNames;
74  QTimer replotTimer;
76  QList<QLabel*> plotInfos;
83  QList< QQueue< QVector<float> > > queuedValues;
85  QMutex mutex;
86 };
87 
88 } //end namespace farsa
89 
90 #endif
This file contains the common type defitions used on the whole framework.
A macro to deprecate functions.
The DataStreamPlot display a series of data streams into the plot storing all the history of the data...
this widget display one or more DataStreamPlot and utility toolbar for interacting with them ...