void Dialog::request_pressure_slot()
{
    //-----------------------------------------------------
    // Reading pressure value from previous request allows
    // max time for pressure measurement to be received.
    // Skip read prior to first request.
    //-----------------------------------------------------
    if (first_read == false) {
        serialBuffer = rtpUSB->readAll();
        int chop_point = serialBuffer.indexOf("\n") - 1;
        serialBuffer1 = serialBuffer.left(chop_point);
        if (!serialBuffer1.isEmpty()) {
            pressureData = serialBuffer1.toDouble()/100;
            serialBuffer.clear();
            serialBuffer1.clear();
            emit get_pressure_data(pressureData);
        }
    } else {
        rtpUSB->clear();
        serialBuffer.clear();
        serialBuffer1.clear();
        first_read = false;
    }
    //-----------------------------------------------------
    // request a pressure measurement by sending cmd
    //-----------------------------------------------------
    rtpUSB->write("4\n");
}