Orfeo Toolbox  4.0
otbWrapperQtWidgetSimpleProgressReport.cxx
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ORFEO Toolbox
4  Language: C++
5  Date: $Date$
6  Version: $Revision$
7 
8 
9  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
10  See OTBCopyright.txt for details.
11 
12 
13  This software is distributed WITHOUT ANY WARRANTY; without even
14  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  PURPOSE. See the above copyright notices for more information.
16 
17 =========================================================================*/
18 
21 #include "itksys/SystemTools.hxx"
22 
24 
25 namespace otb
26 {
27 namespace Wrapper
28 {
29 
31 {
32  m_Model = model;
33  connect(model, SIGNAL(SetProgressReportBegin()), this, SLOT(show()) );
34  connect(model, SIGNAL(SetProgressReportDone()), this, SLOT(close()) );
35  connect(model, SIGNAL(SetProgressReportDone()), this, SLOT(Init()) );
36  connect(this, SIGNAL(AddNewProcessToReport()), this, SLOT(ReportProcess()) );
37 
38  m_Layout = new QVBoxLayout;
39  this->setLayout(m_Layout);
40 
43 
44  m_Bar = new itk::QtProgressBar(this);
45  m_Label = new QLabel("No process");
46  connect( m_Bar, SIGNAL(SetValueChanged(int)), m_Bar, SLOT(setValue(int)) );
47  connect( m_Model, SIGNAL(SetProgressReportDone()), m_Bar, SLOT(reset()) );
48 
49  m_Layout->addWidget(m_Label);
50  m_Layout->addWidget(m_Bar);
51 
52  this->show();
53 }
54 
56 {
57 }
58 
60 {
61  m_Application = app;
63 }
64 
65 void
67  const itk::EventObject & event )
68 {
69  if( typeid( otb::Wrapper::AddProcessToWatchEvent ) == typeid( event ) )
70  {
71  const AddProcessToWatchEvent* eventToWacth = dynamic_cast< const AddProcessToWatchEvent*> ( &event );
72 
73  m_CurrentProcess = eventToWacth->GetProcess();
75  emit AddNewProcessToReport();
76  }
77 }
78 
80 {
82  m_Label->setText(QString(m_CurrentDescription.c_str()));
83 }
84 
85 
87 {
88  m_Bar->setValue(0);
89  m_Label->setText("No process yet...");
90 }
91 
92 }
93 }

Generated at Sat Mar 8 2014 16:28:52 for Orfeo Toolbox with doxygen 1.8.3.1