SubGhz: fix GUI ReadRAW and add new man (#843)

* Notification: add sequence_single_vibro
* SubGhz: optimizing the performance of the GUI ReadRAW
* SubGhz: full highlighting of the default filename on save
* SubGhz: add man Leopard, Faraon, Reff, ZX-750, Back_SL-B9, fix syntax

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Skorpionm
2021-11-26 18:01:03 +04:00
committed by GitHub
parent f52e9fc578
commit 7c0943e736
11 changed files with 47 additions and 30 deletions

View File

@@ -309,7 +309,14 @@ const NotificationSequence sequence_blink_white_100 = {
NULL,
};
// General
//General
const NotificationSequence sequence_single_vibro = {
&message_vibro_on,
&message_delay_100,
&message_vibro_off,
NULL,
};
const NotificationSequence sequence_double_vibro = {
&message_vibro_on,
&message_delay_100,

View File

@@ -89,6 +89,7 @@ extern const NotificationSequence sequence_blink_magenta_100;
extern const NotificationSequence sequence_blink_white_100;
// General
extern const NotificationSequence sequence_single_vibro;
extern const NotificationSequence sequence_double_vibro;
extern const NotificationSequence sequence_success;
extern const NotificationSequence sequence_error;

View File

@@ -19,13 +19,6 @@ static const NotificationSequence sequence_note_c = {
NULL,
};
static const NotificationSequence sequence_vibro = {
&message_vibro_on,
&message_delay_100,
&message_vibro_off,
NULL,
};
#define BACKLIGHT_COUNT 5
const char* const backlight_text[BACKLIGHT_COUNT] = {
"0%",
@@ -150,7 +143,7 @@ static void vibro_changed(VariableItem* item) {
variable_item_set_current_value_text(item, vibro_text[index]);
app->notification->settings.vibro_on = vibro_value[index];
notification_message(app->notification, &sequence_vibro);
notification_message(app->notification, &sequence_single_vibro);
}
static uint32_t notification_app_settings_exit(void* context) {

View File

@@ -29,6 +29,7 @@ typedef enum {
SubghzCustomEventViewReadRAWSendStart,
SubghzCustomEventViewReadRAWSendStop,
SubghzCustomEventViewReadRAWSave,
SubghzCustomEventViewReadRAWVibro,
SubghzCustomEventViewTransmitterBack,
SubghzCustomEventViewTransmitterSendStart,

View File

@@ -108,6 +108,10 @@ bool subghz_scene_read_raw_on_event(void* context, SceneManagerEvent event) {
subghz->txrx->rx_key_state = SubGhzRxKeyStateIDLE;
return true;
break;
case SubghzCustomEventViewReadRAWVibro:
notification_message(subghz->notifications, &sequence_single_vibro);
return true;
break;
case SubghzCustomEventViewReadRAWSendStart:
//set the path to read the file
if(strcmp(

View File

@@ -18,7 +18,7 @@ void subghz_scene_save_name_on_enter(void* context) {
if(!strcmp(subghz->file_name, "")) {
set_random_name(subghz->file_name, sizeof(subghz->file_name));
dev_name_empty = true;
} else {
memcpy(subghz->file_name_tmp, subghz->file_name, strlen(subghz->file_name) + 1);
if(scene_manager_get_scene_state(subghz->scene_manager, SubGhzSceneReadRAW) ==
@@ -26,6 +26,8 @@ void subghz_scene_save_name_on_enter(void* context) {
subghz_get_next_name_file(subghz);
}
}
//highlighting the entire filename by default
dev_name_empty = true;
text_input_set_header_text(text_input, "Name signal");
text_input_set_result_callback(

View File

@@ -123,7 +123,7 @@ static int8_t subghz_read_raw_tab_sin(uint8_t x) {
void subghz_read_raw_draw_sin(Canvas* canvas, SubghzReadRAWModel* model) {
#define SUBGHZ_RAW_SIN_AMPLITUDE 11
for(int i = 114; i > 0; i--) {
for(int i = 113; i > 0; i--) {
canvas_draw_line(
canvas,
i,
@@ -212,12 +212,12 @@ void subghz_read_raw_draw(Canvas* canvas, SubghzReadRAWModel* model) {
canvas_draw_line(canvas, 0, 14, 115, 14);
canvas_draw_line(canvas, 0, 48, 115, 48);
canvas_draw_line(canvas, 115, 14, 115, 48);
subghz_read_raw_draw_scale(canvas, model);
if((model->satus == SubghzReadRAWStatusTX) || (model->satus == SubghzReadRAWStatusTXRepeat)) {
subghz_read_raw_draw_sin(canvas, model);
} else {
subghz_read_raw_draw_rssi(canvas, model);
subghz_read_raw_draw_scale(canvas, model);
}
if(model->satus == SubghzReadRAWStatusIDLE) {
@@ -243,13 +243,19 @@ bool subghz_read_raw_input(InputEvent* event, void* context) {
furi_assert(context);
SubghzReadRAW* instance = context;
if(event->key == InputKeyOk && event->type == InputTypePress) {
if((event->key == InputKeyOk) &&
(event->type == InputTypeLong || event->type == InputTypeRepeat)) {
//we check that if we hold the transfer button,
//further check of events is not needed, we exit
return false;
} else if(event->key == InputKeyOk && event->type == InputTypePress) {
with_view_model(
instance->view, (SubghzReadRAWModel * model) {
uint8_t ret = false;
if(model->satus == SubghzReadRAWStatusIDLE) {
// Start TX
instance->callback(SubghzCustomEventViewReadRAWSendStart, instance->context);
instance->callback(SubghzCustomEventViewReadRAWVibro, instance->context);
model->satus = SubghzReadRAWStatusTXRepeat;
ret = true;
} else if(model->satus == SubghzReadRAWStatusTX) {
@@ -279,16 +285,13 @@ bool subghz_read_raw_input(InputEvent* event, void* context) {
}
return true;
});
} else if(event->key == InputKeyLeft && event->type == InputTypeShort) {
with_view_model(
instance->view, (SubghzReadRAWModel * model) {
if(model->satus == SubghzReadRAWStatusStart) {
//Config
instance->callback(SubghzCustomEventViewReadRAWConfig, instance->context);
}
if(model->satus == SubghzReadRAWStatusIDLE) {
} else if(model->satus == SubghzReadRAWStatusIDLE) {
//Erase
model->satus = SubghzReadRAWStatusStart;
model->rssi_history_end = false;
@@ -326,7 +329,6 @@ bool subghz_read_raw_input(InputEvent* event, void* context) {
return true;
});
}
return true;
}