|
|
#pragma once
|
|
|
|
|
|
#include "Defines.h"
|
|
|
|
|
|
#include "iXmlTable.h"
|
|
|
#include "iXmlAlias.h"
|
|
|
#include "iModelInfoBase.h"
|
|
|
#include "iModelDescGroup.h"
|
|
|
#include "iParameterGroup.h"
|
|
|
#include "iParameterGroupSp.h"
|
|
|
#include "iPvtParaItemGroup.h"
|
|
|
#include "iIprAlgItemGroup.h"
|
|
|
#include "iUnitGroup.h"
|
|
|
|
|
|
#include "IxDynObj.h"
|
|
|
|
|
|
#include "iXmlBtn.h"
|
|
|
#include "iXmlCmds.h"
|
|
|
#include "iSpeciParam.h"
|
|
|
|
|
|
#include "iSysUtils_global.h"
|
|
|
#include "iXmlCurveDictConfig.h"
|
|
|
|
|
|
class I_SYSUTILS_EXPORT zxSysUtils
|
|
|
{
|
|
|
public:
|
|
|
|
|
|
// 获取对象,单例模式
|
|
|
static zxSysUtils* getInstance();
|
|
|
|
|
|
// 关闭消耗
|
|
|
static void release();
|
|
|
|
|
|
// 状态栏相关
|
|
|
static void setStatusLabel(QLabel* pStatusLabel);
|
|
|
void setStatusText(QString sText, int nLevel = 0);
|
|
|
|
|
|
// 当前井、项目、作业
|
|
|
static void setCurProject(IxDynObj* p);
|
|
|
static IxDynObj* getCurProject();
|
|
|
static void setCurWell(IxDynObj* p);
|
|
|
static IxDynObj* getCurWell();
|
|
|
static void setCurJobRun(QObject* p);
|
|
|
static QObject* getCurJobRun();
|
|
|
|
|
|
// 对Setting进行统一管理,保存窗口状态用
|
|
|
QSettings* getWndSettings(QString& sWndKey, bool bResetIfExists = false);
|
|
|
|
|
|
// 加载TableStruct
|
|
|
bool loadTableStructs(QString sFile);
|
|
|
|
|
|
// 加载Models
|
|
|
bool loadModelInfos(QString sFile /*= ""*/);
|
|
|
|
|
|
// 加载Parameters
|
|
|
bool loadParaDefines(QString sFile /*= ""*/, QString sFileEx = "");
|
|
|
|
|
|
// 加载PvtMethod
|
|
|
bool loadPvtParaItems(QString sFile /*= ""*/);
|
|
|
bool loadIprAlgItems(QString sFile /*= ""*/);
|
|
|
|
|
|
// 特殊参数
|
|
|
bool loadSpeciParamInfos(QString sFile /*= ""*/);
|
|
|
|
|
|
// 加载BtnCmds
|
|
|
bool loadBtnCmdInfos(QString sFile /*= ""*/);
|
|
|
bool parseBtnCmd2ToolBar(QToolBar* p, QString sType, int nOption = -1, int wh = -1);
|
|
|
bool parseBtnCmdID2ToolBar(QToolBar* p, QStringList listIDs, int wh);
|
|
|
QString getCmdNameByID(QString sCmdID);
|
|
|
|
|
|
// 加载Unit
|
|
|
bool loadUnitInfos(QString sFile /*= ""*/);
|
|
|
|
|
|
// 曲线字典
|
|
|
bool loadCurveDictionaryInfos(QString sFile /*= ""*/);
|
|
|
|
|
|
// 字段别名
|
|
|
bool loadAliasTablesInfos(QString sFile /*= ""*/);
|
|
|
|
|
|
|
|
|
/// @brief 对于单位控件的修改
|
|
|
/// @param sPara可以英文、可以中文,查找英文优先
|
|
|
/// @param pTbxValue默认值填写上,不能为空
|
|
|
/// @param pCbxUnit单位下拉,可以为空
|
|
|
void loadAndFillWithDefault(QString sPara,
|
|
|
QLineEdit* pTbxValue,
|
|
|
QComboBox* pCbxUnit,
|
|
|
float& fDefaultValue,
|
|
|
QString& sCurUnit);
|
|
|
|
|
|
// 获取参数单位,为了一点点性能,可以英文、可以中文,查找英文优先
|
|
|
QString getUnitOfPara(QString sPara);
|
|
|
|
|
|
private:
|
|
|
|
|
|
zxSysUtils();
|
|
|
~zxSysUtils();
|
|
|
|
|
|
private:
|
|
|
|
|
|
static zxSysUtils* m_pSysInstance;
|
|
|
static QLabel* m_pStatusLabel;
|
|
|
static IxDynObj* m_pCurWell;
|
|
|
static IxDynObj* m_pCurProject;
|
|
|
static QObject* m_pCurJobRun;
|
|
|
|
|
|
public:
|
|
|
|
|
|
// 各种参数缓存,一旦成功加载,即可作为全局变量进行使用
|
|
|
|
|
|
vecXmlTablesPtr m_vecXmlTables;
|
|
|
vecXmlAliasTablesPtr m_vecXmlAliasTables;
|
|
|
vecXmlCurveItemsPtr m_vecCurveDict;
|
|
|
|
|
|
vecModelInfoBasesPtr m_vecModelWbss;
|
|
|
vecModelInfoBasesPtr m_vecModelWels;
|
|
|
vecModelInfoBasesPtr m_vecModelRess;
|
|
|
vecModelInfoBasesPtr m_vecModelBdys;
|
|
|
vecModelDescGroupsPtr m_vecModelGroups;
|
|
|
|
|
|
vecXmlCmdGroupsPtr m_vecCmdInfos;
|
|
|
vecXmlBtnsPtr m_vecBtnInfos;
|
|
|
|
|
|
vecParameterGroupsPtr m_vecParaGroups;
|
|
|
vecParameterGroupSpsPtr m_vecParaGroupSps;
|
|
|
vecPvtParaItemGroupsPtr m_vecPvtParaItemGroups;
|
|
|
|
|
|
vecIprAlgItemGroupsPtr m_vecIprAlgItemGroups;
|
|
|
vecUnitGroupPtr m_vecUnitGroups;
|
|
|
vecParamPtr m_vecSpeciParam;
|
|
|
|
|
|
QMap<QString, QString> m_mapParaUnits;
|
|
|
};
|