Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
otb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
273
Issues
273
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Main Repositories
otb
Commits
e16d4bc0
Commit
e16d4bc0
authored
Nov 04, 2015
by
Guillaume Pasero
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'mantis-1098' into develop
parents
d36baa4b
3d9e0a5b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
37 deletions
+46
-37
Modules/Wrappers/ApplicationEngine/include/otbWrapperInputProcessXMLParameter.h
...cationEngine/include/otbWrapperInputProcessXMLParameter.h
+2
-11
Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx
.../Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx
+2
-1
Modules/Wrappers/ApplicationEngine/src/otbWrapperInputProcessXMLParameter.cxx
...licationEngine/src/otbWrapperInputProcessXMLParameter.cxx
+28
-12
Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetInputProcessXMLParameter.cxx
...Widget/src/otbWrapperQtWidgetInputProcessXMLParameter.cxx
+14
-13
No files found.
Modules/Wrappers/ApplicationEngine/include/otbWrapperInputProcessXMLParameter.h
View file @
e16d4bc0
...
...
@@ -43,19 +43,10 @@ public:
// Get Value
//TODO otbGetObjectMemberMacro(StringParam, Value , std::string);
void
SetFileName
(
std
::
string
value
)
{
this
->
SetValue
(
value
);
}
bool
SetFileName
(
std
::
string
value
);
// Set Value
virtual
void
SetValue
(
const
std
::
string
value
)
{
itkDebugMacro
(
"setting member m_FileName to "
<<
value
);
this
->
m_FileName
=
value
;
SetActive
(
true
);
this
->
Modified
();
}
virtual
void
SetValue
(
const
std
::
string
value
);
ImagePixelType
GetPixelTypeFromString
(
std
::
string
pixTypeAsString
);
...
...
Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx
View file @
e16d4bc0
...
...
@@ -830,7 +830,8 @@ void Application::SetParameterString(std::string parameter, std::string value)
else
if
(
dynamic_cast
<
InputProcessXMLParameter
*>
(
param
))
{
InputProcessXMLParameter
*
paramDown
=
dynamic_cast
<
InputProcessXMLParameter
*>
(
param
);
paramDown
->
SetValue
(
value
);
if
(
!
paramDown
->
SetFileName
(
value
)
)
otbAppLogCRITICAL
(
<<
"Invalid XML parameter filename "
<<
value
<<
"."
);
}
}
...
...
Modules/Wrappers/ApplicationEngine/src/otbWrapperInputProcessXMLParameter.cxx
View file @
e16d4bc0
...
...
@@ -41,6 +41,34 @@ InputProcessXMLParameter::~InputProcessXMLParameter()
}
bool
InputProcessXMLParameter
::
SetFileName
(
std
::
string
value
)
{
// Check if the filename is not empty
if
(
!
value
.
empty
())
{
// Check that the right extension is given : expected .xml
if
(
itksys
::
SystemTools
::
GetFilenameLastExtension
(
value
)
==
".xml"
)
{
if
(
itksys
::
SystemTools
::
FileExists
(
value
.
c_str
(),
true
))
{
this
->
SetValue
(
value
);
return
true
;
}
}
}
return
false
;
}
void
InputProcessXMLParameter
::
SetValue
(
const
std
::
string
value
)
{
itkDebugMacro
(
"setting member m_FileName to "
<<
value
);
this
->
m_FileName
=
value
;
SetActive
(
true
);
this
->
Modified
();
}
ImagePixelType
InputProcessXMLParameter
::
GetPixelTypeFromString
(
std
::
string
strType
)
{
...
...
@@ -134,18 +162,6 @@ InputProcessXMLParameter::GetChildNodeTextOf(TiXmlElement *parentElement, std::s
int
InputProcessXMLParameter
::
Read
(
Application
::
Pointer
this_
)
{
// Check if the filename is not empty
if
(
m_FileName
.
empty
())
itkExceptionMacro
(
<<
"The XML input FileName is empty, please set the filename via the method SetFileName"
);
// Check that the right extension is given : expected .xml
if
(
itksys
::
SystemTools
::
GetFilenameLastExtension
(
m_FileName
)
!=
".xml"
)
{
itkExceptionMacro
(
<<
itksys
::
SystemTools
::
GetFilenameLastExtension
(
m_FileName
)
<<
" "
<<
m_FileName
<<
" "
<<
" is a wrong Extension FileName : Expected .xml"
);
}
// Open the xml file
TiXmlDocument
doc
;
...
...
Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetInputProcessXMLParameter.cxx
View file @
e16d4bc0
...
...
@@ -34,10 +34,13 @@ QtWidgetInputProcessXMLParameter::~QtWidgetInputProcessXMLParameter()
void
QtWidgetInputProcessXMLParameter
::
DoUpdateGUI
()
{
// Update the lineEdit
QString
text
(
m_XMLParam
->
GetFileName
()
);
if
(
text
!=
m_Input
->
text
())
m_Input
->
setText
(
text
);
if
(
m_XMLParam
->
HasUserValue
())
{
// Update the lineEdit
QString
text
(
m_XMLParam
->
GetFileName
()
);
if
(
text
!=
m_Input
->
text
())
m_Input
->
setText
(
text
);
}
}
void
QtWidgetInputProcessXMLParameter
::
DoCreateWidget
()
...
...
@@ -85,15 +88,13 @@ void QtWidgetInputProcessXMLParameter::SelectFile()
void
QtWidgetInputProcessXMLParameter
::
SetFileName
(
const
QString
&
value
)
{
// load xml file name
m_XMLParam
->
SetValue
(
value
.
toAscii
().
constData
());
// notify of value change
QString
key
(
m_XMLParam
->
GetKey
()
);
emit
ParameterChanged
(
key
);
GetModel
()
->
UpdateAllWidgets
();
if
(
m_XMLParam
->
SetFileName
(
value
.
toAscii
().
constData
()))
{
// notify of value change
QString
key
(
m_XMLParam
->
GetKey
()
);
emit
ParameterChanged
(
key
);
GetModel
()
->
UpdateAllWidgets
();
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment