状态颜色完善

This commit is contained in:
hm
2021-06-04 19:26:47 +08:00
parent 98b0de243d
commit 6c62d7f9a1
6 changed files with 179 additions and 62 deletions
+15 -4
View File
@@ -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);
}
}
+2
View File
@@ -8,6 +8,8 @@
#include "QDebug"
#include "mavlinknode.h"
#include "QEvent"
QT_BEGIN_NAMESPACE