Results 1 to 5 of 5

Thread: Discussion on GUI and Program-Solver Interaction

  1. #1
    Join Date
    Jan 2015
    Posts
    8
    Thanks
    7
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Discussion on GUI and Program-Solver Interaction

    Hi there,

    I have written my numerical solution (for fluid dynamics) in Fortran. I have used Qt to make an application to serve as a GUI for my code.

    So far, Qt application takes input from the user and save them in a text file. Then, the text file will serve as input for the Fortran code which solves the problem.
    Solving the problem, Fortran saves results back into some other text files which can be loaded into Qt application for further analysis.

    I am not expert in application development. My question is that, is this the simple and good way to do GUI and Program-Solver interaction, or should I try other ways?

    Thanks for hints.

    Omid

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,546 Times in 1,496 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Discussion on GUI and Program-Solver Interaction

    Sounds good to me.
    A simple, yet effective solution.

    Do I assume correctly that the solver runs as a child process of the GUI?

    Cheers,
    _

  3. The following user says thank you to anda_skoa for this useful post:

    Omid123 (23rd February 2015)

  4. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,771
    Thanks
    262
    Thanked 773 Times in 763 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: Discussion on GUI and Program-Solver Interaction

    I think a similar solution is used for many computational chemistry problems, where legacy Fortran code has been used forever, but where more modern GUIs are desired for entering parameters and reviewing results, all through the use of text files for input or output.

    Further to anda_skoa's comment - if the Fortran program can be run as a child process of the GUI application, then you can create the parameters, run the process, wait for it to finish, and then read the results back in. It will appear to the user as if the GUI program is the only thing running.

    If the computations are intensive and take a while, then you can offer to play a movie until the process finishes. Qt can do that, too. :-)

  5. #4
    Join Date
    Jan 2015
    Posts
    8
    Thanks
    7
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Discussion on GUI and Program-Solver Interaction

    thanks for the note.
    the GUI, depending on which parameters the user activate, will save different contents in the 'text file'. Then, FORTRAN which should read the 'text file', has several "if statement". Do you suggest to use a better way of transferring the 'input data' from GUI to FORTRAN? maybe using XML??

    Omid

  6. #5
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,771
    Thanks
    262
    Thanked 773 Times in 763 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: Discussion on GUI and Program-Solver Interaction

    Do you suggest to use a better way of transferring the 'input data' from GUI to FORTRAN?
    No. As they say, if it isn't broken, don't fix it. What I was suggesting is, that if you can run the FORTRAN program as a sub-process from the GUI and then display the results in the GUI when the computation is finished, the user will think that he is directly controlling the computation.

    I do not know how you run your FORTRAN program now. It sounds like it is started manually from the command line. With Qt, you can run this program from inside your GUI (maybe in response to the user clicking "Run" ) and avoid using the command prompt at all.

Similar Threads

  1. Discussion about developing an onscreen keyboard in Qt
    By montylee in forum Qt Programming
    Replies: 6
    Last Post: 2nd January 2009, 21:09
  2. brief discussion IProjectcomponent
    By ramakrishnach in forum General Discussion
    Replies: 3
    Last Post: 1st May 2006, 09:19
  3. [DevQt] General discussion
    By GreyGeek in forum Qt-based Software
    Replies: 40
    Last Post: 25th April 2006, 09:24

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.