package com.uavps.system.udp.vo;

import java.util.List;

/**
 * @Author MBQ
 * @Date: 2025/1/15
 * @Description:
 * @Version: 1.0
 **/
public class UdpData {
    public static final String PLANT_UAV = "1"; //平台无人机
    public static final String REAL_TARGET = "2"; // 真实目标
    public static final String NOISE_TARGET = "3"; // 噪声目标

    //业务id，代表一次仿真任务的唯一标识
    private String bizId;

    //是否结束 true代表本次bizId的任务已结束，以后接收该id的数据都会废弃
    private String finished;
    // 数据类型1=平台无人机，2=真实目标，3=噪声目标
    private String type;

    //时间单位ms，代表本次数据的时间
    private float time;

    private List<AircraftFormation> targetAircraft;

    private PlatformAircraft platformAircraft;

    public String getBizId() {
        return bizId;
    }

    public void setBizId(String bizId) {
        this.bizId = bizId;
    }

    public String getFinished() {
        return finished;
    }

    public void setFinished(String finished) {
        this.finished = finished;
    }

    public float getTime() {
        return time;
    }

    public void setTime(float time) {
        this.time = time;
    }

    public List<AircraftFormation> getTargetAircraft() {
        return targetAircraft;
    }

    public void setTargetAircraft(List<AircraftFormation> targetAircraft) {
        this.targetAircraft = targetAircraft;
    }

    public PlatformAircraft getPlatformAircraft() {
        return platformAircraft;
    }

    public void setPlatformAircraft(PlatformAircraft platformAircraft) {
        this.platformAircraft = platformAircraft;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getTargetAircraftsString() {
        String returnString = "";
        if (targetAircraft!= null) {
            long aircraftFormationId = 0;
            for (AircraftFormation aircraftFormation : targetAircraft) {
                if(aircraftFormation != null && aircraftFormation.getAircrafts() !=null){
                    for (Aircraft aircraft : aircraftFormation.getAircrafts()) {
                        returnString += "{编队"+aircraftFormationId+",机号:"+aircraft.getAircraftNumber()+",x:"+aircraft.getCoordinateX()+",y:"+aircraft.getCoordinateY()+"}";
                    }
                }
                aircraftFormationId++;
            }
        }

        return returnString;
    }
}
