TimeSeriesDialog.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/qt/widgets/charts/TimeSeriesDialog.cpp
22 
23  \brief A dialog used to define the basic parameters of a new timeSeries.
24 */
25 
26 //Terralib
27 #include "../../../dataaccess.h"
28 #include "../../../datatype/Property.h"
29 #include "ChartDisplay.h"
30 #include "ChartDisplayWidget.h"
31 #include "ChartStyle.h"
32 #include "TimeSeriesChart.h"
33 #include "TimeSeriesDataWidget.h"
34 #include "TimeSeriesDialog.h"
35 #include "TimeSeriesStyle.h"
36 #include "ui_ChartDialogForm.h"
37 #include "ui_TimeSeriesDataWidgetForm.h"
38 
39 //QT
40 #include <QDockWidget>
41 
43  : QDialog(parent, f),
44  m_ui(new Ui::ChartDialogForm)
45 {
46  m_ui->setupUi(this);
47 
48  // TimeSeries data Widget
50 
51  // Adjusting...
52  QGridLayout* layout = new QGridLayout(m_ui->m_dataWidgetFrame);
53  layout->addWidget(m_timeSeriesDataWidget);
54  this->layout()->setSizeConstraint(QLayout::SetFixedSize);
55 
56 // connect signal and slots
57  connect(m_ui->m_okPushButton, SIGNAL(clicked()), this, SLOT(onOkPushButtonClicked()));
58 
59  m_ui->m_helpPushButton->setPageReference("widgets/charts/timeSeries/timeSeries.html");
60 }
61 
63 {
65 }
66 
68 {
69  return m_displayWidget;
70 }
71 
73 {
74  QApplication::setOverrideCursor(Qt::WaitCursor);
75 
77 
78  //Creating and adjusting the chart Display's style.
80  chartStyle->setTitle(QString::fromUtf8("TimeSeries"));
81 
82  chartStyle->setAxisX(m_timeSeriesDataWidget->getForm()->m_timeComboBox->currentText());
83  chartStyle->setAxisY(m_timeSeriesDataWidget->getForm()->m_valueComboBox->currentText());
84 
85  //Creating and adjusting the chart Display
86  te::qt::widgets::ChartDisplay* chartDisplay = new te::qt::widgets::ChartDisplay(nullptr, QString::fromUtf8("TimeSeries"), chartStyle);
87  chartDisplay->adjustDisplay();
88  chart->attach(chartDisplay);
89  chartDisplay->show();
90  chartDisplay->replot();
91 
92  //Adjusting the chart widget
93  m_displayWidget = new te::qt::widgets::ChartDisplayWidget(chart, te::qt::widgets::TIMESERIES_CHART, chartDisplay, this->parentWidget());
94 
95  QApplication::restoreOverrideCursor();
96  this->accept();
97 }
TimeSeriesDialog(te::da::DataSet *dataSet, te::da::DataSetType *dataType, QWidget *parent=0, Qt::WindowFlags f=0)
Constructor.
A class to represent a timeSeries&#39; chart.
void adjustDisplay()
Updates the general display settings according to the ChartStyle. The adjusted properties are: Title;...
A class that models the description of a dataset.
Definition: DataSetType.h:72
A widget used to adjust a histogram&#39;s input data.
ChartDisplayWidget * m_displayWidget
The display&#39;s widget that will be populated by this widget.
Ui::TimeSeriesDataWidgetForm * getForm()
Returns a pointer to the widget&#39;s form.
A class used to define the style of a TimeSeries&#39;s chart.
TimeSeriesDataWidget * m_timeSeriesDataWidget
The histogram&#39;s data widget used to configure the basic parameters of the new histogram.
te::qt::widgets::ChartDisplayWidget * getDisplayWidget()
Returns a pointer to the generated ChartDisplayWidget.
A class to represent a chart display.
Definition: ChartDisplay.h:65
te::st::TimeSeries * getTimeSeries()
Returns a pointer to the widget&#39;s form.
A dataset is the unit of information manipulated by the data access module of TerraLib.
A wdiget used to display a chart.
A dialog used to define the basic parameters of a new timeSeries.
std::unique_ptr< Ui::ChartDialogForm > m_ui
The dialog form.
A widget used to display a set of charts.
void attach(QwtPlot *plot)
It atttaches a QwtPlot to this Cahrt.
A class used to define a chartDisplay&#39;s style.
A widget used to adjust a timeSeries&#39; input data.
A class to represent a chart display.
A class to represent a timeSeries chart.