You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nmWTAI-Platform/Include/nmNum/nmSubWxs/nmReservoirPropertiesSession.h

99 lines
3.2 KiB
C

#pragma once
#include "nmSubWxs_global.h"
#include "nmReservoirPropertiesDataSource.h"
#include "nmReservoirParameterCatalog.h"
#include <QMap>
#include <QVariant>
class nmAttrRegistry;
/**
* @brief
* @note
*/
class NM_SUB_WXS_EXPORT nmReservoirPropertiesSession
{
public:
/**
* @brief
* @param pDataSource
*/
explicit nmReservoirPropertiesSession(nmIReservoirPropertiesDataSource* pDataSource);
/** @brief 析构编辑会话及其独立注册表。 */
~nmReservoirPropertiesSession();
/**
* @brief
* @param sError
* @return true
*/
bool initialize(QString& sError);
/**
* @brief
* @param eCategory
* @return
*/
QList<nmReservoirPropertyObjectInfo> objectInfos(
nmReservoirPropertiesCategory eCategory);
/**
* @brief
* @param sParameterId ID
* @return QVariant
*/
QVariant value(const QString& sParameterId) const;
/**
* @brief
* @param sParameterId ID
* @param oValue
* @return true
*/
bool setValue(const QString& sParameterId, const QVariant& oValue);
/**
* @brief
* @param mapValues ID
*/
void setValues(const QMap<QString, QVariant>& mapValues);
/**
* @brief code
* @param sParameterId ID
* @return code
*/
QString enumCode(const QString& sParameterId) const;
/**
* @brief code
* @param sParameterId ID
* @param sCode code
* @return true
*/
bool setEnumCode(const QString& sParameterId, const QString& sCode);
/**
* @brief
* @param sError
* @return true
*/
bool commit(QString& sError);
/** @brief 获取只读工作副本,供后续导入预览或测试使用。 */
const nmReservoirPropertiesSnapshot& workingSnapshot() const;
private:
/** @brief 判断井坐标或几何参数是否发生变化。 */
bool isGeometryChanged() const;
nmIReservoirPropertiesDataSource* m_pDataSource; ///< 参数数据源,不拥有所有权。
nmAttrRegistry* m_pAttrRegistry; ///< 编辑会话独占的属性注册表。
nmReservoirPropertiesSnapshot m_oOriginalSnapshot; ///< 打开对话框时的原始快照。
nmReservoirPropertiesSnapshot m_oWorkingSnapshot; ///< 所有界面编辑写入的工作副本。
bool m_bInitialized; ///< 会话是否初始化成功。
};