package com.muyu.vehicleGateway.vehicle.thread;

import com.muyu.vehicleGateway.vehicle.VehicleInstance;
import lombok.Data;
import lombok.extern.log4j.Log4j2;

/**
 * @ClassName VehicleThread
 * @Description TODO
 * @Author LiHD
 * @Date 2024/9/27 22:44
 */
@Data
@Log4j2
public class VehicleThread implements Runnable {

    /**
     * 是否停止线程
     */
    private volatile boolean isStop = false;

    /**
     * 车辆实例对象
     */
    private VehicleInstance vehicleInstance;

    @Override
    public void run() {
        try {
            if (!isStop){
                log.info("{} - 上报数据",this.vehicleInstance.getVin());

            }
        }catch (Throwable throwable){

        }
    }

    /**
     *
     */
    private void stop() {
        this.isStop = true;
    }
}
