// Util7433Dlg.cpp : implementation file // #include "stdafx.h" #include "Util7433.h" #include "Util7433Dlg.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() // CUtil7433Dlg dialog CUtil7433Dlg::CUtil7433Dlg(I16 hCard, CWnd* pParent /*=NULL*/) : CDialog(CUtil7433Dlg::IDD, pParent) { m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); m_hCard = hCard; m_nTimer = -1; m_dwInDataLow = m_dwInDataHigh = 0x00000000; } void CUtil7433Dlg::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); DDX_Control(pDX, IDC_ICON_DI16, m_Icon_DI16); DDX_Control(pDX, IDC_ICON_DI17, m_Icon_DI17); DDX_Control(pDX, IDC_ICON_DI18, m_Icon_DI18); DDX_Control(pDX, IDC_ICON_DI19, m_Icon_DI19); DDX_Control(pDX, IDC_ICON_DI20, m_Icon_DI20); DDX_Control(pDX, IDC_ICON_DI21, m_Icon_DI21); DDX_Control(pDX, IDC_ICON_DI22, m_Icon_DI22); DDX_Control(pDX, IDC_ICON_DI23, m_Icon_DI23); DDX_Control(pDX, IDC_ICON_DI24, m_Icon_DI24); DDX_Control(pDX, IDC_ICON_DI25, m_Icon_DI25); DDX_Control(pDX, IDC_ICON_DI26, m_Icon_DI26); DDX_Control(pDX, IDC_ICON_DI27, m_Icon_DI27); DDX_Control(pDX, IDC_ICON_DI28, m_Icon_DI28); DDX_Control(pDX, IDC_ICON_DI29, m_Icon_DI29); DDX_Control(pDX, IDC_ICON_DI30, m_Icon_DI30); DDX_Control(pDX, IDC_ICON_DI31, m_Icon_DI31); DDX_Control(pDX, IDC_ICON_DI32, m_Icon_DI32); DDX_Control(pDX, IDC_ICON_DI33, m_Icon_DI33); DDX_Control(pDX, IDC_ICON_DI34, m_Icon_DI34); DDX_Control(pDX, IDC_ICON_DI35, m_Icon_DI35); DDX_Control(pDX, IDC_ICON_DI36, m_Icon_DI36); DDX_Control(pDX, IDC_ICON_DI37, m_Icon_DI37); DDX_Control(pDX, IDC_ICON_DI38, m_Icon_DI38); DDX_Control(pDX, IDC_ICON_DI39, m_Icon_DI39); DDX_Control(pDX, IDC_ICON_DI40, m_Icon_DI40); DDX_Control(pDX, IDC_ICON_DI41, m_Icon_DI41); DDX_Control(pDX, IDC_ICON_DI42, m_Icon_DI42); DDX_Control(pDX, IDC_ICON_DI43, m_Icon_DI43); DDX_Control(pDX, IDC_ICON_DI44, m_Icon_DI44); DDX_Control(pDX, IDC_ICON_DI45, m_Icon_DI45); DDX_Control(pDX, IDC_ICON_DI46, m_Icon_DI46); DDX_Control(pDX, IDC_ICON_DI47, m_Icon_DI47); DDX_Control(pDX, IDC_ICON_DI48, m_Icon_DI48); DDX_Control(pDX, IDC_ICON_DI49, m_Icon_DI49); DDX_Control(pDX, IDC_ICON_DI50, m_Icon_DI50); DDX_Control(pDX, IDC_ICON_DI51, m_Icon_DI51); DDX_Control(pDX, IDC_ICON_DI52, m_Icon_DI52); DDX_Control(pDX, IDC_ICON_DI53, m_Icon_DI53); DDX_Control(pDX, IDC_ICON_DI54, m_Icon_DI54); DDX_Control(pDX, IDC_ICON_DI55, m_Icon_DI55); DDX_Control(pDX, IDC_ICON_DI56, m_Icon_DI56); DDX_Control(pDX, IDC_ICON_DI57, m_Icon_DI57); DDX_Control(pDX, IDC_ICON_DI58, m_Icon_DI58); DDX_Control(pDX, IDC_ICON_DI59, m_Icon_DI59); DDX_Control(pDX, IDC_ICON_DI60, m_Icon_DI60); DDX_Control(pDX, IDC_ICON_DI61, m_Icon_DI61); DDX_Control(pDX, IDC_ICON_DI62, m_Icon_DI62); DDX_Control(pDX, IDC_ICON_DI63, m_Icon_DI63); } BEGIN_MESSAGE_MAP(CUtil7433Dlg, CDialog) ON_WM_SYSCOMMAND() ON_WM_PAINT() ON_WM_QUERYDRAGICON() //}}AFX_MSG_MAP ON_WM_DESTROY() ON_WM_TIMER() END_MESSAGE_MAP() // CUtil7433Dlg message handlers BOOL CUtil7433Dlg::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 m_nTimer = SetTimer( 1, 250, NULL ); return TRUE; // return TRUE unless you set the focus to a control } void CUtil7433Dlg::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 CUtil7433Dlg::OnPaint() { if (IsIconic()) { CPaintDC dc(this); // device context for painting SendMessage(WM_ICONERASEBKGND, reinterpret_cast(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 CUtil7433Dlg::OnQueryDragIcon() { return static_cast(m_hIcon); } void CUtil7433Dlg::OnDestroy() { CDialog::OnDestroy(); // TODO: Add your message handler code here if( m_nTimer != -1 ) KillTimer( m_nTimer ); } void CUtil7433Dlg::OnTimer(UINT_PTR nIDEvent) { // TODO: Add your message handler code here and/or call default U32 dwPortData, dwChangeMask; DI_ReadPort(m_hCard, PORT_DI_LOW, &dwPortData); DO_WritePort(m_hCard, P7433R_DO_LED, dwPortData); dwChangeMask = dwPortData ^ m_dwInDataLow; if( dwChangeMask != 0x00 ) // Input had been changed { m_dwInDataLow = 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) ) ; } } if( (dwChangeMask & 0x10000) == 0x10000 ) // if the target bit is changed { if( (dwPortData & 0x10000) == 0x10000 ) { m_Icon_DI16.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI16.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x20000) == 0x20000 ) // if the target bit is changed { if( (dwPortData & 0x20000) == 0x20000 ) { m_Icon_DI17.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI17.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x40000) == 0x40000 ) // if the target bit is changed { if( (dwPortData & 0x40000) == 0x40000 ) { m_Icon_DI18.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI18.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x80000) == 0x80000 ) // if the target bit is changed { if( (dwPortData & 0x80000) == 0x80000 ) { m_Icon_DI19.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI19.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x100000) == 0x100000 ) // if the target bit is changed { if( (dwPortData & 0x100000) == 0x100000 ) { m_Icon_DI20.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI20.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x200000) == 0x200000 ) // if the target bit is changed { if( (dwPortData & 0x200000) == 0x200000 ) { m_Icon_DI21.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI21.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x400000) == 0x400000 ) // if the target bit is changed { if( (dwPortData & 0x400000) == 0x400000 ) { m_Icon_DI22.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI22.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x800000) == 0x800000 ) // if the target bit is changed { if( (dwPortData & 0x800000) == 0x800000 ) { m_Icon_DI23.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI23.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x1000000) == 0x1000000 ) // if the target bit is changed { if( (dwPortData & 0x1000000) == 0x1000000 ) { m_Icon_DI24.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI24.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x2000000) == 0x2000000 ) // if the target bit is changed { if( (dwPortData & 0x2000000) == 0x2000000 ) { m_Icon_DI25.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI25.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x4000000) == 0x4000000 ) // if the target bit is changed { if( (dwPortData & 0x4000000) == 0x4000000 ) { m_Icon_DI26.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI26.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x8000000) == 0x8000000 ) // if the target bit is changed { if( (dwPortData & 0x8000000) == 0x8000000 ) { m_Icon_DI27.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI27.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x10000000) == 0x10000000 ) // if the target bit is changed { if( (dwPortData & 0x10000000) == 0x10000000 ) { m_Icon_DI28.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI28.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x20000000) == 0x20000000 ) // if the target bit is changed { if( (dwPortData & 0x20000000) == 0x20000000 ) { m_Icon_DI29.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI29.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x40000000) == 0x40000000 ) // if the target bit is changed { if( (dwPortData & 0x40000000) == 0x40000000 ) { m_Icon_DI30.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI30.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x80000000) == 0x80000000 ) // if the target bit is changed { if( (dwPortData & 0x80000000) == 0x80000000 ) { m_Icon_DI31.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI31.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } } DI_ReadPort(m_hCard, PORT_DI_HIGH, &dwPortData); dwChangeMask = dwPortData ^ m_dwInDataHigh; if( dwChangeMask != 0x00 ) // Input had been changed { m_dwInDataHigh = dwPortData; // update the DI data if( (dwChangeMask & 0x01) == 0x01 ) // if the target bit is changed { if( (dwPortData & 0x01) == 0x01 ) { m_Icon_DI32.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI32.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x02) == 0x02 ) // if the target bit is changed { if( (dwPortData & 0x02) == 0x02 ) { m_Icon_DI33.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI33.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x04) == 0x04 ) // if the target bit is changed { if( (dwPortData & 0x04) == 0x04 ) { m_Icon_DI34.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI34.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x08) == 0x08 ) // if the target bit is changed { if( (dwPortData & 0x08) == 0x08 ) { m_Icon_DI35.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI35.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x10) == 0x10 ) // if the target bit is changed { if( (dwPortData & 0x10) == 0x10 ) { m_Icon_DI36.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI36.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x20) == 0x20 ) // if the target bit is changed { if( (dwPortData & 0x20) == 0x20 ) { m_Icon_DI37.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI37.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x40) == 0x40 ) // if the target bit is changed { if( (dwPortData & 0x40) == 0x40 ) { m_Icon_DI38.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI38.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x80) == 0x80 ) // if the target bit is changed { if( (dwPortData & 0x80) == 0x80 ) { m_Icon_DI39.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI39.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x100) == 0x100 ) // if the target bit is changed { if( (dwPortData & 0x100) == 0x100 ) { m_Icon_DI40.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI40.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x200) == 0x200 ) // if the target bit is changed { if( (dwPortData & 0x200) == 0x200 ) { m_Icon_DI41.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI41.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x400) == 0x400 ) // if the target bit is changed { if( (dwPortData & 0x400) == 0x400 ) { m_Icon_DI42.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI42.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x800) == 0x800 ) // if the target bit is changed { if( (dwPortData & 0x800) == 0x800 ) { m_Icon_DI43.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI43.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x1000) == 0x1000 ) // if the target bit is changed { if( (dwPortData & 0x1000) == 0x1000 ) { m_Icon_DI44.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI44.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x2000) == 0x2000 ) // if the target bit is changed { if( (dwPortData & 0x2000) == 0x2000 ) { m_Icon_DI45.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI45.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x4000) == 0x4000 ) // if the target bit is changed { if( (dwPortData & 0x4000) == 0x4000 ) { m_Icon_DI46.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI46.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x8000) == 0x8000 ) // if the target bit is changed { if( (dwPortData & 0x8000) == 0x8000 ) { m_Icon_DI47.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI47.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x10000) == 0x10000 ) // if the target bit is changed { if( (dwPortData & 0x10000) == 0x10000 ) { m_Icon_DI48.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI48.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x20000) == 0x20000 ) // if the target bit is changed { if( (dwPortData & 0x20000) == 0x20000 ) { m_Icon_DI49.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI49.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x40000) == 0x40000 ) // if the target bit is changed { if( (dwPortData & 0x40000) == 0x40000 ) { m_Icon_DI50.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI50.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x80000) == 0x80000 ) // if the target bit is changed { if( (dwPortData & 0x80000) == 0x80000 ) { m_Icon_DI51.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI51.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x100000) == 0x100000 ) // if the target bit is changed { if( (dwPortData & 0x100000) == 0x100000 ) { m_Icon_DI52.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI52.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x200000) == 0x200000 ) // if the target bit is changed { if( (dwPortData & 0x200000) == 0x200000 ) { m_Icon_DI53.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI53.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x400000) == 0x400000 ) // if the target bit is changed { if( (dwPortData & 0x400000) == 0x400000 ) { m_Icon_DI54.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI54.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x800000) == 0x800000 ) // if the target bit is changed { if( (dwPortData & 0x800000) == 0x800000 ) { m_Icon_DI55.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI55.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x1000000) == 0x1000000 ) // if the target bit is changed { if( (dwPortData & 0x1000000) == 0x1000000 ) { m_Icon_DI56.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI56.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x2000000) == 0x2000000 ) // if the target bit is changed { if( (dwPortData & 0x2000000) == 0x2000000 ) { m_Icon_DI57.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI57.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x4000000) == 0x4000000 ) // if the target bit is changed { if( (dwPortData & 0x4000000) == 0x4000000 ) { m_Icon_DI58.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI58.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x8000000) == 0x8000000 ) // if the target bit is changed { if( (dwPortData & 0x8000000) == 0x8000000 ) { m_Icon_DI59.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI59.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x10000000) == 0x10000000 ) // if the target bit is changed { if( (dwPortData & 0x10000000) == 0x10000000 ) { m_Icon_DI60.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI60.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x20000000) == 0x20000000 ) // if the target bit is changed { if( (dwPortData & 0x20000000) == 0x20000000 ) { m_Icon_DI61.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI61.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x40000000) == 0x40000000 ) // if the target bit is changed { if( (dwPortData & 0x40000000) == 0x40000000 ) { m_Icon_DI62.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI62.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } if( (dwChangeMask & 0x80000000) == 0x80000000 ) // if the target bit is changed { if( (dwPortData & 0x80000000) == 0x80000000 ) { m_Icon_DI63.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_RED) ) ; } else { m_Icon_DI63.SetIcon( AfxGetApp()->LoadIcon(IDI_ICON_BLACK) ) ; } } } CDialog::OnTimer(nIDEvent); }