You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
723 lines
15 KiB
723 lines
15 KiB
|
4 weeks ago
|
|
||
|
|
// Util7256Dlg.cpp : implementation file
|
||
|
|
//
|
||
|
|
|
||
|
|
#include "stdafx.h"
|
||
|
|
#include "Util7256.h"
|
||
|
|
#include "Util7256Dlg.h"
|
||
|
|
|
||
|
|
#ifdef _DEBUG
|
||
|
|
#define new DEBUG_NEW
|
||
|
|
#endif
|
||
|
|
|
||
|
|
|
||
|
|
// CAboutDlg dialog used for App About
|
||
|
|
|
||
|
|
class CAboutDlg : public CDialog
|
||
|
|
{
|
||
|
|
public:
|
||
|
|
CAboutDlg();
|
||
|
|
|
||
|
|
// Dialog Data
|
||
|
|
enum { IDD = IDD_ABOUTBOX };
|
||
|
|
|
||
|
|
protected:
|
||
|
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||
|
|
|
||
|
|
// Implementation
|
||
|
|
protected:
|
||
|
|
DECLARE_MESSAGE_MAP()
|
||
|
|
};
|
||
|
|
|
||
|
|
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
|
||
|
|
{
|
||
|
|
}
|
||
|
|
|
||
|
|
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
|
||
|
|
{
|
||
|
|
CDialog::DoDataExchange(pDX);
|
||
|
|
}
|
||
|
|
|
||
|
|
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
|
||
|
|
END_MESSAGE_MAP()
|
||
|
|
|
||
|
|
|
||
|
|
// CUtil7256Dlg dialog
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
CUtil7256Dlg::CUtil7256Dlg(I16 hCard, CWnd* pParent /*=NULL*/)
|
||
|
|
: CDialog(CUtil7256Dlg::IDD, pParent)
|
||
|
|
{
|
||
|
|
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
|
||
|
|
m_nTimer = -1;
|
||
|
|
m_hCard = hCard;
|
||
|
|
|
||
|
|
m_dwInData = 0x00000000;
|
||
|
|
m_dwOutData = 0x00000000;
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
void CUtil7256Dlg::DoDataExchange(CDataExchange* pDX)
|
||
|
|
{
|
||
|
|
CDialog::DoDataExchange(pDX);
|
||
|
|
DDX_Control(pDX, IDC_ICON_DI00, m_Icon_DI00);
|
||
|
|
DDX_Control(pDX, IDC_ICON_DI01, m_Icon_DI01);
|
||
|
|
DDX_Control(pDX, IDC_ICON_DI02, m_Icon_DI02);
|
||
|
|
DDX_Control(pDX, IDC_ICON_DI03, m_Icon_DI03);
|
||
|
|
DDX_Control(pDX, IDC_ICON_DI04, m_Icon_DI04);
|
||
|
|
DDX_Control(pDX, IDC_ICON_DI05, m_Icon_DI05);
|
||
|
|
DDX_Control(pDX, IDC_ICON_DI06, m_Icon_DI06);
|
||
|
|
DDX_Control(pDX, IDC_ICON_DI07, m_Icon_DI07);
|
||
|
|
DDX_Control(pDX, IDC_ICON_DI08, m_Icon_DI08);
|
||
|
|
DDX_Control(pDX, IDC_ICON_DI09, m_Icon_DI09);
|
||
|
|
DDX_Control(pDX, IDC_ICON_DI10, m_Icon_DI10);
|
||
|
|
DDX_Control(pDX, IDC_ICON_DI11, m_Icon_DI11);
|
||
|
|
DDX_Control(pDX, IDC_ICON_DI12, m_Icon_DI12);
|
||
|
|
DDX_Control(pDX, IDC_ICON_DI13, m_Icon_DI13);
|
||
|
|
DDX_Control(pDX, IDC_ICON_DI14, m_Icon_DI14);
|
||
|
|
DDX_Control(pDX, IDC_ICON_DI15, m_Icon_DI15);
|
||
|
|
}
|
||
|
|
|
||
|
|
BEGIN_MESSAGE_MAP(CUtil7256Dlg, CDialog)
|
||
|
|
ON_WM_SYSCOMMAND()
|
||
|
|
ON_WM_PAINT()
|
||
|
|
ON_WM_QUERYDRAGICON()
|
||
|
|
//}}AFX_MSG_MAP
|
||
|
|
ON_BN_CLICKED(IDC_CHECK_DO00, &CUtil7256Dlg::OnOut00)
|
||
|
|
ON_BN_CLICKED(IDC_CHECK_DO01, &CUtil7256Dlg::OnOut01)
|
||
|
|
ON_BN_CLICKED(IDC_CHECK_DO02, &CUtil7256Dlg::OnOut02)
|
||
|
|
ON_BN_CLICKED(IDC_CHECK_DO03, &CUtil7256Dlg::OnOut03)
|
||
|
|
ON_BN_CLICKED(IDC_CHECK_DO04, &CUtil7256Dlg::OnOut04)
|
||
|
|
ON_BN_CLICKED(IDC_CHECK_DO05, &CUtil7256Dlg::OnOut05)
|
||
|
|
ON_BN_CLICKED(IDC_CHECK_DO06, &CUtil7256Dlg::OnOut06)
|
||
|
|
ON_BN_CLICKED(IDC_CHECK_DO07, &CUtil7256Dlg::OnOut07)
|
||
|
|
ON_BN_CLICKED(IDC_CHECK_DO08, &CUtil7256Dlg::OnOut08)
|
||
|
|
ON_BN_CLICKED(IDC_CHECK_DO09, &CUtil7256Dlg::OnOut09)
|
||
|
|
ON_BN_CLICKED(IDC_CHECK_DO10, &CUtil7256Dlg::OnOut10)
|
||
|
|
ON_BN_CLICKED(IDC_CHECK_DO11, &CUtil7256Dlg::OnOut11)
|
||
|
|
ON_BN_CLICKED(IDC_CHECK_DO12, &CUtil7256Dlg::OnOut12)
|
||
|
|
ON_BN_CLICKED(IDC_CHECK_DO13, &CUtil7256Dlg::OnOut13)
|
||
|
|
ON_BN_CLICKED(IDC_CHECK_DO14, &CUtil7256Dlg::OnOut14)
|
||
|
|
ON_BN_CLICKED(IDC_CHECK_DO15, &CUtil7256Dlg::OnOut15)
|
||
|
|
ON_WM_DESTROY()
|
||
|
|
ON_WM_TIMER()
|
||
|
|
END_MESSAGE_MAP()
|
||
|
|
|
||
|
|
|
||
|
|
// CUtil7256Dlg message handlers
|
||
|
|
|
||
|
|
BOOL CUtil7256Dlg::OnInitDialog()
|
||
|
|
{
|
||
|
|
CDialog::OnInitDialog();
|
||
|
|
|
||
|
|
// Add "About..." menu item to system menu.
|
||
|
|
|
||
|
|
// IDM_ABOUTBOX must be in the system command range.
|
||
|
|
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
|
||
|
|
ASSERT(IDM_ABOUTBOX < 0xF000);
|
||
|
|
|
||
|
|
CMenu* pSysMenu = GetSystemMenu(FALSE);
|
||
|
|
if (pSysMenu != NULL)
|
||
|
|
{
|
||
|
|
BOOL bNameValid;
|
||
|
|
CString strAboutMenu;
|
||
|
|
bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX);
|
||
|
|
ASSERT(bNameValid);
|
||
|
|
if (!strAboutMenu.IsEmpty())
|
||
|
|
{
|
||
|
|
pSysMenu->AppendMenu(MF_SEPARATOR);
|
||
|
|
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
// 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
|
||
|
|
DO_WritePort( m_hCard, 0, m_dwOutData );
|
||
|
|
m_nTimer = SetTimer( 1, 250, NULL );
|
||
|
|
|
||
|
|
return TRUE; // return TRUE unless you set the focus to a control
|
||
|
|
}
|
||
|
|
|
||
|
|
void CUtil7256Dlg::OnSysCommand(UINT nID, LPARAM lParam)
|
||
|
|
{
|
||
|
|
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
|
||
|
|
{
|
||
|
|
CAboutDlg dlgAbout;
|
||
|
|
dlgAbout.DoModal();
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
CDialog::OnSysCommand(nID, lParam);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
// If you add a minimize button to your dialog, you will need the code below
|
||
|
|
// to draw the icon. For MFC applications using the document/view model,
|
||
|
|
// this is automatically done for you by the framework.
|
||
|
|
|
||
|
|
void CUtil7256Dlg::OnPaint()
|
||
|
|
{
|
||
|
|
if (IsIconic())
|
||
|
|
{
|
||
|
|
CPaintDC dc(this); // device context for painting
|
||
|
|
|
||
|
|
SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);
|
||
|
|
|
||
|
|
// Center icon in client rectangle
|
||
|
|
int cxIcon = GetSystemMetrics(SM_CXICON);
|
||
|
|
int cyIcon = GetSystemMetrics(SM_CYICON);
|
||
|
|
CRect rect;
|
||
|
|
GetClientRect(&rect);
|
||
|
|
int x = (rect.Width() - cxIcon + 1) / 2;
|
||
|
|
int y = (rect.Height() - cyIcon + 1) / 2;
|
||
|
|
|
||
|
|
// Draw the icon
|
||
|
|
dc.DrawIcon(x, y, m_hIcon);
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
CDialog::OnPaint();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
// The system calls this function to obtain the cursor to display while the user drags
|
||
|
|
// the minimized window.
|
||
|
|
HCURSOR CUtil7256Dlg::OnQueryDragIcon()
|
||
|
|
{
|
||
|
|
return static_cast<HCURSOR>(m_hIcon);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
void CUtil7256Dlg::OnDestroy()
|
||
|
|
{
|
||
|
|
CDialog::OnDestroy();
|
||
|
|
|
||
|
|
// TODO: Add your message handler code here
|
||
|
|
if( m_nTimer != -1 )
|
||
|
|
KillTimer( m_nTimer );
|
||
|
|
}
|
||
|
|
|
||
|
|
void CUtil7256Dlg::OnTimer(UINT_PTR nIDEvent)
|
||
|
|
{
|
||
|
|
// TODO: Add your message handler code here and/or call default
|
||
|
|
U32 dwPortData, dwChangeMask;
|
||
|
|
|
||
|
|
DI_ReadPort(m_hCard, 0 ,&dwPortData);
|
||
|
|
dwChangeMask = dwPortData ^ m_dwInData;
|
||
|
|
|
||
|
|
if( dwChangeMask != 0x00 ) // Input had been changed
|
||
|
|
{
|
||
|
|
m_dwInData = dwPortData; // update the DI data
|
||
|
|
|
||
|
|
if( (dwChangeMask & 0x01) == 0x01 ) // if the target bit is changed
|
||
|
|
{
|
||
|
|
if( (dwPortData & 0x01) == 0x01 )
|
||
|
|
{
|
||
|
|
m_Icon_DI00.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ;
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
m_Icon_DI00.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
if( (dwChangeMask & 0x02) == 0x02 ) // if the target bit is changed
|
||
|
|
{
|
||
|
|
if( (dwPortData & 0x02) == 0x02 )
|
||
|
|
{
|
||
|
|
m_Icon_DI01.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ;
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
m_Icon_DI01.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
if( (dwChangeMask & 0x04) == 0x04 ) // if the target bit is changed
|
||
|
|
{
|
||
|
|
if( (dwPortData & 0x04) == 0x04 )
|
||
|
|
{
|
||
|
|
m_Icon_DI02.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ;
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
m_Icon_DI02.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
if( (dwChangeMask & 0x08) == 0x08 ) // if the target bit is changed
|
||
|
|
{
|
||
|
|
if( (dwPortData & 0x08) == 0x08 )
|
||
|
|
{
|
||
|
|
m_Icon_DI03.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ;
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
m_Icon_DI03.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
if( (dwChangeMask & 0x10) == 0x10 ) // if the target bit is changed
|
||
|
|
{
|
||
|
|
if( (dwPortData & 0x10) == 0x10 )
|
||
|
|
{
|
||
|
|
m_Icon_DI04.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ;
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
m_Icon_DI04.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
if( (dwChangeMask & 0x20) == 0x20 ) // if the target bit is changed
|
||
|
|
{
|
||
|
|
if( (dwPortData & 0x20) == 0x20 )
|
||
|
|
{
|
||
|
|
m_Icon_DI05.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ;
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
m_Icon_DI05.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
if( (dwChangeMask & 0x40) == 0x40 ) // if the target bit is changed
|
||
|
|
{
|
||
|
|
if( (dwPortData & 0x40) == 0x40 )
|
||
|
|
{
|
||
|
|
m_Icon_DI06.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ;
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
m_Icon_DI06.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
if( (dwChangeMask & 0x80) == 0x80 ) // if the target bit is changed
|
||
|
|
{
|
||
|
|
if( (dwPortData & 0x80) == 0x80 )
|
||
|
|
{
|
||
|
|
m_Icon_DI07.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ;
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
m_Icon_DI07.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
if( (dwChangeMask & 0x100) == 0x100 ) // if the target bit is changed
|
||
|
|
{
|
||
|
|
if( (dwPortData & 0x100) == 0x100 )
|
||
|
|
{
|
||
|
|
m_Icon_DI08.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ;
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
m_Icon_DI08.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
if( (dwChangeMask & 0x200) == 0x200 ) // if the target bit is changed
|
||
|
|
{
|
||
|
|
if( (dwPortData & 0x200) == 0x200 )
|
||
|
|
{
|
||
|
|
m_Icon_DI09.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ;
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
m_Icon_DI09.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
if( (dwChangeMask & 0x400) == 0x400 ) // if the target bit is changed
|
||
|
|
{
|
||
|
|
if( (dwPortData & 0x400) == 0x400 )
|
||
|
|
{
|
||
|
|
m_Icon_DI10.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ;
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
m_Icon_DI10.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
if( (dwChangeMask & 0x800) == 0x800 ) // if the target bit is changed
|
||
|
|
{
|
||
|
|
if( (dwPortData & 0x800) == 0x800 )
|
||
|
|
{
|
||
|
|
m_Icon_DI11.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ;
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
m_Icon_DI11.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
if( (dwChangeMask & 0x1000) == 0x1000 ) // if the target bit is changed
|
||
|
|
{
|
||
|
|
if( (dwPortData & 0x1000) == 0x1000 )
|
||
|
|
{
|
||
|
|
m_Icon_DI12.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ;
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
m_Icon_DI12.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
if( (dwChangeMask & 0x2000) == 0x2000 ) // if the target bit is changed
|
||
|
|
{
|
||
|
|
if( (dwPortData & 0x2000) == 0x2000 )
|
||
|
|
{
|
||
|
|
m_Icon_DI13.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ;
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
m_Icon_DI13.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
if( (dwChangeMask & 0x4000) == 0x4000 ) // if the target bit is changed
|
||
|
|
{
|
||
|
|
if( (dwPortData & 0x4000) == 0x4000 )
|
||
|
|
{
|
||
|
|
m_Icon_DI14.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ;
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
m_Icon_DI14.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
if( (dwChangeMask & 0x8000) == 0x8000 ) // if the target bit is changed
|
||
|
|
{
|
||
|
|
if( (dwPortData & 0x8000) == 0x8000 )
|
||
|
|
{
|
||
|
|
m_Icon_DI15.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ;
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
m_Icon_DI15.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
CDialog::OnTimer(nIDEvent);
|
||
|
|
}
|
||
|
|
|
||
|
|
void CUtil7256Dlg::OnOut00()
|
||
|
|
{
|
||
|
|
// TODO: Add your control notification handler code here
|
||
|
|
int CheckSts;
|
||
|
|
|
||
|
|
CheckSts = ((CButton*)GetDlgItem( IDC_CHECK_DO00 ))->GetCheck();
|
||
|
|
|
||
|
|
if( CheckSts == BST_CHECKED )
|
||
|
|
{
|
||
|
|
m_dwOutData |= 0x01;
|
||
|
|
}
|
||
|
|
else if( CheckSts == BST_UNCHECKED )
|
||
|
|
{
|
||
|
|
m_dwOutData &= (~0x01);
|
||
|
|
}
|
||
|
|
|
||
|
|
DO_WritePort( m_hCard, 0, m_dwOutData );
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
void CUtil7256Dlg::OnOut01()
|
||
|
|
{
|
||
|
|
// TODO: Add your control notification handler code here
|
||
|
|
int CheckSts;
|
||
|
|
|
||
|
|
CheckSts = ((CButton*)GetDlgItem( IDC_CHECK_DO01 ))->GetCheck();
|
||
|
|
|
||
|
|
if( CheckSts == BST_CHECKED )
|
||
|
|
{
|
||
|
|
m_dwOutData |= 0x02;
|
||
|
|
}
|
||
|
|
else if( CheckSts == BST_UNCHECKED )
|
||
|
|
{
|
||
|
|
m_dwOutData &= (~0x02);
|
||
|
|
}
|
||
|
|
|
||
|
|
DO_WritePort( m_hCard, 0, m_dwOutData );
|
||
|
|
}
|
||
|
|
|
||
|
|
void CUtil7256Dlg::OnOut02()
|
||
|
|
{
|
||
|
|
// TODO: Add your control notification handler code here
|
||
|
|
int CheckSts;
|
||
|
|
|
||
|
|
CheckSts = ((CButton*)GetDlgItem( IDC_CHECK_DO02 ))->GetCheck();
|
||
|
|
|
||
|
|
if( CheckSts == BST_CHECKED )
|
||
|
|
{
|
||
|
|
m_dwOutData |= 0x04;
|
||
|
|
}
|
||
|
|
else if( CheckSts == BST_UNCHECKED )
|
||
|
|
{
|
||
|
|
m_dwOutData &= (~0x04);
|
||
|
|
}
|
||
|
|
|
||
|
|
DO_WritePort( m_hCard, 0, m_dwOutData );
|
||
|
|
}
|
||
|
|
|
||
|
|
void CUtil7256Dlg::OnOut03()
|
||
|
|
{
|
||
|
|
// TODO: Add your control notification handler code here
|
||
|
|
int CheckSts;
|
||
|
|
|
||
|
|
CheckSts = ((CButton*)GetDlgItem( IDC_CHECK_DO03 ))->GetCheck();
|
||
|
|
|
||
|
|
if( CheckSts == BST_CHECKED )
|
||
|
|
{
|
||
|
|
m_dwOutData |= 0x08;
|
||
|
|
}
|
||
|
|
else if( CheckSts == BST_UNCHECKED )
|
||
|
|
{
|
||
|
|
m_dwOutData &= (~0x08);
|
||
|
|
}
|
||
|
|
|
||
|
|
DO_WritePort( m_hCard, 0, m_dwOutData );
|
||
|
|
}
|
||
|
|
|
||
|
|
void CUtil7256Dlg::OnOut04()
|
||
|
|
{
|
||
|
|
// TODO: Add your control notification handler code here
|
||
|
|
int CheckSts;
|
||
|
|
|
||
|
|
CheckSts = ((CButton*)GetDlgItem( IDC_CHECK_DO04 ))->GetCheck();
|
||
|
|
|
||
|
|
if( CheckSts == BST_CHECKED )
|
||
|
|
{
|
||
|
|
m_dwOutData |= 0x10;
|
||
|
|
}
|
||
|
|
else if( CheckSts == BST_UNCHECKED )
|
||
|
|
{
|
||
|
|
m_dwOutData &= (~0x10);
|
||
|
|
}
|
||
|
|
|
||
|
|
DO_WritePort( m_hCard, 0, m_dwOutData );
|
||
|
|
}
|
||
|
|
|
||
|
|
void CUtil7256Dlg::OnOut05()
|
||
|
|
{
|
||
|
|
// TODO: Add your control notification handler code here
|
||
|
|
int CheckSts;
|
||
|
|
|
||
|
|
CheckSts = ((CButton*)GetDlgItem( IDC_CHECK_DO05 ))->GetCheck();
|
||
|
|
|
||
|
|
if( CheckSts == BST_CHECKED )
|
||
|
|
{
|
||
|
|
m_dwOutData |= 0x20;
|
||
|
|
}
|
||
|
|
else if( CheckSts == BST_UNCHECKED )
|
||
|
|
{
|
||
|
|
m_dwOutData &= (~0x20);
|
||
|
|
}
|
||
|
|
|
||
|
|
DO_WritePort( m_hCard, 0, m_dwOutData );
|
||
|
|
}
|
||
|
|
|
||
|
|
void CUtil7256Dlg::OnOut06()
|
||
|
|
{
|
||
|
|
// TODO: Add your control notification handler code here
|
||
|
|
int CheckSts;
|
||
|
|
|
||
|
|
CheckSts = ((CButton*)GetDlgItem( IDC_CHECK_DO06 ))->GetCheck();
|
||
|
|
|
||
|
|
if( CheckSts == BST_CHECKED )
|
||
|
|
{
|
||
|
|
m_dwOutData |= 0x40;
|
||
|
|
}
|
||
|
|
else if( CheckSts == BST_UNCHECKED )
|
||
|
|
{
|
||
|
|
m_dwOutData &= (~0x40);
|
||
|
|
}
|
||
|
|
|
||
|
|
DO_WritePort( m_hCard, 0, m_dwOutData );
|
||
|
|
}
|
||
|
|
|
||
|
|
void CUtil7256Dlg::OnOut07()
|
||
|
|
{
|
||
|
|
// TODO: Add your control notification handler code here
|
||
|
|
int CheckSts;
|
||
|
|
|
||
|
|
CheckSts = ((CButton*)GetDlgItem( IDC_CHECK_DO07 ))->GetCheck();
|
||
|
|
|
||
|
|
if( CheckSts == BST_CHECKED )
|
||
|
|
{
|
||
|
|
m_dwOutData |= 0x80;
|
||
|
|
}
|
||
|
|
else if( CheckSts == BST_UNCHECKED )
|
||
|
|
{
|
||
|
|
m_dwOutData &= (~0x80);
|
||
|
|
}
|
||
|
|
|
||
|
|
DO_WritePort( m_hCard, 0, m_dwOutData );
|
||
|
|
}
|
||
|
|
|
||
|
|
void CUtil7256Dlg::OnOut08()
|
||
|
|
{
|
||
|
|
// TODO: Add your control notification handler code here
|
||
|
|
int CheckSts;
|
||
|
|
|
||
|
|
CheckSts = ((CButton*)GetDlgItem( IDC_CHECK_DO08 ))->GetCheck();
|
||
|
|
|
||
|
|
if( CheckSts == BST_CHECKED )
|
||
|
|
{
|
||
|
|
m_dwOutData |= 0x100;
|
||
|
|
}
|
||
|
|
else if( CheckSts == BST_UNCHECKED )
|
||
|
|
{
|
||
|
|
m_dwOutData &= (~0x100);
|
||
|
|
}
|
||
|
|
|
||
|
|
DO_WritePort( m_hCard, 0, m_dwOutData );
|
||
|
|
}
|
||
|
|
|
||
|
|
void CUtil7256Dlg::OnOut09()
|
||
|
|
{
|
||
|
|
// TODO: Add your control notification handler code here
|
||
|
|
int CheckSts;
|
||
|
|
|
||
|
|
CheckSts = ((CButton*)GetDlgItem( IDC_CHECK_DO09 ))->GetCheck();
|
||
|
|
|
||
|
|
if( CheckSts == BST_CHECKED )
|
||
|
|
{
|
||
|
|
m_dwOutData |= 0x200;
|
||
|
|
}
|
||
|
|
else if( CheckSts == BST_UNCHECKED )
|
||
|
|
{
|
||
|
|
m_dwOutData &= (~0x200);
|
||
|
|
}
|
||
|
|
|
||
|
|
DO_WritePort( m_hCard, 0, m_dwOutData );
|
||
|
|
}
|
||
|
|
|
||
|
|
void CUtil7256Dlg::OnOut10()
|
||
|
|
{
|
||
|
|
// TODO: Add your control notification handler code here
|
||
|
|
int CheckSts;
|
||
|
|
|
||
|
|
CheckSts = ((CButton*)GetDlgItem( IDC_CHECK_DO10 ))->GetCheck();
|
||
|
|
|
||
|
|
if( CheckSts == BST_CHECKED )
|
||
|
|
{
|
||
|
|
m_dwOutData |= 0x400;
|
||
|
|
}
|
||
|
|
else if( CheckSts == BST_UNCHECKED )
|
||
|
|
{
|
||
|
|
m_dwOutData &= (~0x400);
|
||
|
|
}
|
||
|
|
|
||
|
|
DO_WritePort( m_hCard, 0, m_dwOutData );
|
||
|
|
}
|
||
|
|
|
||
|
|
void CUtil7256Dlg::OnOut11()
|
||
|
|
{
|
||
|
|
// TODO: Add your control notification handler code here
|
||
|
|
int CheckSts;
|
||
|
|
|
||
|
|
CheckSts = ((CButton*)GetDlgItem( IDC_CHECK_DO11 ))->GetCheck();
|
||
|
|
|
||
|
|
if( CheckSts == BST_CHECKED )
|
||
|
|
{
|
||
|
|
m_dwOutData |= 0x800;
|
||
|
|
}
|
||
|
|
else if( CheckSts == BST_UNCHECKED )
|
||
|
|
{
|
||
|
|
m_dwOutData &= (~0x800);
|
||
|
|
}
|
||
|
|
|
||
|
|
DO_WritePort( m_hCard, 0, m_dwOutData );
|
||
|
|
}
|
||
|
|
|
||
|
|
void CUtil7256Dlg::OnOut12()
|
||
|
|
{
|
||
|
|
// TODO: Add your control notification handler code here
|
||
|
|
int CheckSts;
|
||
|
|
|
||
|
|
CheckSts = ((CButton*)GetDlgItem( IDC_CHECK_DO12 ))->GetCheck();
|
||
|
|
|
||
|
|
if( CheckSts == BST_CHECKED )
|
||
|
|
{
|
||
|
|
m_dwOutData |= 0x1000;
|
||
|
|
}
|
||
|
|
else if( CheckSts == BST_UNCHECKED )
|
||
|
|
{
|
||
|
|
m_dwOutData &= (~0x1000);
|
||
|
|
}
|
||
|
|
|
||
|
|
DO_WritePort( m_hCard, 0, m_dwOutData );
|
||
|
|
}
|
||
|
|
|
||
|
|
void CUtil7256Dlg::OnOut13()
|
||
|
|
{
|
||
|
|
// TODO: Add your control notification handler code here
|
||
|
|
int CheckSts;
|
||
|
|
|
||
|
|
CheckSts = ((CButton*)GetDlgItem( IDC_CHECK_DO13 ))->GetCheck();
|
||
|
|
|
||
|
|
if( CheckSts == BST_CHECKED )
|
||
|
|
{
|
||
|
|
m_dwOutData |= 0x2000;
|
||
|
|
}
|
||
|
|
else if( CheckSts == BST_UNCHECKED )
|
||
|
|
{
|
||
|
|
m_dwOutData &= (~0x2000);
|
||
|
|
}
|
||
|
|
|
||
|
|
DO_WritePort( m_hCard, 0, m_dwOutData );
|
||
|
|
}
|
||
|
|
|
||
|
|
void CUtil7256Dlg::OnOut14()
|
||
|
|
{
|
||
|
|
// TODO: Add your control notification handler code here
|
||
|
|
int CheckSts;
|
||
|
|
|
||
|
|
CheckSts = ((CButton*)GetDlgItem( IDC_CHECK_DO14 ))->GetCheck();
|
||
|
|
|
||
|
|
if( CheckSts == BST_CHECKED )
|
||
|
|
{
|
||
|
|
m_dwOutData |= 0x4000;
|
||
|
|
}
|
||
|
|
else if( CheckSts == BST_UNCHECKED )
|
||
|
|
{
|
||
|
|
m_dwOutData &= (~0x4000);
|
||
|
|
}
|
||
|
|
|
||
|
|
DO_WritePort( m_hCard, 0, m_dwOutData );
|
||
|
|
}
|
||
|
|
|
||
|
|
void CUtil7256Dlg::OnOut15()
|
||
|
|
{
|
||
|
|
// TODO: Add your control notification handler code here
|
||
|
|
int CheckSts;
|
||
|
|
|
||
|
|
CheckSts = ((CButton*)GetDlgItem( IDC_CHECK_DO15 ))->GetCheck();
|
||
|
|
|
||
|
|
if( CheckSts == BST_CHECKED )
|
||
|
|
{
|
||
|
|
m_dwOutData |= 0x8000;
|
||
|
|
}
|
||
|
|
else if( CheckSts == BST_UNCHECKED )
|
||
|
|
{
|
||
|
|
m_dwOutData &= (~0x8000);
|
||
|
|
}
|
||
|
|
|
||
|
|
DO_WritePort( m_hCard, 0, m_dwOutData );
|
||
|
|
}
|