21 #include "ui_plsdialog.h" 24 PLSDialog::PLSDialog(QWidget *parent, QSharedPointer<VespucciWorkspace> ws, QSharedPointer<AbstractDataAnalyzer> analyzer) :
31 ui->matrixDisplayLabel->setVisible(
false);
32 ui->matrixLabel->setVisible(
false);
33 ui->selectPushButton->setVisible(
false);
48 void PLSDialog::on_buttonBox_accepted()
50 if (!analyzer_.isNull()){
51 int components = ui->componentsSpinBox->value();
52 QString name = ui->nameLineEdit->text();
53 QString type = ui->analysisTypeComboBox->currentText();
56 if (type ==
"Classification (Principal Components)")
57 analyzer_->PartialLeastSquares(name, components);
58 else if (type ==
"Calibration")
59 analyzer_->PLSCalibration(name, control_keys_);
60 else if (type ==
"Train PLS-DA")
61 analyzer_->TrainPLSDA(name, control_keys_);
63 workspace_->main_window()->DisplayExceptionWarning(e);
73 void PLSDialog::on_buttonBox_rejected()
79 void PLSDialog::on_predictionCheckBox_clicked(
bool checked)
81 ui->componentsSpinBox->setVisible(!checked);
84 void PLSDialog::on_analysisTypeComboBox_currentIndexChanged(
const QString &arg1)
86 if (arg1 ==
"Classification (Principal Components)"){
87 ui->matrixDisplayLabel->setVisible(
false);
88 ui->matrixLabel->setVisible(
false);
89 ui->selectPushButton->setVisible(
false);
90 ui->componentsLabel->setVisible(
true);
91 ui->componentsSpinBox->setVisible(
true);
93 else if (arg1 ==
"Calibration"){
94 ui->matrixDisplayLabel->setVisible(
true);
95 ui->matrixLabel->setVisible(
true);
96 ui->selectPushButton->setVisible(
true);
97 ui->componentsLabel->setVisible(
false);
98 ui->componentsSpinBox->setVisible(
false);
100 else if (arg1 ==
"Train PLS-DA"){
101 ui->matrixDisplayLabel->setVisible(
true);
102 ui->matrixLabel->setVisible(
true);
103 ui->selectPushButton->setVisible(
true);
104 ui->componentsLabel->setVisible(
false);
105 ui->componentsSpinBox->setVisible(
false);
109 void PLSDialog::on_selectPushButton_clicked()
111 matrix_selection_dialog_->show();
116 control_keys_ = keys;
117 ui->matrixDisplayLabel->setText(control_keys_.last());
void MatrixSelected(QStringList keys)
PLSDialog(QWidget *parent, QSharedPointer< VespucciWorkspace > ws, QSharedPointer< AbstractDataAnalyzer > analyzer)
The PLSDialog class Dialog that allows the user to perform PLS determinant analysis.
void MatrixSelected(QStringList keys)