⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 timerset.cpp

📁 opc client 的开发工具
💻 CPP
字号:
// TimerSet.cpp : implementation file
//

#include "stdafx.h"
#include "vcsvr.h"
#include "TimerSet.h"
#include "MainFrm.h"
#include "TagDef.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CTimerSet dialog


CTimerSet::CTimerSet(CWnd* pParent /*=NULL*/)
	: CDialog(CTimerSet::IDD, pParent)
{
	//{{AFX_DATA_INIT(CTimerSet)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CTimerSet::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CTimerSet)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CTimerSet, CDialog)
	//{{AFX_MSG_MAP(CTimerSet)
	ON_WM_SHOWWINDOW()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CTimerSet message handlers
//设置设备标签刷新周期
void CTimerSet::OnOK() 
{
	// TODO: Add extra validation here
	long newInterval;
	CString str;
	CWnd *pWnd = GetParent();
	CEdit *pWndEdit= (CEdit *)GetDlgItem(IDC_EDIT1);
	pWndEdit->GetWindowText(str);
	newInterval = atoi(str.GetBuffer(str.GetLength()));
	if(newInterval!=TimerInterval)
	{
		TimerInterval=newInterval;
		KillTimer(ID_TIMER);
		pWnd->SetTimer(ID_TIMER,TimerInterval,NULL);
	}
	CDialog::OnOK();
}
//显示当前刷新周期
void CTimerSet::OnShowWindow(BOOL bShow, UINT nStatus) 
{
	CDialog::OnShowWindow(bShow, nStatus);
	char Interval[6];
	itoa(TimerInterval,Interval,10);
	CEdit *pWndEdit= (CEdit *)GetDlgItem(IDC_EDIT1);
	pWndEdit->SetWindowText(Interval);
}

void CTimerSet::OnCancel() 
{
	// TODO: Add extra cleanup here
	
	CDialog::OnCancel();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -