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

from status import ACCStatusType, LKAStatusType, LDWStatusType, ICAStatusType, AEBStatusType


def acc_status_mapping(value):
    if value == ACCStatusType.Off.value:
        return "Off"
    elif value == ACCStatusType.Passive.value:
        return "Passive"
    elif value == ACCStatusType.Standby.value:
        return "Standby"
    elif value == ACCStatusType.Active_Control.value:
        return "Active"
    elif value == ACCStatusType.Override.value:
        return "Override"
    elif value == ACCStatusType.Brake_Only.value:
        return "Brake_Only"
    elif value == ACCStatusType.StandStill.value:
        return "StandStill"
    elif value == ACCStatusType.Failure.value:
        return "Failure"


def lka_status_mapping(value):
    if value == LKAStatusType.Standby.value:
        return "Standby"
    elif value == LKAStatusType.Left_Active.value:
        return "Active"
    elif value == LKAStatusType.Right_Active.value:
        return "Active"


def ldw_status_mapping(value):
    if value == LDWStatusType.Off.value:
        return "Off"
    elif value == LDWStatusType.Passive.value:
        return "Passive"
    elif value == LDWStatusType.Standby.value:
        return "Standby"
    elif value == LDWStatusType.Active.value:
        return "Active"
    elif value == LDWStatusType.Error.value:
        return "Error"


def ica_status_mapping(value):
    if value == ICAStatusType.Off.value:
        return "Off"
    elif value == ICAStatusType.Passive.value:
        return "Passive"
    elif value == ICAStatusType.Standby.value:
        return "Standby"
    elif value == ICAStatusType.LLC_Follow_Line.value:
        return "LLC_Follow_Line"  # 3 无车，定速，居中
    elif value == ICAStatusType.LLC_Follow_Vehicle.value:
        return "LLC_Follow_Vehicle"  # 4 跟车，居中
    elif value == ICAStatusType.Only_Longitudinal_Control.value:
        return "Only_Longitudinal_Control"  # 5 仅纵向
    elif value == ICAStatusType.Error.value:
        return "Error"


def aeb_status_mapping(value):
    if value == AEBStatusType.Off.value:
        return "Off"
    elif value == AEBStatusType.Passive.value:
        return "Passive"
    elif value == AEBStatusType.Standby.value:
        return "Standby"
    elif value == AEBStatusType.Active.value:
        return "Active"
    elif value == AEBStatusType.Error.value:
        return "Error"
