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. Real Time data and Json File
Forum Updated to NodeBB v4.3 + New Features

Real Time data and Json File

Scheduled Pinned Locked Moved Unsolved General and Desktop
31 Posts 7 Posters 3.9k Views 2 Watching
  • 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.
  • D Offline
    D Offline
    deleted286
    wrote on 22 Mar 2021, 05:55 last edited by
    #1

    Hi everyone. I want to ask something.
    I have a project that should be drawing chart which includes the telemetry datas.
    The datas will come to me real time.
    Firstly, im keeping them in a json file, and then read this telemetry datas from json.
    I add them in a table widget, and choose which data am i want and create a chart with that selected ones.

    Im confusing is there any way to keep them in a json. Or is this a very bad idea which i'm trying to do?
    If it necessary i can share my code for check on

    J 1 Reply Last reply 22 Mar 2021, 06:25
    0
    • C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 22 Mar 2021, 05:58 last edited by
      #2

      @suslucoder said in Real Time data and Json File:

      The datas will come to me real time.

      This does not help at all - the data rate is important. Not some undefined requirement word like 'real time'.
      And no - storing data in json is not fast.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      D 1 Reply Last reply 22 Mar 2021, 05:58
      1
      • C Christian Ehrlicher
        22 Mar 2021, 05:58

        @suslucoder said in Real Time data and Json File:

        The datas will come to me real time.

        This does not help at all - the data rate is important. Not some undefined requirement word like 'real time'.
        And no - storing data in json is not fast.

        D Offline
        D Offline
        deleted286
        wrote on 22 Mar 2021, 05:58 last edited by deleted286
        #3

        @Christian-Ehrlicher Actually, im trying to create a config file which is the type of json.
        Datas coming from autopilot and all i know is, im receiving about 600 packet of data

        1 Reply Last reply
        0
        • C Offline
          C Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on 22 Mar 2021, 06:01 last edited by
          #4

          First you said you're getting data from somewhere and store it as json, now you read about a config file... can you please first think before you write something?

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          D 1 Reply Last reply 22 Mar 2021, 06:04
          1
          • C Christian Ehrlicher
            22 Mar 2021, 06:01

            First you said you're getting data from somewhere and store it as json, now you read about a config file... can you please first think before you write something?

            D Offline
            D Offline
            deleted286
            wrote on 22 Mar 2021, 06:04 last edited by
            #5

            @Christian-Ehrlicher
            Im storing it as json it is true. But my aim create a file like configuration file

            J 1 Reply Last reply 22 Mar 2021, 06:19
            0
            • D deleted286
              22 Mar 2021, 06:04

              @Christian-Ehrlicher
              Im storing it as json it is true. But my aim create a file like configuration file

              J Online
              J Online
              jsulm
              Lifetime Qt Champion
              wrote on 22 Mar 2021, 06:19 last edited by
              #6

              @suslucoder Why would you store data in a configuration file?!

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              D 1 Reply Last reply 22 Mar 2021, 06:26
              0
              • D deleted286
                22 Mar 2021, 05:55

                Hi everyone. I want to ask something.
                I have a project that should be drawing chart which includes the telemetry datas.
                The datas will come to me real time.
                Firstly, im keeping them in a json file, and then read this telemetry datas from json.
                I add them in a table widget, and choose which data am i want and create a chart with that selected ones.

                Im confusing is there any way to keep them in a json. Or is this a very bad idea which i'm trying to do?
                If it necessary i can share my code for check on

                J Offline
                J Offline
                JKSH
                Moderators
                wrote on 22 Mar 2021, 06:25 last edited by
                #7

                @suslucoder said in Real Time data and Json File:

                The datas will come to me real time.
                Firstly, im keeping them in a json file, and then read this telemetry datas from json.
                I add them in a table widget, and choose which data am i want and create a chart with that selected ones.
                Im confusing is there any way to keep them in a json. Or is this a very bad idea which i'm trying to do?

                It is a bad idea to store chartable data in a JSON file. A database (like an SQLite file, for example) is far more suitable.

                Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                D 1 Reply Last reply 22 Mar 2021, 06:27
                3
                • J jsulm
                  22 Mar 2021, 06:19

                  @suslucoder Why would you store data in a configuration file?!

                  D Offline
                  D Offline
                  deleted286
                  wrote on 22 Mar 2021, 06:26 last edited by
                  #8

                  @jsulm yeah, i dont know why im storing datas in json as a config file, my boss wants and i do thats all

                  1 Reply Last reply
                  0
                  • J JKSH
                    22 Mar 2021, 06:25

                    @suslucoder said in Real Time data and Json File:

                    The datas will come to me real time.
                    Firstly, im keeping them in a json file, and then read this telemetry datas from json.
                    I add them in a table widget, and choose which data am i want and create a chart with that selected ones.
                    Im confusing is there any way to keep them in a json. Or is this a very bad idea which i'm trying to do?

                    It is a bad idea to store chartable data in a JSON file. A database (like an SQLite file, for example) is far more suitable.

                    D Offline
                    D Offline
                    deleted286
                    wrote on 22 Mar 2021, 06:27 last edited by
                    #9

                    @JKSH thank you, but is there anything wrong which i do as i explain

                    J 1 Reply Last reply 22 Mar 2021, 06:45
                    0
                    • D deleted286
                      22 Mar 2021, 06:27

                      @JKSH thank you, but is there anything wrong which i do as i explain

                      J Offline
                      J Offline
                      JKSH
                      Moderators
                      wrote on 22 Mar 2021, 06:45 last edited by
                      #10

                      @suslucoder said in Real Time data and Json File:

                      is there anything wrong

                      Yes, there are problems. Every time new data packets arrive, you must rewrite the whole JSON file.

                      You won't notice anything wrong when the file is small. But as the file gets bigger, performance will become very bad, and you will wear out your hard drive/SSD faster. The risk of data corruption might also be higher.

                      my boss wants

                      I can't understand why your boss wants this.

                      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                      D 1 Reply Last reply 22 Mar 2021, 06:48
                      1
                      • J JKSH
                        22 Mar 2021, 06:45

                        @suslucoder said in Real Time data and Json File:

                        is there anything wrong

                        Yes, there are problems. Every time new data packets arrive, you must rewrite the whole JSON file.

                        You won't notice anything wrong when the file is small. But as the file gets bigger, performance will become very bad, and you will wear out your hard drive/SSD faster. The risk of data corruption might also be higher.

                        my boss wants

                        I can't understand why your boss wants this.

                        D Offline
                        D Offline
                        deleted286
                        wrote on 22 Mar 2021, 06:48 last edited by
                        #11

                        @JKSH he thinks that keeping datas on json == creating a config file. Like settings folder. But i know it isnt, so i dont know how can i handle with that issue

                        J 1 Reply Last reply 22 Mar 2021, 06:52
                        0
                        • D deleted286
                          22 Mar 2021, 06:48

                          @JKSH he thinks that keeping datas on json == creating a config file. Like settings folder. But i know it isnt, so i dont know how can i handle with that issue

                          J Online
                          J Online
                          jsulm
                          Lifetime Qt Champion
                          wrote on 22 Mar 2021, 06:52 last edited by
                          #12

                          @suslucoder said in Real Time data and Json File:

                          so i dont know how can i handle with that issue

                          You could explain to him the disadvantages shown by @JKSH

                          https://forum.qt.io/topic/113070/qt-code-of-conduct

                          D 1 Reply Last reply 22 Mar 2021, 06:54
                          0
                          • J jsulm
                            22 Mar 2021, 06:52

                            @suslucoder said in Real Time data and Json File:

                            so i dont know how can i handle with that issue

                            You could explain to him the disadvantages shown by @JKSH

                            D Offline
                            D Offline
                            deleted286
                            wrote on 22 Mar 2021, 06:54 last edited by
                            #13

                            @jsulm thank you

                            J 1 Reply Last reply 22 Mar 2021, 07:04
                            0
                            • D deleted286
                              22 Mar 2021, 06:54

                              @jsulm thank you

                              J Offline
                              J Offline
                              J.Hilk
                              Moderators
                              wrote on 22 Mar 2021, 07:04 last edited by
                              #14

                              @suslucoder well, you could only save the data as a json file, on program close, or something similar.

                              Fits your requirement and he will never know that the actual data processing/storage is something different.

                              Doesn't hurt to have redundancies either.


                              Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                              Q: What's that?
                              A: It's blue light.
                              Q: What does it do?
                              A: It turns blue.

                              J JonBJ 2 Replies Last reply 22 Mar 2021, 07:09
                              2
                              • J J.Hilk
                                22 Mar 2021, 07:04

                                @suslucoder well, you could only save the data as a json file, on program close, or something similar.

                                Fits your requirement and he will never know that the actual data processing/storage is something different.

                                Doesn't hurt to have redundancies either.

                                J Offline
                                J Offline
                                JKSH
                                Moderators
                                wrote on 22 Mar 2021, 07:09 last edited by
                                #15

                                @J-Hilk said in Real Time data and Json File:

                                you could only save the data as a json file, on program close, or something similar.

                                Good idea; this helps avoid the performance issues and hard drive wearing. Beware though: If the program crashes, all of the data will be lost.

                                Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                                D 1 Reply Last reply 22 Mar 2021, 07:11
                                0
                                • J JKSH
                                  22 Mar 2021, 07:09

                                  @J-Hilk said in Real Time data and Json File:

                                  you could only save the data as a json file, on program close, or something similar.

                                  Good idea; this helps avoid the performance issues and hard drive wearing. Beware though: If the program crashes, all of the data will be lost.

                                  D Offline
                                  D Offline
                                  deleted286
                                  wrote on 22 Mar 2021, 07:11 last edited by
                                  #16

                                  @JKSH i spoke with him, he says he wants a config file with json.

                                  It should include the name of the data, and the type. Like
                                  Name: string
                                  Age: int
                                  Height:float etc.

                                  I dont know how to create such a file

                                  KroMignonK 1 Reply Last reply 22 Mar 2021, 08:27
                                  0
                                  • J J.Hilk
                                    22 Mar 2021, 07:04

                                    @suslucoder well, you could only save the data as a json file, on program close, or something similar.

                                    Fits your requirement and he will never know that the actual data processing/storage is something different.

                                    Doesn't hurt to have redundancies either.

                                    JonBJ Offline
                                    JonBJ Offline
                                    JonB
                                    wrote on 22 Mar 2021, 08:19 last edited by
                                    #17

                                    @J-Hilk

                                    and he will never know that the actual data processing/storage is something different.

                                    ROFL. Are you now advising Qt programmers to deceive their bosses? ;-)

                                    @suslucoder

                                    I dont know how to create such a file

                                    What don't you know how to do? You have done JSON stuff, haven't you, so what is different about this task?

                                    J D 2 Replies Last reply 22 Mar 2021, 08:34
                                    0
                                    • D deleted286
                                      22 Mar 2021, 07:11

                                      @JKSH i spoke with him, he says he wants a config file with json.

                                      It should include the name of the data, and the type. Like
                                      Name: string
                                      Age: int
                                      Height:float etc.

                                      I dont know how to create such a file

                                      KroMignonK Offline
                                      KroMignonK Offline
                                      KroMignon
                                      wrote on 22 Mar 2021, 08:27 last edited by
                                      #18

                                      @suslucoder said in Real Time data and Json File:

                                      I dont know how to create such a file

                                      Have you tried to read JSON documentation?
                                      ==> https://doc.qt.io/qt-5/json.html
                                      ==> https://doc.qt.io/qt-5/qtcore-serialization-savegame-example.html

                                      It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

                                      1 Reply Last reply
                                      1
                                      • JonBJ JonB
                                        22 Mar 2021, 08:19

                                        @J-Hilk

                                        and he will never know that the actual data processing/storage is something different.

                                        ROFL. Are you now advising Qt programmers to deceive their bosses? ;-)

                                        @suslucoder

                                        I dont know how to create such a file

                                        What don't you know how to do? You have done JSON stuff, haven't you, so what is different about this task?

                                        J Offline
                                        J Offline
                                        J.Hilk
                                        Moderators
                                        wrote on 22 Mar 2021, 08:34 last edited by
                                        #19

                                        @JonB said in Real Time data and Json File:

                                        ROFL. Are you now advising Qt programmers to deceive their bosses? ;-)

                                        😱 me, never!

                                        The boss will get what he want's, in the end. Bosses always only care about the end result 🤷‍♂️


                                        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                                        Q: What's that?
                                        A: It's blue light.
                                        Q: What does it do?
                                        A: It turns blue.

                                        D 1 Reply Last reply 22 Mar 2021, 10:29
                                        2
                                        • J J.Hilk
                                          22 Mar 2021, 08:34

                                          @JonB said in Real Time data and Json File:

                                          ROFL. Are you now advising Qt programmers to deceive their bosses? ;-)

                                          😱 me, never!

                                          The boss will get what he want's, in the end. Bosses always only care about the end result 🤷‍♂️

                                          D Offline
                                          D Offline
                                          deleted286
                                          wrote on 22 Mar 2021, 10:29 last edited by
                                          #20

                                          @J-Hilk ahahahha you made me laugh so much

                                          I create the file, but i dont know how to read such a complex json :D
                                          Can anybody help?

                                             {
                                          "GPS": [
                                              {
                                          
                                                  "GPS ID": ["integer", "0"],
                                                  "GPS Mod": ["integer", "1"],
                                                  "GPS Utc": ["float", "2"],
                                                  "GPS Latitude": ["float", "3"],
                                                  "GPS Longitude": ["float", "4"],
                                                  "GPS Alt":  ["float", "5"],
                                                  "GPS Yer Hızı":  ["float", "6"],
                                                  "GPS Dikey Hız":["float", "7"],
                                                  "GPS Yatay Doğruluk":  ["float", "8"],
                                                  "GPS Dikey Doğruluk": ["float", "9"],
                                                  "GPS Yer Başı":  ["float", "10"],
                                                  "GPS Hdop": ["float", "11"],
                                                  "GPS Vdop": ["float", "12"],
                                                  "GPS Uydu Sayısı": ["integer", "13"],
                                                  "GPS Boy":  ["integer", "14"]
                                              } 
                                            ],
                                          
                                          
                                          "Imu": [
                                           {
                                               
                                              "HW ID": ["integer", "0"],
                                                  "HW Motor": ["float", "1"],
                                                  "HW Motor1": ["float", "2"],
                                                  "HW Motor2": ["float", "3"],
                                                  "HW Motor3": ["float", "4"],
                                                  "HW Motor4": ["float", "5"],
                                                  "HW P": ["float", "6"],
                                                  "HW R": ["float", "7"],
                                                  "HW Y": ["float", "8"],
                                                  "HW Boy": ["float", "9"]
                                                 }
                                             ]
                                               }
                                          
                                          1 Reply Last reply
                                          0

                                          5/31

                                          22 Mar 2021, 06:04

                                          topic:navigator.unread, 26
                                          • Login

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