⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hmican_usbdlg.cpp

📁 面板显示程序
💻 CPP
📖 第 1 页 / 共 5 页
字号:
// HMIcan_usbDlg.cpp : implementation file
//

#include "stdafx.h"
#include "HMIcan_usb.h"
#include "HMIcan_usbDlg.h"
#include "HMIexitDlg.h"
#include "HMI_A_PASSWORD_Dlg.h"
#include "HMI_C_PASSWORD_Dlg.h"
#include "ControlCAN.h"  ////////////////////
#include "SCDSET.h"
#include "CXTSET.h"
#include "P_TOILSET.h"
#include "MODE.h"
#include "MXA_MEP.h"
#include "MXA_MEP_BIG.h"
#include "MXA_MEP_SMALL.h"

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

#include "GradientProgressCtrl.h"

CBitmap m_bmpBg;
CBrush m_brBk;
	
//CGradientProgressCtrl	m_cProgress1;//扩展进度条
//CGradientProgressCtrl	m_cProgress2;
//CGradientProgressCtrl	m_cProgress3;
//CGradientProgressCtrl	m_cProgress4;

/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About

class CAboutDlg : public CDialog
{
public:
	CAboutDlg();

// Dialog Data
	//{{AFX_DATA(CAboutDlg)
	enum { IDD = IDD_ABOUTBOX };
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CAboutDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	//{{AFX_MSG(CAboutDlg)
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
	//{{AFX_DATA_INIT(CAboutDlg)
	//}}AFX_DATA_INIT
}

void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CAboutDlg)
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
	//{{AFX_MSG_MAP(CAboutDlg)
		// No message handlers
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CHMIcan_usbDlg dialog

