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

📄 flowimpl.h

📁 一个工业控制管道流动控件,能够反映管道内流动情况.不是我写的,但觉得不错,因此转载上来
💻 H
字号:
/***********************************************************************
* Copyright (c) 2007* All rights reserved.* 
* ATTRIBUTE:        控制流动功能的绘制
* FILE NAME:		FlowImpl.h
* FILE ID:			SYSTEMCTRL-FLOWIMPL-H
* CURRENT VERSION:	V1.0
* AUTHOR:			戚高
* CONTECT:			successq_g@163.com	
* BUILD DATA:		27/12/2007
* COMPLETION DATE:	27/12/2007
* NOTE:	            This source code can be used freely but without guarantee. 
					You are respon responsible for using the following codes
***********************************************************************/
#ifndef __FLOWIMPL_H__
#define __FLOWIMPL_H__

#include <afxtempl.h>
#include "FlowUnit.h"

const int  UNIT_WIDTH = 8;
const int  UNIT_HEIGHT = 4;
const int  UNIT_DISC = 5;
const int  UNIT_STEP = 1;   //步进

typedef enum _UnitPattern
{
	UP_RECTANGLE = 0,   
	UP_CIRCLE    = 1,
	UP_DLINE     = 2,    // 象 >> 类别
	UP_TRIANGLE  = 3
}UNITPATTERN;

typedef enum _DLinePattern
{	
	DP_RIGHT = 0,
	DP_LEFT  = 1,
	DP_DOWN  = 2,
	DP_UP    = 3
}DLINEPATTERN;

class CFlowCtrl;

class CFlowImpl  
{
public:	
	CFlowImpl(CFlowCtrl *pOwer);
	virtual ~CFlowImpl();

	void Draw(CDC *pDC);
	void CalculateFlowUnit();  //重新计算相关信息
	void InitFlowUnit();	   //初始化滑块,包含位置以及数量等

	void SetUnitBackColor(const COLORREF colorBack);

	inline CFlowCtrl * GetFlowCtrl()
	{
		return m_pOwer;
	}

	inline void SetUnitPattern(const UNITPATTERN enumUnitPattern)
	{
		m_enumUnitPattern = enumUnitPattern;
	}

	inline void SetUnitDLinePattern(const DLINEPATTERN enumDLinePattern)
	{
		m_enumDLinePattern = enumDLinePattern;
	}

	inline UNITPATTERN GetUnitPattern() const
	{
		return m_enumUnitPattern;
	}

	inline DLINEPATTERN GetUnitDLinePattern() const
	{
		return m_enumDLinePattern;
	}

	inline COLORREF GetUnitBackColor() const
	{
		return m_colorUnitBack;
	}

private:
	CFlowCtrl *m_pOwer;
	CList<CFlowUnit *, CFlowUnit *> m_arrayFlowUnit; 

	UNITPATTERN  m_enumUnitPattern;
	DLINEPATTERN m_enumDLinePattern;
	COLORREF     m_colorUnitBack;

};

#endif

⌨️ 快捷键说明

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