All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TimeSeriesDialog.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2010-2013 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 TimeSeriesLayer.
24 */
25 
26 //Terralib
27 #include "../../../dataaccess.h"
28 #include "../../../datatype/Property.h"
29 #include "../utils/DoubleListWidget.h"
30 #include "TimeSeriesDialog.h"
33 #include "ui_DoubleListWidgetForm.h"
34 #include "ui_TimeSeriesDialogForm.h"
35 #include "ui_TemporalPropertiesWidgetForm.h"
36 
38  : QDialog(parent, f),
39  m_ui(new Ui::TimeSeriesDialogForm)
40 {
41  m_ui->setupUi(this);
42 
43  // Time Properties Widget
44  te::da::DataSet* dataset = layer->getData().release();
47 
48  //Observed Properties
49  std::vector<std::string> properties;
50 
51  // Creating the properties list. DATETIME_TYPE properties can not be included.
52  for (std::size_t i = 0; i < dataset->getNumProperties(); i++)
53  {
55  {
56  properties.push_back(dataset->getPropertyName(i));
57  }
58  }
59 
60  m_observedPropWidget.reset(new DoubleListWidget(this));
61  m_observedPropWidget->getForm()->m_leftItemsLabel->setText(tr(""));
62  m_observedPropWidget->getForm()->m_rightItemsLabel->setText(tr(""));
63  m_observedPropWidget->setInputValues(properties);
64 
65  // Adjusting...
66  QGridLayout* layout = new QGridLayout(m_ui->m_propertiesWidgetFrame);
67  QVBoxLayout *vboxLayout = new QVBoxLayout;
68 
69  layout->addWidget(m_propertiesWidget.get());
70  layout->addWidget(m_uniquePropWidget.get());
71  vboxLayout->addWidget(m_observedPropWidget.get());
72  m_ui->m_uniquePropertiesGroupBox->setLayout(vboxLayout);
73  this->layout()->setSizeConstraint(QLayout::SetFixedSize);
74 
75  //connect signal and slots
76  connect(m_ui->m_okPushButton, SIGNAL(clicked()), this, SLOT(onOkPushButtonClicked()));
77  connect(m_ui->m_helpPushButton, SIGNAL(clicked()), this, SLOT(onHelpPushButtonClicked()));
78 }
79 
81 {
82 }
83 
85 
87 {
88 
89 }
A widget used to adjust a time series layer's properties.
std::auto_ptr< Ui::TimeSeriesDialogForm > m_ui
The dialog form.
std::auto_ptr< DoubleListWidget > m_observedPropWidget
A widget used to adjust a temporal layer's properties.
std::auto_ptr< TimeSeriesPropertiesWidget > m_uniquePropWidget
The widget used to configure the unique TimeSeriesLayer's properties.
virtual std::string getPropertyName(std::size_t i) const =0
It returns the property name at position pos.
TimeSeriesDialog(te::map::AbstractLayerPtr layer, QWidget *parent=0, Qt::WindowFlags f=0)
Constructor.
A widget used to adjust a time series layer's properties.
virtual std::size_t getNumProperties() const =0
It returns the number of properties that composes an item of the dataset.
A dataset is the unit of information manipulated by the data access module of TerraLib.
Definition: DataSet.h:112
virtual int getPropertyDataType(std::size_t i) const =0
It returns the underlying data type of the property at position pos.
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
std::auto_ptr< TemporalPropertiesWidget > m_propertiesWidget
The widget used to configure the general TimeSeriesLayer's properties.