fix: 优化光电吊舱人机交互逻辑及页面

shiyi
wanghaoyu 3 months ago
parent 538dde64ea
commit afc4476eaa

@ -0,0 +1,273 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 14.0.1, 2024-12-03T19:00:43. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
<value type="QByteArray">{ed0dad32-f81f-4133-8ec2-4a3277169847}</value>
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="qlonglong">0</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
<value type="QString" key="language">Cpp</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
</valuemap>
</valuemap>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
<value type="QString" key="language">QmlJS</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
</valuemap>
</valuemap>
<value type="qlonglong" key="EditorConfiguration.CodeStyle.Count">2</value>
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
<value type="int" key="EditorConfiguration.IndentSize">4</value>
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
<value type="int" key="EditorConfiguration.PreferAfterWhitespaceComments">0</value>
<value type="bool" key="EditorConfiguration.PreferSingleLineComments">false</value>
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
<value type="int" key="EditorConfiguration.TabSize">8</value>
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
<value type="bool" key="EditorConfiguration.UseIndenter">false</value>
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
<value type="QString" key="EditorConfiguration.ignoreFileTypes">*.md, *.MD, Makefile</value>
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
<value type="bool" key="EditorConfiguration.skipTrailingWhitespace">true</value>
<value type="bool" key="EditorConfiguration.tintMarginArea">true</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap">
<valuemap type="QVariantMap" key="AutoTest.ActiveFrameworks">
<value type="bool" key="AutoTest.Framework.Boost">true</value>
<value type="bool" key="AutoTest.Framework.CTest">false</value>
<value type="bool" key="AutoTest.Framework.Catch">true</value>
<value type="bool" key="AutoTest.Framework.GTest">true</value>
<value type="bool" key="AutoTest.Framework.QtQuickTest">true</value>
<value type="bool" key="AutoTest.Framework.QtTest">true</value>
</valuemap>
<value type="bool" key="AutoTest.ApplyFilter">false</value>
<valuemap type="QVariantMap" key="AutoTest.CheckStates"/>
<valuelist type="QVariantList" key="AutoTest.PathFilters"/>
<value type="int" key="AutoTest.RunAfterBuild">0</value>
<value type="bool" key="AutoTest.UseGlobal">true</value>
<valuemap type="QVariantMap" key="ClangTools">
<value type="bool" key="ClangTools.AnalyzeOpenFiles">true</value>
<value type="bool" key="ClangTools.BuildBeforeAnalysis">true</value>
<value type="QString" key="ClangTools.DiagnosticConfig">Builtin.DefaultTidyAndClazy</value>
<value type="int" key="ClangTools.ParallelJobs">10</value>
<value type="bool" key="ClangTools.PreferConfigFile">true</value>
<valuelist type="QVariantList" key="ClangTools.SelectedDirs"/>
<valuelist type="QVariantList" key="ClangTools.SelectedFiles"/>
<valuelist type="QVariantList" key="ClangTools.SuppressedDiagnostics"/>
<value type="bool" key="ClangTools.UseGlobalSettings">true</value>
</valuemap>
<valuemap type="QVariantMap" key="CppEditor.QuickFix">
<value type="bool" key="UseGlobalSettings">true</value>
</valuemap>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value type="QString" key="DeviceType">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 6.6.3 MSVC2019 64bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 6.6.3 MSVC2019 64bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt6.663.win64_msvc2019_64_kit</value>
<value type="qlonglong" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="qlonglong" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="qlonglong" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="int" key="EnableQmlDebugging">0</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:\WorkData\Code\PlayLoad\build\build-PayloadAPP-Desktop_Qt_6_6_3_MSVC2019_64bit-Debug</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">D:/WorkData/Code/PlayLoad/build/build-PayloadAPP-Desktop_Qt_6_6_3_MSVC2019_64bit-Debug</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">构建</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">清除</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">清除</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:\WorkData\Code\PlayLoad\build\release</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">D:/WorkData/Code/PlayLoad/build/release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">构建</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">清除</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">清除</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="int" key="QtQuickCompiler">0</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
<value type="int" key="EnableQmlDebugging">0</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:\WorkData\Code\build-PayloadAPP-Desktop_Qt_6_6_3_MSVC2019_64bit-Profile</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">D:/WorkData/Code/build-PayloadAPP-Desktop_Qt_6_6_3_MSVC2019_64bit-Profile</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">构建</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">清除</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">清除</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Profile</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="int" key="QtQuickCompiler">0</value>
<value type="int" key="SeparateDebugInfo">0</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.Target.BuildConfigurationCount">3</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">部署</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">部署</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.DeployConfiguration.CustomData"/>
<value type="bool" key="ProjectExplorer.DeployConfiguration.CustomDataEnabled">false</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
<value type="int" key="Analyzer.Valgrind.Callgrind.CostFormat">0</value>
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
<valuelist type="QVariantList" key="CustomOutputParsers"/>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph &quot;dwarf,4096&quot; -F 250</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:D:/WorkData/Code/PlayLoad/PayloadAPP.pro</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">D:/WorkData/Code/PlayLoad/PayloadAPP.pro</value>
<value type="bool" key="ProjectExplorer.RunConfiguration.Customized">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default">D:/WorkData/Code/PlayLoad/build/build-PayloadAPP-Desktop_Qt_6_6_3_MSVC2019_64bit-Debug</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.TargetCount</variable>
<value type="qlonglong">1</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">22</value>
</data>
<data>
<variable>Version</variable>
<value type="int">22</value>
</data>
</qtcreator>

@ -18,3 +18,6 @@ FORMS += \
$$PWD/gddcSet.ui \ $$PWD/gddcSet.ui \
$$PWD/gddcStateInfo.ui \ $$PWD/gddcStateInfo.ui \
RESOURCES += \
$$PWD/res.qrc

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

