package com.ai.da.python.vo;

import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

@Data
public class DesignPythonItemPrint {
    /**
     * print 绝对路径
     */
    @ApiModelProperty("图片绝对路径")
    private String path;

    private List<String> print_path_list = new ArrayList<>();

    @ApiModelProperty("上传时候对应的类型,一级类型  Printboard ")
    private String level1Type;

    /**
     * print_scale
     */
    @ApiModelProperty("print_scale")
    private Float scale;

    /**
     * 是否打点
     */
    @ApiModelProperty("是否打点 是传true 否则false")
    private Boolean ifSingle;


    @ApiModelProperty("print的位置 传 [[0.2, 0.2]]")
    private List<List<Float>> location = new ArrayList<>();

    @ApiModelProperty("print的缩放比例 传 [0.2, 0.2]")
    private List<List<Float>> print_scale_list = new ArrayList<>();

    @ApiModelProperty("print的旋转角度 传 [0.2, 0.2]")
    private List<Double> print_angle_list = new ArrayList<>();

    @JSONField(name = "IfSingle")
    public Boolean getIfSingle() {
        return ifSingle;
    }

    public DesignPythonItemPrint(List<String> print_path_list, Boolean ifDesign) {
        if (ifDesign){
            this.print_path_list = print_path_list;
            this.location = Collections.singletonList(Arrays.asList(0.0f, 0.0f));
            this.print_scale_list = Collections.singletonList(Arrays.asList(0.0f, 0.0f));
            this.print_angle_list = Arrays.asList(0.0, 0.0);
        }

    }

    public DesignPythonItemPrint(String singlePath, String level1Type, Float scale, Boolean ifSingle) {
        this.path = singlePath;
        this.level1Type = level1Type;
        this.scale = scale;
        this.ifSingle = ifSingle;
    }

    public DesignPythonItemPrint() {
    }

    public DesignPythonItemPrint(String path) {
        this.path = path;
    }

}
