ObservationPropertiesWizardPage.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/st/ObservationPropertiesWIzardPage.cpp
22 
23  \brief A wizardPage used to configure the properties of a new Observation layer.
24 */
25 
26 // TerraLib
27 #include "../../../datatype/DateTimeProperty.h"
28 #include "../../../geometry/GeometryProperty.h"
29 #include "../../../st/core/observation/ObservationDataSetInfo.h"
33 #include "ui_ObservationPropertiesWidgetForm.h"
34 #include "ui_TemporalPropertiesWidgetForm.h"
35 
37  : QWizardPage(parent)
38 {
41 
42  // Adjusting...
43  QGridLayout* propLayout = new QGridLayout(this);
44  propLayout->addWidget(m_propWidget.get());
45 
46  // Adjusting the properties widget
47  QGridLayout* tempPropLayout = new QGridLayout(m_propWidget->getForm()->m_temporalPropertiesFrame);
48  tempPropLayout->setContentsMargins(0, 0, 0, 0);
49  tempPropLayout->addWidget(m_tempPropWidget.get());
50 }
51 
54 
55 std::list<te::st::ObservationDataSetInfo*> te::qt::widgets::ObservationPropertiesWizardPage::getInfo(const te::da::DataSourceInfoPtr dsInfo)
56 {
57  std::list<te::st::ObservationDataSetInfo*> obsInfos;
58 
59  std::list<te::da::DataSetTypePtr>::const_iterator typesItBegin = m_dataTypes.begin();
60  std::list<te::da::DataSetTypePtr>::const_iterator typesItEnd = m_dataTypes.end();
61 
62  while(typesItBegin != typesItEnd)
63  {
64  te::st::ObservationDataSetInfo* obsInfo = new te::st::ObservationDataSetInfo(*dsInfo.get(), typesItBegin->get()->getName());
65  obsInfo->setTimePropInfo(new te::dt::DateTimeProperty(m_tempPropWidget->getPhenomenonTime()));
66 
67  if(m_tempPropWidget->getForm()->m_avancedGroupBox->isEnabled())
68  {
69  obsInfo->setVlTimePropInfo(new te::dt::DateTimeProperty(m_tempPropWidget->getValidTime()));
70  obsInfo->setRsTimePropInfo(new te::dt::DateTimeProperty(m_tempPropWidget->getResultTime()));
71  }
72 
73  obsInfo->setObsPropInfo(m_propWidget->getOutputValues());
74  obsInfo->setObsPropInfo(m_propWidget->getOutputPropNames());
75  obsInfo->setGeomPropInfo(new te::gm::GeometryProperty(m_propWidget->getGeometryPropName()));
76 
77  //id properties
78  obsInfo->setIdPropInfo(m_propWidget->getIdPropName());
79  obsInfo->setIdPropInfo(m_propWidget->getIdIndex());
80  //result.setId(info.getObsId());
81 
82  obsInfos.push_back(obsInfo);
83  typesItBegin++;
84  }
85 
86  return obsInfos;
87 }
88 
90 {
91  return true;
92 }
93 
94 void te::qt::widgets::ObservationPropertiesWizardPage::set(const std::list<te::da::DataSetTypePtr> dataTypes)
95 {
96  m_dataTypes = dataTypes;
97  m_tempPropWidget->setUp(dataTypes.front());
98  m_propWidget->setUp(dataTypes.front());
99 }
100 
A widget used to adjust a Observation layer&#39;s properties.
Geometric property.
A class that contains infos about a DataSet that contains observations.
A widget used to adjust a Observation layer&#39;s properties.
A widget used to adjust a temporal layer&#39;s properties.
void setVlTimePropInfo(te::dt::DateTimeProperty *tpInfo)
It sets the property info that contains the valid time.
void setIdPropInfo(int idProp)
It sets the index of the DataSet property that contains identifiers that groups the observations...
void setRsTimePropInfo(te::dt::DateTimeProperty *tpInfo)
It sets the property info that contains the result time.
std::list< te::da::DataSetTypePtr > m_dataTypes
The list of datasettypes used to configure the trajectory(ies)
std::unique_ptr< ObservationPropertiesWidget > m_propWidget
The widget used to configure the unique ObservationLayer&#39;s properties.
void setTimePropInfo(te::dt::DateTimeProperty *tpInfo)
It sets the property info that contains the phenomenon time.
The type for date and time types: date, date period, date duration, time duration, time instant, time period, time instant with time zone or time period with time zone.
std::unique_ptr< TemporalPropertiesWidget > m_tempPropWidget
The widget used to configure the general TrajectoryLayer&#39;s properties.
void set(const std::list< te::da::DataSetTypePtr > dataTypes)
void setGeomPropInfo(te::gm::GeometryProperty *prop)
It sets the info about the property that contains the observation location.
void setObsPropInfo(const std::vector< int > &props)
It sets the indexes of the DataSet properties that are observed over time.
std::list< te::st::ObservationDataSetInfo * > getInfo(const te::da::DataSourceInfoPtr dsInfo)
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr