#include "QtWidgetsClass_ISAR.h"



void QtWidgetsClass_ISAR::FEKOSimulationDataparamsChanged_slots()
{
	if (this->simulationparams->imagemode == FEKOBase::FEKOImageMode::ISAR) {
		this->ui.lineEdit_deltaAngle->setText(QString::number(this->simulationparams->delta_angle));
		this->ui.lineEdit_startAzAngle->setText(QString::number(this->simulationparams->start_circle_angle));
		this->ui.lineEdit_EndAzAngle->setText(QString::number(this->simulationparams->end_circle_angle));
	}
	else if (this->simulationparams->imagemode == FEKOBase::FEKOImageMode::CircleSAR) {
		this->ui.lineEdit_deltaAngle->setText(QString::number(this->simulationparams->delta_angle));
	}
	else {
		return;
	}

}

void QtWidgetsClass_ISAR::bandingsetFEKOSimulationDataparams()
{
	QObject::connect(this->simulationparams.get(), SIGNAL(FEKOSimulationDataparamsChanged()), this, SLOT(FEKOSimulationDataparamsChanged_slots()));

}

QtWidgetsClass_ISAR::QtWidgetsClass_ISAR(QWidget* parent)
	: QWidget(parent)
{
	ui.setupUi(this);
}

QtWidgetsClass_ISAR::~QtWidgetsClass_ISAR()
{}


void QtWidgetsClass_ISAR::on_pushButton_OK_clicked() {

	//根据OKClick参数,结合控件，获取参数

	double startAngle = this->ui.lineEdit_startAzAngle->text().toDouble();
	double endAngle = this->ui.lineEdit_EndAzAngle->text().toDouble();
	double deltaAngle = this->ui.lineEdit_deltaAngle->text().toDouble();
	this->simulationparams->setStart_circle_angle(startAngle);
	this->simulationparams->setEnd_circle_angle(endAngle);
	this->simulationparams->setDelta_angle(deltaAngle);
	this->simulationparams->setImagemode(FEKOBase::FEKOImageMode::ISAR);
	emit this->OKClick();

}