abcfantasy
Programmer
Hello, there is this command line application and I need to create a GUI application for it to simplify work and increase efficiency. The way I'm doing it is that the graphical application runs the command line program, sends all input to it and receives all output.
While building it however, I had to put a lot of dirty hacks to get around small issues, but now I am starting to doubt whether my approach is the best. This is what's happening:
My application sends input to the command line process and receives the output asynchronously. The output needs to be analyzed, because some will be displayed to the user, and some will be used internally by the GUI. Since the output is received asynchronously, it's very hard to keep track of which output is a response to which input. This is what can happen for example:
Input:
- Send a command to the command line program to get the list of variables.
- Send a command to output "Hello world"
Output:
1. varA
2. varB
3. Hello world
4. varC
As you can see one command's output can be mixed with another. I'm currently using a lot of dirty hacks as workarounds, but this is making my application not robust at all.
Doing the output synchronous might help, but due to the many inputs and outputs, I fear there will be few time intervals where it hangs.
Anyone can help me on this? I can give more information.
It will be much appreciated.
Andrew
|| ABC
While building it however, I had to put a lot of dirty hacks to get around small issues, but now I am starting to doubt whether my approach is the best. This is what's happening:
My application sends input to the command line process and receives the output asynchronously. The output needs to be analyzed, because some will be displayed to the user, and some will be used internally by the GUI. Since the output is received asynchronously, it's very hard to keep track of which output is a response to which input. This is what can happen for example:
Input:
- Send a command to the command line program to get the list of variables.
- Send a command to output "Hello world"
Output:
1. varA
2. varB
3. Hello world
4. varC
As you can see one command's output can be mixed with another. I'm currently using a lot of dirty hacks as workarounds, but this is making my application not robust at all.
Doing the output synchronous might help, but due to the many inputs and outputs, I fear there will be few time intervals where it hangs.
Anyone can help me on this? I can give more information.
It will be much appreciated.
Andrew
|| ABC