www.pudn.com > bitmappaint.rar > property.cpp


// property.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "radar.h" 
#include "property.h" 
////////////////////// 
#include "childfrm.H" 
///////////////////////// 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
 
// **************************** 
 
///////////////////////////////////////////////////////////////////////////// 
// CPage1 property page 
 
IMPLEMENT_DYNCREATE(CPage1, CPropertyPage) 
 
CPage1::CPage1() : CPropertyPage(CPage1::IDD) 
{ 
	//{{AFX_DATA_INIT(CPage1) 
	m_GainSelect = -1; 
	m_nAGCMaxGain = 0; 
	m_nSECAbsorb = 0; 
	m_nSECMaxGain = 0; 
	m_fGainVelocity = 0.0f; 
	m_fPusleNumber = 0.0f; 
	m_nCONGain = 0; 
	//}}AFX_DATA_INIT 
	m_bAGCGain=false; 
	m_bSECGain=true; 
	m_bCONGain=false; 
} 
 
CPage1::~CPage1() 
{ 
} 
 
void CPage1::DoDataExchange(CDataExchange* pDX) 
{ 
	CPropertyPage::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(CPage1) 
	DDX_Radio(pDX, IDC_AGC_GAIN, m_GainSelect); 
	DDX_Text(pDX, IDC_AGC_MAX_GAIN, m_nAGCMaxGain); 
	DDV_MinMaxInt(pDX, m_nAGCMaxGain, 1, 32767); 
	DDX_Text(pDX, IDC_SEC_ABSORB, m_nSECAbsorb); 
	DDV_MinMaxInt(pDX, m_nSECAbsorb, 0, 100); 
	DDX_Text(pDX, IDC_SEC_MAX_GAIN, m_nSECMaxGain); 
	DDV_MinMaxInt(pDX, m_nSECMaxGain, 1, 30000); 
	DDX_Text(pDX, IDC_GAIN_VELOCITY, m_fGainVelocity); 
	DDV_MinMaxFloat(pDX, m_fGainVelocity, 0.f, 0.3f); 
	DDX_Text(pDX, IDC_AGC_PUSLE_NUMBER, m_fPusleNumber); 
	DDV_MinMaxFloat(pDX, m_fPusleNumber, 1.f, 4.f); 
	DDX_Text(pDX, IDC_CON_GAIN, m_nCONGain); 
	DDV_MinMaxInt(pDX, m_nCONGain, 1, 32767); 
	//}}AFX_DATA_MAP 
    EnableCtrl();///********* *\\\\\\\\\\\\ 
  
} 
 
 
BEGIN_MESSAGE_MAP(CPage1, CPropertyPage) 
	//{{AFX_MSG_MAP(CPage1) 
	ON_BN_CLICKED(IDC_AGC_GAIN, OnAgcGain) 
	ON_BN_CLICKED(IDC_RADIO2, OnSECGain) 
	ON_BN_CLICKED(IDC_RADIO3, OnCONGain) 
	ON_BN_CLICKED(IDC_RADIO4, OnUserGain) 
	ON_BN_CLICKED(IDC_RADIO5, OnNoneGain) 
	ON_WM_VSCROLL() 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CPage1 message handlers 
///////////////////////////////////////////////////////////////////////////// 
// CPage2 property page 
 
IMPLEMENT_DYNCREATE(CPage2, CPropertyPage) 
 
CPage2::CPage2() : CPropertyPage(CPage2::IDD) 
{ 
	//{{AFX_DATA_INIT(CPage2) 
	m_nPointAverage = 1; 
	m_nTraceAverage = 1; 
	//}}AFX_DATA_INIT 
} 
 
CPage2::~CPage2() 
{ 
} 
 
void CPage2::DoDataExchange(CDataExchange* pDX) 
{ 
	CPropertyPage::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(CPage2) 
	DDX_Text(pDX, IDC_POINT_AVERAGE, m_nPointAverage); 
	DDV_MinMaxInt(pDX, m_nPointAverage, 1, 10); 
	DDX_Text(pDX, IDC_TRACE_AVERAGE, m_nTraceAverage); 
	DDV_MinMaxInt(pDX, m_nTraceAverage, 1, 10); 
	//}}AFX_DATA_MAP 
} 
 
 
BEGIN_MESSAGE_MAP(CPage2, CPropertyPage) 
	//{{AFX_MSG_MAP(CPage2) 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CPage2 message handlers 
///////////////////////////////////////////////////////////////////////////// 
// CPage3 property page 
 
IMPLEMENT_DYNCREATE(CPage3, CPropertyPage) 
 
CPage3::CPage3() : CPropertyPage(CPage3::IDD) 
{ 
	//{{AFX_DATA_INIT(CPage3) 
	m_RightAxis = -1; 
	m_LeftAxis = -1; 
	m_fLeftx = 0.0f; 
	m_fLefty = 0.0f; 
	m_fRightx = 0.0f; 
	m_fRighty = 0.0f; 
	m_fTraceToTrace = 0.0f; 
	m_nTraceFrom = 0; 
	m_nTraceTo = 0; 
	m_nTimeFrom = 0; 
	m_nTimeTo = 0; 
	m_fTraceWidth = 0.0f; 
	m_fVAxisLength = 0.0f; 
	m_fHAxisLength = 0.0f; 
	//}}AFX_DATA_INIT 
} 
 
CPage3::~CPage3() 
{ 
} 
 
void CPage3::DoDataExchange(CDataExchange* pDX) 
{ 
	CPropertyPage::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(CPage3) 
	DDX_Radio(pDX, IDC_RIGHT_AXIS, m_RightAxis); 
	DDX_Radio(pDX, IDC_LEFT_AXIS, m_LeftAxis); 
	DDX_Text(pDX, IDC_TOP_LEFTX, m_fLeftx); 
	DDX_Text(pDX, IDC_TOP_LEFTY, m_fLefty); 
	DDX_Text(pDX, IDC_BOTTOM_RIGHTX, m_fRightx); 
	DDX_Text(pDX, IDC_BOTTOM_RIGHTY, m_fRighty); 
	DDX_Text(pDX, IDC_TRACE_TO_TRACE, m_fTraceToTrace); 
	DDX_Text(pDX, IDC_TRACE_FROM, m_nTraceFrom); 
	DDX_Text(pDX, IDC_TRACE_TO, m_nTraceTo); 
	DDX_Text(pDX, IDC_TIME_FROM, m_nTimeFrom); 
	DDX_Text(pDX, IDC_TIME_TO, m_nTimeTo); 
	DDX_Text(pDX, IDC_TRACE_WIDTH, m_fTraceWidth); 
	DDX_Text(pDX, IDC_VERTICAL_AXIS_LENGTH, m_fVAxisLength); 
	DDX_Text(pDX, IDC_EDIT2, m_fHAxisLength); 
	//}}AFX_DATA_MAP 
} 
 
 
BEGIN_MESSAGE_MAP(CPage3, CPropertyPage) 
	//{{AFX_MSG_MAP(CPage3) 
		// NOTE: the ClassWizard will add message map macros here 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CPage3 message handlers 
///////////////////////////////////////////////////////////////////////////// 
// CPage4 property page 
 
IMPLEMENT_DYNCREATE(CPage4, CPropertyPage) 
 
CPage4::CPage4() : CPropertyPage(CPage4::IDD) 
{ 
	//{{AFX_DATA_INIT(CPage4) 
	m_DisplaySelect = -1; 
	m_FillSelect = -1; 
	m_GraySelect = -1; 
	m_DisplayWave = FALSE; 
	m_nMaxMinGray = 0; 
	m_nGrayFrom = 0; 
	m_nGrayTo = 0; 
	//}}AFX_DATA_INIT 
    m_bAreaEnabled=true; 
	m_bGrayEnabled=false; 
	m_bColorEnabled=false; 
     
} 
 
CPage4::~CPage4() 
{ 
} 
 
