Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Run 2nd program from Qt and send constantly infromation from 2nd program to Qt.
Forum Update on Monday, May 27th 2025

Run 2nd program from Qt and send constantly infromation from 2nd program to Qt.

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 1.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nnicou
    wrote on 10 Oct 2016, 12:32 last edited by nnicou 10 Oct 2016, 12:33
    #1

    Hello all,

    I have a really big simulator and i need to create a gui for a part it(run it from command line and i direct simulator through arguments)

    I cant extract that small part of from the whole simulator and i cant create gui on top of it(i guess). So i chose to make a seperate Gui through Qt and then run the application within Qt with the given arguements(take from gui) But how i cant constantly take infrormation from the application run in terminal?(Visualize Internetwork simulator - i need to know every cycle where is each flit/packet)

    I did something like this with threads and sockets but with 2 command line programs.
    What options do i have ?

    Thank you in advance!!

    K 1 Reply Last reply 10 Oct 2016, 13:24
    0
    • N nnicou
      10 Oct 2016, 12:32

      Hello all,

      I have a really big simulator and i need to create a gui for a part it(run it from command line and i direct simulator through arguments)

      I cant extract that small part of from the whole simulator and i cant create gui on top of it(i guess). So i chose to make a seperate Gui through Qt and then run the application within Qt with the given arguements(take from gui) But how i cant constantly take infrormation from the application run in terminal?(Visualize Internetwork simulator - i need to know every cycle where is each flit/packet)

      I did something like this with threads and sockets but with 2 command line programs.
      What options do i have ?

      Thank you in advance!!

      K Offline
      K Offline
      koahnig
      wrote on 10 Oct 2016, 13:24 last edited by
      #2

      @nnicou

      Hi and welcome to devnet forum

      You are probably already aware of the method to start an external application through QProcess

      This is certaily one way to start your simulator. If your simulator is only available as readily compiled executable, the only way would be to scan the outputs and extract the required information e.g. through signal readyReadStandardOutput.

      If you have access to the source of your simulator you can add for instance QTcpSocket/QTcpServer and communicate between your GUI app and the simulator. Or you can do also a mix of both.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      2
      • N Offline
        N Offline
        nnicou
        wrote on 10 Oct 2016, 18:23 last edited by
        #3

        Thank you alot for the advice. I have access to the source code and i guess i will need to use sockets to collect all the data i need and then forward it to my Gui App . The first option may not be helpful due to the fact that the data i need are not output but data from components of the simulator. that i need to extract

        K 1 Reply Last reply 10 Oct 2016, 21:52
        0
        • N nnicou
          10 Oct 2016, 18:23

          Thank you alot for the advice. I have access to the source code and i guess i will need to use sockets to collect all the data i need and then forward it to my Gui App . The first option may not be helpful due to the fact that the data i need are not output but data from components of the simulator. that i need to extract

          K Offline
          K Offline
          koahnig
          wrote on 10 Oct 2016, 21:52 last edited by
          #4

          @nnicou

          For sure the first option is only possible when you have enough information output to cout and/or cerr. I have used this also and it works, but might be a bit crude.

          The option through TCP sockets allows more precision especially timewise, but this depends on a lot of different factors.

          Vote the answer(s) that helped you to solve your issue(s)

          N 1 Reply Last reply 11 Oct 2016, 06:52
          0
          • K koahnig
            10 Oct 2016, 21:52

            @nnicou

            For sure the first option is only possible when you have enough information output to cout and/or cerr. I have used this also and it works, but might be a bit crude.

            The option through TCP sockets allows more precision especially timewise, but this depends on a lot of different factors.

            N Offline
            N Offline
            nnicou
            wrote on 11 Oct 2016, 06:52 last edited by
            #5

            @koahnig Hmm i was thinking about precision but the good part of the simulator is event driven i hope this helps me if i go with sockets options and I hope this method will not add extra overhead to the simulation.

            Thank you alot and i will start working and see which option suits my demands.

            1 Reply Last reply
            0

            1/5

            10 Oct 2016, 12:32

            • Login

            • Login or register to search.
            1 out of 5
            • First post
              1/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved