Refactor XML parameters
Currently saving and loading application parameters to XML files is handled by two classes:
InputProcessXMLParameter. They are "parameters" in the sense of the application framework. They represent the "-inxml" and "-outxml" command line arguments in the CLI interface, and the load/save widgets in GUI. The actual calls to the XML reading/writing code are made inside UpdateParameters() for input, and inside ExecuteAndWriteOutput() for output.
The goal of this refactoring is double:
Separate XML operations from application's execution and UpdateParameters()
Replace the GUI widgets for XML load/save by a simple menu:
This MR does this with a significant refactoring:
InputProcessXMLParameterand their Qt wrappers
- Add public Application API:
SaveParametersToXML(filename)(in C++ and Python)
- Remove support for
-inxmlwithout application name in ApplicationLauncherCommandLine (somewhat of a niche use case)
Backwards compatibility of the otbcli interface is maintained. If argv contains
-outxml, the command line launcher will call LoadParametersFromXML or SaveParametersFromXML and behave as before. So they are command line arguments but not application parameters (like -help, -progress, -testenv and -version).
Backwards breaking changes:
- In GUI and Python, it is now possible to write XML parameters without executing the application. In that case parameters with the "output" role will not be written to the xml file.
SetParameterString("outxml")will not work anymore, because parameters "inxml" and "outxml" are removed. Use
See above. It will also be helpful for solving #1842 (closed)
The copyright owner is CNES and has signed the ORFEO ToolBox Contributor License Agreement.
Check before merging:
- All discussions are resolved
- At least 2
👍votes from core developers, no 👎vote.
- The feature branch is (reasonably) up-to-date with the base branch
- Dashboard is green
- Copyright owner has signed the ORFEO ToolBox Contributor License Agreement
- Optionally, run
git diff develop... -U0 --no-color | clang-format-diff.py -p1 -ion latest changes and commit