I am writing a gui that is supposed to replace a fairly large shellscript in order to make the usage easier for not-so-technical people.
The script calls a certain program (
saga_cmd) multiple times with different parameters, i.e.
saga_cmd grid_calculus 8 -GRIDS "TriGridResult.sgrd;TpiGridResult.sgrd;SlopeResultGrid.sgrd" -RESULT "ResultGrid3".sgrd saga_cmd grid_calculus 9 -GRIDS "ResultGrid3.sgrd;DepthResultGrid.sgrd" -RESULT "ResultGrid".sgrd
where the second call relies on the output of the first call. There also are other parameters than filenames.
I can not change the structure of the script, but only put this into a gui where the parameters can be changed easily. The gui will be a Qt widgets application (c++). I found some helpful tips about the gui itself here, but I'm not sure how to implement the system calls in a good way and am looking for some kind of pattern. My searches led me to the Command design pattern, but it does not seem to fit, I thought of something like a builder pattern but as a class that would allow something like
string sagaLibrary; int sagaTool; ... sagaCmd().addParam(sagaLibrary).addParam(sagaTool).execute();
This is mostly a string builder, but you may get the idea. Surely there is a well-tried way on how to do this? Should there be functions like
addParamSagaLib and so on instead of a generic one? These could also handle parameters like
-GRID where there's a parameter name and the parameter itself in a better way I think.
Clarification: The user is allowed to change the values of the parameters and sometimes can choose to omit some of them, but the structure of each call is defined and must not be changed.