• 大小: 4.81MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-10-30
  • 语言: 其他
  • 标签: 抢答器  

资源简介

基于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  基于单片机的抢答器与上位机设计\LEDScreenDemo\LEDScreen.cpp

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

评论

共有 条评论