📄 devicetest.cpp
字号:
// DeviceTest.cpp : implementation file
//
#include "stdafx.h"
#include "NoteBook.h"
#include "DeviceTest.h"
#include "KeyRlt.h"
#include "KeyTest.h"
#include "LedTest.h"
#include "MouseTest.h"
#include "ReaderTest.h"
#include "UsbTest.h"
#include "TvRlt.h"
#include "LedRlt.h"
#include "MouseRlt.h"
#include "ReaderRlt.h"
#include "UsbRlt.h"
#include "TvRlt.h"
#include "PhotoRelt.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDeviceTest dialog
CDeviceTest::CDeviceTest(CWnd* pParent /*=NULL*/)
: CDialog(CDeviceTest::IDD, pParent)
{
//{{AFX_DATA_INIT(CDeviceTest)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CDeviceTest::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDeviceTest)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDeviceTest, CDialog)
//{{AFX_MSG_MAP(CDeviceTest)
ON_BN_CLICKED(IDC_STARTTEST, OnStarttest)
ON_BN_CLICKED(IDC_FINISHTEST, OnFinishtest)
ON_BN_CLICKED(IDC_KEYBOARD, OnKeyboard)
ON_BN_CLICKED(IDC_LED, OnLed)
ON_BN_CLICKED(IDC_MOUSE, OnMouse)
ON_BN_CLICKED(IDC_READER, OnReader)
ON_BN_CLICKED(IDC_USB, OnUsb)
ON_BN_CLICKED(IDC_TV, OnTv)
ON_BN_CLICKED(IDC_PHOTO, OnPhoto)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDeviceTest message handlers
void CDeviceTest::OnStarttest()
{
// TODO: Add your control notification handler code here
ShellExecute(NULL,"open","D:\\测试工具\\鼠标、键盘测试\\keyboard.exe",NULL,NULL,SW_SHOW);
Sleep(10000);
if (::FindWindow(NULL,"KEY_beta Vision"))
{
Sleep(30000);
if (::FindWindow(NULL,"key"))
{
::SendMessage(::FindWindow(NULL,"key"),
WM_SYSCOMMAND, SC_CLOSE, 0);
}
else
{
/* ::SetDlgItemText(::FindWindow(NULL,"外设、端口测试模块"),IDC_EDIT1,
"键盘测试失败");*/
::SendMessage(::FindWindow(NULL,"KEY_beta Vision"),
WM_SYSCOMMAND, SC_CLOSE, 0);
}
}
else
MessageBox("测试故障,请重新测试!");
Sleep(1000);
CKeyRlt dlg;
dlg.DoModal();
MessageBox("请对LED进行测试!");
Sleep(10000);
CLedRlt dlg1;
dlg1.DoModal();
ShellExecute(NULL,"open","D:\\测试工具\\鼠标、键盘测试\\MMouse3.exe",
NULL,NULL,SW_SHOW);
Sleep(4000);
CMouseRlt dlg2;
dlg2.DoModal();
MessageBox("请按spec说明插入卡进行读卡器测试!");
Sleep(10000);
CReaderRlt dlg3;
dlg3.DoModal();
MessageBox("请按照spec说明打开摄像头进行测试!");
Sleep(10000);
CPhotoRelt dlg6;
dlg6.DoModal();
MessageBox("请对USB进行测试!");
Sleep(10000);
CUsbRlt dlg4;
dlg4.DoModal();
MessageBox("请对TV端口进行测试!");
Sleep(10000);
CTvRlt dlg5;
dlg5.DoModal();
}
void CDeviceTest::OnFinishtest()
{
// TODO: Add your control notification handler code here
SendMessage(WM_SYSCOMMAND,SC_CLOSE,0);
}
void CDeviceTest::OnKeyboard()
{
// TODO: Add your control notification handler code here
ShellExecute(NULL,"open","D:\\测试工具\\鼠标、键盘测试\\keyboard.exe",NULL,NULL,SW_SHOW);
Sleep(10000);
if (::FindWindow(NULL,"KEY_beta Vision"))
{
Sleep(30000);
if (::FindWindow(NULL,"key"))
{
::SendMessage(::FindWindow(NULL,"key"),
WM_SYSCOMMAND, SC_CLOSE, 0);
}
else
{
::SendMessage(::FindWindow(NULL,"KEY_beta Vision"),
WM_SYSCOMMAND, SC_CLOSE, 0);
}
}
else
MessageBox("测试故障,请重新测试!");
Sleep(1000);
CKeyTest dlg;
dlg.DoModal();
}
void CDeviceTest::OnLed()
{
// TODO: Add your control notification handler code here
MessageBox("请按照spec说明打开所有的LED指示灯进行测试!");
Sleep(10000);
MessageBox("关闭所有的LED指示灯!");
// ShellExecute(NULL,"open","D:\\测试程序\\test\\8050_test\\Led\\LED_TEST.EXE","depth8",NULL,SW_SHOWNORMAL);
Sleep(10000);
CLedTest dlg;
dlg.DoModal();
}
void CDeviceTest::OnMouse()
{
// TODO: Add your control notification handler code here
ShellExecute(NULL,"open","D:\\测试工具\\鼠标、键盘测试\\MMouse3.exe",
NULL,NULL,SW_SHOW);
Sleep(5000);
CMouseTest dlg;
dlg.DoModal();
}
void CDeviceTest::OnReader()
{
// TODO: Add your control notification handler code here
MessageBox("请按spec说明进行读卡器测试!");
Sleep(60000);
CReaderTest dlg;
dlg.DoModal();
}
void CDeviceTest::OnUsb()
{
// TODO: Add your control notification handler code here
MessageBox("请按照spec说明进行USB测试!");
Sleep(10000);
CUsbTest dlg;
dlg.DoModal();
}
void CDeviceTest::OnTv()
{
// TODO: Add your control notification handler code here
MessageBox("请按照spec说明进行TV测试!");
Sleep(10000);
CTvRlt dlg;
dlg.DoModal();
}
void CDeviceTest::OnPhoto()
{
// TODO: Add your control notification handler code here
MessageBox("请按照spec说明打开摄像头进行测试!");
Sleep(10000);
CPhotoRelt dlg;
dlg.DoModal();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -