package com.base.core.model.enity;



import java.util.*;

public class AccessData {
    /**
     * 卫星名称
     */
    private String satName;

    /**
     * 高度
     */
    private float altitude;

    /**
     * 轨道圈号
     */
    private int pass;


    private String accessTime;

    /**
     * 访问开始时间
     */
    private Date beginTime;

    /**
     * 访问结束时间
     */
    private Date endTime;


    private float rollAngle;

    private float pitchAngle;

    private float yawAngle;

    private float sunElevation;

    private SphericalPoint targetCenter;


    /**
     * 访问开始时间的视角
     */
    private float beginConeangle;

    /**
     * 访问结束时间的视角
     */
    private float endConeangle;
    
    private float coneangle_nearest;

    private AccessData base_AccessData = null;


    private List<EphData> positionEphdataList = new ArrayList<>();

    private EphData accessPosition_ephdata;

    //成像模式是否为凝视，用于生成访问窗口多边形角点坐标。
    private boolean imageMode_gaze = false;

    //访问窗口中心点坐标
    private SphericalPoint center_position;
    //访问窗口（条带）顶点坐标
    private List<SphericalPoint> vertex_Points;
    //对任务需求区域的覆盖率
    private double coverage_percentage;
    //访问窗口对应的网格编号集合（局部编码）
    private Set<Integer> accessDataGridsCodeSet = new HashSet<>();
    //任务目标的多边形坐标点
    private  List<SphericalPoint> pointsOfTarget;
    //任务目标的点阵
    private  List<SphericalPoint> pointsArrayOfTarget;
    //任务目标的网格编号集合（局部编码）
    private Set<Integer> targetAreaGridsCodeSet = new HashSet<>();

    public Set<Integer> getAccessDataGridsCodeSet() {
        return accessDataGridsCodeSet;
    }

    public void setAccessDataGridsCodeSet(Set<Integer> accessDataGridsCodeSet) {
        this.accessDataGridsCodeSet = accessDataGridsCodeSet;
    }

    public Set<Integer> getTargetAreaGridsCodeSet() {
        return targetAreaGridsCodeSet;
    }

    public void setTargetAreaGridsCodeSet(Set<Integer> targetAreaGridsCodeSet) {
        this.targetAreaGridsCodeSet = targetAreaGridsCodeSet;
    }

    public List<SphericalPoint> getPointsOfTarget() {
        return pointsOfTarget;
    }

    public void setPointsOfTarget(List<SphericalPoint> pointsOfTarget) {
        this.pointsOfTarget = pointsOfTarget;
    }

    public SphericalPoint getCenter_position() {
        return center_position;
    }

    public void setCenter_position(SphericalPoint center_position) {
        this.center_position = center_position;
    }

    public EphData getAccessPosition_ephdata() {
        return accessPosition_ephdata;
    }

    public void setAccessPosition_ephdata(EphData accessPosition_ephdata) {
        this.accessPosition_ephdata = accessPosition_ephdata;
    }


    private List<AccessData> combinedAccessDataList = new ArrayList<>();


    public String getSatName() {
        return satName;
    }

    public void setSatName(String satName) {
        this.satName = satName;
    }

    public float getAltitude() {
        return altitude;
    }

    public void setAltitude(float altitude) {
        this.altitude = altitude;
    }

    public int getPass() {
        return pass;
    }

    public void setPass(int pass) {
        this.pass = pass;
    }

    public Date getBeginTime() {
        return beginTime;
    }

