mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-24 11:46:34 +00:00
Disable unused widgets
This commit is contained in:
parent
f0e57e92b4
commit
9b8adb0223
@ -684,7 +684,7 @@ typedef struct {
|
||||
#define LV_USE_BTNMATRIX 1
|
||||
|
||||
/*Calendar (dependencies: -)*/
|
||||
#define LV_USE_CALENDAR 1
|
||||
#define LV_USE_CALENDAR 0
|
||||
|
||||
/*Canvas (dependencies: lv_img)*/
|
||||
#define LV_USE_CANVAS 1
|
||||
@ -693,7 +693,7 @@ typedef struct {
|
||||
#define LV_USE_CHECKBOX 1
|
||||
|
||||
/*Chart (dependencies: -)*/
|
||||
#define LV_USE_CHART 1
|
||||
#define LV_USE_CHART 0
|
||||
#if LV_USE_CHART
|
||||
# define LV_CHART_AXIS_TICK_LABEL_MAX_LEN 20
|
||||
#endif
|
||||
@ -774,7 +774,7 @@ typedef struct {
|
||||
#define LV_USE_LMETER 1
|
||||
|
||||
/*Mask (dependencies: -)*/
|
||||
#define LV_USE_OBJMASK 1
|
||||
#define LV_USE_OBJMASK 0
|
||||
|
||||
/*Message box (dependencies: lv_rect, lv_btnm, lv_label)*/
|
||||
#define LV_USE_MSGBOX 1
|
||||
@ -808,7 +808,7 @@ typedef struct {
|
||||
#define LV_USE_SLIDER 1
|
||||
|
||||
/*Spinbox (dependencies: lv_ta)*/
|
||||
#define LV_USE_SPINBOX 1
|
||||
#define LV_USE_SPINBOX 0
|
||||
|
||||
/*Switch (dependencies: lv_slider)*/
|
||||
#define LV_USE_SWITCH 1
|
||||
@ -821,7 +821,7 @@ typedef struct {
|
||||
#endif
|
||||
|
||||
/*Table (dependencies: lv_label)*/
|
||||
#define LV_USE_TABLE 1 //(LV_HIGH_RESOURCE_MCU)
|
||||
#define LV_USE_TABLE 0 //(LV_HIGH_RESOURCE_MCU)
|
||||
#if LV_USE_TABLE
|
||||
# define LV_TABLE_COL_MAX 12
|
||||
#endif
|
||||
@ -834,14 +834,14 @@ typedef struct {
|
||||
#endif
|
||||
|
||||
/*Tileview (dependencies: lv_page) */
|
||||
#define LV_USE_TILEVIEW 1
|
||||
#define LV_USE_TILEVIEW 0
|
||||
#if LV_USE_TILEVIEW
|
||||
/*Time of slide animation [ms] (0: no animation)*/
|
||||
# define LV_TILEVIEW_DEF_ANIM_TIME 300
|
||||
#endif
|
||||
|
||||
/*Window (dependencies: lv_cont, lv_btn, lv_label, lv_img, lv_page)*/
|
||||
#define LV_USE_WIN 1
|
||||
#define LV_USE_WIN 0
|
||||
|
||||
/*==================
|
||||
* Non-user section
|
||||
|
@ -1348,8 +1348,11 @@ static hasp_attribute_type_t specific_int_attribute(lv_obj_t* obj, uint16_t attr
|
||||
{LV_HASP_PAGE, ATTR_ANIM_TIME, lv_page_set_anim_time, lv_page_get_anim_time},
|
||||
{LV_HASP_ROLLER, ATTR_ANIM_TIME, lv_roller_set_anim_time, lv_roller_get_anim_time},
|
||||
{LV_HASP_TABVIEW, ATTR_ANIM_TIME, lv_tabview_set_anim_time, lv_tabview_get_anim_time},
|
||||
#if LV_USE_WINDOW > 0
|
||||
{LV_HASP_WINDOW, ATTR_ANIM_TIME, lv_win_set_anim_time, lv_win_get_anim_time},
|
||||
{LV_HASP_LABEL, ATTR_ANIM_SPEED, lv_label_set_anim_speed, lv_label_get_anim_speed}};
|
||||
#endif
|
||||
{LV_HASP_LABEL, ATTR_ANIM_SPEED, lv_label_set_anim_speed, lv_label_get_anim_speed}
|
||||
};
|
||||
if(do_attribute(list, obj, attr_hash, val, update)) return HASP_ATTR_TYPE_INT;
|
||||
}
|
||||
|
||||
@ -1362,10 +1365,15 @@ static hasp_attribute_type_t specific_int_attribute(lv_obj_t* obj, uint16_t attr
|
||||
{LV_HASP_ARC, ATTR_END_ANGLE1, lv_arc_set_end_angle, lv_arc_get_angle_end},
|
||||
{LV_HASP_LINEMETER, ATTR_ROTATION, lv_linemeter_set_angle_offset, lv_linemeter_get_angle_offset},
|
||||
{LV_HASP_GAUGE, ATTR_ROTATION, lv_gauge_set_angle_offset, lv_gauge_get_angle_offset},
|
||||
{LV_HASP_SLIDER, ATTR_ANIM_TIME, lv_slider_set_anim_time, lv_slider_get_anim_time},
|
||||
#if LV_USE_TABLE > 0
|
||||
{LV_HASP_TABLE, ATTR_COLS, lv_table_set_col_cnt, lv_table_get_col_cnt},
|
||||
{LV_HASP_TABLE, ATTR_ROWS, lv_table_set_row_cnt, lv_table_get_row_cnt},
|
||||
{LV_HASP_TILEVIEW, ATTR_ANIM_TIME, lv_tileview_set_anim_time, lv_tileview_get_anim_time}};
|
||||
#endif
|
||||
#if LV_USE_TILEVIEW > 0
|
||||
{LV_HASP_TILEVIEW, ATTR_ANIM_TIME, lv_tileview_set_anim_time, lv_tileview_get_anim_time}
|
||||
#endif
|
||||
{LV_HASP_SLIDER, ATTR_ANIM_TIME, lv_slider_set_anim_time, lv_slider_get_anim_time},
|
||||
};
|
||||
if(do_attribute(list, obj, attr_hash, val, update)) return HASP_ATTR_TYPE_INT;
|
||||
}
|
||||
|
||||
@ -1461,15 +1469,19 @@ static bool my_obj_get_range(lv_obj_t* obj, int32_t& min, int32_t& max)
|
||||
if(max == 0) return false; // only one tab available
|
||||
break;
|
||||
|
||||
#if LV_USE_CHART > 0
|
||||
case LV_HASP_CHART:
|
||||
min = my_chart_get_min_value(obj);
|
||||
max = my_chart_get_max_value(obj);
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if LV_USE_SPINBOX > 0
|
||||
case LV_HASP_SPINBOX:
|
||||
min = my_spinbox_get_min_value(obj);
|
||||
max = my_spinbox_get_max_value(obj);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case LV_HASP_DROPDOWN:
|
||||
case LV_HASP_ROLLER:
|
||||
@ -1590,12 +1602,14 @@ static hasp_attribute_type_t attribute_common_val(lv_obj_t* obj, int32_t& val, b
|
||||
val = lv_bar_get_value(obj);
|
||||
break;
|
||||
|
||||
#if LV_USE_SPINBOX > 0
|
||||
case LV_HASP_SPINBOX:
|
||||
if(update)
|
||||
lv_spinbox_set_value(obj, val);
|
||||
else
|
||||
val = lv_spinbox_get_value(obj);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case LV_HASP_TABVIEW:
|
||||
if(update)
|
||||
@ -1692,6 +1706,7 @@ static hasp_attribute_type_t attribute_common_range(lv_obj_t* obj, int32_t& val,
|
||||
val = set_min ? min : max;
|
||||
break;
|
||||
|
||||
#if LV_USE_CHART > 0
|
||||
case LV_HASP_CHART:
|
||||
if(update && (set_min ? val : min) == (set_max ? val : max))
|
||||
return HASP_ATTR_TYPE_RANGE_ERROR; // prevent setting min=max
|
||||
@ -1700,7 +1715,9 @@ static hasp_attribute_type_t attribute_common_range(lv_obj_t* obj, int32_t& val,
|
||||
else
|
||||
val = set_min ? min : max;
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if LV_USE_SPINBOX > 0
|
||||
case LV_HASP_SPINBOX:
|
||||
if(update && (set_min ? val : min) == (set_max ? val : max))
|
||||
return HASP_ATTR_TYPE_RANGE_ERROR; // prevent setting min=max
|
||||
@ -1709,6 +1726,7 @@ static hasp_attribute_type_t attribute_common_range(lv_obj_t* obj, int32_t& val,
|
||||
else
|
||||
val = set_min ? min : max;
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
return HASP_ATTR_TYPE_NOT_FOUND;
|
||||
|
@ -10,9 +10,11 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if LV_USE_CHART>0
|
||||
lv_chart_series_t* my_chart_get_series(lv_obj_t* chart, uint8_t ser_num);
|
||||
void my_obj_set_value_str_text(lv_obj_t* obj, uint8_t part, lv_state_t state, const char* text);
|
||||
#endif
|
||||
|
||||
void my_obj_set_value_str_text(lv_obj_t* obj, uint8_t part, lv_state_t state, const char* text);
|
||||
void my_btnmatrix_map_clear(lv_obj_t* obj);
|
||||
void my_msgbox_map_clear(lv_obj_t* obj);
|
||||
void line_clear_points(lv_obj_t* obj);
|
||||
|
@ -51,6 +51,7 @@ static inline uint16_t my_arc_get_rotation(lv_obj_t* arc)
|
||||
return ext->rotation_angle;
|
||||
}
|
||||
|
||||
#if LV_USE_CHART > 0
|
||||
// OK - this function is missing in lvgl
|
||||
static inline int16_t my_chart_get_min_value(lv_obj_t* chart)
|
||||
{
|
||||
@ -75,7 +76,9 @@ lv_chart_series_t* my_chart_get_series(lv_obj_t* chart, uint8_t ser_num)
|
||||
}
|
||||
return ser;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_SPINBOX > 0
|
||||
// OK - this function is missing in lvgl
|
||||
static inline int16_t my_spinbox_get_min_value(lv_obj_t* chart)
|
||||
{
|
||||
@ -89,6 +92,7 @@ static inline int16_t my_spinbox_get_max_value(lv_obj_t* chart)
|
||||
lv_spinbox_ext_t* ext = (lv_spinbox_ext_t*)lv_obj_get_ext_attr(chart);
|
||||
return ext->range_max;
|
||||
}
|
||||
#endif
|
||||
|
||||
// OK
|
||||
static inline lv_color_t haspLogColor(lv_color_t color)
|
||||
|
@ -71,6 +71,7 @@ void delete_event_handler(lv_obj_t* obj, lv_event_t event)
|
||||
}
|
||||
|
||||
/* ============================== Timer Event ============================ */
|
||||
#if LV_USE_CALENDAR > 0
|
||||
void event_timer_calendar(lv_task_t* task)
|
||||
{
|
||||
hasp_task_user_data_t* data = (hasp_task_user_data_t*)task->user_data;
|
||||
@ -111,6 +112,7 @@ void event_timer_calendar(lv_task_t* task)
|
||||
|
||||
lv_calendar_set_today_date(obj, &date);
|
||||
}
|
||||
#endif
|
||||
|
||||
void event_timer_clock(lv_task_t* task)
|
||||
{
|
||||
@ -529,6 +531,7 @@ void selector_event_handler(lv_obj_t* obj, lv_event_t event)
|
||||
break;
|
||||
}
|
||||
|
||||
#if LV_USE_TABLE > 0
|
||||
case LV_HASP_TABLE: {
|
||||
uint16_t row;
|
||||
uint16_t col;
|
||||
@ -541,6 +544,7 @@ void selector_event_handler(lv_obj_t* obj, lv_event_t event)
|
||||
attr_out_str(obj, property, buffer);
|
||||
return; // done sending
|
||||
}
|
||||
#endif
|
||||
|
||||
default:
|
||||
return; // Invalid selector type
|
||||
@ -699,6 +703,7 @@ void cpicker_event_handler(lv_obj_t* obj, lv_event_t event)
|
||||
// event_update_group(obj->user_data.groupid, obj, val, min, max);
|
||||
}
|
||||
|
||||
#if LV_USE_CALENDAR > 0
|
||||
void calendar_event_handler(lv_obj_t* obj, lv_event_t event)
|
||||
{
|
||||
log_event("calendar", event);
|
||||
@ -729,4 +734,5 @@ void calendar_event_handler(lv_obj_t* obj, lv_event_t event)
|
||||
event_send_object_data(obj, data);
|
||||
|
||||
// event_update_group(obj->user_data.groupid, obj, val, min, max);
|
||||
}
|
||||
}
|
||||
#endif
|
@ -294,6 +294,7 @@ void hasp_new_object(const JsonObject& config, uint8_t& saved_page_id)
|
||||
}
|
||||
break;
|
||||
|
||||
#if LV_USE_TABLE > 0
|
||||
case LV_HASP_TABLE:
|
||||
case HASP_OBJ_TABLE:
|
||||
obj = lv_table_create(parent_obj, NULL);
|
||||
@ -302,6 +303,7 @@ void hasp_new_object(const JsonObject& config, uint8_t& saved_page_id)
|
||||
obj->user_data.objid = LV_HASP_TABLE;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
case LV_HASP_BUTTON:
|
||||
case HASP_OBJ_BTN:
|
||||
@ -431,6 +433,7 @@ void hasp_new_object(const JsonObject& config, uint8_t& saved_page_id)
|
||||
}
|
||||
break;
|
||||
|
||||
#if LV_USE_TILEVIEW > 0
|
||||
case LV_HASP_TILEVIEW:
|
||||
case HASP_OBJ_TILEVIEW:
|
||||
obj = lv_tileview_create(parent_obj, NULL);
|
||||
@ -438,6 +441,7 @@ void hasp_new_object(const JsonObject& config, uint8_t& saved_page_id)
|
||||
|
||||
// No event handler for tileviews
|
||||
break;
|
||||
#endif
|
||||
|
||||
case LV_HASP_TABVIEW:
|
||||
case HASP_OBJ_TABVIEW:
|
||||
@ -538,6 +542,7 @@ void hasp_new_object(const JsonObject& config, uint8_t& saved_page_id)
|
||||
}
|
||||
break;
|
||||
|
||||
#if LV_USE_SPINBOX > 0
|
||||
case LV_HASP_SPINBOX:
|
||||
case HASP_OBJ_SPINBOX:
|
||||
obj = lv_spinbox_create(parent_obj, NULL);
|
||||
@ -547,6 +552,7 @@ void hasp_new_object(const JsonObject& config, uint8_t& saved_page_id)
|
||||
obj->user_data.objid = LV_HASP_SPINBOX;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
case LV_HASP_LIST:
|
||||
case HASP_OBJ_LIST:
|
||||
@ -557,6 +563,7 @@ void hasp_new_object(const JsonObject& config, uint8_t& saved_page_id)
|
||||
}
|
||||
break;
|
||||
|
||||
#if LV_USE_CHART > 0
|
||||
case LV_HASP_CHART:
|
||||
case HASP_OBJ_CHART:
|
||||
obj = lv_chart_create(parent_obj, NULL);
|
||||
@ -577,6 +584,7 @@ void hasp_new_object(const JsonObject& config, uint8_t& saved_page_id)
|
||||
obj->user_data.objid = LV_HASP_CHART;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
/* ----- On/Off Objects ------ */
|
||||
case LV_HASP_SWITCH:
|
||||
@ -625,6 +633,7 @@ void hasp_new_object(const JsonObject& config, uint8_t& saved_page_id)
|
||||
}
|
||||
break;
|
||||
|
||||
#if LV_USE_CALENDAR > 0
|
||||
case LV_HASP_CALENDER:
|
||||
case HASP_OBJ_CALENDAR:
|
||||
obj = lv_calendar_create(parent_obj, NULL);
|
||||
@ -636,6 +645,7 @@ void hasp_new_object(const JsonObject& config, uint8_t& saved_page_id)
|
||||
object_add_task(obj, pageid, id, event_timer_calendar, 5000);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
/* ----- Other Object ------ */
|
||||
// default:
|
||||
|
Loading…
x
Reference in New Issue
Block a user