状态颜色完善
This commit is contained in:
+15
-4
@@ -466,7 +466,7 @@ bool DLink::setup_remote(const QString port, qint32 baud, QSerialPort::Parity pa
|
||||
bool isSuccess = false;
|
||||
QSerialPort *serialPort = new QSerialPort(port, this);
|
||||
|
||||
if (serialPort->open(QIODevice::ReadOnly))
|
||||
if (serialPort->open(QIODevice::ReadWrite))
|
||||
{
|
||||
serialPort->setBaudRate(baud);
|
||||
serialPort->setStopBits(QSerialPort::OneStop);
|
||||
@@ -488,7 +488,7 @@ bool DLink::setup_rtk(const QString port, qint32 baudrate, QSerialPort::Parity p
|
||||
bool isSuccess = false;
|
||||
QSerialPort *serialPort = new QSerialPort(port, this);
|
||||
|
||||
if (serialPort->open(QIODevice::ReadOnly))
|
||||
if (serialPort->open(QIODevice::ReadWrite))
|
||||
{
|
||||
serialPort->setBaudRate(baudrate);
|
||||
serialPort->setStopBits(QSerialPort::OneStop);
|
||||
@@ -564,15 +564,26 @@ void DLink::processPendingMulticastDatagrams(void)
|
||||
void DLink::readRTKPendingDatagrams(void)
|
||||
{
|
||||
|
||||
QObject *obj = sender();
|
||||
//QObject *obj = sender();
|
||||
|
||||
QSerialPort *serialport = qobject_cast<QSerialPort *>(obj);
|
||||
QSerialPort *serialport = qobject_cast<QSerialPort *>(sender());
|
||||
if(serialport)
|
||||
{
|
||||
QByteArray datagram = serialport->readAll();
|
||||
|
||||
if(datagram.size() > 0)
|
||||
{
|
||||
|
||||
//serialport->write(datagram);
|
||||
|
||||
|
||||
QEvent *rtk_receive= new QEvent(QEvent::User);
|
||||
|
||||
|
||||
|
||||
QCoreApplication::sendEvent(nullptr,rtk_receive);
|
||||
|
||||
|
||||
emit getRTK(SourceType::s_port,datagram);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
#include "QDebug"
|
||||
#include "mavlinknode.h"
|
||||
|
||||
#include "QEvent"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user