Orfeo Toolbox  3.16
otbWrapperQtWidgetModel.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 =========================================================================*/
19 
20 namespace otb
21 {
22 namespace Wrapper
23 {
24 
26  : m_Application(app)
27 {
28  m_Application->Init();
30 
31  // Attach log output to the Application logger
32  m_Application->GetLogger()->SetTimeStampFormat(itk::LoggerBase::HUMANREADABLE);
33  m_Application->GetLogger()->AddLogOutput(m_LogOutput);
34 }
35 
37 {
38 }
39 
41 {
42  // Update the parameters
43  m_Application->UpdateParameters();
44  emit UpdateGui();
45 
46  // Notify all
47  bool applicationStatus = m_Application->IsApplicationReady();
48  emit SetApplicationReady(applicationStatus);
49 }
50 
52 {
53  // Deactivate the Execute button while processing
54  emit SetApplicationReady(false);
55 
56  // launch the output image writing
57  AppliThread * taskAppli = new AppliThread( m_Application );
58  connect(taskAppli, SIGNAL(ApplicationExecutionDone()), this, SLOT(NotifyUpdate()));
59  connect(taskAppli, SIGNAL(ApplicationExecutionDone()), this, SLOT(ActivateExecuteButton()));
60 
61  taskAppli->Execute();
62 
63  // Tell the Progress Reporter to begin
65 }
66 
68 {
69  // For the view to activate the button "Execute"
70  emit SetApplicationReady(true);
71 
72  // For the progressReport to close the Progress widget
73  emit SetProgressReportDone();
74 }
75 
76 void QtWidgetModel::SendLogWARNING( const std::string & mes )
77 {
78  m_Application->GetLogger()->Write( itk::LoggerBase::WARNING, mes );
79 }
80 
81 void QtWidgetModel::SendLogINFO( const std::string & mes )
82 {
83  m_Application->GetLogger()->Write( itk::LoggerBase::INFO, mes );
84 }
85 
86 void QtWidgetModel::SendLogDEBUG( const std::string & mes )
87 {
88  m_Application->GetLogger()->Write( itk::LoggerBase::DEBUG, mes );
89 }
90 
91 
92 }
93 }

Generated at Sun May 19 2013 01:01:50 for Orfeo Toolbox with doxygen 1.8.3.1