-
-
Notifications
You must be signed in to change notification settings - Fork 561
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* BMP initial * Add vscode debug configuration as a template (#2109) * usb serial debug interface & usb serial async msg (#2111) * add serial_debug * not use OSS * add path print * add string print and vec * clean up * clean up * format * add an async blocking bool * add an async blocking bool - comment * protect the unexpected tx * naming * remove demo code * fix bottom-up format, and add auto extend, .. * bmp write * Minor additions * Minor * overwrite on create * Tmp * Basic view - WIP * debug * add literal str print in asyncmsg (#2113) * add literal str print in asyncmsg * remove debug things * accept suggestion per gull * fix documentary * Fix bug (#2114) * Disable Back button during Touch Calibration (#2115) * ADS1100 (#2116) * WIP * WIP * WIP * Corrected name * WIP * WIP * WIP * WIP * Added new calc * WIP * WIP * WIP * WIP * WIP * WIP * Added debug serial lines * WIP * Fixed issue * Fixed calculation issue * Added voltage to performance DFU menu * Added padding function and added voltage to perf menu * Clean up * Refactor * Fixed linting * Hides voltage if PP does not conatin IC * WIP showing battery % * made the percentage a int * Added % to header * Removed test UI * Removed comment * Added fix for precision too large * Added fix for precision too large * Linting * widget * auto zoom * remove debug * move in screen * fix math * remove test code * fix * fix compiler warning * BMP File viewer * Full screen * bg instead of noice * add comment * Handle some not supported formats. --------- Co-authored-by: E.T <[email protected]> Co-authored-by: sommermorgentraum <[email protected]> Co-authored-by: Mark Thompson <[email protected]> Co-authored-by: jLynx <[email protected]>
- Loading branch information
1 parent
67975d7
commit 06651dc
Showing
15 changed files
with
801 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* Copyright (C) 2024 HTotoo | ||
* | ||
* This file is part of PortaPack. | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2, or (at your option) | ||
* any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; see the file COPYING. If not, write to | ||
* the Free Software Foundation, Inc., 51 Franklin Street, | ||
* Boston, MA 02110-1301, USA. | ||
*/ | ||
|
||
#include "ui_bmp_file_viewer.hpp" | ||
|
||
extern ui::SystemView* system_view_ptr; | ||
|
||
using namespace portapack; | ||
namespace fs = std::filesystem; | ||
|
||
namespace ui { | ||
|
||
BMPFileViewer::BMPFileViewer( | ||
NavigationView& nav, | ||
const std::filesystem::path& path) | ||
: nav_{nav}, | ||
path_{path} { | ||
add_children( | ||
{&bmp}); | ||
bmp.set_enter_pass(true); // pass the enter key to me, so i can exit. this will disable zoom + pos reset | ||
set_focusable(true); | ||
system_view_ptr->set_app_fullscreen(true); | ||
} | ||
|
||
BMPFileViewer::~BMPFileViewer() { | ||
system_view_ptr->set_app_fullscreen(false); | ||
} | ||
|
||
void BMPFileViewer::focus() { | ||
bmp.focus(); | ||
} | ||
|
||
bool BMPFileViewer::on_key(KeyEvent k) { | ||
if (k == KeyEvent::Select) { | ||
nav_.pop(); | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
void BMPFileViewer::paint(Painter&) { | ||
bmp.load_bmp(path_); | ||
} | ||
|
||
} // namespace ui |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright (C) 2024 HTotoo | ||
* | ||
* This file is part of PortaPack. | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2, or (at your option) | ||
* any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; see the file COPYING. If not, write to | ||
* the Free Software Foundation, Inc., 51 Franklin Street, | ||
* Boston, MA 02110-1301, USA. | ||
*/ | ||
|
||
#ifndef __UI_BMP_FILE_VIEWER_H__ | ||
#define __UI_BMP_FILE_VIEWER_H__ | ||
|
||
#include "ui.hpp" | ||
#include "ui_navigation.hpp" | ||
#include "ui_painter.hpp" | ||
#include "ui_styles.hpp" | ||
#include "ui_widget.hpp" | ||
#include "file.hpp" | ||
#include "ui_bmpview.hpp" | ||
|
||
namespace ui { | ||
|
||
class BMPFileViewer : public View { | ||
public: | ||
BMPFileViewer(NavigationView& nav, const std::filesystem::path& path); | ||
~BMPFileViewer(); | ||
bool on_key(KeyEvent key) override; | ||
void paint(Painter& painter) override; | ||
void focus() override; | ||
|
||
private: | ||
NavigationView& nav_; | ||
std::filesystem::path path_{}; | ||
BMPViewer bmp{{0, 0, 240, 320}}; | ||
}; | ||
|
||
} // namespace ui | ||
|
||
#endif // __UI_BMP_FILE_VIEWER_H__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.