diff options
author | Karsten Heimrich <karsten.heimrich@theqtcompany.com> | 2016-01-07 13:05:27 +0100 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@theqtcompany.com> | 2016-01-08 07:51:59 +0000 |
commit | 034861898c20e0d2aec7dba18887f90056495464 (patch) | |
tree | fecf642c566ddf548bf86fed0c6d7ba9707d0aef /examples | |
parent | 510cf1e49174495a90e4f03768da6eb21f0bc87a (diff) |
Resolve TODO's. Merge both error code enums, update code.
Change-Id: I52bfdcd84d2164b45754fdfe85a96679f64133f2
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/serialbus/modbus/adueditor/modbustcpclient_p.h | 2 | ||||
-rw-r--r-- | examples/serialbus/modbus/master/mainwindow.cpp | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/examples/serialbus/modbus/adueditor/modbustcpclient_p.h b/examples/serialbus/modbus/adueditor/modbustcpclient_p.h index 4c52d98..af20d66 100644 --- a/examples/serialbus/modbus/adueditor/modbustcpclient_p.h +++ b/examples/serialbus/modbus/adueditor/modbustcpclient_p.h @@ -105,7 +105,7 @@ public: qDebug() << "Resend request with tId:" << hex << m_tId; } else { qDebug() << "Timeout of request with tId:" << hex << m_tId; - elem.reply->setError(QModbusReply::TimeoutError, + elem.reply->setError(QModbusDevice::TimeoutError, QModbusClient::tr("Request timeout.")); } }); diff --git a/examples/serialbus/modbus/master/mainwindow.cpp b/examples/serialbus/modbus/master/mainwindow.cpp index d30ddbe..3c3edda 100644 --- a/examples/serialbus/modbus/master/mainwindow.cpp +++ b/examples/serialbus/modbus/master/mainwindow.cpp @@ -261,7 +261,7 @@ void MainWindow::readReady() if (!reply) return; - if (reply->error() == QModbusReply::NoError) { + if (reply->error() == QModbusDevice::NoError) { const QModbusDataUnit unit = reply->result(); for (uint i = 0; i < unit.valueCount(); i++) { const QString entry = tr("Address: %1, Value: %2").arg(unit.startAddress()) @@ -269,7 +269,7 @@ void MainWindow::readReady() unit.registerType() <= QModbusDataUnit::Coils ? 10 : 16)); ui->readValue->addItem(entry); } - } else if (reply->error() == QModbusReply::ProtocolError) { + } else if (reply->error() == QModbusDevice::ProtocolError) { statusBar()->showMessage(tr("Read response error: %1 (Mobus exception: 0x%2)"). arg(reply->errorString()). arg(reply->rawResult().exceptionCode(), -1, 16), 5000); @@ -328,11 +328,11 @@ void MainWindow::writeReady() if (!reply) return; - if (reply->error() == QModbusReply::ProtocolError) { + if (reply->error() == QModbusDevice::ProtocolError) { statusBar()->showMessage(tr("Write response error: %1 (Mobus exception: 0x%2)"). arg(reply->errorString()). arg(reply->rawResult().exceptionCode(), -1, 16), 5000); - } else if (reply->error() != QModbusReply::NoError) { + } else if (reply->error() != QModbusDevice::NoError) { statusBar()->showMessage(tr("Write response error: %1 (code: 0x%2)"). arg(reply->errorString()). arg(reply->error(), -1, 16), 5000); |