CHMIcan_usbDlg::CHMIcan_usbDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CHMIcan_usbDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CHMIcan_usbDlg)
	//}}AFX_DATA_INIT
	// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void CHMIcan_usbDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CHMIcan_usbDlg)
	DDX_Control(pDX, IDC_PROGRESS1, m_cProgress1);
	DDX_Control(pDX, IDC_PROGRESS2, m_cProgress2);
	DDX_Control(pDX, IDC_PROGRESS3, m_cProgress3);
	DDX_Control(pDX, IDC_STATIC_TIP7, m_tip7);
	DDX_Control(pDX, IDC_STATIC_TIP6, m_tip6);
	DDX_Control(pDX, IDC_STATIC_TIP5, m_tip5);
	DDX_Control(pDX, IDC_STATIC_TIP4, m_tip4);
	DDX_Control(pDX, IDC_STATIC_TIP3, m_tip3);
	DDX_Control(pDX, IDC_STATIC_TIP2, m_tip2);
	DDX_Control(pDX, IDC_STATIC_TIP1, m_tip1);
	DDX_Control(pDX, IDC_LIST1, m_list);

	DDX_Control(pDX, IDC_DG11, m_Dg11);
	DDX_Control(pDX, IDC_DG12, m_Dg12);
	DDX_Control(pDX, IDC_DG13, m_Dg13);
	DDX_Control(pDX, IDC_DG14, m_Dg14);
	DDX_Control(pDX, IDC_DG15, m_Dg15);
	DDX_Control(pDX, IDC_DG21, m_Dg21);
	DDX_Control(pDX, IDC_DG22, m_Dg22);
	DDX_Control(pDX, IDC_DG23, m_Dg23);
	DDX_Control(pDX, IDC_DG24, m_Dg24);
	DDX_Control(pDX, IDC_DG25, m_Dg25);
	DDX_Control(pDX, IDC_DG31, m_Dg31);
	DDX_Control(pDX, IDC_DG32, m_Dg32);
	DDX_Control(pDX, IDC_DG33, m_Dg33);
	DDX_Control(pDX, IDC_DG34, m_Dg34);
	DDX_Control(pDX, IDC_DG35, m_Dg35);
	DDX_Control(pDX, IDC_DG41, m_Dg41);
	DDX_Control(pDX, IDC_DG42, m_Dg42);
	DDX_Control(pDX, IDC_DG43, m_Dg43);
	DDX_Control(pDX, IDC_DG44, m_Dg44);
	DDX_Control(pDX, IDC_DG45, m_Dg45);
	DDX_Control(pDX, IDC_DG51, m_Dg51);
	DDX_Control(pDX, IDC_DG52, m_Dg52);
	DDX_Control(pDX, IDC_DG53, m_Dg53);
	DDX_Control(pDX, IDC_DG54, m_Dg54);
	DDX_Control(pDX, IDC_DG55, m_Dg55);
	DDX_Control(pDX, IDC_DG61, m_Dg61);
	DDX_Control(pDX, IDC_DG62, m_Dg62);
	DDX_Control(pDX, IDC_DG63, m_Dg63);
	DDX_Control(pDX, IDC_DG64, m_Dg64);
	DDX_Control(pDX, IDC_DG65, m_Dg65);
	DDX_Control(pDX, IDC_DG71, m_Dg71);
	DDX_Control(pDX, IDC_DG72, m_Dg72);
	DDX_Control(pDX, IDC_DG73, m_Dg73);
	DDX_Control(pDX, IDC_DG74, m_Dg74);
	DDX_Control(pDX, IDC_DG75, m_Dg75);
	DDX_Control(pDX, IDC_DG81, m_Dg81);
	DDX_Control(pDX, IDC_DG82, m_Dg82);
	DDX_Control(pDX, IDC_DG83, m_Dg83);
	DDX_Control(pDX, IDC_DG84, m_Dg84);
	DDX_Control(pDX, IDC_DG85, m_Dg85);
	DDX_Control(pDX, IDC_DG91, m_Dg91);
	DDX_Control(pDX, IDC_DG92, m_Dg92);
	DDX_Control(pDX, IDC_DG93, m_Dg93);
	DDX_Control(pDX, IDC_DG94, m_Dg94);
	DDX_Control(pDX, IDC_DG95, m_Dg95);
	DDX_Control(pDX, IDC_DG101, m_Dg101);
	DDX_Control(pDX, IDC_DG102, m_Dg102);
	DDX_Control(pDX, IDC_DG103, m_Dg103);
	DDX_Control(pDX, IDC_DG104, m_Dg104);
	DDX_Control(pDX, IDC_DG105, m_Dg105);
	DDX_Control(pDX, IDC_DG111, m_Dg111);
	DDX_Control(pDX, IDC_DG112, m_Dg112);
	DDX_Control(pDX, IDC_DG113, m_Dg113);
	DDX_Control(pDX, IDC_DG114, m_Dg114);
	DDX_Control(pDX, IDC_DG115, m_Dg115);
	DDX_Control(pDX, IDC_DG121, m_Dg121);
	DDX_Control(pDX, IDC_DG122, m_Dg122);
	DDX_Control(pDX, IDC_DG123, m_Dg123);
	DDX_Control(pDX, IDC_DG124, m_Dg124);
	DDX_Control(pDX, IDC_DG125, m_Dg125);
	DDX_Control(pDX, IDC_DG131, m_Dg131);
	DDX_Control(pDX, IDC_DG132, m_Dg132);
	DDX_Control(pDX, IDC_DG133, m_Dg133);
	DDX_Control(pDX, IDC_DG134, m_Dg134);
	DDX_Control(pDX, IDC_DG135, m_Dg135);
	DDX_Control(pDX, IDC_DG141, m_Dg141);
	DDX_Control(pDX, IDC_DG142, m_Dg142);
	DDX_Control(pDX, IDC_DG143, m_Dg143);
	DDX_Control(pDX, IDC_DG144, m_Dg144);
	DDX_Control(pDX, IDC_DG145, m_Dg145);
	DDX_Control(pDX, IDC_DG151, m_Dg151);
	DDX_Control(pDX, IDC_DG152, m_Dg152);
	DDX_Control(pDX, IDC_DG153, m_Dg153);
	DDX_Control(pDX, IDC_DG154, m_Dg154);
	DDX_Control(pDX, IDC_DG155, m_Dg155);
	DDX_Control(pDX, IDC_DG161, m_Dg161);
	DDX_Control(pDX, IDC_DG162, m_Dg162);
	DDX_Control(pDX, IDC_DG163, m_Dg163);
	DDX_Control(pDX, IDC_DG164, m_Dg164);
	DDX_Control(pDX, IDC_DG165, m_Dg165);
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CHMIcan_usbDlg, CDialog)
	//{{AFX_MSG_MAP(CHMIcan_usbDlg)
	ON_WM_SYSCOMMAND()
	ON_WM_PAINT()
	ON_WM_QUERYDRAGICON()
	ON_WM_CTLCOLOR()
	ON_WM_TIMER()
	ON_WM_DESTROY()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CHMIcan_usbDlg message handlers

BOOL CHMIcan_usbDlg::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)
	{
		CString strAboutMenu;
		strAboutMenu.LoadString(IDS_ABOUTBOX);
		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_bmpBg.LoadBitmap(IDB_BITMAP_BACKGROUND);
	m_brBk.CreatePatternBrush(&m_bmpBg);
	m_bmpBg.DeleteObject();

//字体设置
	lstrcpy((LPSTR)logfont.lfFaceName,(LPSTR)"Arial bold");
	logfont.lfWeight=2000;   
	logfont.lfWidth=30;   
	logfont.lfHeight=40;   
	logfont.lfEscapement=0;   
	logfont.lfUnderline=FALSE;   
	logfont.lfItalic=FALSE;   
	logfont.lfStrikeOut=FALSE;   
	logfont.lfCharSet=GB2312_CHARSET;

	lstrcpy((LPSTR)logfont1.lfFaceName,(LPSTR)"Arial bold");
	logfont1.lfWeight=800;   
	logfont1.lfWidth=18;   
	logfont1.lfHeight=20;   
	logfont1.lfEscapement=0;   
	logfont1.lfUnderline=FALSE;   
	logfont1.lfItalic=FALSE;   
	logfont1.lfStrikeOut=FALSE;   
	logfont1.lfCharSet=GB2312_CHARSET;

	lstrcpy((LPSTR)logfont2.lfFaceName,(LPSTR)"方正姚体");
	logfont2.lfWeight=600;   
	logfont2.lfWidth=10;   
	logfont2.lfHeight=18;   
	logfont2.lfEscapement=0;   
	logfont2.lfUnderline=FALSE;   
	logfont2.lfItalic=FALSE;   
	logfont2.lfStrikeOut=FALSE;   
	logfont2.lfCharSet=GB2312_CHARSET;

	lstrcpy((LPSTR)logfont3.lfFaceName,(LPSTR)"方正姚体");
	logfont3.lfWeight=1000;   
	logfont3.lfWidth=10;   
	logfont3.lfHeight=18;   
	logfont3.lfEscapement=0;   
	logfont3.lfUnderline=FALSE;   
	logfont3.lfItalic=FALSE;   
	logfont3.lfStrikeOut=FALSE;   
	logfont3.lfCharSet=GB2312_CHARSET;

//静态框,编辑框颜色,背景设置
	 bk = RGB(0, 0, 130);
	 bk1 = RGB(255, 255, 0);
	 tx = RGB(0, 255, 255);
	 tx1 = RGB(255, 0, 255);
	 tx2 = RGB(255, 255, 0);
	 tx3 = RGB(255, 0, 0);
	 tx4 = RGB(255, 0, 0);

//设置静态文本
	m_static_HMI.SubclassDlgItem( IDC_HMI, this );
	m_static_HMI.bkColor( bk );
    m_static_HMI.textColor( tx );
	m_static_HMI.setFont(&logfont );

	m_static_ACU_BCU.SubclassDlgItem( IDC_ACU_BCU, this );
	m_static_ACU_BCU.bkColor( bk );
    m_static_ACU_BCU.textColor( tx1 );
	m_static_ACU_BCU.setFont(&logfont1 );

	m_static_N_NUM.SubclassDlgItem( IDC_N_NUM, this );
	m_static_N_NUM.bkColor( bk );
    m_static_N_NUM.textColor( tx2 );
	m_static_N_NUM.setFont(&logfont2 );
	m_static_N.SubclassDlgItem( IDC_N, this );
	m_static_N.bkColor( bk );
    m_static_N.textColor( tx2 );
	m_static_N.setFont(&logfont2 );
	m_static_CTRL_N.SubclassDlgItem( IDC_CTRL_N, this );
	m_static_CTRL_N.bkColor( bk );
    m_static_CTRL_N.textColor( tx2 );
	m_static_CTRL_N.setFont(&logfont2 );
	m_static_CTRL_INC.SubclassDlgItem( IDC_CTRL_INC, this );
	m_static_CTRL_INC.bkColor( bk );
    m_static_CTRL_INC.textColor( tx2 );
	m_static_CTRL_INC.setFont(&logfont2 );
	m_static_CTRL_MODE.SubclassDlgItem( IDC_CTRL_MODE, this );
	m_static_CTRL_MODE.bkColor( bk );
    m_static_CTRL_MODE.textColor( tx2 );
	m_static_CTRL_MODE.setFont(&logfont2 );

	m_static_MEP_NUM.SubclassDlgItem( IDC_MEP_NUM, this );
	m_static_MEP_NUM.bkColor( bk );
    m_static_MEP_NUM.textColor( tx2 );
	m_static_MEP_NUM.setFont(&logfont2 );
	m_static_MEP.SubclassDlgItem( IDC_MEP, this );
	m_static_MEP.bkColor( bk );
    m_static_MEP.textColor( tx2 );
	m_static_MEP.setFont(&logfont2 );

	m_static_POIL_NUM.SubclassDlgItem( IDC_POIL_NUM, this );
	m_static_POIL_NUM.bkColor( bk );
    m_static_POIL_NUM.textColor( tx2 );
	m_static_POIL_NUM.setFont(&logfont2 );
	m_static_POIL.SubclassDlgItem( IDC_POIL, this );
	m_static_POIL.bkColor( bk );
    m_static_POIL.textColor( tx2 );
	m_static_POIL.setFont(&logfont2 );

	m_static_CTRL_TOIL.SubclassDlgItem( IDC_CTRL_TOIL, this );
	m_static_CTRL_TOIL.bkColor( bk );
    m_static_CTRL_TOIL.textColor( tx2 );
	m_static_CTRL_TOIL.setFont(&logfont2 );

	m_static_CTRL_SPM.SubclassDlgItem( IDC_CTRL_SPM, this );
	m_static_CTRL_SPM.bkColor( bk );
    m_static_CTRL_SPM.textColor( tx2 );
	m_static_CTRL_SPM.setFont(&logfont2 );

	m_static_ALARM_LIST.SubclassDlgItem( IDC_ALARM_LIST, this );
	m_static_ALARM_LIST.bkColor( bk );
    m_static_ALARM_LIST.textColor( tx3 );
	m_static_ALARM_LIST.setFont(&logfont1 );

	m_static_LIST_ORDER.SubclassDlgItem( IDC_LIST_ORDER, this );
	m_static_LIST_ORDER.bkColor( bk );
    m_static_LIST_ORDER.textColor( tx3 );
	m_static_LIST_ORDER.setFont(&logfont3 );
	m_static_LIST_CODE.SubclassDlgItem( IDC_LIST_CODE, this );
	m_static_LIST_CODE.bkColor( bk );
    m_static_LIST_CODE.textColor( tx3 );
	m_static_LIST_CODE.setFont(&logfont3 );
	m_static_LIST_description.SubclassDlgItem( IDC_LIST_description, this );
	m_static_LIST_description.bkColor( bk );
    m_static_LIST_description.textColor( tx3 );
	m_static_LIST_description.setFont(&logfont3 );
	m_static_LIST_NUM.SubclassDlgItem( IDC_LIST_NUM, this );
	m_static_LIST_NUM.bkColor( bk );
    m_static_LIST_NUM.textColor( tx3 );
	m_static_LIST_NUM.setFont(&logfont3 );
	m_static_LIST_FROM.SubclassDlgItem( IDC_LIST_FROM, this );
	m_static_LIST_FROM.bkColor( bk );
    m_static_LIST_FROM.textColor( tx3 );
	m_static_LIST_FROM.setFont(&logfont3 );

	m_static_tishi.SubclassDlgItem( IDC_STATIC_tishi, this );
	m_static_tishi.bkColor( bk );
    m_static_tishi.textColor( tx );
	m_static_tishi.setFont(&logfont3 );

//设置参数
	m_static_SET1.SubclassDlgItem( IDC_CTRL_SET1, this );
	m_static_SET1.bkColor( bk1 );
    m_static_SET1.textColor( tx4 );
	m_static_SET1.setFont(&logfont2 );
	m_tip1.ShowWindow(SW_SHOW);

	m_static_SET2.SubclassDlgItem( IDC_CTRL_SET2, this );
	m_static_SET2.bkColor( bk );
    m_static_SET2.textColor( tx4 );
	m_static_SET2.setFont(&logfont2 );

	m_static_SET3.SubclassDlgItem( IDC_CTRL_SET3, this );
	m_static_SET3.bkColor( bk );
    m_static_SET3.textColor( tx4 );
	m_static_SET3.setFont(&logfont2 );

	m_static_SET4.SubclassDlgItem( IDC_CTRL_SET4, this );
	m_static_SET4.bkColor( bk );
    m_static_SET4.textColor( tx4 );
	m_static_SET4.setFont(&logfont2 );

	m_static_SET5.SubclassDlgItem( IDC_CTRL_SET5, this );
	m_static_SET5.bkColor( bk );
    m_static_SET5.textColor( tx4 );
	m_static_SET5.setFont(&logfont2 );

	m_static_SET6.SubclassDlgItem( IDC_CTRL_SET6, this );
	m_static_SET6.bkColor( bk );
    m_static_SET6.textColor( tx4 );
	m_static_SET6.setFont(&logfont2 );

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -