📄 setpage3.cpp
字号:
// SetPage3.cpp : implementation file
//
#include "stdafx.h"
#include "DxManger.h"
#include "SetPage3.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSetPage3 property page
IMPLEMENT_DYNCREATE(CSetPage3, CPropertyPage)
CSetPage3::CSetPage3() : CPropertyPage(CSetPage3::IDD)
{
//{{AFX_DATA_INIT(CSetPage3)
m_lchk_bnumber = FALSE;
m_lchk_curalldl = FALSE;
m_lchk_curfdl = FALSE;
m_lchk_curgdl = FALSE;
m_lchk_curpdl = FALSE;
m_lchk_dis_dot = FALSE;
m_lchk_disdetect = FALSE;
m_lchk_jvnum = FALSE;
m_rchk_salldl = FALSE;
m_rchk_sfdl = FALSE;
m_rchk_sgdl = FALSE;
m_rchk_spdl = FALSE;
m_rchk_ssalldl = FALSE;
m_rchk_ssfdl = FALSE;
m_rchk_ssgdl = FALSE;
m_rchk_sspdl = FALSE;
m_edt_offtime = 0;
m_edt_ontime = 0;
//}}AFX_DATA_INIT
}
CSetPage3::~CSetPage3()
{
}
void CSetPage3::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSetPage3)
DDX_Control(pDX, IDC_SPIN_OFFTIME, m_spin_offtime);
DDX_Control(pDX, IDC_SPIN_ONTIME, m_spin_ontime);
DDX_Check(pDX, IDC_LCHK_BNUMBER, m_lchk_bnumber);
DDX_Check(pDX, IDC_LCHK_CURALLDL, m_lchk_curalldl);
DDX_Check(pDX, IDC_LCHK_CURFDL, m_lchk_curfdl);
DDX_Check(pDX, IDC_LCHK_CURGDL, m_lchk_curgdl);
DDX_Check(pDX, IDC_LCHK_CURPDL, m_lchk_curpdl);
DDX_Check(pDX, IDC_LCHK_DIS_DOT, m_lchk_dis_dot);
DDX_Check(pDX, IDC_LCHK_DISDETECT, m_lchk_disdetect);
DDX_Check(pDX, IDC_LCHK_JVNUM, m_lchk_jvnum);
DDX_Check(pDX, IDC_RCHK_SALLDL, m_rchk_salldl);
DDX_Check(pDX, IDC_RCHK_SFDL, m_rchk_sfdl);
DDX_Check(pDX, IDC_RCHK_SGDL, m_rchk_sgdl);
DDX_Check(pDX, IDC_RCHK_SPDL, m_rchk_spdl);
DDX_Check(pDX, IDC_RCHK_SSALLDL, m_rchk_ssalldl);
DDX_Check(pDX, IDC_RCHK_SSFDL, m_rchk_ssfdl);
DDX_Check(pDX, IDC_RCHK_SSGDL, m_rchk_ssgdl);
DDX_Check(pDX, IDC_RCHK_SSPDL, m_rchk_sspdl);
DDX_Text(pDX, IDC_EDT_OFFTIME, m_edt_offtime);
DDV_MinMaxByte(pDX, m_edt_offtime, 0, 99);
DDX_Text(pDX, IDC_EDT_ONTIME, m_edt_ontime);
DDV_MinMaxByte(pDX, m_edt_ontime, 0, 99);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CSetPage3, CPropertyPage)
//{{AFX_MSG_MAP(CSetPage3)
ON_BN_CLICKED(IDC_BTN_SELECTALL, OnBtnSelectall)
ON_BN_CLICKED(IDC_BTN_CANCLEALL, OnBtnCancleall)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSetPage3 message handlers
/////////////////////////////////////////////////////////////////////////////
// CSetPage1 property page
IMPLEMENT_DYNCREATE(CSetPage1, CPropertyPage)
CSetPage1::CSetPage1() : CPropertyPage(CSetPage1::IDD)
{
//{{AFX_DATA_INIT(CSetPage1)
m_time = 0;
m_date = 0;
m_chk_autocbday = FALSE;
m_chk_broadcast = FALSE;
m_chk_clear = FALSE;
m_chk_date = FALSE;
m_chk_time = FALSE;
m_chk_setdaytimes = FALSE;
m_chk_setjvnumber = FALSE;
m_edt_nsetdaytimes = 2;
m_edt_setjvnumber = _T("000000000001");
m_edt_clear_h = 0.0;
m_edt_clear_l = 0.0;
m_edt_clear_m = 0.0;
m_edt_clearall = 0.0;
m_chk_setclear_mima = FALSE;
m_chk_setdbnumber = FALSE;
m_chk_setprg_mima = FALSE;
m_edt_setclear_mima = _T("123456");
m_edt_setdbnumber = _T("000000000001");
m_edt_setprg_mima = _T("123456");
m_chk_dbconst = FALSE;
m_edt_str_dbconst = _T("1600");
//}}AFX_DATA_INIT
}
CSetPage1::~CSetPage1()
{
}
void CSetPage1::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSetPage1)
DDX_Control(pDX, IDC_COMBO_AUTOHOUR, m_combo_autohour);
DDX_Control(pDX, IDC_COMBO_AUTODAY, m_combo_autoday);
DDX_DateTimeCtrl(pDX, IDC_DATETIMEPICKER1, m_time);
DDX_DateTimeCtrl(pDX, IDC_DATETIMEPICKER2, m_date);
DDX_Check(pDX, IDC_CHK_AUTOCBDAY, m_chk_autocbday);
DDX_Check(pDX, IDC_CHK_BROADCAST, m_chk_broadcast);
DDX_Check(pDX, IDC_CHK_CLEAR, m_chk_clear);
DDX_Check(pDX, IDC_CHK_DATE, m_chk_date);
DDX_Check(pDX, IDC_CHK_TIME, m_chk_time);
DDX_Check(pDX, IDC_CHK_SETDAYTIMES, m_chk_setdaytimes);
DDX_Check(pDX, IDC_CHK_SETJVNUMBER, m_chk_setjvnumber);
DDX_Text(pDX, IDC_EDT_SETDAYTIMES, m_edt_nsetdaytimes);
DDV_MinMaxInt(pDX, m_edt_nsetdaytimes, 0, 99);
DDX_Text(pDX, IDC_EDT_SETJVNUMBER, m_edt_setjvnumber);
DDV_MaxChars(pDX, m_edt_setjvnumber, 12);
DDX_Text(pDX, IDC_EDT_CLEAR_H, m_edt_clear_h);
DDV_MinMaxDouble(pDX, m_edt_clear_h, 0., 999999.99);
DDX_Text(pDX, IDC_EDT_CLEAR_L, m_edt_clear_l);
DDV_MinMaxDouble(pDX, m_edt_clear_l, 0., 999999.99);
DDX_Text(pDX, IDC_EDT_CLEAR_M, m_edt_clear_m);
DDV_MinMaxDouble(pDX, m_edt_clear_m, 0., 999999.99);
DDX_Text(pDX, IDC_EDT_CLEARALL, m_edt_clearall);
DDV_MinMaxDouble(pDX, m_edt_clearall, 0., 999999.99);
DDX_Check(pDX, IDC_CHK_SETCLEAR_MIMA, m_chk_setclear_mima);
DDX_Check(pDX, IDC_CHK_SETDBNUMBER, m_chk_setdbnumber);
DDX_Check(pDX, IDC_CHK_SETPRG_MIMA, m_chk_setprg_mima);
DDX_Text(pDX, IDC_EDT_SETCLEAR_MIMA, m_edt_setclear_mima);
DDV_MaxChars(pDX, m_edt_setclear_mima, 6);
DDX_Text(pDX, IDC_EDT_SETDBNUMBER, m_edt_setdbnumber);
DDV_MaxChars(pDX, m_edt_setdbnumber, 12);
DDX_Text(pDX, IDC_EDT_SETPRG_MIMA, m_edt_setprg_mima);
DDV_MaxChars(pDX, m_edt_setprg_mima, 6);
DDX_Check(pDX, IDC_CHK_DBCONST, m_chk_dbconst);
DDX_Text(pDX, IDC_EDT_DBCONST, m_edt_str_dbconst);
DDV_MaxChars(pDX, m_edt_str_dbconst, 6);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CSetPage1, CPropertyPage)
//{{AFX_MSG_MAP(CSetPage1)
ON_EN_CHANGE(IDC_EDT_SETJVNUMBER, OnChangeEdtSetjvnumber)
ON_EN_CHANGE(IDC_EDT_CLEAR_H, OnChangeEdtClearH)
ON_EN_CHANGE(IDC_EDT_CLEAR_M, OnChangeEdtClearM)
ON_EN_CHANGE(IDC_EDT_CLEAR_L, OnChangeEdtClearL)
ON_EN_CHANGE(IDC_EDT_CLEARALL, OnChangeEdtClearall)
ON_EN_KILLFOCUS(IDC_EDT_CLEAR_H, OnKillfocusEdtClearH)
ON_EN_KILLFOCUS(IDC_EDT_CLEAR_M, OnKillfocusEdtClearM)
ON_EN_KILLFOCUS(IDC_EDT_CLEAR_L, OnKillfocusEdtClearL)
ON_BN_CLICKED(IDC_BTN_SELECTALL, OnBtnSelectall)
ON_BN_CLICKED(IDC_BTN_CANCLEALL, OnBtnCancleall)
ON_WM_TIMER()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSetPage1 message handlers
/////////////////////////////////////////////////////////////////////////////
// CSetPage2 property page
IMPLEMENT_DYNCREATE(CSetPage2, CPropertyPage)
CSetPage2::CSetPage2() : CPropertyPage(CSetPage2::IDD)
{
//{{AFX_DATA_INIT(CSetPage2)
m_edit_num = 0;
//}}AFX_DATA_INIT
}
CSetPage2::~CSetPage2()
{
}
void CSetPage2::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSetPage2)
DDX_Control(pDX, IDC_COMBO_FL5, m_combo_fl5);
DDX_Control(pDX, IDC_SPIN_NUM, m_spin_num);
DDX_Control(pDX, IDC_COMBO_FL12, m_combo_fl12);
DDX_Control(pDX, IDC_COMBO_FL11, m_combo_fl11);
DDX_Control(pDX, IDC_COMBO_FL10, m_combo_fl10);
DDX_Control(pDX, IDC_COMBO_FL9, m_combo_fl9);
DDX_Control(pDX, IDC_COMBO_FL8, m_combo_fl8);
DDX_Control(pDX, IDC_COMBO_FL7, m_combo_fl7);
DDX_Control(pDX, IDC_COMBO_FL6, m_combo_fl6);
DDX_Control(pDX, IDC_COMBO_FL4, m_combo_fl4);
DDX_Control(pDX, IDC_COMBO_FL3, m_combo_fl3);
DDX_Control(pDX, IDC_COMBO_FL2, m_combo_fl2);
DDX_Control(pDX, IDC_COMBO_FL1, m_combo_fl1);
DDX_Control(pDX, IDC_DATETIMEPICKER12, m_time12);
DDX_Control(pDX, IDC_DATETIMEPICKER11, m_time11);
DDX_Control(pDX, IDC_DATETIMEPICKER10, m_time10);
DDX_Control(pDX, IDC_DATETIMEPICKER9, m_time9);
DDX_Control(pDX, IDC_DATETIMEPICKER8, m_time8);
DDX_Control(pDX, IDC_DATETIMEPICKER7, m_time7);
DDX_Control(pDX, IDC_DATETIMEPICKER6, m_time6);
DDX_Control(pDX, IDC_DATETIMEPICKER5, m_time5);
DDX_Control(pDX, IDC_DATETIMEPICKER4, m_time4);
DDX_Control(pDX, IDC_DATETIMEPICKER3, m_time3);
DDX_Control(pDX, IDC_DATETIMEPICKER2, m_time2);
DDX_Control(pDX, IDC_DATETIMEPICKER1, m_time1);
DDX_Text(pDX, IDC_EDIT_FL_NUMBER, m_edit_num);
DDV_MinMaxByte(pDX, m_edit_num, 0, 12);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CSetPage2, CPropertyPage)
//{{AFX_MSG_MAP(CSetPage2)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSetPage2 message handlers
BOOL CSetPage1::OnInitDialog()
{
CPropertyPage::OnInitDialog();
m_combo_autoday.SetCurSel(0);
m_combo_autohour.SetCurSel(0);
// TODO: Add extra initialization here
CDateTimeCtrl *htimectr;
htimectr=(CDateTimeCtrl *)this->GetDlgItem(IDC_DATETIMEPICKER1);
htimectr->SetTime(COleDateTime::GetCurrentTime());
htimectr=(CDateTimeCtrl *)this->GetDlgItem(IDC_DATETIMEPICKER2);
htimectr->SetTime(COleDateTime::GetCurrentTime());
SetTimer(1,1000,NULL);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
BYTE CSetPage1::getweek()
{
UpdateData();
BYTE result;
if(m_date.GetDayOfWeek()==1)
result=7;
else result=m_date.GetDayOfWeek()-1;
return result;
}
BYTE CSetPage1::getday()
{
BYTE result;
UpdateData();
result=m_date.GetDay();
return result;
}
BYTE CSetPage1::getmonth()
{
UpdateData();
BYTE month=m_date.GetMonth();
return month;
}
BYTE CSetPage1::getyear()
{
UpdateData();
BYTE year=m_date.GetYear()-2000;
return year;
}
void CSetPage1::update()
{
// CDateTimeCtrl *htimectr;
// htimectr=(CDateTimeCtrl *)this->GetDlgItem(IDC_DATETIMEPICKER1);
//htimectr->SetTime(COleDateTime::GetCurrentTime());
// htimectr=(CDateTimeCtrl *)this->GetDlgItem(IDC_DATETIMEPICKER2);
// htimectr->SetTime(COleDateTime::GetCurrentTime());
UpdateData();
}
void CSetPage1::OnChangeEdtSetjvnumber()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CPropertyPage::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
UpdateData(TRUE);
int len=m_edt_setjvnumber.GetLength();
BYTE tempchar[255];
m_edt_setjvnumber.MakeUpper();
if(!m_edt_setjvnumber.IsEmpty())
for(int i=0;i<len;i++)
{
tempchar[i]=m_edt_setjvnumber[i];
if( (tempchar[i]<'0'||tempchar[i]>'9'))
{
m_edt_setjvnumber.Insert(i,'\0');
UpdateData(FALSE);
}
}
// TODO: Add your control notification handler code here
}
void CSetPage1::UpdatJvnumber()
{
CEdit *hedit;
UpdateData(FALSE);
hedit=(CEdit *)GetDlgItem(IDC_EDT_SETJVNUMBER);
hedit->RedrawWindow();
hedit=(CEdit *)GetDlgItem(IDC_EDT_SETDBNUMBER);
hedit->RedrawWindow();
}
void CSetPage1::OnChangeEdtClearH()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CPropertyPage::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
}
void CSetPage1::OnChangeEdtClearM()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CPropertyPage::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
}
void CSetPage1::OnChangeEdtClearL()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CPropertyPage::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
}
void CSetPage1::OnChangeEdtClearall()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CPropertyPage::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
}
void CSetPage1::OnKillfocusEdtClearH()
{
// TODO: Add your control notification handler code here
UpdateData();
m_edt_clearall=m_edt_clear_h+m_edt_clear_m+m_edt_clear_l;
UpdateData(FALSE);
}
void CSetPage1::OnKillfocusEdtClearM()
{
// TODO: Add your control notification handler code here
UpdateData();
m_edt_clearall=m_edt_clear_h+m_edt_clear_m+m_edt_clear_l;
UpdateData(FALSE);
}
void CSetPage1::OnKillfocusEdtClearL()
{
// TODO: Add your control notification handler code here
UpdateData();
m_edt_clearall=m_edt_clear_h+m_edt_clear_m+m_edt_clear_l;
UpdateData(FALSE);
}
void CSetPage1::OnBtnSelectall()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
m_chk_autocbday=TRUE;
m_chk_broadcast=TRUE;
m_chk_clear=TRUE;
m_chk_date=TRUE;
m_chk_time=TRUE;
m_chk_setdaytimes=TRUE;
m_chk_setjvnumber=TRUE;
m_chk_setclear_mima=TRUE;
m_chk_setdbnumber=TRUE;
m_chk_setprg_mima=TRUE;
m_chk_dbconst=TRUE;
UpdateData(FALSE);
}
void CSetPage1::OnBtnCancleall()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
m_chk_autocbday=FALSE;
m_chk_broadcast=FALSE;
m_chk_clear=FALSE;
m_chk_date=FALSE;
m_chk_time=FALSE;
m_chk_setdaytimes=FALSE;
m_chk_setjvnumber=FALSE;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -