#include "lvgl.h"
#include "img_def.h"
#include "demo.h"
#include "mxc_meter.h"
#include "moto_list.h"
//#include "language_table.h"
#include "lan_str_table.h"
#include "equipment.h"

__attribute__((section("resource_section"))) lv_equipment_list_t equipment_list_group[EQUIPMENT_ID_MAX]=
{
    {EQUIPMENT_ID_THEME,        STR_ID_THEME,                                true,   true},
    {EQUIPMENT_ID_LIGHT,        STR_ID_LIGHT,                                false,  true},
    {EQUIPMENT_ID_BLUETOOTH,    STR_ID_BLUETOOTH,                            false,  true},
    {EQUIPMENT_ID_OTHER,        STR_ID_OTHER_SETTING,                        false,  true},
    {EQUIPMENT_ID_INFORMATION,  STR_ID_INFORMATION,                          false,  true},
    {EQUIPMENT_ID_PRESSURE,     STR_ID_PRESSURE,                             false,  true},
    {EQUIPMENT_ID_FAULT_CODE,   STR_ID_FAULT_CODE,                           false,  true},
    {EQUIPMENT_ID_RETURN,       STR_ID_RETURN,                               false,  true},
};


bool get_equipment_is_display(ENUM_EQUIPMENT_ID equip_id)
{
    return equipment_list_group[equip_id].is_display;
}

void get_display_equipment_str(uint32_t res_arr[MAINMENU_TILE_END][COMMON_PER_PAGE_NUM])
{
    uint8_t equip_id = EQUIPMENT_ID_THEME;

    for(uint8_t i=MAINMENU_TILE_ZERO; i<MAINMENU_TILE_END; i++)
    {
        for(uint8_t j=0; j<3;)
        {
            if((equip_id < EQUIPMENT_ID_MAX) && (get_equipment_is_display(equip_id))){
                res_arr[i][j] = equipment_list_group[equip_id].str;
                j++;
            }

            equip_id++;
            if(equip_id == EQUIPMENT_ID_MAX)
                return;
        }
    }

}

extern void set_is_display(ENUM_EQUIPMENT_ID equip_id,bool value)
{
    equipment_list_group[equip_id].is_display=value;
}

LAN_STR_ID get_equipment_is_str(ENUM_EQUIPMENT_ID equip_id)
{
    return equipment_list_group[equip_id].str;
}




