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. TCP/IP or serial port data is JSON : process it to C++ structure: and use that info # QT QML C++

TCP/IP or serial port data is JSON : process it to C++ structure: and use that info # QT QML C++

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 946 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.
  • P Offline
    P Offline
    Prasad_Socionext
    wrote on 17 Jul 2018, 15:51 last edited by
    #1

    Hi

    I have a scenario where I get data from a serial or TCPIP port in Json.
    I need to first of all check if the JSON string exist and then convert it into C++ structure and further use the info to process information to plot , display info on GUI extra.

    I used to do the whole process in Matlab and now I have to do it in QT QML.

    Right now I am able to:
    1.) Connect to serial or TCP port and send cmd to receive data.
    2.) I want to now check if JSON string is present in the data received and convert it into C++ structure.
    3.) Basically I will use the info from this structure to to display it on the QML GUI, or may be use the data points and plot them on the graph.

    could any one help me how to go about point 2 and 3. Any small existing example would be great.

    Regards
    Prasad

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 17 Jul 2018, 20:30 last edited by
      #2

      Hi,

      Since you are sing QtQuick, why not handle the JSON directly in the javascript portion of your code ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      P 1 Reply Last reply 19 Jul 2018, 09:30
      2
      • S SGaist
        17 Jul 2018, 20:30

        Hi,

        Since you are sing QtQuick, why not handle the JSON directly in the javascript portion of your code ?

        P Offline
        P Offline
        Prasad_Socionext
        wrote on 19 Jul 2018, 09:30 last edited by
        #3

        @SGaist hi any example on how to do that. Or could you put some light on it with some few sentences I would try to figure it out myself.

        A 1 Reply Last reply 19 Jul 2018, 09:36
        0
        • P Prasad_Socionext
          19 Jul 2018, 09:30

          @SGaist hi any example on how to do that. Or could you put some light on it with some few sentences I would try to figure it out myself.

          A Offline
          A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on 19 Jul 2018, 09:36 last edited by
          #4

          @Prasad_Socionext

          Have you already read https://doc.qt.io/qt-5.11/qtqml-cppintegration-overview.html ?

          And I agree with @SGaist, JSON is JavaScript Object Notation, so you should easily be able to handle JSON on the JavaScript side. For documentation on how to do that, use Google :)

          Qt has to stay free or it will die.

          1 Reply Last reply
          0

          2/4

          17 Jul 2018, 20:30

          • Login

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