21 #include "ui_filterdialog.h" 35 dataset_ = workspace_->GetDataset(dataset_key);
47 void FilterDialog::on_methodComboBox_currentIndexChanged(
int index)
49 if ((index != 4) && ui->epsilonSpinBox->isEnabled())
50 ui->epsilonSpinBox->setEnabled(
false);
51 if ((index == 4) && !ui->epsilonSpinBox->isEnabled())
52 ui->epsilonSpinBox->setEnabled(
true);
53 if (((index == 0) || (index == 1)) && !ui->windowSpinBox->isEnabled())
54 ui->windowSpinBox->setEnabled(
true);
55 if ((index!=2) && (ui->derivativeSpinBox->isEnabled()))
56 ui->derivativeSpinBox->setEnabled(
false);
57 if ((index == 2) && (!ui->derivativeSpinBox->isEnabled()))
58 ui->derivativeSpinBox->setEnabled(
true);
59 if ((index == 2) && (!ui->windowSpinBox->isEnabled()))
60 ui->windowSpinBox->setEnabled(
true);
61 if ((index != 2) && (ui->polynomialSpinBox->isEnabled()))
62 ui->polynomialSpinBox->setEnabled(
false);
63 if ((index == 2)&&(!ui->polynomialSpinBox->isEnabled()))
64 ui->polynomialSpinBox->setEnabled(
true);
66 ui->singularValuesSpinBox->setDisabled(
true);
68 ui->singularValuesSpinBox->setEnabled(
true);
69 ui->windowSpinBox->setDisabled(
true);
76 void FilterDialog::on_buttonBox_accepted()
79 switch (ui->methodComboBox->currentIndex())
83 dataset_->MedianFilter(ui->windowSpinBox->value());
86 workspace_->main_window()->DisplayExceptionWarning(e);
92 dataset_->LinearMovingAverage(ui->windowSpinBox->value());
95 workspace_->main_window()->DisplayExceptionWarning(e);
100 dataset_->SavitzkyGolay(ui->derivativeSpinBox->value(),
101 ui->polynomialSpinBox->value(),
102 ui->windowSpinBox->value());
105 workspace_->main_window()->DisplayExceptionWarning(e);
110 dataset_->SingularValue(ui->singularValuesSpinBox->value());
113 workspace_->main_window()->DisplayExceptionWarning(e);
118 SVD_rank = dataset_->QUIC_SVD(ui->epsilonSpinBox->value());
121 workspace_->main_window()->DisplayExceptionWarning(e);
124 QMessageBox::information(
this,
126 "The rank of the approximation is " +
127 QString::number(SVD_rank) +
".");
140 void FilterDialog::on_buttonBox_rejected()
The FilterDialog class This dialog allows the user to apply filtering, smoothing or derivatization to...
FilterDialog(QWidget *parent, QSharedPointer< VespucciWorkspace > ws, const QString &dataset_key)
FilterDialog::FilterDialog.