基于单片机的抢答器与上位机设计


基于51单片机的抢答器设计以及上位机抢答设计,上位机的设计用到了CLED类等,界面能良好显示!!
资源截图
代码片段和文件信息
// StaticCounter.cpp : implementation file
//

#include “stdafx.h“
#include “LEDScreen.h“

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

/////////////////////////////////////////////////////////////////////////////
// CLEDScreen

//====================================================================
CLEDScreen::CLEDScreen():m_SymbolRect(0000)m_MatrixRect(0000)
{
symbDC = NULL;
backDC = NULL;

m_RightAligned = FALSE;

m_ScrollPos = 0;

m_recClient.left  = 0;
m_recClient.right = 0;

m_Space = 0;
m_Offset = 0;
m_NotchWidth  = 0;
m_NotchLength = 0;

// Set default background
m_crBackground = RGB(2550255); //::GetSysColor(COLOR_BTNFACE);
m_brBackground.CreateSolidBrush(m_crBackground);

// Set default foreground
m_crForeground = 0x0000FF00; //::GetSysColor(COLOR_BTNFACE);
m_brForeground.CreateSolidBrush(m_crForeground);

m_contents = _T(““);

m_bSpecifiedFadeColour = false;
m_bDrawFadedNotches = true;
m_bGotMetrics = false;
m_bDrawTransparent = false;
}


//====================================================================
CLEDScreen::~CLEDScreen()
{
if(symbDC) delete symbDC;
if(backDC) delete backDC;
}


//====================================================================
void CLEDScreen::SetColourBackGround(COLORREF cr)
{
// Set new background color
if (cr != 0xffffffff)
m_crBackground = cr;
else // Set default background color
m_crBackground = ::GetSysColor(COLOR_BTNFACE);

//backDC->m_crBackground = m_crBackground;

m_brBackground.Deleteobject();
    m_brBackground.CreateSolidBrush(m_crBackground);

Update();
}


//====================================================================
void CLEDScreen::SetColourForeGround(COLORREF cr)
{
// Set new foreground color
if (cr != 0xffffffff)
m_crForeground = cr;
else // Set default foreground color
m_crForeground = ::GetSysColor(COLOR_BTNTEXT);

Update();
}


//====================================================================
void CLEDScreen::SetColourFaded(COLORREF cr)
{
m_bSpecifiedFadeColour = true;
m_crDimForeground = cr;
Update();
}


//====================================================================
BEGIN_MESSAGE_MAP(CLEDScreen CStatic)
//{{AFX_MSG_MAP(CLEDScreen)
ON_WM_CTLCOLOR_REFLECT()
ON_WM_PAINT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()


//====================================================================
HBRUSH CLEDScreen::CtlColor(CDC* pDC UINT nCtlColor) 
{
pDC->SetTextColor(m_crForeground);
pDC->SetBkColor(m_crBackground);

    return (HBRUSH)m_brBackground; // Return non-NULL brush - the parent‘s handler is not called
}


//====================================================================
void CLEDScreen::OnPaint() 
{
GetClientRect(&m_recClient);

CPaintDC dc(this);

if (!backDC) 
{
backDC = new CMemDC(&dc m_recClient);
RedrawBkCanvas(

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

    .......     15693  2005-01-26 11:36  基于单片机的抢答器与上位机设计LEDScreenDemoLEDScreen.cpp

    .......      9056  2005-01-26 11:36  基于单片机的抢答器与上位机设计LEDScreenDemoLEDScreen.h

    .......      2128  2005-01-26 11:36  基于单片机的抢答器与上位机设计LEDScreenDemoLEDScreenDemo.cpp

    .......      4451  2005-01-26 11:36  基于单片机的抢答器与上位机设计LEDScreenDemoLEDScreenDemo.dsp

    .......       549  2005-01-26 11:36  基于单片机的抢答器与上位机设计LEDScreenDemoLEDScreenDemo.dsw

    .......      1401  2005-01-26 11:36  基于单片机的抢答器与上位机设计LEDScreenDemoLEDScreenDemo.h

     文件       9249  2011-09-26 15:55  基于单片机的抢答器与上位机设计LEDScreenDemoLEDScreenDemoDlg.cpp

     文件      54784  2011-09-26 15:55  基于单片机的抢答器与上位机设计LEDScreenDemoLEDScreenDemo.opt

    .......     99606  2005-01-26 11:36  基于单片机的抢答器与上位机设计LEDScreenDemo
esk.bmp

    .......      1078  2005-01-26 11:36  基于单片机的抢答器与上位机设计LEDScreenDemo
esLEDScreenDemo.ico

    .......       405  2005-01-26 11:36  基于单片机的抢答器与上位机设计LEDScreenDemo
esLEDScreenDemo.rc2

    .......       215  2005-01-26 11:36  基于单片机的抢答器与上位机设计LEDScreenDemoStdAfx.cpp

    .......       999  2005-01-26 11:36  基于单片机的抢答器与上位机设计LEDScreenDemoStdAfx.h

    .......    133632  2005-01-26 11:36  基于单片机的抢答器与上位机设计LEDScreenDemoReleaseLEDScreenDemo.exe

     文件      66560  2011-09-26 15:55  基于单片机的抢答器与上位机设计LEDScreenDemoLEDScreenDemo.ncb

     文件     111572  2011-09-26 15:23  基于单片机的抢答器与上位机设计LEDScreenDemoDebugLEDScreenDemo.res

     文件     214016  2011-09-26 15:23  基于单片机的抢答器与上位机设计LEDScreenDemoDebugvc60.idb

     文件    6912912  2011-09-25 21:19  基于单片机的抢答器与上位机设计LEDScreenDemoDebugLEDScreenDemo.pch

     文件     372736  2011-09-26 15:15  基于单片机的抢答器与上位机设计LEDScreenDemoDebugvc60.pdb

     文件    2843648  2011-09-26 15:23  基于单片机的抢答器与上位机设计LEDScreenDemoDebugLEDScreenDemo.pdb

     文件    1361548  2011-09-25 21:19  基于单片机的抢答器与上位机设计LEDScreenDemoDebugStdAfx.sbr

     文件     105666  2011-09-25 21:19  基于单片机的抢答器与上位机设计LEDScreenDemoDebugStdAfx.obj

     文件          0  2011-09-25 21:19  基于单片机的抢答器与上位机设计LEDScreenDemoDebugLEDScreen.sbr

     文件          0  2011-09-25 21:34  基于单片机的抢答器与上位机设计LEDScreenDemoDebugLEDScreenDemo.sbr

     文件          0  2011-09-25 21:34  基于单片机的抢答器与上位机设计LEDScreenDemoDebugLEDScreenDemoDlg.sbr

     文件      52206  2011-09-25 21:19  基于单片机的抢答器与上位机设计LEDScreenDemoDebugLEDScreen.obj

     文件    3138560  2011-09-25 21:34  基于单片机的抢答器与上位机设计LEDScreenDemoDebugLEDScreenDemo.bsc

     文件    1782312  2011-09-26 15:23  基于单片机的抢答器与上位机设计LEDScreenDemoDebugLEDScreenDemo.ilk

     文件    1540164  2011-09-26 15:23  基于单片机的抢答器与上位机设计LEDScreenDemoDebugLEDScreenDemo.exe

     文件      14207  2011-09-26 15:15  基于单片机的抢答器与上位机设计LEDScreenDemoDebugLEDScreenDemo.obj

............此处省略16个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)