📄 type.cpp
字号:
// Type.cpp : implementation file
//
#include "stdafx.h"
#include "IcDemo.h"
#include "Type.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CType dialog
CType::CType(CWnd* pParent /*=NULL*/)
: CDialog(CType::IDD, pParent)
{
//{{AFX_DATA_INIT(CType)
m_lstdata = _T("");
//}}AFX_DATA_INIT
}
void CType::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CType)
DDX_Control(pDX, IDC_LIST1, m_list);
DDX_LBString(pDX, IDC_LIST1, m_lstdata);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CType, CDialog)
//{{AFX_MSG_MAP(CType)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CType message handlers
extern CIcDemoApp theApp;
BOOL CType::OnInitDialog()
{
CDialog::OnInitDialog();
m_list.AddString( "INSIDE 24C01A 00 1024 ");//128 0
m_list.AddString( "INSIDE 24C02 01 2048 ");//256 1
m_list.AddString( "INSIDE 24C04 02 4096 ");//512 2
m_list.AddString( "INSIDE 24C08 03 8192 ");//1024 3
m_list.AddString( "INSIDE 24C16 04 16384 ");//2048 4
m_list.AddString( "INSIDE 24C32 05 32768 ");//4096 5
m_list.AddString( "INSIDE 24C64 07 65536 ");//8192 6
m_list.AddString( "INSIDE 24C65 06 65536 ");///8192 7
m_list.AddString( "ATMEL 88SC101 10 1376 ");//172 8
m_list.AddString( "ATMEL 88SC102 11 1424 ");//176 9
m_list.AddString( "ATMEL 88SC103 12 1536 ");//192 10
m_list.AddString( "ATMEL 88SC1601 13 16056 ");//2007 11
m_list.AddString( "ATMEL 88SC1604 14 16056 ");//2007 12
m_list.AddString( "ATMEL 88SC1604A 15 16336 ");//2042 13
m_list.AddString( "ATMEL 24C01A 20 1024 ");//128 14
m_list.AddString( "ATMEL 24C02 21 2048 ");//256 15
m_list.AddString( "ATMEL 24C04 22 4096 ");//512 16
m_list.AddString( "ATMEL 24C08 23 8192 ");//1024 17
m_list.AddString( "ATMEL 24C16 24 16384 ");//2048 18
m_list.AddString( "ATMEL 24C32 25 32768 ");//4096 19
m_list.AddString( "ATMEL 24C64 27 65536 ");//8192 20
m_list.AddString( "ATMEL 45D041 64 540672 ");//540672 21
m_list.AddString( "ATMEL 93C46 30 1024 ");//128 22
m_list.AddString( "MICROCHIP 24C65 26 65536 ");//8192 23
m_list.AddString( "MICROCHIP 24LC01B 20 1024 ");//128 24
m_list.AddString( "MICROCHIP 24LC08B 23 8192 ");//1024 25
m_list.AddString( "MICROCHIP 24LC16B 24 16384 ");//2048 26
m_list.AddString( "SIEMENS 4404 40 512 ");//64 27
m_list.AddString( "SIEMENS 4406 41 512 ");//64 28
m_list.AddString( "SIEMENS 4418 51 8192 ");//1024 29
m_list.AddString( "SIEMENS 4428 43 8192 ");//1024 30
m_list.AddString( "SIEMENS 4432 50 2048 ");//256 31
m_list.AddString( "SIEMENS 4442 42 2048 ");//256 32
m_list.SetCurSel(0);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CType::GetPageCount()
{
if(m_list.GetCurSel()==0 || m_list.GetCurSel()==14
||m_list.GetCurSel()==22||m_list.GetCurSel()==24)
{
theApp.intPage=1;
theApp.lInfaceByte=128;
}
if(m_list.GetCurSel()==1 || m_list.GetCurSel()==15|| m_list.GetCurSel()==31
||m_list.GetCurSel()==32)
{
theApp.intPage=2;
theApp.lInfaceByte=256;
}
if(m_list.GetCurSel()==2 || m_list.GetCurSel()==16)
{
theApp.intPage=4;
theApp.lInfaceByte=512;
}
if(m_list.GetCurSel()==3 || m_list.GetCurSel()==17|| m_list.GetCurSel()==25
||m_list.GetCurSel()==29||m_list.GetCurSel()==30)
{
theApp.intPage=8;
theApp.lInfaceByte=1024;
}
if(m_list.GetCurSel()==4 || m_list.GetCurSel()==18|| m_list.GetCurSel()==26)
{
theApp.intPage=16;
theApp.lInfaceByte=2048;
}
if(m_list.GetCurSel()==5 || m_list.GetCurSel()==19)
{
theApp.intPage=32;
theApp.lInfaceByte=4096;
}
if(m_list.GetCurSel()==6 || m_list.GetCurSel()==7 || m_list.GetCurSel()==20|| m_list.GetCurSel()==23)
{
theApp.intPage=64;
theApp.lInfaceByte=8192;
}
if(m_list.GetCurSel()==8)
{
theApp.intPage=2;
theApp.lInfaceByte=172;
}
if(m_list.GetCurSel()==9)
{
theApp.intPage=2;
theApp.lInfaceByte=176;
}
if(m_list.GetCurSel()==10)
{
theApp.intPage=2;
theApp.lInfaceByte=192;
}
if(m_list.GetCurSel()==11 || m_list.GetCurSel()==12)
{
theApp.intPage=16;
theApp.lInfaceByte=2007;
}
if(m_list.GetCurSel()==13)
{
theApp.intPage=16;
theApp.lInfaceByte=2042;
}
if(m_list.GetCurSel()==21)
{
theApp.intPage=4160;
theApp.lInfaceByte=540672;
}
if(m_list.GetCurSel()==27 || m_list.GetCurSel()==28)
{
theApp.intPage=1;
theApp.lInfaceByte=64;
}
}
void CType::OnOK()
{
// TODO: Add extra validation here
GetPageCount();
CDialog::OnOK();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -