-
Notifications
You must be signed in to change notification settings - Fork 1
/
qgssensorinfodialog.h
77 lines (62 loc) · 3.01 KB
/
qgssensorinfodialog.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/***************************************************************************
qgssensorinfodialog.h - description
-------------------------------------
begin : June 2013
copyright : (C) 2013 by Marco Hugentobler
email : marco dot hugentobler at sourcepole dot ch
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSSENSORINFODIALOG_H
#define QGSSENSORINFODIALOG_H
#include "ui_qgssensorinfodialogbase.h"
#include "qwt_compat.h"
#include <QDateTime>
class QwtPlot;
class QwtPlotMarker;
class QgsSensorInfoDialog: public QDialog, private Ui::QgsSensorInfoDialogBase
{
Q_OBJECT
public:
struct ObservableEntry
{
QString serviceUrl;
QString stationId;
QString stationName;
QStringList observables;
QList< QDateTime > beginList;
QList< QDateTime > endList;
};
QgsSensorInfoDialog( QWidget * parent = 0, Qt::WindowFlags f = 0 );
~QgsSensorInfoDialog();
void clearObservables();
void addObservables( const QString& serviceUrl, const QString& stationId, const QString& stationName, const QStringList& observables, const QList< QDateTime >& begin, const QList< QDateTime >& end );
/**Adds observables which are hidden at the moment but may be shown later (after mShowAllObservableButton has been clicked)*/
void addHiddenObservables( const QString& serviceUrl, const QString& stationId, const QString& stationName, const QStringList& observables, const QList< QDateTime >& begin, const QList< QDateTime >& end );
void openObservablesTab();
private slots:
void showDiagram();
int convertTimeToInt( const QDateTime& dt ) const;
QDateTime convertIntToTime( int t ) const;
void onDiagramSelected( const QPointF& pt );
void on_mTabWidget_tabCloseRequested( int index );
void showAllObservables();
void exportToCSV();
private:
QStringList plotList() const;
QwtPlot* plot( const QString& name );
QwtPlot* currentPlot();
QwtPlotMarker* plotMarker( QwtPlot* plot );
/**Removes characters which might be roblematic e.g. on windows*/
static QString removeProblematicFileCharacters( const QString& fileName );
QMap< QwtPlot*, QwtPlotMarker* > mPlotMarkers;
QList< ObservableEntry > mHiddenObservables;
QPushButton* mShowAllButton;
};
#endif // QGSSENSORINFODIALOG_H