#pragma once

#ifndef LAMP_SCATTERSETTINGCLASS_H
#define LAMP_SCATTERSETTINGCLASS_H

#include "AllHead.h"
#include <QDialog>
#include "ui_LAMP_ScatterSettingClass.h"

class LAMP_ScatterSettingXmlClass {
public:
	QString taskName;
	double startfre;
	double endfre;
	double freponts;
	bool farfield;
	bool nearfield;
	bool A1;
	double incidence_A1;
	bool A2;
	double incidence_A2;
	bool enableScatter;
	bool S1;
	bool S3;
	bool S5;
	bool S8;
	bool S10;
	bool S12;
	bool F1;
	bool F2;
	bool F3;
	bool F4;
	bool F5;
	bool F6;
	bool F7;
	bool F8;
	bool F9;
	bool F10;
	bool F11;
	bool F12;
public:
	LAMP_ScatterSettingXmlClass();
	~LAMP_ScatterSettingXmlClass();
	void loadxml(QString xmlpath);
	void savexml(QString xmlpath);

};


class LAMP_ScatterSettingClass : public QDialog
{
	Q_OBJECT

public:
	LAMP_ScatterSettingClass(QWidget *parent = nullptr);
	~LAMP_ScatterSettingClass();

public:
	Handle(AIS_InteractiveContext) myContext; // 窗口交互 // 模型管理
	QString xmlpath;
	QString workpsace;
	LAMP_ScatterSettingXmlClass* settingobj;
	//QMap<QString, Handle(AIS_InteractiveObject)> DataAISMap;
 	std::map<std::string, Handle(AIS_InteractiveObject)> DataAISMap; // 构建雷达照射模型
	std::map<std::string, SphericalCoordinates> AntSettingdict; // 构建雷达照射模型
	std::map<std::string, QString> AntffePathDict;
public:
	void loadxml(QString xmlpath);
	void savexml();
	void renderSettingObj();
	void sycnSettingObj();
	void createAntModel();
	void initAntModelSettingParams(); // 模型设置参数
	void closeWindows();
	void setDocument3d(Handle(AIS_InteractiveContext) myContext);
	void createFEKOLua();
	void setTaskName(QString name);
	void setWorkSpacePath(QString path);
public slots:
	void on_radioButton_S1_toggled(bool flag);
	void on_radioButton_S3_toggled(bool flag);
	void on_radioButton_S5_toggled(bool flag);
	void on_radioButton_S8_toggled(bool flag);
	void on_radioButton_S10_toggled(bool flag);
	void on_radioButton_S12_toggled(bool flag);
	void on_radioButton_F1_toggled(bool flag);
	void on_radioButton_F2_toggled(bool flag);
	void on_radioButton_F3_toggled(bool flag);
	void on_radioButton_F4_toggled(bool flag);
	void on_radioButton_F5_toggled(bool flag);
	void on_radioButton_F6_toggled(bool flag);
	void on_radioButton_F7_toggled(bool flag);
	void on_radioButton_F8_toggled(bool flag);
	void on_radioButton_F9_toggled(bool flag);
	void on_radioButton_F10_toggled(bool flag);
	void on_radioButton_F11_toggled(bool flag);
	void on_radioButton_F12_toggled(bool flag);

	void on_checkBox_A1_toggled(bool flag);
	void on_checkBox_A2_toggled(bool flag);
	void on_checkBox_AllScatter_toggled(bool flag);

	void on_lineEdit_A1_incAngle_editingFinished();
	void on_lineEdit_A2_incAngle_editingFinished();

	void on_pushButton_load_clicked();
	void on_pushButton_apply_clicked();
	void on_okButton_clicked();
	void on_cancelButton_clicked();

	void switchAntShowAndHide(std::string antName,bool isShow);


private:
	SphericalCoordinates antsettingstring2Spherical(QString sphericalStr);

private:
	Ui::LAMP_ScatterSettingClassClass ui;
};




#endif
