光电吊舱控制功能完善

pull/3/head
caoyuhui 8 months ago
commit 10e575a42c

@ -1,18 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject> <!DOCTYPE QtCreatorProject>
<<<<<<< Updated upstream <!-- Written by QtCreator 13.0.2, 2024-07-08T17:21:00. -->
<!-- Written by QtCreator 13.0.2, 2024-07-07T17:08:17. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
<value type="QByteArray">{759415a8-4594-451e-a962-883a838b346f}</value>
=======
<!-- Written by QtCreator 13.0.2, 2024-07-07T20:01:12. -->
<qtcreator> <qtcreator>
<data> <data>
<variable>EnvironmentId</variable> <variable>EnvironmentId</variable>
<value type="QByteArray">{a4cfdcc4-9e92-4192-b732-d379deab22e3}</value> <value type="QByteArray">{a4cfdcc4-9e92-4192-b732-d379deab22e3}</value>
>>>>>>> Stashed changes
</data> </data>
<data> <data>
<variable>ProjectExplorer.Project.ActiveTarget</variable> <variable>ProjectExplorer.Project.ActiveTarget</variable>
@ -84,7 +76,7 @@
<value type="bool" key="ClangTools.AnalyzeOpenFiles">true</value> <value type="bool" key="ClangTools.AnalyzeOpenFiles">true</value>
<value type="bool" key="ClangTools.BuildBeforeAnalysis">true</value> <value type="bool" key="ClangTools.BuildBeforeAnalysis">true</value>
<value type="QString" key="ClangTools.DiagnosticConfig">Builtin.DefaultTidyAndClazy</value> <value type="QString" key="ClangTools.DiagnosticConfig">Builtin.DefaultTidyAndClazy</value>
<value type="int" key="ClangTools.ParallelJobs">8</value> <value type="int" key="ClangTools.ParallelJobs">10</value>
<value type="bool" key="ClangTools.PreferConfigFile">true</value> <value type="bool" key="ClangTools.PreferConfigFile">true</value>
<valuelist type="QVariantList" key="ClangTools.SelectedDirs"/> <valuelist type="QVariantList" key="ClangTools.SelectedDirs"/>
<valuelist type="QVariantList" key="ClangTools.SelectedFiles"/> <valuelist type="QVariantList" key="ClangTools.SelectedFiles"/>
@ -108,13 +100,8 @@
<value type="qlonglong" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value> <value type="qlonglong" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0"> <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="int" key="EnableQmlDebugging">0</value> <value type="int" key="EnableQmlDebugging">0</value>
<<<<<<< Updated upstream
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">F:\MyProject\PayloadAPP\build\Desktop_Qt_6_5_3_MSVC2019_64bit-Debug</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">F:/MyProject/PayloadAPP/build/Desktop_Qt_6_5_3_MSVC2019_64bit-Debug</value>
=======
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:\QT\Custom_projects\Project_14\PayloadAPP\build\Desktop_Qt_6_5_3_MSVC2019_64bit-Debug</value> <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:\QT\Custom_projects\Project_14\PayloadAPP\build\Desktop_Qt_6_5_3_MSVC2019_64bit-Debug</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">D:/QT/Custom_projects/Project_14/PayloadAPP/build/Desktop_Qt_6_5_3_MSVC2019_64bit-Debug</value> <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">D:/QT/Custom_projects/Project_14/PayloadAPP/build/Desktop_Qt_6_5_3_MSVC2019_64bit-Debug</value>
>>>>>>> Stashed changes
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@ -127,8 +114,8 @@
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
</valuemap> </valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value> <value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">构建</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap> </valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
@ -138,8 +125,8 @@
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
</valuemap> </valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value> <value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">清除</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">清除</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap> </valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
@ -152,13 +139,8 @@
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value> <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
</valuemap> </valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1"> <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<<<<<<< Updated upstream
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">F:\MyProject\PayloadAPP\build\Desktop_Qt_6_5_3_MSVC2019_64bit-Release</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">F:/MyProject/PayloadAPP/build/Desktop_Qt_6_5_3_MSVC2019_64bit-Release</value>
=======
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:\QT\Custom_projects\Project_14\PayloadAPP\build\Desktop_Qt_6_5_3_MSVC2019_64bit-Release</value> <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:\QT\Custom_projects\Project_14\PayloadAPP\build\Desktop_Qt_6_5_3_MSVC2019_64bit-Release</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">D:/QT/Custom_projects/Project_14/PayloadAPP/build/Desktop_Qt_6_5_3_MSVC2019_64bit-Release</value> <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">D:/QT/Custom_projects/Project_14/PayloadAPP/build/Desktop_Qt_6_5_3_MSVC2019_64bit-Release</value>
>>>>>>> Stashed changes
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@ -171,8 +153,8 @@
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
</valuemap> </valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value> <value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">构建</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap> </valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
@ -182,8 +164,8 @@
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
</valuemap> </valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value> <value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">清除</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">清除</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap> </valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
@ -196,9 +178,6 @@
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="int" key="QtQuickCompiler">0</value> <value type="int" key="QtQuickCompiler">0</value>
</valuemap> </valuemap>
<<<<<<< Updated upstream
<value type="qlonglong" key="ProjectExplorer.Target.BuildConfigurationCount">2</value>
=======
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2"> <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
<value type="int" key="EnableQmlDebugging">0</value> <value type="int" key="EnableQmlDebugging">0</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:\QT\Custom_projects\Project_14\PayloadAPP\build\Desktop_Qt_6_5_3_MSVC2019_64bit-Profile</value> <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:\QT\Custom_projects\Project_14\PayloadAPP\build\Desktop_Qt_6_5_3_MSVC2019_64bit-Profile</value>
@ -410,12 +389,11 @@
<value type="int" key="SeparateDebugInfo">0</value> <value type="int" key="SeparateDebugInfo">0</value>
</valuemap> </valuemap>
<value type="qlonglong" key="ProjectExplorer.Target.BuildConfigurationCount">3</value> <value type="qlonglong" key="ProjectExplorer.Target.BuildConfigurationCount">3</value>
>>>>>>> Stashed changes
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0"> <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">0</value> <value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">部署</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Deploy</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">部署</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap> </valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value> <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
@ -435,21 +413,12 @@
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value> <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="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.DisplayName"></value>
<<<<<<< Updated upstream
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:F:/MyProject/PayloadAPP/PayloadAPP.pro</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">F:/MyProject/PayloadAPP/PayloadAPP.pro</value>
=======
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:D:/QT/Custom_projects/Project_14/PayloadAPP/PayloadAPP.pro</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:D:/QT/Custom_projects/Project_14/PayloadAPP/PayloadAPP.pro</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">D:/QT/Custom_projects/Project_14/PayloadAPP/PayloadAPP.pro</value> <value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">D:/QT/Custom_projects/Project_14/PayloadAPP/PayloadAPP.pro</value>
>>>>>>> Stashed changes
<value type="bool" key="ProjectExplorer.RunConfiguration.Customized">false</value> <value type="bool" key="ProjectExplorer.RunConfiguration.Customized">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value> <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value> <value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value> <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
<<<<<<< Updated upstream
<value type="QString" key="RunConfiguration.WorkingDirectory.default">F:/MyProject/PayloadAPP/build/Desktop_Qt_6_5_3_MSVC2019_64bit-Debug</value>
=======
>>>>>>> Stashed changes
</valuemap> </valuemap>
<value type="qlonglong" key="ProjectExplorer.Target.RunConfigurationCount">1</value> <value type="qlonglong" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap> </valuemap>

