64 lines
1.7 KiB
C++
64 lines
1.7 KiB
C++
#include "breedingwindow.h"
|
|
#include "ui_breedingwindow.h"
|
|
#include "DEC-0.0/processor/Settings.h"
|
|
#include "DEC-0.0/processor/Processor.h"
|
|
#include <QString>
|
|
|
|
BreedingWindow::BreedingWindow(QWidget *parent) :
|
|
QWidget(parent),
|
|
ui(new Ui::BreedingWindow)
|
|
{
|
|
ui->setupUi(this);
|
|
//setPopComboBoxes();
|
|
plotFlag = 1;
|
|
connect(this, SIGNAL(drawGraph(QCustomPlot *, int)), &breedQPlot, SLOT(drawGraphics(QCustomPlot*, int)));
|
|
}
|
|
|
|
BreedingWindow::~BreedingWindow()
|
|
{
|
|
delete ui;
|
|
}
|
|
|
|
void BreedingWindow::startDraw(int ind)
|
|
{
|
|
if (plotFlag == 1)
|
|
{
|
|
emit drawGraph(ui->Plot_widget, ind);
|
|
}
|
|
if (plotFlag == 2)
|
|
{
|
|
emit drawGraph(ui->Plot_widget_2, ind);
|
|
}
|
|
}
|
|
|
|
void BreedingWindow::setPopComboBoxes()
|
|
{
|
|
for (int i = 0; i < Settings::geneName.size(); i++)
|
|
{
|
|
ui->pop_comboBox->addItem(QString::fromStdString(Settings::geneName[i]), QVariant(i));
|
|
ui->pop_comboBox_2->addItem(QString::fromStdString(Settings::geneName[i]), QVariant(i));
|
|
}
|
|
ui->time_spinBox->setRange(0, 100000);
|
|
ui->time_spinBox->setSingleStep(10);
|
|
ui->time_spinBox->setValue(10);
|
|
}
|
|
|
|
void BreedingWindow::on_pop_comboBox_currentIndexChanged(int index)
|
|
{
|
|
plotFlag = 1;
|
|
int ind = ui->pop_comboBox->itemData(ui->pop_comboBox->currentIndex()).toInt();
|
|
startDraw(ind);
|
|
}
|
|
|
|
void BreedingWindow::on_pop_comboBox_2_currentIndexChanged(int index)
|
|
{
|
|
plotFlag = 2;
|
|
int ind = ui->pop_comboBox_2->itemData(ui->pop_comboBox_2->currentIndex()).toInt();
|
|
startDraw(ind);
|
|
}
|
|
|
|
void BreedingWindow::on_evol_pushButton_clicked()
|
|
{
|
|
//Processor::evolution(ui->time_spinBox->value());
|
|
}
|