mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-02-09 07:38:43 +01:00
Fixed SDRplay AGC and added hardware donators to the credits
This commit is contained in:
parent
28d056b776
commit
f3e987fb7e
@ -35,6 +35,17 @@ namespace sdrpp_credits {
|
|||||||
"Portable File Dialogs"
|
"Portable File Dialogs"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const char* hardwareDonators[] = {
|
||||||
|
"Airspy",
|
||||||
|
"Analog Devices",
|
||||||
|
"Howard Su",
|
||||||
|
"MyriadRF",
|
||||||
|
"Nuand",
|
||||||
|
"RFspace",
|
||||||
|
"RTL-SDRblog",
|
||||||
|
"SDRplay"
|
||||||
|
};
|
||||||
|
|
||||||
const char* patrons[] = {
|
const char* patrons[] = {
|
||||||
"Bob Logan",
|
"Bob Logan",
|
||||||
"Christian Häusler",
|
"Christian Häusler",
|
||||||
@ -58,5 +69,6 @@ namespace sdrpp_credits {
|
|||||||
|
|
||||||
const int contributorCount = sizeof(contributors) / sizeof(char*);
|
const int contributorCount = sizeof(contributors) / sizeof(char*);
|
||||||
const int libraryCount = sizeof(libraries) / sizeof(char*);
|
const int libraryCount = sizeof(libraries) / sizeof(char*);
|
||||||
|
const int hardwareDonatorCount = sizeof(hardwareDonators) / sizeof(char*);
|
||||||
const int patronCount = sizeof(patrons) / sizeof(char*);
|
const int patronCount = sizeof(patrons) / sizeof(char*);
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,10 @@
|
|||||||
namespace sdrpp_credits {
|
namespace sdrpp_credits {
|
||||||
SDRPP_EXPORT const char* contributors[];
|
SDRPP_EXPORT const char* contributors[];
|
||||||
SDRPP_EXPORT const char* libraries[];
|
SDRPP_EXPORT const char* libraries[];
|
||||||
|
SDRPP_EXPORT const char* hardwareDonators[];
|
||||||
SDRPP_EXPORT const char* patrons[];
|
SDRPP_EXPORT const char* patrons[];
|
||||||
SDRPP_EXPORT const int contributorCount;
|
SDRPP_EXPORT const int contributorCount;
|
||||||
SDRPP_EXPORT const int libraryCount;
|
SDRPP_EXPORT const int libraryCount;
|
||||||
|
SDRPP_EXPORT const int hardwareDonatorCount;
|
||||||
SDRPP_EXPORT const int patronCount;
|
SDRPP_EXPORT const int patronCount;
|
||||||
}
|
}
|
@ -33,7 +33,7 @@ namespace credits {
|
|||||||
|
|
||||||
ImGui::Text("This software is brought to you by Alexandre Rouma with the help of\n\n");
|
ImGui::Text("This software is brought to you by Alexandre Rouma with the help of\n\n");
|
||||||
|
|
||||||
ImGui::Columns(3, "CreditColumns", true);
|
ImGui::Columns(4, "CreditColumns", true);
|
||||||
|
|
||||||
ImGui::Text("Contributors");
|
ImGui::Text("Contributors");
|
||||||
for (int i = 0; i < sdrpp_credits::contributorCount; i++) {
|
for (int i = 0; i < sdrpp_credits::contributorCount; i++) {
|
||||||
@ -46,6 +46,12 @@ namespace credits {
|
|||||||
ImGui::BulletText("%s", sdrpp_credits::libraries[i]);
|
ImGui::BulletText("%s", sdrpp_credits::libraries[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImGui::NextColumn();
|
||||||
|
ImGui::Text("Hardware Donators");
|
||||||
|
for (int i = 0; i < sdrpp_credits::hardwareDonatorCount; i++) {
|
||||||
|
ImGui::BulletText("%s", sdrpp_credits::hardwareDonators[i]);
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
ImGui::Text("Patrons");
|
ImGui::Text("Patrons");
|
||||||
for (int i = 0; i < sdrpp_credits::patronCount; i++) {
|
for (int i = 0; i < sdrpp_credits::patronCount; i++) {
|
||||||
|
@ -95,13 +95,6 @@ const sdrplay_api_RspDx_AntennaSelectT rspdx_antennaPorts[] = {
|
|||||||
|
|
||||||
const char* rspdx_antennaPortsTxt = "Port A\0Port B\0Port C\0";
|
const char* rspdx_antennaPortsTxt = "Port A\0Port B\0Port C\0";
|
||||||
|
|
||||||
const sdrplay_api_AgcControlT agcModes[] = {
|
|
||||||
sdrplay_api_AGC_DISABLE,
|
|
||||||
sdrplay_api_AGC_5HZ,
|
|
||||||
sdrplay_api_AGC_50HZ,
|
|
||||||
sdrplay_api_AGC_100HZ
|
|
||||||
};
|
|
||||||
|
|
||||||
struct ifMode_t {
|
struct ifMode_t {
|
||||||
sdrplay_api_If_kHzT ifValue;
|
sdrplay_api_If_kHzT ifValue;
|
||||||
sdrplay_api_Bw_MHzT bw;
|
sdrplay_api_Bw_MHzT bw;
|
||||||
@ -130,8 +123,6 @@ const char* ifModeTxt =
|
|||||||
|
|
||||||
const char* rspduo_antennaPortsTxt = "Tuner 1 (50Ohm)\0Tuner 1 (Hi-Z)\0Tuner 2 (50Ohm)\0";
|
const char* rspduo_antennaPortsTxt = "Tuner 1 (50Ohm)\0Tuner 1 (Hi-Z)\0Tuner 2 (50Ohm)\0";
|
||||||
|
|
||||||
const char* agcModesTxt = "Off\0005Hz\00050Hz\000100Hz\000";
|
|
||||||
|
|
||||||
class SDRPlaySourceModule : public ModuleManager::Instance {
|
class SDRPlaySourceModule : public ModuleManager::Instance {
|
||||||
public:
|
public:
|
||||||
SDRPlaySourceModule(std::string name) {
|
SDRPlaySourceModule(std::string name) {
|
||||||
@ -327,7 +318,13 @@ public:
|
|||||||
config.conf["devices"][selectedName]["bwMode"] = 8; // Auto
|
config.conf["devices"][selectedName]["bwMode"] = 8; // Auto
|
||||||
config.conf["devices"][selectedName]["lnaGain"] = lnaSteps - 1;
|
config.conf["devices"][selectedName]["lnaGain"] = lnaSteps - 1;
|
||||||
config.conf["devices"][selectedName]["ifGain"] = 59;
|
config.conf["devices"][selectedName]["ifGain"] = 59;
|
||||||
config.conf["devices"][selectedName]["agc"] = 0; // Disabled
|
config.conf["devices"][selectedName]["agc"] = false;
|
||||||
|
|
||||||
|
config.conf["devices"][selectedName]["agcAttack"] = 500;
|
||||||
|
config.conf["devices"][selectedName]["agcDecay"] = 500;
|
||||||
|
config.conf["devices"][selectedName]["agcDecayDelay"] = 200;
|
||||||
|
config.conf["devices"][selectedName]["agcDecayThreshold"] = 5;
|
||||||
|
config.conf["devices"][selectedName]["agcSetPoint"] = -30;
|
||||||
|
|
||||||
config.conf["devices"][selectedName]["ifModeId"] = 0;
|
config.conf["devices"][selectedName]["ifModeId"] = 0;
|
||||||
|
|
||||||
@ -392,8 +389,28 @@ public:
|
|||||||
gain = config.conf["devices"][selectedName]["ifGain"];
|
gain = config.conf["devices"][selectedName]["ifGain"];
|
||||||
}
|
}
|
||||||
if (config.conf["devices"][selectedName].contains("agc")) {
|
if (config.conf["devices"][selectedName].contains("agc")) {
|
||||||
|
if (!config.conf["devices"][selectedName]["agc"].is_boolean()) {
|
||||||
|
int oldMode = config.conf["devices"][selectedName]["agc"];
|
||||||
|
config.conf["devices"][selectedName]["agc"] = (bool)(oldMode != 0);
|
||||||
|
created = true;
|
||||||
|
}
|
||||||
agc = config.conf["devices"][selectedName]["agc"];
|
agc = config.conf["devices"][selectedName]["agc"];
|
||||||
}
|
}
|
||||||
|
if (config.conf["devices"][selectedName].contains("agcAttack")) {
|
||||||
|
agcAttack = config.conf["devices"][selectedName]["agcAttack"];
|
||||||
|
}
|
||||||
|
if (config.conf["devices"][selectedName].contains("agcDecay")) {
|
||||||
|
agcDecay = config.conf["devices"][selectedName]["agcDecay"];
|
||||||
|
}
|
||||||
|
if (config.conf["devices"][selectedName].contains("agcDecayDelay")) {
|
||||||
|
agcDecayDelay = config.conf["devices"][selectedName]["agcDecayDelay"];
|
||||||
|
}
|
||||||
|
if (config.conf["devices"][selectedName].contains("agcDecayThreshold")) {
|
||||||
|
agcDecayThreshold = config.conf["devices"][selectedName]["agcDecayThreshold"];
|
||||||
|
}
|
||||||
|
if (config.conf["devices"][selectedName].contains("agcSetPoint")) {
|
||||||
|
agcSetPoint = config.conf["devices"][selectedName]["agcSetPoint"];
|
||||||
|
}
|
||||||
|
|
||||||
core::setInputSampleRate(sampleRate);
|
core::setInputSampleRate(sampleRate);
|
||||||
|
|
||||||
@ -621,12 +638,12 @@ private:
|
|||||||
_this->channelParams->tunerParams.loMode = sdrplay_api_LO_Auto;
|
_this->channelParams->tunerParams.loMode = sdrplay_api_LO_Auto;
|
||||||
|
|
||||||
// Hard coded AGC parameters
|
// Hard coded AGC parameters
|
||||||
_this->channelParams->ctrlParams.agc.attack_ms = 500;
|
_this->channelParams->ctrlParams.agc.attack_ms = _this->agcAttack;
|
||||||
_this->channelParams->ctrlParams.agc.decay_ms = 500;
|
_this->channelParams->ctrlParams.agc.decay_ms = _this->agcDecay;
|
||||||
_this->channelParams->ctrlParams.agc.decay_delay_ms = 200;
|
_this->channelParams->ctrlParams.agc.decay_delay_ms = _this->agcDecayDelay;
|
||||||
_this->channelParams->ctrlParams.agc.decay_threshold_dB = 5;
|
_this->channelParams->ctrlParams.agc.decay_threshold_dB = _this->agcDecayThreshold;
|
||||||
_this->channelParams->ctrlParams.agc.setPoint_dBfs = -30;
|
_this->channelParams->ctrlParams.agc.setPoint_dBfs = _this->agcSetPoint;
|
||||||
_this->channelParams->ctrlParams.agc.enable = agcModes[_this->agc];
|
_this->channelParams->ctrlParams.agc.enable = _this->agc ? sdrplay_api_AGC_CTRL_EN : sdrplay_api_AGC_DISABLE;
|
||||||
|
|
||||||
sdrplay_api_Update(_this->openDev.dev, _this->openDev.tuner, sdrplay_api_Update_Dev_Fs, sdrplay_api_Update_Ext1_None);
|
sdrplay_api_Update(_this->openDev.dev, _this->openDev.tuner, sdrplay_api_Update_Dev_Fs, sdrplay_api_Update_Ext1_None);
|
||||||
sdrplay_api_Update(_this->openDev.dev, _this->openDev.tuner, sdrplay_api_Update_Tuner_BwType, sdrplay_api_Update_Ext1_None);
|
sdrplay_api_Update(_this->openDev.dev, _this->openDev.tuner, sdrplay_api_Update_Tuner_BwType, sdrplay_api_Update_Ext1_None);
|
||||||
@ -771,13 +788,49 @@ private:
|
|||||||
ImGui::PopItemWidth();
|
ImGui::PopItemWidth();
|
||||||
if (_this->agc > 0) { style::endDisabled(); }
|
if (_this->agc > 0) { style::endDisabled(); }
|
||||||
|
|
||||||
ImGui::LeftLabel("AGC");
|
|
||||||
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
|
if (_this->agcParamEdit) {
|
||||||
if (ImGui::Combo(CONCAT("##sdrplay_agc", _this->name), &_this->agc, agcModesTxt)) {
|
bool valid = false;
|
||||||
if (_this->running) {
|
_this->agcParamEdit = _this->agcParamMenu(valid);
|
||||||
_this->channelParams->ctrlParams.agc.enable = agcModes[_this->agc];
|
|
||||||
|
// If the menu was closed and (TODO) valid, update options
|
||||||
|
if (!_this->agcParamEdit && valid) {
|
||||||
|
_this->agcAttack = _this->_agcAttack;
|
||||||
|
_this->agcDecay = _this->_agcDecay;
|
||||||
|
_this->agcDecayDelay = _this->_agcDecayDelay;
|
||||||
|
_this->agcDecayThreshold = _this->_agcDecayThreshold;
|
||||||
|
_this->agcSetPoint = _this->_agcSetPoint;
|
||||||
|
if (_this->running && _this->agc) {
|
||||||
|
_this->channelParams->ctrlParams.agc.attack_ms = _this->agcAttack;
|
||||||
|
_this->channelParams->ctrlParams.agc.decay_ms = _this->agcDecay;
|
||||||
|
_this->channelParams->ctrlParams.agc.decay_delay_ms = _this->agcDecayDelay;
|
||||||
|
_this->channelParams->ctrlParams.agc.decay_threshold_dB = _this->agcDecayThreshold;
|
||||||
|
_this->channelParams->ctrlParams.agc.setPoint_dBfs = _this->agcSetPoint;
|
||||||
|
sdrplay_api_Update(_this->openDev.dev, _this->openDev.tuner, sdrplay_api_Update_Ctrl_Agc, sdrplay_api_Update_Ext1_None);
|
||||||
|
}
|
||||||
|
config.acquire();
|
||||||
|
config.conf["devices"][_this->selectedName]["agcAttack"] = _this->agcAttack;
|
||||||
|
config.conf["devices"][_this->selectedName]["agcDecay"] = _this->agcDecay;
|
||||||
|
config.conf["devices"][_this->selectedName]["agcDecayDelay"] = _this->agcDecayDelay;
|
||||||
|
config.conf["devices"][_this->selectedName]["agcDecayThreshold"] = _this->agcDecayThreshold;
|
||||||
|
config.conf["devices"][_this->selectedName]["agcSetPoint"] = _this->agcSetPoint;
|
||||||
|
config.release(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ImGui::Checkbox(CONCAT("IF AGC##sdrplay_agc", _this->name), &_this->agc)) {
|
||||||
|
if (_this->running) {
|
||||||
|
_this->channelParams->ctrlParams.agc.enable = _this->agc ? sdrplay_api_AGC_CTRL_EN : sdrplay_api_AGC_DISABLE;
|
||||||
|
if (_this->agc) {
|
||||||
|
_this->channelParams->ctrlParams.agc.attack_ms = _this->agcAttack;
|
||||||
|
_this->channelParams->ctrlParams.agc.decay_ms = _this->agcDecay;
|
||||||
|
_this->channelParams->ctrlParams.agc.decay_delay_ms = _this->agcDecayDelay;
|
||||||
|
_this->channelParams->ctrlParams.agc.decay_threshold_dB = _this->agcDecayThreshold;
|
||||||
|
_this->channelParams->ctrlParams.agc.setPoint_dBfs = _this->agcSetPoint;
|
||||||
|
sdrplay_api_Update(_this->openDev.dev, _this->openDev.tuner, sdrplay_api_Update_Ctrl_Agc, sdrplay_api_Update_Ext1_None);
|
||||||
|
}
|
||||||
|
else {
|
||||||
sdrplay_api_Update(_this->openDev.dev, _this->openDev.tuner, sdrplay_api_Update_Ctrl_Agc, sdrplay_api_Update_Ext1_None);
|
sdrplay_api_Update(_this->openDev.dev, _this->openDev.tuner, sdrplay_api_Update_Ctrl_Agc, sdrplay_api_Update_Ext1_None);
|
||||||
if (_this->agc == 0) {
|
|
||||||
_this->channelParams->tunerParams.gain.gRdB = _this->gain;
|
_this->channelParams->tunerParams.gain.gRdB = _this->gain;
|
||||||
sdrplay_api_Update(_this->openDev.dev, _this->openDev.tuner, sdrplay_api_Update_Tuner_Gr, sdrplay_api_Update_Ext1_None);
|
sdrplay_api_Update(_this->openDev.dev, _this->openDev.tuner, sdrplay_api_Update_Tuner_Gr, sdrplay_api_Update_Ext1_None);
|
||||||
}
|
}
|
||||||
@ -786,7 +839,15 @@ private:
|
|||||||
config.conf["devices"][_this->selectedName]["agc"] = _this->agc;
|
config.conf["devices"][_this->selectedName]["agc"] = _this->agc;
|
||||||
config.release(true);
|
config.release(true);
|
||||||
}
|
}
|
||||||
|
ImGui::SameLine();
|
||||||
|
if (ImGui::Button(CONCAT("Parameters##sdrplay_agc_edit_btn", _this->name), ImVec2(menuWidth - ImGui::GetCursorPosX(), 0))) {
|
||||||
|
_this->agcParamEdit = true;
|
||||||
|
_this->_agcAttack = _this->agcAttack;
|
||||||
|
_this->_agcDecay = _this->agcDecay;
|
||||||
|
_this->_agcDecayDelay = _this->agcDecayDelay;
|
||||||
|
_this->_agcDecayThreshold = _this->agcDecayThreshold;
|
||||||
|
_this->_agcSetPoint = _this->agcSetPoint;
|
||||||
|
}
|
||||||
|
|
||||||
switch (_this->openDev.hwVer) {
|
switch (_this->openDev.hwVer) {
|
||||||
case SDRPLAY_RSP1_ID:
|
case SDRPLAY_RSP1_ID:
|
||||||
@ -814,6 +875,70 @@ private:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool agcParamMenu(bool& valid) {
|
||||||
|
bool open = true;
|
||||||
|
gui::mainWindow.lockWaterfallControls = true;
|
||||||
|
ImGui::OpenPopup("Edit##sdrplay_source_edit_agc_params_");
|
||||||
|
if (ImGui::BeginPopup("Edit##sdrplay_source_edit_agc_params_", ImGuiWindowFlags_NoResize)) {
|
||||||
|
|
||||||
|
ImGui::BeginTable(("sdrplay_source_agc_param_tbl"+name).c_str(), 2);
|
||||||
|
|
||||||
|
ImGui::TableNextRow();
|
||||||
|
ImGui::TableSetColumnIndex(0);
|
||||||
|
ImGui::LeftLabel("Attack");
|
||||||
|
ImGui::TableSetColumnIndex(1);
|
||||||
|
ImGui::SetNextItemWidth(100);
|
||||||
|
ImGui::InputInt("ms##sdrplay_source_agc_attack", &_agcAttack);
|
||||||
|
_agcAttack = std::clamp<int>(_agcAttack, 0, 65535);
|
||||||
|
|
||||||
|
ImGui::TableNextRow();
|
||||||
|
ImGui::TableSetColumnIndex(0);
|
||||||
|
ImGui::LeftLabel("Decay");
|
||||||
|
ImGui::TableSetColumnIndex(1);
|
||||||
|
ImGui::SetNextItemWidth(100);
|
||||||
|
ImGui::InputInt("ms##sdrplay_source_agc_decay", &_agcDecay);
|
||||||
|
_agcDecay = std::clamp<int>(_agcDecay, 0, 65535);
|
||||||
|
|
||||||
|
ImGui::TableNextRow();
|
||||||
|
ImGui::TableSetColumnIndex(0);
|
||||||
|
ImGui::LeftLabel("Decay Delay");
|
||||||
|
ImGui::TableSetColumnIndex(1);
|
||||||
|
ImGui::SetNextItemWidth(100);
|
||||||
|
ImGui::InputInt("ms##sdrplay_source_agc_decay_delay", &_agcDecayDelay);
|
||||||
|
_agcDecayDelay = std::clamp<int>(_agcDecayDelay, 0, 65535);
|
||||||
|
|
||||||
|
ImGui::TableNextRow();
|
||||||
|
ImGui::TableSetColumnIndex(0);
|
||||||
|
ImGui::LeftLabel("Decay Threshold");
|
||||||
|
ImGui::TableSetColumnIndex(1);
|
||||||
|
ImGui::SetNextItemWidth(100);
|
||||||
|
ImGui::InputInt("dB##sdrplay_source_agc_decay_thresh", &_agcDecayThreshold);
|
||||||
|
_agcDecayThreshold = std::clamp<int>(_agcDecayThreshold, 0, 100);
|
||||||
|
|
||||||
|
ImGui::TableNextRow();
|
||||||
|
ImGui::TableSetColumnIndex(0);
|
||||||
|
ImGui::LeftLabel("Setpoint");
|
||||||
|
ImGui::TableSetColumnIndex(1);
|
||||||
|
ImGui::SetNextItemWidth(100);
|
||||||
|
ImGui::InputInt("dBFS##sdrplay_source_agc_setpoint", &_agcSetPoint);
|
||||||
|
_agcSetPoint = std::clamp<int>(_agcSetPoint, -60, -20);
|
||||||
|
|
||||||
|
ImGui::EndTable();
|
||||||
|
|
||||||
|
if (ImGui::Button("Apply")) {
|
||||||
|
open = false;
|
||||||
|
valid = true;
|
||||||
|
}
|
||||||
|
ImGui::SameLine();
|
||||||
|
if (ImGui::Button("Cancel")) {
|
||||||
|
open = false;
|
||||||
|
valid = false;
|
||||||
|
}
|
||||||
|
ImGui::EndPopup();
|
||||||
|
}
|
||||||
|
return open;
|
||||||
|
}
|
||||||
|
|
||||||
void RSP1Menu(float menuWidth) {
|
void RSP1Menu(float menuWidth) {
|
||||||
// No options?
|
// No options?
|
||||||
}
|
}
|
||||||
@ -1024,7 +1149,21 @@ private:
|
|||||||
int lnaGain = 9;
|
int lnaGain = 9;
|
||||||
int gain = 59;
|
int gain = 59;
|
||||||
int lnaSteps = 9;
|
int lnaSteps = 9;
|
||||||
int agc = 0;
|
|
||||||
|
bool agc = false;
|
||||||
|
bool agcParamEdit = false;
|
||||||
|
int agcAttack = 500;
|
||||||
|
int agcDecay = 500;
|
||||||
|
int agcDecayDelay = 200;
|
||||||
|
int agcDecayThreshold = 5;
|
||||||
|
int agcSetPoint = -30;
|
||||||
|
|
||||||
|
// Temporary values for the edit window
|
||||||
|
int _agcAttack = 500;
|
||||||
|
int _agcDecay = 500;
|
||||||
|
int _agcDecayDelay = 200;
|
||||||
|
int _agcDecayThreshold = 5;
|
||||||
|
int _agcSetPoint = -30;
|
||||||
|
|
||||||
int bufferSize = 0;
|
int bufferSize = 0;
|
||||||
int bufferIndex = 0;
|
int bufferIndex = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user