@ -1,5 +1,6 @@
#include "gddcCmdDlg.h" #include "gddcCmdDlg.h"
#include "ui_gddcCmdDlg.h" #include "ui_gddcCmdDlg.h"
#include <algorithm>
GDDCCmdDlg::GDDCCmdDlg(QWidget *parent) GDDCCmdDlg::GDDCCmdDlg(QWidget *parent)
: QWidget(parent), ui(new Ui::GDDCCmdDlg) { : QWidget(parent), ui(new Ui::GDDCCmdDlg) {
@ -107,6 +108,10 @@ void GDDCCmdDlg::initParam() {
ui->lineEdit_6_1->setText("960"); ui->lineEdit_6_1->setText("960");
ui->lineEdit_6_2->setText("540"); ui->lineEdit_6_2->setText("540");
detectionAreaSetting = false; detectionAreaSetting = false;
ui->spinBox->setWrapping(true);
ui->spinBox->setValue(5);
setPodIco();
} }
// 设置tabwidget的几何位置 // 设置tabwidget的几何位置
void GDDCCmdDlg::setTabWidgetGeometry(int ax, int ay, int aw, int ah) { void GDDCCmdDlg::setTabWidgetGeometry(int ax, int ay, int aw, int ah) {
@ -337,27 +342,31 @@ void GDDCCmdDlg::on_pushButton_3_3_released() { clearTJDCCmdBuffer(); }
void GDDCCmdDlg::on_pushButton_3_4_pressed() { void GDDCCmdDlg::on_pushButton_3_4_pressed() {
TJDCCmdBuffer[0] = (std::byte)0x45; TJDCCmdBuffer[0] = (std::byte)0x45;
TJDCCmdBuffer[1] = (std::byte)0x01; TJDCCmdBuffer[1] = (std::byte)0x01;
TJDCCmdBuffer[2] = (std::byte)ui->spinBox->value();
} }
void GDDCCmdDlg::on_pushButton_3_4_released() { void GDDCCmdDlg::on_pushButton_3_4_released() {
clearTJDCCmdBuffer(); clearTJDCCmdBuffer();
TJDCCmdBuffer[0] = (std::byte)0x45; TJDCCmdBuffer[0] = (std::byte)0x45;
TJDCCmdBuffer[1] = (std::byte)0x00; TJDCCmdBuffer[1] = (std::byte)0x00;
sendCurDate(TJDCCmdBuffer, 1);
} }
// 变倍- // 变倍-
void GDDCCmdDlg::on_pushButton_3_5_pressed() { void GDDCCmdDlg::on_pushButton_3_5_pressed() {
TJDCCmdBuffer[0] = (std::byte)0x45; TJDCCmdBuffer[0] = (std::byte)0x45;
TJDCCmdBuffer[1] = (std::byte)0x02; TJDCCmdBuffer[1] = (std::byte)0x02;
TJDCCmdBuffer[2] = (std::byte)ui->spinBox->value();
} }
void GDDCCmdDlg::on_pushButton_3_5_released() { void GDDCCmdDlg::on_pushButton_3_5_released() {
clearTJDCCmdBuffer(); clearTJDCCmdBuffer();
TJDCCmdBuffer[0] = (std::byte)0x45; TJDCCmdBuffer[0] = (std::byte)0x45;
TJDCCmdBuffer[1] = (std::byte)0x00; TJDCCmdBuffer[1] = (std::byte)0x00;
sendCurDate(TJDCCmdBuffer, 1);
} }
// 可见光镜头初始化 // 可见光镜头初始化
void GDDCCmdDlg::on_pushButton_3_6_pressed() { void GDDCCmdDlg::on_pushButton_3_6_pressed() {
TJDCCmdBuffer[0] = (std::byte)0x41; TJDCCmdBuffer[0] = (std::byte)0x40;
TJDCCmdBuffer[1] = (std::byte)0x03; TJDCCmdBuffer[1] = (std::byte)0x03;
} }
void GDDCCmdDlg::on_pushButton_3_6_released() { clearTJDCCmdBuffer(); } void GDDCCmdDlg::on_pushButton_3_6_released() { clearTJDCCmdBuffer(); }
@ -380,12 +389,16 @@ void GDDCCmdDlg::on_pushButton_3_8_released() { clearTJDCCmdBuffer(); }
// 低照度模式 // 低照度模式
void GDDCCmdDlg::on_pushButton_3_9_pressed() { void GDDCCmdDlg::on_pushButton_3_9_pressed() {
if (param_pushButton_3_9) { if (param_pushButton_3_9) {//关闭
TJDCCmdBuffer[0] = (std::byte)0x4A; TJDCCmdBuffer[0] = (std::byte)0x4B;
TJDCCmdBuffer[1] = (std::byte)0x00; TJDCCmdBuffer[1] = (std::byte)0x00;
} else { param_pushButton_3_9 = false;
TJDCCmdBuffer[0] = (std::byte)0x4A; ui->pushButton_3_9->setText("低照度模式");
} else { //开启
TJDCCmdBuffer[0] = (std::byte)0x4B;
TJDCCmdBuffer[1] = (std::byte)0x01; TJDCCmdBuffer[1] = (std::byte)0x01;
param_pushButton_3_9 = true;
ui->pushButton_3_9->setText("低照度模式关");
} }
} }
void GDDCCmdDlg::on_pushButton_3_9_released() { clearTJDCCmdBuffer(); } void GDDCCmdDlg::on_pushButton_3_9_released() { clearTJDCCmdBuffer(); }
@ -646,7 +659,7 @@ void GDDCCmdDlg::on_pushButton_4_17_pressed() {
TJDCCmdBuffer[1] = (std::byte)0x00; TJDCCmdBuffer[1] = (std::byte)0x00;
TJDCCmdBuffer[2] = (std::byte)0x00; TJDCCmdBuffer[2] = (std::byte)0x00;
} else { } else {
TJDCCmdBuffer[0] = (std::byte)0x58; TJDCCmdBuffer[0] = (std::byte)0x53;
TJDCCmdBuffer[1] = (std::byte)0x01; TJDCCmdBuffer[1] = (std::byte)0x01;
TJDCCmdBuffer[2] = (std::byte)(sel - 1); TJDCCmdBuffer[2] = (std::byte)(sel - 1);
} }
@ -870,13 +883,13 @@ void GDDCCmdDlg::on_pushButton_5_15_released() { clearTJDCCmdBuffer(); }
// 框架 // 框架
void GDDCCmdDlg::on_radioButton_5_1_clicked() { void GDDCCmdDlg::on_radioButton_5_1_clicked() {
paramIsFrame = true; paramIsFrame = true;
ui->pushButton_5_5->setText("归中"); // ui->pushButton_5_5->setText("归中");
} }
// 陀螺 // 陀螺
void GDDCCmdDlg::on_radioButton_5_2_clicked() { void GDDCCmdDlg::on_radioButton_5_2_clicked() {
paramIsFrame = false; paramIsFrame = false;
ui->pushButton_5_5->setText("自动校准"); // ui->pushButton_5_5->setText("自动校准");
} }
// AI开 // AI开
@ -956,3 +969,59 @@ void GDDCCmdDlg::on_pushButton_6_8_clicked() {
ui->pushButton_6_8->setDown(false); ui->pushButton_6_8->setDown(false);
} }
} }
void GDDCCmdDlg::wheelSwipe(int value)
{
if(value > 0)//鼠标前滚
{
on_pushButton_3_4_pressed();
}
else if(value < 0)
{
on_pushButton_3_5_pressed();
}
else if(value == 0)
{
on_pushButton_3_4_released();
}
//qDebug() << value;
}
void GDDCCmdDlg::setMoveParm(QPointF size)
{
int x = std::clamp(static_cast<int>(size.x()/10), -60, 60);
int y = std::clamp(static_cast<int>(- size.y()/10), -60, 60);
// qDebug() << "缩减之后的屏幕滑动参数==>" << "x:" << x << "y:" << y;
TJDCCmdBuffer[5] = (std::byte)0x70;
TJDCCmdBuffer[6] = (std::byte)(x & 0xFF);
TJDCCmdBuffer[7] = (std::byte)((x >> 8) & 0xFF);
TJDCCmdBuffer[8] = (std::byte)(y & 0xFF);
TJDCCmdBuffer[9] = (std::byte)((y >> 8) & 0xFF);
//qDebug() << (int)TJDCCmdBuffer[6] << "---" << (int)TJDCCmdBuffer[7];
}
/*************************************************
* @func
* @brief
**************************************************/
void GDDCCmdDlg::setPodIco() {
ui->pushButton_5_1->setIcon(QIcon(":/img/Pod/podUp.png"));
ui->pushButton_5_1->setIconSize(QSize(53, 53));
ui->pushButton_5_1->setStyleSheet("QPushButton { border: none; }");
ui->pushButton_5_2->setIcon(QIcon(":/img/Pod/podLeft.png"));
ui->pushButton_5_2->setIconSize(QSize(53, 53));
ui->pushButton_5_2->setStyleSheet("QPushButton { border: none; }");
ui->pushButton_5_3->setIcon(QIcon(":/img/Pod/podDown.png"));
ui->pushButton_5_3->setIconSize(QSize(53, 53));
ui->pushButton_5_3->setStyleSheet("QPushButton { border: none; }");
ui->pushButton_5_4->setIcon(QIcon(":/img/Pod/podRight.png"));
ui->pushButton_5_4->setIconSize(QSize(53, 53));
ui->pushButton_5_4->setStyleSheet("QPushButton { border: none; }");
ui->pushButton_5_5->setIcon(QIcon(":/img/Pod/Center.png"));
ui->pushButton_5_5->setIconSize(QSize(53, 53));
ui->pushButton_5_5->setStyleSheet("QPushButton { border: none; }");
}

