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#include "selectsamples.h"
2#include "ui_selectsamples.h"
5
7 QWidget(parent),
8 ui(new Ui::SelectSamples)
9{
10 ui->setupUi(this);
11 connect(ui->GroupComboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(comboChanged()));
12}
13
15{
16 delete ui;
17}
18
20{
21 data = _data;
22 ui->GroupComboBox->clear();
23 for (map<string,Elemental_Profile_Set>::iterator it=data->begin(); it!=data->end(); it++)
24 {
25 if (Mode!=mode::regressions || it->first!=data->GetTargetGroup())
26 ui->GroupComboBox->addItem(QString::fromStdString(it->first));
27 }
30 samplemodel->SetSelectedSource(ui->GroupComboBox->currentText().toStdString());
31 ui->SamplestableView->setModel(samplemodel);
32 SelectSampleDelegate *samplesDelegate = new SelectSampleDelegate(data, this);
33 samplesDelegate->SetMode(mode::samples);
34 ui->SamplestableView->setItemDelegate(samplesDelegate);
35 }
36 else if (Mode==mode::regressions)
37 {
38 OmSizeCorrectionTableModel *OMSizemodel = new OmSizeCorrectionTableModel(data->operator[](ui->GroupComboBox->currentText().toStdString()).GetRegressionModels());
39 ui->SamplestableView->setModel(OMSizemodel);
40 SelectSampleDelegate *omsizecorrectionDelegate = new SelectSampleDelegate(data, this);
41 omsizecorrectionDelegate->SetMode(mode::regressions);
42 ui->SamplestableView->setItemDelegate(omsizecorrectionDelegate);
43 }
44
45
46}
47
49{
52 samplemodel->SetSelectedSource(ui->GroupComboBox->currentText().toStdString());
53 ui->SamplestableView->setModel(samplemodel);
54 }
55 else if (Mode==mode::regressions)
56 {
57 OmSizeCorrectionTableModel *OMSizemodel = new OmSizeCorrectionTableModel(data->operator[](ui->GroupComboBox->currentText().toStdString()).GetRegressionModels());
58 ui->SamplestableView->setModel(OMSizemodel);
59 SelectSampleDelegate *omsizecorrectionDelegate = new SelectSampleDelegate(data, this);
60 omsizecorrectionDelegate->SetMode(mode::regressions);
61 ui->SamplestableView->setItemDelegate(omsizecorrectionDelegate);
62 }
63
64
65}
void SetSelectedSource(const string &group)
void SetData(SourceSinkData *_data)
Ui::SelectSamples * ui
SourceSinkData * data
SelectSamples(QWidget *parent=nullptr)
string GetTargetGroup() const
Retrieves the name of the target group.
@ regressions
@ samples