|
|
@@ -3,8 +3,14 @@
|
|
|
|
|
|
#include "app.h"
|
|
|
|
|
|
-/* Renders the view with the detected message information. */
|
|
|
-void render_view_info(Canvas *const canvas, ProtoViewApp *app) {
|
|
|
+enum {
|
|
|
+ SubViewInfoMain,
|
|
|
+ SubViewInfoSave,
|
|
|
+ SubViewInfoLast, /* Just a sentinel. */
|
|
|
+};
|
|
|
+
|
|
|
+/* Render the view with the detected message information. */
|
|
|
+static void render_subview_main(Canvas *const canvas, ProtoViewApp *app) {
|
|
|
if (app->signal_decoded == false) {
|
|
|
canvas_set_font(canvas, FontSecondary);
|
|
|
canvas_draw_str(canvas, 30,36,"No signal decoded");
|
|
|
@@ -31,8 +37,24 @@ void render_view_info(Canvas *const canvas, ProtoViewApp *app) {
|
|
|
canvas_draw_str(canvas, 0, y, app->signal_info.info4); y += lineheight;
|
|
|
}
|
|
|
|
|
|
+/* Render view with save option. */
|
|
|
+static void render_subview_save(Canvas *const canvas, ProtoViewApp *app) {
|
|
|
+ UNUSED(canvas);
|
|
|
+ UNUSED(app);
|
|
|
+}
|
|
|
+
|
|
|
+/* Render the selected subview of this view. */
|
|
|
+void render_view_info(Canvas *const canvas, ProtoViewApp *app) {
|
|
|
+ show_available_subviews(canvas,app,SubViewInfoLast);
|
|
|
+ switch(app->current_subview[app->current_view]) {
|
|
|
+ case SubViewInfoMain: render_subview_main(canvas,app); break;
|
|
|
+ case SubViewInfoSave: render_subview_save(canvas,app); break;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
/* Handle input for the info view. */
|
|
|
void process_input_info(ProtoViewApp *app, InputEvent input) {
|
|
|
+ if (process_subview_updown(app,input,SubViewInfoLast)) return;
|
|
|
if (input.type == InputTypeShort) {
|
|
|
if (input.key == InputKeyOk) {
|
|
|
/* Reset the current sample to capture the next. */
|