@ -1,6 +1,7 @@
#ifndef GDDCCMDDLG_H #ifndef GDDCCMDDLG_H
#define GDDCCMDDLG_H #define GDDCCMDDLG_H
#include "imageswitch.h"
#include <QByteArray> #include <QByteArray>
#include <QDateTime> #include <QDateTime>
#include <QDir> #include <QDir>
@ -17,7 +18,6 @@
#include <QWidget> #include <QWidget>
#include <vector> #include <vector>
#include <windows.h> #include <windows.h>
#include "imageswitch.h"
#define cmdLength 44 #define cmdLength 44
namespace Ui { namespace Ui {
@ -230,7 +230,12 @@ private slots:
void on_pushButton_6_7_pressed(); void on_pushButton_6_7_pressed();
void on_pushButton_6_7_released(); void on_pushButton_6_7_released();
void on_pushButton_6_8_clicked(); void on_pushButton_6_8_clicked();
public slots:
//滚轮
void wheelSwipe(int value);
void setMoveParm(QPointF size);
private:
void setPodIco();
}; };
#endif // GDDCCMDDLG_H #endif // GDDCCMDDLG_H

File diff suppressed because it is too large Load Diff

@ -584,9 +584,9 @@ void GDDCStateInfo::UDPMessageReceive(QByteArray &da, int size) {
} }
bool GDDCStateInfo::checkdata(QByteArray buffer, int length, int type) { bool GDDCStateInfo::checkdata(QByteArray buffer, int length, int type) {
if (length != 64) { // if (length != 64) {
return false; // return false;
} // }
if ((buffer.at(0) != '\xFC') || (buffer.at(1) != '\x2C') || if ((buffer.at(0) != '\xFC') || (buffer.at(1) != '\x2C') ||
buffer.at(63) != '\xF0') { buffer.at(63) != '\xF0') {
return false; return false;

@ -9,7 +9,7 @@
#include <QTabBar> #include <QTabBar>
#include <QTabWidget> #include <QTabWidget>
#include <iostream> #include <iostream>
#include <QPixmap>
#include "ui_gddcdlg.h" #include "ui_gddcdlg.h"
#pragma comment(lib, "Wtsapi32.lib") #pragma comment(lib, "Wtsapi32.lib")
@ -41,7 +41,7 @@ DWORD GetmPid(LPCWSTR ProcessName) {
} }
#define CONFIG_PATH "config.ini" #define CONFIG_PATH "config.ini"
#define CMDPAGEHIGHT 210 #define CMDPAGEWIDTH 380
#define STATEPAGEWIDTH 250 #define STATEPAGEWIDTH 250
GDDCdlg::GDDCdlg(QWidget *parent) : QWidget(parent), ui(new Ui::GDDCdlg) { GDDCdlg::GDDCdlg(QWidget *parent) : QWidget(parent), ui(new Ui::GDDCdlg) {
@ -83,7 +83,7 @@ void GDDCdlg::initWindow() {
m_GDDCCmdDlg = new GDDCCmdDlg(this); m_GDDCCmdDlg = new GDDCCmdDlg(this);
m_GDDCStateDlg = new GDDCStateInfo(this); m_GDDCStateDlg = new GDDCStateInfo(this);
ui->pushButShowStatePage->setIcon(QIcon(":/res/right.png")); ui->pushButShowStatePage->setIcon(QIcon(":/res/right.png"));
ui->pushButShowCmdPage->setIcon(QIcon(":/res/down.png")); ui->pushButShowCmdPage->setIcon(QIcon(":/res/right.png"));
// connect( // connect(
// ui->WgtffmpegVideo, &VideoWidget::sendErrorMessageSignal, this, // ui->WgtffmpegVideo, &VideoWidget::sendErrorMessageSignal, this,
@ -102,9 +102,45 @@ void GDDCdlg::initParam() {
pointSelectionTracking = false; pointSelectionTracking = false;
Is_openVideo = false; Is_openVideo = false;
isCmdPageShow = true; isCmdPageShow = true;
isStatePageShow = true; isStatePageShow = false;
detectionAreaSetting = false; detectionAreaSetting = false;
connectFlag.resize(12, false); connectFlag.resize(12, false);
_delta = 0;
_wheelStopTime = new QTimer(this);
_wheelStopTime->setInterval(300);
_wheelStopTime->setSingleShot(true);
_dragFlag = false;
_moveFlag = false;
firstLocation = new QLabel(this);
firstLocation->setPixmap(QPixmap(":/img/Pod/c.png"));
firstLocation->setScaledContents(true);
firstLocation->resize(30,30);
firstLocation->setStyleSheet("border: none; background: transparent;");
firstLocation->hide();
lastLocation = new QLabel(this);
lastLocation->setPixmap(QPixmap(":/img/Pod/circle.png"));
lastLocation->setScaledContents(true);
lastLocation->resize(25,25);
lastLocation->setStyleSheet("border: none; background: transparent;");
lastLocation->hide();
wheelPlus = new QLabel(this);
wheelPlus->setPixmap(QPixmap(":/img/Pod/plus.png"));
wheelPlus->setScaledContents(true);
wheelPlus->resize(30,30);
wheelPlus->setStyleSheet("border: none; background: transparent;");
wheelPlus->hide();
wheelSub = new QLabel(this);
wheelSub->setPixmap(QPixmap(":/img/Pod/sub.png"));
wheelSub->setScaledContents(true);
wheelSub->resize(30,30);
wheelSub->setStyleSheet("border: none; background: transparent;");
wheelSub->hide();
} }
// 初始化信号与槽 // 初始化信号与槽
@ -129,6 +165,20 @@ void GDDCdlg::initSignalSlot() {
SLOT(startConnect(int))); // 开始连接 SLOT(startConnect(int))); // 开始连接
connect(m_DlgGDDCSet, SIGNAL(SignalStopConnect(int)), this, connect(m_DlgGDDCSet, SIGNAL(SignalStopConnect(int)), this,
SLOT(stopConnect(int))); // 停止连接 SLOT(stopConnect(int))); // 停止连接
connect(this, &GDDCdlg::wheelSendData, m_GDDCCmdDlg, &GDDCCmdDlg::wheelSwipe);
connect(_wheelStopTime, &QTimer::timeout, this, [this](){
emit wheelSendData(0);
qDebug()<<"滚轮停止了";
// if(wheelPlus->isVisible())
// {
// wheelPlus->hide();
// }
// else if(wheelSub->isVisible())
// {
// wheelSub->hide();
// }
});
} }
// 槽函数开始连接 // 槽函数开始连接
@ -203,7 +253,7 @@ void GDDCdlg::stopConnect(int type) {
// 鼠标左键 // 鼠标左键
void GDDCdlg::mousePressEvent(QMouseEvent *event) { void GDDCdlg::mousePressEvent(QMouseEvent *event) {
// 如果鼠标左键按下 // 如果鼠标左键按下
if (event->type() == QEvent::MouseButtonPress) { /*if (event->type() == QEvent::MouseButtonPress) {
// AI检测区域设置 // AI检测区域设置
if (m_GDDCCmdDlg->detectionAreaSetting == true) { if (m_GDDCCmdDlg->detectionAreaSetting == true) {
QPointF sPoint1 = event->globalPosition(); QPointF sPoint1 = event->globalPosition();
@ -216,34 +266,24 @@ void GDDCdlg::mousePressEvent(QMouseEvent *event) {
m_GDDCCmdDlg->setAIDetcLineEditText(QString::number((int)dir), m_GDDCCmdDlg->setAIDetcLineEditText(QString::number((int)dir),
QString::number((int)pitch)); QString::number((int)pitch));
} }
// 目标跟踪
if (m_GDDCCmdDlg->pointSelectionTracking == true) {
QPointF sPoint1 = event->globalPosition();
QPointF widgetPoint = ui->WgtffmpegVideo->mapFromGlobal(sPoint1);
double a = ui->WgtffmpegVideo->width();
double b = ui->WgtffmpegVideo->height();
double dir = 1920 / a * widgetPoint.rx() - 960;
double pitch = -(1080 / b * widgetPoint.ry() - 540);
std::byte buffer[10];
buffer[0] = (std::byte)0x3A;
buffer[1] = (std::byte)(dir);
buffer[2] = (std::byte)((int)dir >> 8);
buffer[3] = (std::byte)pitch;
buffer[4] = (std::byte)((int)pitch >> 8);
buffer[5] = (std::byte)0x00;
buffer[6] = (std::byte)0x00;
buffer[7] = (std::byte)0x00;
buffer[8] = (std::byte)0x00;
buffer[9] = (std::byte)0x00;
// 发送5次 }*/
m_GDDCCmdDlg->sendCurDate(buffer, 3); if(ui->WgtffmpegVideo->underMouse())
{
if(event->button() == Qt::LeftButton)
{
//记录鼠标按下位置
_dragStartPositon = event->pos();
//QPointF b = event->globalPosition();
qDebug() << "局部坐标" << "x" << _dragStartPositon.x() << "y" << _dragStartPositon.y();
//qDebug() << "全局坐标" << "x" << b.x() << "y" << b.y();
_dragFlag = true;
} }
} }
} }
// 鼠标移动 // 鼠标移动
void GDDCdlg::mouseMoveEvent(QMouseEvent *event) { void GDDCdlg::mouseMoveEvent(QMouseEvent *event) {
if (m_GDDCCmdDlg->detectionAreaSetting == true) { /*if (m_GDDCCmdDlg->detectionAreaSetting == true) {
// qDebug() << this->geometry().x(); // qDebug() << this->geometry().x();
// qDebug() << this->geometry().y(); // qDebug() << this->geometry().y();
QPointF sPoint1 = event->globalPosition(); QPointF sPoint1 = event->globalPosition();
@ -265,6 +305,65 @@ void GDDCdlg::mouseMoveEvent(QMouseEvent *event) {
double pitch = -(1080 / b * widgetPoint.ry() - 540); double pitch = -(1080 / b * widgetPoint.ry() - 540);
m_GDDCCmdDlg->setAIDetcLineEditText(QString::number((int)dir), m_GDDCCmdDlg->setAIDetcLineEditText(QString::number((int)dir),
QString::number((int)pitch)); QString::number((int)pitch));
}*/
if(_dragFlag)//点击并且移动
{
QPointF diff = event->pos() - _dragStartPositon;
qDebug() << "x:" << diff.x() <<"y:" <<diff.y();
m_GDDCCmdDlg->setMoveParm(diff);
_moveFlag = true;
firstLocation->move((_dragStartPositon - QPoint(firstLocation->width()/2, firstLocation->height()/2)).toPoint());
lastLocation->move(event->pos() - QPoint(lastLocation->width() / 2, lastLocation->height() / 2));
firstLocation->show();
lastLocation->show();
}
}
void GDDCdlg::mouseReleaseEvent(QMouseEvent *event)
{
if(ui->WgtffmpegVideo->underMouse())
{
if(event->button() == Qt::LeftButton && _moveFlag)
{
_moveFlag = false;
std::byte buffer[10];
buffer[5] = (std::byte)0x70;
buffer[6] = (std::byte)0x00;
buffer[7] = (std::byte)0x00;
buffer[8] = (std::byte)0x00;
buffer[9] = (std::byte)0x00;
// 发送3次
m_GDDCCmdDlg->sendCurDate(buffer, 3);
firstLocation->hide();
lastLocation->hide();
}
else if(event->button() == Qt::LeftButton && _dragFlag)
{
// 目标跟踪
if (m_GDDCCmdDlg->pointSelectionTracking == true) {
QPointF sPoint1 = event->globalPosition();
QPointF widgetPoint = ui->WgtffmpegVideo->mapFromGlobal(sPoint1);
double a = ui->WgtffmpegVideo->width();
double b = ui->WgtffmpegVideo->height();
double dir = 1920 / a * widgetPoint.rx() - 960;
double pitch = -(1080 / b * widgetPoint.ry() - 540);
std::byte buffer[10];
buffer[0] = (std::byte)0x3A;
buffer[1] = (std::byte)(dir);
buffer[2] = (std::byte)((int)dir >> 8);
buffer[3] = (std::byte)pitch;
buffer[4] = (std::byte)((int)pitch >> 8);
buffer[5] = (std::byte)0x00;
buffer[6] = (std::byte)0x00;
buffer[7] = (std::byte)0x00;
buffer[8] = (std::byte)0x00;
buffer[9] = (std::byte)0x00;
// 发送5次
m_GDDCCmdDlg->sendCurDate(buffer, 3);
}
}
} }
} }
// 区域重绘 // 区域重绘
@ -286,37 +385,31 @@ void GDDCdlg::resizeUI() {
// qDebug()<<"宽度,高度:"<<GDDCPageHeight<<GDDCPageWidth; // qDebug()<<"宽度,高度:"<<GDDCPageHeight<<GDDCPageWidth;
/******控制区位置和大小设置*****/ /******控制区位置和大小设置*****/
double cmdAreaHeight; double cmdAreaHeight = 0;
double cmdAreaWidth; double cmdAreaWidth = 0;
if (isStatePageShow) {
cmdAreaWidth = GDDCPageWidth - STATEPAGEWIDTH;
} else {
cmdAreaWidth = GDDCPageWidth;
}
if (isCmdPageShow) { if (isCmdPageShow) {
cmdAreaHeight = CMDPAGEHIGHT; cmdAreaWidth = CMDPAGEWIDTH;
} else { cmdAreaHeight = GDDCPageHeight;
cmdAreaHeight = 0;
} }
m_GDDCCmdDlg->setGeometry(0, GDDCPageHeight - cmdAreaHeight,
(int)cmdAreaWidth, (int)cmdAreaHeight); m_GDDCCmdDlg->setGeometry(GDDCPageWidth - cmdAreaWidth, 0, (int)cmdAreaWidth,
GDDCPageHeight);
m_GDDCCmdDlg->setTabWidgetGeometry(0, 0, cmdAreaWidth, cmdAreaHeight); m_GDDCCmdDlg->setTabWidgetGeometry(0, 0, cmdAreaWidth, cmdAreaHeight);
/*********状态区位置和大小设置***********/ /*********状态区位置和大小设置***********/
double stateAreaHeight = GDDCPageHeight; double stateAreaHeight = 0;
double stateAreaWidth; double stateAreaWidth = 0;
if (isStatePageShow) { if (isStatePageShow) {
stateAreaWidth = STATEPAGEWIDTH; stateAreaWidth = STATEPAGEWIDTH;
} else { stateAreaHeight = GDDCPageHeight;
stateAreaWidth = 0;
} }
m_GDDCStateDlg->setGeometry(GDDCPageWidth - stateAreaWidth, 0, m_GDDCStateDlg->setGeometry(0, 0, stateAreaWidth, stateAreaHeight);
stateAreaWidth, stateAreaHeight);
m_GDDCStateDlg->setTableViewGeometry(0, 0, stateAreaWidth, stateAreaHeight); m_GDDCStateDlg->setTableViewGeometry(0, 0, stateAreaWidth, stateAreaHeight);
/*******视频区位置和大小设置********/ /*******视频区位置和大小设置********/
double VideoAreaHeight = GDDCPageHeight - cmdAreaHeight; // 视频区高度 double VideoAreaHeight = GDDCPageHeight /*- cmdAreaHeight*/; // 视频区高度
double VideoAreaWidth = GDDCPageWidth - stateAreaWidth; // 视频区宽度 double VideoAreaWidth = GDDCPageWidth - cmdAreaWidth; // 视频区宽度
// //高度值相对比较大 // //高度值相对比较大
// if(VideoAreaHeight*16>VideoAreaWidth*9) // if(VideoAreaHeight*16>VideoAreaWidth*9)
// { // {
@ -337,18 +430,17 @@ void GDDCdlg::resizeUI() {
(int)VideoAreaHeight); (int)VideoAreaHeight);
/**************设置按钮****************/ /**************设置按钮****************/
ui->pushButtonSet->setGeometry(GDDCPageWidth - stateAreaWidth, 0, 30, 30); ui->pushButtonSet->setGeometry(GDDCPageWidth - cmdAreaWidth - 30, 0, 30, 30);
ui->pushButtonSet->raise(); ui->pushButtonSet->raise();
/**********控制页显示隐藏按钮********/ /**********控制页显示隐藏按钮********/
ui->pushButShowCmdPage->setGeometry( ui->pushButShowCmdPage->setGeometry(GDDCPageWidth - cmdAreaWidth - 15,
cmdAreaWidth * 0.5, GDDCPageHeight - cmdAreaHeight - 15, 50, 15); GDDCPageHeight * 0.5, 15, 50);
ui->pushButShowCmdPage->raise(); ui->pushButShowCmdPage->raise();
/**********状态页显示隐藏按钮********/ /**********状态页显示隐藏按钮********/
ui->pushButShowStatePage->setGeometry( ui->pushButShowStatePage->setGeometry(0 + stateAreaWidth,
GDDCPageWidth - stateAreaWidth - 15, GDDCPageHeight * 0.5, 15, 50);
(stateAreaHeight - cmdAreaHeight) * 0.5, 15, 50);
ui->pushButShowStatePage->raise(); ui->pushButShowStatePage->raise();
} }
@ -366,8 +458,7 @@ void GDDCdlg::GDDCControlTimeOut() {
// UDP控制 // UDP控制
if (connectFlag[3]) { if (connectFlag[3]) {
udpSocket->writeDatagram( udpSocket->writeDatagram(m_GDDCCmdDlg->m_DCcmdBuffer,
m_GDDCCmdDlg->m_DCcmdBuffer,
m_DlgGDDCSet->m_myPairNetwork.getRemoteAddr(), m_DlgGDDCSet->m_myPairNetwork.getRemoteAddr(),
m_DlgGDDCSet->m_myPairNetwork.getRemotePort()); m_DlgGDDCSet->m_myPairNetwork.getRemotePort());
} }
@ -382,8 +473,7 @@ void GDDCdlg::GDDCControlTimeOut() {
m_GDDCCmdDlg->UpdateDataTJDC(); m_GDDCCmdDlg->UpdateDataTJDC();
// UDP控制 // UDP控制
if (connectFlag[3]) { if (connectFlag[3]) {
udpSocket->writeDatagram( udpSocket->writeDatagram(m_GDDCCmdDlg->m_DCcmdBuffer,
m_GDDCCmdDlg->m_DCcmdBuffer,
m_DlgGDDCSet->m_myPairNetwork.getRemoteAddr(), m_DlgGDDCSet->m_myPairNetwork.getRemoteAddr(),
m_DlgGDDCSet->m_myPairNetwork.getRemotePort()); m_DlgGDDCSet->m_myPairNetwork.getRemotePort());
} }
@ -456,10 +546,9 @@ void GDDCdlg::startConnectUDPCtrl() {
if (!connectFlag[3]) { if (!connectFlag[3]) {
/*启动定时器*/ /*启动定时器*/
GDDCControlTimer = new QTimer(); GDDCControlTimer = new QTimer();
GDDCControlTimer->setInterval(100); GDDCControlTimer->setInterval(40);
connect(GDDCControlTimer, &QTimer::timeout, this, [=]() { connect(GDDCControlTimer, &QTimer::timeout, this,
GDDCControlTimeOut(); [=]() { GDDCControlTimeOut(); });
});
GDDCControlTimer->start(); GDDCControlTimer->start();
// 创建udp socket对象 // 创建udp socket对象
@ -468,8 +557,7 @@ void GDDCdlg::startConnectUDPCtrl() {
// QList<QHostAddress> ipAddressesList = // QList<QHostAddress> ipAddressesList =
// QNetworkInterface::allAddresses();//获取本机ip // QNetworkInterface::allAddresses();//获取本机ip
udpSocket->bind(m_DlgGDDCSet->m_myPairNetwork.getLocalPort()); udpSocket->bind(m_DlgGDDCSet->m_myPairNetwork.getLocalPort());
connect(udpSocket, SIGNAL(readyRead()), this, connect(udpSocket, SIGNAL(readyRead()), this, SLOT(UDPMessageReceive()));
SLOT(UDPMessageReceive()));
connectFlag[3] = true; connectFlag[3] = true;
} }
} }
@ -617,13 +705,13 @@ void GDDCdlg::pushButShowCmdPage_clicked() {
m_GDDCCmdDlg->setVisible(false); m_GDDCCmdDlg->setVisible(false);
isCmdPageShow = false; isCmdPageShow = false;
resizeUI(); resizeUI();
ui->pushButShowCmdPage->setIcon(QIcon(":/res/up.png")); ui->pushButShowCmdPage->setIcon(QIcon(":/res/left.png"));
// ui->pushButton->setGeometry(this->width()/2,this->height()-50,50,50); // ui->pushButton->setGeometry(this->width()/2,this->height()-50,50,50);
} else { } else {
m_GDDCCmdDlg->setVisible(true); m_GDDCCmdDlg->setVisible(true);
isCmdPageShow = true; isCmdPageShow = true;
resizeUI(); resizeUI();
ui->pushButShowCmdPage->setIcon(QIcon(":/res/down.png")); ui->pushButShowCmdPage->setIcon(QIcon(":/res/right.png"));
// ui->pushButton->setGeometry(this->width()/2,ui->tabWidget->height(),50,50); // ui->pushButton->setGeometry(this->width()/2,ui->tabWidget->height(),50,50);
} }
} }
@ -633,12 +721,12 @@ void GDDCdlg::pushButShowStatePage_clicked() {
m_GDDCStateDlg->setVisible(false); m_GDDCStateDlg->setVisible(false);
isStatePageShow = false; isStatePageShow = false;
resizeUI(); resizeUI();
ui->pushButShowStatePage->setIcon(QIcon(":/res/left.png")); ui->pushButShowStatePage->setIcon(QIcon(":/res/right.png"));
} else { } else {
m_GDDCStateDlg->setVisible(true); m_GDDCStateDlg->setVisible(true);
isStatePageShow = true; isStatePageShow = true;
resizeUI(); resizeUI();
ui->pushButShowStatePage->setIcon(QIcon(":/res/right.png")); ui->pushButShowStatePage->setIcon(QIcon(":/res/left.png"));
// ui->pushButton->setGeometry(this->width()/2,ui->tabWidget->height(),50,50); // ui->pushButton->setGeometry(this->width()/2,ui->tabWidget->height(),50,50);
} }
} }
@ -646,3 +734,51 @@ void GDDCdlg::pushButShowStatePage_clicked() {
void GDDCdlg::showErrorMessage(QString message, int type) { void GDDCdlg::showErrorMessage(QString message, int type) {
g_notifyManager->notify(message, "", type, 3000); g_notifyManager->notify(message, "", type, 3000);
} }
//鼠标滚轮事件
void GDDCdlg::wheelEvent(QWheelEvent *event)
{
if(ui->WgtffmpegVideo->underMouse())
{
// 获取滚轮的滚动方向和角度增量
_delta = event->angleDelta().y();
QPointF currentLocation = event->position();
// qDebug() << "当前位置:" << currentLocation;
if (_delta > 0)
{
// 向上滚动
//qDebug() << "鼠标滚轮向上滚动" << " 步长:" << _delta;
// if(wheelSub->isVisible())
// {
// wheelSub->hide();
// }
// wheelPlus->move((currentLocation - QPoint(wheelPlus->width()/2, wheelPlus->height()/2)).toPoint());
// wheelPlus->show();
emit wheelSendData(_delta);
}
else if (_delta < 0)
{
// 向下滚动
// if(wheelPlus->isVisible())
// {
// wheelPlus->hide();
// }
// wheelSub->move((currentLocation - QPoint(wheelSub->width()/2, wheelSub->height()/2)).toPoint());
// wheelSub->show();
emit wheelSendData(_delta);
//qDebug() << "鼠标滚轮事向下滚动" << " 步长:" << _delta;
}
if(!_wheelStopTime->isActive())
{
_wheelStopTime->start();
}
else
{
_wheelStopTime->stop();
_wheelStopTime->start();
}
}
QWidget::wheelEvent(event);
}

@ -25,6 +25,9 @@
// #include "ui_gddcSet.h" // #include "ui_gddcSet.h"
#include <QMessageBox> #include <QMessageBox>
#include <QThread> #include <QThread>
#include <QWheelEvent>
#include <QTimer>
#include <QLabel>
#include "QProcess" #include "QProcess"
@ -69,8 +72,9 @@ public:
QProcess *process; // 执行CMD QProcess *process; // 执行CMD
QThread workerThread; // 线程 QThread workerThread; // 线程
// bool eventFilter(QObject *,QEvent *); //事件过滤器 // bool eventFilter(QObject *,QEvent *); //事件过滤器
void mousePressEvent(QMouseEvent *event); // 事件过滤器 void mousePressEvent(QMouseEvent *event) override; // 事件过滤器
void mouseMoveEvent(QMouseEvent *event); // 事件过滤器 void mouseMoveEvent(QMouseEvent *event) override; // 事件过滤器
void mouseReleaseEvent(QMouseEvent *event) override;
void startConnectURL1(); void startConnectURL1();
void stopConnectURL1(); void stopConnectURL1();
@ -102,6 +106,22 @@ public slots:
void pushButShowStatePage_clicked(); void pushButShowStatePage_clicked();
void showErrorMessage(QString message, int type); void showErrorMessage(QString message, int type);
protected:
void wheelEvent(QWheelEvent* event) override;
private:
int _delta; //滚轮滚动量
QTimer *_wheelStopTime;
QPointF _dragStartPositon; //记录滑动操作当前点击的局部坐标
bool _dragFlag; //记录滑动初始标志
bool _moveFlag; //记录正在滑动中的标志
QLabel* firstLocation;
QLabel* lastLocation;
// QPointF _currentLocation; //记录鼠标当前位置
QLabel* wheelPlus; //鼠标+图标
QLabel* wheelSub; //鼠标-图标
signals:
void wheelSendData(int value);
}; };
#endif // GDDCDLG_H #endif // GDDCDLG_H

