From c28e6ec8b716081a9eae7c8f9d2605c886fa840b Mon Sep 17 00:00:00 2001 From: cbwu <504-wuchengbo@htsdfp.com> Date: Fri, 20 Sep 2024 09:22:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ExportQBGISCtrlClass.cpp | 9 ++++++ ExportQBGISCtrlClass.h | 3 ++ GISControlDlg.def | 3 +- GISDlg.cpp | 60 +++++++++++++++++++++------------------- GISDlg.h | 2 ++ Globe.cpp | 5 +++- Globe.h | 2 ++ 7 files changed, 54 insertions(+), 30 deletions(-) diff --git a/ExportQBGISCtrlClass.cpp b/ExportQBGISCtrlClass.cpp index 7631ca4..6960ef8 100644 --- a/ExportQBGISCtrlClass.cpp +++ b/ExportQBGISCtrlClass.cpp @@ -436,4 +436,13 @@ extern "C" void WINAPI SetBindLine14Coordinate(int uavID,double lon,double lat) { g_mapShowDlg.SetBindLine14Coordinate(uavID,lon,lat); } +} + +//获取地图版本号 +extern "C" CString WINAPI GetMapVersion() { + AFX_MANAGE_STATE(AfxGetAppModuleState()); + if (g_bCreateMap) + { + return g_mapShowDlg.GetMapVersion(); + } } \ No newline at end of file diff --git a/ExportQBGISCtrlClass.h b/ExportQBGISCtrlClass.h index aff09b1..5e8e90d 100644 --- a/ExportQBGISCtrlClass.h +++ b/ExportQBGISCtrlClass.h @@ -119,4 +119,7 @@ extern "C" _declspec(dllexport) void ShowLine14Ex(int uavID,double uavLon,double //输入:飞机ID,自主着陆点经纬度 extern "C" _declspec(dllexport) void SetBindLine14Coordinate(int uavID,double lon,double lat); +//获取地图版本号 +extern "C" _declspec(dllexport) CString GetMapVersion(); + //#endif \ No newline at end of file diff --git a/GISControlDlg.def b/GISControlDlg.def index 13d0248..4740923 100644 --- a/GISControlDlg.def +++ b/GISControlDlg.def @@ -38,4 +38,5 @@ EXPORTS ZoomToLocation @31 OnShowTargetPoint @32 ShowLine14Ex @33 - SetBindLine14Coordinate @34 \ No newline at end of file + SetBindLine14Coordinate @34 + GetMapVersion @35 \ No newline at end of file diff --git a/GISDlg.cpp b/GISDlg.cpp index 51cb1ef..67b59b4 100644 --- a/GISDlg.cpp +++ b/GISDlg.cpp @@ -1393,9 +1393,9 @@ void CGISDlg::OnShowRMenu() { pSubMenu->CheckMenuItem( ID_SHOW_BACKLINE, MF_BYCOMMAND | MF_UNCHECKED ); }*/ - if (g_b981AMulti && m_line14FlyID >=0) + if (g_b981AMulti && m_line14FlyID >0) { - if (m_pHaveDrawCopyLineFlag[13][m_line14FlyID]) + if (m_pHaveDrawCopyLineFlag[13][m_line14FlyID-1]) { menu.CheckMenuItem( ID_SHOW_BACKLINE, MF_BYCOMMAND | MF_CHECKED ); } @@ -4683,8 +4683,8 @@ void CGISDlg::DrawCopyFlyLine(const DrawLineDataStruct lineData) //航线索引号 int lineID = lineData.lineID-1; - //子航线索引号(飞机ID) - int sublineID = lineData.pts[0].nV; + //子航线索引号 + int sublineID = lineData.pts[0].nV-1; //没有目标标绘SHP图层,创建该图层 if (m_subLineLayerID[lineID][sublineID] ==-1) @@ -5101,18 +5101,6 @@ void CGISDlg::SetFlyLineShowStatus(const int lineID) bMulti = true; } } -/* - if (lineID==14) //清除连线 - { - for (auto it=m_TempLine14LayerID.begin();it!=m_TempLine14LayerID.end();) - { - if ((*it).second!=-1) - { - m_map.ClearDrawing((*it).second); - m_TempLine14LayerID.erase(it++); - } - } - }*/ } //已经标绘,清除航线 if (m_pHaveDrawLineFlag[lineIndex]) @@ -5258,22 +5246,19 @@ void CGISDlg::OnShowGivenLine(const CString strLineFileName) } m_lineFullPathName[lineDataGroup.lineID] = strLineFileName; - if (g_b981AMulti) //多机ID号 + if (g_b981AMulti && lineDataGroup.pts[0].nV>0) //多机ID号 { if (lineDataGroup.lineID==14) { m_line14FlyID = lineDataGroup.pts[0].nV; SetBindLine14Coordinate(lineDataGroup.pts[0].nV,lineDataGroup.pts[0].dX,lineDataGroup.pts[0].dY); } - if (lineDataGroup.pts[0].nV > 0 || (lineDataGroup.lineID==14)) - { - //清除标绘的航线 - ClearDrawedCopyLine(lineDataGroup.lineID-1,lineDataGroup.pts[0].nV); + //清除标绘的航线 + ClearDrawedCopyLine(lineDataGroup.lineID-1,lineDataGroup.pts[0].nV-1); - //标绘航线 - DrawCopyFlyLine(lineDataGroup); - return; - } + //标绘航线 + DrawCopyFlyLine(lineDataGroup); + return; } int ch = lineDataGroup.linePts[lineDataGroup.pointNum-1].ch1; @@ -6295,9 +6280,9 @@ void CGISDlg::OnUpdateShowBackLine(CCmdUI *pCmdUI) // TODO: 在此添加命令更新用户界面处理程序代码 if (g_b981ADesktop || g_b981APad) { - if (g_b981AMulti && (m_line14FlyID>=0)) //多机 + if (g_b981AMulti && (m_line14FlyID>0)) //多机 { - pCmdUI->SetCheck(m_pHaveDrawCopyLineFlag[13][m_line14FlyID]); + pCmdUI->SetCheck(m_pHaveDrawCopyLineFlag[13][m_line14FlyID-1]); return; } pCmdUI->SetCheck(m_pHaveDrawLineFlag[13]); @@ -8815,7 +8800,26 @@ void CGISDlg::SetBindLine14Coordinate(int uavID,double lon,double lat) m_CoordinateBindLine14[uavID] = pt; } - +//获取地图版本号 +CString CGISDlg::GetMapVersion() +{ + CString str; + if (g_b981ADesktop && g_b981AMulti) + { + mapVersion[2] = "多机单机版在线地图"; + }else if (g_b981ADesktop && !g_b981AMulti) + { + mapVersion[2] = "单机版在线地图"; + }else if (g_b981APad) + { + mapVersion[2] = "平板版在线地图"; + }else if (g_b981AMulti) + { + mapVersion[2] = "多机版在线地图"; + } + str = mapVersion[0] + '\/' + mapVersion[1] + '\/' + mapVersion[2]; + return str; +} diff --git a/GISDlg.h b/GISDlg.h index 291c2a9..d11f0ff 100644 --- a/GISDlg.h +++ b/GISDlg.h @@ -66,6 +66,8 @@ public: ~CGISDlg(); + //获取地图版本号 + CString GetMapVersion(); /*******************新增<编辑航线>功能**************************/ map m_ShowedLineDataList; //存储已显示的航线数据 DrawLineDataStruct m_editLineDataGroup; //编辑航线数据 diff --git a/Globe.cpp b/Globe.cpp index e22551c..4afb89c 100644 --- a/Globe.cpp +++ b/Globe.cpp @@ -323,4 +323,7 @@ bool g_bMarkerPlot[g_iMarkerPtNum] = {false}; bool g_b981ADesktop = true; bool g_b981APad = false; bool g_b981CDesktop = false; -bool g_b981AMulti = true; \ No newline at end of file +bool g_b981AMulti = false; + +//地图模块版本号 [主版本.次版本.修订版本,日期,特性] +CString mapVersion[3] = { "1.0.0","20240920", "单机版在线地图"}; \ No newline at end of file diff --git a/Globe.h b/Globe.h index 61e18ad..34dc6a7 100644 --- a/Globe.h +++ b/Globe.h @@ -301,4 +301,6 @@ extern bool g_b981APad; // 981A平 extern bool g_b981CDesktop; // 981C电脑端 extern bool g_b981AMulti; // 981A多机 +extern CString mapVersion[3]; + #endif \ No newline at end of file