xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

資源簡(jiǎn)介

基于QT編寫的GPS上位機(jī)軟件,已增加注釋,個(gè)人認(rèn)為比較詳細(xì),有界面,很適合初學(xué)者,界面功能還算比較完善,包含時(shí)間,日期,經(jīng)緯度,衛(wèi)星等各種內(nèi)容,推薦。

資源截圖

代碼片段和文件信息

#include?“gpsGUI.h“
#include?“QDebug“
#include?“ui_mainwindow.h“

MainWindow::MainWindow(QWidget?*parent)?:
????QMainWindow(parent)
????ui(new?Ui::MainWindow)
{
????ui->setupUi(this);
????readTimer?=?new?QTimer(this);
????//????connect(ui->searchButtonSIGNAL(clicked())thisSLOT(on_searchButton_clicked()));?????//ui上使用槽后會(huì)自動(dòng)connect不用再connect,否則會(huì)鏈接兩遍
????//????connect(ui->openComButtonSIGNAL(clicked())thisSLOT(on_openComButton_clicked()));
????connect(readTimerSIGNAL(timeout())thisSLOT(readData()));
}

MainWindow::~MainWindow()
{
????delete?ui;
}

//自動(dòng)搜索并設(shè)置端口號(hào)
void?MainWindow::on_searchButton_clicked()
{
????foreach(const?QSerialPortInfo?&protInformation?QSerialPortInfo::availablePorts())//遍歷
????{
????????ui->comInformationTextEdit?->?clear();?//下方數(shù)據(jù)欄清空
????????ui->comComboBox?->?clear();???????????//串口下拉菜單欄清空
????????QStringList?comlist;??????????????????//定義一個(gè)comlist存protInformation里的portName
????????comlist?<????????ui->comComboBox->addItems(comlist);???//將comlist里的內(nèi)容傳給ui上的comComboBox
????????ui->boteComboBox->setCurrentText(“9600“);
????????//???????ui->comComboBox->addItems(ProtInfomation.portName());
????????ui->comStatusLabel->setText(protInformation.portName().append(“可以使用“));//在comStatusLabel顯示可以使用的端口名字append函數(shù)是用來(lái)追加元素到QList容器中
????????ui->comInformationTextEdit->append(protInformation.portName());
????????ui->comInformationTextEdit->append(protInformation.description());
????????ui->comInformationTextEdit->append(protInformation.manufacturer());
????}
}

//打開(kāi)串口并初始化按鈕和文字
void?MainWindow::on_openComButton_clicked()
{

????if(ui->openComButton->text()==tr(“打開(kāi)串口“))??????//如果openComButton上的字符為“打開(kāi)串口”
????{
????????serialPortset?=?new?QSerialPort;
????????serialPortset->setPortName(ui->comComboBox->currentText());//QSerialPort讀取串口信息serialPortset,并將串口comComboBox的名稱設(shè)置為當(dāng)前找到的串口名
????????serialPortset->open(QIODevice::ReadWrite);????//打開(kāi)串口讀寫功能
????????serialPortset->setBaudRate(ui->boteComboBox->currentText().toInt());//將當(dāng)前波特率以整形顯示在boteComboBox
????????switch?(ui->comComboBox->currentText().toInt())
????????{
????????case?8:serialPortset->setDataBits(QSerialPort::Data8);break;??//如果當(dāng)前comComboBox選擇8,則數(shù)據(jù)解析方案setDataBits選擇Data8
????????case?7:serialPortset->setDataBits(QSerialPort::Data7);break;
????????case?6:serialPortset->setDataBits(QSerialPort::Data6);break;
????????case?5:serialPortset->setDataBits(QSerialPort::Data5);break;
????????default:break;
????????}

????????switch?(ui->checkComboBox->currentIndex())????//校驗(yàn)位選擇
????????{
????????case?0:serialPortset->setParity(QSerialPort::NoParity);break;
????????case?1:serialPortset->setParity(QSerialPort::OddParity);break;
????????case?2:serialPortset->setParity(QSerialPort::EvenParity);break;
????????default:break;
????????}

????????switch?(ui->stopComboBox->currentIndex())?//停止位選擇
????????{
????????case?0:serialPortset->setStopBits(QSerialPort::OneStop);break;
????????case?1:serialPortset->set

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-05-14?10:05??GPS\
?????文件??????270398??2018-04-20?14:43??GPS\GPS.ico
?????文件???????19105??2018-04-20?15:43??GPS\GPS.pro.user
?????文件????????9558??2018-05-14?10:05??GPS\gpsGUI.cpp
?????文件????????1113??2018-04-20?11:57??GPS\gpsGUI.h
?????文件???????19037??2018-04-20?16:00??GPS\GPS_1.pro.user
?????文件???????14435??2018-04-20?14:45??GPS\GPS_test.pro.user
?????文件????????1095??2018-04-20?14:45??GPS\GPS_user.pro
?????文件???????19082??2018-05-14?10:05??GPS\GPS_user.pro.user
?????文件?????????179??2018-04-17?10:06??GPS\main.cpp
?????文件???????17289??2018-04-20?12:18??GPS\mainwindow.ui

評(píng)論

共有 條評(píng)論