2016-04-11 13:59:55 -04:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2016 Jared Boone, ShareBrained Technology, Inc.
|
2018-04-18 17:44:41 -04:00
|
|
|
* Copyright (C) 2018 Furrtek
|
2016-04-11 13:59:55 -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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __CAPTURE_APP_HPP__
|
|
|
|
#define __CAPTURE_APP_HPP__
|
|
|
|
|
|
|
|
#include "ui_widget.hpp"
|
|
|
|
#include "ui_navigation.hpp"
|
2016-04-12 13:56:00 -04:00
|
|
|
#include "ui_receiver.hpp"
|
2023-06-18 15:11:04 -04:00
|
|
|
#include "ui_freq_field.hpp"
|
2016-04-30 16:56:54 -04:00
|
|
|
#include "ui_record_view.hpp"
|
2016-04-13 14:09:18 -04:00
|
|
|
#include "ui_spectrum.hpp"
|
2023-06-17 10:54:52 -04:00
|
|
|
#include "app_settings.hpp"
|
2023-06-14 03:57:20 -04:00
|
|
|
#include "radio_state.hpp"
|
2023-05-14 17:09:43 -04:00
|
|
|
|
2016-04-11 13:59:55 -04:00
|
|
|
namespace ui {
|
|
|
|
|
|
|
|
class CaptureAppView : public View {
|
2023-05-18 16:16:05 -04:00
|
|
|
public:
|
|
|
|
CaptureAppView(NavigationView& nav);
|
|
|
|
~CaptureAppView();
|
|
|
|
|
|
|
|
void focus() override;
|
2023-06-17 10:54:52 -04:00
|
|
|
void set_parent_rect(const Rect new_parent_rect) override;
|
2023-05-18 16:16:05 -04:00
|
|
|
|
|
|
|
std::string title() const override { return "Capture"; };
|
|
|
|
|
|
|
|
private:
|
|
|
|
static constexpr ui::Dim header_height = 3 * 16;
|
2023-08-24 04:14:18 -04:00
|
|
|
uint32_t previous_bandwidth{500000};
|
2023-05-18 16:16:05 -04:00
|
|
|
|
2023-06-18 15:11:04 -04:00
|
|
|
NavigationView& nav_;
|
2023-07-04 19:26:26 -04:00
|
|
|
RxRadioState radio_state_{ReceiverModel::Mode::Capture};
|
2023-06-17 10:54:52 -04:00
|
|
|
app_settings::SettingsManager settings_{
|
|
|
|
"rx_capture", app_settings::Mode::RX,
|
|
|
|
app_settings::Options::UseGlobalTargetFrequency};
|
2023-06-14 03:57:20 -04:00
|
|
|
|
2023-05-18 16:16:05 -04:00
|
|
|
Labels labels{
|
|
|
|
{{0 * 8, 1 * 16}, "Rate:", Color::light_grey()},
|
2023-07-22 03:20:56 -04:00
|
|
|
{{11 * 8, 1 * 16}, "Format:", Color::light_grey()},
|
2023-05-18 16:16:05 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
RSSI rssi{
|
2023-06-18 15:11:04 -04:00
|
|
|
{24 * 8, 0, 6 * 8, 4}};
|
2023-05-18 16:16:05 -04:00
|
|
|
|
|
|
|
Channel channel{
|
2023-06-18 15:11:04 -04:00
|
|
|
{24 * 8, 5, 6 * 8, 4}};
|
2023-05-18 16:16:05 -04:00
|
|
|
|
2023-06-18 15:11:04 -04:00
|
|
|
RxFrequencyField field_frequency{
|
2023-05-18 16:16:05 -04:00
|
|
|
{0 * 8, 0 * 16},
|
2023-06-18 15:11:04 -04:00
|
|
|
nav_};
|
2023-05-18 16:16:05 -04:00
|
|
|
|
|
|
|
FrequencyStepView field_frequency_step{
|
2023-06-18 15:11:04 -04:00
|
|
|
{10 * 8, 0 * 16}};
|
2023-05-18 16:16:05 -04:00
|
|
|
|
|
|
|
RFAmpField field_rf_amp{
|
|
|
|
{16 * 8, 0 * 16}};
|
|
|
|
|
|
|
|
LNAGainField field_lna{
|
|
|
|
{18 * 8, 0 * 16}};
|
|
|
|
|
|
|
|
VGAGainField field_vga{
|
|
|
|
{21 * 8, 0 * 16}};
|
|
|
|
|
|
|
|
OptionsField option_bandwidth{
|
|
|
|
{5 * 8, 1 * 16},
|
|
|
|
5,
|
2023-06-25 05:33:44 -04:00
|
|
|
{}};
|
2023-05-18 16:16:05 -04:00
|
|
|
|
2023-07-22 03:20:56 -04:00
|
|
|
OptionsField option_format{
|
|
|
|
{18 * 8, 1 * 16},
|
|
|
|
3,
|
|
|
|
{{"C16", RecordView::FileType::RawS16},
|
|
|
|
{"C8", RecordView::FileType::RawS8}}};
|
|
|
|
|
2023-09-21 11:43:10 -04:00
|
|
|
Checkbox check_trim{
|
|
|
|
{23 * 8, 1 * 16},
|
|
|
|
4,
|
|
|
|
"Trim",
|
|
|
|
/*small*/ true};
|
|
|
|
|
2023-05-18 16:16:05 -04:00
|
|
|
RecordView record_view{
|
|
|
|
{0 * 8, 2 * 16, 30 * 8, 1 * 16},
|
|
|
|
u"BBD_????.*",
|
|
|
|
u"CAPTURES",
|
|
|
|
RecordView::FileType::RawS16,
|
|
|
|
16384,
|
|
|
|
3};
|
|
|
|
|
2023-06-30 01:34:19 -04:00
|
|
|
spectrum::WaterfallView waterfall{};
|
2016-04-11 13:59:55 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
} /* namespace ui */
|
|
|
|
|
2023-05-18 16:16:05 -04:00
|
|
|
#endif /*__CAPTURE_APP_HPP__*/
|