@ -18,10 +18,11 @@ GDDCdlg::GDDCdlg(QWidget *parent)
/*启动定时器*/ /*启动定时器*/
GDDCControlTimer = new QTimer(); GDDCControlTimer = new QTimer();
GDDCControlTimer->setInterval(1000);
connect(GDDCControlTimer,&QTimer::timeout,this,[=](){ connect(GDDCControlTimer,&QTimer::timeout,this,[=](){
GDDCControlTimeOut(); GDDCControlTimeOut();
}); });
GDDCControlTimer->start(100); GDDCControlTimer->start();
} }
GDDCdlg::~GDDCdlg() GDDCdlg::~GDDCdlg()
@ -30,6 +31,7 @@ GDDCdlg::~GDDCdlg()
GDDCControlTimer->stop(); GDDCControlTimer->stop();
//关闭套接字,并丢弃写缓冲区中的所有待处理数据。 //关闭套接字,并丢弃写缓冲区中的所有待处理数据。
udpSocket->abort(); udpSocket->abort();
delete udpSocket;
delete ui; delete ui;
} }
@ -51,31 +53,93 @@ void GDDCdlg::initParam()
{ {
m_DCcmdBuffer.resize(cmdLength); m_DCcmdBuffer.resize(cmdLength);
memset(TJDCCmdBuffer,0,10); memset(TJDCCmdBuffer,0,10);
/*系统控制*/
ui->comboBox_1_1->addItem("自定义模板"); ui->comboBox_1_1->addItem("自定义模板");
ui->comboBox_1_1->addItem("16*16"); ui->comboBox_1_1->addItem("16*16");
ui->comboBox_1_1->addItem("32*32"); ui->comboBox_1_1->addItem("32*32");
ui->comboBox_1_1->addItem("64*64"); ui->comboBox_1_1->addItem("64*64");
ui->comboBox_1_1->addItem("128*128"); ui->comboBox_1_1->addItem("128*128");
ui->comboBox_1_2->addItem("红外"); ui->comboBox_1_2->addItem("红外");
ui->comboBox_1_2->addItem("可见光"); ui->comboBox_1_2->addItem("可见光");
ui->comboBox_1_2->addItem("可见/红外上下分屏(暂不支持)"); ui->comboBox_1_2->addItem("可见/红外上下分屏(暂不支持)");
ui->comboBox_1_2->addItem("红外显示,可见光画中画"); ui->comboBox_1_2->addItem("红外显示,可见光画中画");
ui->comboBox_1_2->addItem("可见光显示,红外画中画"); ui->comboBox_1_2->addItem("可见光显示,红外画中画");
ui->comboBox_1_2->addItem("红外/可见光左右分屏(暂不支持)"); ui->comboBox_1_2->addItem("红外/可见光左右分屏(暂不支持)");
ui->lineEdit_1_1->setText("24");
ui->lineEdit_1_2->setText("24");
ui->lineEdit_1_3->setText("192");
ui->lineEdit_1_4->setText("168");
ui->lineEdit_1_5->setText("1");
ui->lineEdit_1_6->setText("1");
/*载荷公用*/
ui->comboBox_2_1->addItem("隐藏"); ui->comboBox_2_1->addItem("隐藏");
ui->comboBox_2_1->addItem("部分显示"); ui->comboBox_2_1->addItem("部分显示");
ui->comboBox_2_1->addItem("全部显示(默认)"); ui->comboBox_2_1->addItem("全部显示(默认)");
//ui->comboBox_2_1->addItem("OSD显示内容设置"); //ui->comboBox_2_1->addItem("OSD显示内容设置");
//ui->comboBox_2_1->addItem("OSD显示颜色和中英文设置"); //ui->comboBox_2_1->addItem("OSD显示颜色和中英文设置");
/*可见光*/
param_pushButton_3_9 = false; param_pushButton_3_9 = false;
ui->comboBox_3_1->addItem(""); ui->comboBox_3_1->addItem("");
ui->comboBox_3_1->addItem(""); ui->comboBox_3_1->addItem("");
ui->comboBox_3_1->addItem(""); ui->comboBox_3_1->addItem("");
ui->comboBox_3_1->addItem(""); ui->comboBox_3_1->addItem("");
paramDigitalZoom = 0;
ui->lineEdit_3_1->setText("4.3");
/*红外*/
ui->comboBox_4_1->addItem("循环切换");
ui->comboBox_4_1->addItem("白热");
ui->comboBox_4_1->addItem("黑热");
ui->comboBox_4_1->addItem("蓝红黄");
ui->comboBox_4_1->addItem("紫红黄");
ui->comboBox_4_1->addItem("蓝绿红");
ui->comboBox_4_1->addItem("彩虹1");
ui->comboBox_4_1->addItem("彩虹2");
ui->comboBox_4_1->addItem("黑红");
ui->comboBox_4_1->addItem("墨绿红");
ui->comboBox_4_1->addItem("蓝绿红粉");
ui->comboBox_4_1->addItem("混合色");
ui->comboBox_4_1->addItem("红头");
ui->comboBox_4_2->addItem("");
ui->comboBox_4_2->addItem("1");
ui->comboBox_4_2->addItem("2");
ui->comboBox_4_2->addItem("3");
ui->comboBox_4_2->addItem("4");
ui->comboBox_4_2->addItem("5");
ui->comboBox_4_2->addItem("6");
ui->comboBox_4_2->addItem("7");
/*稳定平台*/
ui->comboBox_5_1->addItem("非常慢");
ui->comboBox_5_1->addItem("很慢");
ui->comboBox_5_1->addItem("");
ui->comboBox_5_1->addItem("较慢");
ui->comboBox_5_1->addItem("中等");
ui->comboBox_5_1->addItem("较快");
ui->comboBox_5_1->addItem("");
ui->comboBox_5_1->addItem("很快");
ui->comboBox_5_1->addItem("非常快");
ui->radioButton_5_1->setChecked(true);
paramIsFrame = true;
ui->lineEdit_5_1->setText("100");
ui->lineEdit_5_1->setText("5");
ui->lineEdit_5_1->setText("50");
ui->lineEdit_5_1->setText("50");
/*AI检测*/
ui->comboBox_6_1->addItem("绿框目标");
ui->comboBox_6_1->addItem("下发编号目标");
ui->comboBox_6_2->addItem("红外");
ui->comboBox_6_2->addItem("可见光");
ui->comboBox_6_3->addItem("常规检测");
ui->comboBox_6_3->addItem("兴趣区域检测");
ui->comboBox_6_3->addItem("分块遍历检测");
ui->lineEdit_6_1->setText("960");
ui->lineEdit_6_2->setText("540");
detectionAreaSetting = false;
} }
//初始化udp通信 //初始化udp通信
@ -85,7 +149,7 @@ void GDDCdlg::initUDPSocket()
udpSocket = new QUdpSocket(this); udpSocket = new QUdpSocket(this);
RemoteIP = "172.10.1.183"; //目标IP RemoteIP = "172.10.1.183"; //目标IP
RemoteAddr.setAddress(RemoteIP); RemoteAddr.setAddress(RemoteIP);
RemotePort = 6002;//目标port RemotePort = 6003;//目标port
/*接收*/ /*接收*/
//获取本机ip //获取本机ip
@ -96,13 +160,113 @@ void GDDCdlg::initUDPSocket()
} }
// bool GDDCdlg::eventFilter(QObject *watched, QEvent *event)
// {
// qDebug() << this->geometry().x();
// qDebug() << this->geometry().y();
// QPoint sPoint2=QCursor::pos();
// qDebug()<<"相对于屏幕坐标2:"<<"("<<sPoint2.rx()<<","<<sPoint2.ry()<<")";
// QPoint windowPoint=this->mapFromGlobal(sPoint2);
// qDebug()<<"相对于窗口坐标:"<<"("<<windowPoint.rx()<<","<<windowPoint.ry()<<")";
// return true;
// }
//鼠标左键
void GDDCdlg::mousePressEvent(QMouseEvent *event)
{
//如果鼠标左键按下
if (event->type() == QEvent::MouseButtonPress) {
//获取鼠标在事件接收者中的位置pos
//qDebug() << event->pos();
///获取控件X Y坐标
//textX = ui->labelImage->x();
//textY = ui->labelImage->y();
//AI检测区域设置
if(detectionAreaSetting==true)
{
QPointF sPoint1 = event->globalPosition();
sPoint1 = QCursor::pos();
QPointF widgetPoint = ui->label_ViewAea->mapFromGlobal(sPoint1);
double a = ui->label_ViewAea->width();
double b = ui->label_ViewAea->height();
double dir = 1920/a*widgetPoint.rx();
double pitch = 1080/b*widgetPoint.ry();
ui->lineEdit_6_1->setText(QString::number((int)dir));
ui->lineEdit_6_2->setText(QString::number((int)pitch));
}
//目标跟踪
if(pointSelectionTracking == true)
{
QPointF sPoint1 = event->globalPosition();
QPointF widgetPoint = ui->label_ViewAea->mapFromGlobal(sPoint1);
double a = ui->label_ViewAea->width();
double b = ui->label_ViewAea->height();
double dir = 1920/a*widgetPoint.rx();
double pitch = 1080/b*widgetPoint.ry();
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);
//发送5次
sendCurDate(buffer,5);
}
}
}
//鼠标移动
void GDDCdlg::mouseMoveEvent(QMouseEvent *event)
{
if(detectionAreaSetting==true)
{
qDebug() << this->geometry().x();
qDebug() << this->geometry().y();
QPoint sPoint1=event->globalPos();
//qDebug()<<"相对于屏幕坐标1:"<<"("<<sPoint1.rx()<<","<<sPoint1.ry()<<")";
QPoint sPoint2=QCursor::pos();
//qDebug()<<"相对于屏幕坐标2:"<<"("<<sPoint2.rx()<<","<<sPoint2.ry()<<")";
QPoint windowPoint=this->mapFromGlobal(sPoint2);
//qDebug()<<"相对于窗口坐标:"<<"("<<windowPoint.rx()<<","<<windowPoint.ry()<<")";
QPoint widgetPoint=ui->label_ViewAea->mapFromGlobal(sPoint1);
//qDebug()<<"相对于控件坐标:"<<"("<<widgetPoint.rx()<<","<<widgetPoint.ry()<<")";
//更新LineEdit信息
double a = ui->label_ViewAea->width();
double b = ui->label_ViewAea->height();
double dir = 1920/a*widgetPoint.rx();
double pitch = 1080/b*widgetPoint.ry();
ui->lineEdit_6_1->setText(QString::number((int)dir));
ui->lineEdit_6_2->setText(QString::number((int)pitch));
}
}
//定时器处理 //定时器处理
void GDDCdlg::GDDCControlTimeOut() void GDDCdlg::GDDCControlTimeOut()
{ {
UpdateDataTJDC(); if(sendTimes>0)
//qDebug()<<"Enter timeout processing function\n"; {
//发出数据包 sendTimes-=1;
udpSocket->writeDatagram(m_DCcmdBuffer,RemoteAddr,RemotePort); udpSocket->writeDatagram(m_DCcmdBuffer,RemoteAddr,RemotePort);
if(sendTimes==0)
{
clearTJDCCmdBuffer();
}
}
else
{
UpdateDataTJDC();
udpSocket->writeDatagram(m_DCcmdBuffer,RemoteAddr,RemotePort);
}
} }
@ -121,11 +285,9 @@ void GDDCdlg::UpdateDataTJDC()
{ {
m_DCcmdBuffer[i] = 0x00; m_DCcmdBuffer[i] = 0x00;
} }
/*精确到毫秒级*/ /*精确到毫秒级*/
QDateTime st = QDateTime::currentDateTime();//获取系统当前的时间 QDateTime st = QDateTime::currentDateTime();//获取系统当前的时间
QString formattedDateTime = st.toString("yyyy-MM-dd hh:mm:ss"); QString formattedDateTime = st.toString("yyyy-MM-dd hh:mm:ss");
m_DCcmdBuffer[37] = (char)TJDCCmdBuffer[5]; m_DCcmdBuffer[37] = (char)TJDCCmdBuffer[5];
m_DCcmdBuffer[38] = (char)TJDCCmdBuffer[6]; m_DCcmdBuffer[38] = (char)TJDCCmdBuffer[6];
m_DCcmdBuffer[39] = (char)TJDCCmdBuffer[7]; m_DCcmdBuffer[39] = (char)TJDCCmdBuffer[7];
@ -152,6 +314,18 @@ void GDDCdlg::clearTJDCCmdBuffer()
memset(TJDCCmdBuffer,0,sizeof(TJDCCmdBuffer)); memset(TJDCCmdBuffer,0,sizeof(TJDCCmdBuffer));
} }
//设置发送数据和次数
void GDDCdlg::sendCurDate(std::byte *buffer, int num)
{
sendTimes = num;
for(int i=0;i<10;++i)
{
TJDCCmdBuffer[i] = buffer[i];
}
UpdateDataTJDC();
}
//拍一张照 按下 //拍一张照 按下
void GDDCdlg::on_pushButton_11_pressed() void GDDCdlg::on_pushButton_11_pressed()
{ {
@ -182,8 +356,10 @@ void GDDCdlg::on_pushButton_1_2_pressed()
uint str = ui->lineEdit_1_1->text().toUInt(); uint str = ui->lineEdit_1_1->text().toUInt();
uint str2 = ui->lineEdit_1_2->text().toUInt(); uint str2 = ui->lineEdit_1_2->text().toUInt();
TJDCCmdBuffer[0]=(std::byte)0x23; TJDCCmdBuffer[0]=(std::byte)0x23;
TJDCCmdBuffer[2]=(std::byte)str; TJDCCmdBuffer[1]=(std::byte)0x00;
TJDCCmdBuffer[3]=(std::byte)str2; TJDCCmdBuffer[2]=(std::byte)0x00;
TJDCCmdBuffer[3]=(std::byte)str;
TJDCCmdBuffer[4]=(std::byte)str2;
} }
else else
{ {
@ -210,10 +386,15 @@ void GDDCdlg::on_pushButton_1_3_released()
//吊舱IP设置 //吊舱IP设置
void GDDCdlg::on_pushButton_1_4_pressed() void GDDCdlg::on_pushButton_1_4_pressed()
{ {
int ip = ui->lineEdit_1_3->text().toInt(); uint ip1 = ui->lineEdit_1_3->text().toUInt();
uint ip2 = ui->lineEdit_1_4->text().toUInt();
uint ip3 = ui->lineEdit_1_5->text().toUInt();
uint ip4 = ui->lineEdit_1_6->text().toUInt();
TJDCCmdBuffer[0]=(std::byte)0x29; TJDCCmdBuffer[0]=(std::byte)0x29;
TJDCCmdBuffer[1]=(std::byte)ip; TJDCCmdBuffer[1]=(std::byte)ip1;
TJDCCmdBuffer[2]=(std::byte)ip2;
TJDCCmdBuffer[3]=(std::byte)ip3;
TJDCCmdBuffer[4]=(std::byte)ip4;
} }
void GDDCdlg::on_pushButton_1_4_released() void GDDCdlg::on_pushButton_1_4_released()
{ {
@ -266,7 +447,7 @@ void GDDCdlg::on_pushButton_2_4_released()
//选点跟踪 //选点跟踪
void GDDCdlg::on_pushButton_2_5_pressed() void GDDCdlg::on_pushButton_2_5_pressed()
{ {
pointSelectionTracking = true;
} }
void GDDCdlg::on_pushButton_2_5_released() void GDDCdlg::on_pushButton_2_5_released()
{ {
@ -652,52 +833,591 @@ void GDDCdlg::on_pushButton_3_25_released()
clearTJDCCmdBuffer(); clearTJDCCmdBuffer();
} }
// //停止连续测距 //调焦+
// void GDDCdlg::on_pushButton_4_1_pressed() void GDDCdlg::on_pushButton_4_1_pressed()
// { {
// TJDCCmdBuffer[0]=(std::byte)0x3F; TJDCCmdBuffer[0]=(std::byte)0x50;
// } TJDCCmdBuffer[1]=(std::byte)0x01;
// void GDDCdlg::on_pushButton_4_1_released() }
// { void GDDCdlg::on_pushButton_4_1_released()
// clearTJDCCmdBuffer(); {
// } clearTJDCCmdBuffer();
}
// //停止连续测距 //调焦-
// void GDDCdlg::on_pushButton_4_2_pressed() void GDDCdlg::on_pushButton_4_2_pressed()
// { {
// TJDCCmdBuffer[0]=(std::byte)0x3D; TJDCCmdBuffer[0]=(std::byte)0x50;
// } TJDCCmdBuffer[1]=(std::byte)0x02;
// void GDDCdlg::on_pushButton_4_2_released() }
// { void GDDCdlg::on_pushButton_4_2_released()
// clearTJDCCmdBuffer(); {
// } clearTJDCCmdBuffer();
}
// //停止连续测距 //自动对焦测
// void GDDCdlg::on_pushButton_4_3_pressed() void GDDCdlg::on_pushButton_4_3_pressed()
// { {
// TJDCCmdBuffer[0]=(std::byte)0x3F; TJDCCmdBuffer[0]=(std::byte)0x50;
// } TJDCCmdBuffer[1]=(std::byte)0x03;
// void GDDCdlg::on_pushButton_4_4_released() }
// { void GDDCdlg::on_pushButton_4_3_released()
// clearTJDCCmdBuffer(); {
// } clearTJDCCmdBuffer();
}
// //停止连续测距 //测温模式
// void GDDCdlg::on_pushButton_4_5_pressed() void GDDCdlg::on_pushButton_4_4_pressed()
// { {
// TJDCCmdBuffer[0]=(std::byte)0x3F; TJDCCmdBuffer[0]=(std::byte)0x51;
// } TJDCCmdBuffer[1]=(std::byte)0x01;
// void GDDCdlg::on_pushButton_4_5_released() }
// { void GDDCdlg::on_pushButton_4_4_released()
// clearTJDCCmdBuffer(); {
// } clearTJDCCmdBuffer();
}
//变倍+
void GDDCdlg::on_pushButton_4_5_pressed()
{
TJDCCmdBuffer[0]=(std::byte)0x50;
TJDCCmdBuffer[1]=(std::byte)0x0F;
}
void GDDCdlg::on_pushButton_4_5_released()
{
clearTJDCCmdBuffer();
}
//变倍-
void GDDCdlg::on_pushButton_4_6_pressed()
{
TJDCCmdBuffer[0]=(std::byte)0x50;
TJDCCmdBuffer[1]=(std::byte)0x10;
}
void GDDCdlg::on_pushButton_4_6_released()
{
clearTJDCCmdBuffer();
}
//电子放大
void GDDCdlg::on_pushButton_4_7_pressed()
{
paramDigitalZoom+=1;
if(paramDigitalZoom == 5)
paramDigitalZoom = 0;
TJDCCmdBuffer[0]=(std::byte)0x54;
TJDCCmdBuffer[1]=(std::byte)paramDigitalZoom;
}
void GDDCdlg::on_pushButton_4_7_released()
{
clearTJDCCmdBuffer();
}
//观测模式
void GDDCdlg::on_pushButton_4_8_pressed()
{
TJDCCmdBuffer[0]=(std::byte)0x51;
TJDCCmdBuffer[1]=(std::byte)0x02;
}
void GDDCdlg::on_pushButton_4_8_released()
{
clearTJDCCmdBuffer();
}
//亮度+
void GDDCdlg::on_pushButton_4_9_pressed()
{
TJDCCmdBuffer[0]=(std::byte)0x59;
}
void GDDCdlg::on_pushButton_4_9_released()
{
clearTJDCCmdBuffer();
}
//亮度-
void GDDCdlg::on_pushButton_4_10_pressed()
{
TJDCCmdBuffer[0]=(std::byte)0x59;
TJDCCmdBuffer[1]=(std::byte)0x01;
}
void GDDCdlg::on_pushButton_4_10_released()
{
clearTJDCCmdBuffer();
}
//场景补偿
void GDDCdlg::on_pushButton_4_11_pressed()
{
TJDCCmdBuffer[0]=(std::byte)0x55;
}
void GDDCdlg::on_pushButton_4_11_released()
{
clearTJDCCmdBuffer();
}
//恢复默认设置
void GDDCdlg::on_pushButton_4_12_pressed()
{
TJDCCmdBuffer[0]=(std::byte)0x58;
TJDCCmdBuffer[1]=(std::byte)0x02;
}
void GDDCdlg::on_pushButton_4_12_released()
{
clearTJDCCmdBuffer();
}
//对比度+
void GDDCdlg::on_pushButton_4_13_pressed()
{
TJDCCmdBuffer[0]=(std::byte)0x5A;
}
void GDDCdlg::on_pushButton_4_13_released()
{
clearTJDCCmdBuffer();
}
//对比度-
void GDDCdlg::on_pushButton_4_14_pressed()
{
TJDCCmdBuffer[0]=(std::byte)0x5A;
TJDCCmdBuffer[1]=(std::byte)0x01;
}
void GDDCdlg::on_pushButton_4_14_released()
{
clearTJDCCmdBuffer();
}
//红外快门补偿
void GDDCdlg::on_pushButton_4_15_pressed()
{
TJDCCmdBuffer[0]=(std::byte)0x56;
TJDCCmdBuffer[1]=(std::byte)0x00;
}
void GDDCdlg::on_pushButton_4_15_released()
{
clearTJDCCmdBuffer();
}
//恢复出厂设置
void GDDCdlg::on_pushButton_4_16_pressed()
{
TJDCCmdBuffer[0]=(std::byte)0x58;
TJDCCmdBuffer[1]=(std::byte)0x01;
}
void GDDCdlg::on_pushButton_4_16_released()
{
clearTJDCCmdBuffer();
}
//伪色彩切换
void GDDCdlg::on_pushButton_4_17_pressed()
{
int sel = ui->comboBox_4_1->currentIndex();
if(sel==0)
{
TJDCCmdBuffer[0]=(std::byte)0x53;
TJDCCmdBuffer[1]=(std::byte)0x00;
TJDCCmdBuffer[2]=(std::byte)0x00;
}
else
{
TJDCCmdBuffer[0]=(std::byte)0x58;
TJDCCmdBuffer[1]=(std::byte)0x01;
TJDCCmdBuffer[2]=(std::byte)(sel-1);
}
}
void GDDCdlg::on_pushButton_4_17_released()
{
clearTJDCCmdBuffer();
}
//图像增强
void GDDCdlg::on_pushButton_4_18_pressed()
{
int sel = ui->comboBox_4_2->currentIndex();
TJDCCmdBuffer[0]=(std::byte)0x57;
TJDCCmdBuffer[1]=(std::byte)0x01;
TJDCCmdBuffer[2]=(std::byte)(sel);
}
void GDDCdlg::on_pushButton_4_18_released()
{
clearTJDCCmdBuffer();
}
//俯仰+
void GDDCdlg::on_pushButton_5_1_pressed()
{
if(paramIsFrame)
{
int sel = ui->comboBox_5_1->currentIndex();
sel+=1;
TJDCCmdBuffer[5]=(std::byte)0x70;
TJDCCmdBuffer[6]=(std::byte)0x00;
TJDCCmdBuffer[7]=(std::byte)0x00;
TJDCCmdBuffer[8]=(std::byte)(sel*3);
TJDCCmdBuffer[9]=(std::byte)((sel*3)>>8);
}
else
{
TJDCCmdBuffer[0]=(std::byte)0x76;
TJDCCmdBuffer[1]=(std::byte)0x03;
TJDCCmdBuffer[2]=(std::byte)0x00;
TJDCCmdBuffer[3]=(std::byte)0x01;
TJDCCmdBuffer[4]=(std::byte)0x00;
}
}
// //停止连续测距 void GDDCdlg::on_pushButton_5_1_released()
// void GDDCdlg::on_pushButton_4_6_pressed() {
clearTJDCCmdBuffer();
}
//方位+
void GDDCdlg::on_pushButton_5_2_pressed()
{
if(paramIsFrame)
{
int sel = ui->comboBox_5_1->currentIndex();
sel+=1;
TJDCCmdBuffer[5]=(std::byte)0x70;
TJDCCmdBuffer[6]=(std::byte)(sel*3);
TJDCCmdBuffer[7]=(std::byte)((sel*3)>>8);
TJDCCmdBuffer[8]=(std::byte)0x00;
TJDCCmdBuffer[9]=(std::byte)0x00;
}
else
{
TJDCCmdBuffer[0]=(std::byte)0x76;
TJDCCmdBuffer[1]=(std::byte)0x03;
TJDCCmdBuffer[2]=(std::byte)0xFF;
TJDCCmdBuffer[3]=(std::byte)0x00;
TJDCCmdBuffer[4]=(std::byte)0x00;
}
}
void GDDCdlg::on_pushButton_5_2_released()
{
clearTJDCCmdBuffer();
}
//俯仰-
void GDDCdlg::on_pushButton_5_3_pressed()
{
if(paramIsFrame)
{
int sel = ui->comboBox_5_1->currentIndex();
sel+=1;
TJDCCmdBuffer[5]=(std::byte)0x70;
TJDCCmdBuffer[6]=(std::byte)0x00;
TJDCCmdBuffer[7]=(std::byte)0x00;
TJDCCmdBuffer[8]=(std::byte)(-sel*3);
TJDCCmdBuffer[9]=(std::byte)((-sel*3)>>8);
}
else
{
TJDCCmdBuffer[0]=(std::byte)0x76;
TJDCCmdBuffer[1]=(std::byte)0x03;
TJDCCmdBuffer[2]=(std::byte)0x00;
TJDCCmdBuffer[3]=(std::byte)0xFF;
TJDCCmdBuffer[4]=(std::byte)0x00;
}
}
void GDDCdlg::on_pushButton_5_3_released()
{
clearTJDCCmdBuffer();
}
//方位-
void GDDCdlg::on_pushButton_5_4_pressed()
{
if(paramIsFrame)
{
int sel = ui->comboBox_5_1->currentIndex();
sel+=1;
TJDCCmdBuffer[5]=(std::byte)0x70;
TJDCCmdBuffer[6]=(std::byte)(-sel*3);
TJDCCmdBuffer[7]=(std::byte)((-sel*3)>>8);
TJDCCmdBuffer[8]=(std::byte)0x00;
TJDCCmdBuffer[9]=(std::byte)0x00;
}
else
{
TJDCCmdBuffer[0]=(std::byte)0x76;
TJDCCmdBuffer[1]=(std::byte)0x03;
TJDCCmdBuffer[2]=(std::byte)0x01;
TJDCCmdBuffer[3]=(std::byte)0x00;
TJDCCmdBuffer[4]=(std::byte)0x00;
}
}
void GDDCdlg::on_pushButton_5_4_released()
{
clearTJDCCmdBuffer();
}
//归中/陀螺校准
void GDDCdlg::on_pushButton_5_5_pressed()
{
if(paramIsFrame)
{
TJDCCmdBuffer[0]=(std::byte)0x71;
}
else
{
TJDCCmdBuffer[0]=(std::byte)0x76;
TJDCCmdBuffer[1]=(std::byte)0x01;
}
}
void GDDCdlg::on_pushButton_5_5_released()
{
clearTJDCCmdBuffer();
}
//垂直下视
void GDDCdlg::on_pushButton_5_6_pressed()
{
TJDCCmdBuffer[0]=(std::byte)0x73;
}
void GDDCdlg::on_pushButton_5_6_released()
{
clearTJDCCmdBuffer();
}
//收藏模式
void GDDCdlg::on_pushButton_5_7_pressed()
{
TJDCCmdBuffer[0]=(std::byte)0x74;
}
void GDDCdlg::on_pushButton_5_7_released()
{
clearTJDCCmdBuffer();
}
//关伺服
void GDDCdlg::on_pushButton_5_8_pressed()
{
TJDCCmdBuffer[0]=(std::byte)0x75;
}
void GDDCdlg::on_pushButton_5_8_released()
{
clearTJDCCmdBuffer();
}
//方位弱随动机头 航向随动
void GDDCdlg::on_pushButton_5_9_pressed()
{
TJDCCmdBuffer[0]=(std::byte)0x7B;
}
void GDDCdlg::on_pushButton_5_9_released()
{
clearTJDCCmdBuffer();
}
// //
// void GDDCdlg::on_pushButton_5_10_pressed()
// { // {
// TJDCCmdBuffer[0]=(std::byte)0x3F; // TJDCCmdBuffer[0]=(std::byte)0x00;
// } // }
// void GDDCdlg::on_pushButton_4_6_released() // void GDDCdlg::on_pushButton_5_10_released()
// { // {
// clearTJDCCmdBuffer(); // clearTJDCCmdBuffer();
// } // }
//航向锁定
void GDDCdlg::on_pushButton_5_11_pressed()
{
TJDCCmdBuffer[0]=(std::byte)0x7A;
}
void GDDCdlg::on_pushButton_5_11_released()
{
clearTJDCCmdBuffer();
}
//扫描设置
void GDDCdlg::on_pushButton_5_12_pressed()
{
int angle = ui->lineEdit_5_1->text().toInt();
int speed = ui->lineEdit_5_2->text().toInt();
TJDCCmdBuffer[0]=(std::byte)0x77;
TJDCCmdBuffer[1]=(std::byte)angle;
TJDCCmdBuffer[2]=(std::byte)(angle>>8);
TJDCCmdBuffer[3]=(std::byte)speed;
TJDCCmdBuffer[4]=(std::byte)(speed>>8);
}
void GDDCdlg::on_pushButton_5_12_released()
{
clearTJDCCmdBuffer();
}
//执行扫描
void GDDCdlg::on_pushButton_5_13_pressed()
{
TJDCCmdBuffer[0]=(std::byte)0x79;
}
void GDDCdlg::on_pushButton_5_13_released()
{
clearTJDCCmdBuffer();
}
//姿态指引
void GDDCdlg::on_pushButton_5_14_pressed()
{
double Dir = ui->lineEdit_5_3->text().toDouble();
double Pitch = ui->lineEdit_5_4->text().toDouble();
int dir = Dir*100;
int pitch = Pitch*100;
TJDCCmdBuffer[0]=(std::byte)0x7C;
TJDCCmdBuffer[1]=(std::byte)dir;
TJDCCmdBuffer[2]=(std::byte)(dir>>8);
TJDCCmdBuffer[3]=(std::byte)pitch;
TJDCCmdBuffer[4]=(std::byte)(pitch>>8);
}
void GDDCdlg::on_pushButton_5_14_released()
{
clearTJDCCmdBuffer();
}
//数字指引
void GDDCdlg::on_pushButton_5_15_pressed()
{
double Dir = ui->lineEdit_5_3->text().toDouble();
double Pitch = ui->lineEdit_5_4->text().toDouble();
int dir = Dir*100;
int pitch = Pitch*100;
TJDCCmdBuffer[0]=(std::byte)0x72;
TJDCCmdBuffer[1]=(std::byte)dir;
TJDCCmdBuffer[2]=(std::byte)(dir>>8);
TJDCCmdBuffer[3]=(std::byte)pitch;
TJDCCmdBuffer[4]=(std::byte)(pitch>>8);
}
void GDDCdlg::on_pushButton_5_15_released()
{
clearTJDCCmdBuffer();
}
//框架
void GDDCdlg::on_radioButton_5_1_clicked()
{
paramIsFrame = true;
ui->pushButton_5_5->setText("归中");
}
//陀螺
void GDDCdlg::on_radioButton_5_2_clicked()
{
paramIsFrame = false;
ui->pushButton_5_5->setText("自动校准");
}
//AI开
void GDDCdlg::on_pushButton_6_1_pressed()
{
TJDCCmdBuffer[0]=(std::byte)0x91;
TJDCCmdBuffer[1]=(std::byte)0x01;
}
void GDDCdlg::on_pushButton_6_1_released()
{
clearTJDCCmdBuffer();
}
//AI关
void GDDCdlg::on_pushButton_6_2_pressed()
{
TJDCCmdBuffer[0]=(std::byte)0x91;
TJDCCmdBuffer[1]=(std::byte)0x00;
}
void GDDCdlg::on_pushButton_6_2_released()
{
clearTJDCCmdBuffer();
}
//AI框显示
void GDDCdlg::on_pushButton_6_3_pressed()
{
TJDCCmdBuffer[0]=(std::byte)0x94;
TJDCCmdBuffer[1]=(std::byte)0x01;
}
void GDDCdlg::on_pushButton_6_3_released()
{
clearTJDCCmdBuffer();
}
//AI框隐藏
void GDDCdlg::on_pushButton_6_4_pressed()
{
TJDCCmdBuffer[0]=(std::byte)0x94;
TJDCCmdBuffer[1]=(std::byte)0x00;
}
void GDDCdlg::on_pushButton_6_4_released()
{
clearTJDCCmdBuffer();
}
//AI跟踪
void GDDCdlg::on_pushButton_6_5_pressed()
{
int sel = ui->comboBox_6_1->currentIndex();
if(sel == 0)
{
TJDCCmdBuffer[0]=(std::byte)0x93;
TJDCCmdBuffer[1]=(std::byte)0x00;
}
if(sel == 1)
{
int value = ui->spinBox_6_1->value();
TJDCCmdBuffer[0]=(std::byte)0x93;
TJDCCmdBuffer[1]=(std::byte)0x01;
TJDCCmdBuffer[2]=(std::byte)value;
}
}
void GDDCdlg::on_pushButton_6_5_released()
{
clearTJDCCmdBuffer();
}
//目标检测方式
void GDDCdlg::on_pushButton_6_6_pressed()
{
int sel = ui->comboBox_6_2->currentIndex();
int sel2 = ui->comboBox_6_3->currentIndex();
TJDCCmdBuffer[0]=(std::byte)0x9A;
TJDCCmdBuffer[1]=(std::byte)sel;
TJDCCmdBuffer[2]=(std::byte)sel2;
}
void GDDCdlg::on_pushButton_6_6_released()
{
clearTJDCCmdBuffer();
}
//检测兴趣区域位置设置
void GDDCdlg::on_pushButton_6_7_pressed()
{
int Direction = ui->lineEdit_6_1->text().toInt();
int Pitch = ui->lineEdit_6_2->text().toInt();
TJDCCmdBuffer[0]=(std::byte)0x93;
TJDCCmdBuffer[1]=(std::byte)Direction;
TJDCCmdBuffer[2]=(std::byte)Direction>>8;
TJDCCmdBuffer[3]=(std::byte)Pitch;
TJDCCmdBuffer[4]=(std::byte)Pitch>>8;
detectionAreaSetting = false;
}
void GDDCdlg::on_pushButton_6_7_released()
{
clearTJDCCmdBuffer();
}
//像素选取
void GDDCdlg::on_pushButton_6_8_clicked()
{
if(detectionAreaSetting == false)
{
detectionAreaSetting = true;
ui->pushButton_6_8->setDown(true);
}
else
{
detectionAreaSetting = false;
ui->pushButton_6_8->setDown(false);
}
}

