Added ability to select ADC1 or ADC2 from the floating rcvr widget.
This commit is contained in:
@@ -59,6 +59,8 @@
|
||||
*/
|
||||
|
||||
static int firstTimeRxInit;
|
||||
static quint8 adc_rx1_4, adc_rx5_8, adc_rx9_16;
|
||||
static quint8 new_adc_rx1_4, new_adc_rx5_8, new_adc_rx9_16;
|
||||
|
||||
DataEngine::DataEngine(QObject *parent)
|
||||
: QObject(parent)
|
||||
@@ -532,7 +534,6 @@ bool DataEngine::getFirmwareVersions() {
|
||||
|
||||
if (!initReceivers(rcvrs)) return false;
|
||||
|
||||
|
||||
if (!m_dataIO) createDataIO();
|
||||
|
||||
if (!m_dataProcessor) createDataProcessor();
|
||||
@@ -3358,7 +3359,7 @@ void DataProcessor::encodeCCBytes() {
|
||||
|
||||
if (de->io.tx_freq_change >= 0) {
|
||||
|
||||
de->io.output_buffer[4] = de->RX.at(de->io.tx_freq_change)->getCtrFrequency() >> 24;
|
||||
de->io.output_buffer[4] = de->RX.at(de->io.tx_freq_change)->getCtrFrequency() >> 24;
|
||||
de->io.output_buffer[5] = de->RX.at(de->io.tx_freq_change)->getCtrFrequency() >> 16;
|
||||
de->io.output_buffer[6] = de->RX.at(de->io.tx_freq_change)->getCtrFrequency() >> 8;
|
||||
de->io.output_buffer[7] = de->RX.at(de->io.tx_freq_change)->getCtrFrequency();
|
||||
@@ -3380,13 +3381,13 @@ void DataProcessor::encodeCCBytes() {
|
||||
// C0 = 0 0 0 1 0 0 0 x C1, C2, C3, C4 NCO Frequency in Hz for Receiver _7
|
||||
// C0 = 0 0 1 0 0 1 0 x C1, C2, C3, C4 NCO Frequency in Hz for Receiver _8 // Was 0 0 0 1 0 0 1 x
|
||||
// C0 = 0 0 1 1 0 1 0 x C1, C2, C3, C4 NCO Frequency in Hz for Receiver _16
|
||||
// C0 = 0 0 1 1 0 1 0 x C1, C2, C3, C4 NCO Frequency in Hz for Receiver _16
|
||||
// C0 = 0 1 0 1 0 1 0 x C1, C2, C3, C4 NCO Frequency in Hz for Receiver _32
|
||||
|
||||
// RRK, workaround for gige timing bug, make sure all rx freq's are sent on init.
|
||||
if (firstTimeRxInit) {
|
||||
firstTimeRxInit -= 1;
|
||||
de->io.rx_freq_change = firstTimeRxInit;
|
||||
}
|
||||
// RRK, workaround for gige timing bug, make sure all rx freq's are sent on init.
|
||||
if (firstTimeRxInit) {
|
||||
firstTimeRxInit -= 1;
|
||||
de->io.rx_freq_change = firstTimeRxInit;
|
||||
}
|
||||
|
||||
if (de->io.rx_freq_change >= 0) {
|
||||
|
||||
@@ -3526,9 +3527,42 @@ void DataProcessor::encodeCCBytes() {
|
||||
for (int i = 0; i < 5; i++)
|
||||
de->io.output_buffer[i+3] = de->io.control_out[i];
|
||||
|
||||
// check if we need to update ADC C&C's
|
||||
new_adc_rx1_4 = new_adc_rx5_8 = new_adc_rx9_16 = 0;
|
||||
for (int i = 0; i < set->getNumberOfReceivers(); i++) {
|
||||
if (i < 4) new_adc_rx1_4 |= de->RX.at(i)->getADCMode() << (i * 2);
|
||||
else if (i < 8) new_adc_rx5_8 |= de->RX.at(i)->getADCMode() << ((i-4) * 2);
|
||||
else if (i < 16) new_adc_rx9_16 |= de->RX.at(i)->getADCMode() << (i-8);
|
||||
}
|
||||
|
||||
if ((new_adc_rx1_4 != adc_rx1_4) || (new_adc_rx5_8 != adc_rx5_8) || (new_adc_rx9_16 != adc_rx9_16))
|
||||
m_sendState = 4;
|
||||
else
|
||||
m_sendState = 0;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
// setup data for ADC c&c's
|
||||
adc_rx1_4 = new_adc_rx1_4;
|
||||
adc_rx5_8 = new_adc_rx5_8;
|
||||
adc_rx9_16 = new_adc_rx9_16;
|
||||
|
||||
de->io.control_out[0] = 0x1C; // 0 0 0 1 1 1 0 x
|
||||
de->io.control_out[1] = adc_rx1_4; // C1
|
||||
de->io.control_out[2] = adc_rx5_8; // C2
|
||||
de->io.control_out[3] = 0x0; // C3, ADC Input Attenuator Tx (0-31dB) [4:0]
|
||||
de->io.control_out[4] = adc_rx9_16; // C4
|
||||
|
||||
// fill the out buffer with the C&C bytes
|
||||
for (int i = 0; i < 5; i++)
|
||||
de->io.output_buffer[i+3] = de->io.control_out[i];
|
||||
|
||||
//DATA_PROCESSOR_DEBUG << "rx_adc_change rcvr: " << hex << new_adc_rx1_4 << "," << hex << new_adc_rx5_8 << "," << hex << new_adc_rx9_16;
|
||||
|
||||
// round finished
|
||||
m_sendState = 0;
|
||||
break;
|
||||
|
||||
}
|
||||
de->io.mutex.unlock();
|
||||
|
||||
|
||||
@@ -119,6 +119,12 @@ void Receiver::setupConnections() {
|
||||
this,
|
||||
SLOT(setHamBand(QObject *, int, bool, HamBand)));
|
||||
|
||||
CHECKED_CONNECT(
|
||||
set,
|
||||
SIGNAL(adcModeChanged(QObject *, int, ADCMode)),
|
||||
this,
|
||||
SLOT(setADCMode(QObject *, int, ADCMode)));
|
||||
|
||||
CHECKED_CONNECT(
|
||||
set,
|
||||
SIGNAL(agcModeChanged(QObject *, int, AGCMode, bool)),
|
||||
@@ -220,6 +226,7 @@ void Receiver::setReceiverData(TReceiver data) {
|
||||
m_hamBand = m_receiverData.hamBand;
|
||||
m_dspMode = m_receiverData.dspMode;
|
||||
m_dspModeList = m_receiverData.dspModeList;
|
||||
m_adcMode = m_receiverData.adcMode;
|
||||
m_agcMode = m_receiverData.agcMode;
|
||||
m_agcGain = m_receiverData.acgGain;
|
||||
m_agcFixedGain_dB = m_receiverData.agcFixedGain_dB;
|
||||
@@ -478,6 +485,18 @@ void Receiver::setDspMode(QObject *sender, int rx, DSPMode mode) {
|
||||
//emit messageEvent(msg.arg(rx).arg(set->getDSPModeString(m_dspMode)));
|
||||
}
|
||||
|
||||
void Receiver::setADCMode(QObject *sender, int rx, ADCMode mode) {
|
||||
|
||||
Q_UNUSED(sender)
|
||||
|
||||
if (m_receiver != rx) return;
|
||||
if (m_adcMode == mode) return;
|
||||
|
||||
m_adcMode = mode;
|
||||
|
||||
//RECEIVER_DEBUG << "RRK setADCMode = " << m_adcMode;
|
||||
}
|
||||
|
||||
void Receiver::setAGCMode(QObject *sender, int rx, AGCMode mode, bool hang) {
|
||||
|
||||
Q_UNUSED(sender)
|
||||
|
||||
@@ -62,6 +62,7 @@ public:
|
||||
QSDR::_DSPCore getDSPCoreMode() const;
|
||||
QHostAddress getPeerAddress() { return m_peerAddress; }
|
||||
HamBand getHamBand() { return m_hamBand; }
|
||||
ADCMode getADCMode() { return m_adcMode; }
|
||||
AGCMode getAGCMode() { return m_agcMode; }
|
||||
QList<int> getMercuryAttenuators() { return m_mercuryAttenuators; }
|
||||
QList<DSPMode> getDSPModeList() { return m_dspModeList; }
|
||||
@@ -116,6 +117,7 @@ public slots:
|
||||
void setSampleRate(int value);
|
||||
void setHamBand(QObject* sender, int rx, bool byBtn, HamBand band);
|
||||
void setDspMode(QObject* sender, int rx, DSPMode mode);
|
||||
void setADCMode(QObject* sender, int rx, ADCMode mode);
|
||||
void setAGCMode(QObject* sender, int rx, AGCMode mode, bool hang);
|
||||
void setAGCGain(QObject* sender, int rx, int value);
|
||||
void setAudioVolume(QObject* sender, int rx, float value);
|
||||
@@ -171,6 +173,7 @@ private:
|
||||
HamBand m_hamBand;
|
||||
DSPMode m_dspMode;
|
||||
AGCMode m_agcMode;
|
||||
ADCMode m_adcMode;
|
||||
TDefaultFilterMode m_filterMode;
|
||||
|
||||
QList<long> m_lastCtrFrequencyList;
|
||||
|
||||
@@ -163,6 +163,9 @@ QGLReceiverPanel::QGLReceiverPanel(QWidget *parent, int rx)
|
||||
|
||||
m_mouseWheelFreqStep = m_rxDataList.at(m_receiver).mouseWheelFreqStep;
|
||||
|
||||
m_adcMode = m_rxDataList.at(m_receiver).adcMode;
|
||||
m_adcModeString = set->getADCModeString(m_receiver);
|
||||
|
||||
m_agcMode = m_rxDataList.at(m_receiver).agcMode;
|
||||
m_agcModeString = set->getAGCModeString(m_receiver);
|
||||
m_agcFixedGain = m_rxDataList.at(m_receiver).agcFixedGain_dB;
|
||||
@@ -545,6 +548,12 @@ void QGLReceiverPanel::setupConnections() {
|
||||
this,
|
||||
SLOT(setAGCLinesStatus(QObject *, bool, int)));
|
||||
|
||||
CHECKED_CONNECT(
|
||||
set,
|
||||
SIGNAL(adcModeChanged(QObject *, int, ADCMode)),
|
||||
this,
|
||||
SLOT(setADCMode(QObject *, int, ADCMode)));
|
||||
|
||||
CHECKED_CONNECT(
|
||||
set,
|
||||
SIGNAL(dspModeChanged(QObject *, int, DSPMode)),
|
||||
@@ -1976,6 +1985,7 @@ void QGLReceiverPanel::drawReceiverInfo() {
|
||||
|
||||
int alpha;
|
||||
QColor colFlt;
|
||||
QColor colADC;
|
||||
QColor colAGC;
|
||||
QColor colDSP;
|
||||
QRect rect;
|
||||
@@ -1986,6 +1996,7 @@ void QGLReceiverPanel::drawReceiverInfo() {
|
||||
|
||||
colDSP = QColor(1, 190, 180, 180);
|
||||
colFlt = QColor(200, 190, 50, 180);
|
||||
colADC = QColor(215, 130, 50, 180);
|
||||
if (m_showAGCLines)
|
||||
colAGC = QColor(255, 170, 90, 180);
|
||||
else
|
||||
@@ -1999,12 +2010,14 @@ void QGLReceiverPanel::drawReceiverInfo() {
|
||||
colFlt = QColor(110, 100, 1, 180);
|
||||
colDSP = QColor(1, 100, 90, 180);
|
||||
colAGC = QColor(165, 80, 1);
|
||||
colADC = QColor(165, 80, 1);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
alpha = 100;
|
||||
colFlt = m_darkColor;
|
||||
colADC = m_darkColor;
|
||||
colAGC = m_darkColor;
|
||||
colDSP = m_darkColor;
|
||||
}
|
||||
@@ -2044,6 +2057,17 @@ void QGLReceiverPanel::drawReceiverInfo() {
|
||||
qglColor(QColor(0, 0, 0));
|
||||
m_oglTextSmall->renderText(x1+1, y1-2, 3.0f, str);
|
||||
|
||||
// ADC mode
|
||||
x1 += m_fonts.smallFontMetrics->width(str) + 4;
|
||||
|
||||
str = "%1";
|
||||
str = str.arg(m_adcModeString);
|
||||
|
||||
rect = QRect(x1, y1, m_fonts.smallFontMetrics->width(str) + 4, m_fonts.fontHeightSmallFont + 2);
|
||||
drawGLRect(rect, colADC, 2.0f);
|
||||
qglColor(QColor(0, 0, 0));
|
||||
m_oglTextSmall->renderText(x1+1, y1-2, 3.0f, str);
|
||||
|
||||
// VFO frequency
|
||||
TFrequency f;
|
||||
f.freqMHz = (int)(m_vfoFrequency / 1000);
|
||||
@@ -4474,6 +4498,18 @@ void QGLReceiverPanel::setAGCLineFixedLevel(QObject *sender, int rx, qreal value
|
||||
//GRAPHICS_DEBUG << "m_agcFixedGain = " << m_agcFixedGain;
|
||||
}
|
||||
|
||||
void QGLReceiverPanel::setADCMode(QObject *sender, int rx, ADCMode mode) {
|
||||
|
||||
Q_UNUSED(sender)
|
||||
|
||||
if (m_receiver != rx) return;
|
||||
|
||||
m_adcMode = mode;
|
||||
m_adcModeString = set->getADCModeString(m_receiver);
|
||||
|
||||
update();
|
||||
}
|
||||
|
||||
void QGLReceiverPanel::setAGCMode(QObject *sender, int rx, AGCMode mode, bool hangEnabled) {
|
||||
|
||||
Q_UNUSED(sender)
|
||||
|
||||
@@ -91,6 +91,7 @@ private:
|
||||
|
||||
DualModeAverager* averager;
|
||||
RadioPopupWidget* radioPopup;
|
||||
ADCMode m_adcMode;
|
||||
AGCMode m_agcMode;
|
||||
DSPMode m_dspMode;
|
||||
PanGraphicsMode m_panMode;
|
||||
@@ -102,6 +103,7 @@ private:
|
||||
QTime peakHoldTimer;
|
||||
|
||||
QString m_bandText;
|
||||
QString m_adcModeString;
|
||||
QString m_agcModeString;
|
||||
QString m_dspModeString;
|
||||
QString m_filterWidthString;
|
||||
@@ -416,6 +418,7 @@ private slots:
|
||||
void updateADCStatus();
|
||||
void setFramesPerSecond(QObject* sender, int rx, int value);
|
||||
void setDSPMode(QObject* sender, int rx, DSPMode mode);
|
||||
void setADCMode(QObject* sender, int rx, ADCMode mode);
|
||||
void setAGCMode(QObject* sender, int rx, AGCMode mode, bool hangEnabled);
|
||||
void setAGCLineLevels(QObject* sender, int rx, qreal thresh, qreal hang);
|
||||
void setAGCLineFixedLevel(QObject* sender, int rx, qreal value);
|
||||
|
||||
@@ -22,4 +22,4 @@
|
||||
* License along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
*/
|
||||
|
||||
@@ -85,6 +85,13 @@ typedef enum _dspMode {
|
||||
|
||||
} DSPMode;
|
||||
|
||||
typedef enum _adcMode {
|
||||
|
||||
adc1,
|
||||
adc2
|
||||
|
||||
} ADCMode;
|
||||
|
||||
typedef enum _agcMode {
|
||||
|
||||
agcOFF,
|
||||
@@ -115,6 +122,7 @@ typedef enum _defaultFilterMode {
|
||||
|
||||
Q_DECLARE_METATYPE (HamBand)
|
||||
Q_DECLARE_METATYPE (DSPMode)
|
||||
Q_DECLARE_METATYPE (ADCMode)
|
||||
Q_DECLARE_METATYPE (AGCMode)
|
||||
Q_DECLARE_METATYPE (TDefaultFilterMode)
|
||||
|
||||
|
||||
@@ -275,6 +275,12 @@ void MainWindow::setupConnections() {
|
||||
this,
|
||||
SLOT(setTxAllowed(QObject *, bool)));
|
||||
|
||||
CHECKED_CONNECT(
|
||||
set,
|
||||
SIGNAL(adcModeChanged(QObject *, int, ADCMode)),
|
||||
this,
|
||||
SLOT(setADCMode(QObject *, int, ADCMode)));
|
||||
|
||||
CHECKED_CONNECT(
|
||||
set,
|
||||
SIGNAL(agcModeChanged(QObject *, int, AGCMode, bool)),
|
||||
@@ -414,6 +420,7 @@ void MainWindow::setup() {
|
||||
setAttenuatorButton();
|
||||
|
||||
m_agcMode = set->getAGCMode(0);
|
||||
m_adcMode = set->getADCMode(0);
|
||||
|
||||
// initialize all Signal/Slot connections
|
||||
setupConnections();
|
||||
@@ -1784,6 +1791,14 @@ void MainWindow::setTxAllowed(QObject *sender, bool value) {
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::setADCMode(QObject *sender, int rx, ADCMode mode) {
|
||||
|
||||
Q_UNUSED(sender)
|
||||
Q_UNUSED(rx)
|
||||
|
||||
m_adcMode = mode;
|
||||
}
|
||||
|
||||
void MainWindow::setAGCMode(QObject *sender, int rx, AGCMode mode, bool hang) {
|
||||
|
||||
Q_UNUSED(sender)
|
||||
|
||||
@@ -200,6 +200,7 @@ private:
|
||||
|
||||
QSlider* m_volumeSlider;
|
||||
QSlider* m_agcGainSlider;
|
||||
ADCMode m_adcMode;
|
||||
AGCMode m_agcMode;
|
||||
|
||||
DataEngine* m_dataEngine;
|
||||
@@ -318,6 +319,7 @@ private slots:
|
||||
void getNetworkInterfaces();
|
||||
void setMainVolume(int value);
|
||||
//void setHamBand(QObject *sender, int rx, bool byButton, HamBand band);
|
||||
void setADCMode(QObject *sender, int rx, ADCMode mode);
|
||||
void setAGCMode(QObject *sender, int rx, AGCMode mode, bool hang);
|
||||
void setAGCGain(int value);
|
||||
//void setAGCGain(QObject *sender, int rx, int value);
|
||||
|
||||
@@ -84,6 +84,7 @@ RadioPopupWidget::RadioPopupWidget(QWidget *parent, int rx)
|
||||
m_hamBand = m_receiverDataList.at(m_receiver).hamBand;
|
||||
//m_dspMode = m_receiverDataList.at(m_receiver).dspMode;
|
||||
m_dspModeList = m_receiverDataList.at(m_receiver).dspModeList;
|
||||
m_adcMode = m_receiverDataList.at(m_receiver).adcMode;
|
||||
m_agcMode = m_receiverDataList.at(m_receiver).agcMode;
|
||||
m_filterMode = m_receiverDataList.at(m_receiver).defaultFilterMode;
|
||||
m_filterLo = m_receiverDataList.at(m_receiver).filterLo;
|
||||
@@ -119,6 +120,7 @@ RadioPopupWidget::RadioPopupWidget(QWidget *parent, int rx)
|
||||
createOptionsBtnGroup();
|
||||
createFFTOptionsGroup();
|
||||
createBandBtnGroup();
|
||||
createAdcBtnGroup();
|
||||
createModeBtnGroup();
|
||||
createAgcBtnGroup();
|
||||
createFilterBtnWidgetA();
|
||||
@@ -156,6 +158,8 @@ RadioPopupWidget::RadioPopupWidget(QWidget *parent, int rx)
|
||||
mainLayout->addSpacing(16);
|
||||
mainLayout->addLayout(bandVBox);
|
||||
mainLayout->addSpacing(8);
|
||||
mainLayout->addLayout(adcVBox);
|
||||
mainLayout->addSpacing(8);
|
||||
mainLayout->addLayout(modeVBox);
|
||||
mainLayout->addSpacing(8);
|
||||
mainLayout->addWidget(m_filterStackedWidget);
|
||||
@@ -170,6 +174,7 @@ RadioPopupWidget::RadioPopupWidget(QWidget *parent, int rx)
|
||||
bandBtnList.at(m_hamBand)->update();
|
||||
|
||||
dspModeChanged(this, 0, m_dspModeList.at(m_hamBand));
|
||||
adcModeChanged(this, m_receiver, m_adcMode);
|
||||
agcModeChanged(this, 0, m_agcMode, false);
|
||||
filterChanged(this, 0, m_filterLo, m_filterHi);
|
||||
|
||||
@@ -268,6 +273,12 @@ void RadioPopupWidget::setupConnections() {
|
||||
this,
|
||||
SLOT(dspModeChanged(QObject *, int, DSPMode)));
|
||||
|
||||
CHECKED_CONNECT(
|
||||
set,
|
||||
SIGNAL(adcModeChanged(QObject *, int, ADCMode)),
|
||||
this,
|
||||
SLOT(adcModeChanged(QObject *, int, ADCMode)));
|
||||
|
||||
CHECKED_CONNECT(
|
||||
set,
|
||||
SIGNAL(agcModeChanged(QObject *, int, AGCMode, bool)),
|
||||
@@ -739,6 +750,34 @@ void RadioPopupWidget::createBandBtnGroup() {
|
||||
|
||||
}
|
||||
|
||||
void RadioPopupWidget::createAdcBtnGroup() {
|
||||
adc1Btn = new AeroButton("ADC1", this);
|
||||
adcModeBtnList.append(adc1Btn);
|
||||
CHECKED_CONNECT(adc1Btn, SIGNAL(clicked()), this, SLOT(adcModeChangedByBtn()));
|
||||
|
||||
adc2Btn = new AeroButton("ADC2", this);
|
||||
adcModeBtnList.append(adc2Btn);
|
||||
CHECKED_CONNECT(adc2Btn, SIGNAL(clicked()), this, SLOT(adcModeChangedByBtn()));
|
||||
|
||||
foreach (AeroButton *btn, adcModeBtnList) {
|
||||
|
||||
btn->setRoundness(0);
|
||||
btn->setFixedHeight(btn_height);
|
||||
btn->setStyleSheet(set->getMiniButtonStyle());
|
||||
btn->update();
|
||||
}
|
||||
|
||||
QHBoxLayout *hbox1 = new QHBoxLayout();
|
||||
hbox1->setContentsMargins(0, 0, 0, 0);
|
||||
hbox1->setSpacing(0);
|
||||
hbox1->addWidget(adc1Btn);
|
||||
hbox1->addWidget(adc2Btn);
|
||||
|
||||
adcVBox = new QVBoxLayout;
|
||||
adcVBox->setSpacing(1);
|
||||
adcVBox->addLayout(hbox1);
|
||||
}
|
||||
|
||||
void RadioPopupWidget::createModeBtnGroup() {
|
||||
|
||||
lsbBtn = new AeroButton("LSB", this);
|
||||
@@ -2249,6 +2288,41 @@ void RadioPopupWidget::filterChanged(QObject *sender, int rx, qreal low, qreal h
|
||||
}
|
||||
}
|
||||
|
||||
void RadioPopupWidget::adcModeChangedByBtn() {
|
||||
|
||||
AeroButton *button = qobject_cast<AeroButton *>(sender());
|
||||
int btn = adcModeBtnList.indexOf(button);
|
||||
|
||||
foreach(AeroButton *btn, adcModeBtnList) {
|
||||
|
||||
btn->setBtnState(AeroButton::OFF);
|
||||
btn->update();
|
||||
}
|
||||
|
||||
set->setADCMode(this, m_receiver, (ADCMode) btn);
|
||||
m_adcMode = (ADCMode) btn;
|
||||
|
||||
button->setBtnState(AeroButton::ON);
|
||||
button->update();
|
||||
}
|
||||
|
||||
void RadioPopupWidget::adcModeChanged(QObject *sender, int rx, ADCMode mode) {
|
||||
|
||||
Q_UNUSED(sender)
|
||||
//RADIOPOPUP_DEBUG << "RadioPopupWidget::adcModeChanged rx: " << rx;
|
||||
if (m_receiver != rx) return;
|
||||
m_adcMode = mode;
|
||||
|
||||
foreach(AeroButton *btn, adcModeBtnList) {
|
||||
|
||||
btn->setBtnState(AeroButton::OFF);
|
||||
btn->update();
|
||||
}
|
||||
|
||||
adcModeBtnList.at(mode)->setBtnState(AeroButton::ON);
|
||||
adcModeBtnList.at(mode)->update();
|
||||
}
|
||||
|
||||
void RadioPopupWidget::agcModeChangedByBtn() {
|
||||
|
||||
AeroButton *button = qobject_cast<AeroButton *>(sender());
|
||||
|
||||
@@ -95,6 +95,7 @@ private:
|
||||
QVBoxLayout* optionsVBox;
|
||||
QVBoxLayout* fftOptionsVBox;
|
||||
QVBoxLayout* bandVBox;
|
||||
QVBoxLayout* adcVBox;
|
||||
QVBoxLayout* modeVBox;
|
||||
QVBoxLayout* agcVBox;
|
||||
//QVBoxLayout* mercuryBtnVBox();
|
||||
@@ -181,6 +182,11 @@ private:
|
||||
|
||||
QList<AeroButton *> dspModeBtnList;
|
||||
|
||||
AeroButton* adc1Btn;
|
||||
AeroButton* adc2Btn;
|
||||
|
||||
QList<AeroButton *> adcModeBtnList;
|
||||
|
||||
AeroButton* showAGCLines;
|
||||
AeroButton* agcOFF;
|
||||
AeroButton* agcLONG;
|
||||
@@ -240,6 +246,7 @@ private:
|
||||
|
||||
HamBand m_hamBand;
|
||||
//DSPMode m_dspMode;
|
||||
ADCMode m_adcMode;
|
||||
AGCMode m_agcMode;
|
||||
TDefaultFilterMode m_filterMode;
|
||||
|
||||
@@ -288,6 +295,7 @@ private slots:
|
||||
void createOptionsBtnGroup();
|
||||
void createFFTOptionsGroup();
|
||||
void createBandBtnGroup();
|
||||
void createAdcBtnGroup();
|
||||
void createModeBtnGroup();
|
||||
void createAgcBtnGroup();
|
||||
void createFilterBtnWidgetA();
|
||||
@@ -314,6 +322,8 @@ private slots:
|
||||
void bandChanged(QObject *sender, int rx, bool byButton, HamBand band);
|
||||
void dspModeChangedByBtn();
|
||||
void dspModeChanged(QObject *sender, int rx, DSPMode mode);
|
||||
void adcModeChangedByBtn();
|
||||
void adcModeChanged(QObject *sender, int rx, ADCMode mode);
|
||||
void agcModeChangedByBtn();
|
||||
void agcModeChanged(QObject *sender, int rx, AGCMode mode, bool hang);
|
||||
void agcShowLinesChanged();
|
||||
|
||||
@@ -112,6 +112,10 @@ private:
|
||||
AeroButton *samBtn;
|
||||
AeroButton *drmBtn;
|
||||
|
||||
QList<AeroButton *> adcModeBtnList;
|
||||
AeroButton *adc1Btn;
|
||||
AeroButton *adc2Btn;
|
||||
|
||||
AeroButton *filter1kBtnA;
|
||||
AeroButton *filter1k8BtnA;
|
||||
AeroButton *filter2k1BtnA;
|
||||
@@ -162,6 +166,7 @@ private:
|
||||
QList<DSPMode> m_dspModeList;
|
||||
HamBand m_hamBand;
|
||||
//DSPMode m_dspMode;
|
||||
ADCMode m_adcMode;
|
||||
AGCMode m_agcMode;
|
||||
TDefaultFilterMode m_filterMode;
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@ Settings::Settings(QObject *parent)
|
||||
qRegisterMetaType<QSDR::_HWInterfaceMode>();
|
||||
qRegisterMetaType<HamBand>();
|
||||
qRegisterMetaType<DSPMode>();
|
||||
qRegisterMetaType<ADCMode>();
|
||||
qRegisterMetaType<AGCMode>();
|
||||
qRegisterMetaType<TDefaultFilterMode>();
|
||||
qRegisterMetaType<TNetworkDevicecard>();
|
||||
@@ -813,6 +814,14 @@ int Settings::loadSettings() {
|
||||
else
|
||||
m_receiverDataList[i].hangEnabled = true;
|
||||
|
||||
cstr = m_rxStringList.at(i);
|
||||
cstr.append("/adcMode");
|
||||
str = settings->value(cstr, "ADC1").toString();
|
||||
if (str == "ADC1")
|
||||
m_receiverDataList[i].adcMode = adc1;
|
||||
else
|
||||
m_receiverDataList[i].adcMode = adc2;
|
||||
|
||||
cstr = m_rxStringList.at(i);
|
||||
cstr.append("/panMode");
|
||||
|
||||
@@ -1873,6 +1882,14 @@ int Settings::saveSettings() {
|
||||
else if (m_receiverDataList[i].agcMode == agcFAST)
|
||||
settings->setValue(str, "FAST");
|
||||
|
||||
str = m_rxStringList.at(i);
|
||||
str.append("/adcMode");
|
||||
|
||||
if (m_receiverDataList[i].adcMode == adc1)
|
||||
settings->setValue(str, "ADC1");
|
||||
else if (m_receiverDataList[i].adcMode == adc2)
|
||||
settings->setValue(str, "ADC2");
|
||||
|
||||
str = m_rxStringList.at(i);
|
||||
str.append("/panMode");
|
||||
|
||||
@@ -3627,6 +3644,23 @@ AGCMode Settings::getAGCMode(int rx) {
|
||||
return m_receiverDataList.at(rx).agcMode;
|
||||
}
|
||||
|
||||
ADCMode Settings::getADCMode(int rx) {
|
||||
|
||||
return m_receiverDataList.at(rx).adcMode;
|
||||
}
|
||||
|
||||
QString Settings::getADCModeString(int rx) {
|
||||
|
||||
ADCMode mode = getADCMode(rx);
|
||||
QString str;
|
||||
if (mode == adc1)
|
||||
str = "ADC1";
|
||||
else
|
||||
str = "ADC2";
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
QString Settings::getAGCModeString(int rx) {
|
||||
|
||||
AGCMode mode = getAGCMode(rx);
|
||||
@@ -3660,6 +3694,16 @@ QString Settings::getAGCModeString(int rx) {
|
||||
return str;
|
||||
}
|
||||
|
||||
void Settings::setADCMode(QObject *sender, int rx, ADCMode mode) {
|
||||
|
||||
QMutexLocker locker(&settingsMutex);
|
||||
|
||||
if (m_receiverDataList[rx].adcMode == mode) return;
|
||||
m_receiverDataList[rx].adcMode = mode;
|
||||
|
||||
emit adcModeChanged(sender, rx, mode);
|
||||
}
|
||||
|
||||
void Settings::setAGCMode(QObject *sender, int rx, AGCMode mode) {
|
||||
|
||||
QMutexLocker locker(&settingsMutex);
|
||||
|
||||
@@ -446,6 +446,7 @@ typedef struct _hpsdrParameter {
|
||||
//int hpsdr_122_88MhzSource;
|
||||
int mic_source;
|
||||
int rxClass;
|
||||
int rx_adc_change;
|
||||
int rx_freq_change;
|
||||
int tx_freq_change;
|
||||
|
||||
@@ -506,6 +507,7 @@ typedef struct _receiver {
|
||||
HamBand hamBand;
|
||||
HamBand lastHamBand;
|
||||
DSPMode dspMode;
|
||||
ADCMode adcMode;
|
||||
AGCMode agcMode;
|
||||
TDefaultFilterMode defaultFilterMode;
|
||||
PanGraphicsMode panMode;
|
||||
@@ -846,6 +848,7 @@ signals:
|
||||
|
||||
void hamBandChanged(QObject *sender, int rx, bool byButton, HamBand band);
|
||||
void dspModeChanged(QObject *sender, int rx, DSPMode mode);
|
||||
void adcModeChanged(QObject *sender, int rx, ADCMode mode);
|
||||
void agcModeChanged(QObject *sender, int rx, AGCMode mode, bool hangEnabled);
|
||||
void agcHangEnabledChanged(QObject *sender, int rx, bool hang);
|
||||
void agcGainChanged(QObject *sender, int rx, int value);
|
||||
@@ -1077,7 +1080,9 @@ public:
|
||||
|
||||
qreal getMainVolume(int rx);
|
||||
qreal getMouseWheelFreqStep(int rx);// { return m_mouseWheelFreqStep; }
|
||||
ADCMode getADCMode(int rx);
|
||||
AGCMode getAGCMode(int rx);
|
||||
QString getADCModeString(int rx);
|
||||
QString getAGCModeString(int rx);
|
||||
int getAGCGain(int rx);
|
||||
qreal getAGCMaximumGain_dB(int rx);
|
||||
@@ -1268,6 +1273,7 @@ public slots:
|
||||
|
||||
void setHamBand(QObject* sender, int rx, bool byButton, HamBand band);
|
||||
void setDSPMode(QObject* sender, int rx, DSPMode mode);
|
||||
void setADCMode(QObject* sender, int rx, ADCMode mode);
|
||||
void setAGCMode(QObject* sender, int rx, AGCMode mode);
|
||||
void setAGCGain(QObject* sender, int rx, int value);
|
||||
void setAGCMaximumGain_dB(QObject *sender, int rx, qreal value);
|
||||
|
||||
Reference in New Issue
Block a user