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. Can calling a slot too often lead to delays in data transfer?

Can calling a slot too often lead to delays in data transfer?

Scheduled Pinned Locked Moved Unsolved General and Desktop
signals & slotsble
7 Posts 3 Posters 967 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.
  • S Offline
    S Offline
    SpaceToon
    wrote on 18 Nov 2020, 11:01 last edited by SpaceToon
    #1
    This post is deleted!
    J 1 Reply Last reply 18 Nov 2020, 12:11
    0
    • S SpaceToon
      18 Nov 2020, 11:01

      This post is deleted!

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 18 Nov 2020, 12:11 last edited by
      #2

      @SpaceToon said in Can calling a slot too often lead to delays in data transfer?:

      My problem is that for one device the data "arrive" and are displayed and plotted on the GUI with a delay but for the other device not

      Are these different devices (I mean different hardware)?
      The frequency of calling the slot shouldn't be a problem, but the time needed to execute the slot.

      Just a note - this is not the correct way to convert a QByteArray to a string:

      newValue = newValue + (QString)value;
      

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

      S 1 Reply Last reply 18 Nov 2020, 12:20
      1
      • J jsulm
        18 Nov 2020, 12:11

        @SpaceToon said in Can calling a slot too often lead to delays in data transfer?:

        My problem is that for one device the data "arrive" and are displayed and plotted on the GUI with a delay but for the other device not

        Are these different devices (I mean different hardware)?
        The frequency of calling the slot shouldn't be a problem, but the time needed to execute the slot.

        Just a note - this is not the correct way to convert a QByteArray to a string:

        newValue = newValue + (QString)value;
        
        S Offline
        S Offline
        SpaceToon
        wrote on 18 Nov 2020, 12:20 last edited by SpaceToon
        #3

        @jsulm Thank you! Yes these two devices are different hardware, but the same type of sensor

        The frequency of calling the slot shouldn't be a problem, but the time needed to execute the slot.

        So is that something I can influence? Since there is one slot for each device which are independent, why it is for one slot not a problem but for the other one it is? And do you think putting the slots, signals and function of the second device in another thread (worker thread) would help out? As I said, after deploying the app and starting 2 instances of it, the problem still occured for one device.

        Just a note - this is not the correct way to convert a QByteArray to a string:

        newValue = newValue + (QString)value;

        Hmm, but this worked for me so far..

        J 1 Reply Last reply 18 Nov 2020, 12:26
        0
        • S SpaceToon
          18 Nov 2020, 12:20

          @jsulm Thank you! Yes these two devices are different hardware, but the same type of sensor

          The frequency of calling the slot shouldn't be a problem, but the time needed to execute the slot.

          So is that something I can influence? Since there is one slot for each device which are independent, why it is for one slot not a problem but for the other one it is? And do you think putting the slots, signals and function of the second device in another thread (worker thread) would help out? As I said, after deploying the app and starting 2 instances of it, the problem still occured for one device.

          Just a note - this is not the correct way to convert a QByteArray to a string:

          newValue = newValue + (QString)value;

          Hmm, but this worked for me so far..

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 18 Nov 2020, 12:26 last edited by
          #4

          @SpaceToon said in Can calling a slot too often lead to delays in data transfer?:

          why it is for one slot not a problem bot for the other one it is?

          I don't know. Mybe something wrong with one of the devices?
          What is not clear: is this slot used for both devices ConnectionClass::updateDataSlot? If so, are you aware that this slot writes data into same newValue even if you use two ConnectionClass instances?

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

          S 1 Reply Last reply 18 Nov 2020, 12:32
          0
          • J jsulm
            18 Nov 2020, 12:26

            @SpaceToon said in Can calling a slot too often lead to delays in data transfer?:

            why it is for one slot not a problem bot for the other one it is?

            I don't know. Mybe something wrong with one of the devices?
            What is not clear: is this slot used for both devices ConnectionClass::updateDataSlot? If so, are you aware that this slot writes data into same newValue even if you use two ConnectionClass instances?

            S Offline
            S Offline
            SpaceToon
            wrote on 18 Nov 2020, 12:32 last edited by SpaceToon
            #5

            I don't know. Mybe something wrong with one of the devices?

            It was also my first thought that a device might be broken. But since the problem occurred with both devices (sometimes with one, sometimes with the other, I cannot influence this) it must have something to do with my application.

            What is not clear: is this slot used for both devices ConnectionClass::updateDataSlot? If so, are you aware that this slot writes >data into same newValue even if you use two ConnectionClass instances?

            I have my own updateData slot for the first device and an updateData_secondDevice Slot for the other device. So only for testing I copied the complete code for one device for the other device so that they are independent of each other. Of course you shouldn't copy code unnecessarily, but it was only for testing purposes to see if it would work with two devices at the same time at all.

            EDIT: Here is where I get the conversion from QByteArray to QString: https://stackoverflow.com/a/37802857

            J 1 Reply Last reply 18 Nov 2020, 13:05
            0
            • S SpaceToon
              18 Nov 2020, 12:32

              I don't know. Mybe something wrong with one of the devices?

              It was also my first thought that a device might be broken. But since the problem occurred with both devices (sometimes with one, sometimes with the other, I cannot influence this) it must have something to do with my application.

              What is not clear: is this slot used for both devices ConnectionClass::updateDataSlot? If so, are you aware that this slot writes >data into same newValue even if you use two ConnectionClass instances?

              I have my own updateData slot for the first device and an updateData_secondDevice Slot for the other device. So only for testing I copied the complete code for one device for the other device so that they are independent of each other. Of course you shouldn't copy code unnecessarily, but it was only for testing purposes to see if it would work with two devices at the same time at all.

              EDIT: Here is where I get the conversion from QByteArray to QString: https://stackoverflow.com/a/37802857

              J Offline
              J Offline
              JonB
              wrote on 18 Nov 2020, 13:05 last edited by
              #6

              @SpaceToon said in Can calling a slot too often lead to delays in data transfer?:

              EDIT: Here is where I get the conversion from QByteArray to QString: https://stackoverflow.com/a/37802857

              Then follow either of the solutions given there, not the code you wrote!

              S 1 Reply Last reply 18 Nov 2020, 13:27
              0
              • J JonB
                18 Nov 2020, 13:05

                @SpaceToon said in Can calling a slot too often lead to delays in data transfer?:

                EDIT: Here is where I get the conversion from QByteArray to QString: https://stackoverflow.com/a/37802857

                Then follow either of the solutions given there, not the code you wrote!

                S Offline
                S Offline
                SpaceToon
                wrote on 18 Nov 2020, 13:27 last edited by
                #7

                @JonB Oh, I thought I had the same, fixed it, thanks

                1 Reply Last reply
                0

                6/7

                18 Nov 2020, 13:05

                • Login

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