forked from AlexandreRouma/SDRPlusPlus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
- Loading branch information
Showing
15 changed files
with
957 additions
and
160 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
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 |
---|---|---|
@@ -1,8 +1,11 @@ | ||
#pragma once | ||
#include <signal_path/vfo_manager.h> | ||
|
||
class Decoder { | ||
public: | ||
|
||
virtual void showMenu(); | ||
|
||
virtual ~Decoder() {} | ||
virtual void showMenu() {}; | ||
virtual void setVFO(VFOManager::VFO* vfo) = 0; | ||
virtual void start() = 0; | ||
virtual void stop() = 0; | ||
}; |
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,96 @@ | ||
#pragma once | ||
#include "../decoder.h" | ||
#include <signal_path/vfo_manager.h> | ||
#include <utils/optionlist.h> | ||
#include <gui/widgets/symbol_diagram.h> | ||
#include <gui/style.h> | ||
#include <dsp/sink/handler_sink.h> | ||
#include "flex.h" | ||
|
||
class FLEXDecoder : public Decoder { | ||
dsp::stream<float> dummy1; | ||
dsp::stream<uint8_t> dummy2; | ||
public: | ||
FLEXDecoder(const std::string& name, VFOManager::VFO* vfo) : diag(0.6, 1600) { | ||
this->name = name; | ||
this->vfo = vfo; | ||
|
||
// Define baudrate options | ||
baudrates.define(1600, "1600 Baud", 1600); | ||
baudrates.define(3200, "3200 Baud", 3200); | ||
baudrates.define(6400, "6400 Baud", 6400); | ||
|
||
// Init DSP | ||
vfo->setBandwidthLimits(12500, 12500, true); | ||
vfo->setSampleRate(16000, 12500); | ||
reshape.init(&dummy1, 1600.0, (1600 / 30.0) - 1600.0); | ||
dataHandler.init(&dummy2, _dataHandler, this); | ||
diagHandler.init(&reshape.out, _diagHandler, this); | ||
} | ||
|
||
~FLEXDecoder() { | ||
stop(); | ||
} | ||
|
||
void showMenu() { | ||
ImGui::LeftLabel("Baudrate"); | ||
ImGui::FillWidth(); | ||
if (ImGui::Combo(("##pager_decoder_flex_br_" + name).c_str(), &brId, baudrates.txt)) { | ||
// TODO | ||
} | ||
|
||
ImGui::FillWidth(); | ||
diag.draw(); | ||
} | ||
|
||
void setVFO(VFOManager::VFO* vfo) { | ||
this->vfo = vfo; | ||
vfo->setBandwidthLimits(12500, 12500, true); | ||
vfo->setSampleRate(24000, 12500); | ||
// dsp.setInput(vfo->output); | ||
} | ||
|
||
void start() { | ||
flog::debug("FLEX start"); | ||
// dsp.start(); | ||
reshape.start(); | ||
dataHandler.start(); | ||
diagHandler.start(); | ||
} | ||
|
||
void stop() { | ||
flog::debug("FLEX stop"); | ||
// dsp.stop(); | ||
reshape.stop(); | ||
dataHandler.stop(); | ||
diagHandler.stop(); | ||
} | ||
|
||
private: | ||
static void _dataHandler(uint8_t* data, int count, void* ctx) { | ||
FLEXDecoder* _this = (FLEXDecoder*)ctx; | ||
// _this->decoder.process(data, count); | ||
} | ||
|
||
static void _diagHandler(float* data, int count, void* ctx) { | ||
FLEXDecoder* _this = (FLEXDecoder*)ctx; | ||
float* buf = _this->diag.acquireBuffer(); | ||
memcpy(buf, data, count * sizeof(float)); | ||
_this->diag.releaseBuffer(); | ||
} | ||
|
||
std::string name; | ||
|
||
VFOManager::VFO* vfo; | ||
dsp::buffer::Reshaper<float> reshape; | ||
dsp::sink::Handler<uint8_t> dataHandler; | ||
dsp::sink::Handler<float> diagHandler; | ||
|
||
flex::Decoder decoder; | ||
|
||
ImGui::SymbolDiagram diag; | ||
|
||
int brId = 0; | ||
|
||
OptionList<int, int> baudrates; | ||
}; |
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,5 @@ | ||
#include "flex.h" | ||
|
||
namespace flex { | ||
// TODO | ||
} |
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,11 @@ | ||
#pragma once | ||
|
||
namespace flex { | ||
class Decoder { | ||
public: | ||
// TODO | ||
|
||
private: | ||
// TODO | ||
}; | ||
} |
Oops, something went wrong.