package com.mogo.v2x.data

import androidx.annotation.Keep
import java.io.Serializable

/**
 * 路口碰撞预警、盲区预警等数据实体
 */
@Keep
class V2XAdvanceWarning: Serializable {

    companion object {
        private const  val serialVersionUID = -446395L
    }

    /**
     * 物体唯一标识
     */
    var objectId: String? = null

    /**
     * 物体类型:
     * 1-人
     * 2-自行车
     * 3-小轿车
     * 4-摩托车
     * 5-红绿灯
     * 6-公交车
     * 8-卡车
     * 9-路边摄像头
     */
    var objectType: Int? = -1

    /**
     * 1-add
     * 2-update
     * 3-delete
     */
    var status: Int? = -1

    /**
     * 大类标识
     * 1-预警
     * 2-规划
     * 3-拥堵
     * 4-事故
     */
    var typeId: Int? = -1

    /**
     * 预警下发时间
     */
    var time: Long? = 0

    /**
     * 预警等级
     */
    var level: Int? = -1

    /**
     * 危险等级：
     * 0-保留
     * 1-模型原始颜色
     * 2-通知--黄
     * 3-警告--红
     */
    var threatLevel: Int? = -1

    /**
     * 目标预警物所在位置
     */
    var position: V2XLocation? = null

    /**
     * 目标预警物朝向
     */
    var heading: Double? = 0.0

    /**
     * 目标预警物速度
     */
    var speed: Double? = 0.0

    /**
     * 目标预警物到自车距离
     */
    var distance: Double? = 0.0

    /**
     * 道路ID
     */
    var roadId: String? = null

    /**
     * 车道ID
     */
    var laneId: String? = null

    /**
     * 车道号：
     * 中心线编号为0, 中心线右侧编号为负数。
     * eg: 3车道通行Road的车道编号，0,-1,-2,-3
     */
    var laneNum: Int? = Integer.MIN_VALUE

    /**
     * 线性经纬度轨迹列表(高德)
     */
    var gdLocusList: List<V2XLocation>? = null

    /**
     * 轨迹列表(Wgs84坐标系)
     */
    var locusList: List<V2XLocation>? = null

    override fun toString(): String {
        return "V2XAdvanceWarning(objectId=$objectId, objectType=$objectType, status=$status, typeId=$typeId, time=$time, level=$level, threatLevel=$threatLevel, position=$position, heading=$heading, speed=$speed, distance=$distance, roadId=$roadId, laneId=$laneId, laneNum=$laneNum, gdLocusList=$gdLocusList, locusList=$locusList)"
    }
}

