?? mserial.cpp
字號:
// Mserial.cpp : implementation file
//
#include "stdafx.h"
#include "Watertank.h"
#include "Mserial.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMserial
IMPLEMENT_DYNCREATE(CMserial, CCmdTarget)
CMserial::CMserial()
{
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;
}
CMserial::~CMserial()
{
}
double CMserial::Produce_Mserial()
{ int i;
if(Number%1==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=-1.0;
else
OutData=1.0;
Number++;
return OutData;
}
BEGIN_MESSAGE_MAP(CMserial, CCmdTarget)
//{{AFX_MSG_MAP(CMserial)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMserial message handlers
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -