📄 blurmergepage.cpp
字号:
// BlurMergePage.cpp : implementation file
//
#include "stdafx.h"
#include "AcquireKlg.h"
#include "AcquireKlgDoc.h"
#include "MainFrm.h"
#include "MHDialog.h"
#include "cgqDlg.h"
#include "RuleDefineView.h"
#include "Global.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CBlurMergePage dialog
extern CADODatabase GlDataBase;
CBlurMergePage::CBlurMergePage(CWnd* pParent /*=NULL*/)
: CDialog(CBlurMergePage::IDD, pParent)
{
//{{AFX_DATA_INIT(CBlurMergePage)
// NOTE: the ClassWizard will add member initialization here
// m_pDlg=new CMHDialog(this);
//}}AFX_DATA_INIT
}
void CBlurMergePage::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CBlurMergePage)
DDX_Control(pDX, IDC_COMBO_rhlx, m_como_FuseType);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CBlurMergePage, CDialog)
//{{AFX_MSG_MAP(CBlurMergePage)
ON_BN_CLICKED(IDC_BUTTON_cgqqk, OnButton1)
ON_BN_CLICKED(IDC_BUTTON_mhhsqk, OnBUTTONmhhsqk)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//获得指定的视图类指针
CView* CBlurMergePage::GetView(CRuntimeClass* pClass)
{
CAcquireKlgDoc* pDoc=(CAcquireKlgDoc*)GetParentFrame()->GetActiveView()->GetDocument();
ASSERT(pDoc);
CView* pView = NULL;
POSITION pos=pDoc->GetFirstViewPosition();
while(pos!=NULL){
pView=pDoc->GetNextView(pos);
if(pView->IsKindOf(pClass))
break;
}
if(!pView->IsKindOf(pClass)){
AfxMessageBox("Can't Locate the View.");
return NULL;
}
return pView;
}
void CBlurMergePage::OnButton1()
{
int id=getfr_id();
if (id>0){
xh.Format("%d",id);
CMHDialog dlg;
dlg.DoModal();
}else if (id==-1)
{
AfxMessageBox("请先选择规则!");
}
}
/////////////////////////////////////////////////////////////////////////////
// CBlurMergePage message handlers
void CBlurMergePage::SetFuseTypeCurSel(int nCur){
m_como_FuseType.SetCurSel(nCur-1);
}
int CBlurMergePage::GetFuseTypeCurSel(){
int nCur = m_como_FuseType.GetCurSel();
if(nCur!=CB_ERR)
nCur++;
return nCur;
}
BOOL CBlurMergePage::OnInitDialog()
{
CDialog::OnInitDialog();
m_pNtView = (CNodeTreeView*)GetView(RUNTIME_CLASS(CNodeTreeView));
m_pRDView=(CRuleDefineView*)GetView(RUNTIME_CLASS(CRuleDefineView));
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
int CBlurMergePage::getfr_id()
{ CString strs;
int frid;
GetDlgItemText(IDC_EDIT_rhxh,strs);
strs.TrimLeft();
if (strs.GetLength()==0) return -1;
int nodenum = m_pNtView->GetNodeID();
if(nodenum == ERR_NOSELETED) return 0;
//查找相应规则
CADORecordset recordset(&GlDataBase);
CString strQuery;
strQuery.Format("select * from Fuse_Rule_Table where FRSN=%s and nodesn=%d",strs,nodenum);
recordset.SetQuery(strQuery);
if(TRUE == recordset.Open()){
if(recordset.GetRecordCount()!=0){
frid = 0;
recordset.GetFieldValue("FR_id",frid);
return frid;
}
else
{ AfxMessageBox("请先保存融合规则!");
return 0;
}
}
}
void CBlurMergePage::OnBUTTONmhhsqk()
{
int id=getfr_id();
if (id>0){
xh.Format("%d",id);
CcgqDlg cgqdlg;
cgqdlg.DoModal();
}else if (id==-1)
{
AfxMessageBox("请先选择规则!");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -