From 1c544a663b83f9b9a792a7e255614c0ab6aa3608 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Wed, 20 Apr 2016 10:22:05 -0700 Subject: [PATCH] Use automatic file naming for screen capture .png files. --- firmware/application/ui_navigation.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/firmware/application/ui_navigation.cpp b/firmware/application/ui_navigation.cpp index 2b245dd6..002a8f47 100644 --- a/firmware/application/ui_navigation.cpp +++ b/firmware/application/ui_navigation.cpp @@ -35,6 +35,7 @@ #include "core_control.hpp" +#include "file.hpp" #include "png_writer.hpp" namespace ui { @@ -80,7 +81,12 @@ void SystemStatusView::set_title(const std::string new_value) { } void SystemStatusView::on_camera() { - PNGWriter png { "capture.png" }; + const auto filename = next_filename_matching_pattern("SCR_????.PNG"); + if( filename.empty() ) { + return; + } + + PNGWriter png { filename }; for(int i=0; i<320; i++) { std::array row;