#ifndef NMWXSENSITIVE_H #define NMWXSENSITIVE_H #include "iDlgBase.h" #include "nmSubWxs_global.h" #include "nmDataSensitive.h" #include 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 m_resultsDialog; QPointer m_resultsModel; // 各个变量页面的控件列表 QList m_modeCombos; QList m_logChecks; QList m_numSpins; QList m_modelSpins; QList m_minSpins; QList m_maxSpins; QList m_valueTables; QList 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