// 87k_aoDlg.cpp : implementation file // #include "stdafx.h" #include "87k_ao.h" #include "87k_aoDlg.h" #include "PACSDK.h" #ifdef _DEBUG #define new DEBUG_NEW #endif // CMy87k_aoDlg dialog CMy87k_aoDlg::CMy87k_aoDlg(CWnd* pParent /*=NULL*/) : CDialog(CMy87k_aoDlg::IDD, pParent) { m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); } void CMy87k_aoDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); DDX_Control(pDX, IDC_COMBO1, cmbSlot); DDX_Control(pDX, IDC_EDIT1, txtTotalChannel); DDX_Control(pDX, IDC_EDIT2, txtWriteChannel); DDX_Control(pDX, IDC_EDIT3, txtValue); } BEGIN_MESSAGE_MAP(CMy87k_aoDlg, CDialog) #if defined(_DEVICE_RESOLUTION_AWARE) && !defined(WIN32_PLATFORM_WFSP) ON_WM_SIZE() #endif //}}AFX_MSG_MAP ON_BN_CLICKED(IDC_BUTTON1, &CMy87k_aoDlg::OnBnClickedButton1) ON_BN_CLICKED(IDC_BUTTON2, &CMy87k_aoDlg::OnBnClickedButton2) END_MESSAGE_MAP() // CMy87k_aoDlg message handlers BOOL CMy87k_aoDlg::OnInitDialog() { CDialog::OnInitDialog(); // Set the icon for this dialog. The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon // TODO: Add extra initialization here //set default value SetDlgItemText(IDC_COMBO1,L"3"); SetDlgItemText(IDC_EDIT1,L"4"); SetDlgItemText(IDC_EDIT2,L"1"); SetDlgItemText(IDC_EDIT3,L"3.5"); return TRUE; // return TRUE unless you set the focus to a control } #if defined(_DEVICE_RESOLUTION_AWARE) && !defined(WIN32_PLATFORM_WFSP) void CMy87k_aoDlg::OnSize(UINT /*nType*/, int /*cx*/, int /*cy*/) { if (AfxIsDRAEnabled()) { DRA::RelayoutDialog( AfxGetResourceHandle(), this->m_hWnd, DRA::GetDisplayMode() != DRA::Portrait ? MAKEINTRESOURCE(IDD_MY87K_AO_DIALOG_WIDE) : MAKEINTRESOURCE(IDD_MY87K_AO_DIALOG)); } } #endif void CMy87k_aoDlg::OnBnClickedButton1() { // TODO: Add your control notification handler code here HANDLE hPort = uart_Open(""); TCHAR temp[20]; CString strTemp; char ctemp[20]; float fValue = 0.0; //get user set slot GetDlgItemText(IDC_COMBO1,temp,20); int slot = _wtoi(temp); //get user set total channel GetDlgItemText(IDC_EDIT1,temp,20); int TotalChannel = _wtoi(temp); //get user set write channel GetDlgItemText(IDC_EDIT2,temp,20); int WriteChannel = _wtoi(temp); //get user set write data GetDlgItemText(IDC_EDIT3,strTemp); for(int i=0;i