?? fakemserial.cpp
字號:
// FakeMserial.cpp : implementation file
//
#include "stdafx.h"
#include "Watertank.h"
#include "FakeMserial.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CFakeMserial
IMPLEMENT_DYNCREATE(CFakeMserial, CCmdTarget)
CFakeMserial::CFakeMserial()
{
x[0]=0;
x[1]=1;
x[2]=1;
x[3]=1;
x[4]=1;
x[5]=0;
x[6]=1;
x[7]=1;
x[8]=1;
x[9]=1;
x[10]=1;
OutData=0;
Number=1;
}
CFakeMserial::~CFakeMserial()
{
}
BEGIN_MESSAGE_MAP(CFakeMserial, CCmdTarget)
//{{AFX_MSG_MAP(CFakeMserial)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CFakeMserial message handlers
double CFakeMserial::Produce_FakeMserial(int gap)
{
int i;
int j;
j=gap;
if(Number%j==0)
{
for(i=0;i<11;i++)
y[i]=x[i];
for(i=1;i<11;i++)
x[i]=y[i-1];
if(x[1]==x[10])
x[0]=0;
else
x[0]=1;
}
if(y[10]==0)
OutData=0;
else
OutData=1.0;
Number++;
return OutData;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -