#pragma once
/*****************************************************************//**
 * \file   SARSimulationTaskSetting.h
 * \brief  SAR卫星回波仿真参数设置界面文件
 * 
 * \author 30453
 * \date   October 2024
 *********************************************************************/


#include "BaseConstVariable.h"

#include "BaseTool.h"
#include "SARSatelliteSimulationAbstractCls.h"
#include "SatelliteOribtModel.h"
#include "LogInfoCls.h"
#include <QString>
#include <vector>
#include <memory>



class SARSimulationTaskSetting:public AbstractSARSatelliteModel
{
public: // 轨道模型
	virtual SatelliteOribtNode getSatelliteOribtNode(double& timeFromStartTime, bool& antAzAngleFlag) override;// 设置轨道节点，
	virtual ErrorCode getSatelliteOribtNode(double& timeFromStartTime, SatelliteOribtNode& node, bool& antAzAngleFlag) override; // 获取轨道节点
	virtual void			   setSatelliteOribtModel( std::shared_ptr < AbstractSatelliteOribtModel> model) override; // 设置轨道模型
	virtual ErrorCode getSatelliteAntDirectNormal(SatelliteOribtNode& Rs, Vector3D& Rt, SatelliteAntDirect& antNode); // 计算目标在天线方向图中的位置
private:
	std::shared_ptr <AbstractSatelliteOribtModel>  OribtModel; // 轨道模型

public:// 影像成像时间
	virtual void setSARImageStartTime(long double imageStartTime) override;// 成像开始时间
	virtual void setSARImageEndTime(long double imageEndTime) override;	  // 成像结束时间

	virtual double getSARImageStartTime() override;
	virtual double getSARImageEndTime() override;

	virtual double getNearRange() override; // 近斜距 -- 快时间门
	virtual void   setNearRange(double NearRange) override;

	virtual double getFarRange() override; // 最远斜距 
	virtual void   setFarRange(double FarRange) override;

	virtual bool   getIsRightLook() override; // 是否右视
	virtual void   setIsRightLook(bool isR) override;
private:
	double imageStartTime;
	double imageEndTime;
	double NearRange;
	double FarRange;
	bool isR;


public: // 成像参数
	virtual void	setCenterFreq(double Freq) override; // 中心频率
	virtual double	getCenterFreq() override;

	virtual void	setCenterLamda(double Lamda) override; // 波长
	virtual double  getCenterLamda() override;

	virtual void	setBandWidth(double bandwidth) override; // 带宽范围
	virtual double	getBandWidth() override;

	virtual POLARTYPEENUM getPolarType();// 极化类型
	virtual void	setPolarType(POLARTYPEENUM type);

	virtual double getCenterLookAngle() override;
	virtual void setCenterLookAngle(double angle) override;
private:
	double centerLookAngle;
	double centerFreq;
	double centerLamda;
	double bandWidth;
	POLARTYPEENUM polarType;

public: // 设置PRF、FS
	virtual void setPRF(double prf) override; // 方位向采样频率
	virtual double getPRF() override;
	virtual void setRefphaseRange(double refRange);
	virtual double getRefphaseRange();
	virtual double getFs() override;
	virtual void setFs(double fs) override;

private:
	double PRF;
	double Fs;
	double refPhaseRange;
	double pt;
	double Gri;

public:// 天线方向图
	virtual void setTransformRadiationPattern(std::shared_ptr<AbstractRadiationPattern> radiationPanttern); //  极化发射方向图
	virtual void setReceiveRadiationPattern(std::shared_ptr<AbstractRadiationPattern> radiationPanttern); // V 极化接收方向图

	virtual std::shared_ptr<AbstractRadiationPattern> getTransformRadiationPattern();// H 极化发射方向图 
	virtual std::shared_ptr<AbstractRadiationPattern> getReceiveRadiationPattern();// V 极化发射方向图 

private: // 变量
	std::shared_ptr<AbstractRadiationPattern>  TransformRadiationPattern; // 极化发射方向图
	std::shared_ptr<AbstractRadiationPattern>  ReceiveRadiationPattern; // 极化接收方向图
	
public:
	virtual double getPt() override;
	virtual double getGri() override;
	virtual void setPt(double Pt) override;
	virtual void setGri(double gri) override;



private:
	double DopplerParametersReferenceTime;
	std::vector<double> DopplerCentroidCoefficients;
	std::vector<double> DopplerRateValuesCoefficients;

public:
	virtual double getDopplerParametersReferenceTime() override;
	virtual void   setDopplerParametersReferenceTime(double time) override;
	virtual std::vector<double> getDopplerCentroidCoefficients() override;
	virtual void				setDopplerCentroidCoefficients(std::vector<double> DopplerCentroids) override;
	virtual std::vector<double> getDopplerRateValuesCoefficients() override;
	virtual void				setDopplerRateValuesCoefficients(std::vector<double>  DopplerRateValues) override;
	

};															 

std::shared_ptr<AbstractSARSatelliteModel> ReadSimulationSettingsXML(QString xmlPath);

