#!/usr/bin/env python
# -*- coding: utf-8 -*-
##################################################################
#
# Copyright (c) 2023 CICV, Inc. All Rights Reserved
#
##################################################################
"""
@Authors:           yangzihao(yangzihao@china-icv.cn)
@Data:              2023/11/23
@Last Modified:     2023/11/23
@Summary:           Status machine type enumerations.
"""

from enum import Enum, auto


# Abpb_status	ACC_status	Aeb_status	Awb_status	DOW_status
# Eba_status	ELK_status	ESA_status	Fcw_status	ICA_status
# ISLC_status	JA_status	LDW_status	LKA_status	NOA_status
# RCW_status	TLC_status

class ACCStatusType(Enum):
    """
    ACC状态机
    关闭              0
    激活              1
    接管              2
    中断              3
    待机              4
    抑制              5
    静止激活           6
    静止等待           7
    """
    Off = 0
    Active = auto()
    Override = auto()
    Shut_off = auto()
    Standby = auto()
    Passive = auto()
    Stand_active = auto()
    Stand_wait = auto()


class LDWStatusType(Enum):
    """
    LDW状态机
    关闭              0
    抑制              1
    待机              2
    激活              3
    故障              4
    """
    Off = 0
    Passive = auto()
    Standby = auto()
    Active = auto()
    Error = auto()


class LKAStatusType(Enum):
    """
    LKA状态机
    关闭              0
    抑制              1
    待机              2
    激活              3
    故障              4
    """
    Off = 0
    Passive = auto()
    Standby = auto()
    Active = auto()
    Error = auto()


class FCWStatusType(Enum):
    """
    FCW状态机
    关闭              0
    抑制              1
    待机              2
    激活              3
    故障              4
    """
    Off = 0
    Passive = auto()
    Standby = auto()
    Active = auto()
    Error = auto()


class AEBStatusType(Enum):
    """
    AEB状态机
    关闭              0
    抑制              1
    待机              2
    激活              3
    故障              4
    """
    Off = 0
    Passive = auto()
    Standby = auto()
    Active = auto()
    Error = auto()


class ICAStatusType(Enum):
    """
    ICA状态机
    关闭              0
    抑制              1
    待机              2
    仅纵向控制         3
    车道保持辅助循线    4
    车道保持辅助跟车    5
    故障              6
    """
    Off = 0
    Passive = auto()
    Standby = auto()
    Only_Longitudinal_Control = auto()
    LLC_Follow_Line = auto()
    LLC_Follow_Vehicle = auto()
    Error = auto()


class AWBStatusType(Enum):
    """
    AWB状态机
    关闭              0
    抑制              1
    待机              2
    激活              3
    故障              4
    """
    Off = 0
    Passive = auto()
    Standby = auto()
    Active = auto()
    Error = auto()


class ABPBStatusType(Enum):
    """
    ABPB状态机
    关闭              0
    抑制              1
    待机              2
    激活              3
    故障              4
    """
    Off = 0
    Passive = auto()
    Standby = auto()
    Active = auto()
    Error = auto()


class EBAStatusType(Enum):
    """
    EBA状态机
    关闭              0
    抑制              1
    待机              2
    激活              3
    故障              4
    """
    Off = 0
    Passive = auto()
    Standby = auto()
    Active = auto()
    Error = auto()


class ESAStatusType(Enum):
    """
    ESA状态机
    关闭              0
    抑制              1
    待机              2
    AES激活           3
    ESS激活           4
    故障              5
    """
    Off = 0
    Passive = auto()
    Standby = auto()
    AES_Active = auto()
    ESS_Active = auto()
    Error = auto()


class ELKStatusType(Enum):
    """
    ELK状态机
    关闭              0
    抑制              1
    待机              2
    等待              3
    警告              4
    控制              5
    故障              6
    """
    Off = 0
    Passive = auto()
    Standby = auto()
    Wait = auto()
    ELK_Warning = auto()
    ELK_Control = auto()
    Error = auto()


class JAStatusType(Enum):
    """
    JA状态机
    关闭              0
    抑制              1
    待机              2
    激活              3
    故障              4
    """
    Off = 0
    Passive = auto()
    Standby = auto()
    Active = auto()
    Error = auto()


class ISLCStatusType(Enum):
    """
    ISLC状态机
    关闭              0
    视觉抑制           1
    融合抑制           2
    导航抑制           3
    待机              4
    激活              5
    故障              6
    """
    Off = 0
    Passive_Vision_Mode = auto()
    Passive_Fusion_Mode = auto()
    Passive_Navigation_Mode = auto()
    Standby = auto()
    Active = auto()
    Error = auto()


class DOWStatusType(Enum):
    """
    DOW状态机
    关闭              0
    抑制              1
    待机              2
    激活              3
    激活              4
    故障              5
    """
    Off = 0
    Passive = auto()
    Standby = auto()
    Active_Level1 = auto()
    Active_Level2 = auto()
    Error = auto()


class RCWStatusType(Enum):
    """
    RCW状态机
    关闭              0
    抑制              1
    待机              2
    激活              3
    故障              4
    """
    Off = 0
    Passive = auto()
    Standby = auto()
    Active = auto()
    Error = auto()


class TLCStatusType(Enum):
    """
    TLC状态机
    关闭              0
    抑制              1
    待机              2
    等待              3
    需求延迟           4
    变道中             5
    变道返回           6
    变道失败           7
    故障              8
    """
    Off = 0
    Passive = auto()
    Standby = auto()
    Wait = auto()
    Reqdelay = auto()
    LC_Ing = auto()
    LC_Return = auto()
    LC_Fail = auto()
    Error = auto()


class NOAStatusType(Enum):
    """
    NOA状态机
    关闭              0
    抑制              1
    待机              2
    一般激活           3
    需要反馈激活        4
    安全停车           5
    故障              6
    """
    NOA_Off = 0
    NOA_Passive = auto()
    NOA_Standby = auto()
    NOA_Active_Normal = auto()
    NOA_Active_RequestingFallback = auto()
    NOA_SafeStop = auto()
    NOA_Error = auto()