    public void setBeginTime(Date beginTime) {
        this.beginTime = beginTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public float getRollAngle() {
        return rollAngle;
    }

    public void setRollAngle(float rollAngle) {
        this.rollAngle = rollAngle;
    }

    public float getPitchAngle() {
        return pitchAngle;
    }

    public void setPitchAngle(float pitchAngle) {
        this.pitchAngle = pitchAngle;
    }

    public float getSunElevation() {
        return sunElevation;
    }

    public void setSunElevation(float sunElevation) {
        this.sunElevation = sunElevation;
    }

    public float getBeginConeangle() {
        return beginConeangle;
    }

    public void setBeginConeangle(float beginConeangle) {
        this.beginConeangle = beginConeangle;
    }

    public float getEndConeangle() {
        return endConeangle;
    }

    public void setEndConeangle(float endConeangle) {
        this.endConeangle = endConeangle;
    }

    public void combineToAccessDataList(AccessData timeWindow_b) {
        combinedAccessDataList.addAll(timeWindow_b.getCombinedAccessDataList());
        //合并后的轨道数据
        positionEphdataList.addAll(timeWindow_b.positionEphdataList);
        if(vertex_Points==null)
            vertex_Points = new ArrayList<>();
        if(vertex_Points.size()==0) {
            vertex_Points.addAll(timeWindow_b.getVertex_Points());
        }else{
//            SphericalPoint bottom_right =timeWindow_b.getVertex_Points().get(3);
//            SphericalPoint bottom_center =timeWindow_b.getVertex_Points().get(4);
//            SphericalPoint bottom_left =timeWindow_b.getVertex_Points().get(5);
//            vertex_Points.remove(5);
//            vertex_Points.remove(4);
//            vertex_Points.remove(3);
//            vertex_Points.add(bottom_right);
//            vertex_Points.add(bottom_center);
//            vertex_Points.add(bottom_left);
        }
    }
    public List<AccessData> getCombinedAccessDataList(){
        return combinedAccessDataList;
    }

    public List<EphData> getPositionEphdataList() {
        return positionEphdataList;
    }

    public void setPositionEphdataList(List<EphData> positionEphdataList) {
        this.positionEphdataList = positionEphdataList;
        EphData ephData_begin =positionEphdataList.get(0);
        EphData ephData_end = positionEphdataList.get(positionEphdataList.size()-1);
        beginTime = ephData_begin.getEpochTime();
        endTime = ephData_end.getEpochTime();
    }

    public String toString(){
        return "access time:"+accessTime+"\n"
                +"begin time:"+beginTime+"\n"
                +"end time:"+endTime+"\n"
                +"roll angle:"+rollAngle+"\n"
                +"pitch angle:"+pitchAngle+"\n"
                +"yaw angle:"+yawAngle+"\n"
                +"elevation angle:"+sunElevation+"\n"
                +"eph datalist:"+positionEphdataList.size()+"\n";
    }

    public void setVertexPoints(List<SphericalPoint> sphericalPoints) {
        vertex_Points = sphericalPoints;
    }

    public List<SphericalPoint> getVertex_Points() {
        return vertex_Points;
    }


    public String getAccessTime() {
        return accessTime;
    }

    public void setAccessTime(String accessTime) {
        this.accessTime = accessTime;


    }

    public SphericalPoint getTargetCenter() {
        return targetCenter;
    }

    public void setTargetCenter(SphericalPoint targetCenter) {
        this.targetCenter = targetCenter;
    }



    public void setVertex_Points(List<SphericalPoint> vertex_Points) {
        this.vertex_Points = vertex_Points;
    }

    public void setCombinedAccessDataList(List<AccessData> combinedAccessDataList) {
        this.combinedAccessDataList = combinedAccessDataList;
    }


    public void combineGridSet(AccessData timeWindow) {
        if(accessDataGridsCodeSet==null)
            accessDataGridsCodeSet = new HashSet<>();
        if(timeWindow.getAccessDataGridsCodeSet()!=null)
            accessDataGridsCodeSet.addAll(timeWindow.getAccessDataGridsCodeSet());
        targetAreaGridsCodeSet.addAll(timeWindow.targetAreaGridsCodeSet);
    }

    public AccessData getBase_AccessData() {
        return base_AccessData;
    }

    public void setBase_AccessData(AccessData base_AccessData) {
        this.base_AccessData = base_AccessData;
    }

    public double getCoverage_percentage() {
        return coverage_percentage;
    }

    public void setCoverage_percentage(double coverage_percentage) {
        this.coverage_percentage = coverage_percentage;
    }

    public List<SphericalPoint> getPointsArrayOfTarget() {
        return pointsArrayOfTarget;
    }

    public void setPointsArrayOfTarget(List<SphericalPoint> pointsArrayOfTarget) {
        this.pointsArrayOfTarget = pointsArrayOfTarget;
    }

    public boolean isImageMode_gaze() {
        return imageMode_gaze;
    }

    public void setImageMode_gaze(boolean imageMode_gaze) {
        this.imageMode_gaze = imageMode_gaze;
    }

    public float getYawAngle() {
        return yawAngle;
    }

    public void setYawAngle(float yawAngle) {
        this.yawAngle = yawAngle;
    }

	public void setCenterConeangle(float coneangle_nearest) {
		// TODO Auto-generated method stub
		this.coneangle_nearest = coneangle_nearest;
	}
	public float getCenterConeanlge(){
		return this.coneangle_nearest;
	}
}
