package com.muyu.vehicleGateway.vehicle;

import com.muyu.vehicleGateway.vehicle.model.VehicleData;
import com.muyu.vehicleGateway.vehicle.thread.VehicleThread;
import com.muyu.vehicleGateway.web.domain.VehicleInfo;
import com.muyu.vehicleGateway.web.domain.model.PositionModel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.log4j.Log4j2;

import java.util.concurrent.LinkedBlockingQueue;

/**
 * 车辆实例
 * @className VehicleInstance
 * @author LiHD
 * @date 2024/9/27 20:37
 */
@Data
@Log4j2
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class VehicleInstance {

    /**
     * 路线轨迹编码
     */
    private String postitionCode;

    /**
     * 路径队列
     */
    @Builder.Default
    private LinkedBlockingQueue<PositionModel> positionQueue = new LinkedBlockingQueue<>();

    /**
     * 车辆
     */
    private VehicleInfo vehicleInfo;

    /**
     * 实例数据
     */
    private VehicleData vehicleData;

    /**
     * 上一次定位点
     */
    private PositionModel lastPosition;

    /**
     * 车辆工作线程
     */
    private VehicleThread vehicleThread;

    /**
     * 获取当前车辆VIN
     * @return VIN
     */
    public String getVin() {
        return this.vehicleInfo.getVin();
    }


}
