mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2026-06-02 06:04:39 -04:00
Save sample rate, gain levels and AGC state per-device, add sample rate to device dialog
This commit is contained in:
@@ -36,6 +36,7 @@ GainCanvas::GainCanvas(wxWindow *parent, int *dispAttrs) :
|
||||
barWidth = (1.0/numGains)*0.8;
|
||||
startPos = spacing/2.0;
|
||||
barHeight = 0.8;
|
||||
refreshCounter = 0;
|
||||
}
|
||||
|
||||
GainCanvas::~GainCanvas() {
|
||||
@@ -186,8 +187,9 @@ void GainCanvas::updateGainUI() {
|
||||
const wxSize ClientSize = GetClientSize();
|
||||
|
||||
SDRDeviceInfo *devInfo = wxGetApp().getDevice();
|
||||
DeviceConfig *devConfig = wxGetApp().getConfig()->getDevice(devInfo->getDeviceId());
|
||||
|
||||
SDRRangeMap gains = devInfo->getGains(SOAPY_SDR_RX, 0);
|
||||
gains = devInfo->getGains(SOAPY_SDR_RX, 0);
|
||||
SDRRangeMap::iterator gi;
|
||||
|
||||
numGains = gains.size();
|
||||
@@ -223,7 +225,8 @@ void GainCanvas::updateGainUI() {
|
||||
gInfo->name = gi->first;
|
||||
gInfo->low = gi->second.minimum();
|
||||
gInfo->high = gi->second.maximum();
|
||||
gInfo->current = wxGetApp().getGain(gInfo->name);
|
||||
gInfo->current = devConfig->getGain(gInfo->name,wxGetApp().getGain(gInfo->name));
|
||||
gInfo->changed = false;
|
||||
|
||||
gInfo->panel.setBorderPx(1);
|
||||
gInfo->panel.setFill(GLPanel::GLPANEL_FILL_GRAD_BAR_X);
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "MouseTracker.h"
|
||||
#include "GLPanel.h"
|
||||
#include "PrimaryGLContext.h"
|
||||
|
||||
#include "SDRDeviceInfo.h"
|
||||
#include "Timer.h"
|
||||
|
||||
class GainInfo {
|
||||
@@ -53,8 +53,10 @@ private:
|
||||
std::string helpTip;
|
||||
std::vector<GainInfo *> gainInfo;
|
||||
GLPanel bgPanel;
|
||||
SDRRangeMap gains;
|
||||
|
||||
float spacing, barWidth, startPos, barHeight, numGains;
|
||||
int refreshCounter;
|
||||
wxSize clientSize;
|
||||
//
|
||||
wxDECLARE_EVENT_TABLE();
|
||||
|
||||
Reference in New Issue
Block a user