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

📄 device.cpp

📁 gps对时
💻 CPP
字号:
// Device.cpp: implementation of the CDevice class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "RegionComm.h"
#include "ComPort.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
IMPLEMENT_SERIAL(CDevice, CObject, 0)
CDevice::CDevice()
{
   TimeOutCount=0;
   DeviceType=0;//信号机
   DeviceNo=0;
   IsConnected=FALSE;
}

CDevice::~CDevice()
{

}
int CDevice::GetState() 
{ 	// 取连接设备工作状态
	 if (IsConnected) return DEV_LINEON;
	 else return DEV_LINEOFF; 
}
void CDevice::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		ar << DeviceType;
		ar << DeviceNo;
		ar << TimeOutCount;
		ar << IsConnected;
	}
	else
	{
		ar >> DeviceType;
		ar >> DeviceNo;
		ar >> TimeOutCount;
		ar >> IsConnected;
	}
}

⌨️ 快捷键说明

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