📄 optionsdlg.cpp
字号:
/////////////////////////////////////////////////////////////////////////////
//
// OPC DataAccess VC++ Client: OptionsDlg.CPP
// (Source File)
//
/////////////////////////////////////////////////////////////////////////////
//
// Author: Raphael Imhof
// Initial Date: 11/04/98
// $Workfile: OptionsDlg.cpp $
// $Revision: 1 $
// $Date: 7/27/99 5:23p $
// Target System: Microsoft Windows NT 4.0
// Environment: Visual C++ 5.0 / OPC DataAccess 1.0/2.0
// Remarks:
//
/////////////////////////////////////////////////////////////////////////////
//
// Description: implementation of the COptionsDlg class.
// options for internal parameters for certain functions.
//
//
/////////////////////////////////////////////////////////////////////////////
//
// History of Changes (Please remove very old comments and blank lines!)
// $Log: /IDK/OPCServer/clients/VC++/InfoServerExplorer/OptionsDlg.cpp $
//
// 1 7/27/99 5:23p Imhof
//
// 1 7/27/99 5:19p Imhof
//
// 6 2/24/99 2:02p Imhof
// Added ValidateItem option and support
//
// 5 1/15/99 6:43p Imhof
// Updated legal notice.
//
// 4 12/15/98 10:06a Imhof
//
// 3 12/11/98 5:58p Imhof
// Made modifications for OPC 2.0.
//
// 2 11/10/98 2:20p Imhof
// Added file header's.
//
//
// $Nokeywords:$ (To avoid useless search while checking in.)
/////////////////////////////////////////////////////////////////////////////
// Copyright (C) 1998, Siemens Building Technologies, Inc. Landis Division
//
// SIEMENS BUILDING TECHNOLOGIES, INC. IS PROVIDING THE FOLLOWING
// EXAMPLES OF CODE AS SAMPLE ONLY.
//
// SIEMENS BUILDING TECHNOLOGIES, INC. MAKES NO REPRESENTATIONS
// OR WARRANTIES OF ANY KIND WITH RESPECT TO THE VALIDTY OF THE
// CODES OR DESIRED RESULTS AND DISCLAIMS ALL SUCH
// REPRESENTATIONS AND WARRANTIES, INCLUDING FOR EXAMPLE,
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE. SIEMENS BUILIDNG TECHNOLOGIES, INC. DOES NOT
// REPRESENT OR WARRANT THAT THE FOLLOWING CODE SAMPLES ARE
// ACCURATE, VALID, COMPLETE OR CURRENT.
//
/////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "infoserverexplorer.h"
#include "MainFrm.h"
#include "infoserverexplorerdoc.h"
#include "OptionsDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// COptionsDlg dialog
COptionsDlg::COptionsDlg(CWnd* pParent /*=NULL*/)
: CDialog(COptionsDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(COptionsDlg)
m_iReloadEnumNextElements = 0;
m_iReloadEnumMethod = 0;
m_iBrowserEnumNextElements = 0;
m_iReloadEnumAttributesNextElements = 0;
m_iOPCVersion = 1; //OPC 2.0
m_iDataChangeType = 1; //with time stamp
m_bValidateItems = FALSE;
//}}AFX_DATA_INIT
}
void COptionsDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(COptionsDlg)
DDX_Text(pDX, IDC_OPTIONS_RELOAD_ENUM_NEXT_ELEMENTS, m_iReloadEnumNextElements);
DDX_Radio(pDX, IDC_OPTIONS_RELOAD_IENUMSTRING, m_iReloadEnumMethod);
DDX_Text(pDX, IDC_OPTIONS_BROWSER_ENUM_NEXT_ELEMENTS, m_iBrowserEnumNextElements);
DDX_Text(pDX, IDC_OPTIONS_RELOAD_ENUM_ATTRIBUTES_NEXT_ELEMENTS, m_iReloadEnumAttributesNextElements);
DDX_Radio(pDX, IDC_OPCVERSION_10, m_iOPCVersion);
DDX_Radio(pDX, IDC_DATACHANGE_NOTIME, m_iDataChangeType);
DDX_Check(pDX, IDC_VALIDATE_ITEMS, m_bValidateItems);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(COptionsDlg, CDialog)
//{{AFX_MSG_MAP(COptionsDlg)
ON_BN_CLICKED(IDC_OPCVERSION_10, OnOpcversion10)
ON_BN_CLICKED(IDC_OPCVERSION_20, OnOpcversion20)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// COptionsDlg message handlers
void COptionsDlg::OnOpcversion10()
{
// TODO: Add your control notification handler code here
GetDlgItem(IDC_DATACHANGE_STATIC)->EnableWindow(TRUE);
GetDlgItem(IDC_DATACHANGE_NOTIME)->EnableWindow(TRUE);
GetDlgItem(IDC_DATACHANGE_TIME)->EnableWindow(TRUE);
}
void COptionsDlg::OnOpcversion20()
{
// TODO: Add your control notification handler code here
GetDlgItem(IDC_DATACHANGE_STATIC)->EnableWindow(FALSE);
GetDlgItem(IDC_DATACHANGE_NOTIME)->EnableWindow(FALSE);
GetDlgItem(IDC_DATACHANGE_TIME)->EnableWindow(FALSE);
}
BOOL COptionsDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
CMainFrame* pMainFrame = (CMainFrame*) AfxGetMainWnd();
CInfoServerExplorerDoc* pDoc = (CInfoServerExplorerDoc*) pMainFrame->GetActiveDocument();
if(pDoc->GetInfoServer()->IsConnected())
{
GetDlgItem(IDC_OPCVERSION_10)->EnableWindow(FALSE);
GetDlgItem(IDC_OPCVERSION_20)->EnableWindow(FALSE);
}
if(m_iOPCVersion >= 1) //OPC 2
OnOpcversion20();
else
OnOpcversion10();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -