Changeset - 130806291698
[Not reviewed]
default
0 2 0
Hasan Yavuz Ă–ZDERYA - 10 years ago 2015-05-29 08:45:03
hy@ozderya.net
improved error messages by using qWarning and qCritical
2 files changed with 10 insertions and 11 deletions:
0 comments (0 inline, 0 general)
mainwindow.cpp
Show inline comments
 
@@ -247,7 +247,7 @@ void MainWindow::onDataReadyASCII()
 
        }
 
        else // there is missing channel data
 
        {
 
            qDebug() << "Incoming data is missing data for some channels!";
 
            qWarning() << "Incoming data is missing data for some channels!";
 
            for (int ci = 0; ci < separatedValues.length(); ci++)
 
            {
 
                double channelSample = separatedValues[ci].toDouble();
 
@@ -632,7 +632,7 @@ void MainWindow::onExportCsv()
 
        }
 
        else
 
        {
 
            qDebug() << "File open error during export: " << file.error();
 
            qCritical() << "File open error during export: " << file.error();
 
        }
 
    }
 
}
portcontrol.cpp
Show inline comments
 
@@ -146,12 +146,11 @@ void PortControl::selectBaudRate(QString
 
    {
 
        if (!serialPort->setBaudRate(baudRate.toInt()))
 
        {
 
            qDebug() << "Set baud rate failed during select: "
 
                     << serialPort->error();
 
            qCritical() << "Can't set baud rate!";
 
        }
 
        else
 
        {
 
            qDebug() << "Baud rate changed: " << serialPort->baudRate();
 
            qDebug() << "Baud rate changed to" << serialPort->baudRate();
 
        }
 
    }
 
}
 
@@ -162,7 +161,7 @@ void PortControl::selectParity(int parit
 
    {
 
        if(!serialPort->setParity((QSerialPort::Parity) parity))
 
        {
 
            qDebug() << "Set parity failed: " << serialPort->error();
 
            qCritical() << "Can't set parity option!";
 
        }
 
    }
 
}
 
@@ -173,7 +172,7 @@ void PortControl::selectDataBits(int dat
 
    {
 
        if(!serialPort->setDataBits((QSerialPort::DataBits) dataBits))
 
        {
 
            qDebug() << "Set data bits failed: " << serialPort->error();
 
            qCritical() << "Can't set numer of data bits!";
 
        }
 
    }
 
}
 
@@ -184,7 +183,7 @@ void PortControl::selectStopBits(int sto
 
    {
 
        if(!serialPort->setStopBits((QSerialPort::StopBits) stopBits))
 
        {
 
            qDebug() << "Set stop bits failed: " << serialPort->error();
 
            qCritical() << "Can't set number of stop bits!";
 
        }
 
    }
 
}
 
@@ -195,7 +194,7 @@ void PortControl::selectFlowControl(int 
 
    {
 
        if(!serialPort->setFlowControl((QSerialPort::FlowControl) flowControl))
 
        {
 
            qDebug() << "Set flow control failed: " << serialPort->error();
 
            qCritical() << "Can't set flow control option!";
 
        }
 
    }
 
}
 
@@ -205,7 +204,7 @@ void PortControl::togglePort()
 
    if (serialPort->isOpen())
 
    {
 
        serialPort->close();
 
        qDebug() << "Port closed, " << serialPort->portName();
 
        qDebug() << "Closed port:" << serialPort->portName();
 
        emit portToggled(false);
 
    }
 
    else
 
@@ -222,7 +221,7 @@ void PortControl::togglePort()
 
            selectStopBits((QSerialPort::StopBits) stopBitsButtons.checkedId());
 
            selectFlowControl((QSerialPort::FlowControl) flowControlButtons.checkedId());
 

	
 
            qDebug() << "Port opened, " << serialPort->portName();
 
            qDebug() << "Opened port:" << serialPort->portName();
 
            emit portToggled(true);
 
        }
 
    }
0 comments (0 inline, 0 general)