#ifndef ORD_CTRL_H_
#define ORD_CTRL_H_

#ifdef __cplusplus
extern "C" {
#endif 

#include "kit_macro.h"
#include "run_status.h"

typedef enum
{
    kDoLogicStatus_Reset,
    kDoLogicStatus_Init,
    kDoLogicStatus_Off,
    kDoLogicStatus_WaitOff,
    kDoLogicStatus_WaitAdhesion,
    kDoLogicStatus_On,
	kDoLogicStatus_ChgOn,
	kDoLogicStatus_DisOn,
	kDoLogicStatus_Prechg,
    kDoLogicStatus_PrechgFail,
}DoLogicStatus;

typedef enum
{
	kDoCtrlStrategy_Statrt = 0,
	kDoCtrlStrategy_Ups = kDoCtrlStrategy_Statrt,
	kDoCtrlStrategy_CmdCtrl,
    kDoCtrlStrategy_DiffCircuit,
	kDoCtrlStrategy_SameCircuit,    			
	kDoCtrlStrategy_End
}DoCtrlStrategy;

typedef enum
{
    kTripIdx_1,
    kTripIdx_2,
    kTripIdx_3,
    kTripIdx_4,
    kTripIdx_5,
    kTripIdx_End,
}TripIdx;

typedef enum
{
    kChainIdx_1,
    kChainIdx_2,
    kChainIdx_3,
    kChainIdx_4,
    kChainIdx_5,
    kChainIdx_End,
}ChainIdx;

typedef enum
{
    kFanIdx_1,
    kFanIdx_2,
    kFanIdx_End,
}FanIdx;

void bms_set_trip_status(TripIdx idx, bool is_trigger);
void bms_set_chain_status(ChainIdx idx, bool is_trigger);
void bms_set_sys_fan_status(FanIdx idx, bool is_trigger);

void task_dido_ctrl_handle(uint32_t base_time);

RunStatus bms_get_run_ctrl_status(void);
void bms_set_run_ctrl_status(RunStatus status);

void logic_do_cool1_ctrl(uint32_t base_time, uint8_t idx);
void logic_do_heat1_ctrl(uint32_t base_time, uint8_t idx);
void logic_do_run1_led_ctrl(uint32_t base_time, uint8_t idx);
void logic_do_alarm1_led_ctrl(uint32_t base_time, uint8_t idx);
void logic_do_trip1_ctrl(uint32_t base_time, uint8_t idx);


void logic_same_circuit_poll(uint32_t base_time, uint8_t idx);
void logic_cmd_ctrl_poll(uint32_t base_time, uint8_t idx);



#ifdef __cplusplus
}
#endif

#endif

