提交 | 用户 | age
|
0ed438
|
1 |
// DialogSetCoil.cpp: 实现文件
|
Q |
2 |
//
|
|
3 |
|
|
4 |
#include "pch.h"
|
|
5 |
#include "MTerm2.h"
|
|
6 |
#include "DialogSetCoil.h"
|
|
7 |
#include "afxdialogex.h"
|
|
8 |
|
|
9 |
|
|
10 |
// CDialogSetCoil 对话框
|
|
11 |
|
|
12 |
IMPLEMENT_DYNAMIC(CDialogSetCoil, CDialogEx)
|
|
13 |
|
|
14 |
CDialogSetCoil::CDialogSetCoil(CWnd* pParent /*=nullptr*/)
|
|
15 |
: CDialogEx(IDD_DIALOG_SET_COIL, pParent)
|
|
16 |
{
|
|
17 |
|
|
18 |
}
|
|
19 |
|
|
20 |
CDialogSetCoil::~CDialogSetCoil()
|
|
21 |
{
|
|
22 |
}
|
|
23 |
|
|
24 |
void CDialogSetCoil::DoDataExchange(CDataExchange* pDX)
|
|
25 |
{
|
|
26 |
CDialogEx::DoDataExchange(pDX);
|
|
27 |
}
|
|
28 |
|
|
29 |
|
|
30 |
BEGIN_MESSAGE_MAP(CDialogSetCoil, CDialogEx)
|
|
31 |
END_MESSAGE_MAP()
|
|
32 |
|
|
33 |
|
|
34 |
// CDialogSetCoil 消息处理程序
|
|
35 |
|
|
36 |
|
|
37 |
BOOL CDialogSetCoil::OnInitDialog()
|
|
38 |
{
|
|
39 |
CDialogEx::OnInitDialog();
|
|
40 |
|
|
41 |
// TODO: 在此添加额外的初始化
|
|
42 |
ShowParams();
|
|
43 |
return TRUE; // return TRUE unless you set the focus to a control
|
|
44 |
// 异常: OCX 属性页应返回 FALSE
|
|
45 |
}
|
|
46 |
|
|
47 |
|
|
48 |
int CDialogSetCoil::ShowParams()
|
|
49 |
{
|
|
50 |
// TODO: 在此处添加实现代码.
|
|
51 |
CString s1;
|
|
52 |
s1 = _T("触点写入 ") + m_strAddr;
|
|
53 |
SetDlgItemText(IDC_STATIC_INFO, s1);
|
|
54 |
if (m_nStat) {
|
|
55 |
((CButton *)GetDlgItem(IDC_RADIO_SET_ON))->SetCheck(0);
|
|
56 |
((CButton *)GetDlgItem(IDC_RADIO_SET_OFF))->SetCheck(1);
|
|
57 |
}
|
|
58 |
else {
|
|
59 |
((CButton *)GetDlgItem(IDC_RADIO_SET_ON))->SetCheck(1);
|
|
60 |
((CButton *)GetDlgItem(IDC_RADIO_SET_OFF))->SetCheck(0);
|
|
61 |
}
|
|
62 |
|
|
63 |
return 0;
|
|
64 |
}
|
|
65 |
|
|
66 |
|
|
67 |
int CDialogSetCoil::GetParams()
|
|
68 |
{
|
|
69 |
// TODO: 在此处添加实现代码.
|
|
70 |
int j= ((CButton *)GetDlgItem(IDC_RADIO_SET_ON))->GetCheck();
|
|
71 |
m_nStat = j;
|
|
72 |
return 0;
|
|
73 |
}
|
|
74 |
|
|
75 |
void CDialogSetCoil::OnOK()
|
|
76 |
{
|
|
77 |
// TODO: 在此添加专用代码和/或调用基类
|
|
78 |
GetParams();
|
|
79 |
CDialogEx::OnOK();
|
|
80 |
}
|