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.
143 lines
3.8 KiB
C++
143 lines
3.8 KiB
C++
#ifndef NMWXFORECAST_H
|
|
#define NMWXFORECAST_H
|
|
|
|
#include <QDialog>
|
|
#include <QVBoxLayout>
|
|
#include <QHBoxLayout>
|
|
#include <QGridLayout>
|
|
#include <QGroupBox>
|
|
#include <QRadioButton>
|
|
#include <QCheckBox>
|
|
#include <QButtonGroup>
|
|
#include <QPushButton>
|
|
#include <QStackedWidget>
|
|
#include <QTableWidget>
|
|
#include <QComboBox>
|
|
#include "nmDataForecast.h"
|
|
#include "nmGUIComponentLineEdit.h"
|
|
#include "nmDataAnalyzeManager.h"
|
|
|
|
class nmWxForecast : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit nmWxForecast(QWidget *parent = 0);
|
|
~nmWxForecast();
|
|
|
|
private slots:
|
|
// Forecast option slots
|
|
void onConstantPressureSelected();
|
|
void onDecliningPressureSelected();
|
|
void onMultiplePressuresSelected();
|
|
void onMultipleRatesSelected();
|
|
|
|
// Checkbox slots
|
|
void onUsePastHistoryToggled(bool checked);
|
|
void onSurfacePressuresToggled(bool checked);
|
|
void onAbandonmentRateCheckToggled(bool checked);
|
|
void onMaximumRateCheckToggled(bool checked);
|
|
|
|
// Button slots
|
|
void onLoadDataClicked();
|
|
void onGenerateClicked();
|
|
void onCancelClicked();
|
|
|
|
// Table edit
|
|
void onPressureCellChanged(int row, int column);
|
|
void onPressureUnitChanged(const QString& unit);
|
|
|
|
// Slots for Multiple Rates table
|
|
void onRateCellChanged(int row, int column);
|
|
void onRateUnitChanged(const QString& unit);
|
|
|
|
void onSharedDurationUnitChanged(const QString &);
|
|
|
|
private:
|
|
void setupUI();
|
|
void setupConnections();
|
|
void loadDataFromManager();
|
|
void updateParametersForOption();
|
|
void updateUIFromData();
|
|
void updateDataFromUI();
|
|
void saveDataToManager();
|
|
|
|
QWidget* buildExtEmptyPage(const QString& text = QString());
|
|
QWidget* buildExtRampPage();
|
|
QWidget* buildExtMultiPressurePage();
|
|
QWidget* buildExtMultiRatePage();
|
|
|
|
QTableWidgetItem* makeCenteredEmptyItem();
|
|
|
|
private:
|
|
|
|
nmDataForecast m_forecastData;
|
|
|
|
// Main layout
|
|
QVBoxLayout *m_mainLayout;
|
|
|
|
// Forecast options group
|
|
QGroupBox *m_forecastOptionsGroup;
|
|
QVBoxLayout *m_forecastOptionsLayout;
|
|
QRadioButton *m_constantPressureRadio;
|
|
QRadioButton *m_decliningPressureRadio;
|
|
QRadioButton *m_multiplePressuresRadio;
|
|
QRadioButton *m_multipleRatesRadio;
|
|
QButtonGroup *m_forecastButtonGroup;
|
|
QCheckBox *m_usePastHistoryCheck;
|
|
QCheckBox *m_surfacePressuresCheck;
|
|
|
|
// Parameters group
|
|
QGroupBox *m_parametersGroup;
|
|
QGridLayout *m_parametersLayout;
|
|
|
|
// Base parameters
|
|
nmGUIComponentLineEdit *m_initialPressureComponent;
|
|
|
|
QCheckBox *m_abandonmentRateCheck;
|
|
nmGUIComponentLineEdit *m_abandonmentRateComponent;
|
|
|
|
QCheckBox *m_maximumRateCheck;
|
|
nmGUIComponentLineEdit *m_maximumRateComponent;
|
|
|
|
nmGUIComponentLineEdit *m_forecastDurationComponent;
|
|
nmGUIComponentLineEdit *m_producingPressureComponent;
|
|
|
|
// Extension stack for different options
|
|
QWidget *m_extEmpty;
|
|
QWidget *m_extRamp;
|
|
QWidget *m_extMultiP;
|
|
QWidget *m_extMultiR;
|
|
|
|
// Ramp-specific parameters
|
|
nmGUIComponentLineEdit *m_producingPressureEndComponent;
|
|
nmGUIComponentLineEdit *m_pressureChangePeriodComponent;
|
|
|
|
// Bottom buttons
|
|
QHBoxLayout *m_buttonLayout;
|
|
QPushButton *m_loadDataButton;
|
|
QPushButton *m_generateButton;
|
|
QPushButton *m_cancelButton;
|
|
|
|
// Table
|
|
QTableWidget* m_pressureTableWidget;
|
|
QComboBox* m_pDurationUnitCombo;
|
|
QComboBox* m_pPressureUnitCombo;
|
|
QString m_currentDurationUnit;
|
|
QString m_currentPressureUnit;
|
|
|
|
// For Multiple Rates
|
|
QTableWidget* m_rateTableWidget;
|
|
QComboBox* m_rDurationUnitCombo;
|
|
QComboBox* m_rRateUnitCombo;
|
|
QString m_currentRateUnit;
|
|
|
|
QStackedWidget* m_extStackedWidget;
|
|
QStackedWidget* m_abandonmentStack;
|
|
QStackedWidget* m_maximumStack;
|
|
|
|
QWidget* m_abandonmentSpacer;
|
|
QWidget* m_maximumSpacer;
|
|
};
|
|
|
|
#endif // NMWXFORECAST_H
|