@ -0,0 +1,13 @@
<RCC>
<qresource prefix="/img">
<file>Pod/podDown.png</file>
<file>Pod/podLeft.png</file>
<file>Pod/podRight.png</file>
<file>Pod/podUp.png</file>
<file>Pod/Center.png</file>
<file>Pod/c.png</file>
<file>Pod/circle.png</file>
<file>Pod/plus.png</file>
<file>Pod/sub.png</file>
</qresource>
</RCC>

@ -85,7 +85,7 @@ bool Cffmpeg_decode::open_input_file() {
// av_dict_set(&avdic, "listen_timeout", "200000", 0); // av_dict_set(&avdic, "listen_timeout", "200000", 0);
// 在尝试连接到一个流或网络资源时,等待的最长时间。如果在这个时间内无法建立连接,就会返回超时错误 // 在尝试连接到一个流或网络资源时,等待的最长时间。如果在这个时间内无法建立连接,就会返回超时错误
av_dict_set(&avdic, "stimeout", "5000000", 0); // 设置超时5秒 av_dict_set(&avdic, "stimeout", "5000000", 0); // 设置超时5秒
// av_dict_set(&avdic, "max_delay", "300000", 0); // 设置最大时延300ms av_dict_set(&avdic, "max_delay", "300000", 0); // 设置最大时延300ms
av_dict_set(&avdic, "tune", "zerolatency", 0); // 实时编码 av_dict_set(&avdic, "tune", "zerolatency", 0); // 实时编码
av_dict_set(&avdic, "preset", "ultrafast", 0); // faster av_dict_set(&avdic, "preset", "ultrafast", 0); // faster
// av_dict_set(&avdic, "threads", "auto", 0); // 自动开启线程数 // av_dict_set(&avdic, "threads", "auto", 0); // 自动开启线程数

@ -572,3 +572,8 @@ void VideoWidget::receiveErrorMessage(QString message, int type) {
// qDebug() << "receive message:" << message; // qDebug() << "receive message:" << message;
emit sendErrorMessageSignal(message, type); emit sendErrorMessageSignal(message, type);
} }
QSizeF VideoWidget::getCurImgSize()
{
return m_zoomSize;
}

@ -113,6 +113,8 @@ private:
signals: signals:
void startPullSignal(); void startPullSignal();
void sendErrorMessageSignal(QString message, int type); void sendErrorMessageSignal(QString message, int type);
public:
QSizeF getCurImgSize();
}; };
#endif // VIDEOWIDGET_H #endif // VIDEOWIDGET_H

@ -2,12 +2,13 @@
#include <QFile> #include <QFile>
#include <QLocale> #include <QLocale>
#include <QTranslator> #include <QTranslator>
#include <QQuickWindow>
#include "mainwindow.h" #include "mainwindow.h"
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
// QApplication::setAttribute(Qt::AA_UseOpenGLES); // QApplication::setAttribute(Qt::AA_UseOpenGLES);
// qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--enable-gpu-rasterization"); // qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--enable-gpu-rasterization");
QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL);
QApplication a(argc, argv); QApplication a(argc, argv);
QTranslator translator; QTranslator translator;
const QStringList uiLanguages = QLocale::system().uiLanguages(); const QStringList uiLanguages = QLocale::system().uiLanguages();

Loading…
Cancel
Save