SedSat3 1.1.6
Sediment Source Apportionment Tool - Advanced statistical methods for environmental pollution research
Loading...
Searching...
No Matches
selectsamples.cpp
Go to the documentation of this file.
1// SedSAT3 – Sediment Source Assessment Tool, version 3
2// U.S. Geological Survey. See LICENSE.md and DISCLAIMER.md in the repository root.
3
4#include "selectsamples.h"
5#include "ui_selectsamples.h"
8
10 QWidget(parent),
11 ui(new Ui::SelectSamples)
12{
13 ui->setupUi(this);
14 connect(ui->GroupComboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(comboChanged()));
15}
16
18{
19 delete ui;
20}
21
23{
24 data = _data;
25 ui->GroupComboBox->clear();
26 for (map<string,Elemental_Profile_Set>::iterator it=data->begin(); it!=data->end(); it++)
27 {
28 if (Mode!=mode::regressions || it->first!=data->GetTargetGroup())
29 ui->GroupComboBox->addItem(QString::fromStdString(it->first));
30 }
33 samplemodel->SetSelectedSource(ui->GroupComboBox->currentText().toStdString());
34 ui->SamplestableView->setModel(samplemodel);
35 SelectSampleDelegate *samplesDelegate = new SelectSampleDelegate(data, this);
36 samplesDelegate->SetMode(mode::samples);
37 ui->SamplestableView->setItemDelegate(samplesDelegate);
38 }
39 else if (Mode==mode::regressions)
40 {
41 OmSizeCorrectionTableModel *OMSizemodel = new OmSizeCorrectionTableModel(data->operator[](ui->GroupComboBox->currentText().toStdString()).GetRegressionModels());
42 ui->SamplestableView->setModel(OMSizemodel);
43 SelectSampleDelegate *omsizecorrectionDelegate = new SelectSampleDelegate(data, this);
44 omsizecorrectionDelegate->SetMode(mode::regressions);
45 ui->SamplestableView->setItemDelegate(omsizecorrectionDelegate);
46 }
47
48
49}
50
52{
55 samplemodel->SetSelectedSource(ui->GroupComboBox->currentText().toStdString());
56 ui->SamplestableView->setModel(samplemodel);
57 }
58 else if (Mode==mode::regressions)
59 {
60 OmSizeCorrectionTableModel *OMSizemodel = new OmSizeCorrectionTableModel(data->operator[](ui->GroupComboBox->currentText().toStdString()).GetRegressionModels());
61 ui->SamplestableView->setModel(OMSizemodel);
62 SelectSampleDelegate *omsizecorrectionDelegate = new SelectSampleDelegate(data, this);
63 omsizecorrectionDelegate->SetMode(mode::regressions);
64 ui->SamplestableView->setItemDelegate(omsizecorrectionDelegate);
65 }
66
67
68}
void SetSelectedSource(const string &group)
void SetData(SourceSinkData *_data)
Ui::SelectSamples * ui
SourceSinkData * data
SelectSamples(QWidget *parent=nullptr)