#include "GUI_VC66_AC_AdBule.h"
#include "Data_AdBule.h"
/*ZH:*/

static uint8_t Logic_Processing(void);


/*尿素显示*/
void Gui_Display_AC_AdBule(void)
{
    static uint8_t last_value = 5u;//上次调用本函数时的Logic_Processing()返回值。
    uint8_t current_value;//本次调用本函数时的Logic_Processing()返回值。

    current_value = Logic_Processing();

    switch (current_value)
    {
        case 0u:{
                    ;
                }
                break;

        case 1u:{
                    GUI_General_Display(AdBlue_Sprite, CN_tianlanyezouge_01, GUI_BLENDMODE_SRC_OVER);
                }
                break;

        case 2u:{
                    GUI_General_Display(AdBlue_Sprite, CN_tianlanyezouge_01, GUI_BLENDMODE_SRC_OVER);
                    GUI_General_Display(AdBlue_Sprite, CN_tianlanyezouge_02, GUI_BLENDMODE_SRC_OVER);
                }
                break;

        case 3u:{
                    GUI_General_Display(AdBlue_Sprite, CN_tianlanyezouge_01, GUI_BLENDMODE_SRC_OVER);
                    GUI_General_Display(AdBlue_Sprite, CN_tianlanyezouge_02, GUI_BLENDMODE_SRC_OVER);
                    GUI_General_Display(AdBlue_Sprite, CN_tianlanyezouge_03, GUI_BLENDMODE_SRC_OVER);
                }
                break;

        case 4u:{
                    GUI_General_Display(AdBlue_Sprite, CN_tianlanyezouge_01, GUI_BLENDMODE_SRC_OVER);
                    GUI_General_Display(AdBlue_Sprite, CN_tianlanyezouge_02, GUI_BLENDMODE_SRC_OVER);
                    GUI_General_Display(AdBlue_Sprite, CN_tianlanyezouge_03, GUI_BLENDMODE_SRC_OVER);
                    GUI_General_Display(AdBlue_Sprite, CN_tianlanyezouge_04, GUI_BLENDMODE_SRC_OVER);
                }
                break;

        case 5u:{
                    GUI_General_Display(AdBlue_Sprite, CN_tianlanyezouge_01, GUI_BLENDMODE_SRC_OVER);
                    GUI_General_Display(AdBlue_Sprite, CN_tianlanyezouge_02, GUI_BLENDMODE_SRC_OVER);
                    GUI_General_Display(AdBlue_Sprite, CN_tianlanyezouge_03, GUI_BLENDMODE_SRC_OVER);
                    GUI_General_Display(AdBlue_Sprite, CN_tianlanyezouge_04, GUI_BLENDMODE_SRC_OVER);
                    GUI_General_Display(AdBlue_Sprite, CN_tianlanyezouge_05, GUI_BLENDMODE_SRC_OVER);
                }
                break;

        default:{
                    ;
                }
                break;
    }

    GUI_General_Display(AdBlue_Sprite, CN_tianlanye, GUI_BLENDMODE_SRC_OVER);//常显的表框和图标
    GUI_General_Display(AdBlue_Sprite, CN_tianlanyefuhaodeng, GUI_BLENDMODE_SRC_OVER);

    if (current_value < last_value)//若本次要显示的格数小于上次显示的格数，则清空本次未刷的图。
    {
        GUI_General_Display(AdBlue_Sprite, SpriteSize, GUI_BLENDMODE_SRC_OVER);
    }
    else
    {
        ;
    }

/******************************************************************************************/

    last_value = current_value;//本句 尽可能 放在 本函数体 的结尾位置。
}




uint8_t Logic_Processing(void)
{
    uint8_t in_1 = AdBule_Get_Number();
    en_ADBULE_Sta in_2 = AdBule_Get_Display_Sta();
    uint8_t out;

    switch (in_2)
    {
        case ADBULE_LED_1HZ_FLASH :
            {
                if (FLASH_SYNC_1Hz)
                {
                    out = in_1;
                }
                else
                {
                    out = 0u;
                }
            }
            break;

        case ADBULE_LED_3HZ_FLASH :
            {
                if (FLASH_SYNC_2Hz)
                {
                    out = in_1;
                }
                else
                {
                    out = 0u;
                }
            }
            break;

        case ADBULE_LED_ON :
            {
                out = in_1;
            }
            break;

        case ADBULE_LED_OFF :
            {
                out = 0u;
            }
            break;

        default :
            {
                out = 0u;
            }
            break;
    }

    return out;
}

/*:ZH*/