2017-04-07 01:20:24 -04:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
|
|
|
|
* Copyright (C) 2016 Furrtek
|
2023-05-18 16:16:05 -04:00
|
|
|
*
|
2017-04-07 01:20:24 -04:00
|
|
|
* 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.hpp"
|
2023-12-12 10:55:50 -05:00
|
|
|
#include "ui_language.hpp"
|
2017-04-07 01:20:24 -04:00
|
|
|
#include "ui_widget.hpp"
|
|
|
|
#include "ui_navigation.hpp"
|
|
|
|
#include "ui_transmitter.hpp"
|
|
|
|
|
|
|
|
#include "message.hpp"
|
|
|
|
#include "transmitter_model.hpp"
|
2022-05-13 08:38:04 -04:00
|
|
|
#include "app_settings.hpp"
|
2023-06-14 03:57:20 -04:00
|
|
|
#include "radio_state.hpp"
|
2017-04-07 01:20:24 -04:00
|
|
|
#include "portapack.hpp"
|
|
|
|
|
2023-12-12 10:55:50 -05:00
|
|
|
namespace ui::external_app::coasterp {
|
2017-04-07 01:20:24 -04:00
|
|
|
|
|
|
|
class CoasterPagerView : public View {
|
2023-05-18 16:16:05 -04:00
|
|
|
public:
|
|
|
|
CoasterPagerView(NavigationView& nav);
|
|
|
|
~CoasterPagerView();
|
|
|
|
|
|
|
|
void focus() override;
|
|
|
|
|
|
|
|
std::string title() const override { return "BurgerPgrTX"; };
|
|
|
|
|
|
|
|
private:
|
|
|
|
enum tx_modes {
|
|
|
|
IDLE = 0,
|
|
|
|
SINGLE,
|
|
|
|
SCAN
|
|
|
|
};
|
|
|
|
|
|
|
|
tx_modes tx_mode = IDLE;
|
|
|
|
|
2023-06-14 03:57:20 -04:00
|
|
|
TxRadioState radio_state_{
|
2023-10-14 12:33:52 -04:00
|
|
|
433920000, /* frequency */
|
2023-06-14 03:57:20 -04:00
|
|
|
1750000 /* bandwidth */,
|
|
|
|
2280000 /* sampling rate */
|
|
|
|
};
|
2023-06-11 14:47:13 -04:00
|
|
|
app_settings::SettingsManager settings_{
|
2023-10-14 15:08:39 -04:00
|
|
|
"tx_burger", app_settings::Mode::TX};
|
2023-05-18 16:16:05 -04:00
|
|
|
|
|
|
|
void start_tx();
|
|
|
|
void generate_frame();
|
|
|
|
void on_tx_progress(const uint32_t progress, const bool done);
|
|
|
|
|
|
|
|
Labels labels{
|
2024-05-27 15:02:52 -04:00
|
|
|
{{1 * 8, 3 * 8}, "Syscall pager TX beta", Theme::getInstance()->fg_light->foreground},
|
|
|
|
{{1 * 8, 8 * 8}, LanguageHelper::currentMessages[LANG_DATADP], Theme::getInstance()->fg_light->foreground}};
|
2023-05-18 16:16:05 -04:00
|
|
|
|
|
|
|
SymField sym_data{
|
|
|
|
{7 * 8, 8 * 8},
|
2023-09-12 15:38:19 -04:00
|
|
|
16,
|
|
|
|
SymField::Type::Hex};
|
2023-05-18 16:16:05 -04:00
|
|
|
|
|
|
|
Checkbox checkbox_scan{
|
|
|
|
{10 * 8, 14 * 8},
|
|
|
|
4,
|
2023-12-12 10:55:50 -05:00
|
|
|
LanguageHelper::currentMessages[LANG_SCAN]};
|
2023-05-18 16:16:05 -04:00
|
|
|
|
2023-09-12 15:38:19 -04:00
|
|
|
/*
|
|
|
|
ProgressBar progressbar {
|
|
|
|
{ 5 * 8, 12 * 16, 20 * 8, 16 }};
|
|
|
|
*/
|
|
|
|
|
2023-05-18 16:16:05 -04:00
|
|
|
Text text_message{
|
|
|
|
{5 * 8, 13 * 16, 20 * 8, 16},
|
|
|
|
""};
|
|
|
|
|
|
|
|
TransmitterView tx_view{
|
|
|
|
16 * 16,
|
|
|
|
10000,
|
|
|
|
12};
|
|
|
|
|
|
|
|
MessageHandlerRegistration message_handler_tx_progress{
|
|
|
|
Message::ID::TXProgress,
|
|
|
|
[this](const Message* const p) {
|
|
|
|
const auto message = *reinterpret_cast<const TXProgressMessage*>(p);
|
|
|
|
this->on_tx_progress(message.progress, message.done);
|
|
|
|
}};
|
2017-04-07 01:20:24 -04:00
|
|
|
};
|
|
|
|
|
2023-12-12 10:55:50 -05:00
|
|
|
} /* namespace ui::external_app::coasterp */
|