|
|
|
|
|
#ifndef NMWXSENSITIVE_H
|
|
|
|
|
|
#define NMWXSENSITIVE_H
|
|
|
|
|
|
|
|
|
|
|
|
#include "iDlgBase.h"
|
|
|
|
|
|
#include "nmSubWxs_global.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "nmDataSensitive.h"
|
|
|
|
|
|
#include <QPointer>
|
|
|
|
|
|
|
|
|
|
|
|
class QTreeWidget;
|
|
|
|
|
|
class QTreeWidgetItem;
|
|
|
|
|
|
class QComboBox;
|
|
|
|
|
|
class QPushButton;
|
|
|
|
|
|
class QStackedWidget;
|
|
|
|
|
|
class QCheckBox;
|
|
|
|
|
|
class QSpinBox;
|
|
|
|
|
|
class QLineEdit;
|
|
|
|
|
|
class nmDataAnalyzeManager;
|
|
|
|
|
|
class QTableWidget;
|
|
|
|
|
|
class QLabel;
|
|
|
|
|
|
class QIcon;
|
|
|
|
|
|
class SensitivityRunsView;
|
|
|
|
|
|
class nmCalculationDllPebiSolverTask;
|
|
|
|
|
|
class QCloseEvent;
|
|
|
|
|
|
class QDialog;
|
|
|
|
|
|
class SensitivityResultsModel;
|
|
|
|
|
|
|
|
|
|
|
|
class NM_SUB_WXS_EXPORT nmWxSensitive : public iDlgBase
|
|
|
|
|
|
{
|
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
explicit nmWxSensitive(QWidget *parent = 0, nmDataAnalyzeManager* manager = nullptr);
|
|
|
|
|
|
~nmWxSensitive();
|
|
|
|
|
|
// 主窗口接管普通求解进度框后,才隐藏参数窗口并启动批量任务。
|
|
|
|
|
|
void startSensitivityCalculation();
|
|
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
|
void sigSensitivityTaskReady(nmWxSensitive* dialog, nmCalculationDllPebiSolverTask* task);
|
|
|
|
|
|
void sigSensitivityCancelRequested();
|
|
|
|
|
|
void sigSensitiveResultsRequested();
|
|
|
|
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
|
void reject() override;
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
void closeEvent(QCloseEvent* event) override;
|
|
|
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
|
void onGenerateClicked();
|
|
|
|
|
|
void onCancelClicked();
|
|
|
|
|
|
void onCalculationTypeChanged(int index);
|
|
|
|
|
|
void onTreeItemClicked(QTreeWidgetItem *item, int column);
|
|
|
|
|
|
void onVariableParamChanged();
|
|
|
|
|
|
void onSamplingEditingFinished();
|
|
|
|
|
|
void onTableCellClicked(int row, int column);
|
|
|
|
|
|
void onTreeItemChanged(QTreeWidgetItem *item, int column);
|
|
|
|
|
|
void onPreviewClicked();
|
|
|
|
|
|
void onPreviewScrollAction(int action);
|
|
|
|
|
|
void onSensitivityFinished();
|
|
|
|
|
|
void onResultsClicked();
|
|
|
|
|
|
void onResultsChanged();
|
|
|
|
|
|
void onModelResultChanged();
|
|
|
|
|
|
void onApplyResults();
|
|
|
|
|
|
void onAcceptResults();
|
|
|
|
|
|
void onShowAllResults();
|
|
|
|
|
|
void onHideAllResults();
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
void setupUI();
|
|
|
|
|
|
void createConnections();
|
|
|
|
|
|
void populateTreeWidget();
|
|
|
|
|
|
void createDetailPages();
|
|
|
|
|
|
QWidget *createVariablePage(const QString &varName);
|
|
|
|
|
|
void updateValuesForPage(int idx);
|
|
|
|
|
|
QIcon createTriangleIcon(); // 创建三角箭头图标
|
|
|
|
|
|
|
|
|
|
|
|
void loadDataToUI(bool refreshRangesOnly = false); // 从数据加载到界面
|
|
|
|
|
|
bool saveDataFromUI(); // 校验并从界面保存到数据
|
|
|
|
|
|
void refreshModelValues();
|
|
|
|
|
|
void updateModelCount();
|
|
|
|
|
|
void setCalculationRunning(bool running);
|
|
|
|
|
|
int findVariableIndex(const QString& varName); // 查找变量索引
|
|
|
|
|
|
|
|
|
|
|
|
// UI 控件
|
|
|
|
|
|
QComboBox *calculationTypeCombo;
|
|
|
|
|
|
QTreeWidget *variablesTree;
|
|
|
|
|
|
QStackedWidget *detailStack;
|
|
|
|
|
|
QLabel *modelCountLabel;
|
|
|
|
|
|
QPushButton *generateButton;
|
|
|
|
|
|
QPushButton *cancelButton;
|
|
|
|
|
|
QPushButton *previewButton;
|
|
|
|
|
|
QPushButton *resultsButton;
|
|
|
|
|
|
QPointer<QDialog> m_resultsDialog;
|
|
|
|
|
|
QPointer<SensitivityResultsModel> m_resultsModel;
|
|
|
|
|
|
|
|
|
|
|
|
// 各个变量页面的控件列表
|
|
|
|
|
|
QList<QComboBox*> m_modeCombos;
|
|
|
|
|
|
QList<QCheckBox*> m_logChecks;
|
|
|
|
|
|
QList<QSpinBox*> m_numSpins;
|
|
|
|
|
|
QList<QLineEdit*> m_modelSpins;
|
|
|
|
|
|
QList<QLineEdit*> m_minSpins;
|
|
|
|
|
|
QList<QLineEdit*> m_maxSpins;
|
|
|
|
|
|
QList<QTableWidget*> m_valueTables;
|
|
|
|
|
|
QList<QLabel*> m_unitLabels;
|
|
|
|
|
|
|
|
|
|
|
|
// 跟踪当前选中的值索引
|
|
|
|
|
|
int m_selectedValueIndex;
|
|
|
|
|
|
bool m_loading;
|
|
|
|
|
|
nmDataAnalyzeManager* m_pDataManager;
|
|
|
|
|
|
SensitivityRunsView* m_previewView;
|
|
|
|
|
|
nmCalculationDllPebiSolverTask* m_pSensitivityTask;
|
|
|
|
|
|
bool m_calculationRunning;
|
|
|
|
|
|
|
|
|
|
|
|
// 敏感分析数据
|
|
|
|
|
|
nmDataSensitive m_sensitiveData;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // NMWXSENSITIVE_H
|