@ -7,7 +7,7 @@
#include <QNetworkDatagram> #include <QNetworkDatagram>
#include <QByteArray> #include <QByteArray>
#include <QTimer> #include <QTimer>
#include <QMouseEvent>
#define cmdLength 44 #define cmdLength 44
namespace Ui { namespace Ui {
@ -21,9 +21,41 @@ class GDDCdlg : public QWidget
public: public:
explicit GDDCdlg(QWidget *parent = nullptr); explicit GDDCdlg(QWidget *parent = nullptr);
~GDDCdlg(); ~GDDCdlg();
private:
Ui::GDDCdlg *ui;
QTimer *GDDCControlTimer;
public slots:
void GDDCControlTimeOut();
public: public:
QByteArray m_DCcmdBuffer;//存储吊舱控制指令
std::byte TJDCCmdBuffer[10];
void UpdateDataTJDC();
void clearTJDCCmdBuffer();
int sendTimes;//计划发送次数
void sendCurDate(std::byte *,int);//发送当前数据:内容,发送次数
//socket对象
QUdpSocket *udpSocket;
QString RemoteIP; //目标IP
QHostAddress RemoteAddr; //目标地址
quint16 RemotePort; //目标port
//初始化UDPSocket
void initUDPSocket();
void initWindow();//初始化窗口
void initParam();//初始化参数
//bool eventFilter(QObject *,QEvent *); //事件过滤器
void mousePressEvent(QMouseEvent *event); //事件过滤器
void mouseMoveEvent(QMouseEvent *event); //事件过滤器
public:
bool pointSelectionTracking = false; //选点跟踪
bool param_pushButton_3_9; bool param_pushButton_3_9;
int paramDigitalZoom;//电子放大参数
bool paramIsFrame; //是否是框架/陀螺校准
bool detectionAreaSetting;//检测区域设置
private slots: private slots:
/*系统控制*/ /*系统控制*/
void on_pushButton_11_pressed(); void on_pushButton_11_pressed();
@ -113,40 +145,94 @@ private slots:
void on_pushButton_3_25_pressed(); void on_pushButton_3_25_pressed();
void on_pushButton_3_25_released(); void on_pushButton_3_25_released();
/*红外*/ /*红外*/
// void on_pushButton_4_1_pressed(); void on_pushButton_4_1_pressed();
// void on_pushButton_4_1_released(); void on_pushButton_4_1_released();
// void on_pushButton_4_2_pressed(); void on_pushButton_4_2_pressed();
// void on_pushButton_4_2_released(); void on_pushButton_4_2_released();
// void on_pushButton_4_3_pressed(); void on_pushButton_4_3_pressed();
// void on_pushButton_4_3_released(); void on_pushButton_4_3_released();
// void on_pushButton_4_4_pressed(); void on_pushButton_4_4_pressed();
// void on_pushButton_4_4_released(); void on_pushButton_4_4_released();
// void on_pushButton_4_5_pressed(); void on_pushButton_4_5_pressed();
// void on_pushButton_4_5_released(); void on_pushButton_4_5_released();
// void on_pushButton_4_6_pressed(); void on_pushButton_4_6_pressed();
// void on_pushButton_4_6_released(); void on_pushButton_4_6_released();
private: void on_pushButton_4_7_pressed();
Ui::GDDCdlg *ui; void on_pushButton_4_7_released();
QTimer *GDDCControlTimer; void on_pushButton_4_8_pressed();
public slots: void on_pushButton_4_8_released();
void GDDCControlTimeOut(); void on_pushButton_4_9_pressed();
void on_pushButton_4_9_released();
void on_pushButton_4_10_pressed();
void on_pushButton_4_10_released();
void on_pushButton_4_11_pressed();
void on_pushButton_4_11_released();
void on_pushButton_4_12_pressed();
void on_pushButton_4_12_released();
void on_pushButton_4_13_pressed();
void on_pushButton_4_13_released();
void on_pushButton_4_14_pressed();
void on_pushButton_4_14_released();
void on_pushButton_4_15_pressed();
void on_pushButton_4_15_released();
void on_pushButton_4_16_pressed();
void on_pushButton_4_16_released();
void on_pushButton_4_17_pressed();
void on_pushButton_4_17_released();
void on_pushButton_4_18_pressed();
void on_pushButton_4_18_released();
/*云台控制*/
void on_pushButton_5_1_pressed();
void on_pushButton_5_1_released();
void on_pushButton_5_2_pressed();
void on_pushButton_5_2_released();
void on_pushButton_5_3_pressed();
void on_pushButton_5_3_released();
void on_pushButton_5_4_pressed();
void on_pushButton_5_4_released();
void on_pushButton_5_5_pressed();
void on_pushButton_5_5_released();
void on_pushButton_5_6_pressed();
void on_pushButton_5_6_released();
void on_pushButton_5_7_pressed();
void on_pushButton_5_7_released();
void on_pushButton_5_8_pressed();
void on_pushButton_5_8_released();
void on_pushButton_5_9_pressed();
void on_pushButton_5_9_released();
// void on_pushButton_5_10_pressed();
// void on_pushButton_5_10_released();
void on_pushButton_5_11_pressed();
void on_pushButton_5_11_released();
void on_pushButton_5_12_pressed();
void on_pushButton_5_12_released();
void on_pushButton_5_13_pressed();
void on_pushButton_5_13_released();
void on_pushButton_5_14_pressed();
void on_pushButton_5_14_released();
void on_pushButton_5_15_pressed();
void on_pushButton_5_15_released();
public: void on_radioButton_5_1_clicked();
QByteArray m_DCcmdBuffer;//存储吊舱控制指令 void on_radioButton_5_2_clicked();
std::byte TJDCCmdBuffer[10];
void UpdateDataTJDC();
void clearTJDCCmdBuffer();
//socket对象
QUdpSocket *udpSocket;
QString RemoteIP; //目标IP
QHostAddress RemoteAddr; //目标地址
quint16 RemotePort; //目标port
//初始化UDPSocket /*AI检测*/
void initUDPSocket(); void on_pushButton_6_1_pressed();
void initWindow();//初始化窗口 void on_pushButton_6_1_released();
void initParam();//初始化参数 void on_pushButton_6_2_pressed();
void on_pushButton_6_2_released();
void on_pushButton_6_3_pressed();
void on_pushButton_6_3_released();
void on_pushButton_6_4_pressed();
void on_pushButton_6_4_released();
void on_pushButton_6_5_pressed();
void on_pushButton_6_5_released();
void on_pushButton_6_6_pressed();
void on_pushButton_6_6_released();
void on_pushButton_6_7_pressed();
void on_pushButton_6_7_released();
void on_pushButton_6_8_clicked();
}; };
#endif // GDDCDLG_H #endif // GDDCDLG_H

File diff suppressed because it is too large Load Diff

@ -74,7 +74,7 @@ QTabWidget::pane {
/*当打开多个tab右侧出现点击后可以向前向后的按钮的样式*/ /*当打开多个tab右侧出现点击后可以向前向后的按钮的样式*/
QTabBar QToolButton { QTabBar QToolButton {
border: none; border: none;
color: rgb(255, 206, 6); color: rgb(255, 206, 6);
background-color: #0b0e11; background-color: #0b0e11;
} }
@ -90,3 +90,9 @@ QLabel{
font-size:11pt; font-size:11pt;
} }
QComboBox{
color: rgb(0, 0, 0);
background-color: rgb(250, 250, 250);
border-color:rgb(255, 255, 255);/*边框颜色*/
font-size:11pt;
}

Loading…
Cancel
Save