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

📄 controlunit.h

📁 是一个集网络技术与数据库技术于一体的软件
💻 H
字号:
// ControlUnit.h: interface for the CControlUnit class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_CONTROLUNIT_H__43A3763B_9ACA_11D2_A6F8_0000B43BACE5__INCLUDED_)
#define AFX_CONTROLUNIT_H__43A3763B_9ACA_11D2_A6F8_0000B43BACE5__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <afxtempl.h>
#include "afxdao.h"
#include "ClientSocket.h"

class CControlModule;
class CControlSegment;
class CControlUnit;
class CControlPoint;

///////////////////////////////////////////////////////////////////////////
// class CControlModule
class CControlModule : public CObject  
{
public:
	CControlModule();
	virtual ~CControlModule();

// Attritutes
protected:
	CString		m_strModuleName;		//名称
	CPtrList	m_plSegmentList;		//段的链表

// Operations
public:
	CString GetModuleName();

	int GetSegmentCount();
	CControlSegment* GetSegment(int nIndex);
	CControlSegment* GetSegment(CString strSegmentName);
	CControlSegment* GetSegment(WORD wSegmentID);

	BOOL AddSegment(CControlSegment* pSegment);
	BOOL AddSegment(CString strSegment);

	BOOL DeleteSegment(CControlSegment* pSegment);
	BOOL DeleteSegment(int nIndex);
public:
	bool CheckTable(CString strTableName);
	CString GetDefaultDBName();
	//用于打开数据库
	CDaoDatabase m_Database;
	void BuildMemTree();

	friend CControlSegment;
	friend CControlUnit;
	friend CControlPoint;
};

class CControlSegment : public CObject  
{
public:
	CControlSegment();
	virtual ~CControlSegment();

// Attritutes
protected:
public:
	CString			m_strSysName;
	CControlModule*	m_pModule;
	WORD			m_wSegmentID;
	CPtrList		m_plUnitList;
	CClientSocket*  m_SegmentSocket;
	HTREEITEM hItem;

// Operations
public:
	CString GetSegmentName();
	BOOL SetSegmentName(CString strSysName);

	int GetUnitCount();
	CControlUnit* GetUnit(int nIndex);
	CControlUnit* GetUnit(CString strUnitName);
	CControlUnit* GetUnit(WORD wUnitID);

	BOOL AddUnit(CControlUnit* pUnit);
	BOOL AddUnit(CString strUnitName);

	BOOL DeleteUnit(CControlUnit* pUnit);
	BOOL DeleteUnit(int nIndex);

	WORD GetSegmentID();
	BOOL SetSegmentID(WORD wSegmentID);
	
	CControlModule* GetControlModule();
	void SetControlModule(CControlModule* pModule);

	CString GetHisTableName();
	CString GetPointNameID();
	CString GetUnitTableName();

public:
	void BuildMemTree();

	friend CControlUnit;
	friend CControlPoint;
};

class CControlUnit : public CObject  
{
public:
	CControlUnit();
	virtual ~CControlUnit();

// Attritutes
protected:
public:
	CControlSegment*	m_pSegment;
	CString			m_strUnitName;
	CPtrList		m_plPointList;
	WORD			m_wUnitID;
	HTREEITEM hItem;

// Operations
public:
	CString GetUnitName();
	CString GetUnitLongName();
	BOOL SetUnitName(CString strUnitName);

	WORD GetUnitID();
	BOOL SetUnitID(WORD wUnitID);

	int GetPointCount();
	CControlPoint* GetPoint(int nIndex);
	CControlPoint* GetPoint(CString strPointName);
	CControlPoint* GetPoint(WORD wPointID);
	CString GetPointTableName();

	BOOL AddPoint(CControlPoint* pPoint);
	BOOL AddPoint(CString strPointName,
					CString strPointMemo);

	BOOL DeletePoint(CControlPoint* pPoint);
	BOOL DeletePoint(int nIndex);

	CControlSegment* GetControlSegment();
	void SetControlSegment(CControlSegment* pSegment);

	void BuildMemTree();

	friend CControlPoint;
};

class CControlPoint : public CObject  
{
public:
	CControlPoint();
	virtual ~CControlPoint();

// Attritutes
protected:
public:
	CControlUnit*	m_pUnit;
	CString			m_strPointName;
	CString			m_strPointLongName;
	WORD			m_wPointID;
	WORD			m_wPointLongID;
	CString			m_strValue;
	CString			m_strMemo;
	
// Operations
public:
	CControlUnit* GetControlUnit();
	void SetControlUnit(CControlUnit* pUnit);

	CString GetPointName();
	CString GetPointLongName();
	BOOL SetPointName(CString strPointName);

	WORD GetPointID();
	DWORD GetPointLongID();
	BOOL SetPointID(WORD wPointID);

	CString GetPointValue();
	BOOL SetPointValue(CString strNewValue);

	CString GetPointMemo();
	BOOL SetPointMemo(CString strNewMemo);
	friend CControlUnit;
};


#endif // !defined(AFX_CONTROLUNIT_H__43A3763B_9ACA_11D2_A6F8_0000B43BACE5__INCLUDED_)

⌨️ 快捷键说明

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