2016-04-11 13:59:55 -04:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2016 Jared Boone, ShareBrained Technology, Inc.
|
|
|
|
*
|
|
|
|
* 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"
|
2016-04-13 14:09:18 -04:00
|
|
|
#include "ui_spectrum.hpp"
|
2016-04-11 13:59:55 -04:00
|
|
|
|
2016-04-22 14:57:46 -04:00
|
|
|
#include "bitmap.hpp"
|
|
|
|
|
2016-04-22 15:15:51 -04:00
|
|
|
#include "capture_thread.hpp"
|
2016-04-11 13:59:55 -04:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
namespace ui {
|
|
|
|
|
|
|
|
class CaptureAppView : public View {
|
|
|
|
public:
|
|
|
|
CaptureAppView(NavigationView& nav);
|
|
|
|
~CaptureAppView();
|
|
|
|
|
2016-04-13 14:09:18 -04:00
|
|
|
void on_hide() override;
|
|
|
|
|
|
|
|
void set_parent_rect(const Rect new_parent_rect) override;
|
|
|
|
|
2016-04-11 14:22:35 -04:00
|
|
|
void focus() override;
|
|
|
|
|
2016-04-11 13:59:55 -04:00
|
|
|
std::string title() const override { return "Capture"; };
|
|
|
|
|
|
|
|
private:
|
2016-04-21 14:45:37 -04:00
|
|
|
static constexpr ui::Dim header_height = 3 * 16;
|
2016-04-13 14:09:18 -04:00
|
|
|
|
2016-04-20 12:54:19 -04:00
|
|
|
static constexpr uint32_t sampling_rate = 4000000;
|
|
|
|
static constexpr uint32_t baseband_bandwidth = 2500000;
|
2016-04-11 13:59:55 -04:00
|
|
|
|
2016-04-22 15:15:51 -04:00
|
|
|
std::unique_ptr<CaptureThread> capture_thread;
|
2016-04-11 13:59:55 -04:00
|
|
|
|
2016-04-22 15:08:01 -04:00
|
|
|
void on_record();
|
2016-04-11 14:22:35 -04:00
|
|
|
|
2016-04-12 13:56:00 -04:00
|
|
|
void on_tuning_frequency_changed(rf::Frequency f);
|
|
|
|
void on_lna_changed(int32_t v_db);
|
|
|
|
void on_vga_changed(int32_t v_db);
|
|
|
|
|
2016-04-22 15:08:01 -04:00
|
|
|
ImageButton button_record {
|
2016-04-21 14:45:37 -04:00
|
|
|
{ 0 * 8, 2 * 16, 2 * 8, 1 * 16 },
|
2016-04-12 14:37:58 -04:00
|
|
|
&bitmap_record,
|
|
|
|
Color::red(),
|
|
|
|
Color::black()
|
|
|
|
};
|
|
|
|
|
2016-04-21 14:45:57 -04:00
|
|
|
Text text_record_filename {
|
|
|
|
{ 3 * 8, 2 * 16, 12 * 8, 16 },
|
|
|
|
"",
|
|
|
|
};
|
|
|
|
|
2016-04-12 13:56:00 -04:00
|
|
|
RSSI rssi {
|
|
|
|
{ 21 * 8, 0, 6 * 8, 4 },
|
|
|
|
};
|
|
|
|
|
|
|
|
Channel channel {
|
|
|
|
{ 21 * 8, 5, 6 * 8, 4 },
|
|
|
|
};
|
|
|
|
|
|
|
|
FrequencyField field_frequency {
|
|
|
|
{ 5 * 8, 0 * 16 },
|
|
|
|
};
|
|
|
|
|
|
|
|
LNAGainField field_lna {
|
|
|
|
{ 15 * 8, 0 * 16 }
|
|
|
|
};
|
|
|
|
|
|
|
|
VGAGainField field_vga {
|
|
|
|
{ 18 * 8, 0 * 16 }
|
|
|
|
};
|
2016-04-13 14:09:18 -04:00
|
|
|
|
|
|
|
spectrum::WaterfallWidget waterfall;
|
2016-04-11 13:59:55 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
} /* namespace ui */
|
|
|
|
|
|
|
|
#endif/*__CAPTURE_APP_HPP__*/
|