Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main Repositories
otb
Commits
61dfdffe
Commit
61dfdffe
authored
6 years ago
by
Rashad Kanavath
Browse files
Options
Downloads
Patches
Plain Diff
ENH: address comments from code review
parent
dfdf6f9c
No related branches found
No related tags found
1 merge request
!74
Review: "add Wrapper/QGIS to generate qgis descriptors for processing plugin"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Modules/Wrappers/QGIS/src/otbQgisDescriptor.cxx
+15
-15
15 additions, 15 deletions
Modules/Wrappers/QGIS/src/otbQgisDescriptor.cxx
with
15 additions
and
15 deletions
Modules/Wrappers/QGIS/src/otbQgisDescriptor.cxx
+
15
−
15
View file @
61dfdffe
...
...
@@ -50,6 +50,9 @@ int main(int argc, char* argv[])
assert
(
!
appli
.
IsNull
());
const
std
::
string
group
=
appli
->
GetDocTags
().
size
()
>
0
?
appli
->
GetDocTags
()[
0
]
:
""
;
assert
(
!
group
.
empty
());
std
::
map
<
ParameterType
,
std
::
string
>
parameterTypeToString
;
parameterTypeToString
[
ParameterType_Empty
]
=
"QgsProcessingParameterBoolean"
;
parameterTypeToString
[
ParameterType_Bool
]
=
"QgsProcessingParameterBoolean"
;
...
...
@@ -106,12 +109,11 @@ int main(int argc, char* argv[])
Parameter
::
Pointer
param
=
appli
->
GetParameterByKey
(
appKeyList
[
i
]);
if
(
param
->
GetMandatory
())
{
ParameterType
type
=
appli
->
GetParameterType
(
appKeyList
[
i
]);
if
(
type
==
ParameterType_OutputImage
)
{
output_parameter_name
=
appKeyList
[
i
];
hasRasterOutput
=
true
;
}
if
(
appli
->
GetParameterType
(
appKeyList
[
i
])
==
ParameterType_OutputImage
)
{
output_parameter_name
=
appKeyList
[
i
];
hasRasterOutput
=
true
;
}
}
}
}
...
...
@@ -122,15 +124,13 @@ int main(int argc, char* argv[])
dFile
<<
module
<<
"|"
<<
output_parameter_name
<<
std
::
endl
;
dFile
<<
appli
->
GetDescription
()
<<
std
::
endl
;
const
std
::
string
group
=
appli
->
GetDocTags
().
size
()
>
0
?
appli
->
GetDocTags
()[
0
]
:
"UNCLASSIFIED"
;
dFile
<<
group
<<
std
::
endl
;
for
(
unsigned
int
i
=
0
;
i
<
nbOfParam
;
i
++
)
{
const
std
::
string
name
=
appKeyList
[
i
];
Parameter
::
Pointer
param
=
appli
->
GetParameterByKey
(
name
);
ParameterType
type
=
appli
->
GetParameterType
(
name
);
const
Parameter
::
Pointer
param
=
appli
->
GetParameterByKey
(
name
);
const
ParameterType
type
=
appli
->
GetParameterType
(
name
);
const
std
::
string
description
=
param
->
GetName
();
if
(
type
==
ParameterType_Group
||
type
==
ParameterType_OutputProcessXML
||
...
...
@@ -239,7 +239,7 @@ int main(int argc, char* argv[])
{
dFile
<<
"|4"
;
//QgsProcessing.TypeFile"
}
else
if
(
type
==
ParameterType_String
)
else
if
(
type
==
ParameterType_String
)
{
// Below line is interpreted in qgis processing as
// 1. default_value = None
...
...
@@ -248,7 +248,7 @@ int main(int argc, char* argv[])
// please refer to documetation of QgsProcessingParameterString.
default_value
=
"None|False"
;
}
else
if
(
type
==
ParameterType_StringList
)
else
if
(
type
==
ParameterType_StringList
)
{
// Below line is interpreted in qgis processing as
// 1. default_value = None
...
...
@@ -262,13 +262,13 @@ int main(int argc, char* argv[])
{
// default is None and nothing to add to dFile
}
else
if
(
type
==
ParameterType_ListView
)
else
if
(
type
==
ParameterType_ListView
)
{
// default is None and nothing to add to dFile
}
else
if
(
type
==
ParameterType_Bool
)
{
default_value
=
appli
->
GetParameterAsString
(
name
);
default_value
=
appli
->
GetParameterAsString
(
name
);
}
else
if
(
type
==
ParameterType_Choice
)
{
...
...
@@ -328,7 +328,7 @@ int main(int argc, char* argv[])
if
(
hasRasterOutput
)
{
dFile
<<
"*QgsProcessingParameterEnum|outputpixeltype|Output pixel type|u
n
it8;int;float;double|False|2|True"
<<
std
::
endl
;
dFile
<<
"*QgsProcessingParameterEnum|outputpixeltype|Output pixel type|ui
n
t8;int;float;double|False|2|True"
<<
std
::
endl
;
}
dFile
.
close
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment