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
0f4d7d57
Commit
0f4d7d57
authored
Oct 09, 2020
by
Julien Cabieces
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ENH: map parameter type list_view to QgsProcessingParameterEnum
parent
6e85bdc9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
30 deletions
+9
-30
Modules/Wrappers/QGIS/src/otbQgisDescriptor.cxx
Modules/Wrappers/QGIS/src/otbQgisDescriptor.cxx
+9
-30
No files found.
Modules/Wrappers/QGIS/src/otbQgisDescriptor.cxx
View file @
0f4d7d57
...
...
@@ -74,18 +74,8 @@ int main(int argc, char* argv[])
parameterTypeToString
[
ParameterType_Directory
]
=
"QgsProcessingParameterFile"
;
// TODO
parameterTypeToString
[
ParameterType_StringList
]
=
"QgsProcessingParameterString"
;
// ListView parameters are treated as plain string (QLineEdit) in qgis processing ui.
// This seems rather unpleasant when comparing Qgis processing with Monteverdi/Mapla in OTB
// We tried to push something simple with checkboxes but its too risky for this version
// and clock is ticking...
parameterTypeToString
[
ParameterType_ListView
]
=
"QgsProcessingParameterString"
;
// For next update of plugin code ListView should use a custom widget wrapper and behave
// exactly like OTB Mapla. And this #if 0 block is our TODO remainder.
#if 0
parameterTypeToString[ParameterType_ListView] = "OTBParameterListView";
#endif
parameterTypeToString
[
ParameterType_ListView
]
=
"QgsProcessingParameterEnum"
;
const
std
::
vector
<
std
::
string
>
appKeyList
=
appli
->
GetParametersKeys
(
true
);
const
unsigned
int
nbOfParam
=
appKeyList
.
size
();
...
...
@@ -155,24 +145,6 @@ int main(int argc, char* argv[])
return
EXIT_FAILURE
;
}
std
::
string
qgis_type
=
it
->
second
;
#if 0
if (type == ParameterType_ListView)
{
ListViewParameter *lv_param = dynamic_cast<ListViewParameter*>(param.GetPointer());
std::cerr << "lv_param->GetSingleSelection()" << lv_param->GetSingleSelection() << std::endl;
if (lv_param->GetSingleSelection())
{
qgis_type = "QgsProcessingParameterEnum";
std::vector<std::string> key_list = appli->GetChoiceKeys(name);
std::string values = "";
for( auto k : key_list)
values += k + ";";
values.pop_back();
dFile << "|" << values ;
}
}
#endif
bool
isEpsgCode
=
false
;
...
...
@@ -265,7 +237,14 @@ int main(int argc, char* argv[])
}
else
if
(
type
==
ParameterType_ListView
)
{
// default is None and nothing to add to dFile
ListViewParameter
*
lv_param
=
dynamic_cast
<
ListViewParameter
*>
(
param
.
GetPointer
());
std
::
vector
<
std
::
string
>
key_list
=
appli
->
GetChoiceKeys
(
name
);
std
::
string
values
=
""
;
for
(
auto
k
:
key_list
)
values
+=
k
+
";"
;
values
.
pop_back
();
dFile
<<
"|"
<<
values
;
dFile
<<
"|"
<<
(
lv_param
->
GetSingleSelection
()
?
"False"
:
"True"
);
}
else
if
(
type
==
ParameterType_Bool
)
{
...
...
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