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

📄 systemsetupdlg.cpp

📁 串行通讯程序,为电池分析仪与电脑通讯软件,效果不错.
💻 CPP
字号:
// SYSTEMSetupDlg.cpp : implementation file
//

#include "stdafx.h"
#include "DigitalPowerAnalyst.h"
#include "SYSTEMSetupDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CSYSTEMSetupDlg dialog


CSYSTEMSetupDlg::CSYSTEMSetupDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CSYSTEMSetupDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CSYSTEMSetupDlg)
	for(int i=0;i<7;i++)
	m_SystemSetup[i] = _T("");
	m_pOwner=NULL;
	IsDlgShow=FALSE;
	m_RadioOffOn = -1;
	//}}AFX_DATA_INIT
}


void CSYSTEMSetupDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CSYSTEMSetupDlg)
    DDX_Radio(pDX, IDC_RADIO1, m_RadioOffOn );
	DDX_Text(pDX, IDC_EDIT_Battery0, m_SystemSetup[0]);
	DDX_Text(pDX, IDC_EDIT_Battery001, m_SystemSetup[1]);
	DDX_Text(pDX, IDC_EDIT_Battery002, m_SystemSetup[2]);
	DDX_Text(pDX, IDC_EDIT_Battery003, m_SystemSetup[3]);
	DDX_Text(pDX, IDC_EDIT_Battery004, m_SystemSetup[4]);
	DDX_Text(pDX, IDC_EDIT_Battery005, m_SystemSetup[5]);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CSYSTEMSetupDlg, CDialog)
	//{{AFX_MSG_MAP(CSYSTEMSetupDlg)
	ON_BN_CLICKED(ID_SystemSetup1, OnSystemSetup1)
	ON_BN_CLICKED(ID_SystemSetup2, OnSystemSetup2)
	ON_BN_CLICKED(ID_SystemSetup3, OnSystemSetup3)
	ON_BN_CLICKED(ID_SystemSetup6, OnSystemSetup6)
	ON_BN_CLICKED(ID_SystemSetup7, OnSystemSetup7)
	ON_BN_CLICKED(ID_SystemSetup8, OnSystemSetup8)
	ON_BN_CLICKED(ID_SystemSetup4, OnSystemSetup4)
	ON_BN_CLICKED(ID_SystemSetup5, OnSystemSetup5)
	ON_BN_CLICKED(ID_SystemSetup9, OnSystemSetup9)
	ON_BN_CLICKED(ID_SystemSetup10, OnSystemSetup10)
	ON_BN_CLICKED(ID_SystemSetup11, OnSystemSetup11)
	ON_BN_CLICKED(ID_SystemSetup12, OnSystemSetup12)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSYSTEMSetupDlg message handlers

BOOL CSYSTEMSetupDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}


void CSYSTEMSetupDlg::OnSystemSetup1() 
{
	// TODO: Add your control notification handler code here
 	SendMessageToView(0x86);
}

void CSYSTEMSetupDlg::OnSystemSetup2() 
{
	// TODO: Add your control notification handler code here
	SendMessageToView(0x8A);	
}

void CSYSTEMSetupDlg::OnSystemSetup3() 
{
	// TODO: Add your control notification handler code here
	SendMessageToView(0x8D);
}

void CSYSTEMSetupDlg::OnSystemSetup6() 
{
	// TODO: Add your control notification handler code here
	SendMessageToView(0x9C);	
}

void CSYSTEMSetupDlg::OnSystemSetup7() 
{
	// TODO: Add your control notification handler code here
		SendMessageToView(0x9A);
}

void CSYSTEMSetupDlg::OnSystemSetup8() 
{
	// TODO: Add your control notification handler code here
		SendMessageToView(0x9B);
}

void CSYSTEMSetupDlg::OnSystemSetup4() 
{
	// TODO: Add your control notification handler code here
		SendMessageToView(0xA5);
}

void CSYSTEMSetupDlg::OnSystemSetup5() 
{
	// TODO: Add your control notification handler code here
		SendMessageToView(0xA4);
}

void CSYSTEMSetupDlg::OnSystemSetup9() 
{
	// TODO: Add your control notification handler code here
		SendMessageToView(0x8E);
}

void CSYSTEMSetupDlg::OnSystemSetup10() 
{
	// TODO: Add your control notification handler code here
		SendMessageToView(0xA1);
}

void CSYSTEMSetupDlg::OnSystemSetup11() 
{
	// TODO: Add your control notification handler code here
		SendMessageToView(0x9D);
}

void CSYSTEMSetupDlg::OnSystemSetup12() 
{
	// TODO: Add your control notification handler code here
		SendMessageToView(0xA0);
}


void CSYSTEMSetupDlg::SendMessageToView(unsigned char cmd)
{
    UpdateData( TRUE);
	m_SystemSetup[0]="";
	UpdateData( FALSE);
 	::SendMessage(m_pOwner->m_hWnd, WM_COMM_READAnaly , (WPARAM) cmd, (LPARAM) 0L);
}

void CSYSTEMSetupDlg::SetOwner(CView *m_pOwnerActul)
{
	m_pOwner=m_pOwnerActul;
}

void CSYSTEMSetupDlg::SystemUpdate(BOOL m_boolUpdate)
{
   UpdateData( m_boolUpdate);
}
void   CSYSTEMSetupDlg::OnOK() 
{
	// TODO: Add extra validation here
 	IsDlgShow=FALSE;
	CDialog::OnOK();
}

⌨️ 快捷键说明

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