78 lines
2.4 KiB
C++
78 lines
2.4 KiB
C++
/*============================================================================*
|
|
|
|
* 类 名: CTHvacCfgLayStd
|
|
* 版 本: 1.0
|
|
* 作 者: hh
|
|
* 创建时间: 2011-08-10
|
|
* 描 述: 风管系统图层标准管理类
|
|
* 历史记录:
|
|
=============================================================================*/
|
|
#ifndef _THVACCFGLAYSTD_H_
|
|
#define _THVACCFGLAYSTD_H_
|
|
|
|
class CTHvacCfgLayStd
|
|
{
|
|
typedef struct tagSDuctLayStd
|
|
{
|
|
CString sLayStdName; // 图层标准名称
|
|
CString sTableName; // 该图层标准对应的表名
|
|
BOOL bIsCurr; // 是否当前标准
|
|
int nIndex; // 索引 用于生成数据表名
|
|
}SDUCTLAYSTD, *LPSDUCTLAYSTD;
|
|
public:
|
|
CTHvacCfgLayStd();
|
|
~CTHvacCfgLayStd();
|
|
|
|
// 判断图层标准是否有效(用以兼容以前版本的数据库)
|
|
static BOOL IsLayStdEnable(CUIISQLiteServer* pDB = NULL);
|
|
|
|
// 初始化
|
|
void Init();
|
|
// 重新初始化
|
|
void Reinit();
|
|
// 取得当前图层标准名
|
|
LPCTSTR GetCurStdName();
|
|
// 取得所有的图层标准名
|
|
int GetAllStdNames(CStringArray& arStdNames) const;
|
|
// 取得当前图层标准的数据表名
|
|
LPCTSTR GetCurStdTab() const;
|
|
// 取得图层标准对应的数据表名
|
|
LPCTSTR GetStdTabName(LPCTSTR pszStdName) const;
|
|
// 设置新的当前图层标准
|
|
BOOL SetCurStd(LPCTSTR pszStdName);
|
|
// 判断是否当前标准
|
|
BOOL IsCurStd(LPCTSTR pszStdName) const;
|
|
// 判断标准是否存在
|
|
BOOL IsStdExist(LPCTSTR pszStdName) const;
|
|
// 添加一个新标准
|
|
BOOL AddNewStandard(LPCTSTR pszStdName);
|
|
// 从另一个数据库中添加新标准
|
|
int AddNewStandardFormDB(CUIISQLiteServer* pDBSrc, LPCTSTR pszStdName = NULL);
|
|
// 删除一个标准
|
|
BOOL RemoveStandard(LPCTSTR pszStdName);
|
|
|
|
protected:
|
|
// 生成一个新的图层标准索引
|
|
int MakeNewStdIndex() const;
|
|
// 根据索引生成一个新的表名
|
|
CString MakeTabName(int nIndex) const;
|
|
// 添加一个标准到映射中
|
|
void AddStdToMap(LPCTSTR pszKey, LPSDUCTLAYSTD pNewLayStd);
|
|
// 释放内存
|
|
void Release();
|
|
// 拷贝数据表
|
|
BOOL CopyTable(CUIISQLiteServer* pSrcDB, LPCTSTR pszSrcTab,
|
|
CUIISQLiteServer* pDstDB, LPCTSTR pszDstTab);
|
|
|
|
protected:
|
|
CMapStringToPtr m_mapLayStds; // 图层标准映射
|
|
CString m_sCurStdName; // 当前图层标准名称
|
|
BOOL m_bInited; // 指示是否已经初始化
|
|
|
|
public:
|
|
CUIISQLiteServer* m_pAdoSer; //
|
|
};
|
|
extern CTHvacCfgLayStd g_sTHvacLayStd;
|
|
|
|
#endif // _THVACCFGLAYSTD_H_
|