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. QT C++ How can I inform the user after the sQSerialPort reading process is finished?
Forum Updated to NodeBB v4.3 + New Features

QT C++ How can I inform the user after the sQSerialPort reading process is finished?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 301 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.
  • T Offline
    T Offline
    TheCeylann
    wrote on last edited by
    #1

    I have a program that reads data over the serial port. I am collecting the incoming data into a buffer and the incoming data has no fixed value. I want to notify the user after the data is finished reading How can I do this?

    Here I check if data is coming through the serial port. How can I check this after all the data is in?

    serialInput = serial.getString();
      serial.clearAll();
    
      serialInput = serialInput.trimmed();
    
      if (serialInput.isEmpty() == false) {
        parser.parse(serialInput, 0 == 0, 0 == 2); 
        QStringList labelList = parser.getStringListLabels();
        QList < double > numericDataList = parser.getListNumericValues();
    
    
        QList < long > timeStamps = parser.getListTimeStamp();
    
        this -> processChart(labelList, numericDataList, timeStamps);
    
        this -> saveToRAM(labelList, numericDataList, timeStamps);
    
      }
    }
    
    Christian EhrlicherC 1 Reply Last reply
    0
    • T TheCeylann

      I have a program that reads data over the serial port. I am collecting the incoming data into a buffer and the incoming data has no fixed value. I want to notify the user after the data is finished reading How can I do this?

      Here I check if data is coming through the serial port. How can I check this after all the data is in?

      serialInput = serial.getString();
        serial.clearAll();
      
        serialInput = serialInput.trimmed();
      
        if (serialInput.isEmpty() == false) {
          parser.parse(serialInput, 0 == 0, 0 == 2); 
          QStringList labelList = parser.getStringListLabels();
          QList < double > numericDataList = parser.getListNumericValues();
      
      
          QList < long > timeStamps = parser.getListTimeStamp();
      
          this -> processChart(labelList, numericDataList, timeStamps);
      
          this -> saveToRAM(labelList, numericDataList, timeStamps);
      
        }
      }
      
      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @TheCeylann said in QT C++ How can I inform the user after the sQSerialPort reading process is finished?:

      I want to notify the user after the data is finished reading How can I do this?

      How do you know that all data is transferred?

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

      1 Reply Last reply
      1
      • T Offline
        T Offline
        TheCeylann
        wrote on last edited by
        #3

        After all the data has been sent, if I send another data indicating that the data has been sent, can I do this by checking the latest data?

        Christian EhrlicherC 1 Reply Last reply
        0
        • T TheCeylann

          After all the data has been sent, if I send another data indicating that the data has been sent, can I do this by checking the latest data?

          Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @TheCeylann When you send data over a stream you have to add some kind of protocol so you know when your data is complete. How you implement it is up to you.

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

          1 Reply Last reply
          3

          • Login

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