|
|
|
|
|
#include "stdafx.h"
|
|
|
#include "LaiPuLaser.h"
|
|
|
#include "afxdialogex.h"
|
|
|
#include "DlgGraphEdit.h"
|
|
|
#include "PropertieMgr.h"
|
|
|
#include "ModuleDeviceMgr.h"
|
|
|
#include "ModuleDrawMgr.h"
|
|
|
#include "GlobalFunction.h"
|
|
|
#include "ObjSortMgr.h"
|
|
|
#include "AuthorityMgr.h"
|
|
|
#include "GlobalDrawMgr.h"
|
|
|
#include "LogMgr.h"
|
|
|
#include "WorkFileMgr.h"
|
|
|
#include "MsgBox.h"
|
|
|
#include "DlgChildRecipe.h"
|
|
|
#include "LanguageMgr.h"
|
|
|
#include "DlgDeviceMain.h"
|
|
|
#include "Layer.h"
|
|
|
#include "DlgMapHistory.h"
|
|
|
|
|
|
|
|
|
#define OPEN_MAIN_DLG_TIMER 1
|
|
|
#define OPEN_MAIN_DLG_TIMER_DELAY 300
|
|
|
|
|
|
|
|
|
IMPLEMENT_DYNAMIC(CDlgGraphEdit, CMyDlgView)
|
|
|
BEGIN_MESSAGE_MAP(CDlgGraphEdit, CMyDlgView)
|
|
|
ON_WM_TIMER()
|
|
|
ON_REGISTERED_MESSAGE(AFX_WM_PROPERTY_CHANGED,OnPropertyChanged)
|
|
|
ON_BN_CLICKED(IDC_PER_OBJ, OnBnClickedPerObjBtn)
|
|
|
ON_BN_CLICKED(IDC_NEXT_OBJ,OnBnClickedNextObjBtn)
|
|
|
ON_BN_CLICKED(IDC_FRIST_OBJ,OnBnClickedFristObjBtn)
|
|
|
ON_BN_CLICKED(IDC_SHOW_OBJ_IDX,OnBnClickedShowObjIdx)
|
|
|
ON_BN_CLICKED(IDC_INSERT,OnBnClickedInsertBtn)
|
|
|
ON_BN_CLICKED(IDC_REVERSE_ORDER,OnBnClickedReverseOrderBtn)
|
|
|
ON_BN_CLICKED(IDC_OBJ_SORT_BTN,OnBnClickedObjSortBtn)
|
|
|
ON_BN_CLICKED(ID_OPEN_OBJ_BTN, OnBnClickedOpenObjBtn)
|
|
|
ON_BN_CLICKED(ID_SAVE_OBJ_BTN, OnBnClickedSaveObjBtn)
|
|
|
ON_BN_CLICKED(NEW_ZOOM_FULL_BTN, &CDlgGraphEdit::OnBnClickedZoomFullBtn)
|
|
|
ON_BN_CLICKED(NEW_ZOOM_IN_BTN, &CDlgGraphEdit::OnBnClickedZoomInBtn)
|
|
|
ON_BN_CLICKED(NEW_ZOOM_OUT_BTN, &CDlgGraphEdit::OnBnClickedZoomOutBtn)
|
|
|
ON_STN_CLICKED(NEW_OPEN_MAIN_DLG_BTN, &CDlgGraphEdit::OnStnClickedOpenMainDlg)
|
|
|
ON_BN_CLICKED(IDC_CREAT_AREA_BTN, &CDlgGraphEdit::OnBnClickedCreatAreaBtn)
|
|
|
ON_BN_CLICKED(ID_OPEN_TXT_BTN, &CDlgGraphEdit::OnBnClickedOpenTxtBtn)
|
|
|
ON_BN_CLICKED(ID_SAVE_TXT_BTN, &CDlgGraphEdit::OnBnClickedSaveTxtBtn)
|
|
|
ON_BN_CLICKED(IDC_SHOW_OBJ_PT_COORD, &CDlgGraphEdit::OnBnClickedShowObjPtCoord)
|
|
|
ON_BN_CLICKED(NEW_OPEN_MAP_HISTORY_BTN, &CDlgGraphEdit::OnBnClickedOpenMapHistoryBtn)
|
|
|
END_MESSAGE_MAP()
|
|
|
|
|
|
|
|
|
CDlgGraphEdit::CDlgGraphEdit(CWnd* pParent /*=NULL*/)
|
|
|
: CMyDlgView(CDlgGraphEdit::IDD, pParent)
|
|
|
{
|
|
|
m_InsertIdx = 1;//<2F><><EFBFBD><EFBFBD>λ<EFBFBD>õ<EFBFBD><C3B5><EFBFBD><EFBFBD><EFBFBD>ֵ
|
|
|
m_AreaCrossPtRange = 10;//<2F><><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD>ɨ<EFBFBD><C9A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ľ<EFBFBD><C4BD><EFBFBD><EFBFBD>㷶Χ
|
|
|
m_CreatAreaGap = 2;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>mm
|
|
|
}
|
|
|
|
|
|
CDlgGraphEdit::~CDlgGraphEdit()
|
|
|
{
|
|
|
}
|
|
|
|
|
|
void CDlgGraphEdit::DoDataExchange(CDataExchange* pDX)
|
|
|
{
|
|
|
CMyDlgView::DoDataExchange(pDX);
|
|
|
DDX_Control(pDX, IDC_SCAN_DIR_COMBO2, m_ObjSortDirComb);
|
|
|
DDX_Control(pDX, IDC_PROPERTY_OBJ, m_ObjPropList);
|
|
|
DDX_Text(pDX, IDC_INSERT_IDX, m_InsertIdx);
|
|
|
DDX_Text(pDX, IDC_CROSS_PT_RANGE, m_AreaCrossPtRange);
|
|
|
DDX_Text(pDX, IDC_CREAT_AREA_GAP, m_CreatAreaGap);
|
|
|
}
|
|
|
|
|
|
BOOL CDlgGraphEdit::OnInitDialog()
|
|
|
{
|
|
|
CMyDlgView::OnInitDialog();
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
::DeleteObject(m_fntPropList.Detach());
|
|
|
LOGFONT lf;
|
|
|
afxGlobalData.fontRegular.GetLogFont(&lf);
|
|
|
NONCLIENTMETRICS info;
|
|
|
info.cbSize = sizeof(info);
|
|
|
afxGlobalData.GetNonClientMetrics(info);
|
|
|
lf.lfHeight = info.lfMenuFont.lfHeight;
|
|
|
lf.lfWeight = info.lfMenuFont.lfWeight;
|
|
|
lf.lfItalic = info.lfMenuFont.lfItalic;
|
|
|
m_fntPropList.CreateFontIndirect(&lf);
|
|
|
|
|
|
|
|
|
InitObjSortDirComb();
|
|
|
InitPropList(m_ObjPropList);
|
|
|
|
|
|
((CButton *)GetDlgItem(IDC_SHOW_OBJ_PT_COORD))->SetCheck(TRUE);
|
|
|
|
|
|
SetTimer(OPEN_MAIN_DLG_TIMER,OPEN_MAIN_DLG_TIMER_DELAY,NULL);
|
|
|
|
|
|
UpdateData(FALSE);
|
|
|
return TRUE;
|
|
|
}
|
|
|
void CDlgGraphEdit::OnTimer(UINT nIDEvent)
|
|
|
{
|
|
|
if(nIDEvent == OPEN_MAIN_DLG_TIMER)
|
|
|
{
|
|
|
KillTimer(OPEN_MAIN_DLG_TIMER);
|
|
|
OnStnClickedOpenMainDlg();
|
|
|
}
|
|
|
CDialog::OnTimer(nIDEvent);
|
|
|
}
|
|
|
void CDlgGraphEdit::ShowAllItem()
|
|
|
{
|
|
|
GetDlgItem(ID_OPEN_OBJ_BTN)->ShowWindow(SW_SHOW);
|
|
|
GetDlgItem(ID_SAVE_OBJ_BTN)->ShowWindow(SW_SHOW);
|
|
|
GetDlgItem(IDC_SHOW_OBJ_IDX)->ShowWindow(SW_SHOW);
|
|
|
GetDlgItem(IDC_FRIST_OBJ)->ShowWindow(SW_SHOW);
|
|
|
GetDlgItem(IDC_PER_OBJ)->ShowWindow(SW_SHOW);
|
|
|
GetDlgItem(IDC_NEXT_OBJ)->ShowWindow(SW_SHOW);
|
|
|
GetDlgItem(IDC_STATIC_INSERT_IDX)->ShowWindow(SW_SHOW);
|
|
|
GetDlgItem(IDC_INSERT)->ShowWindow(SW_SHOW);
|
|
|
GetDlgItem(IDC_REVERSE_ORDER)->ShowWindow(SW_SHOW);
|
|
|
GetDlgItem(IDC_STATIC_SORT_DIR)->ShowWindow(SW_SHOW);
|
|
|
GetDlgItem(IDC_OBJ_SORT_BTN)->ShowWindow(SW_SHOW);
|
|
|
|
|
|
GetDlgItem(NEW_ZOOM_IN_BTN)->ShowWindow(SW_SHOW);
|
|
|
GetDlgItem(NEW_ZOOM_OUT_BTN)->ShowWindow(SW_SHOW);
|
|
|
GetDlgItem(NEW_ZOOM_FULL_BTN)->ShowWindow(SW_SHOW);
|
|
|
|
|
|
GetDlgItem(NEW_OPEN_MAIN_DLG_BTN)->ShowWindow(SW_SHOW);
|
|
|
GetDlgItem(IDC_PROPERTY_OBJ)->ShowWindow(SW_SHOW);
|
|
|
GetDlgItem(IDC_STATIC_OBJ_PAR)->ShowWindow(SW_SHOW);
|
|
|
GetDlgItem(IDC_GROUP_S_SORT)->ShowWindow(SW_SHOW);
|
|
|
GetDlgItem(IDC_SCAN_DIR_COMBO2)->ShowWindow(SW_SHOW);
|
|
|
GetDlgItem(IDC_INSERT_IDX)->ShowWindow(SW_SHOW);
|
|
|
GetDlgItem(IDC_GROUP_SORT_ADJUST)->ShowWindow(SW_SHOW);
|
|
|
|
|
|
gDraw->SetbObjEditMode(true);
|
|
|
}
|
|
|
void CDlgGraphEdit::UpdateLanguageTxt()
|
|
|
{
|
|
|
|
|
|
}
|
|
|
#if 1
|
|
|
void CDlgGraphEdit::InitPropList(CMFCPropertyGridCtrl &PropertyGridCtrl)
|
|
|
{
|
|
|
PropertyGridCtrl.SetFont(&m_fntPropList);
|
|
|
PropertyGridCtrl.SetVSDotNetLook();
|
|
|
HDITEM item;
|
|
|
item.cxy=220;//<2F><>һ<EFBFBD>еĿ<D0B5><C4BF><EFBFBD>
|
|
|
item.mask=HDI_WIDTH;
|
|
|
PropertyGridCtrl.GetHeaderCtrl().SetItem(0, new HDITEM(item));
|
|
|
}
|
|
|
//<2F><><EFBFBD>Ըı<D4B8><C4B1><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>Ӧ
|
|
|
LRESULT CDlgGraphEdit::OnPropertyChanged(WPARAM,LPARAM lParam)
|
|
|
{
|
|
|
gDrawPropertieMgr.OnPropertyChanged(lParam);
|
|
|
return 0;
|
|
|
}
|
|
|
//<2F><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
|
|
|
void CDlgGraphEdit::UpdateObjPropList()
|
|
|
{
|
|
|
m_ObjPropList.RemoveAll();
|
|
|
gDrawPropertieMgr.DelAllPropertie();
|
|
|
gModuleDrawMgr.InsertModuleGridProperty(0,m_ObjPropList);
|
|
|
//<2F><><EFBFBD>µ<EFBFBD><C2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
m_ObjPropList.AdjustLayout();
|
|
|
}
|
|
|
#endif
|
|
|
#if 1
|
|
|
void CDlgGraphEdit::InitObjSortDirComb()
|
|
|
{
|
|
|
int idx = 0;
|
|
|
m_ObjSortDirComb.InsertString(idx++,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
m_ObjSortDirComb.InsertString(idx++,"<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD>");
|
|
|
m_ObjSortDirComb.InsertString(idx++,"<EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><EFBFBD><EFBFBD>");
|
|
|
m_ObjSortDirComb.InsertString(idx++,"<EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><EFBFBD><EFBFBD>");
|
|
|
m_ObjSortDirComb.SetCurSel(0);
|
|
|
}
|
|
|
|
|
|
//ѡ<><D1A1><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>obj
|
|
|
void CDlgGraphEdit::OnBnClickedFristObjBtn()
|
|
|
{
|
|
|
gLogMgr->WriteDebugLog("Func---->OnBnClickedFristObjBtn");
|
|
|
CLayer &layer = gLayer;
|
|
|
layer.SelFirstObj();
|
|
|
}
|
|
|
void CDlgGraphEdit::OnBnClickedPerObjBtn()
|
|
|
{
|
|
|
gLogMgr->WriteDebugLog("Func---->OnBnClickedPerObjBtn");
|
|
|
CLayer &layer = gLayer;
|
|
|
layer.SelborderObj(false);
|
|
|
}
|
|
|
void CDlgGraphEdit::OnBnClickedNextObjBtn()
|
|
|
{
|
|
|
gLogMgr->WriteDebugLog("Func---->OnBnClickedNextObjBtn");
|
|
|
CLayer &layer = gLayer;
|
|
|
layer.SelborderObj(true);
|
|
|
}
|
|
|
//<2F>Ƿ<EFBFBD><C7B7><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>˳<EFBFBD><CBB3>
|
|
|
void CDlgGraphEdit::OnBnClickedShowObjIdx()
|
|
|
{
|
|
|
gLayer.SetbShowObjIdx(((CButton*)GetDlgItem(IDC_SHOW_OBJ_IDX))->GetCheck());
|
|
|
GetCurViewPtr()->RefreshView();
|
|
|
}
|
|
|
//<2F><><EFBFBD>뵽λ<EBB5BD><CEBB>
|
|
|
void CDlgGraphEdit::OnBnClickedInsertBtn()
|
|
|
{
|
|
|
gLogMgr->WriteDebugLog("Func---->OnBnClickedInsertBtn");
|
|
|
if(!UpdateData(TRUE))
|
|
|
return;
|
|
|
CLayer &layer = gLayer;
|
|
|
CObjContainer &ObjContainer = layer.GetObjContainer();
|
|
|
int SelObjCnt = ObjContainer.GetSelObjCnt();
|
|
|
layer.SelectedObjInsertToIdx(m_InsertIdx);
|
|
|
m_InsertIdx += SelObjCnt;
|
|
|
UpdateData(FALSE);
|
|
|
}
|
|
|
//<2F><><EFBFBD><EFBFBD>
|
|
|
void CDlgGraphEdit::OnBnClickedReverseOrderBtn()
|
|
|
{
|
|
|
gLogMgr->WriteDebugLog("Func---->OnBnClickedReverseOrderBtn");
|
|
|
CLayer &layer = gLayer;
|
|
|
layer.ReverseSelObj();
|
|
|
}
|
|
|
//S <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
void CDlgGraphEdit::OnBnClickedObjSortBtn()
|
|
|
{
|
|
|
gLogMgr->WriteDebugLog("Func---->OnBnClickedObjSortBtn");
|
|
|
int SortDirIdx = m_ObjSortDirComb.GetCurSel();//ɨ<>跽<EFBFBD><E8B7BD>
|
|
|
DIRECTION SortDir;
|
|
|
switch(SortDirIdx)
|
|
|
{
|
|
|
case 0://<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
SortDir = _DIR_R;
|
|
|
break;
|
|
|
case 1://<2F><><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>
|
|
|
SortDir = _DIR_L;
|
|
|
break;
|
|
|
case 2://<2F><><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD>
|
|
|
SortDir = _DIR_D;
|
|
|
break;
|
|
|
case 3://<2F><><EFBFBD>µ<EFBFBD><C2B5><EFBFBD>
|
|
|
SortDir = _DIR_U;
|
|
|
break;
|
|
|
default:
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
CObjSortMgr ObjSortMgr;
|
|
|
ObjSortMgr.SortObjByDir(SortDir);
|
|
|
|
|
|
GetCurViewPtr()->RefreshView();
|
|
|
}
|
|
|
|
|
|
#endif
|
|
|
#if 1
|
|
|
void CDlgGraphEdit::OnBnClickedOpenObjBtn()
|
|
|
{
|
|
|
gLogMgr->WriteDebugLog("Func---->OnBnClickedOpenObjBtn");
|
|
|
CWorkFileMgr WorkFileMgr;
|
|
|
WorkFileMgr.OpenObjFile();
|
|
|
}
|
|
|
void CDlgGraphEdit::OnBnClickedSaveObjBtn()
|
|
|
{
|
|
|
gLogMgr->WriteDebugLog("Func---->OnBnClickedSaveObjBtn");
|
|
|
CWorkFileMgr WorkFileMgr;
|
|
|
WorkFileMgr.SaveObjFile();
|
|
|
}
|
|
|
void CDlgGraphEdit::OnBnClickedOpenTxtBtn()
|
|
|
{
|
|
|
gLogMgr->WriteDebugLog("Func---->OnBnClickedOpenTxtBtn");
|
|
|
CWorkFileMgr WorkFileMgr;
|
|
|
WorkFileMgr.OpenObjTxtFile();
|
|
|
}
|
|
|
void CDlgGraphEdit::OnBnClickedSaveTxtBtn()
|
|
|
{
|
|
|
gLogMgr->WriteDebugLog("Func---->OnBnClickedSaveTxtBtn");
|
|
|
CWorkFileMgr WorkFileMgr;
|
|
|
WorkFileMgr.SaveObjTxtFile();
|
|
|
}
|
|
|
#endif
|
|
|
#if 1
|
|
|
void CDlgGraphEdit::OnBnClickedZoomFullBtn()
|
|
|
{
|
|
|
m_pView->DoZoomFull();
|
|
|
}
|
|
|
void CDlgGraphEdit::OnBnClickedZoomInBtn()
|
|
|
{
|
|
|
m_pView->OnZoomIn();
|
|
|
}
|
|
|
void CDlgGraphEdit::OnBnClickedZoomOutBtn()
|
|
|
{
|
|
|
m_pView->OnZoomOut();
|
|
|
}
|
|
|
#endif
|
|
|
#define MAIN_DLG_SIZE_Y 1050
|
|
|
void CDlgGraphEdit::OnStnClickedOpenMainDlg()
|
|
|
{
|
|
|
if(gDlgDeviceMain)
|
|
|
{
|
|
|
gDraw->SetbObjEditMode(false);//<2F>رձ༭ģʽ
|
|
|
gDlgDeviceMain->ShowWindow(SW_SHOW);
|
|
|
//ȫ<><C8AB><EFBFBD><EFBFBD>ʾ(<28><>Ӱ<EFBFBD>쵯<EFBFBD><ECB5AF><EFBFBD>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>)
|
|
|
gDlgDeviceMain->MoveWindow(CRect(0,0,1950,MAIN_DLG_SIZE_Y));
|
|
|
}
|
|
|
}
|
|
|
void CDlgGraphEdit::OnBnClickedCreatAreaBtn()
|
|
|
{
|
|
|
gLogMgr->WriteDebugLog("Func---->OnBnClickedCreatAreaBtn");
|
|
|
UpdateData(TRUE);
|
|
|
if(m_AreaCrossPtRange<1)
|
|
|
{
|
|
|
CMsgBox MsgBox;
|
|
|
MsgBox.Show("ʶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Χ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><EFBFBD>1");
|
|
|
return;
|
|
|
}
|
|
|
gLayer.SetAreaCrossPtRange(m_AreaCrossPtRange);
|
|
|
gLayer.QuickCreatScanArea(m_CreatAreaGap);
|
|
|
}
|
|
|
void CDlgGraphEdit::OnBnClickedShowObjPtCoord()
|
|
|
{
|
|
|
gLayer.SetbShowObjPtCoord(((CButton*)GetDlgItem(IDC_SHOW_OBJ_PT_COORD))->GetCheck());
|
|
|
GetCurViewPtr()->RefreshView();
|
|
|
}
|
|
|
|
|
|
|
|
|
void CDlgGraphEdit::OnBnClickedOpenMapHistoryBtn()
|
|
|
{
|
|
|
CDlgMapHistory dlg;
|
|
|
dlg.DoModal();
|
|
|
}
|