first design ui
|
@ -24,7 +24,8 @@ SOURCES += \
|
|||
src/cpp/utils.cpp \
|
||||
src/cpp/interfaceTestWin.cpp \
|
||||
src/cpp/msgInputWin.cpp \
|
||||
src/cpp/statusTestWin.cpp
|
||||
src/cpp/statusTestWin.cpp \
|
||||
src/cpp/precisionTestWin.cpp
|
||||
|
||||
HEADERS += \
|
||||
src/include/posTestWin.h \
|
||||
|
@ -33,6 +34,7 @@ HEADERS += \
|
|||
src/include/mainwindow.h \
|
||||
src/include/loginWin.h \
|
||||
src/include/msgInputWin.h \
|
||||
src/include/precisionTestWin.h \
|
||||
src/include/qcustomplot.h \
|
||||
src/include/serialport.h \
|
||||
src/include/sqlitedb.h \
|
||||
|
@ -41,6 +43,7 @@ HEADERS += \
|
|||
src/include/utils.h
|
||||
|
||||
FORMS += \
|
||||
src/ui/precisionTestWin.ui \
|
||||
src/ui/posTestWin.ui \
|
||||
src/ui/interfaceTestWin.ui \
|
||||
src/ui/msgInputWin.ui \
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>images/close.png</file>
|
||||
<file>images/close_hover.png</file>
|
||||
<file>images/max.png</file>
|
||||
<file>images/min.png</file>
|
||||
<file>images/normal.png</file>
|
||||
<file>images/logo.ico</file>
|
||||
<file>images/login_logo.png</file>
|
||||
<file>images/circle_gray.png</file>
|
||||
<file>images/circle_green.png</file>
|
||||
<file>images/delete_black.png</file>
|
||||
<file>images/delete_red.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 5.5 KiB |
After Width: | Height: | Size: 162 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 1.8 KiB |
|
@ -0,0 +1,7 @@
|
|||
#include "globalParams.h"
|
||||
|
||||
namespace globalParams
|
||||
{
|
||||
QString curUserId;
|
||||
QString curUserType;
|
||||
}
|
|
@ -0,0 +1,86 @@
|
|||
#include "interfaceTestWin.h"
|
||||
#include "ui_interfaceTestWin.h"
|
||||
|
||||
InterfaceTestWin::InterfaceTestWin(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, ui(new Ui::InterfaceTestWin)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
serialModel = new QStandardItemModel(this);
|
||||
serialSelect = new QItemSelectionModel(serialModel);
|
||||
serialModel->setColumnCount(2);
|
||||
ui->tableViewSerial->setModel(serialModel);
|
||||
ui->tableViewSerial->setSelectionModel(serialSelect);
|
||||
ui->tableViewSerial->horizontalHeader()->setVisible(false);
|
||||
ui->tableViewSerial->verticalHeader()->setVisible(false);
|
||||
ui->tableViewSerial->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||
ui->tableViewSerial->verticalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||
|
||||
QFont font = ui->tableViewSerial->font();
|
||||
//font.setPointSize(10);
|
||||
ui->tableViewSerial->setFont(font);
|
||||
|
||||
QList<QStandardItem *> aItemList;
|
||||
QStandardItem *aItem = new QStandardItem("串口接收");
|
||||
aItem->setEditable(false);
|
||||
font.setBold(true);
|
||||
aItem->setFont(font);
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
serialModel->insertRow(serialModel->rowCount(),aItemList);
|
||||
|
||||
aItemList.clear();
|
||||
aItem = new QStandardItem("串口发送");
|
||||
aItem->setEditable(false);
|
||||
font.setBold(true);
|
||||
aItem->setFont(font);
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
serialModel->insertRow(serialModel->rowCount(),aItemList);
|
||||
|
||||
canModel = new QStandardItemModel(this);
|
||||
canSelect = new QItemSelectionModel(canModel);
|
||||
canModel->setColumnCount(2);
|
||||
ui->tableViewCan->setModel(canModel);
|
||||
ui->tableViewCan->setSelectionModel(canSelect);
|
||||
ui->tableViewCan->horizontalHeader()->setVisible(false);
|
||||
ui->tableViewCan->verticalHeader()->setVisible(false);
|
||||
ui->tableViewCan->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||
ui->tableViewCan->verticalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||
|
||||
aItemList.clear();
|
||||
aItem = new QStandardItem("CAN接收");
|
||||
aItem->setEditable(false);
|
||||
font.setBold(true);
|
||||
aItem->setFont(font);
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
canModel->insertRow(canModel->rowCount(),aItemList);
|
||||
|
||||
aItemList.clear();
|
||||
aItem = new QStandardItem("CAN发送");
|
||||
aItem->setEditable(false);
|
||||
font.setBold(true);
|
||||
aItem->setFont(font);
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
canModel->insertRow(canModel->rowCount(),aItemList);
|
||||
}
|
||||
|
||||
InterfaceTestWin::~InterfaceTestWin()
|
||||
{
|
||||
delete ui;
|
||||
}
|
|
@ -0,0 +1,260 @@
|
|||
#include "loginwin.h"
|
||||
#include "ui_loginwin.h"
|
||||
#include "utils.h"
|
||||
#include "sqlitedb.h"
|
||||
#include "globalParams.h"
|
||||
#include <QSettings>
|
||||
#include <qt_windows.h>
|
||||
#include <dwmapi.h>
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
#include <cmath>
|
||||
#include <QGraphicsDropShadowEffect>
|
||||
#include <QPainter>
|
||||
#include <QPainterPath>
|
||||
#include <QMessageBox>
|
||||
#include <QRegularExpression>
|
||||
#include <QRegularExpressionMatch>
|
||||
#include <QMessageBox>
|
||||
#include <QDebug>
|
||||
|
||||
#ifdef defined(_MSC_VER)
|
||||
#pragma comment(lib, "user32.lib")
|
||||
#pragma comment(lib,"dwmapi.lib")
|
||||
#endif
|
||||
|
||||
LoginWin::LoginWin(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::LoginWin)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowMinMaxButtonsHint);
|
||||
this->setPalette(QPalette(QColor(240,240,240)));
|
||||
ui->titleBar->setPalette(QPalette(QColor(240,240,240)));
|
||||
this->setAutoFillBackground(true);
|
||||
|
||||
int w = this->width();
|
||||
int h = this->height();
|
||||
this->setMinimumSize(w,h);
|
||||
this->setMaximumSize(w,h);
|
||||
|
||||
#ifdef defined(_MSC_VER)
|
||||
/*
|
||||
此行代码可以带回Aero效果,同时也带回了标题栏和边框,在nativeEvent()会再次去掉标题栏
|
||||
主要的关键是WS_THICKFRAME,可以实现窗口停靠边缘自动改变大小功能和Aero效果
|
||||
*/
|
||||
HWND hwnd = (HWND)this->winId();
|
||||
DWORD style = ::GetWindowLong(hwnd, GWL_STYLE);
|
||||
::SetWindowLong(hwnd, GWL_STYLE, style | WS_THICKFRAME);
|
||||
|
||||
//保留一个像素的边框宽度,否则系统不会绘制边框阴影
|
||||
const MARGINS shadow = { 1, 1, 1, 1 };
|
||||
DwmExtendFrameIntoClientArea(HWND(winId()), &shadow);
|
||||
#endif
|
||||
|
||||
connect(ui->titleBar,SIGNAL(windowCloseSignal()),this,SLOT(windowCloseHandle()),Qt::QueuedConnection);
|
||||
|
||||
readCfg();
|
||||
}
|
||||
|
||||
LoginWin::~LoginWin()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void LoginWin::windowCloseHandle()
|
||||
{
|
||||
QSettings setting("config/cfg.ini",QSettings::IniFormat);
|
||||
QString check;
|
||||
if(ui->ckbRemember->isChecked()){
|
||||
check = "1";
|
||||
}else{
|
||||
check = "0";
|
||||
}
|
||||
setting.setValue("users/remember",check);
|
||||
close();
|
||||
}
|
||||
|
||||
void LoginWin::on_btnLogin_clicked()
|
||||
{
|
||||
if(ui->cmbName->currentText().isEmpty()){
|
||||
QMessageBox::warning(this,"警告","请输入用户名!",QMessageBox::Ok,QMessageBox::NoButton);
|
||||
return;
|
||||
}
|
||||
if(ui->lePassword->text().isEmpty()){
|
||||
QMessageBox::warning(this,"警告","请输入密码!",QMessageBox::Ok,QMessageBox::NoButton);
|
||||
return;
|
||||
}
|
||||
QString curName = ui->cmbName->currentText().trimmed();
|
||||
QString curPassword = ui->lePassword->text().trimmed();
|
||||
QMap<QString,QString> map;
|
||||
map["ID"] = curName;
|
||||
char base64[256] = {'\0'};
|
||||
int len = 0;
|
||||
base64_encode((const unsigned char *)curPassword.toStdString().c_str(),strlen(curPassword.toStdString().c_str()),(unsigned char *)base64,&len);
|
||||
map["PASSWORD"] = QString::fromLocal8Bit(base64,len);
|
||||
QVector<QMap<QString, QString>> result = SQLITEDB::getInstance().getRecord("USERS",map);
|
||||
if(result.size()<=0){
|
||||
QMessageBox::warning(this,"警告",QString("用户名或密码错误!"),QMessageBox::NoButton);
|
||||
return;
|
||||
}
|
||||
nameMap[curName] = curPassword;
|
||||
globalParams::curUserId = result[0].value("ID");
|
||||
globalParams::curUserType = result[0].value("USER_TYPE");
|
||||
saveCfg();
|
||||
emit loginSignal();
|
||||
windowCloseHandle();
|
||||
}
|
||||
|
||||
bool LoginWin::nativeEvent(const QByteArray &eventType, void *message, long *result)
|
||||
{
|
||||
MSG* param = static_cast<MSG*>(message);
|
||||
|
||||
switch (param->message)
|
||||
{
|
||||
case WM_NCCALCSIZE: {
|
||||
/*
|
||||
此消息用于处理非客户区域,比如边框的绘制
|
||||
返回false,就是按系统的默认处理,如果返回true,而不做任何绘制,则非客户区域
|
||||
就不会被绘制,就相当于没有绘制非客户区域,所以就会看不到非客户区域的效果
|
||||
*/
|
||||
return true;
|
||||
}
|
||||
case WM_NCHITTEST:
|
||||
{
|
||||
|
||||
const LONG border_width = 3;
|
||||
RECT winrect;
|
||||
GetWindowRect(HWND(winId()), &winrect);
|
||||
|
||||
long x = GET_X_LPARAM(param->lParam);
|
||||
long y = GET_Y_LPARAM(param->lParam);
|
||||
|
||||
/*
|
||||
只用这种办法设置动态改变窗口大小比手动通过鼠标事件效果好,可以
|
||||
避免闪烁问题
|
||||
*/
|
||||
//bottom left corner
|
||||
if (x >= winrect.left && x < winrect.left + border_width &&
|
||||
y < winrect.bottom && y >= winrect.bottom - border_width)
|
||||
{
|
||||
*result = HTBOTTOMLEFT;
|
||||
return true;
|
||||
}
|
||||
//bottom right corner
|
||||
if (x < winrect.right && x >= winrect.right - border_width &&
|
||||
y < winrect.bottom && y >= winrect.bottom - border_width)
|
||||
{
|
||||
*result = HTBOTTOMRIGHT;
|
||||
return true;
|
||||
}
|
||||
//top left corner
|
||||
if (x >= winrect.left && x < winrect.left + border_width &&
|
||||
y >= winrect.top && y < winrect.top + border_width)
|
||||
{
|
||||
*result = HTTOPLEFT;
|
||||
return true;
|
||||
}
|
||||
//top right corner
|
||||
if (x < winrect.right && x >= winrect.right - border_width &&
|
||||
y >= winrect.top && y < winrect.top + border_width)
|
||||
{
|
||||
*result = HTTOPRIGHT;
|
||||
return true;
|
||||
}
|
||||
//left border
|
||||
if (x >= winrect.left && x < winrect.left + border_width)
|
||||
{
|
||||
*result = HTLEFT;
|
||||
return true;
|
||||
}
|
||||
//right border
|
||||
if (x < winrect.right && x >= winrect.right - border_width)
|
||||
{
|
||||
*result = HTRIGHT;
|
||||
return true;
|
||||
}
|
||||
|
||||
//bottom border
|
||||
if (y < winrect.bottom && y >= winrect.bottom - border_width)
|
||||
{
|
||||
*result = HTBOTTOM;
|
||||
return true;
|
||||
}
|
||||
//top border
|
||||
if (y >= winrect.top && y < winrect.top + border_width)
|
||||
{
|
||||
*result = HTTOP;
|
||||
return true;
|
||||
}
|
||||
|
||||
return QWidget::nativeEvent(eventType, message, result);
|
||||
}
|
||||
}
|
||||
|
||||
return QWidget::nativeEvent(eventType, message, result);
|
||||
}
|
||||
|
||||
void LoginWin::readCfg()
|
||||
{
|
||||
QSettings setting("config/cfg.ini",QSettings::IniFormat);
|
||||
QString names = setting.value("users/names").toString().trimmed();
|
||||
QStringList nameList = names.split(";");
|
||||
|
||||
for(int i=0;i<nameList.size();i++){
|
||||
QString nameAndPassword = nameList[i];
|
||||
QStringList list = nameAndPassword.split(":");
|
||||
if(list.size()==2){
|
||||
QString name = list[0];
|
||||
QString base64 = list[1];
|
||||
char password[256] = {'\0'};
|
||||
int len = 0;
|
||||
base64_decode((const unsigned char *)base64.toStdString().c_str(),strlen(base64.toStdString().c_str()),(unsigned char *)password,&len);
|
||||
nameMap[name] = QString::fromLocal8Bit(password,len);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (const QString &name, nameMap.keys()) {
|
||||
if(!name.isEmpty()){
|
||||
ui->cmbName->addItem(name);
|
||||
}
|
||||
}
|
||||
QString curName = setting.value("users/current").toString().trimmed();
|
||||
if(!curName.isEmpty()){
|
||||
ui->cmbName->setCurrentText(curName);
|
||||
}
|
||||
|
||||
QString check = setting.value("users/remember").toString();
|
||||
if(check.toInt()==1){
|
||||
ui->ckbRemember->setChecked(true);
|
||||
}else{
|
||||
ui->ckbRemember->setChecked(false);
|
||||
}
|
||||
}
|
||||
|
||||
void LoginWin::saveCfg()
|
||||
{
|
||||
QSettings setting("config/cfg.ini",QSettings::IniFormat);
|
||||
|
||||
QString names;
|
||||
QString curname = ui->cmbName->currentText();
|
||||
foreach (const QString &name, nameMap.keys()) {
|
||||
if(!ui->ckbRemember->isChecked() && name==curname){
|
||||
continue;
|
||||
}
|
||||
if(!name.isEmpty()){
|
||||
QString password = nameMap.value(name,"");
|
||||
char base64[256] = {'\0'};
|
||||
int len = 0;
|
||||
base64_encode((const unsigned char *)password.toStdString().c_str(),strlen(password.toStdString().c_str()),(unsigned char *)base64,&len);
|
||||
names += QString("%1:%2;").arg(name,base64);
|
||||
}
|
||||
}
|
||||
setting.setValue("users/names",names);
|
||||
}
|
||||
|
||||
void LoginWin::on_cmbName_currentTextChanged(const QString &arg1)
|
||||
{
|
||||
ui->lePassword->setText(nameMap.value(arg1,""));
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
#include "mainwindow.h"
|
||||
#include "loginWin.h"
|
||||
#include "sqlitedb.h"
|
||||
#include <QApplication>
|
||||
#include <QTextCodec>
|
||||
#include <QFont>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QTextCodec *codec = QTextCodec::codecForName("GB2312");
|
||||
QTextCodec::setCodecForLocale(codec);
|
||||
QApplication a(argc, argv);
|
||||
QFont font = a.font();
|
||||
font.setFamily("Microsoft YaHei UI");
|
||||
a.setFont(font);
|
||||
LoginWin login;
|
||||
login.show();
|
||||
MainWindow w;
|
||||
w.hide();
|
||||
w.connect(&login,SIGNAL(loginSignal()),&w,SLOT(loginHandle()));
|
||||
|
||||
SQLITEDB::getInstance();
|
||||
return a.exec();
|
||||
}
|
|
@ -0,0 +1,184 @@
|
|||
#include "mainwindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
#include "globalParams.h"
|
||||
#include "msgInputWin.h"
|
||||
#include <QSerialPortInfo>
|
||||
#include <QGroupBox>
|
||||
#include <QHBoxLayout>
|
||||
#include <QPushButton>
|
||||
#include <QDebug>
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent)
|
||||
: QMainWindow(parent)
|
||||
, ui(new Ui::MainWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
this->setWindowTitle("北斗用户机测试软件");
|
||||
//this->setPalette(QPalette(QColor(255,255,255)));
|
||||
//this->setPalette(QPalette(QColor(225,225,225)));
|
||||
serialPortInit();
|
||||
|
||||
//状态栏显示当前用户
|
||||
QGroupBox *userBox = new QGroupBox();
|
||||
userBox->setStyleSheet("QGroupBox{border:none;}");
|
||||
QHBoxLayout *userLayout = new QHBoxLayout(userBox);
|
||||
userLayout->setMargin(0);
|
||||
QLabel *lbUserSpaceLeft = new QLabel();
|
||||
QLabel *lbUserSpaceRight = new QLabel();
|
||||
lbUserSpaceLeft->setFixedWidth(10);
|
||||
lbUserSpaceRight->setFixedWidth(10);
|
||||
QLabel *lbUserId = new QLabel("当前用户:");
|
||||
lbCurUserId = new QLabel();
|
||||
lbCurUserId->setText(globalParams::curUserId);
|
||||
userLayout->addWidget(lbUserSpaceLeft);
|
||||
userLayout->addWidget(lbUserId);
|
||||
userLayout->addWidget(lbCurUserId);
|
||||
userLayout->addWidget(lbUserSpaceRight);
|
||||
ui->statusbar->addWidget(userBox);
|
||||
//状态栏显示接收比特数
|
||||
QGroupBox *byteBox = new QGroupBox();
|
||||
byteBox->setStyleSheet("QGroupBox{border:none;}");
|
||||
QHBoxLayout *byteLayout = new QHBoxLayout(byteBox);
|
||||
byteLayout->setMargin(0);
|
||||
QLabel *lbByteSpaceLeft = new QLabel();
|
||||
QLabel *lbByteSpaceMid1 = new QLabel();
|
||||
QLabel *lbByteSpaceMid2 = new QLabel();
|
||||
QLabel *lbByteSpaceMid3 = new QLabel();
|
||||
QLabel *lbByteSpaceRight = new QLabel();
|
||||
lbByteSpaceLeft->setFixedWidth(5);
|
||||
lbByteSpaceMid1->setFixedWidth(5);
|
||||
lbByteSpaceMid2->setFixedWidth(5);
|
||||
lbByteSpaceMid3->setFixedWidth(5);
|
||||
lbByteSpaceRight->setFixedWidth(5);
|
||||
|
||||
QLabel *lbSend = new QLabel("发送:");
|
||||
QLabel *lbRecv = new QLabel("接收:");
|
||||
QPushButton *btnClean = new QPushButton();
|
||||
connect(btnClean,SIGNAL(clicked()),this,SLOT(btnCleanClickedHandle()),Qt::QueuedConnection);
|
||||
lbComStatus = new QLabel();
|
||||
lbComStatus->setFixedSize(16,16);
|
||||
lbComStatus->setPixmap(QPixmap(":/images/circle_gray.png"));
|
||||
lbComStatus->setScaledContents(true);
|
||||
btnClean->setFixedSize(18,18);
|
||||
btnClean->setAutoRepeat(true);
|
||||
btnClean->setStyleSheet("QPushButton{background-image:url(:/images/delete_black.png);\
|
||||
background-color:rgb(240,240,240);background-position:center;;border:none}" \
|
||||
"QPushButton:hover{background-color:rgba(233,233,233,150);" \
|
||||
"background-image:url(:/images/delete_red.png);border:none;}");
|
||||
lbSendByte = new QLabel("0");
|
||||
lbRecvByte = new QLabel("0");
|
||||
byteLayout->addWidget(lbByteSpaceLeft);
|
||||
byteLayout->addWidget(lbComStatus);
|
||||
byteLayout->addWidget(lbByteSpaceMid1);
|
||||
byteLayout->addWidget(lbSend);
|
||||
byteLayout->addWidget(lbSendByte);
|
||||
byteLayout->addWidget(lbByteSpaceMid2);
|
||||
byteLayout->addWidget(lbRecv);
|
||||
byteLayout->addWidget(lbRecvByte);
|
||||
byteLayout->addWidget(lbByteSpaceMid3);
|
||||
byteLayout->addWidget(btnClean);
|
||||
byteLayout->addWidget(lbByteSpaceRight);
|
||||
ui->statusbar->addWidget(byteBox);
|
||||
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
serial->close();
|
||||
delete serial;
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void MainWindow::receiverSerialDataHandle(const QByteArray &data)
|
||||
{
|
||||
long long totalLen = lbRecvByte->text().toLongLong();
|
||||
totalLen += data.size();
|
||||
lbRecvByte->setText(QString::number(totalLen));
|
||||
try {
|
||||
leftData.append(data);
|
||||
} catch (...) {
|
||||
qDebug()<<"new data can't append to buf";
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void MainWindow::loginHandle()
|
||||
{
|
||||
lbCurUserId->setText(globalParams::curUserId);
|
||||
this->show();
|
||||
}
|
||||
|
||||
void MainWindow::btnCleanClickedHandle()
|
||||
{
|
||||
lbSendByte->setText("0");
|
||||
lbRecvByte->setText("0");
|
||||
}
|
||||
|
||||
void MainWindow::on_tbtnFresh_clicked()
|
||||
{
|
||||
QString curCom = ui->cmbCom->currentText();
|
||||
ui->cmbCom->clear();
|
||||
QStringList nameList;
|
||||
foreach (const QSerialPortInfo &info, QSerialPortInfo::availablePorts())
|
||||
{
|
||||
nameList.append(info.portName());
|
||||
}
|
||||
std::sort(nameList.begin(), nameList.end(), [&](QString &s1, QString &s2)
|
||||
{
|
||||
if(s1.size()==s2.size()){
|
||||
return s1<s2;
|
||||
}else{
|
||||
return s1.size()<s2.size();
|
||||
}
|
||||
});
|
||||
ui->cmbCom->addItems(nameList);
|
||||
ui->cmbCom->setCurrentText(curCom);
|
||||
}
|
||||
|
||||
void MainWindow::serialPortInit()
|
||||
{
|
||||
serial = new SerialPort();
|
||||
connect(serial,SIGNAL(recvSerialDataSignal(QByteArray)),this,SLOT(receiverSerialDataHandle(QByteArray)),Qt::QueuedConnection);
|
||||
QStringList nameList;
|
||||
foreach (const QSerialPortInfo &info, QSerialPortInfo::availablePorts())
|
||||
{
|
||||
nameList.append(info.portName());
|
||||
}
|
||||
|
||||
std::sort(nameList.begin(), nameList.end(), [&](QString &s1, QString &s2)
|
||||
{
|
||||
if(s1.size()==s2.size()){
|
||||
return s1<s2;
|
||||
}else{
|
||||
return s1.size()<s2.size();
|
||||
}
|
||||
});
|
||||
ui->cmbCom->addItems(nameList);
|
||||
}
|
||||
|
||||
void MainWindow::on_tbtnConnect_clicked()
|
||||
{
|
||||
if(!bconnected){
|
||||
serial->setSerialconfig(ui->cmbCom->currentText(),ui->cmbBaud->currentText().toInt());
|
||||
if(serial->open()){
|
||||
ui->tbtnConnect->setText("断开");
|
||||
ui->tbtnConnect->setStyleSheet("color:red");
|
||||
lbComStatus->setPixmap(QPixmap(":/images/circle_green.png"));
|
||||
bconnected = true;
|
||||
ui->cmbBaud->setEnabled(false);
|
||||
ui->cmbCom->setEnabled(false);
|
||||
ui->tbtnFresh->setEnabled(false);
|
||||
}
|
||||
}else{
|
||||
ui->tbtnConnect->setText("连接");
|
||||
ui->tbtnConnect->setStyleSheet("color:green");
|
||||
lbComStatus->setPixmap(QPixmap(":/images/circle_gray.png"));
|
||||
bconnected = false;
|
||||
serial->close();
|
||||
ui->cmbBaud->setEnabled(true);
|
||||
ui->cmbCom->setEnabled(true);
|
||||
ui->tbtnFresh->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
#include "msgInputWin.h"
|
||||
#include "ui_msgInputWin.h"
|
||||
#include <QComboBox>
|
||||
|
||||
MsgInputWin::MsgInputWin(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, ui(new Ui::MsgInputWin)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
msgModel = new QStandardItemModel(this);
|
||||
msgSelect = new QItemSelectionModel(msgModel);
|
||||
msgModel->setColumnCount(2);
|
||||
ui->tableView->setModel(msgModel);
|
||||
ui->tableView->setSelectionModel(msgSelect);
|
||||
ui->tableView->horizontalHeader()->setVisible(false);
|
||||
ui->tableView->verticalHeader()->setVisible(false);
|
||||
ui->tableView->horizontalHeader()->setStretchLastSection(true);
|
||||
ui->tableView->verticalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||
|
||||
QFont font = ui->tableView->font();
|
||||
//font.setPointSize(10);
|
||||
ui->tableView->setFont(font);
|
||||
|
||||
QList<QStandardItem *> aItemList;
|
||||
QStandardItem *aItem = new QStandardItem("单位");
|
||||
aItem->setEditable(false);
|
||||
font.setBold(true);
|
||||
aItem->setFont(font);
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("");
|
||||
aItemList.append(aItem);
|
||||
msgModel->insertRow(msgModel->rowCount(),aItemList);
|
||||
|
||||
aItemList.clear();
|
||||
aItem = new QStandardItem("班组");
|
||||
aItem->setEditable(false);
|
||||
aItem->setFont(font);
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("");
|
||||
aItemList.append(aItem);
|
||||
msgModel->insertRow(msgModel->rowCount(),aItemList);
|
||||
|
||||
aItemList.clear();
|
||||
aItem = new QStandardItem("车型");
|
||||
aItem->setEditable(false);
|
||||
aItem->setFont(font);
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("");
|
||||
aItemList.append(aItem);
|
||||
msgModel->insertRow(msgModel->rowCount(),aItemList);
|
||||
QComboBox *carType = new QComboBox();
|
||||
ui->tableView->setIndexWidget(msgModel->index(msgModel->rowCount()-1,1),carType);
|
||||
|
||||
aItemList.clear();
|
||||
aItem = new QStandardItem("北斗型号");
|
||||
aItem->setEditable(false);
|
||||
aItem->setFont(font);
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("");
|
||||
aItemList.append(aItem);
|
||||
msgModel->insertRow(msgModel->rowCount(),aItemList);
|
||||
|
||||
aItemList.clear();
|
||||
aItem = new QStandardItem("北斗序列号");
|
||||
aItem->setEditable(false);
|
||||
aItem->setFont(font);
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("");
|
||||
aItemList.append(aItem);
|
||||
msgModel->insertRow(msgModel->rowCount(),aItemList);
|
||||
|
||||
aItemList.clear();
|
||||
aItem = new QStandardItem("生产单位");
|
||||
aItem->setEditable(false);
|
||||
aItem->setFont(font);
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("");
|
||||
aItemList.append(aItem);
|
||||
msgModel->insertRow(msgModel->rowCount(),aItemList);
|
||||
}
|
||||
|
||||
MsgInputWin::~MsgInputWin()
|
||||
{
|
||||
delete ui;
|
||||
}
|
|
@ -0,0 +1,263 @@
|
|||
#include "posTestWin.h"
|
||||
#include "ui_posTestWin.h"
|
||||
#include <QPushButton>
|
||||
#include <qDebug>
|
||||
|
||||
PosTestWin::PosTestWin(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, ui(new Ui::PosTestWin)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->gpbRdTest->setVisible(false);
|
||||
ui->gpbRnTest->setVisible(true);
|
||||
ui->gpbRnSignal->setVisible(false);
|
||||
|
||||
rnModel = new QStandardItemModel(this);
|
||||
rnSelect = new QItemSelectionModel(rnModel);
|
||||
rnModel->setColumnCount(10);
|
||||
ui->tableViewRn->setModel(rnModel);
|
||||
ui->tableViewRn->setSelectionModel(rnSelect);
|
||||
ui->tableViewRn->horizontalHeader()->setVisible(false);
|
||||
ui->tableViewRn->verticalHeader()->setVisible(false);
|
||||
//ui->tableViewRn->horizontalHeader()->setStretchLastSection(true);
|
||||
ui->tableViewRn->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||
ui->tableViewRn->verticalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||
ui->tableViewRn->setWordWrap(true);
|
||||
|
||||
|
||||
rdModel = new QStandardItemModel(this);
|
||||
rdSelect = new QItemSelectionModel(rdModel);
|
||||
rdModel->setColumnCount(6);
|
||||
ui->tableViewRd->setModel(rdModel);
|
||||
ui->tableViewRd->setSelectionModel(rdSelect);
|
||||
ui->tableViewRd->horizontalHeader()->setVisible(false);
|
||||
ui->tableViewRd->verticalHeader()->setVisible(false);
|
||||
//ui->tableViewRn->horizontalHeader()->setStretchLastSection(true);
|
||||
ui->tableViewRd->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||
ui->tableViewRd->verticalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||
ui->tableViewRd->setWordWrap(true);
|
||||
|
||||
QFont font = ui->tableViewRn->font();
|
||||
font.setBold(true);
|
||||
QFont smallFont = font;
|
||||
smallFont.setPointSize(font.pointSize()-2);
|
||||
smallFont.setBold(false);
|
||||
|
||||
QList<QStandardItem *> aItemList;
|
||||
for(int r=0;r<9;r++){
|
||||
aItemList.clear();
|
||||
for(int c=0;c<11;c++){
|
||||
QStandardItem *aItem = new QStandardItem("");
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItem->setFont(smallFont);
|
||||
aItemList.append(aItem);
|
||||
}
|
||||
rnModel->insertRow(rnModel->rowCount(),aItemList);
|
||||
ui->tableViewRn->setSpan(r,0,1,2);
|
||||
}
|
||||
|
||||
for(int r=0;r<6;r++){
|
||||
aItemList.clear();
|
||||
for(int c=0;c<6;c++){
|
||||
QStandardItem *aItem = new QStandardItem("");
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItem->setFont(smallFont);
|
||||
aItemList.append(aItem);
|
||||
}
|
||||
rdModel->insertRow(rdModel->rowCount(),aItemList);
|
||||
ui->tableViewRd->setSpan(r,0,1,2);
|
||||
}
|
||||
|
||||
rnModel->item(0,0)->setText("定位模式");
|
||||
rnModel->item(0,0)->setFont(font);
|
||||
ui->tableViewRn->setSpan(0,0,2,2);
|
||||
|
||||
smallFont.setPointSize(font.pointSize()-1);
|
||||
smallFont.setBold(true);
|
||||
QPushButton *b1cBtn = new QPushButton("B1频点C码定位");
|
||||
b1cBtn->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
|
||||
b1cBtn->setFont(smallFont);
|
||||
b1cBtn->setDefault(true);
|
||||
ui->tableViewRn->setIndexWidget(rnModel->index(2,0),b1cBtn);
|
||||
|
||||
QPushButton *b3cBtn = new QPushButton("B3频点C码定位");
|
||||
b3cBtn->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
|
||||
b3cBtn->setFont(smallFont);
|
||||
b3cBtn->setDefault(true);
|
||||
ui->tableViewRn->setIndexWidget(rnModel->index(3,0),b3cBtn);
|
||||
|
||||
QPushButton *b1b3cBtn = new QPushButton("B1+B3频点C码定位");
|
||||
b1b3cBtn->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
|
||||
b1b3cBtn->setFont(smallFont);
|
||||
b1b3cBtn->setDefault(true);
|
||||
ui->tableViewRn->setIndexWidget(rnModel->index(4,0),b1b3cBtn);
|
||||
|
||||
QPushButton *gpsBtn = new QPushButton("GPS频点C码定位");
|
||||
gpsBtn->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
|
||||
gpsBtn->setFont(smallFont);
|
||||
gpsBtn->setDefault(true);
|
||||
ui->tableViewRn->setIndexWidget(rnModel->index(5,0),gpsBtn);
|
||||
|
||||
QPushButton *b1pBtn = new QPushButton("B1频点P码定位");
|
||||
b1pBtn->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
|
||||
b1pBtn->setFont(smallFont);
|
||||
b1pBtn->setDefault(true);
|
||||
ui->tableViewRn->setIndexWidget(rnModel->index(6,0),b1pBtn);
|
||||
|
||||
QPushButton *b3pBtn = new QPushButton("B3频点P码定位");
|
||||
b3pBtn->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
|
||||
b3pBtn->setFont(smallFont);
|
||||
b3pBtn->setDefault(true);
|
||||
ui->tableViewRn->setIndexWidget(rnModel->index(7,0),b3pBtn);
|
||||
|
||||
QPushButton *compatibleBtn = new QPushButton("兼容定位");
|
||||
compatibleBtn->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
|
||||
compatibleBtn->setFont(smallFont);
|
||||
compatibleBtn->setDefault(true);
|
||||
ui->tableViewRn->setIndexWidget(rnModel->index(8,0),compatibleBtn);
|
||||
|
||||
rnModel->item(0,2)->setText("定位结果");
|
||||
rnModel->item(0,2)->setFont(font);
|
||||
ui->tableViewRn->setSpan(0,2,1,7);
|
||||
|
||||
rnModel->item(1,2)->setText("时间");
|
||||
rnModel->item(1,2)->setFont(font);
|
||||
|
||||
rnModel->item(1,3)->setText("经度");
|
||||
rnModel->item(1,3)->setFont(font);
|
||||
|
||||
rnModel->item(1,4)->setText("纬度");
|
||||
rnModel->item(1,4)->setFont(font);
|
||||
|
||||
rnModel->item(1,5)->setText("高程");
|
||||
rnModel->item(1,5)->setFont(font);
|
||||
|
||||
rnModel->item(1,6)->setText("PDOP");
|
||||
rnModel->item(1,6)->setFont(font);
|
||||
|
||||
rnModel->item(1,7)->setText("VDOP");
|
||||
rnModel->item(1,7)->setFont(font);
|
||||
|
||||
rnModel->item(1,8)->setText("HDOP");
|
||||
rnModel->item(1,8)->setFont(font);
|
||||
|
||||
rnModel->item(0,9)->setText("卫星状态");
|
||||
rnModel->item(0,9)->setFont(font);
|
||||
ui->tableViewRn->setSpan(0,9,1,2);
|
||||
|
||||
rnModel->item(1,9)->setText("有效卫星");
|
||||
rnModel->item(1,9)->setFont(font);
|
||||
|
||||
rnModel->item(1,10)->setText("信号");
|
||||
rnModel->item(1,10)->setFont(font);
|
||||
|
||||
QPushButton *viewB1CBtn = new QPushButton("查看");
|
||||
viewB1CBtn->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
|
||||
viewB1CBtn->setFont(smallFont);
|
||||
viewB1CBtn->setDefault(true);
|
||||
ui->tableViewRn->setIndexWidget(rnModel->index(2,10),viewB1CBtn);
|
||||
|
||||
QPushButton *viewB3CBtn = new QPushButton("查看");
|
||||
viewB3CBtn->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
|
||||
viewB3CBtn->setFont(smallFont);
|
||||
viewB3CBtn->setDefault(true);
|
||||
ui->tableViewRn->setIndexWidget(rnModel->index(3,10),viewB3CBtn);
|
||||
|
||||
QPushButton *viewB1B3CBtn = new QPushButton("查看");
|
||||
viewB1B3CBtn->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
|
||||
viewB1B3CBtn->setFont(smallFont);
|
||||
viewB1B3CBtn->setDefault(true);
|
||||
ui->tableViewRn->setIndexWidget(rnModel->index(4,10),viewB1B3CBtn);
|
||||
|
||||
QPushButton *viewGPSBtn = new QPushButton("查看");
|
||||
viewGPSBtn->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
|
||||
viewGPSBtn->setFont(smallFont);
|
||||
viewGPSBtn->setDefault(true);
|
||||
ui->tableViewRn->setIndexWidget(rnModel->index(5,10),viewGPSBtn);
|
||||
|
||||
QPushButton *viewB1PBtn = new QPushButton("查看");
|
||||
viewB1PBtn->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
|
||||
viewB1PBtn->setFont(smallFont);
|
||||
viewB1PBtn->setDefault(true);
|
||||
ui->tableViewRn->setIndexWidget(rnModel->index(6,10),viewB1PBtn);
|
||||
|
||||
QPushButton *viewB3PBtn = new QPushButton("查看");
|
||||
viewB3PBtn->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
|
||||
viewB3PBtn->setFont(smallFont);
|
||||
viewB3PBtn->setDefault(true);
|
||||
ui->tableViewRn->setIndexWidget(rnModel->index(7,10),viewB3PBtn);
|
||||
|
||||
QPushButton *viewCompatibleBtn = new QPushButton("查看");
|
||||
viewCompatibleBtn->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
|
||||
viewCompatibleBtn->setFont(smallFont);
|
||||
viewCompatibleBtn->setDefault(true);
|
||||
ui->tableViewRn->setIndexWidget(rnModel->index(8,10),viewCompatibleBtn);
|
||||
|
||||
|
||||
|
||||
rdModel->item(0,0)->setText("定位模式");
|
||||
rdModel->item(0,0)->setFont(font);
|
||||
ui->tableViewRd->setSpan(0,0,2,2);
|
||||
|
||||
QPushButton *rdPosBtn = new QPushButton("RDSS单次定位");
|
||||
rdPosBtn->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
|
||||
rdPosBtn->setFont(font);
|
||||
rdPosBtn->setDefault(true);
|
||||
ui->tableViewRd->setIndexWidget(rdModel->index(2,0),rdPosBtn);
|
||||
|
||||
QPushButton *rdContinuePosBtn = new QPushButton("RDSS连续定位");
|
||||
rdContinuePosBtn->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
|
||||
rdContinuePosBtn->setFont(font);
|
||||
rdContinuePosBtn->setDefault(true);
|
||||
ui->tableViewRd->setIndexWidget(rdModel->index(3,0),rdContinuePosBtn);
|
||||
|
||||
QPushButton *rdEmergencyPosBtn = new QPushButton("RDSS紧急定位");
|
||||
rdEmergencyPosBtn->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
|
||||
rdEmergencyPosBtn->setFont(font);
|
||||
rdEmergencyPosBtn->setDefault(true);
|
||||
ui->tableViewRd->setIndexWidget(rdModel->index(4,0),rdEmergencyPosBtn);
|
||||
|
||||
QPushButton *rdStopContinuePosBtn = new QPushButton("结束RDSS连续定位");
|
||||
rdStopContinuePosBtn->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
|
||||
rdStopContinuePosBtn->setFont(font);
|
||||
rdStopContinuePosBtn->setDefault(true);
|
||||
ui->tableViewRd->setIndexWidget(rdModel->index(5,0),rdStopContinuePosBtn);
|
||||
|
||||
rdModel->item(0,2)->setText("定位结果");
|
||||
rdModel->item(0,2)->setFont(font);
|
||||
ui->tableViewRd->setSpan(0,2,1,4);
|
||||
|
||||
rdModel->item(1,2)->setText("时间");
|
||||
rdModel->item(1,2)->setFont(font);
|
||||
|
||||
rdModel->item(1,3)->setText("经度");
|
||||
rdModel->item(1,3)->setFont(font);
|
||||
|
||||
rdModel->item(1,4)->setText("纬度");
|
||||
rdModel->item(1,4)->setFont(font);
|
||||
|
||||
rdModel->item(1,5)->setText("高程");
|
||||
rdModel->item(1,5)->setFont(font);
|
||||
}
|
||||
|
||||
PosTestWin::~PosTestWin()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void PosTestWin::on_btnRdTest_clicked()
|
||||
{
|
||||
ui->gpbRdTest->setVisible(true);
|
||||
ui->gpbRnTest->setVisible(false);
|
||||
ui->gpbRnSignal->setVisible(false);
|
||||
}
|
||||
|
||||
|
||||
void PosTestWin::on_btnRnTest_clicked()
|
||||
{
|
||||
ui->gpbRdTest->setVisible(false);
|
||||
ui->gpbRnTest->setVisible(true);
|
||||
ui->gpbRnSignal->setVisible(false);
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
#include "precisionTestWin.h"
|
||||
#include "ui_precisionTestWin.h"
|
||||
#include <QFont>
|
||||
#include <QDebug>
|
||||
|
||||
PrecisionTestWin::PrecisionTestWin(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, ui(new Ui::PrecisionTestWin)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
QFont font = ui->cmbFormat->font();
|
||||
ui->cmbFormat->setCurrentIndex(0);
|
||||
}
|
||||
|
||||
PrecisionTestWin::~PrecisionTestWin()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void PrecisionTestWin::on_cmbFormat_currentIndexChanged(int index)
|
||||
{
|
||||
if(index==0){
|
||||
ui->lbLonDeg->setVisible(false);
|
||||
ui->leLonMinute->setVisible(false);
|
||||
ui->lbLonMinute->setVisible(false);
|
||||
ui->leLonSec->setVisible(false);
|
||||
ui->lbLonSec->setVisible(false);
|
||||
|
||||
ui->lbLatDeg->setVisible(false);
|
||||
ui->leLatMinute->setVisible(false);
|
||||
ui->lbLatMinute->setVisible(false);
|
||||
ui->leLatSec->setVisible(false);
|
||||
ui->lbLatSec->setVisible(false);
|
||||
}else if(index==1){
|
||||
ui->lbLonDeg->setVisible(true);
|
||||
ui->leLonMinute->setVisible(false);
|
||||
ui->lbLonMinute->setVisible(false);
|
||||
ui->leLonSec->setVisible(false);
|
||||
ui->lbLonSec->setVisible(false);
|
||||
|
||||
ui->lbLatDeg->setVisible(true);
|
||||
ui->leLatMinute->setVisible(false);
|
||||
ui->lbLatMinute->setVisible(false);
|
||||
ui->leLatSec->setVisible(false);
|
||||
ui->lbLatSec->setVisible(false);
|
||||
}else if(index==2){
|
||||
ui->lbLonDeg->setVisible(true);
|
||||
ui->leLonMinute->setVisible(true);
|
||||
ui->lbLonMinute->setVisible(true);
|
||||
ui->leLonSec->setVisible(true);
|
||||
ui->lbLonSec->setVisible(true);
|
||||
|
||||
ui->lbLatDeg->setVisible(true);
|
||||
ui->leLatMinute->setVisible(true);
|
||||
ui->lbLatMinute->setVisible(true);
|
||||
ui->leLatSec->setVisible(true);
|
||||
ui->lbLatSec->setVisible(true);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
#include "serialport.h"
|
||||
#include <QDebug>
|
||||
|
||||
SerialPort::SerialPort(QObject *parent) : QObject(parent)
|
||||
{
|
||||
serial = new QSerialPort;
|
||||
thread = new QThread;
|
||||
this->moveToThread(thread);
|
||||
thread->start();
|
||||
connect(serial,SIGNAL(readyRead()),this,SLOT(readData()),Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
SerialPort::~SerialPort()
|
||||
{
|
||||
serial->close();
|
||||
serial->deleteLater();
|
||||
thread->quit();
|
||||
thread->wait();
|
||||
thread->deleteLater();
|
||||
}
|
||||
|
||||
bool SerialPort::open()
|
||||
{
|
||||
if(serial){
|
||||
serial->open(QIODevice::ReadWrite);
|
||||
if(serial->isOpen()){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void SerialPort::close()
|
||||
{
|
||||
if(serial && serial->isOpen()){
|
||||
serial->close();
|
||||
}
|
||||
}
|
||||
|
||||
void SerialPort::setSerialconfig(QString comName, int baud)
|
||||
{
|
||||
if(serial){
|
||||
serial->setPortName(comName);
|
||||
serial->setBaudRate(baud);
|
||||
serial->setDataBits(QSerialPort::Data8);
|
||||
serial->setStopBits(QSerialPort::OneStop);
|
||||
serial->setParity(QSerialPort::NoParity);
|
||||
curBaud = baud;
|
||||
}
|
||||
}
|
||||
|
||||
void SerialPort::setSerialconfig(int baud)
|
||||
{
|
||||
if(serial){
|
||||
serial->setBaudRate(baud);
|
||||
curBaud = baud;
|
||||
}
|
||||
}
|
||||
|
||||
bool SerialPort::isOpen()
|
||||
{
|
||||
return serial->isOpen();
|
||||
}
|
||||
|
||||
int SerialPort::getBaud()
|
||||
{
|
||||
return curBaud;
|
||||
}
|
||||
|
||||
void SerialPort::writeData(const QString &cmd)
|
||||
{
|
||||
if(serial && serial->isOpen()){
|
||||
serial->write(cmd.toLocal8Bit());
|
||||
}
|
||||
}
|
||||
|
||||
void SerialPort::writeData(const QByteArray &buf)
|
||||
{
|
||||
if(serial && serial->isOpen()){
|
||||
serial->write(buf);
|
||||
}
|
||||
}
|
||||
|
||||
void SerialPort::readData()
|
||||
{
|
||||
//qDebug()<<"子线程id"<<QThread::currentThreadId();
|
||||
if(serial){
|
||||
int size = serial->bytesAvailable();
|
||||
if(size<=0){
|
||||
return;
|
||||
}
|
||||
QByteArray buf(size,0);
|
||||
if(buf.data()){
|
||||
serial->read(buf.data(),size);
|
||||
emit recvSerialDataSignal(buf);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,281 @@
|
|||
#include "sqlitedb.h"
|
||||
#include <QDateTime>
|
||||
#include <QMap>
|
||||
#include <QDebug>
|
||||
|
||||
SQLITEDB::SQLITEDB(QObject *parent)
|
||||
:QObject(parent)
|
||||
{
|
||||
thread = new QThread;
|
||||
this->moveToThread(thread);
|
||||
connect(thread, SIGNAL(finished()), this, SLOT(deleteLater()));
|
||||
thread->start();
|
||||
openDateBase();
|
||||
}
|
||||
|
||||
SQLITEDB::~SQLITEDB()
|
||||
{
|
||||
thread->quit();
|
||||
thread->wait();
|
||||
closeDateBase();
|
||||
}
|
||||
|
||||
void SQLITEDB::openDateBase()
|
||||
{
|
||||
DB=QSqlDatabase::addDatabase("QSQLITE");
|
||||
DB.setDatabaseName("database.db"); //设置数据库名称
|
||||
if (!DB.open()) //打开数据库
|
||||
{
|
||||
qDebug()<<"打开数据库失败";
|
||||
return;
|
||||
}else{
|
||||
qDebug()<<"打开数据库成功";
|
||||
}
|
||||
if(!tableExist("USERS")){
|
||||
QSqlQuery query(DB);
|
||||
query.prepare("CREATE TABLE [USERS](\
|
||||
[ID] TEXT(255) NOT NULL UNIQUE,\
|
||||
[PASSWORD] TEXT(4096),\
|
||||
[USER_TYPE] TEXT(5));");
|
||||
|
||||
if(!query.exec()){
|
||||
qDebug()<<"数据表创建失败";
|
||||
}else{
|
||||
//添加默认管理员账号
|
||||
query.prepare("INSERT INTO USERS (ID,PASSWORD,USER_TYPE) VALUES(:ID,:PASSWORD,:USER_TYPE);");
|
||||
query.bindValue(":ID","admin");
|
||||
query.bindValue(":PASSWORD","YWRtaW4=");
|
||||
query.bindValue(":USER_TYPE","Admin");
|
||||
if(!query.exec()){
|
||||
qDebug()<<"添加默认管理员账号失败";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SQLITEDB::closeDateBase()
|
||||
{
|
||||
if(DB.isOpen()){
|
||||
DB.close();
|
||||
}
|
||||
}
|
||||
|
||||
QSqlDatabase &SQLITEDB::getDateBase()
|
||||
{
|
||||
return DB;
|
||||
}
|
||||
|
||||
bool SQLITEDB::tableExist(const QString &table)
|
||||
{
|
||||
QSqlQuery query(DB);
|
||||
query.prepare(QString("SELECT * FROM %1").arg(table));
|
||||
if(!query.exec()){
|
||||
qDebug()<<query.lastError().text();
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool SQLITEDB::keyExist(const QString &table, const QString &key)
|
||||
{
|
||||
QSqlQuery query(DB);
|
||||
query.prepare(QString("SELECT %1 FROM %2").arg(key,table));
|
||||
if(!query.exec()){
|
||||
qDebug()<<query.lastError().text();
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool SQLITEDB::createKey(const QString &table, const QString &key, const QString &type)
|
||||
{
|
||||
QSqlQuery query(DB);
|
||||
query.prepare(QString("ALTER TABLE %1 ADD %2 %3").arg(table,key,type));
|
||||
if(!query.exec()){
|
||||
qDebug()<<query.lastError().text();
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool SQLITEDB::createTable(const QString &sql)
|
||||
{
|
||||
QSqlQuery query(DB);
|
||||
query.prepare(sql);
|
||||
if(!query.exec()){
|
||||
qDebug()<<query.lastError().text();
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
QStringList SQLITEDB::getPrimaryKeys(const QString &table)
|
||||
{
|
||||
QStringList primaryKeys;
|
||||
QString cmd = QString("SELECT l.name FROM pragma_table_info(\"%1\") as l Where l.pk<>0;").arg(table);
|
||||
QSqlQuery query(DB);
|
||||
query.prepare(cmd);
|
||||
if(!query.exec()){
|
||||
qDebug()<<query.lastError().text();
|
||||
}
|
||||
while(query.next()){
|
||||
QString key = query.value("name").toString();
|
||||
if(!key.isEmpty()){
|
||||
primaryKeys.append(key);
|
||||
}
|
||||
}
|
||||
return primaryKeys;
|
||||
}
|
||||
|
||||
QStringList SQLITEDB::getTableFields(const QString &table)
|
||||
{
|
||||
QStringList keys;
|
||||
QString cmd = QString("SELECT l.name FROM pragma_table_info(\"%1\") as l;").arg(table);
|
||||
QSqlQuery query(DB);
|
||||
query.prepare(cmd);
|
||||
if(!query.exec()){
|
||||
qDebug()<<query.lastError().text();
|
||||
}
|
||||
while(query.next()){
|
||||
QString key = query.value("name").toString();
|
||||
if(!key.isEmpty()){
|
||||
keys.append(key);
|
||||
}
|
||||
}
|
||||
return keys;
|
||||
}
|
||||
|
||||
QStringList SQLITEDB::getTableNames()
|
||||
{
|
||||
QStringList tableNames;
|
||||
QString cmd = QString("SELECT name FROM sqlite_master WHERE type=\"table\" AND name!=\"sqlite_sequence\";");
|
||||
QSqlQuery query(DB);
|
||||
query.prepare(cmd);
|
||||
if(!query.exec()){
|
||||
qDebug()<<query.lastError().text();
|
||||
}
|
||||
while(query.next()){
|
||||
QString key = query.value("name").toString();
|
||||
if(!key.isEmpty()){
|
||||
tableNames.append(key);
|
||||
}
|
||||
}
|
||||
return tableNames;
|
||||
}
|
||||
|
||||
QVector<QMap<QString, QString> > SQLITEDB::getRecord(const QString &table, const QMap<QString, QString> &condition)
|
||||
{
|
||||
QVector<QMap<QString, QString> > vecMap;
|
||||
QSqlQuery query(DB);
|
||||
QString cmd = QString("SELECT * FROM %1 WHERE ").arg(table);
|
||||
QStringList keys;
|
||||
foreach (const QString &key, condition.keys()) {
|
||||
keys.append(key);
|
||||
}
|
||||
if(keys.size()>0){
|
||||
for(int i=0;i<keys.size();i++){
|
||||
cmd += QString("%1=:%2").arg(keys[i]).arg(keys[i]);
|
||||
if(i<keys.size()-1){
|
||||
cmd += " AND ";
|
||||
}
|
||||
}
|
||||
}
|
||||
query.prepare(cmd);
|
||||
for(int i=0;i<keys.size();i++){
|
||||
QString key = QString(":%1").arg(keys[i]);
|
||||
query.bindValue(key,condition.value(keys[i]));
|
||||
}
|
||||
query.exec();
|
||||
while(query.next()){
|
||||
QSqlRecord rec = query.record();
|
||||
QMap<QString, QString> map;
|
||||
int count = rec.count();
|
||||
for(int i=0;i<count;i++){
|
||||
QString key = rec.fieldName(i);
|
||||
QString value = rec.value(key).toString();
|
||||
map[key] = value;
|
||||
}
|
||||
vecMap.append(map);
|
||||
}
|
||||
|
||||
return vecMap;
|
||||
}
|
||||
|
||||
bool SQLITEDB::saveRecord(const QString &table, const QMap<QString, QString> &map)
|
||||
{
|
||||
QStringList primaryKeys = SQLITEDB::getInstance().getPrimaryKeys(table);
|
||||
|
||||
QStringList tableFields = SQLITEDB::getInstance().getTableFields(table);
|
||||
QSet<QString> fields;
|
||||
for(int i=0;i<tableFields.size();i++){
|
||||
fields.insert(tableFields[i]);
|
||||
}
|
||||
|
||||
//查询数据库中是否存在该记录
|
||||
QSqlQuery query(SQLITEDB::getInstance().getDateBase());
|
||||
QString cmd = QString("SELECT * FROM %1").arg(table);
|
||||
QString condition = " WHERE ";
|
||||
if(primaryKeys.size()>0){
|
||||
for(int i=0;i<primaryKeys.size();i++){
|
||||
condition += QString("%1=:%2").arg(primaryKeys[i]).arg(primaryKeys[i]);
|
||||
if(i<primaryKeys.size()-1){
|
||||
condition += " AND ";
|
||||
}
|
||||
}
|
||||
cmd += condition;
|
||||
}
|
||||
|
||||
query.prepare(cmd);
|
||||
for(int i=0;i<primaryKeys.size();i++){
|
||||
QString key = QString(":%1").arg(primaryKeys[i]);
|
||||
QString value = map.value(primaryKeys[i]," ");
|
||||
query.bindValue(key,value);
|
||||
}
|
||||
|
||||
query.exec();
|
||||
if(query.first()){
|
||||
QString val;
|
||||
foreach (const QString &key, map.keys()) {
|
||||
if(!fields.contains(key)){
|
||||
continue;
|
||||
}
|
||||
val += QString("%1=:%2,").arg(key,key);
|
||||
}
|
||||
val = val.left(val.lastIndexOf(","));//去掉最后一个","
|
||||
QString command = QString("UPDATE %1 set %2 %3;").arg(table,val,condition);
|
||||
query.prepare(command);
|
||||
}else{//无记录插入
|
||||
QString key,val;
|
||||
foreach (const QString &_key, map.keys()) {
|
||||
if(!fields.contains(_key)){
|
||||
continue;
|
||||
}
|
||||
key += QString("%1,").arg(_key);
|
||||
val += QString(":%1,").arg(_key);
|
||||
}
|
||||
key = key.left(key.lastIndexOf(","));//去掉最后一个","
|
||||
val = val.left(val.lastIndexOf(","));//去掉最后一个","
|
||||
QString command = QString("INSERT INTO %1 (%2) VALUES(%3);").arg(table,key,val);
|
||||
query.prepare(command);
|
||||
}
|
||||
foreach (const QString &_key, map.keys()) {
|
||||
if(!fields.contains(_key)){
|
||||
continue;
|
||||
}
|
||||
QString key = QString(":%1").arg(_key);
|
||||
query.bindValue(key,map.value(_key));
|
||||
}
|
||||
if(!query.exec()){
|
||||
qDebug()<<query.lastError().text();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,253 @@
|
|||
#include "statusTestWin.h"
|
||||
#include "ui_statusTestWin.h"
|
||||
#include <QPushButton>
|
||||
#include <QFontMetrics>
|
||||
|
||||
StatusTestWin::StatusTestWin(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, ui(new Ui::StatusTestWin)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
statusModel = new QStandardItemModel(this);
|
||||
statusSelect = new QItemSelectionModel(statusModel);
|
||||
statusModel->setColumnCount(3);
|
||||
ui->tableView->setModel(statusModel);
|
||||
ui->tableView->setSelectionModel(statusSelect);
|
||||
ui->tableView->horizontalHeader()->setVisible(false);
|
||||
ui->tableView->verticalHeader()->setVisible(false);
|
||||
ui->tableView->horizontalHeader()->setStretchLastSection(true);
|
||||
ui->tableView->verticalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||
ui->tableView->setWordWrap(true);
|
||||
|
||||
QFont font = ui->tableView->font();
|
||||
font.setBold(true);
|
||||
|
||||
QList<QStandardItem *> aItemList;
|
||||
QStandardItem *aItem = new QStandardItem("");
|
||||
aItem->setEditable(false);
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
statusModel->insertRow(statusModel->rowCount(),aItemList);
|
||||
QPushButton *readRnSnBtn = new QPushButton("读取RNSS北斗序列号");
|
||||
readRnSnBtn->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
|
||||
readRnSnBtn->setFont(font);
|
||||
readRnSnBtn->setDefault(true);
|
||||
//QFontMetrics metrics = readRnSnBtn->fontMetrics();
|
||||
//int minW = metrics.horizontalAdvance("读取RNSS北斗序列号")+40;
|
||||
//readRnSnBtn->setMinimumWidth(minW);
|
||||
//ui->tableView->setColumnWidth(0,minW);
|
||||
ui->tableView->setIndexWidget(statusModel->index(statusModel->rowCount()-1,0),readRnSnBtn);
|
||||
ui->tableView->setSpan(statusModel->rowCount()-1,0,1,2);
|
||||
|
||||
aItemList.clear();
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setEditable(false);
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
statusModel->insertRow(statusModel->rowCount(),aItemList);
|
||||
QPushButton *readMPD9Btn = new QPushButton("读取MPD009编号");
|
||||
readMPD9Btn->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
|
||||
readMPD9Btn->setFont(font);
|
||||
readMPD9Btn->setDefault(true);
|
||||
ui->tableView->setIndexWidget(statusModel->index(statusModel->rowCount()-1,0),readMPD9Btn);
|
||||
ui->tableView->setSpan(statusModel->rowCount()-1,0,1,2);
|
||||
|
||||
aItemList.clear();
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setEditable(false);
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
statusModel->insertRow(statusModel->rowCount(),aItemList);
|
||||
QPushButton *readMPD7Btn = new QPushButton("读取MPD007编号");
|
||||
readMPD7Btn->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
|
||||
readMPD7Btn->setFont(font);
|
||||
readMPD7Btn->setDefault(true);
|
||||
ui->tableView->setIndexWidget(statusModel->index(statusModel->rowCount()-1,0),readMPD7Btn);
|
||||
ui->tableView->setSpan(statusModel->rowCount()-1,0,1,2);
|
||||
|
||||
aItemList.clear();
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setEditable(false);
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
statusModel->insertRow(statusModel->rowCount(),aItemList);
|
||||
QPushButton *readPrmBtn = new QPushButton("读取PRM编号");
|
||||
readPrmBtn->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
|
||||
readPrmBtn->setFont(font);
|
||||
readPrmBtn->setDefault(true);
|
||||
ui->tableView->setIndexWidget(statusModel->index(statusModel->rowCount()-1,0),readPrmBtn);
|
||||
ui->tableView->setSpan(statusModel->rowCount()-1,0,1,2);
|
||||
|
||||
aItemList.clear();
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setEditable(false);
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
statusModel->insertRow(statusModel->rowCount(),aItemList);
|
||||
QPushButton *readMPD7DateBtn = new QPushButton("读取MPD007有效期");
|
||||
readMPD7DateBtn->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
|
||||
readMPD7DateBtn->setFont(font);
|
||||
readMPD7DateBtn->setDefault(true);
|
||||
ui->tableView->setIndexWidget(statusModel->index(statusModel->rowCount()-1,0),readMPD7DateBtn);
|
||||
ui->tableView->setSpan(statusModel->rowCount()-1,0,1,2);
|
||||
|
||||
aItemList.clear();
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setEditable(false);
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
statusModel->insertRow(statusModel->rowCount(),aItemList);
|
||||
QPushButton *readPrmDateBtn = new QPushButton("读取PRM有效期");
|
||||
readPrmDateBtn->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
|
||||
readPrmDateBtn->setFont(font);
|
||||
readPrmDateBtn->setDefault(true);
|
||||
ui->tableView->setIndexWidget(statusModel->index(statusModel->rowCount()-1,0),readPrmDateBtn);
|
||||
ui->tableView->setSpan(statusModel->rowCount()-1,0,1,2);
|
||||
//多一行空白行合并,使该行变宽
|
||||
aItemList.clear();
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setEditable(false);
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
statusModel->insertRow(statusModel->rowCount(),aItemList);
|
||||
ui->tableView->setSpan(statusModel->rowCount()-2,0,2,2);
|
||||
ui->tableView->setSpan(statusModel->rowCount()-2,2,2,1);
|
||||
|
||||
aItemList.clear();
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setEditable(false);
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
statusModel->insertRow(statusModel->rowCount(),aItemList);
|
||||
QPushButton *readRdSnBtn = new QPushButton("读取RDSS北斗序列号");
|
||||
readRdSnBtn->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
|
||||
readRdSnBtn->setFont(font);
|
||||
readRdSnBtn->setDefault(true);
|
||||
ui->tableView->setIndexWidget(statusModel->index(statusModel->rowCount()-1,0),readRdSnBtn);
|
||||
ui->tableView->setSpan(statusModel->rowCount()-1,0,1,2);
|
||||
|
||||
aItemList.clear();
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setEditable(false);
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("北斗ID号");
|
||||
aItem->setFont(font);
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
statusModel->insertRow(statusModel->rowCount(),aItemList);
|
||||
QPushButton *readIdBtn = new QPushButton("读取北斗ID号");
|
||||
readIdBtn->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
|
||||
readIdBtn->setFont(font);
|
||||
readIdBtn->setDefault(true);
|
||||
ui->tableView->setIndexWidget(statusModel->index(statusModel->rowCount()-1,0),readIdBtn);
|
||||
aItemList.clear();
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setEditable(false);
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("服务频度");
|
||||
aItem->setFont(font);
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
statusModel->insertRow(statusModel->rowCount(),aItemList);
|
||||
aItemList.clear();
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setEditable(false);
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("通信等级");
|
||||
aItem->setFont(font);
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
statusModel->insertRow(statusModel->rowCount(),aItemList);
|
||||
aItemList.clear();
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setEditable(false);
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("通播地址");
|
||||
aItem->setFont(font);
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
statusModel->insertRow(statusModel->rowCount(),aItemList);
|
||||
aItemList.clear();
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setEditable(false);
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("保密标志");
|
||||
aItem->setFont(font);
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
aItem = new QStandardItem("");
|
||||
aItem->setTextAlignment(Qt::AlignCenter);
|
||||
aItemList.append(aItem);
|
||||
statusModel->insertRow(statusModel->rowCount(),aItemList);
|
||||
ui->tableView->setSpan(statusModel->rowCount()-5,0,5,1);
|
||||
|
||||
}
|
||||
|
||||
StatusTestWin::~StatusTestWin()
|
||||
{
|
||||
delete ui;
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
#include "titlebar.h"
|
||||
#include "ui_titlebar.h"
|
||||
#include <QLabel>
|
||||
#include <QPushButton>
|
||||
#include <qt_windows.h>
|
||||
#include <QDebug>
|
||||
|
||||
#pragma comment(lib, "User32.lib")
|
||||
|
||||
TitleBar::TitleBar(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::TitleBar)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setAttribute(Qt::WA_StyledBackground);
|
||||
//this->setPalette(QPalette(QColor(235,246,249)));
|
||||
this->setPalette(QPalette(QColor(240,240,240)));
|
||||
|
||||
this->setAutoFillBackground(true);
|
||||
ui->btnMin->setStyleSheet("QPushButton{background-image:url(:/images/min.png);\
|
||||
background-color:rgb(240,240,240);background-position:center;border:none}" \
|
||||
"QPushButton:hover{background-color:rgba(233,233,233,150);" \
|
||||
"background-image:url(:/images/min.png);border:none;}");
|
||||
ui->btnMax->setStyleSheet("QPushButton{background-image:url(:/images/normal.png);\
|
||||
background-color:rgb(240,240,240);background-position:center;border:none}" \
|
||||
"QPushButton:hover{background-color:rgba(233,233,233,150);}");
|
||||
ui->btnClose->setStyleSheet("QPushButton{background-image:url(:/images/close.png);\
|
||||
background-color:rgb(240,240,240);background-position:center;border:none}" \
|
||||
"QPushButton:hover{background-image:url(:/images/close_hover.png);\
|
||||
background-color:rgba(196,43,28,220);}");
|
||||
ui->btnMax->setVisible(false);
|
||||
connect(ui->btnMin,SIGNAL(clicked(bool)),this,SLOT(btnClickHandle()),Qt::QueuedConnection);
|
||||
connect(ui->btnMax,SIGNAL(clicked(bool)),this,SLOT(btnClickHandle()),Qt::QueuedConnection);
|
||||
connect(ui->btnClose,SIGNAL(clicked(bool)),this,SLOT(btnClickHandle()),Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
TitleBar::~TitleBar()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void TitleBar::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
if(ReleaseCapture()){
|
||||
QWidget* pWindow = this->window();
|
||||
if(pWindow->isTopLevel()){
|
||||
SendMessage(HWND(pWindow->winId()), WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TitleBar::mouseDoubleClickEvent(QMouseEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
emit ui->btnMax->clicked();
|
||||
}
|
||||
|
||||
void TitleBar::btnClickHandle()
|
||||
{
|
||||
|
||||
QPushButton *btn = qobject_cast<QPushButton*>(sender());
|
||||
QWidget *pWindow = this->window();
|
||||
if(btn == ui->btnMin){
|
||||
pWindow->showMinimized();
|
||||
}else if(btn == ui->btnMax){
|
||||
if(pWindow->isMaximized()){
|
||||
pWindow->showNormal();
|
||||
ui->btnMax->setStyleSheet("QPushButton{background-image:url(:/images/normal.png);\
|
||||
background-color:rgb(255,255,255);background-position:center;border:none}" \
|
||||
"QPushButton:hover{background-color:rgba(233,233,233,150);}");
|
||||
}else{
|
||||
pWindow->showMaximized();
|
||||
ui->btnMax->setStyleSheet("QPushButton{background-image:url(:/images/max.png);\
|
||||
background-color:rgb(255,255,255);background-position:center;border:none}" \
|
||||
"QPushButton:hover{background-color:rgba(233,233,233,150);}");
|
||||
}
|
||||
}else if(btn == ui->btnClose){
|
||||
emit windowCloseSignal();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,82 @@
|
|||
#include "utils.h"
|
||||
#include <string.h>
|
||||
|
||||
void base64_encode(const unsigned char *str, int str_len, unsigned char *res, int *res_len)
|
||||
{
|
||||
long len;
|
||||
|
||||
int i,j;
|
||||
//定义base64编码表
|
||||
unsigned char base64_table[128]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
|
||||
//计算经过base64编码后的字符串长度
|
||||
if(str_len % 3 == 0)
|
||||
len=str_len/3*4;
|
||||
else
|
||||
len=(str_len/3+1)*4;
|
||||
|
||||
*res_len = len;
|
||||
res[len]='\0';
|
||||
|
||||
//以3个8位字符为一组进行编码
|
||||
for(i=0,j=0;i<len-2;j+=3,i+=4)
|
||||
{
|
||||
res[i]=base64_table[str[j]>>2]; //取出第一个字符的前6位并找出对应的结果字符
|
||||
res[i+1]=base64_table[(str[j]&0x3)<<4 | (str[j+1]>>4)]; //将第一个字符的后位与第二个字符的前4位进行组合并找到对应的结果字符
|
||||
res[i+2]=base64_table[(str[j+1]&0xf)<<2 | (str[j+2]>>6)]; //将第二个字符的后4位与第三个字符的前2位组合并找出对应的结果字符
|
||||
res[i+3]=base64_table[str[j+2]&0x3f]; //取出第三个字符的后6位并找出结果字符
|
||||
}
|
||||
|
||||
switch(str_len % 3)
|
||||
{
|
||||
case 1:
|
||||
res[i-2]='=';
|
||||
res[i-1]='=';
|
||||
break;
|
||||
case 2:
|
||||
res[i-1]='=';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void base64_decode(const unsigned char *code, int code_len, unsigned char *res, int *res_len)
|
||||
{
|
||||
//根据base64表,以字符找到对应的十进制数据
|
||||
int table[]={0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,62,0,0,0,
|
||||
63,52,53,54,55,56,57,58,
|
||||
59,60,61,0,0,0,0,0,0,0,0,
|
||||
1,2,3,4,5,6,7,8,9,10,11,12,
|
||||
13,14,15,16,17,18,19,20,21,
|
||||
22,23,24,25,0,0,0,0,0,0,26,
|
||||
27,28,29,30,31,32,33,34,35,
|
||||
36,37,38,39,40,41,42,43,44,
|
||||
45,46,47,48,49,50,51
|
||||
};
|
||||
long len;
|
||||
long str_len;
|
||||
|
||||
int i,j;
|
||||
|
||||
//计算解码后的字符串长度
|
||||
len = code_len;
|
||||
//判断编码后的字符串后是否有=
|
||||
if(strstr((char*)code,"=="))
|
||||
str_len=len/4*3-2;
|
||||
else if(strstr((char*)code,"="))
|
||||
str_len=len/4*3-1;
|
||||
else
|
||||
str_len=len/4*3;
|
||||
|
||||
res[str_len]='\0';
|
||||
*res_len = str_len;
|
||||
//以4个字符为一位进行解码
|
||||
for(i=0,j=0;i < len-2;j+=3,i+=4)
|
||||
{
|
||||
res[j]=((unsigned char)table[code[i]])<<2 | (((unsigned char)table[code[i+1]])>>4); //取出第一个字符对应base64表的十进制数的前6位与第二个字符对应base64表的十进制数的后2位进行组合
|
||||
res[j+1]=(((unsigned char)table[code[i+1]])<<4) | (((unsigned char)table[code[i+2]])>>2); //取出第二个字符对应base64表的十进制数的后4位与第三个字符对应bas464表的十进制数的后4位进行组合
|
||||
res[j+2]=(((unsigned char)table[code[i+2]])<<6) | ((unsigned char)table[code[i+3]]); //取出第三个字符对应base64表的十进制数的后2位与第4个字符进行组合
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
#ifndef GLOBALPARAMS_H
|
||||
#define GLOBALPARAMS_H
|
||||
#include <QString>
|
||||
|
||||
namespace globalParams
|
||||
{
|
||||
extern QString curUserId;
|
||||
extern QString curUserType;
|
||||
}
|
||||
|
||||
#endif // GLOBALPARAMS_H
|
|
@ -0,0 +1,29 @@
|
|||
#ifndef INTERFACETESTWIN_H
|
||||
#define INTERFACETESTWIN_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QStandardItemModel>
|
||||
#include <QItemSelectionModel>
|
||||
|
||||
namespace Ui {
|
||||
class InterfaceTestWin;
|
||||
}
|
||||
|
||||
class InterfaceTestWin : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit InterfaceTestWin(QWidget *parent = nullptr);
|
||||
~InterfaceTestWin();
|
||||
|
||||
private:
|
||||
Ui::InterfaceTestWin *ui;
|
||||
QStandardItemModel *serialModel;
|
||||
QItemSelectionModel *serialSelect;
|
||||
QStandardItemModel *canModel;
|
||||
QItemSelectionModel *canSelect;
|
||||
|
||||
};
|
||||
|
||||
#endif // INTERFACETESTWIN_H
|
|
@ -0,0 +1,37 @@
|
|||
#ifndef LOGINWIN_H
|
||||
#define LOGINWIN_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QMap>
|
||||
|
||||
namespace Ui {
|
||||
class LoginWin;
|
||||
}
|
||||
|
||||
class LoginWin : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit LoginWin(QWidget *parent = 0);
|
||||
~LoginWin();
|
||||
|
||||
signals:
|
||||
void loginSignal();
|
||||
|
||||
private slots:
|
||||
void windowCloseHandle();
|
||||
void on_btnLogin_clicked();
|
||||
void on_cmbName_currentTextChanged(const QString &arg1);
|
||||
|
||||
protected:
|
||||
bool nativeEvent(const QByteArray& eventType, void* message, long *result) override;
|
||||
|
||||
private:
|
||||
Ui::LoginWin *ui;
|
||||
QMap<QString,QString> nameMap;
|
||||
void readCfg();
|
||||
void saveCfg();
|
||||
};
|
||||
|
||||
#endif // LOGINWIN_H
|
|
@ -0,0 +1,40 @@
|
|||
#ifndef MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QLabel>
|
||||
#include "serialport.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui {
|
||||
class MainWindow;
|
||||
}
|
||||
QT_END_NAMESPACE
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MainWindow(QWidget *parent = nullptr);
|
||||
~MainWindow();
|
||||
|
||||
private slots:
|
||||
void receiverSerialDataHandle(const QByteArray &data);
|
||||
void loginHandle();
|
||||
void btnCleanClickedHandle();
|
||||
void on_tbtnFresh_clicked();
|
||||
void on_tbtnConnect_clicked();
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
QByteArray leftData;
|
||||
SerialPort *serial = nullptr;
|
||||
QLabel *lbCurUserId;
|
||||
QLabel *lbComStatus;
|
||||
QLabel *lbSendByte;
|
||||
QLabel *lbRecvByte;
|
||||
bool bconnected = false;
|
||||
void serialPortInit();
|
||||
};
|
||||
#endif // MAINWINDOW_H
|
|
@ -0,0 +1,26 @@
|
|||
#ifndef MSGINPUTWIN_H
|
||||
#define MSGINPUTWIN_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QStandardItemModel>
|
||||
#include <QItemSelectionModel>
|
||||
|
||||
namespace Ui {
|
||||
class MsgInputWin;
|
||||
}
|
||||
|
||||
class MsgInputWin : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MsgInputWin(QWidget *parent = nullptr);
|
||||
~MsgInputWin();
|
||||
|
||||
private:
|
||||
Ui::MsgInputWin *ui;
|
||||
QStandardItemModel *msgModel;
|
||||
QItemSelectionModel *msgSelect;
|
||||
};
|
||||
|
||||
#endif // MSGINPUTWIN_H
|
|
@ -0,0 +1,33 @@
|
|||
#ifndef POSTESTWIN_H
|
||||
#define POSTESTWIN_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QStandardItemModel>
|
||||
#include <QItemSelectionModel>
|
||||
|
||||
namespace Ui {
|
||||
class PosTestWin;
|
||||
}
|
||||
|
||||
class PosTestWin : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit PosTestWin(QWidget *parent = nullptr);
|
||||
~PosTestWin();
|
||||
|
||||
private slots:
|
||||
void on_btnRdTest_clicked();
|
||||
|
||||
void on_btnRnTest_clicked();
|
||||
|
||||
private:
|
||||
Ui::PosTestWin *ui;
|
||||
QStandardItemModel *rnModel;
|
||||
QItemSelectionModel *rnSelect;
|
||||
QStandardItemModel *rdModel;
|
||||
QItemSelectionModel *rdSelect;
|
||||
};
|
||||
|
||||
#endif // POSTESTWIN_H
|
|
@ -0,0 +1,25 @@
|
|||
#ifndef PRECISIONTESTWIN_H
|
||||
#define PRECISIONTESTWIN_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui {
|
||||
class PrecisionTestWin;
|
||||
}
|
||||
|
||||
class PrecisionTestWin : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit PrecisionTestWin(QWidget *parent = nullptr);
|
||||
~PrecisionTestWin();
|
||||
|
||||
private slots:
|
||||
void on_cmbFormat_currentIndexChanged(int index);
|
||||
|
||||
private:
|
||||
Ui::PrecisionTestWin *ui;
|
||||
};
|
||||
|
||||
#endif // PRECISIONTESTWIN_H
|
|
@ -0,0 +1,35 @@
|
|||
#ifndef SERIALPORT_H
|
||||
#define SERIALPORT_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QThread>
|
||||
#include <QtSerialPort/QSerialPort>
|
||||
|
||||
class SerialPort : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SerialPort(QObject *parent = nullptr);
|
||||
~SerialPort();
|
||||
|
||||
signals:
|
||||
void recvSerialDataSignal(const QByteArray &buf);
|
||||
|
||||
public slots:
|
||||
void writeData(const QString &cmd);
|
||||
void writeData(const QByteArray &buf);
|
||||
void readData();
|
||||
bool open();
|
||||
void close();
|
||||
void setSerialconfig(QString comName,int baud);
|
||||
void setSerialconfig(int baud);
|
||||
bool isOpen();
|
||||
int getBaud();
|
||||
|
||||
private:
|
||||
QSerialPort *serial;
|
||||
QThread *thread;
|
||||
int curBaud;
|
||||
};
|
||||
|
||||
#endif // SERIALPORT_H
|
|
@ -0,0 +1,42 @@
|
|||
#ifndef SQLITEDB_H
|
||||
#define SQLITEDB_H
|
||||
|
||||
#include <QtSql>
|
||||
#include <QThread>
|
||||
#include <QObject>
|
||||
|
||||
class SQLITEDB: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
SQLITEDB(QObject *parent = nullptr);
|
||||
~SQLITEDB();
|
||||
SQLITEDB(const SQLITEDB&);
|
||||
SQLITEDB& operator=(const SQLITEDB&);
|
||||
QSqlDatabase DB; //数据库
|
||||
QThread *thread;
|
||||
public:
|
||||
static SQLITEDB& getInstance()
|
||||
{
|
||||
static SQLITEDB instance;
|
||||
return instance;
|
||||
}
|
||||
void openDateBase();
|
||||
void closeDateBase();
|
||||
QSqlDatabase &getDateBase();
|
||||
bool tableExist(const QString &table);
|
||||
bool keyExist(const QString &table,const QString &key);
|
||||
bool createKey(const QString &table,const QString &key, const QString &type);
|
||||
bool createTable(const QString &sql);
|
||||
QStringList getPrimaryKeys(const QString &table);
|
||||
QStringList getTableFields(const QString &table);
|
||||
QStringList getTableNames();
|
||||
QVector<QMap<QString,QString>> getRecord(const QString &table,const QMap<QString,QString> &condition);
|
||||
bool saveRecord(const QString &table,const QMap<QString,QString> &map);
|
||||
|
||||
signals:
|
||||
void synchronismPercentSignal(int per);
|
||||
void displayLogSignal(const QString &txt,const QColor &color);
|
||||
};
|
||||
|
||||
#endif // SQLITEDB_H
|
|
@ -0,0 +1,26 @@
|
|||
#ifndef STATUSTESTWIN_H
|
||||
#define STATUSTESTWIN_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QStandardItemModel>
|
||||
#include <QItemSelectionModel>
|
||||
|
||||
namespace Ui {
|
||||
class StatusTestWin;
|
||||
}
|
||||
|
||||
class StatusTestWin : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit StatusTestWin(QWidget *parent = nullptr);
|
||||
~StatusTestWin();
|
||||
|
||||
private:
|
||||
Ui::StatusTestWin *ui;
|
||||
QStandardItemModel *statusModel;
|
||||
QItemSelectionModel *statusSelect;
|
||||
};
|
||||
|
||||
#endif // STATUSTESTWIN_H
|
|
@ -0,0 +1,32 @@
|
|||
#ifndef TITLEBAR_H
|
||||
#define TITLEBAR_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui {
|
||||
class TitleBar;
|
||||
}
|
||||
|
||||
class TitleBar : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit TitleBar(QWidget *parent = 0);
|
||||
~TitleBar();
|
||||
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent* event) override;
|
||||
void mouseDoubleClickEvent(QMouseEvent* event) override;
|
||||
|
||||
signals:
|
||||
void windowCloseSignal();
|
||||
|
||||
private slots:
|
||||
void btnClickHandle();
|
||||
|
||||
private:
|
||||
Ui::TitleBar *ui;
|
||||
};
|
||||
|
||||
#endif // TITLEBAR_H
|
|
@ -0,0 +1,8 @@
|
|||
#ifndef UTILS_H
|
||||
#define UTILS_H
|
||||
|
||||
void base64_encode(const unsigned char *str,int str_len,unsigned char *res,int *res_len);
|
||||
|
||||
void base64_decode(const unsigned char *code,int code_len,unsigned char *res,int *res_len);
|
||||
|
||||
#endif // UTILS_H
|
|
@ -0,0 +1,293 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>InterfaceTestWin</class>
|
||||
<widget class="QWidget" name="InterfaceTestWin">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>697</width>
|
||||
<height>385</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="2">
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QGroupBox{border:none;}</string>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3" rowstretch="1,0,0,1,2">
|
||||
<item row="2" column="1">
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<spacer name="verticalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="btnCanTest">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CAN口检测</string>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="3">
|
||||
<widget class="QTableView" name="tableViewCan">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QTableView
|
||||
{
|
||||
border-top:1px solid black;
|
||||
border-left:1px solid black;
|
||||
gridline-color:black;
|
||||
}</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="verticalSpacer_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<spacer name="horizontalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QGroupBox{border:none;}</string>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2" rowstretch="1,0,0,1,2">
|
||||
<item row="1" column="0">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="btnSerialTest">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>串口检测</string>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="3">
|
||||
<widget class="QTableView" name="tableViewSerial">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QTableView
|
||||
{
|
||||
border-top:1px solid black;
|
||||
border-left:1px solid black;
|
||||
gridline-color:black;
|
||||
}</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="verticalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<spacer name="horizontalSpacer_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -0,0 +1,200 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>LoginWin</class>
|
||||
<widget class="QWidget" name="LoginWin">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>350</width>
|
||||
<height>410</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>用户登录</string>
|
||||
</property>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>28</y>
|
||||
<width>330</width>
|
||||
<height>371</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QGroupBox{border:none}</string>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>50</y>
|
||||
<width>310</width>
|
||||
<height>47</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../../images.qrc">:/images/login_logo.png</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>150</y>
|
||||
<width>60</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Microsoft YaHei</family>
|
||||
<pointsize>11</pointsize>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>用户名:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QComboBox" name="cmbName">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>150</y>
|
||||
<width>190</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Microsoft YaHei</family>
|
||||
<pointsize>11</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>200</y>
|
||||
<width>60</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Microsoft YaHei</family>
|
||||
<pointsize>11</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>密码:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QCheckBox" name="ckbRemember">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>209</x>
|
||||
<y>250</y>
|
||||
<width>101</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Microsoft YaHei</family>
|
||||
<pointsize>11</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>记住账号</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="btnLogin">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>310</y>
|
||||
<width>281</width>
|
||||
<height>30</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Microsoft YaHei</family>
|
||||
<pointsize>12</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>登录</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="lePassword">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>200</y>
|
||||
<width>190</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>11</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="echoMode">
|
||||
<enum>QLineEdit::PasswordEchoOnEdit</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="TitleBar" name="titleBar" native="true">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>350</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>TitleBar</class>
|
||||
<extends>QWidget</extends>
|
||||
<header location="global">titlebar.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>cmbName</tabstop>
|
||||
<tabstop>lePassword</tabstop>
|
||||
<tabstop>ckbRemember</tabstop>
|
||||
<tabstop>btnLogin</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="../../images.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -0,0 +1,273 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>700</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QGroupBox{border:none;}</string>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>串口号:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="cmbCom"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>波特率:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="cmbBaud">
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>115200</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>230400</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>460800</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>921600</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="tbtnFresh">
|
||||
<property name="text">
|
||||
<string>刷新</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="tbtnConnect">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color:green</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>连接</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QTabBar::tab {
|
||||
padding: 5px;
|
||||
border:1px solid gray;
|
||||
border-top-left-radius:10px;
|
||||
border-top-right-radius:10px;
|
||||
border-bottom-left-radius:10px;
|
||||
border-bottom-right-radius:10px;
|
||||
min-width: 100px;
|
||||
background-color:#ffffff;
|
||||
}
|
||||
QTabBar::tab::hover {
|
||||
background-color:rgba(68,114,195,125);
|
||||
font-weight:bold;
|
||||
color:#ffffff;
|
||||
}
|
||||
QTabBar::tab:!first{
|
||||
margin-left:-1px;
|
||||
}
|
||||
QTabBar::tab:selected {
|
||||
/*border-bottom: 2px solid #2080F7;*/
|
||||
font-weight:bold;
|
||||
color:#ffffff;
|
||||
background-color:#4472c3;
|
||||
}
|
||||
QTabWidget::pane{
|
||||
background-color:transparent;
|
||||
border:none;
|
||||
}</string>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tabMsgInput">
|
||||
<attribute name="title">
|
||||
<string>信息录入</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="MsgInputWin" name="msgInputWdg" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tabInterfaceTest">
|
||||
<attribute name="title">
|
||||
<string>接口检测</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="InterfaceTestWin" name="interfaceTestWdg" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tabStatusTest">
|
||||
<attribute name="title">
|
||||
<string>状态检测</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0">
|
||||
<widget class="StatusTestWin" name="statusTestWdg" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tabPosTest">
|
||||
<attribute name="title">
|
||||
<string>定位检测</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<widget class="PosTestWin" name="posTestWdg" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tabPrecisionTest">
|
||||
<attribute name="title">
|
||||
<string>精度检测 </string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<item row="0" column="0">
|
||||
<widget class="PrecisionTestWin" name="precisionTestWdg" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tabDataManage">
|
||||
<attribute name="title">
|
||||
<string>数据管理</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>25</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menu">
|
||||
<property name="title">
|
||||
<string>用户</string>
|
||||
</property>
|
||||
</widget>
|
||||
<addaction name="menu"/>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar">
|
||||
<property name="sizeGripEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>MsgInputWin</class>
|
||||
<extends>QWidget</extends>
|
||||
<header location="global">msgInputWin.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>InterfaceTestWin</class>
|
||||
<extends>QWidget</extends>
|
||||
<header location="global">interfaceTestWin.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>StatusTestWin</class>
|
||||
<extends>QWidget</extends>
|
||||
<header location="global">statusTestWin.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>PosTestWin</class>
|
||||
<extends>QWidget</extends>
|
||||
<header location="global">posTestWin.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>PrecisionTestWin</class>
|
||||
<extends>QWidget</extends>
|
||||
<header location="global">precisionTestWin.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -0,0 +1,94 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MsgInputWin</class>
|
||||
<widget class="QWidget" name="MsgInputWin">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>622</width>
|
||||
<height>415</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout" rowstretch="1,2,1" columnstretch="1,4,1">
|
||||
<item row="1" column="1">
|
||||
<widget class="QTableView" name="tableView">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QTableView
|
||||
{
|
||||
border-top:1px solid black;
|
||||
border-left:1px solid black;
|
||||
gridline-color:black;
|
||||
}</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -0,0 +1,359 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>PosTestWin</class>
|
||||
<widget class="QWidget" name="PosTestWin">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>526</width>
|
||||
<height>606</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="gpbRnTest">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QGroupBox{border:none;}</string>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QTableView" name="tableViewRn">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QTableView
|
||||
{
|
||||
border-top:1px solid black;
|
||||
border-left:1px solid black;
|
||||
border-right:1px solid gray;
|
||||
gridline-color:black;
|
||||
}</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="midLineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="showGrid">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="gridStyle">
|
||||
<enum>Qt::SolidLine</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QGroupBox{border:none;}</string>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnRnAutoTest">
|
||||
<property name="text">
|
||||
<string>自动测试</string>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnSave">
|
||||
<property name="text">
|
||||
<string>保存</string>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnRdTest">
|
||||
<property name="text">
|
||||
<string>RDSS定位测试</string>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="gpbRnSignal">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QGroupBox{border:none;}</string>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QCustomPlot" name="widget" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>100</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="gpbRdTest">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QGroupBox{border:none;}</string>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,2">
|
||||
<item>
|
||||
<widget class="QWidget" name="widget_2" native="true"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QGroupBox{border:none;}</string>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="font">
|
||||
<font>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>RDSS定位测试</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTableView" name="tableViewRd">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QTableView
|
||||
{
|
||||
border-top:1px solid black;
|
||||
border-left:1px solid black;
|
||||
border-right:1px solid gray;
|
||||
gridline-color:black;
|
||||
}</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_3">
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnRdAutoTest">
|
||||
<property name="text">
|
||||
<string>自动测试</string>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnRnTest">
|
||||
<property name="text">
|
||||
<string>RNSS定位测试</string>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_7">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>QCustomPlot</class>
|
||||
<extends>QWidget</extends>
|
||||
<header location="global">qcustomplot.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -0,0 +1,397 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>PrecisionTestWin</class>
|
||||
<widget class="QWidget" name="PrecisionTestWin">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>867</width>
|
||||
<height>433</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Ignored" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,1">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QGroupBox{border:none;}</string>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="5">
|
||||
<widget class="Line" name="line_2">
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>参考点:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QGroupBox" name="groupBox_3">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QGroupBox{border:none;}</string>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QComboBox" name="cmbFormat">
|
||||
<property name="currentIndex">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>ddmm.mm(度分.分)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>dd.dd(度.度)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>dd°mm'ss.ss''(度分秒)</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="Line" name="line">
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="10">
|
||||
<widget class="QLineEdit" name="lineEdit_3"/>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>经度:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="6">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>纬度:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="7">
|
||||
<widget class="QGroupBox" name="groupBox_5">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QGroupBox{border:none;}</string>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="leLatDeg"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lbLatDeg">
|
||||
<property name="text">
|
||||
<string>°</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="leLatMinute"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lbLatMinute">
|
||||
<property name="text">
|
||||
<string>'</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="leLatSec"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lbLatSec">
|
||||
<property name="text">
|
||||
<string>''</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="9">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>高程:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<widget class="QGroupBox" name="groupBox_4">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QGroupBox{border:none;}</string>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="leLonDeg"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lbLonDeg">
|
||||
<property name="text">
|
||||
<string>°</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="leLonMinute"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lbLonMinute">
|
||||
<property name="text">
|
||||
<string>'</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="leLonSec"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lbLonSec">
|
||||
<property name="text">
|
||||
<string>''</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="8">
|
||||
<widget class="Line" name="line_3">
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_6">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QGroupBox{border:none;}</string>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>采样点数:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<widget class="QPushButton" name="btnStart">
|
||||
<property name="text">
|
||||
<string>开始</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="6">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QSpinBox" name="spbPoints">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>9999</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>100</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>定位模式:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="cmbPosMode">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>B1C</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>B1P</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>B3C</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>B3P</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>GPS</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>B1+B3C</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>B1+B3P</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="5">
|
||||
<widget class="QPushButton" name="btnEnd">
|
||||
<property name="text">
|
||||
<string>结束</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QGroupBox{border:none;}</string>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="0">
|
||||
<widget class="QCustomPlot" name="widget" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>QCustomPlot</class>
|
||||
<extends>QWidget</extends>
|
||||
<header location="global">qcustomplot.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -0,0 +1,92 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>StatusTestWin</class>
|
||||
<widget class="QWidget" name="StatusTestWin">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>564</width>
|
||||
<height>353</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout" rowstretch="1,10,1" columnstretch="1,9,1">
|
||||
<item row="1" column="1">
|
||||
<widget class="QTableView" name="tableView">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QTableView
|
||||
{
|
||||
border-top:1px solid black;
|
||||
border-left:1px solid black;
|
||||
border-right:1px solid gray;
|
||||
gridline-color:black;
|
||||
}</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -0,0 +1,230 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>TitleBar</class>
|
||||
<widget class="QWidget" name="TitleBar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>736</width>
|
||||
<height>32</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>15</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lbLogo">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>10</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lbTitle">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Microsoft YaHei</family>
|
||||
<pointsize>11</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnMin">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnMax">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnClose">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|