SubGhz count+show repeats when not ignoring

This commit is contained in:
Willy-JL
2023-12-10 14:00:13 +00:00
parent 265cdd8b64
commit 8a15bc6397
6 changed files with 80 additions and 32 deletions

View File

@@ -20,6 +20,7 @@ typedef struct {
FuriString* item_str;
FuriString* time;
uint8_t type;
uint16_t repeats;
} SubGhzReceiverMenuItem;
ARRAY_DEF(SubGhzReceiverMenuItemArray, SubGhzReceiverMenuItem, M_POD_OPLIST)
@@ -175,7 +176,8 @@ void subghz_view_receiver_add_item_to_menu(
SubGhzViewReceiver* subghz_receiver,
const char* name,
const char* time,
uint8_t type) {
uint8_t type,
uint16_t repeats) {
furi_assert(subghz_receiver);
with_view_model(
subghz_receiver->view,
@@ -186,6 +188,7 @@ void subghz_view_receiver_add_item_to_menu(
item_menu->time = furi_string_alloc_set(time);
item_menu->item_str = furi_string_alloc_set(name);
item_menu->type = type;
item_menu->repeats = repeats;
if((model->idx == model->history_item - 1)) {
model->history_item++;
model->idx++;
@@ -293,7 +296,15 @@ void subghz_view_receiver_draw(Canvas* canvas, SubGhzViewReceiverModel* model) {
if(item_menu->type == 0) {
break;
}
furi_string_set(str_buff, item_menu->item_str);
if(item_menu->repeats) {
furi_string_printf(
str_buff,
"x%u: %s",
item_menu->repeats + 1,
furi_string_get_cstr(item_menu->item_str));
} else {
furi_string_set(str_buff, item_menu->item_str);
}
if(model->idx == idx) {
subghz_view_receiver_draw_frame(canvas, i, scrollbar);
if(model->show_time) {

View File

@@ -47,7 +47,8 @@ void subghz_view_receiver_add_item_to_menu(
SubGhzViewReceiver* subghz_receiver,
const char* name,
const char* time,
uint8_t type);
uint8_t type,
uint16_t repeats);
uint16_t subghz_view_receiver_get_idx_menu(SubGhzViewReceiver* subghz_receiver);