← Back to team overview

kicad-developers team mailing list archive

Re: executing child processes

 

On 9/24/2016 7:51 PM, Cirilo Bernardo wrote:
> As part of improving the STEP Export code to protect KiCad
> from a hung child process and also to give the use the option
> to cancel a long Export operation, I am doing some preliminary
> design work on a dialog for launching such child processes.
> My ideas so far:
> 
> 1. Define a dialog which will:
>  a. take a command line and optional environment pointer
>  b. on ShowModal()  (+ override Show() to use ShowModal/EndModal),
>     execute the command argument asynchronously

You should not call ShowModal() or EndModal() anywhere in your dialog.
Your assuming the user is going to show the dialog in the modal mode
which may not be correct.  We currently have 3 potential dialog show
modes, modal, modeless, and quasimodal.  Just overload the OnCancel()
button event handler and let the underlying dialog modality code do it's
job.

>  c. display the command being executed and its parameters
>  d. display the stdout + stderr messages from the child process
>  e. offer a CANCEL and OK button; OK is grayed out
>     until the process terminates, while CANCEL is active
>     until the process terminates and clicking CANCEL will kill
>     the child process.

Everything else looks good.

> 
> This dialog essentially provides synchronous execution of the
> command while making it possible to (a) cancel the process,
> and (b) see the stdout + stderr output which may not otherwise
> be accessible to the user. The dialog may be of some use in
> other cases where we have synchronous execution such as
> the BOM export.
> 
> Any comments or suggestions, including other synchronous
> child processes I may have missed?
> 
> - Cirilo
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
> 


Follow ups

References