package com.uavps.framework.udp;

import com.uavps.common.utils.uuid.IdUtils;
import com.uavps.system.udp.vo.TargetAircraft;
import com.uavps.system.udp.vo.UdpInitParameter;
import com.uavps.system.udp.vo.UnmannedAerialVehicle;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author MBQ
 * @Date: 2025/1/15
 * @Description:
 * @Version: 1.0
 **/
public class UdpUtils {
    public UdpInitParameter initParameter() {
        UdpInitParameter parameter = new UdpInitParameter();
        parameter.setBizId(IdUtils.simpleUUID());
        parameter.setRefreshRate("20");

        UnmannedAerialVehicle unmannedAerialVehicle = new UnmannedAerialVehicle();
        unmannedAerialVehicle.setInitialPositionX(135);
        unmannedAerialVehicle.setInitialPositionY(175);
        unmannedAerialVehicle.setInitialPositionZ(100);
        unmannedAerialVehicle.setInitialSpeed(20.33f);
        unmannedAerialVehicle.setInitialPoseX(2.33f);
        unmannedAerialVehicle.setInitialPoseY(2.33f);
        unmannedAerialVehicle.setInitialPoseZ(2.33f);
        parameter.setUnmannedAerialVehicle(unmannedAerialVehicle);

        TargetAircraft targetAircraft = new TargetAircraft();
        targetAircraft.setAircraftType("固定翼无人机");
        targetAircraft.setFormationAircraftCount(50);
        targetAircraft.setLeadAircraftSpeed(11.20f);
        targetAircraft.setInitialPositionX(100.00f);
        targetAircraft.setInitialPositionY(100.00f);
        targetAircraft.setInitialPositionZ(100.00f);
        targetAircraft.setFlightPathType("直线");
        targetAircraft.setPositionNoise(18.20f);
        targetAircraft.setFormationShape("V");
        targetAircraft.setFollowAircraftDistance(20.00f);

        List<TargetAircraft> multiTargetFormation = new ArrayList<>();
        multiTargetFormation.add(targetAircraft);

        parameter.setMultiTargetFormation(multiTargetFormation);
        return parameter;
    }

    public static void main(String[] args) {
        System.out.printf(IdUtils.simpleUUID());
    }
}
