577 lines
18 KiB
C++
577 lines
18 KiB
C++
#if !defined(__KTPARAMCLASS_H__)
|
|
#define __KTPARAMCLASS_H__
|
|
|
|
#if _MSC_VER > 1000
|
|
#pragma once
|
|
#endif // _MSC_VER > 1000
|
|
|
|
#define StringToLong(pszVal) _ttol(pszVal)
|
|
|
|
inline CString LongToString(ULONG lValue)
|
|
{
|
|
CString sValue;
|
|
sValue.Format(_T("%ld"), lValue);
|
|
return sValue;
|
|
}
|
|
|
|
#define StringToBool(pszVal) (_tcsicmp((pszVal), _T("0")) == 0 ? FALSE : TRUE)
|
|
#define BoolToString(bVal) ((bVal) ? _T("1") : _T("0"))
|
|
|
|
class KTParamClass
|
|
{
|
|
public:
|
|
KTParamClass() : m_lId(0), m_lUpId(0), m_bReadOnly(FALSE) {}
|
|
KTParamClass(const KTParamClass& data) {operator=(data);}
|
|
|
|
KTParamClass& operator=(const KTParamClass& data)
|
|
{
|
|
m_lId = data.m_lId;
|
|
m_lUpId = data.m_lUpId;
|
|
m_sCode = data.m_sCode;
|
|
m_sName = data.m_sName;
|
|
m_sDesc = data.m_sDesc;
|
|
m_sIcon1 = data.m_sIcon1;
|
|
m_sIcon2 = data.m_sIcon2;
|
|
m_bReadOnly = data.m_bReadOnly;
|
|
m_sFlags = data.m_sFlags;
|
|
m_sLayer = data.m_sLayer;
|
|
return (*this);
|
|
}
|
|
|
|
void MapFieldToValue(CMapStringToString& mapData)
|
|
{
|
|
mapData[_T("ID")] = LongToString(m_lId);
|
|
mapData[_T("UpID")] = LongToString(m_lUpId);
|
|
mapData[_T("Code")] = m_sCode;
|
|
mapData[_T("Name")] = m_sName;
|
|
mapData[_T("Desc")] = m_sDesc;
|
|
mapData[_T("Icon1")] = m_sIcon1;
|
|
mapData[_T("Icon2")] = m_sIcon2;
|
|
mapData[_T("Read")] = BoolToString(m_bReadOnly);
|
|
mapData[_T("Flags")] = m_sFlags;
|
|
mapData[_T("Layer")] = m_sLayer;
|
|
}
|
|
|
|
BOOL GetValue(LPCTSTR pszName, CString& sValue) const
|
|
{
|
|
ASSERT(NULL != pszName && _tcslen(pszName) > 0);
|
|
if (_tcsicmp(pszName, _T("ID")) == 0) sValue = LongToString(m_lId);
|
|
else if (_tcsicmp(pszName, _T("UpID")) == 0) sValue = LongToString(m_lUpId);
|
|
else if (_tcsicmp(pszName, _T("Code")) == 0) sValue = m_sCode;
|
|
else if (_tcsicmp(pszName, _T("Name")) == 0) sValue = m_sName;
|
|
else if (_tcsicmp(pszName, _T("Desc")) == 0) sValue = m_sDesc;
|
|
else if (_tcsicmp(pszName, _T("Icon1")) == 0) sValue = m_sIcon1;
|
|
else if (_tcsicmp(pszName, _T("Icon2")) == 0) sValue = m_sIcon2;
|
|
else if (_tcsicmp(pszName, _T("Read")) == 0) sValue = BoolToString(m_bReadOnly);
|
|
else if (_tcsicmp(pszName, _T("Flags")) == 0) sValue = m_sFlags;
|
|
else if (_tcsicmp(pszName, _T("Layer")) == 0) sValue = m_sLayer;
|
|
else return FALSE;
|
|
return TRUE;
|
|
}
|
|
|
|
BOOL SetValue(LPCTSTR pszName, LPCTSTR pszValue)
|
|
{
|
|
if (_tcsicmp(pszName, _T("ID")) == 0) m_lId = StringToLong(pszValue);
|
|
else if (_tcsicmp(pszName, _T("UpID")) == 0) m_lUpId = StringToLong(pszValue);
|
|
else if (_tcsicmp(pszName, _T("Code")) == 0) m_sCode = pszValue;
|
|
else if (_tcsicmp(pszName, _T("Name")) == 0) m_sName = pszValue;
|
|
else if (_tcsicmp(pszName, _T("Desc")) == 0) m_sDesc = pszValue;
|
|
else if (_tcsicmp(pszName, _T("Icon1")) == 0) m_sIcon1 = pszValue;
|
|
else if (_tcsicmp(pszName, _T("Icon2")) == 0) m_sIcon2 = pszValue;
|
|
else if (_tcsicmp(pszName, _T("Read")) == 0) m_bReadOnly = StringToBool(pszValue);
|
|
else if (_tcsicmp(pszName, _T("Flags")) == 0) m_sFlags = pszValue;
|
|
else if (_tcsicmp(pszName, _T("Layer")) == 0) m_sLayer = pszValue;
|
|
else return FALSE;
|
|
return TRUE;
|
|
}
|
|
|
|
ULONG GetId() const {return m_lId;}
|
|
void SetId(ULONG lId) {m_lId = lId;}
|
|
|
|
ULONG GetUpId() const {return m_lUpId;}
|
|
void SetUpId(ULONG lUpId) {m_lUpId = lUpId;}
|
|
|
|
LPCTSTR GetCode() const {return m_sCode;}
|
|
void SetCode(LPCTSTR pszCode) {m_sCode = pszCode;}
|
|
|
|
LPCTSTR GetName() const {return m_sName;}
|
|
void SetName(LPCTSTR pszName) {m_sName = pszName;}
|
|
|
|
LPCTSTR GetDesc() const {return m_sDesc;}
|
|
void SetDesc(LPCTSTR pszDesc) {m_sDesc = pszDesc;}
|
|
|
|
LPCTSTR GetIcon1() const {return m_sIcon1;}
|
|
void SetIcon1(LPCTSTR pszIcon1) {m_sIcon1 = pszIcon1;}
|
|
|
|
LPCTSTR GetIcon2() const {return m_sIcon2;}
|
|
void SetIcon2(LPCTSTR pszIcon2) {m_sIcon2 = pszIcon2;}
|
|
|
|
BOOL IsReadOnly() const {return m_bReadOnly;}
|
|
void SetReadOnly(BOOL bReadOnly) {m_bReadOnly = bReadOnly;}
|
|
|
|
LPCTSTR GetFlags() const {return m_sFlags;}
|
|
void SetFlags(LPCTSTR pszFlags) {m_sFlags = pszFlags;}
|
|
|
|
LPCTSTR GetLayer() const {return m_sLayer;}
|
|
LPCTSTR GetLayerKey() const {return _T("Layer");}
|
|
void SetLayer(LPCTSTR pszLayer) {m_sLayer = pszLayer;}
|
|
|
|
protected:
|
|
// 类别ID
|
|
ULONG m_lId;
|
|
// 父类别ID
|
|
ULONG m_lUpId;
|
|
// 类别代号
|
|
CString m_sCode;
|
|
// 类别名称
|
|
CString m_sName;
|
|
// 类别说明
|
|
CString m_sDesc;
|
|
// 小图标
|
|
CString m_sIcon1;
|
|
// 大图标
|
|
CString m_sIcon2;
|
|
// 是否只读
|
|
BOOL m_bReadOnly;
|
|
// 状态标志
|
|
CString m_sFlags;
|
|
// 默认图层
|
|
CString m_sLayer;
|
|
};
|
|
|
|
typedef CArray<KTParamClass, KTParamClass&> KTParamClassArray;
|
|
typedef CArray<KTParamClass*, KTParamClass*&> KTParamClassPtrArray;
|
|
|
|
class KTParamTableAttr
|
|
{
|
|
public:
|
|
KTParamTableAttr() : m_lId(0), m_bNotNull(FALSE), m_bVisible(TRUE), m_bOverride(FALSE),
|
|
m_bReadOnly(FALSE), m_bNeedSave(FALSE), m_lIndex(0) {}
|
|
KTParamTableAttr(const KTParamTableAttr& data) {operator=(data);}
|
|
|
|
KTParamTableAttr& operator=(const KTParamTableAttr& data)
|
|
{
|
|
m_lId = data.m_lId;
|
|
m_sField = data.m_sField;
|
|
m_sName = data.m_sName;
|
|
m_sDesc = data.m_sDesc;
|
|
m_sDataType = data.m_sDataType;
|
|
m_sValue = data.m_sValue;
|
|
m_sDefault = data.m_sDefault;
|
|
m_sVarDesc = data.m_sVarDesc;
|
|
m_bNotNull = data.m_bNotNull;
|
|
m_bVisible = data.m_bVisible;
|
|
m_bOverride = data.m_bOverride;
|
|
m_bReadOnly = data.m_bReadOnly;
|
|
m_bNeedSave = data.m_bNeedSave;
|
|
m_lIndex = data.m_lIndex;
|
|
m_sFlags = data.m_sFlags;
|
|
return (*this);
|
|
}
|
|
|
|
ULONG GetId() const {return m_lId;}
|
|
void SetId(ULONG lId) {m_lId = lId;}
|
|
|
|
LPCTSTR GetField() const {return m_sField;}
|
|
void SetField(LPCTSTR pszField) {m_sField = pszField;}
|
|
|
|
LPCTSTR GetName() const {return m_sName;}
|
|
void SetName(LPCTSTR pszName) {m_sName = pszName;}
|
|
|
|
LPCTSTR GetDesc() const {return m_sDesc;}
|
|
void SetDesc(LPCTSTR pszDesc) {m_sDesc = pszDesc;}
|
|
|
|
LPCTSTR GetDataType() const {return m_sDataType;}
|
|
void SetDataType(LPCTSTR pszDataType) {m_sDataType = pszDataType;}
|
|
|
|
LPCTSTR GetValue() const {return m_sValue;}
|
|
void SetValue(LPCTSTR pszValue) {m_sValue = pszValue;}
|
|
|
|
LPCTSTR GetDefault() const {return m_sDefault;}
|
|
void SetDefault(LPCTSTR pszDefault) {m_sDefault = pszDefault;}
|
|
|
|
LPCTSTR GetVarDesc() const {return m_sVarDesc;}
|
|
void SetVarDesc(LPCTSTR pszVarDesc) {m_sVarDesc = pszVarDesc;}
|
|
|
|
BOOL IsNotNull() const {return m_bNotNull;}
|
|
void SetNotNull(BOOL bNotNull) {m_bNotNull = bNotNull;}
|
|
|
|
BOOL IsVisible() const {return m_bVisible;}
|
|
void SetVisible(BOOL bVisible) {m_bVisible = bVisible;}
|
|
|
|
BOOL IsOverride() const {return m_bOverride;}
|
|
void SetOverride(BOOL bOverride) {m_bOverride = bOverride;}
|
|
|
|
BOOL IsReadOnly() const {return m_bReadOnly;}
|
|
void SetReadOnly(BOOL bReadOnly) {m_bReadOnly = bReadOnly;}
|
|
|
|
BOOL IsNeedSave() const {return m_bNeedSave;}
|
|
void SetNeedSave(BOOL bNeedSave) {m_bNeedSave = bNeedSave;}
|
|
|
|
ULONG GetIndex() const {return m_lIndex;}
|
|
void SetIndex(ULONG lIndex) {m_lIndex = lIndex;}
|
|
|
|
LPCTSTR GetFlags() const {return m_sFlags;}
|
|
void SetFlags(LPCTSTR pszFlags) {m_sFlags = pszFlags;}
|
|
|
|
protected:
|
|
// 编号
|
|
ULONG m_lId;
|
|
// 字段
|
|
CString m_sField;
|
|
// 名称
|
|
CString m_sName;
|
|
// 说明
|
|
CString m_sDesc;
|
|
// 数据类型值
|
|
CString m_sDataType;
|
|
// 数据表达式
|
|
CString m_sValue;
|
|
// 默认值
|
|
CString m_sDefault;
|
|
// 数值描述表
|
|
CString m_sVarDesc;
|
|
// 是否必填
|
|
BOOL m_bNotNull;
|
|
// 是否可见
|
|
BOOL m_bVisible;
|
|
// 是否可更改
|
|
BOOL m_bOverride;
|
|
// 是否只读
|
|
BOOL m_bReadOnly;
|
|
// 是否保存
|
|
BOOL m_bNeedSave;
|
|
// 顺序号
|
|
ULONG m_lIndex;
|
|
// 状态标志
|
|
CString m_sFlags;
|
|
};
|
|
|
|
typedef CArray<KTParamTableAttr, KTParamTableAttr&> KTParamTableAttrArray;
|
|
typedef CArray<KTParamTableAttr*, KTParamTableAttr*&> KTParamTableAttrPtrArray;
|
|
|
|
class KTParamAttribute
|
|
{
|
|
public:
|
|
KTParamAttribute() : m_lId(0), m_lClassId(0), m_sDataType(_T("Int")), m_bNotNull(FALSE), m_bVisible(TRUE),
|
|
m_bOverride(FALSE), m_bReadOnly(FALSE), m_bNeedSave(FALSE), m_lIndex(0) {}
|
|
KTParamAttribute(const KTParamAttribute& data) {operator=(data);}
|
|
|
|
KTParamAttribute& operator=(const KTParamAttribute& data)
|
|
{
|
|
m_lId = data.m_lId;
|
|
m_lClassId = data.m_lClassId;
|
|
m_sCode = data.m_sCode;
|
|
m_sName = data.m_sName;
|
|
m_sDesc = data.m_sDesc;
|
|
m_sDataType = data.m_sDataType;
|
|
m_sValue = data.m_sValue;
|
|
m_sDefault = data.m_sDefault;
|
|
m_sVarDesc = data.m_sVarDesc;
|
|
m_bNotNull = data.m_bNotNull;
|
|
m_bVisible = data.m_bVisible;
|
|
m_bOverride = data.m_bOverride;
|
|
m_bReadOnly = data.m_bReadOnly;
|
|
m_bNeedSave = data.m_bNeedSave;
|
|
m_lIndex = data.m_lIndex;
|
|
m_sFlags = data.m_sFlags;
|
|
return (*this);
|
|
}
|
|
|
|
void MapFieldToValue(CMapStringToString& mapData)
|
|
{
|
|
mapData[_T("ID")] = LongToString(m_lId);
|
|
mapData[_T("ClassID")] = LongToString(m_lClassId);
|
|
mapData[_T("Code")] = m_sCode;
|
|
mapData[_T("Name")] = m_sName;
|
|
mapData[_T("Desc")] = m_sDesc;
|
|
mapData[_T("DataType")] = m_sDataType;
|
|
mapData[_T("Value")] = m_sValue;
|
|
mapData[_T("Default")] = m_sDefault;
|
|
mapData[_T("VarDesc")] = m_sVarDesc;
|
|
mapData[_T("NotNull")] = BoolToString(m_bNotNull);
|
|
mapData[_T("Visible")] = BoolToString(m_bVisible);
|
|
mapData[_T("Override")] = BoolToString(m_bOverride);
|
|
mapData[_T("Read")] = BoolToString(m_bReadOnly);
|
|
mapData[_T("Save")] = BoolToString(m_bNeedSave);
|
|
mapData[_T("Index")] = LongToString(m_lIndex);
|
|
mapData[_T("Flags")] = m_sFlags;
|
|
}
|
|
|
|
BOOL GetValue(LPCTSTR pszName, CString& sValue) const
|
|
{
|
|
ASSERT(NULL != pszName && _tcslen(pszName) > 0);
|
|
if (_tcsicmp(pszName, _T("ID")) == 0) sValue = LongToString(m_lId);
|
|
else if (_tcsicmp(pszName, _T("ClassID")) == 0) sValue = LongToString(m_lClassId);
|
|
else if (_tcsicmp(pszName, _T("Code")) == 0) sValue = m_sCode;
|
|
else if (_tcsicmp(pszName, _T("Name")) == 0) sValue = m_sName;
|
|
else if (_tcsicmp(pszName, _T("Desc")) == 0) sValue = m_sDesc;
|
|
else if (_tcsicmp(pszName, _T("DataType")) == 0)sValue = m_sDataType;
|
|
else if (_tcsicmp(pszName, _T("Value")) == 0) sValue = m_sValue;
|
|
else if (_tcsicmp(pszName, _T("Default")) == 0) sValue = m_sDefault;
|
|
else if (_tcsicmp(pszName, _T("VarDesc")) == 0) sValue = m_sVarDesc;
|
|
else if (_tcsicmp(pszName, _T("NotNull")) == 0) sValue = BoolToString(m_bNotNull);
|
|
else if (_tcsicmp(pszName, _T("Visible")) == 0) sValue = BoolToString(m_bVisible);
|
|
else if (_tcsicmp(pszName, _T("Override")) == 0)sValue = BoolToString(m_bOverride);
|
|
else if (_tcsicmp(pszName, _T("Read")) == 0) sValue = BoolToString(m_bReadOnly);
|
|
else if (_tcsicmp(pszName, _T("Save")) == 0) sValue = BoolToString(m_bNeedSave);
|
|
else if (_tcsicmp(pszName, _T("Index")) == 0) sValue = LongToString(m_lIndex);
|
|
else if (_tcsicmp(pszName, _T("Flags")) == 0) sValue = m_sFlags;
|
|
else return FALSE;
|
|
return TRUE;
|
|
}
|
|
|
|
BOOL SetValue(LPCTSTR pszName, LPCTSTR pszValue)
|
|
{
|
|
if (_tcsicmp(pszName, _T("ID")) == 0) m_lId = StringToLong(pszValue);
|
|
else if (_tcsicmp(pszName, _T("ClassID")) == 0) m_lClassId = StringToLong(pszValue);
|
|
else if (_tcsicmp(pszName, _T("Code")) == 0) m_sCode = pszValue;
|
|
else if (_tcsicmp(pszName, _T("Name")) == 0) m_sName = pszValue;
|
|
else if (_tcsicmp(pszName, _T("Desc")) == 0) m_sDesc = pszValue;
|
|
else if (_tcsicmp(pszName, _T("DataType")) == 0)m_sDataType = pszValue;
|
|
else if (_tcsicmp(pszName, _T("Value")) == 0) m_sValue = pszValue;
|
|
else if (_tcsicmp(pszName, _T("Default")) == 0) m_sDefault = pszValue;
|
|
else if (_tcsicmp(pszName, _T("VarDesc")) == 0) m_sVarDesc = pszValue;
|
|
else if (_tcsicmp(pszName, _T("NotNull")) == 0) m_bNotNull = StringToBool(pszValue);
|
|
else if (_tcsicmp(pszName, _T("Visible")) == 0) m_bVisible = StringToBool(pszValue);
|
|
else if (_tcsicmp(pszName, _T("Override")) == 0)m_bOverride = StringToBool(pszValue);
|
|
else if (_tcsicmp(pszName, _T("Read")) == 0) m_bReadOnly = StringToBool(pszValue);
|
|
else if (_tcsicmp(pszName, _T("Save")) == 0) m_bNeedSave = StringToBool(pszValue);
|
|
else if (_tcsicmp(pszName, _T("Index")) == 0) m_lIndex = StringToLong(pszValue);
|
|
else if (_tcsicmp(pszName, _T("Flags")) == 0) m_sFlags = pszValue;
|
|
else return FALSE;
|
|
return TRUE;
|
|
}
|
|
|
|
ULONG GetId() const {return m_lId;}
|
|
void SetId(ULONG lId) {m_lId = lId;}
|
|
|
|
ULONG GetClassId() const {return m_lClassId;}
|
|
void SetClassId(ULONG lId) {m_lClassId = lId;}
|
|
|
|
LPCTSTR GetCode() const {return m_sCode;}
|
|
void SetCode(LPCTSTR pszCode) {m_sCode = pszCode;}
|
|
|
|
LPCTSTR GetName() const {return m_sName;}
|
|
void SetName(LPCTSTR pszName) {m_sName = pszName;}
|
|
|
|
LPCTSTR GetDesc() const {return m_sDesc;}
|
|
void SetDesc(LPCTSTR pszDesc) {m_sDesc = pszDesc;}
|
|
|
|
LPCTSTR GetDataType() const {return m_sDataType;}
|
|
void SetDataType(LPCTSTR pszDataType) {m_sDataType = pszDataType;}
|
|
|
|
LPCTSTR GetValue() const {return m_sValue;}
|
|
void SetValue(LPCTSTR pszValue) {m_sValue = pszValue;}
|
|
|
|
LPCTSTR GetDefault() const {return m_sDefault;}
|
|
void SetDefault(LPCTSTR pszDefault) {m_sDefault = pszDefault;}
|
|
|
|
LPCTSTR GetVarDesc() const {return m_sVarDesc;}
|
|
void SetVarDesc(LPCTSTR pszVarDesc) {m_sVarDesc = pszVarDesc;}
|
|
|
|
BOOL IsNotNull() const {return m_bNotNull;}
|
|
void SetNotNull(BOOL bNotNull) {m_bNotNull = bNotNull;}
|
|
|
|
BOOL IsVisible() const {return m_bVisible;}
|
|
void SetVisible(BOOL bVisible) {m_bVisible = bVisible;}
|
|
|
|
BOOL IsOverride() const {return m_bOverride;}
|
|
void SetOverride(BOOL bOverride) {m_bOverride = bOverride;}
|
|
|
|
BOOL IsReadOnly() const {return m_bReadOnly;}
|
|
void SetReadOnly(BOOL bReadOnly) {m_bReadOnly = bReadOnly;}
|
|
|
|
BOOL IsNeedSave() const {return m_bNeedSave;}
|
|
void SetNeedSave(BOOL bNeedSave) {m_bNeedSave = bNeedSave;}
|
|
|
|
ULONG GetIndex() const {return m_lIndex;}
|
|
void SetIndex(ULONG lIndex) {m_lIndex = lIndex;}
|
|
|
|
LPCTSTR GetFlags() const {return m_sFlags;}
|
|
void SetFlags(LPCTSTR pszFlags) {m_sFlags = pszFlags;}
|
|
|
|
protected:
|
|
// 编号
|
|
ULONG m_lId;
|
|
// 设备
|
|
ULONG m_lClassId;
|
|
// 代号
|
|
CString m_sCode;
|
|
// 名称
|
|
CString m_sName;
|
|
// 说明
|
|
CString m_sDesc;
|
|
// 数据类型
|
|
CString m_sDataType;
|
|
// 数据取值
|
|
CString m_sValue;
|
|
// 初始化值
|
|
CString m_sDefault;
|
|
// 数值描述表
|
|
CString m_sVarDesc;
|
|
// 是否必填
|
|
BOOL m_bNotNull;
|
|
// 是否可见
|
|
BOOL m_bVisible;
|
|
// 是否可更改
|
|
BOOL m_bOverride;
|
|
// 是否只读
|
|
BOOL m_bReadOnly;
|
|
// 是否保存
|
|
BOOL m_bNeedSave;
|
|
// 顺序号
|
|
ULONG m_lIndex;
|
|
// 状态标志
|
|
CString m_sFlags;
|
|
};
|
|
|
|
typedef CArray<KTParamAttribute, KTParamAttribute&> KTParamAttributeArray;
|
|
typedef CArray<KTParamAttribute*, KTParamAttribute*&> KTParamAttributePtrArray;
|
|
|
|
class KTParamExpression
|
|
{
|
|
public:
|
|
KTParamExpression() : m_lId(0), m_lRuleId(0), m_lIndex(0) {}
|
|
KTParamExpression(const KTParamExpression& data) {operator=(data);}
|
|
|
|
KTParamExpression& operator=(const KTParamExpression& data)
|
|
{
|
|
m_lId = data.m_lId;
|
|
m_lRuleId = data.m_lRuleId;
|
|
m_sVarType = data.m_sVarType;
|
|
m_sValue = data.m_sValue;
|
|
m_lIndex = data.m_lIndex;
|
|
m_sFlags = data.m_sFlags;
|
|
return (*this);
|
|
}
|
|
|
|
ULONG GetId() const {return m_lId;}
|
|
void SetId(ULONG lId) {m_lId = lId;}
|
|
|
|
ULONG GetRuleId() const {return m_lRuleId;}
|
|
void SetRuleId(ULONG lId) {m_lRuleId = lId;}
|
|
|
|
LPCTSTR GetVarType() const {return m_sVarType;}
|
|
void SetVarType(LPCTSTR pszVarType) {m_sVarType = pszVarType;}
|
|
|
|
LPCTSTR GetValue() const {return m_sValue;}
|
|
void SetValue(LPCTSTR pszValue) {m_sValue = pszValue;}
|
|
|
|
ULONG GetIndex() const {return m_lIndex;}
|
|
void SetIndex(ULONG lIndex) {m_lIndex = lIndex;}
|
|
|
|
LPCTSTR GetFlags() const {return m_sFlags;}
|
|
void SetFlags(LPCTSTR pszFlags) {m_sFlags = pszFlags;}
|
|
|
|
protected:
|
|
// 编号
|
|
ULONG m_lId;
|
|
// 约束
|
|
ULONG m_lRuleId;
|
|
// 参数类型
|
|
CString m_sVarType;
|
|
// 参数数据
|
|
CString m_sValue;
|
|
// 顺序号
|
|
ULONG m_lIndex;
|
|
// 状态标志
|
|
CString m_sFlags;
|
|
};
|
|
|
|
typedef CArray<KTParamExpression, KTParamExpression&> KTParamExpressionArray;
|
|
typedef CArray<KTParamExpression*, KTParamExpression*&> KTParamExpressionPtrArray;
|
|
|
|
class KTParamRule
|
|
{
|
|
public:
|
|
KTParamRule() : m_lId(0), m_lClassId(0), m_lIndex(0) {}
|
|
KTParamRule(const KTParamRule& data) {operator=(data);}
|
|
|
|
KTParamRule& operator=(const KTParamRule& data)
|
|
{
|
|
m_lId = data.m_lId;
|
|
m_lClassId = data.m_lClassId;
|
|
m_sCurveType= data.m_sCurveType;
|
|
m_sDrawType = data.m_sDrawType;
|
|
m_lIndex = data.m_lIndex;
|
|
m_sFlags = data.m_sFlags;
|
|
return (*this);
|
|
}
|
|
|
|
void MapFieldToValue(CMapStringToString& mapData)
|
|
{
|
|
mapData[_T("ID")] = LongToString(m_lId);
|
|
mapData[_T("ClassID")] = LongToString(m_lClassId);
|
|
mapData[_T("CurveType")] = m_sCurveType;
|
|
mapData[_T("DrawType")] = m_sDrawType;
|
|
mapData[_T("Index")] = LongToString(m_lIndex);
|
|
mapData[_T("Flags")] = m_sFlags;
|
|
}
|
|
|
|
BOOL GetValue(LPCTSTR pszName, CString& sValue) const
|
|
{
|
|
ASSERT(NULL != pszName && _tcslen(pszName) > 0);
|
|
if (_tcsicmp(pszName, _T("ID")) == 0) sValue = LongToString(m_lId);
|
|
else if (_tcsicmp(pszName, _T("ClassID")) == 0) sValue = LongToString(m_lClassId);
|
|
else if (_tcsicmp(pszName, _T("CurveType")) == 0) sValue = m_sCurveType;
|
|
else if (_tcsicmp(pszName, _T("DrawType")) == 0) sValue = m_sDrawType;
|
|
else if (_tcsicmp(pszName, _T("Index")) == 0) sValue = LongToString(m_lIndex);
|
|
else if (_tcsicmp(pszName, _T("Flags")) == 0) sValue = m_sFlags;
|
|
else return FALSE;
|
|
return TRUE;
|
|
}
|
|
|
|
BOOL SetValue(LPCTSTR pszName, LPCTSTR pszValue)
|
|
{
|
|
if (_tcsicmp(pszName, _T("ID")) == 0) m_lId = StringToLong(pszValue);
|
|
else if (_tcsicmp(pszName, _T("ClassID")) == 0) m_lClassId = StringToLong(pszValue);
|
|
else if (_tcsicmp(pszName, _T("CurveType")) == 0) m_sCurveType = pszValue;
|
|
else if (_tcsicmp(pszName, _T("DrawType")) == 0) m_sDrawType = pszValue;
|
|
else if (_tcsicmp(pszName, _T("Index")) == 0) m_lIndex = StringToLong(pszValue);
|
|
else if (_tcsicmp(pszName, _T("Flags")) == 0) m_sFlags = pszValue;
|
|
else return FALSE;
|
|
return TRUE;
|
|
}
|
|
|
|
ULONG GetId() const {return m_lId;}
|
|
void SetId(ULONG lId) {m_lId = lId;}
|
|
|
|
ULONG GetClassId() const {return m_lClassId;}
|
|
void SetClassId(ULONG lId) {m_lClassId = lId;}
|
|
|
|
LPCTSTR GetCurveType() const {return m_sCurveType;}
|
|
void SetCurveType(LPCTSTR pszCurveType) {m_sCurveType = pszCurveType;}
|
|
|
|
LPCTSTR GetDrawType() const {return m_sDrawType;}
|
|
void SetDrawType(LPCTSTR pszDrawType) {m_sDrawType = pszDrawType;}
|
|
|
|
ULONG GetIndex() const {return m_lIndex;}
|
|
void SetIndex(ULONG lIndex) {m_lIndex = lIndex;}
|
|
|
|
LPCTSTR GetFlags() const {return m_sFlags;}
|
|
void SetFlags(LPCTSTR pszFlags) {m_sFlags = pszFlags;}
|
|
|
|
// 表达式数据
|
|
KTParamExpressionArray m_arExpression;
|
|
|
|
protected:
|
|
// 编号
|
|
ULONG m_lId;
|
|
// 设备
|
|
ULONG m_lClassId;
|
|
// 图元类型
|
|
CString m_sCurveType;
|
|
// 绘制类型
|
|
CString m_sDrawType;
|
|
// 顺序号
|
|
ULONG m_lIndex;
|
|
// 状态标志
|
|
CString m_sFlags;
|
|
};
|
|
|
|
typedef CArray<KTParamRule, KTParamRule&> KTParamRuleArray;
|
|
typedef CArray<KTParamRule*, KTParamRule*&> KTParamRulePtrArray;
|
|
|
|
#endif // !defined(__KTPARAMCLASS_H__)
|