void CPage4::DoDataExchange(CDataExchange* pDX) 
{ 
	CPropertyPage::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(CPage4) 
	DDX_Radio(pDX, IDC_DISPLAY_SELECT, m_DisplaySelect); 
	DDX_Radio(pDX, IDC_FILL_SELECT, m_FillSelect); 
	DDX_Radio(pDX, IDC_GRAY_SELECT, m_GraySelect); 
	DDX_Check(pDX, IDC_DISPALY_WAVE, m_DisplayWave); 
	DDX_Text(pDX, IDC_EDIT2, m_nMaxMinGray); 
	DDV_MinMaxInt(pDX, m_nMaxMinGray, 0, 32767); 
	DDX_Text(pDX, IDC_EDIT3, m_nGrayFrom); 
	DDV_MinMaxInt(pDX, m_nGrayFrom, 0, 255); 
	DDX_Text(pDX, IDC_EDIT4, m_nGrayTo); 
	DDV_MinMaxInt(pDX, m_nGrayTo, 0, 255); 
	//}}AFX_DATA_MAP 
    EnableCtrl(); 
} 
 
 
BEGIN_MESSAGE_MAP(CPage4, CPropertyPage) 
	//{{AFX_MSG_MAP(CPage4) 
	ON_BN_CLICKED(IDC_RADIO2, OnGray) 
	ON_BN_CLICKED(IDC_RADIO3, OnColor) 
	ON_BN_CLICKED(IDC_DISPLAY_SELECT, OnArea) 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CPage4 message handlers 
///////////////////////////////////////////////////////////////////////////// 
// CPage5 property page 
 
IMPLEMENT_DYNCREATE(CPage5, CPropertyPage) 
 
CPage5::CPage5() : CPropertyPage(CPage5::IDD) 
{ 
	//{{AFX_DATA_INIT(CPage5) 
	m_fVelocity = 0.0f; 
	//}}AFX_DATA_INIT 
} 
 
CPage5::~CPage5() 
{ 
} 
 
void CPage5::DoDataExchange(CDataExchange* pDX) 
{ 
	CPropertyPage::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(CPage5) 
	DDX_Text(pDX, IDC_VELOCITY, m_fVelocity); 
	DDV_MinMaxFloat(pDX, m_fVelocity, 0.f, 0.3f); 
	//}}AFX_DATA_MAP 
} 
 
 
BEGIN_MESSAGE_MAP(CPage5, CPropertyPage) 
	//{{AFX_MSG_MAP(CPage5) 
	ON_WM_VSCROLL() 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CPage5 message handlers 
///////////////////////////////////////////////////////////////////////////// 
// CPara 
 
IMPLEMENT_DYNAMIC(CPara, CPropertySheet) 
 
CPara::CPara(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage) 
	:CPropertySheet(nIDCaption, pParentWnd, iSelectPage) 
{ 
} 
 
CPara::CPara(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage) 
	:CPropertySheet(pszCaption, pParentWnd, iSelectPage) 
{ 
	AddPage(&m_page1); 
	AddPage(&m_page2); 
	AddPage(&m_page3); 
	AddPage(&m_page4); 
	AddPage(&m_page5); 
 
} 
 
CPara::~CPara() 
{ 
} 
 
 
BEGIN_MESSAGE_MAP(CPara, CPropertySheet) 
	//{{AFX_MSG_MAP(CPara) 
		// NOTE - the ClassWizard will add and remove mapping macros here. 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CPara message handlers 
 
void CPage1::OnOK()  
{ 
	// TODO: Add your specialized code here and/or call the base class 
	((CMDIFrameWnd*)AfxGetMainWnd())->MDIGetActive()->GetActiveView()->SendMessage(WM_USERAPPLY); 
	SetModified(false); 
	CPropertyPage::OnOK(); 
} 
 
void CPage1::CalcWindowRect(LPRECT lpClientRect, UINT nAdjustType)  
{ 
	// TODO: Add your specialized code here and/or call the base class 
	 
	CPropertyPage::CalcWindowRect(lpClientRect, nAdjustType); 
} 
 
void CPage1::OnAgcGain()  
{ 
	// TODO: Add your control notification handler code here 
	m_GainSelect=0; 
	m_bAGCGain=true; 
	m_bSECGain=false; 
	m_bCONGain=false; 
	EnableCtrl(); 
} 
 
void CPage1::OnSECGain()  
{ 
	// TODO: Add your control notification handler code here 
    m_GainSelect=1; 
	m_bAGCGain=false; 
	m_bSECGain=true; 
	m_bCONGain=false; 
	EnableCtrl(); 
} 
 
void CPage1::OnCONGain()  
{ 
	// TODO: Add your control notification handler code here 
	m_GainSelect=2; 
	m_bAGCGain=false; 
	m_bSECGain=false; 
	m_bCONGain=true; 
	EnableCtrl(); 
} 
void CPage1::OnUserGain()  
{ 
	// TODO: Add your control notification handler code here 
    m_GainSelect=3; 
	m_bAGCGain=false; 
	m_bSECGain=false; 
	m_bCONGain=false; 
	EnableCtrl(); 
} 
 
void CPage1::OnNoneGain()  
{ 
	// TODO: Add your control notification handler code here 
    m_GainSelect=4; 
    m_bAGCGain=false; 
	m_bSECGain=false; 
	m_bCONGain=false; 
	EnableCtrl(); 
} 
 
void CPage1::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)  
{ 
	// TODO: Add your message handler code here and/or call default 
	 
	 
	if(nSBCode==SB_ENDSCROLL) 
	{ return ;} 
	if(pScrollBar->GetDlgCtrlID()==IDC_SPIN1) 
	{ 
	   	m_fPusleNumber=(nPos*0.5f); 
		UpdateData(false); 
	} 
	CPropertyPage::OnVScroll(nSBCode, nPos, pScrollBar); 
} 
 
BOOL CPage1::OnInitDialog()  
{ 
	CPropertyPage::OnInitDialog(); 
	 
	// TODO: Add extra initialization here 
	CSpinButtonCtrl* pSpin1=(CSpinButtonCtrl*)GetDlgItem(IDC_SPIN1); 
	pSpin1->SetRange(2,8); 
	pSpin1->SetPos(2); 
	CSpinButtonCtrl* pSpin2=(CSpinButtonCtrl*)GetDlgItem(IDC_SPIN2); 
	pSpin2->SetRange(1,32767); 
	pSpin2->SetPos(200); 
	CSpinButtonCtrl* pSpin4=(CSpinButtonCtrl*)GetDlgItem(IDC_SPIN4); 
	pSpin4->SetRange(1,32767); 
	pSpin4->SetPos(200); 
	CSpinButtonCtrl* pSpin5=(CSpinButtonCtrl*)GetDlgItem(IDC_SPIN5); 
	pSpin5->SetRange(1,32767); 
	pSpin5->SetPos(200); 
     
   	return TRUE;  // return TRUE unless you set the focus to a control 
	              // EXCEPTION: OCX Property Pages should return FALSE 
} 
 
BOOL CPage5::OnInitDialog()  
{ 
	CPropertyPage::OnInitDialog(); 
	 
	// TODO: Add extra initialization here 
	CSpinButtonCtrl* pSpin1=(CSpinButtonCtrl*)GetDlgItem(IDC_SPIN1); 
	pSpin1->SetRange(0,30); 
	pSpin1->SetPos(int(m_fVelocity*100)); 
	return TRUE;  // return TRUE unless you set the focus to a control 
	              // EXCEPTION: OCX Property Pages should return FALSE 
} 
 
void CPage5::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)  
{ 
	// TODO: Add your message handler code here and/or call default 
	if(nSBCode==SB_ENDSCROLL) 
	{ return ;} 
	if(pScrollBar->GetDlgCtrlID()==IDC_SPIN1) 
	{ 
	    
		CSpinButtonCtrl* pSpin1= 
			(CSpinButtonCtrl*)GetDlgItem(IDC_SPIN1); 
			m_fVelocity=float((nPos)/100.0); 
		UpdateData(false); 
	} 
	CPropertyPage::OnVScroll(nSBCode, nPos, pScrollBar); 
} 
 
void CPage1::EnableCtrl() 
{ 
    GetDlgItem(IDC_AGC_PUSLE_NUMBER)->EnableWindow(m_bAGCGain); 
	GetDlgItem(IDC_AGC_MAX_GAIN)->EnableWindow(m_bAGCGain); 
	GetDlgItem(IDC_SPIN1)->EnableWindow(m_bAGCGain); 
	GetDlgItem(IDC_SPIN2)->EnableWindow(m_bAGCGain); 
	 
	GetDlgItem(IDC_SEC_ABSORB)->EnableWindow(m_bSECGain); 
	GetDlgItem(IDC_SEC_MAX_GAIN)->EnableWindow(m_bSECGain); 
    GetDlgItem(IDC_GAIN_VELOCITY)->EnableWindow(m_bSECGain);  
    GetDlgItem(IDC_SPIN3)->EnableWindow(m_bSECGain); 
	GetDlgItem(IDC_SPIN4)->EnableWindow(m_bSECGain); 
	 
	GetDlgItem(IDC_CON_GAIN)->EnableWindow(m_bCONGain); 
	GetDlgItem(IDC_SPIN5)->EnableWindow(m_bCONGain);  
} 
 
BOOL CPage2::OnInitDialog()  
{ 
	CPropertyPage::OnInitDialog(); 
	 
	// TODO: Add extra initialization here 
	CSpinButtonCtrl* pSpin1=(CSpinButtonCtrl*)GetDlgItem(IDC_SPIN1); 
	pSpin1->SetRange(1,10); 
	pSpin1->SetPos(1); 
	CSpinButtonCtrl* pSpin2=(CSpinButtonCtrl*)GetDlgItem(IDC_SPIN2); 
	pSpin2->SetRange(1,10); 
    pSpin2->SetPos(1); 
	return TRUE;  // return TRUE unless you set the focus to a control 
	              // EXCEPTION: OCX Property Pages should return FALSE 
} 
 
void CPage4::EnableCtrl() 
{ 
    GetDlgItem(IDC_FILL_SELECT)->EnableWindow(m_bAreaEnabled); 
	GetDlgItem(IDC_RADIO5)->EnableWindow(m_bAreaEnabled); 
	GetDlgItem(IDC_RADIO6)->EnableWindow(m_bAreaEnabled); 
	GetDlgItem(IDC_DISPLAY_WAVE)->EnableWindow(m_bAreaEnabled); 
    GetDlgItem(IDC_EDIT1)->EnableWindow(m_bAreaEnabled); 
	GetDlgItem(IDC_SPIN1)->EnableWindow(m_bAreaEnabled); 
 
	GetDlgItem(IDC_GRAY_SELECT)->EnableWindow(m_bGrayEnabled); 
	GetDlgItem(IDC_RADIO8)->EnableWindow(m_bGrayEnabled); 
    GetDlgItem(IDC_EDIT2)->EnableWindow(m_bGrayEnabled);  
    GetDlgItem(IDC_EDIT3)->EnableWindow(m_bGrayEnabled); 
	GetDlgItem(IDC_EDIT4)->EnableWindow(m_bGrayEnabled); 
	GetDlgItem(IDC_SPIN2)->EnableWindow(m_bGrayEnabled); 
/*	 
	GetDlgItem(IDC_SPIN3)->EnableWindow(m_bColorEnabled); 
	GetDlgItem(IDC_CON_GAIN)->EnableWindow(m_bColorEnabled); 
	GetDlgItem(IDC_SPIN5)->EnableWindow(m_bColorEnabled);  
*/ 
} 
 
 
 
void CPage4::OnGray()  
{ 
	// TODO: Add your control notification handler code here 
	m_DisplaySelect=1; 
    m_bAreaEnabled=false; 
	m_bGrayEnabled=true; 
	m_bColorEnabled=false; 
	EnableCtrl(); 
} 
 
void CPage4::OnColor()  
{ 
	// TODO: Add your control notification handler code here 
	m_DisplaySelect=2; 
    m_bAreaEnabled=false; 
	m_bGrayEnabled=false; 
	m_bColorEnabled=true; 
	EnableCtrl(); 
} 
 
void CPage4::OnArea()  
{ 
	// TODO: Add your control notification handler code here 
	m_DisplaySelect=0; 
    m_bAreaEnabled=true; 
	m_bGrayEnabled=false; 
	m_bColorEnabled=false; 
	EnableCtrl(); 
} 
 
BOOL CPage4::OnInitDialog()  
{ 
	CPropertyPage::OnInitDialog(); 
	 
	// TODO: Add extra initialization here 
	CSpinButtonCtrl* pSpin2=(CSpinButtonCtrl*)GetDlgItem(IDC_SPIN2); 
	pSpin2->SetRange(1,32767); 
	pSpin2->SetPos(30000); 
	return TRUE;  // return TRUE unless you set the focus to a control 
	              // EXCEPTION: OCX Property Pages should return FALSE 
}