All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
53 {
54 }
55 
56 std::list<te::st::ObservationDataSetInfo*> te::qt::widgets::ObservationPropertiesWizardPage::getInfo(const te::da::DataSourceInfoPtr dsInfo)
57 {
58  std::list<te::st::ObservationDataSetInfo*> obsInfos;
59 
60  std::list<te::da::DataSetTypePtr>::const_iterator typesItBegin = m_dataTypes.begin();
61  std::list<te::da::DataSetTypePtr>::const_iterator typesItEnd = m_dataTypes.end();
62 
63  while(typesItBegin != typesItEnd)
64  {
65  te::st::ObservationDataSetInfo* obsInfo = new te::st::ObservationDataSetInfo(*dsInfo.get(), typesItBegin->get()->getName());
66  obsInfo->setTimePropInfo(new te::dt::DateTimeProperty(m_tempPropWidget->getPhenomenonTime()));
67 
68  if(m_tempPropWidget->getForm()->m_avancedGroupBox->isEnabled())
69  {
70  obsInfo->setVlTimePropInfo(new te::dt::DateTimeProperty(m_tempPropWidget->getValidTime()));
71  obsInfo->setRsTimePropInfo(new te::dt::DateTimeProperty(m_tempPropWidget->getResultTime()));
72  }
73 
74  obsInfo->setObsPropInfo(m_propWidget->getOutputValues());
75  obsInfo->setObsPropInfo(m_propWidget->getOutputPropNames());
76  obsInfo->setGeomPropInfo(new te::gm::GeometryProperty(m_propWidget->getGeometryPropName()));
77 
78  //id properties
79  obsInfo->setIdPropInfo(m_propWidget->getIdPropName());
80  obsInfo->setIdPropInfo(m_propWidget->getIdIndex());
81  //result.setId(info.getObsId());
82 
83  obsInfos.push_back(obsInfo);
84  typesItBegin++;
85  }
86 
87  return obsInfos;
88 }
89 
91 {
92  return true;
93 }
94 
95 void te::qt::widgets::ObservationPropertiesWizardPage::set(const std::list<te::da::DataSetTypePtr> dataTypes)
96 {
97  m_dataTypes = dataTypes;
98  m_tempPropWidget->setUp(dataTypes.front());
99  m_propWidget->setUp(dataTypes.front());
100 }
101 
A widget used to adjust a Observation layer's properties.
Geometric property.
A class that contains infos about a DataSet that contains observations.
A widget used to adjust a Observation layer's properties.
std::auto_ptr< ObservationPropertiesWidget > m_propWidget
The widget used to configure the unique ObservationLayer's properties.
A widget used to adjust a temporal layer'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::auto_ptr< TemporalPropertiesWidget > m_tempPropWidget
The widget used to configure the general TrajectoryLayer'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.
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.
A wizardPage used to configure the general properties of a new trajectory layer.
std::list< te::st::ObservationDataSetInfo * > getInfo(const te::da::DataSourceInfoPtr dsInfo)
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr