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?
QtWS25 Last Chance

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 966 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 last edited by SpaceToon
    #1
    This post is deleted!
    jsulmJ 1 Reply Last reply
    0
    • S SpaceToon

      This post is deleted!

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on 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
      1
      • jsulmJ jsulm

        @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 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..

        jsulmJ 1 Reply Last reply
        0
        • S SpaceToon

          @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..

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on 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
          0
          • jsulmJ jsulm

            @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 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

            JonBJ 1 Reply Last reply
            0
            • S SpaceToon

              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

              JonBJ Online
              JonBJ Online
              JonB
              wrote on 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
              0
              • JonBJ JonB

                @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 last edited by
                #7

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

                1 Reply Last reply
                0

                • Login

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