21 #include "ui_univariateconcatenationdialog.h" 30 dataset_ = workspace_->GetDataset(dataset_key);
31 QStringList results_keys = dataset_->AnalysisResultsKeys();
32 QStringList univariate_keys;
34 for (
auto results_key: results_keys){
35 QSharedPointer<AnalysisResults> results = dataset_->GetAnalysisResult(results_key);
36 if (results->type() ==
"Univariate Analysis Results")
37 univariate_keys << results_key;
39 univariate_keys.sort();
40 ui->resultsListWidget->addItems(univariate_keys);
48 void UnivariateConcatenationDialog::on_buttonBox_accepted()
50 QStringList selected_keys;
51 QList<QListWidgetItem*> items = ui->resultsListWidget->selectedItems();
52 for (
auto item: items) selected_keys << item->text();
54 QSharedPointer<AnalysisResults> first_results = dataset_->GetAnalysisResult(selected_keys.first());
55 QSharedPointer<AnalysisResults> new_results = first_results->Replicate();
56 new_results->SetName(ui->nameLineEdit->text());
57 selected_keys.removeFirst();
58 for (
auto key: selected_keys){
59 bool ok = new_results->Concatenate(dataset_->GetAnalysisResult(key));
61 QMessageBox::warning(
this,
"Error",
"Could not concatenate results");
67 QStringList subkeys({
"Peak Centers",
69 "Adjusted Peak Intensities",
72 "Area Between Inflection Points",
73 "Adjusted Area Between Inflection Points",
74 "Empirical Full-Width at Half-Maximum"});
75 QMap<QString, uvec> parent_rows = first_results->parent_rows();
76 for (
auto key: parent_rows.keys()){
77 QSharedPointer<VespucciDataset> current_dataset = workspace_->GetDataset(key);
78 if (!current_dataset.isNull()){
79 current_dataset->AddAnalysisResult(new_results,
80 parent_rows.value(key)(0),
81 parent_rows.value(key)(1));
83 current_dataset->AddAnalysisResult(new_results->Subset(subkeys,
84 parent_rows.value(key)(0),
85 parent_rows.value(key)(1)));
94 void UnivariateConcatenationDialog::on_buttonBox_rejected()
UnivariateConcatenationDialog(QWidget *parent, QSharedPointer< VespucciWorkspace > ws, const QString &dataset_key)
~UnivariateConcatenationDialog()