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.
123 lines
3.5 KiB
C++
123 lines
3.5 KiB
C++
#ifndef NMWXAUTOMATICFITTING_H
|
|
#define NMWXAUTOMATICFITTING_H
|
|
|
|
#include "iDlgBase.h"
|
|
#include <QVBoxLayout>
|
|
#include <QHBoxLayout>
|
|
#include <QTableWidget>
|
|
#include <QCheckBox>
|
|
#include <QLineEdit>
|
|
#include <QComboBox>
|
|
#include <QPushButton>
|
|
#include <QLabel>
|
|
#include <QHeaderView>
|
|
#include <QProgressDialog>
|
|
#include <QTimer>
|
|
#include <QMessageBox>
|
|
#include <QApplication>
|
|
|
|
#include "nmDataAnalyzeManager.h"
|
|
#include "nmDataReservoir.h"
|
|
#include "nmDataWellBase.h"
|
|
#include "nmDataAutomaticFitting.h"
|
|
#include "nmCalculationAutoFitPSO.h"
|
|
#include "nmCalculationAutoFitGA.h"
|
|
#include "nmWxAutomaticfittingStart.h"
|
|
|
|
#include "nmSubWxs_global.h"
|
|
|
|
// 算法类型枚举
|
|
enum OptimizationAlgorithm {
|
|
ALGORITHM_PSO = 0,
|
|
ALGORITHM_GA = 1
|
|
};
|
|
|
|
class NM_SUB_WXS_EXPORT nmWxAutomaticFitting : public iDlgBase
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
nmWxAutomaticFitting(QWidget *parent = 0);
|
|
~nmWxAutomaticFitting();
|
|
|
|
private slots:
|
|
void onCellSelectionChanged(int currentRow, int currentColumn, int previousRow, int previousColumn);
|
|
void onReverseSelection();
|
|
void onAccept();
|
|
void onReject();
|
|
void onWellSelected(int index);
|
|
void onAlgorithmChanged(int index);
|
|
|
|
// 自动拟合相关槽函数
|
|
void runAutoFitting();
|
|
void onFittingProgress(int iteration, double fitness);
|
|
void onFittingFinished(bool success, const QString& message);
|
|
void onStopFitting();
|
|
|
|
private:
|
|
void setupUI();
|
|
void setupParameterTable();
|
|
void setupControlPanel();
|
|
void setupButtons();
|
|
void setAutomaticFittingValue();
|
|
void setParameterRowVisible(QTableWidget* table, int row, bool visible);
|
|
void renumberVisibleParameterRows(QTableWidget* table);
|
|
void updateParameterVisibility(QTableWidget* table, NM_SOLVER_MODEL_TYPE eType);
|
|
|
|
void startAutoFitting(const QVector<QVector<double>>& targetData, const QStringList& selectedParams, const QString& targetWellName);
|
|
void cleanupFitting();
|
|
|
|
void updateBestParametersToTable();
|
|
|
|
|
|
private:
|
|
// UI组件
|
|
QVBoxLayout* m_mainLayout;
|
|
QVBoxLayout* m_controlLayout;
|
|
QTableWidget* m_parameterTable;
|
|
|
|
// 控制面板组件
|
|
QLineEdit* m_iterationEdit;
|
|
QLineEdit* m_errorLimitEdit;
|
|
QComboBox* m_targetWellCombo;
|
|
QComboBox* m_algorithmCombo;
|
|
QComboBox* m_surrogateCombo;
|
|
|
|
// 参数复选框
|
|
QCheckBox* m_kCheckBox; // 渗透率
|
|
QCheckBox* m_sCheckBox; // 表皮系数
|
|
QCheckBox* m_cCheckBox; // 井筒储集系数
|
|
QCheckBox* m_phiCheckBox; // 孔隙度
|
|
QCheckBox* m_piCheckBox; // 初始压力
|
|
QCheckBox* m_hCheckBox; // 储层厚度
|
|
QCheckBox* m_ctCheckBox; // 综合压缩系数
|
|
QCheckBox* m_cfCheckBox; // 岩石压缩系数
|
|
QCheckBox* m_soiCheckBox; // 初始含油饱和度
|
|
QCheckBox* m_swiCheckBox; // 初始含水饱和度
|
|
QCheckBox* m_sgiCheckBox; // 初始含气饱和度
|
|
|
|
// 按钮
|
|
QPushButton* m_reverseBtn;
|
|
QPushButton* m_okBtn;
|
|
QPushButton* m_cancelBtn;
|
|
|
|
// 数据成员
|
|
nmDataReservoir reservoirData;
|
|
QVector<nmDataVerticalWell> m_verticalWells;
|
|
QVector<nmDataHorizontalWell> m_horizontalWells;
|
|
QVector<nmDataVerticalFracturedWell> m_verticalFracturedWells;
|
|
QVector<nmDataHorizontalFracturedWell> m_horizontalFracturedWells;
|
|
nmDataAutomaticFitting automaticFittingData;
|
|
|
|
// 自动拟合相关成员
|
|
nmCalculationAutoFitPSO* m_autoFitterPSO;
|
|
nmCalculationAutoFitGA* m_autoFitterGA;
|
|
QProgressDialog* m_progressDialog;
|
|
QTimer* m_progressTimer;
|
|
OptimizationAlgorithm m_selectedAlgorithm; // 选中的算法类型
|
|
|
|
// 拟合开始界面
|
|
nmWxAutomaticfittingStart* m_progressMonitor;
|
|
};
|
|
#endif // NMWXAUTOMATICFITTING_H
|