diff --git a/PayloadAPP.pro b/PayloadAPP.pro index 9bb6758..d6d0f61 100644 --- a/PayloadAPP.pro +++ b/PayloadAPP.pro @@ -14,6 +14,18 @@ QMAKE_PROJECT_DEPTH = 0 SOURCES += \ +<<<<<<< HEAD +# Src/GDDC/gddcCmdDlg.cpp \ +# Src/GDDC/gddcSet.cpp \ +# Src/GDDC/gddcStateInfo.cpp \ +# Src/HomePage/homepagesetingwidget.cpp \ +# cffmpeg_decode.cpp \ +# customwebenginepage.cpp \ +# cwebengineview.cpp \ +# encodemodelcamera.cpp \ +# ffmpegvideodlg.cpp \ +# Src/GDDC/gddcdlg.cpp \ +======= SDFPDlg.cpp \ Src/GDDC/gddcCmdDlg.cpp \ Src/GDDC/gddcSet.cpp \ @@ -24,15 +36,31 @@ SOURCES += \ cwebengineview.cpp \ ffmpegvideodlg.cpp \ Src/GDDC/gddcdlg.cpp \ +>>>>>>> 9cb45d43939c192a61d4fe2800b69ee9f4dd63d9 global.cpp \ - Src/HomePage/homepagedlg.cpp \ +# Src/HomePage/homepagedlg.cpp \ main.cpp \ mainwindow.cpp \ - qweb.cpp \ - rescueload.cpp \ - rescueloadwidget.cpp +# modelcameradlg.cpp \ +# qweb.cpp \ +# rescueload.cpp \ +# rescueloadwidget.cpp HEADERS += \ +<<<<<<< HEAD +# DCFrameCkCmd.h \ +# Src/GDDC/gddcCmdDlg.h \ +# Src/GDDC/gddcSet.h \ +# Src/GDDC/gddcStateInfo.h \ +# Src/GDDC/structDefineMyslef.h \ +# Src/HomePage/homepagesetingwidget.h \ +# cffmpeg_decode.h \ +# customwebenginepage.h \ +# cwebengineview.h \ +# encodemodelcamera.h \ +# ffmpegvideodlg.h \ +# Src/GDDC/gddcdlg.h \ +======= DCFrameCkCmd.h \ SDFPDlg.h \ Src/GDDC/gddcCmdDlg.h \ @@ -45,14 +73,25 @@ HEADERS += \ cwebengineview.h \ ffmpegvideodlg.h \ Src/GDDC/gddcdlg.h \ +>>>>>>> 9cb45d43939c192a61d4fe2800b69ee9f4dd63d9 global.h \ - Src/HomePage/homepagedlg.h \ +# Src/HomePage/homepagedlg.h \ mainwindow.h \ - qweb.h \ - rescueload.h \ - rescueloadwidget.h +# modelcameradlg.h \ +# qweb.h \ +# rescueload.h \ +# rescueloadwidget.h FORMS += \ +<<<<<<< HEAD +# Src/GDDC/gddcCmdDlg.ui \ +# Src/GDDC/gddcSet.ui \ +# Src/GDDC/gddcStateInfo.ui \ +# Src/HomePage/homepagesetingwidget.ui \ +# ffmpegvideodlg.ui \ +# Src/GDDC/gddcdlg.ui \ +# Src/HomePage/homepagedlg.ui \ +======= SDFPDlg.ui \ Src/GDDC/gddcCmdDlg.ui \ Src/GDDC/gddcSet.ui \ @@ -61,9 +100,11 @@ FORMS += \ ffmpegvideodlg.ui \ Src/GDDC/gddcdlg.ui \ Src/HomePage/homepagedlg.ui \ +>>>>>>> 9cb45d43939c192a61d4fe2800b69ee9f4dd63d9 mainwindow.ui \ - qweb.ui \ - rescueloadwidget.ui +# modelcameradlg.ui \ +# qweb.ui \ +# rescueloadwidget.ui TRANSLATIONS += \ PayloadAPP_zh_CN.ts @@ -77,17 +118,23 @@ else: unix:!android: target.path = /opt/$${TARGET}/bin RESOURCES += \ mainwindow.qrc \ - map/places_map.qrc +# map/places_map.qrc DISTFILES += \ config.ini \ res/Qss/qss.qss \ style.qss -INCLUDEPATH += $$PWD/ffmpeg//include +INCLUDEPATH += $$PWD/ffmpeg/include \ + $$PWD/Src/Video/ LIBS += -L$$PWD/ffmpeg/lib \ -lavcodec -lavdevice -lavfilter -lavformat -lavutil -lpostproc \ -lswresample -lswscale - +include($$PWD/Src/HomePage/HomePage.pri) +include($$PWD/Src/WebPage/WebPage.pri) +include($$PWD/Src/ModelCamera/ModelCamera.pri) +include($$PWD/Src/RescueLoad/RescueLoad.pri) +include($$PWD/Src/GDDC/GDDC.pri) +include($$PWD/Src/Video/Video.pri) diff --git a/PayloadAPP.pro.autosave b/PayloadAPP.pro.autosave new file mode 100644 index 0000000..e083b2c --- /dev/null +++ b/PayloadAPP.pro.autosave @@ -0,0 +1,104 @@ +QT += core gui webenginewidgets +QT += network +QT += quickwidgets qml +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +CONFIG += c++17 +# CONFIG += console +QMAKE_PROJECT_DEPTH = 0 +# You can make your code fail to compile if it uses deprecated APIs. +# In order to do so, uncomment the following line. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + + + + +SOURCES += \ +# Src/GDDC/gddcCmdDlg.cpp \ +# Src/GDDC/gddcSet.cpp \ +# Src/GDDC/gddcStateInfo.cpp \ +# Src/HomePage/homepagesetingwidget.cpp \ +# cffmpeg_decode.cpp \ +# customwebenginepage.cpp \ +# cwebengineview.cpp \ +# encodemodelcamera.cpp \ +# ffmpegvideodlg.cpp \ +# Src/GDDC/gddcdlg.cpp \ + SDFPDlg.cpp \ + global.cpp \ +# Src/HomePage/homepagedlg.cpp \ + main.cpp \ + mainwindow.cpp \ +# modelcameradlg.cpp \ +# qweb.cpp \ +# rescueload.cpp \ +# rescueloadwidget.cpp + +HEADERS += \ +# DCFrameCkCmd.h \ +# Src/GDDC/gddcCmdDlg.h \ +# Src/GDDC/gddcSet.h \ +# Src/GDDC/gddcStateInfo.h \ +# Src/GDDC/structDefineMyslef.h \ +# Src/HomePage/homepagesetingwidget.h \ +# cffmpeg_decode.h \ +# customwebenginepage.h \ +# cwebengineview.h \ +# encodemodelcamera.h \ +# ffmpegvideodlg.h \ +# Src/GDDC/gddcdlg.h \ + SDFPDlg.h \ + global.h \ +# Src/HomePage/homepagedlg.h \ + mainwindow.h \ +# modelcameradlg.h \ +# qweb.h \ +# rescueload.h \ +# rescueloadwidget.h + +FORMS += \ +# Src/GDDC/gddcCmdDlg.ui \ +# Src/GDDC/gddcSet.ui \ +# Src/GDDC/gddcStateInfo.ui \ +# Src/HomePage/homepagesetingwidget.ui \ +# ffmpegvideodlg.ui \ +# Src/GDDC/gddcdlg.ui \ +# Src/HomePage/homepagedlg.ui \ + SDFPDlg.ui \ + mainwindow.ui \ +# modelcameradlg.ui \ +# qweb.ui \ +# rescueloadwidget.ui + +TRANSLATIONS += \ + PayloadAPP_zh_CN.ts +CONFIG += lrelease +CONFIG += embed_translations + +# Default rules for deployment. +qnx: target.path = /tmp/$${TARGET}/bin +else: unix:!android: target.path = /opt/$${TARGET}/bin +!isEmpty(target.path): INSTALLS += target + +RESOURCES += \ + mainwindow.qrc \ +# map/places_map.qrc + +DISTFILES += \ + config.ini \ + res/Qss/qss.qss \ + style.qss + +INCLUDEPATH += $$PWD/ffmpeg/include \ + $$PWD/Src/Video/ + +LIBS += -L$$PWD/ffmpeg/lib \ + -lavcodec -lavdevice -lavfilter -lavformat -lavutil -lpostproc \ + -lswresample -lswscale + +include($$PWD/Src/HomePage/HomePage.pri) +include($$PWD/Src/WebPage/WebPage.pri) +include($$PWD/Src/ModelCamera/ModelCamera.pri) +include($$PWD/Src/RescueLoad/RescueLoad.pri) +include($$PWD/Src/GDDC/GDDC.pri) +include($$PWD/Src/Video/Video.pri) diff --git a/DCFrameCkCmd.h b/Src/GDDC/DCFrameCkCmd.h similarity index 100% rename from DCFrameCkCmd.h rename to Src/GDDC/DCFrameCkCmd.h diff --git a/Src/GDDC/GDDC.pri b/Src/GDDC/GDDC.pri new file mode 100644 index 0000000..e1f1fa2 --- /dev/null +++ b/Src/GDDC/GDDC.pri @@ -0,0 +1,20 @@ +SOURCES += \ + $$PWD/gddcCmdDlg.cpp \ + $$PWD/gddcdlg.cpp \ + $$PWD/gddcSet.cpp \ + $$PWD/gddcStateInfo.cpp \ + +HEADERS += \ + $$PWD/gddcCmdDlg.h \ + $$PWD/gddcdlg.h \ + $$PWD/gddcSet.h \ + $$PWD/gddcStateInfo.h \ + $$PWD/structDefineMyslef.h \ + $$PWD/DCFrameCkCmd.h \ + +FORMS += \ + $$PWD/gddcCmdDlg.ui \ + $$PWD/gddcdlg.ui \ + $$PWD/gddcSet.ui \ + $$PWD/gddcStateInfo.ui \ + diff --git a/Src/GDDC/gddcdlg.h b/Src/GDDC/gddcdlg.h index 898c329..27131c6 100644 --- a/Src/GDDC/gddcdlg.h +++ b/Src/GDDC/gddcdlg.h @@ -11,7 +11,7 @@ #include #include #include -#include "cffmpeg_decode.h" +#include "Src/Video/cffmpeg_decode.h" #include "Src/GDDC/gddcSet.h" #include #include diff --git a/Src/HomePage/HomePage.pri b/Src/HomePage/HomePage.pri new file mode 100644 index 0000000..dc16701 --- /dev/null +++ b/Src/HomePage/HomePage.pri @@ -0,0 +1,11 @@ +SOURCES += \ + $$PWD/homepagesetingwidget.cpp \ + $$PWD/homepagedlg.cpp + +HEADERS += \ + $$PWD/homepagesetingwidget.h \ + $$PWD/homepagedlg.h + +FORMS += \ + $$PWD/homepagesetingwidget.ui \ + $$PWD/homepagedlg.ui \ diff --git a/Src/ModelCamera/ModelCamera.pri b/Src/ModelCamera/ModelCamera.pri new file mode 100644 index 0000000..c9c762d --- /dev/null +++ b/Src/ModelCamera/ModelCamera.pri @@ -0,0 +1,11 @@ +SOURCES += \ + $$PWD/encodemodelcamera.cpp \ + $$PWD/modelcameradlg.cpp \ + +HEADERS += \ + $$PWD/encodemodelcamera.h \ + $$PWD/modelcameradlg.h \ + +FORMS += \ + $$PWD/modelcameradlg.ui \ + diff --git a/Src/ModelCamera/encodemodelcamera.cpp b/Src/ModelCamera/encodemodelcamera.cpp new file mode 100644 index 0000000..bb8d8a6 --- /dev/null +++ b/Src/ModelCamera/encodemodelcamera.cpp @@ -0,0 +1,34 @@ +#include "encodemodelcamera.h" + +EncodeModelCamera::EncodeModelCamera(QObject *parent) + : QObject{parent} +{ + cameraUDP = new QUdpSocket(this); + //cameraUDP->bind(QHostAddress("198.18.0.1"),8080); + + cmdArray.insert(0,0xFA); + cmdArray.insert(1,0xFA); +} + +/** + * @brief 发送三维建模相机指令 + * @param cmdDataArray 指令ID与负载数据 + */ +void EncodeModelCamera::SendCMD(QByteArray cmdDataArray) +{ + cmdArray.clear(); + cmdArray.insert(0,0xFA); + cmdArray.insert(1,0xFA); + + cmdArray.append(cmdDataArray); + uint8_t* data = reinterpret_cast(cmdArray.data()); + uint16_t crc16 = calCRC16(data,cmdArray.size()); + + QByteArray byteArray; + QDataStream stream(&byteArray, QIODevice::WriteOnly); + stream.setByteOrder(QDataStream::BigEndian); + stream << crc16; + cmdArray.append(byteArray); + + cameraUDP->writeDatagram(cmdArray,QHostAddress("127.0.0.1"),8080); +} diff --git a/Src/ModelCamera/encodemodelcamera.h b/Src/ModelCamera/encodemodelcamera.h new file mode 100644 index 0000000..55f2a26 --- /dev/null +++ b/Src/ModelCamera/encodemodelcamera.h @@ -0,0 +1,24 @@ +#ifndef ENCODEMODELCAMERA_H +#define ENCODEMODELCAMERA_H + +#include +#include +#include +#include +#include "global.h" + +class EncodeModelCamera : public QObject +{ + Q_OBJECT +public: + explicit EncodeModelCamera(QObject *parent = nullptr); +private: + QByteArray cmdArray; + QUdpSocket* cameraUDP; +public slots: + void SendCMD(QByteArray cmdDataArray); + +signals: +}; + +#endif // ENCODEMODELCAMERA_H diff --git a/Src/ModelCamera/modelcameradlg.cpp b/Src/ModelCamera/modelcameradlg.cpp new file mode 100644 index 0000000..3836926 --- /dev/null +++ b/Src/ModelCamera/modelcameradlg.cpp @@ -0,0 +1,250 @@ +#include "modelcameradlg.h" +#include "ui_modelcameradlg.h" + +ModelCameraDlg::ModelCameraDlg(QWidget *parent) + : QDialog(parent) + , ui(new Ui::ModelCameraDlg) +{ + ui->setupUi(this); + + InitialComboBox(); + + cameraCMDThread = new QThread(this); + encodeModelCamera = new EncodeModelCamera(this); + encodeModelCamera->moveToThread(cameraCMDThread); + cameraCMDThread->start(); + connect(this,&ModelCameraDlg::on_sendCmdData_signal,encodeModelCamera,&EncodeModelCamera::SendCMD); +} + +ModelCameraDlg::~ModelCameraDlg() +{ + delete ui; + if(encodeModelCamera!=nullptr) delete encodeModelCamera; + if(cameraCMDThread!=nullptr) + { + cameraCMDThread->quit(); + cameraCMDThread->wait(); + } +} + +void ModelCameraDlg::InitialComboBox() +{ + ui->photoTimeDbSpinBox->setSuffix("s"); + + //快门速度 + ui->SSComboBox->insertItem(0,"1/100"); + ui->SSComboBox->insertItem(1,"1/125"); + ui->SSComboBox->insertItem(2,"1/160"); + ui->SSComboBox->insertItem(3,"1/200"); + ui->SSComboBox->insertItem(4,"1/250"); + ui->SSComboBox->insertItem(5,"1/320"); + ui->SSComboBox->insertItem(6,"1/400"); + ui->SSComboBox->insertItem(7,"1/500"); + ui->SSComboBox->insertItem(8,"1/640"); + ui->SSComboBox->insertItem(9,"1/800"); + ui->SSComboBox->insertItem(10,"1/1000"); + ui->SSComboBox->insertItem(11,"1/1250"); + ui->SSComboBox->insertItem(12,"1/1600"); + ui->SSComboBox->insertItem(13,"1/2000"); + + //ISO + ui->ISOComboBox->insertItem(0,"50~800"); + ui->ISOComboBox->insertItem(1,"50~1600"); + ui->ISOComboBox->insertItem(2,"50"); + ui->ISOComboBox->insertItem(3,"100"); + ui->ISOComboBox->insertItem(4,"125"); + ui->ISOComboBox->insertItem(5,"160"); + ui->ISOComboBox->insertItem(6,"200"); + ui->ISOComboBox->insertItem(7,"250"); + ui->ISOComboBox->insertItem(8,"320"); + ui->ISOComboBox->insertItem(9,"400"); + ui->ISOComboBox->insertItem(10,"500"); + ui->ISOComboBox->insertItem(11,"640"); + ui->ISOComboBox->insertItem(12,"800"); + ui->ISOComboBox->insertItem(13,"1000"); + ui->ISOComboBox->insertItem(14,"1250"); + ui->ISOComboBox->insertItem(15,"1600"); + + //AWB + ui->AWBComboBox->insertItem(0,"自动"); + ui->AWBComboBox->insertItem(1,"日光"); + + //相机模式 + ui->cameraModelComboBox->insertItem(0,"拍照模式"); + ui->cameraModelComboBox->insertItem(1,"录像模式"); + + //色彩模式 + ui->ColorModelComboBox->insertItem(0,"艳丽"); + ui->ColorModelComboBox->insertItem(1,"标准"); +} + +//开始拍照点击事件 +void ModelCameraDlg::on_startPhotoBtn_clicked() +{ + quint8 photoTime = ui->photoTimeDbSpinBox->value() * 10; + + cmdDataArray.clear(); + cmdDataArray.insert(0,0x02); + cmdDataArray.insert(1,0xA1); + cmdDataArray.insert(2,0x03); + cmdDataArray.insert(3,0x01); + cmdDataArray.insert(4,photoTime); + emit on_sendCmdData_signal(cmdDataArray); +} + +//停止拍照 +void ModelCameraDlg::on_stopPhotoBtn_clicked() +{ + cmdDataArray.clear(); + cmdDataArray.insert(0,0x01); + cmdDataArray.insert(1,0xA1); + cmdDataArray.insert(2,0x03); + cmdDataArray.insert(3,QByteArray(1, char(0x00))); + emit on_sendCmdData_signal(cmdDataArray); +} + +//开机 +void ModelCameraDlg::on_ONBtn_clicked() +{ + cmdDataArray.clear(); + cmdDataArray.insert(0,0x01); + cmdDataArray.insert(1,0xA1); + cmdDataArray.insert(2,0x01); + cmdDataArray.insert(3,0x01); + emit on_sendCmdData_signal(cmdDataArray); +} + +//关机 +void ModelCameraDlg::on_OFFBtn_clicked() +{ + cmdDataArray.clear(); + cmdDataArray.insert(0,0x01); + cmdDataArray.insert(1,0xA1); + cmdDataArray.insert(2,0x01); + cmdDataArray.insert(3,QByteArray(1, char(0x00))); + emit on_sendCmdData_signal(cmdDataArray); +} + +//播放视频 +void ModelCameraDlg::on_pushButton_5_clicked() +{ + QString str = ui->pushButton_5->text(); + if(str == "播放视频") + { + QString ip = ui->videoIPLineEdit->text(); + ui->cameraVideoWidget->play(); + ui->cameraVideoWidget->setUrl(ip); + ui->pushButton_5->setText("暂停播放"); + } + else + { + ui->cameraVideoWidget->stop(); + ui->pushButton_5->setText("播放视频"); + } +} + +//快门速度 +void ModelCameraDlg::on_SSComboBox_activated(int index) +{ + QString tmp = ui->SSComboBox->itemText(index); + QString strSS = tmp.right(tmp.length()-2); + qint16 hexValue = strSS.toShort();// + + cmdDataArray.clear(); + cmdDataArray.insert(0,0x04); + cmdDataArray.insert(1,0xA2); + cmdDataArray.insert(2,0x01); + cmdDataArray.insert(3,0x01); + + QByteArray byteArray; + byteArray.resize(2); + qToBigEndian(hexValue, (char*)byteArray.data()); + + cmdDataArray.append(byteArray); + cmdDataArray.insert(6,0xFF); + emit on_sendCmdData_signal(cmdDataArray); +} + +//ISO +void ModelCameraDlg::on_ISOComboBox_activated(int index) +{ + QString strSS = ui->ISOComboBox->itemText(index); + if(index == 0) strSS = "-2"; + else if(index == 1) strSS = "-1"; + qint16 hexValue = strSS.toShort();// + + cmdDataArray.clear(); + cmdDataArray.insert(0,0x04); + cmdDataArray.insert(1,0xA2); + cmdDataArray.insert(2,0x02); + cmdDataArray.insert(3,0x01); + + QByteArray byteArray; + byteArray.resize(2); + qToBigEndian(hexValue, (char*)byteArray.data()); + + cmdDataArray.append(byteArray); + cmdDataArray.insert(6,0xFF); + + emit on_sendCmdData_signal(cmdDataArray); +} + +//AWB +void ModelCameraDlg::on_AWBComboBox_activated(int index) +{ + quint16 hexValue = index + 1;// + + cmdDataArray.clear(); + cmdDataArray.insert(0,0x04); + cmdDataArray.insert(1,0xA2); + cmdDataArray.insert(2,0x06); + cmdDataArray.insert(3,0x01); + + QByteArray byteArray; + byteArray.resize(2); + qToBigEndian(hexValue, (uchar*)byteArray.data()); + + cmdDataArray.append(byteArray); + cmdDataArray.insert(6,0xFF); + + emit on_sendCmdData_signal(cmdDataArray); +} + +//相机模式 +void ModelCameraDlg::on_cameraModelComboBox_activated(int index) +{ + quint16 hexValue = index + 1;// + + cmdDataArray.clear(); + cmdDataArray.insert(0,0x01); + cmdDataArray.insert(1,0xA1); + cmdDataArray.insert(2,0x02); + if(index == 0) + cmdDataArray.insert(3,QByteArray(1, char(0x00))); + else if(index == 1) + cmdDataArray.insert(3,0x01); + + emit on_sendCmdData_signal(cmdDataArray); +} + +//色彩模式 +void ModelCameraDlg::on_ColorModelComboBox_activated(int index) +{ + quint16 hexValue = index + 1;// + + cmdDataArray.clear(); + cmdDataArray.insert(0,0x04); + cmdDataArray.insert(1,0xA2); + cmdDataArray.insert(2,0x08); + cmdDataArray.insert(3,0x01); + + QByteArray byteArray; + byteArray.resize(2); + qToBigEndian(hexValue, (uchar*)byteArray.data()); + + cmdDataArray.append(byteArray); + cmdDataArray.insert(6,0xFF); + + emit on_sendCmdData_signal(cmdDataArray); +} + diff --git a/Src/ModelCamera/modelcameradlg.h b/Src/ModelCamera/modelcameradlg.h new file mode 100644 index 0000000..e836cc8 --- /dev/null +++ b/Src/ModelCamera/modelcameradlg.h @@ -0,0 +1,53 @@ +#ifndef MODELCAMERADLG_H +#define MODELCAMERADLG_H + +#include +#include +#include +#include "encodemodelcamera.h" +#include + +namespace Ui { +class ModelCameraDlg; +} + +class ModelCameraDlg : public QDialog +{ + Q_OBJECT + +public: + explicit ModelCameraDlg(QWidget *parent = nullptr); + ~ModelCameraDlg(); +signals: + void on_sendCmdData_signal(QByteArray cmdDataArray); +private slots: + void on_startPhotoBtn_clicked(); + + void on_stopPhotoBtn_clicked(); + + void on_ONBtn_clicked(); + + void on_OFFBtn_clicked(); + + void on_pushButton_5_clicked(); + + void on_SSComboBox_activated(int index); + + void on_ISOComboBox_activated(int index); + + void on_AWBComboBox_activated(int index); + + void on_cameraModelComboBox_activated(int index); + + void on_ColorModelComboBox_activated(int index); + +private: + void InitialComboBox(); +private: + Ui::ModelCameraDlg *ui; + QThread* cameraCMDThread; + QByteArray cmdDataArray; + EncodeModelCamera* encodeModelCamera; +}; + +#endif // MODELCAMERADLG_H diff --git a/Src/ModelCamera/modelcameradlg.ui b/Src/ModelCamera/modelcameradlg.ui new file mode 100644 index 0000000..6214646 --- /dev/null +++ b/Src/ModelCamera/modelcameradlg.ui @@ -0,0 +1,643 @@ + + + ModelCameraDlg + + + + 0 + 0 + 907 + 917 + + + + Dialog + + + + 2 + + + 4 + + + 4 + + + 4 + + + 2 + + + + + QFrame::Shape::StyledPanel + + + QFrame::Shadow::Raised + + + + 2 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 600 + 400 + + + + + + + + + + + QFrame::Shape::StyledPanel + + + QFrame::Shadow::Raised + + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + + + 拍照指令 + + + Qt::AlignmentFlag::AlignCenter + + + false + + + + 4 + + + 4 + + + 4 + + + 4 + + + 4 + + + + + 4 + + + 11 + + + 12 + + + + + + 0 + 0 + + + + + 10 + + + + 拍照间隔: + + + + + + + + 0 + 0 + + + + QAbstractSpinBox::ButtonSymbols::NoButtons + + + 1 + + + 0.800000000000000 + + + QAbstractSpinBox::StepType::DefaultStepType + + + + + + + + 0 + 0 + + + + 开始拍照 + + + + + + + + 0 + 0 + + + + 停止拍照 + + + + + + + + 0 + 0 + + + + 开机 + + + + + + + + 0 + 0 + + + + 关机 + + + + + + + + + 9 + + + + + + 10 + + + + 拉流地址: + + + + + + + + + + 播放视频 + + + + + + + + + + + + 设置相机参数 + + + Qt::AlignmentFlag::AlignCenter + + + + 4 + + + 4 + + + 4 + + + 4 + + + 4 + + + + + 8 + + + 16 + + + 4 + + + + + + 10 + + + + 快门速度: + + + + + + + + + + + 10 + + + + ISO: + + + + + + + + + + + 10 + + + + AWB模式: + + + + + + + + + + + 10 + + + + 相机模式: + + + + + + + + + + + 10 + + + + 色彩模式: + + + + + + + + + + + + + + + 相机状态 + + + Qt::AlignmentFlag::AlignCenter + + + + 4 + + + 4 + + + 4 + + + 4 + + + 4 + + + + + QLayout::SizeConstraint::SetDefaultConstraint + + + 4 + + + 8 + + + 4 + + + + + + 10 + + + + 开关机状态: + + + 2 + + + + + + + + + + + 10 + + + + 温度: + + + + + + + + + + + 10 + + + + 图传状态: + + + + + + + + + + + 10 + + + + 相片总数: + + + + + + + + + + + 10 + + + + 快门速度: + + + + + + + + + + + 10 + + + + A照片数: + + + + + + + + + + + 10 + + + + ISO范围值: + + + + + + + + + + + 10 + + + + D照片数: + + + + + + + + + + + 10 + + + + AWB: + + + + + + + + + + + 10 + + + + S照片数: + + + + + + + + + + + 10 + + + + 相机模式: + + + + + + + + + + + 10 + + + + W照片数: + + + + + + + + + + + 10 + + + + 色彩模式: + + + + + + + + + + + 10 + + + + X照片数: + + + + + + + + + + + + + + + + + + + ffmpegvideoDlg + QWidget +
ffmpegvideodlg.h
+ 1 +
+
+ + +
diff --git a/Src/RescueLoad/RescueLoad.pri b/Src/RescueLoad/RescueLoad.pri new file mode 100644 index 0000000..edef6ae --- /dev/null +++ b/Src/RescueLoad/RescueLoad.pri @@ -0,0 +1,13 @@ +SOURCES += \ + $$PWD/rescueload.cpp \ + $$PWD/rescueloadwidget.cpp \ + +HEADERS += \ + $$PWD/rescueload.h \ + $$PWD/rescueloadwidget.h \ + +FORMS += \ + $$PWD/rescueloadwidget.ui \ + +RESOURCES += \ + $$PWD/map/places_map.qrc diff --git a/map/marker.png b/Src/RescueLoad/map/marker.png similarity index 100% rename from map/marker.png rename to Src/RescueLoad/map/marker.png diff --git a/map/places_map.qml b/Src/RescueLoad/map/places_map.qml similarity index 100% rename from map/places_map.qml rename to Src/RescueLoad/map/places_map.qml diff --git a/map/places_map.qrc b/Src/RescueLoad/map/places_map.qrc similarity index 100% rename from map/places_map.qrc rename to Src/RescueLoad/map/places_map.qrc diff --git a/map/selectlocation.png b/Src/RescueLoad/map/selectlocation.png similarity index 100% rename from map/selectlocation.png rename to Src/RescueLoad/map/selectlocation.png diff --git a/rescueload.cpp b/Src/RescueLoad/rescueload.cpp similarity index 100% rename from rescueload.cpp rename to Src/RescueLoad/rescueload.cpp diff --git a/rescueload.h b/Src/RescueLoad/rescueload.h similarity index 100% rename from rescueload.h rename to Src/RescueLoad/rescueload.h diff --git a/rescueloadwidget.cpp b/Src/RescueLoad/rescueloadwidget.cpp similarity index 100% rename from rescueloadwidget.cpp rename to Src/RescueLoad/rescueloadwidget.cpp diff --git a/rescueloadwidget.h b/Src/RescueLoad/rescueloadwidget.h similarity index 100% rename from rescueloadwidget.h rename to Src/RescueLoad/rescueloadwidget.h diff --git a/rescueloadwidget.ui b/Src/RescueLoad/rescueloadwidget.ui similarity index 96% rename from rescueloadwidget.ui rename to Src/RescueLoad/rescueloadwidget.ui index ad46a28..cace7d6 100644 --- a/rescueloadwidget.ui +++ b/Src/RescueLoad/rescueloadwidget.ui @@ -7,7 +7,7 @@ 0 0 1106 - 684 + 689 @@ -299,7 +299,7 @@ background-color:transparent; - Qt::Horizontal + Qt::Orientation::Horizontal @@ -315,7 +315,7 @@ background-color:transparent; 载荷IP: - Qt::AlignCenter + Qt::AlignmentFlag::AlignCenter false @@ -341,7 +341,7 @@ background-color:transparent; 端口: - Qt::AlignCenter + Qt::AlignmentFlag::AlignCenter false @@ -383,7 +383,7 @@ background-color:transparent; - Qt::Horizontal + Qt::Orientation::Horizontal @@ -400,7 +400,7 @@ background-color:transparent; - Qt::Horizontal + Qt::Orientation::Horizontal @@ -441,7 +441,7 @@ background-color:transparent; - Qt::Horizontal + Qt::Orientation::Horizontal @@ -467,7 +467,7 @@ background-color:transparent; - Qt::Horizontal + Qt::Orientation::Horizontal @@ -480,7 +480,7 @@ background-color:transparent; - Qt::Horizontal + Qt::Orientation::Horizontal @@ -512,7 +512,7 @@ background-color:transparent; - Qt::Horizontal + Qt::Orientation::Horizontal @@ -538,7 +538,7 @@ background-color:transparent; - Qt::Horizontal + Qt::Orientation::Horizontal @@ -582,7 +582,7 @@ background-color:transparent; - Qt::Vertical + Qt::Orientation::Vertical @@ -603,11 +603,11 @@ background-color:transparent; 名单配置模式 - Qt::AlignCenter + Qt::AlignmentFlag::AlignCenter - + @@ -635,7 +635,7 @@ background-color:transparent; - Qt::Vertical + Qt::Orientation::Vertical @@ -684,7 +684,7 @@ background-color:transparent; - Qt::Vertical + Qt::Orientation::Vertical diff --git a/Src/Video/Video.pri b/Src/Video/Video.pri new file mode 100644 index 0000000..30b4e0b --- /dev/null +++ b/Src/Video/Video.pri @@ -0,0 +1,10 @@ +SOURCES += \ + $$PWD/cffmpeg_decode.cpp \ + $$PWD/ffmpegvideodlg.cpp \ + +HEADERS += \ + $$PWD/cffmpeg_decode.h \ + $$PWD/ffmpegvideodlg.h \ + +FORMS += \ + $$PWD/ffmpegvideodlg.ui \ diff --git a/cffmpeg_decode.cpp b/Src/Video/cffmpeg_decode.cpp similarity index 100% rename from cffmpeg_decode.cpp rename to Src/Video/cffmpeg_decode.cpp diff --git a/cffmpeg_decode.h b/Src/Video/cffmpeg_decode.h similarity index 100% rename from cffmpeg_decode.h rename to Src/Video/cffmpeg_decode.h diff --git a/ffmpegvideodlg.cpp b/Src/Video/ffmpegvideodlg.cpp similarity index 100% rename from ffmpegvideodlg.cpp rename to Src/Video/ffmpegvideodlg.cpp diff --git a/ffmpegvideodlg.h b/Src/Video/ffmpegvideodlg.h similarity index 100% rename from ffmpegvideodlg.h rename to Src/Video/ffmpegvideodlg.h diff --git a/ffmpegvideodlg.ui b/Src/Video/ffmpegvideodlg.ui similarity index 93% rename from ffmpegvideodlg.ui rename to Src/Video/ffmpegvideodlg.ui index 89b3f3c..51bb678 100644 --- a/ffmpegvideodlg.ui +++ b/Src/Video/ffmpegvideodlg.ui @@ -23,7 +23,7 @@ Form - Qt::LeftToRight + Qt::LayoutDirection::LeftToRight diff --git a/Src/WebPage/WebPage.pri b/Src/WebPage/WebPage.pri new file mode 100644 index 0000000..e663552 --- /dev/null +++ b/Src/WebPage/WebPage.pri @@ -0,0 +1,12 @@ +SOURCES += \ + $$PWD/customwebenginepage.cpp \ + $$PWD/cwebengineview.cpp \ + $$PWD/qweb.cpp + +HEADERS += \ + $$PWD/customwebenginepage.h \ + $$PWD/cwebengineview.h \ + $$PWD/qweb.h + +FORMS += \ + $$PWD/qweb.ui \ diff --git a/customwebenginepage.cpp b/Src/WebPage/customwebenginepage.cpp similarity index 100% rename from customwebenginepage.cpp rename to Src/WebPage/customwebenginepage.cpp diff --git a/customwebenginepage.h b/Src/WebPage/customwebenginepage.h similarity index 100% rename from customwebenginepage.h rename to Src/WebPage/customwebenginepage.h diff --git a/cwebengineview.cpp b/Src/WebPage/cwebengineview.cpp similarity index 100% rename from cwebengineview.cpp rename to Src/WebPage/cwebengineview.cpp diff --git a/cwebengineview.h b/Src/WebPage/cwebengineview.h similarity index 100% rename from cwebengineview.h rename to Src/WebPage/cwebengineview.h diff --git a/qweb.cpp b/Src/WebPage/qweb.cpp similarity index 100% rename from qweb.cpp rename to Src/WebPage/qweb.cpp diff --git a/qweb.h b/Src/WebPage/qweb.h similarity index 100% rename from qweb.h rename to Src/WebPage/qweb.h diff --git a/qweb.ui b/Src/WebPage/qweb.ui similarity index 100% rename from qweb.ui rename to Src/WebPage/qweb.ui diff --git a/global.cpp b/global.cpp index fb39b37..5c4ce21 100644 --- a/global.cpp +++ b/global.cpp @@ -135,4 +135,24 @@ QString g_ToolBtnSelStyle = /**选中情况下样式**/ "border-color: #dcdde1;" "}"; +/** + * @brief calCRC16 + * @param cpu8Data + * @param u16Len + * @return + */ +uint16_t calCRC16(const uint8_t *cpu8Data, uint16_t u16Len) +{ + uint8_t u8X; + uint16_t u16CRC = 0X8848; + + while (u16Len--) + { + u8X = u16CRC >> 8 ^ *cpu8Data++; + u8X ^= u8X >> 4; + u16CRC = (u16CRC << 8) ^ ((uint16_t)(u8X << 12)) ^ ((uint16_t)(u8X << 5)) ^ ((uint16_t)u8X); + } + return u16CRC; +} + global::global() {} diff --git a/global.h b/global.h index 0ff2a1b..c20085e 100644 --- a/global.h +++ b/global.h @@ -12,6 +12,13 @@ extern QString g_ToolBtnStyle; extern QString g_ToolBtnSelStyle; /*******************系统颜色***************************************/ +/** + * @brief calCRC16 + * @param cpu8Data + * @param u16Len + * @return + */ +extern uint16_t calCRC16(const uint8_t *cpu8Data, uint16_t u16Len); class global { diff --git a/mainwindow.cpp b/mainwindow.cpp index 34e8e9c..2b65f6f 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1,7 +1,7 @@ #include "mainwindow.h" #include "ui_mainwindow.h" -#include "CWebEngineView.h" -#include "CustomWebEnginePage.h" +#include "Src/WebPage/cwebengineview.h" +#include "Src/WebPage/CustomWebEnginePage.h" #include "global.h" #include #include @@ -54,7 +54,7 @@ MainWindow::~MainWindow() delete mWeb; delete process; delete ui; - + if(m_ModelCameraDlg!=nullptr) delete m_ModelCameraDlg; } /** * @brief MainWindow::initFile 初始化配置文件 .ini @@ -83,6 +83,8 @@ void MainWindow::initWindow() m_SDFPDlg = new SDFPDlg(this); m_GDDCdlg = new GDDCdlg(this); m_HomePagedlg = new HomePageDlg(this); + + m_ModelCameraDlg = new ModelCameraDlg(this); m_rescueLoadWidget = new RescueLoadWidget(this); //使用信号槽函数获取配置文件中的IP @@ -148,7 +150,7 @@ void MainWindow::initWindow() ui->stackedWidget->addWidget(adHocNetworkWeb); ui->stackedWidget->addWidget(satelliteCommWeb); ui->stackedWidget->addWidget(m_rescueLoadWidget); - + ui->stackedWidget->addWidget(m_ModelCameraDlg); // 初始栈窗口显示主页 ui->stackedWidget->setCurrentWidget(m_SDFPDlg); @@ -317,7 +319,8 @@ void MainWindow::toolButton_2_clicked() { changeBtnColor(2); //m_GDDCdlg->move(130,80); - m_GDDCdlg->show(); //显示窗口 + //m_GDDCdlg->show(); //显示窗口 + ui->stackedWidget->setCurrentWidget(m_GDDCdlg); } @@ -333,6 +336,7 @@ void MainWindow::toolButton_3_clicked() void MainWindow::toolButton_4_clicked() { changeBtnColor(4); + // mWeb->load(QUrl("http://192.168.1.10")); // mWeb->show(); ui->stackedWidget->setCurrentWidget(adHocNetworkWeb); @@ -362,6 +366,7 @@ void MainWindow::toolButton_6_clicked() void MainWindow::toolButton_7_clicked() { changeBtnColor(7); + ui->stackedWidget->setCurrentWidget(m_rescueLoadWidget); } @@ -369,7 +374,12 @@ void MainWindow::toolButton_7_clicked() void MainWindow::toolButton_8_clicked() { changeBtnColor(8); - ui->stackedWidget->setCurrentWidget(mWeb); + ui->stackedWidget->setCurrentWidget(m_ModelCameraDlg); + + //ui->stackedWidget->setCurrentWidget(mWeb); + //process->setWorkingDirectory("D:/QTdemo/playerApp/app"); // 设置工作目录 + //process->start("D:/QTdemo/playerApp/app/XCOM V2.0.exe"); // 启动exe并传递参数 + //process->setWorkingDirectory("D:/Software/TCPUDPDbg"); // 设置工作目录 //process->start("D:/Software/TCPUDPDbg/TCPUDPDbg.exe"); // 启动exe并传递参数 } diff --git a/mainwindow.h b/mainwindow.h index aef7e71..8eedfbf 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -3,9 +3,10 @@ #include #include "Src/GDDC/gddcdlg.h" +#include "Src/ModelCamera/modelcameradlg.h" #include "Src/HomePage/homepagedlg.h" +#include "Src/RescueLoad/rescueloadwidget.h" #include "SDFPDlg.h" -#include "rescueloadwidget.h" #include #include #include @@ -58,10 +59,10 @@ public: SDFPDlg *m_SDFPDlg; //QWeb *m_qWeb; QWebEngineView *mWeb; + ModelCameraDlg* m_ModelCameraDlg; QWebEngineView *lLinkWeb;//L链 QWebEngineView *adHocNetworkWeb;//自组网 QWebEngineView *satelliteCommWeb;//卫通 - private: QProcess *process; QString exeDirPathName = "";