Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+8
-8
@@ -49,7 +49,7 @@ void LtsSerialPortQuerry::continueQuerry()
|
||||
|
||||
void LtsSerialPortQuerry::restartQuerry()
|
||||
{
|
||||
DEBUG_LOG() << "restart querry ";
|
||||
DEBUG_LOG(m_logger) << "restart querry ";
|
||||
m_serialPortInfos = QSerialPortInfo::availablePorts();
|
||||
m_currentQuerry = 0;
|
||||
if (m_serialPortInfos.size())
|
||||
@@ -73,20 +73,20 @@ void LtsSerialPortQuerry::querrySerialPort(const QSerialPortInfo &info)
|
||||
m_currentSerialPort->setStopBits(m_stopBits);
|
||||
m_currentSerialPort->setFlowControl(m_flowControll);
|
||||
|
||||
DEBUG_LOG() << "Try opening Comport:" << m_currentSerialPort->portName() << " index is: " << m_currentQuerry;
|
||||
DEBUG_LOG(m_logger) << "Try opening Comport:" << m_currentSerialPort->portName() << " index is: " << m_currentQuerry;
|
||||
|
||||
|
||||
if (!m_currentSerialPort->open(QSerialPort::ReadWrite))
|
||||
{
|
||||
|
||||
DEBUG_LOG() << "Oppening failed query next";
|
||||
DEBUG_LOG(m_logger) << "Oppening failed query next";
|
||||
|
||||
continueQuerry();
|
||||
}else
|
||||
{
|
||||
connect(m_currentSerialPort, &QSerialPort::errorOccurred,
|
||||
this, &LtsSerialPortQuerry::onSerialPortError, Qt::UniqueConnection);
|
||||
DEBUG_LOG() << "Oppened comport" << m_currentSerialPort->portName();
|
||||
DEBUG_LOG(m_logger) << "Oppened comport" << m_currentSerialPort->portName();
|
||||
emit connectionEstablished();
|
||||
}
|
||||
}
|
||||
@@ -110,7 +110,7 @@ void LtsSerialPortQuerry::onSerialPortError(QSerialPort::SerialPortError serialP
|
||||
|
||||
if (!m_currentSerialPort)
|
||||
return;
|
||||
DEBUG_LOG() << "Spontaneous error " << serialPortError << " doesn't have to be an error ...";
|
||||
DEBUG_LOG(m_logger) << "Spontaneous error " << serialPortError << " doesn't have to be an error ...";
|
||||
|
||||
const QString errStr(QStringLiteral("QSerialPort::SerialPortError ") + QString::number(serialPortError) +
|
||||
QStringLiteral(" from serial port ") + m_currentSerialPort->portName() +
|
||||
@@ -129,19 +129,19 @@ void LtsSerialPortQuerry::onSerialPortError(QSerialPort::SerialPortError serialP
|
||||
case QSerialPort::SerialPortError::NotOpenError:
|
||||
case QSerialPort::SerialPortError::UnknownError:
|
||||
{
|
||||
ERROR_LOG() << "Closing port and try to reopen it. " << m_currentSerialPort->portName();
|
||||
ERROR_LOG(m_logger) << "Closing port and try to reopen it. " << m_currentSerialPort->portName();
|
||||
continueQuerry();
|
||||
|
||||
Q_FALLTHROUGH();
|
||||
}
|
||||
case QSerialPort::SerialPortError::UnsupportedOperationError:
|
||||
{
|
||||
ERROR_LOG() << errStr;
|
||||
ERROR_LOG(m_logger) << errStr;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
ERROR_LOG() << "Got an Error> " << errStr << "restarting";
|
||||
ERROR_LOG(m_logger) << "Got an Error> " << errStr << "restarting";
|
||||
continueQuerry();
|
||||
|
||||
break;
|
||||
|
||||
@@ -33,13 +33,16 @@ signals:
|
||||
void connectionEstablished();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void querrySerialPort(const QSerialPortInfo &info);
|
||||
void closeAndDeleteCurrentPort();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onSerialPortError(QSerialPort::SerialPortError serialPortError);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
QList<QSerialPortInfo> m_serialPortInfos;
|
||||
int m_currentQuerry;
|
||||
QSerialPort::BaudRate m_baudRate;
|
||||
|
||||
Reference in new issue
Block a user