Skip to content

Commit

Permalink
修复串口自收发输出空数据的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wuhai committed Mar 22, 2019
1 parent f808ffa commit 8cecaba
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/MainWindow/MoreInformation.ui
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ p, li { white-space: pre-wrap; }
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'SimSun'; font-size:9pt; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">v1.2.0 2019年</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">v1.2.1 2019年03月22日</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> 01. 修复串口自收发输出空数据的bug</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">v1.2.0 2019年03月22日</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> 01. 添加读写延时参数设置功能</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">v1.1.0 2019年03月10日</p>
Expand Down
2 changes: 1 addition & 1 deletion src/MainWindow/SAKVersion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ SAKVersion::SAKVersion()

copyQQ = ui->pushButtonCopy;

version->setText(QString("1.2.0"));
version->setText(QString("1.2.1"));
datetime->setText(QString(__DATE__) + " " + QString(__TIME__));
author->setText(QString("Qter"));
email->setText(QString("[email protected]"));
Expand Down
8 changes: 6 additions & 2 deletions src/TabPageSerialPort/SerialportSAKIODevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,16 @@ SerialportSAKIODevice::~SerialportSAKIODevice()

}

QByteArray SerialportSAKIODevice::ReadAll()
void SerialportSAKIODevice::ReadAll()
{
while (mpSerialPort->waitForReadyRead(readDelayTime()));
QByteArray data = mpSerialPort->readAll();

if (data.isEmpty()){
return;
}

emit bytesRead(data);
return data;
}

void SerialportSAKIODevice::writeBytes(QByteArray data)
Expand Down
2 changes: 1 addition & 1 deletion src/TabPageSerialPort/SerialportSAKIODevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public slots:
void open(QString portName, QString baudRate, QString dataBits, QString stopBits, QString parity) override;
void writeBytes(QByteArray data) override;

QByteArray ReadAll();
void ReadAll();
protected:
void run() override;
private:
Expand Down

0 comments on commit 8cecaba

Please sign in to comment.