This commit is contained in:
gid9798
2023-06-18 20:25:40 +03:00
parent 3000b8fd0d
commit 5eb677aa55
42 changed files with 993 additions and 1100 deletions

View File

@@ -70,6 +70,7 @@ typedef struct {
SubGhzViewReceiverBarShow bar_show;
SubGhzViewReceiverMode mode;
uint8_t u_rssi;
SubGhzRadioDeviceType device_type;
size_t scroll_counter;
bool nodraw;
} SubGhzViewReceiverModel;
@@ -202,6 +203,17 @@ void subghz_view_receiver_add_data_progress(
true);
}
void subghz_view_receiver_set_radio_device_type(
SubGhzViewReceiver* subghz_receiver,
SubGhzRadioDeviceType device_type) {
furi_assert(subghz_receiver);
with_view_model(
subghz_receiver->view,
SubGhzViewReceiverModel * model,
{ model->device_type = device_type; },
true);
}
static void subghz_view_receiver_draw_frame(Canvas* canvas, uint16_t idx, bool scrollbar) {
canvas_set_color(canvas, ColorBlack);
canvas_draw_box(canvas, 0, 0 + idx * FRAME_HEIGHT, scrollbar ? 122 : 127, FRAME_HEIGHT);
@@ -289,12 +301,14 @@ void subghz_view_receiver_draw(Canvas* canvas, SubGhzViewReceiverModel* model) {
canvas_set_color(canvas, ColorBlack);
if(model->history_item == 0) {
// TODO
if(model->mode == SubGhzViewReceiverModeLive) {
canvas_draw_icon(
canvas,
0,
0,
furi_hal_subghz_get_radio_type() ? &I_Fishing_123x52 : &I_Scanning_123x52);
(model->device_type == SubGhzRadioDeviceTypeInternal) ? &I_Scanning_123x52 :
&I_Fishing_123x52);
canvas_set_font(canvas, FontPrimary);
canvas_draw_str(canvas, 63, 46, "Scanning...");
//canvas_draw_line(canvas, 46, 51, 125, 51);
@@ -304,7 +318,8 @@ void subghz_view_receiver_draw(Canvas* canvas, SubGhzViewReceiverModel* model) {
canvas,
0,
0,
furi_hal_subghz_get_radio_type() ? &I_Fishing_123x52 : &I_Scanning_123x52);
(model->device_type == SubGhzRadioDeviceTypeInternal) ? &I_Scanning_123x52 :
&I_Fishing_123x52);
canvas_set_font(canvas, FontPrimary);
canvas_draw_str(canvas, 63, 46, "Decoding...");
canvas_set_font(canvas, FontSecondary);