diff --git a/GISControlDlg.aps b/GISControlDlg.aps index 5bba7d2..72999e4 100644 Binary files a/GISControlDlg.aps and b/GISControlDlg.aps differ diff --git a/GISDlg.cpp b/GISDlg.cpp index 7a5bc72..5947182 100644 --- a/GISDlg.cpp +++ b/GISDlg.cpp @@ -844,7 +844,7 @@ void CGISDlg::OnAddFlyLineData() } //弹出文件对话框 - CFileDialog dlg(true, ".txt","*.txt",OFN_HIDEREADONLY, "航线文件(*.txt)|*.txt", NULL); + CFileDialog dlg(true, ".txt","*.txt",OFN_HIDEREADONLY, "航线文件(*.txt)|*.txt|", NULL); if (dlg.DoModal() == IDOK) { @@ -1854,11 +1854,7 @@ void CGISDlg::MouseDownMap1(short Button, short Shift, long x, long y) //右键多点测量结束 if (m_bPolylineMeasure && (Button == 2)) { - //删除已经标绘的直线 - m_map.ClearDrawing(m_tempLayerID); - m_bMeasureDrag = false; - m_bEndMeasure = true; - m_numPolylineMeasurePts = 0; + EndPolylineMessure(); return; } /*******************************************************************************************************/ @@ -1949,207 +1945,15 @@ void CGISDlg::MouseDownMap1(short Button, short Shift, long x, long y) } ShowModifyPointDlg(selectedPointID); - - /* - CModifyLinePointDlg dlg; - if (m_lineSelectedID!=11) //非回收航线,隐藏设置盘旋点 - { - dlg.SetCirclingPointRBTNVisible(false); - } - dlg.SetLonLat(m_editLineDataGroup.pts[selectedPointID].dX,m_editLineDataGroup.pts[selectedPointID].dY); - if (circlingPointID == selectedPointID) //选中盘旋点,设置按钮选中 - { - dlg.CheckedCirclingPoint(); - } - if (dlg.DoModal() == IDOK) - { - double targetLat,targetLon; - dlg.GetLonLat(targetLon,targetLat); - //bool bb = dlg.IsCirclingPoint(); - if (m_lineSelectedID==11) //回收航线 - { - if (circlingPointID == selectedPointID) //对已经是盘旋点进行重新设置 - { - if (!dlg.IsCirclingPoint()) //存储盘旋点 - { - circlingPointID = -1; - } - } - if (dlg.IsCirclingPoint()) //存储盘旋点 - { - circlingPointID = selectedPointID; - } - } - - - //修改线坐标 - m_editLineDataGroup.linePts[selectedPointID].dX = targetLon; - m_editLineDataGroup.linePts[selectedPointID].dY = targetLat; - //修改点坐标 - m_editLineDataGroup.pts[selectedPointID].dX = targetLon; - m_editLineDataGroup.pts[selectedPointID].dY = targetLat; - - //清除标绘的航线 - ClearDrawedLine(m_editLineDataGroup.lineID-1); - //标绘航线 - DrawFlyLine(m_editLineDataGroup); - } - else - { - //return; - } return; - */ } ShowEditSaveDlg(); - - /* - CSaveLineEditSetting saveDlg; - saveDlg.DoModal(); - int saveStatus = saveDlg.GetSaveStatus(); //-1为不保存,0为继续编辑,1为保存 - if (saveStatus==-1) - { - //清除标绘的航线 - ClearDrawedLine(m_editLineDataGroup.lineID-1); - //恢复未编辑状态 - DrawFlyLine(m_ShowedLineDataList[m_lineSelectedID]); - //清除距离标绘 - m_map.ClearDrawing(m_distLabelLayer); - - m_bEditLine = false; - m_bSelectFeatureFlag = false; - m_lineSelectedID = -1; - return; - } - else if (saveStatus==0) - { - return; - } - - // - CString dirName = ""; - switch (m_lineSelectedID) - { - case 1: - dirName = "航线1\\"; - break; - case 2: - dirName = "航线2\\"; - break; - case 3: - dirName = "航线3\\"; - break; - case 4: - dirName = "地面滑行航线\\"; - break; - case 5: - dirName = "围栏航线\\"; - break; - case 6: - dirName = "空投航线\\"; - break; - case 10: - dirName = "跑道航线\\"; - break; - case 11: - dirName = "回收航线\\"; - break; - case 13: - dirName = "通场航线\\"; - break; - } - - //重新保存回收航线 - CString filename; - CString strRouteFileDir = GetSoftwareCurrentDirectory() + _T("\\Route\\") + dirName; - - TCHAR s[10000]; - s[0]=0; - CFileDialog dlg(FALSE, _T(".route"), _T("*.route")); - dlg.m_ofn.lpstrTitle=_T("保存航线文件"); - dlg.m_ofn.lpstrFile=s; - dlg.m_ofn.nMaxFile=sizeof(s)/sizeof(TCHAR); - - TCHAR filter[500]=_T("航线文件(*.route)\0*.route\0"); - dlg.m_ofn.lpstrFilter=filter; - dlg.m_ofn.Flags|=OFN_OVERWRITEPROMPT|OFN_HIDEREADONLY|OFN_CREATEPROMPT; - dlg.m_ofn.lpstrInitialDir = strRouteFileDir; - - if (IDOK == dlg.DoModal()) - { - filename = dlg.GetPathName(); - //保存文件 - FILE* fp = fopen(filename,"w"); - fprintf(fp,"%d, 0, %lf, %lf, %.2lf, 0, 00, 03\n", m_editLineDataGroup.lineID, 0.0, 0.0, 0.0); - int n_linePts = m_editLineDataGroup.pointNum; - for (int i=1;i<=n_linePts;i++) - { - PtStruct linePt = m_editLineDataGroup.pts[i-1]; - if (iFillColor = drawColor; - pShapeDrawingOption->PointSize = 16; - pShapeDrawingOption->SetDefaultPointSymbol(mapWindow::tkDefaultPointSymbol::dpsDiamond); - //pShapeDrawingOption->PointType = mapWindow::tkPointSymbolType::ptSymbolStandard; - //pShapeDrawingOption->PointSidesCount = 4; + pShapeDrawingOption->PointSize = 20; + //pShapeDrawingOption->SetDefaultPointSymbol(mapWindow::tkDefaultPointSymbol::dpsDiamond); + //pShapeDrawingOption->PutFillColor(drawColor); + //pShapeDrawingOption->PutPointSize(18); + pShapeDrawingOption->PutPointType(mapWindow::tkPointSymbolType::ptSymbolStandard); + pShapeDrawingOption->PutPointShape(mapWindow::tkPointShapeType::ptShapeStar); //m_map.SetShapeLayerPointType(shpLayerID, mapWindow::ptDiamond); //m_map.SetShapeLayerStippleColor(shpLayerID, drawColor); @@ -7295,6 +7109,10 @@ int CGISDlg::IsSelectLine(double* pt) //编辑航线时,显示航点设置对话框 void CGISDlg::ShowModifyPointDlg(int selectedPointID) { + if (!m_bEditLine) + { + return; + } CModifyLinePointDlg dlg; dlg.m_editLineDataGroup = m_editLineDataGroup; dlg.SetSelectedPointID(selectedPointID); @@ -7346,7 +7164,10 @@ void CGISDlg::ShowModifyPointDlg(int selectedPointID) m_editLineDataGroup.linePts[m_editLineDataGroup.linePointNum-1].dY = targetLat; } //m_editLineDataGroup.linePts[0]->ch1==2 不闭合 0->闭合 - + if (m_distLabelLayer!=-1) + { + m_map.ClearDrawing(m_distLabelLayer);//清除距离和方位角标绘 + } //清除标绘的航线 ClearDrawedLine(m_editLineDataGroup.lineID-1); //标绘航线 @@ -7358,12 +7179,19 @@ void CGISDlg::ShowModifyPointDlg(int selectedPointID) } return; } -void CGISDlg::ShowModifyPointDlg(){ + +void CGISDlg::ShowModifyPointDlg() +{ ShowModifyPointDlg(0); } + //显示保存编辑对话框 void CGISDlg::ShowEditSaveDlg() { + if (!m_bEditLine) + { + return; + } CSaveLineEditSetting saveDlg; saveDlg.DoModal(); int saveStatus = saveDlg.GetSaveStatus(); //-1为不保存,0为继续编辑,1为保存 @@ -7425,12 +7253,12 @@ void CGISDlg::ShowEditSaveDlg() TCHAR s[10000]; s[0]=0; - CFileDialog dlg(FALSE, _T(".route"), _T("*.route")); + CFileDialog dlg(FALSE, _T(".txt"), _T("*.txt")); dlg.m_ofn.lpstrTitle=_T("保存航线文件"); dlg.m_ofn.lpstrFile=s; dlg.m_ofn.nMaxFile=sizeof(s)/sizeof(TCHAR); - TCHAR filter[500]=_T("航线文件(*.route)\0*.route\0"); + TCHAR filter[500]=_T("航线文件(*.txt)\0*.txt\0"); dlg.m_ofn.lpstrFilter=filter; dlg.m_ofn.Flags|=OFN_OVERWRITEPROMPT|OFN_HIDEREADONLY|OFN_CREATEPROMPT; dlg.m_ofn.lpstrInitialDir = strRouteFileDir; @@ -7505,6 +7333,17 @@ void CGISDlg::ShowEditSaveDlg() } } +//测量结束 +void CGISDlg::EndPolylineMessure() +{ + //删除已经标绘的直线 + m_map.ClearDrawing(m_tempLayerID); + m_bMeasureDrag = false; + m_bEndMeasure = true; + m_numPolylineMeasurePts = 0; + return; +} + diff --git a/GISDlg.h b/GISDlg.h index bd87f27..2003256 100644 --- a/GISDlg.h +++ b/GISDlg.h @@ -245,6 +245,7 @@ private: // by Wu // void ShowModifyPointDlg(int selectedPointID=0); //编辑航线时,显示航点设置对话框 void ShowEditSaveDlg(); //显示保存编辑对话框 + void EndPolylineMessure(); //测量结束 protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support diff --git a/Globe.cpp b/Globe.cpp index 52f3005..a31ea08 100644 --- a/Globe.cpp +++ b/Globe.cpp @@ -232,6 +232,6 @@ bool g_bMarkerPlot[g_iMarkerPtNum] = {false}; /*------------------------------------------------------------------------------------------------------------- 说明:不同飞机型号变量,用于控制是否启用个性功能 -------------------------------------------------------------------------------------------------------------*/ -bool g_b981ADesktop = true; -bool g_b981APad = false; +bool g_b981ADesktop = false; +bool g_b981APad = true; bool g_b98CADesktop = false; \ No newline at end of file diff --git a/ModifyLinePointDlg.cpp b/ModifyLinePointDlg.cpp index 2f380fb..878982a 100644 --- a/ModifyLinePointDlg.cpp +++ b/ModifyLinePointDlg.cpp @@ -230,10 +230,10 @@ BOOL CModifyLinePointDlg::OnInitDialog() cstr.Format(_T("%d"), i+1); m_PointID.InsertString(i,cstr); } - m_PointID.SetCurSel(m_selectedPointID); - cstr.Format(_T("%f"), m_editLineDataGroup.pts[m_selectedPointID].dX); + m_PointID.SetCurSel(m_selectedPointID-1); + cstr.Format(_T("%f"), m_editLineDataGroup.pts[m_selectedPointID-1].dX); SetDlgItemText(IDC_EDIT_LON,cstr); - cstr.Format(_T("%f"), m_editLineDataGroup.pts[m_selectedPointID].dY); + cstr.Format(_T("%f"), m_editLineDataGroup.pts[m_selectedPointID-1].dY); SetDlgItemText(IDC_EDIT_LAT,cstr); return TRUE; @@ -369,6 +369,7 @@ void CModifyLinePointDlg::OnEnKillfocusEditLat() void CModifyLinePointDlg::SetSelectedPointID(int PointID){ m_selectedPointID = PointID + 1; + //m_selectedPointID = PointID; } // 选择航点下拉列表变化时触发 @@ -379,18 +380,19 @@ void CModifyLinePointDlg::OnCbnSelchangeComboPointid() TRACE(_T("当前选中航点ID: %d \n"),m_selectedPointID); //修改经纬度文本框的值 CString cstr; - if(posTypeID==0){ //度 + if(posTypeID==0) + { //度 cstr.Format(_T("%f"), m_editLineDataGroup.pts[m_selectedPointID-1].dX); SetDlgItemText(IDC_EDIT_LON,cstr); cstr.Format(_T("%f"), m_editLineDataGroup.pts[m_selectedPointID-1].dY); SetDlgItemText(IDC_EDIT_LAT,cstr); } - else if(posTypeID==1){ // 度分秒 + else if(posTypeID==1) + { // 度分秒 string str_lon, str_lat; getDMSString(m_editLineDataGroup.pts[m_selectedPointID-1].dX, m_editLineDataGroup.pts[m_selectedPointID-1].dY,str_lon, str_lat); SetDlgItemText(IDC_EDIT_LON,str_lon.c_str()); SetDlgItemText(IDC_EDIT_LAT,str_lat.c_str()); - } }