diff --git a/Source/src/DataEngine/cusdr_dataEngine.cpp b/Source/src/DataEngine/cusdr_dataEngine.cpp index 9f01da2..7520130 100644 --- a/Source/src/DataEngine/cusdr_dataEngine.cpp +++ b/Source/src/DataEngine/cusdr_dataEngine.cpp @@ -40,6 +40,7 @@ #include "cusdr_dataEngine.h" + /*! \class DataEngine \brief The DataEngine class implements the main SDR functionality. @@ -1699,7 +1700,6 @@ void DataEngine::stopDataProcessor() { if (io.iq_queue.isEmpty()) { io.iq_queue.enqueue(QByteArray(BUFFER_SIZE, 0x0)); - //io.iq_queue.enqueue(QByteArray(2*BUFFER_SIZE, 0x0)); } } else if (m_serverMode == QSDR::ChirpWSPRFile) { @@ -2834,6 +2834,14 @@ void DataProcessor::processInputBuffer(const QByteArray &buffer) { case 6: m_maxSamples = 512-10; break; case 7: m_maxSamples = 512-20; break; case 8: m_maxSamples = 512-4; break; + case 9: m_maxSamples = 512-0; break; + case 10: m_maxSamples = 512-8; break; + case 11: m_maxSamples = 512-28; break; + case 12: m_maxSamples = 512-60; break; + case 13: m_maxSamples = 512-24; break; + case 14: m_maxSamples = 512-74; break; + case 15: m_maxSamples = 512-44; break; + case 16: m_maxSamples = 512-14; break; } // extract the samples @@ -3296,7 +3304,9 @@ void DataProcessor::encodeCCBytes() { // | | | | | | | | // | | | | | | + + ----------- Alex Tx relay (00 = Tx1, 01= Tx2, 10 = Tx3) // | | | | | + --------------- Duplex (0 = off, 1 = on) - // | | + + +------------------ Number of Receivers (000 = 1, 111 = 8) + // + + + + +------------------ Number of Receivers (000 = 1, 11111 = 32) + + //RRK removed 4HL // | +------------------------ Time stamp - 1PPS on LSB of Mic data (0 = off, 1 = on) // +-------------------------- Common Mercury Frequency (0 = independent frequencies to Mercury // Boards, 1 = same frequency to all Mercury boards) @@ -3311,14 +3321,15 @@ void DataProcessor::encodeCCBytes() { de->io.control_out[4] &= 0xFB; // 1 1 1 1 1 0 1 1 de->io.control_out[4] |= de->io.ccTx.duplex << 2; - de->io.control_out[4] &= 0xC7; // 1 1 0 0 0 1 1 1 + de->io.control_out[4] &= 0x07; // 0 0 0 0 0 1 1 1 de->io.control_out[4] |= (de->io.receivers - 1) << 3; - de->io.control_out[4] &= 0xBF; // 1 0 1 1 1 1 1 1 - de->io.control_out[4] |= de->io.ccTx.timeStamp << 6; + //RRK removed 4HL + //de->io.control_out[4] &= 0xBF; // 1 0 1 1 1 1 1 1 + //de->io.control_out[4] |= de->io.ccTx.timeStamp << 6; - de->io.control_out[4] &= 0x7F; // 0 1 1 1 1 1 1 1 - de->io.control_out[4] |= de->io.ccTx.commonMercuryFrequencies << 7; + //de->io.control_out[4] &= 0x7F; // 0 1 1 1 1 1 1 1 + //de->io.control_out[4] |= de->io.ccTx.commonMercuryFrequencies << 7; // fill the out buffer with the C&C bytes for (int i = 0; i < 5; i++) @@ -3357,10 +3368,14 @@ void DataProcessor::encodeCCBytes() { // C0 = 0 0 0 0 1 1 0 x C1, C2, C3, C4 NCO Frequency in Hz for Receiver _5 // C0 = 0 0 0 0 1 1 1 x C1, C2, C3, C4 NCO Frequency in Hz for Receiver _6 // 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 if (de->io.rx_freq_change >= 0) { - de->io.output_buffer[3] = (de->io.rx_freq_change + 2) << 1; + de->io.output_buffer[3] = (de->io.rx_freq_change < 7) ? (de->io.rx_freq_change + 2) << 1 + : (de->io.rx_freq_change + 11) << 1; + //RRK removed 4HL de->io.output_buffer[3] = (de->io.rx_freq_change + 2) << 1; de->io.output_buffer[4] = de->RX.at(de->io.rx_freq_change)->getCtrFrequency() >> 24; de->io.output_buffer[5] = de->RX.at(de->io.rx_freq_change)->getCtrFrequency() >> 16; de->io.output_buffer[6] = de->RX.at(de->io.rx_freq_change)->getCtrFrequency() >> 8; diff --git a/Source/src/DataEngine/cusdr_dataIO.cpp b/Source/src/DataEngine/cusdr_dataIO.cpp index acdfa80..61e4ebf 100644 --- a/Source/src/DataEngine/cusdr_dataIO.cpp +++ b/Source/src/DataEngine/cusdr_dataIO.cpp @@ -510,7 +510,7 @@ void DataIO::sendAudio(u_char *buf) { cbuf[j].im = (double)sample; } - if(m_pSoundCardOut) + if((m_stopped != true) && m_pSoundCardOut) m_pSoundCardOut->PutOutQueue(63, cbuf); } diff --git a/Source/src/cusdr_alexAntennaWidget.cpp b/Source/src/cusdr_alexAntennaWidget.cpp index b2c54c4..7d35878 100644 --- a/Source/src/cusdr_alexAntennaWidget.cpp +++ b/Source/src/cusdr_alexAntennaWidget.cpp @@ -151,7 +151,7 @@ void AlexAntennaWidget::createAntennasGroup() { // band label QStringList bandNames; - bandNames << "2200m" << "630m" << "160 m" << "80 m" << "60 m" << "40 m" << "30 m" << "20 m" << "17 m" << "15 m" << "12 m" << "10 m" << "6 m" << "gen" << "1" << "2" << "3" << "4"; + bandNames << "2200m" << "630m" << "160 m" << "80 m" << "60 m" << "40 m" << "30 m" << "20 m" << "17 m" << "15 m" << "12 m" << "10 m" << "6 m" << "2 m" << "125 cm" << "70 cm" << "33 cm" << "gen"; QList bandLabelList; diff --git a/Source/src/cusdr_extCtrlWidget.cpp b/Source/src/cusdr_extCtrlWidget.cpp index bef1d91..6969206 100644 --- a/Source/src/cusdr_extCtrlWidget.cpp +++ b/Source/src/cusdr_extCtrlWidget.cpp @@ -138,7 +138,7 @@ void ExtCtrlWidget::createReceivePinsGroup() { // band label QStringList bandNames; - bandNames << "2200m" << "630m" << "160 m" << "80 m" << "60 m" << "40 m" << "30 m" << "20 m" << "17 m" << "15 m" << "12 m" << "10 m" << "6 m" << "1" << "2" << "3" << "4"; + bandNames << "2200m" << "630m" << "160 m" << "80 m" << "60 m" << "40 m" << "30 m" << "20 m" << "17 m" << "15 m" << "12 m" << "10 m" << "6 m" << "2 m" << "125 cm" << "70 cm" << "33 cm"; QList bandLabelList; @@ -212,7 +212,7 @@ void ExtCtrlWidget::createTransmitPinsGroup() { // band label QStringList bandNames; - bandNames << "2200 m" << "630 m" << "160 m" << "80 m" << "60 m" << "40 m" << "30 m" << "20 m" << "17 m" << "15 m" << "12 m" << "10 m" << "6 m" << "1" << "2" << "3" << "4"; + bandNames << "2200 m" << "630 m" << "160 m" << "80 m" << "60 m" << "40 m" << "30 m" << "20 m" << "17 m" << "15 m" << "12 m" << "10 m" << "6 m" << "2 m" << "125 cm" << "70 cm" << "33 cm"; QList bandLabelList; diff --git a/Source/src/cusdr_hamDatabase.h b/Source/src/cusdr_hamDatabase.h index 48a7486..a5c75e4 100644 --- a/Source/src/cusdr_hamDatabase.h +++ b/Source/src/cusdr_hamDatabase.h @@ -56,7 +56,11 @@ typedef enum _hamBand { m12, // 10 m10, // 11 m6, // 12 - gen // 13 + m2, // 13 + cm125, // 14 + cm70, // 15 + cm33, // 16 + gen // 17 } HamBand; @@ -265,6 +269,38 @@ inline QList getHamBandFrequencies() { hamBandFreqList << hamBandFreq; + hamBandFreq.frequencyLo = 144000000; + hamBandFreq.frequencyHi = 148000000; + hamBandFreq.hamBand = (HamBand) m2; + hamBandFreq.bandString = "2m"; + hamBandFreq.region = (IARURegion) region1; + + hamBandFreqList << hamBandFreq; + + hamBandFreq.frequencyLo = 222000000; + hamBandFreq.frequencyHi = 225000000; + hamBandFreq.hamBand = (HamBand) cm125; + hamBandFreq.bandString = "125cm"; + hamBandFreq.region = (IARURegion) region1; + + hamBandFreqList << hamBandFreq; + + hamBandFreq.frequencyLo = 420000000; + hamBandFreq.frequencyHi = 450000000; + hamBandFreq.hamBand = (HamBand) cm70; + hamBandFreq.bandString = "70cm"; + hamBandFreq.region = (IARURegion) region1; + + hamBandFreqList << hamBandFreq; + + hamBandFreq.frequencyLo = 902000000; + hamBandFreq.frequencyHi = 928000000; + hamBandFreq.hamBand = (HamBand) cm33; + hamBandFreq.bandString = "33cm"; + hamBandFreq.region = (IARURegion) region1; + + hamBandFreqList << hamBandFreq; + hamBandFreq.frequencyLo = 0; hamBandFreq.frequencyHi = 61440000; hamBandFreq.hamBand = (HamBand) gen; diff --git a/Source/src/cusdr_radioPopupWidget.cpp b/Source/src/cusdr_radioPopupWidget.cpp index 7dc002e..66131b8 100644 --- a/Source/src/cusdr_radioPopupWidget.cpp +++ b/Source/src/cusdr_radioPopupWidget.cpp @@ -589,6 +589,22 @@ void RadioPopupWidget::createBandBtnGroup() { bandBtnList.append(band6mBtn); CHECKED_CONNECT(band6mBtn, SIGNAL(clicked()), this, SLOT(bandChangedByBtn())); + band2mBtn = new AeroButton("2 m", this); + bandBtnList.append(band2mBtn); + CHECKED_CONNECT(band2mBtn, SIGNAL(clicked()), this, SLOT(bandChangedByBtn())); + + band125cmBtn = new AeroButton("125 cm", this); + bandBtnList.append(band125cmBtn); + CHECKED_CONNECT(band125cmBtn, SIGNAL(clicked()), this, SLOT(bandChangedByBtn())); + + band70cmBtn = new AeroButton("70 cm", this); + bandBtnList.append(band70cmBtn); + CHECKED_CONNECT(band70cmBtn, SIGNAL(clicked()), this, SLOT(bandChangedByBtn())); + + band33cmBtn = new AeroButton("33 cm", this); + bandBtnList.append(band33cmBtn); + CHECKED_CONNECT(band33cmBtn, SIGNAL(clicked()), this, SLOT(bandChangedByBtn())); + bandGenBtn = new AeroButton("Gen", this); bandBtnList.append(bandGenBtn); CHECKED_CONNECT(bandGenBtn, SIGNAL(clicked()), this, SLOT(bandChangedByBtn())); @@ -623,10 +639,20 @@ void RadioPopupWidget::createBandBtnGroup() { hbox2->addWidget(band6mBtn); hbox2->addWidget(bandGenBtn); + QHBoxLayout *hbox3 = new QHBoxLayout(); + hbox3->setContentsMargins(0, 0, 0, 0); + hbox3->setSpacing(0); + hbox3->addWidget(band2mBtn); + hbox3->addWidget(band125cmBtn); + hbox3->addWidget(band70cmBtn); + hbox3->addWidget(band12mBtn); + hbox3->addWidget(band33cmBtn); + bandVBox = new QVBoxLayout; bandVBox->setSpacing(1); bandVBox->addLayout(hbox1); bandVBox->addLayout(hbox2); + bandVBox->addLayout(hbox3); } @@ -1160,6 +1186,18 @@ void RadioPopupWidget::bandChangedByBtn() { if (str == "6 m") set->setVFOFrequency(this, 2, m_receiver, m_lastVfoFrequencyList.at(m6)); else + if (str == "2 m") + set->setVFOFrequency(this, 2, m_receiver, m_lastVfoFrequencyList.at(m2)); + else + if (str == "125 cm") + set->setVFOFrequency(this, 2, m_receiver, m_lastVfoFrequencyList.at(cm125)); + else + if (str == "70 cm") + set->setVFOFrequency(this, 2, m_receiver, m_lastVfoFrequencyList.at(cm70)); + else + if (str == "33 cm") + set->setVFOFrequency(this, 2, m_receiver, m_lastVfoFrequencyList.at(cm33)); + else if (str == "Gen") set->setVFOFrequency(this, 2, m_receiver, m_lastVfoFrequencyList.at(gen)); } diff --git a/Source/src/cusdr_radioPopupWidget.h b/Source/src/cusdr_radioPopupWidget.h index 892bc12..467094f 100644 --- a/Source/src/cusdr_radioPopupWidget.h +++ b/Source/src/cusdr_radioPopupWidget.h @@ -143,6 +143,10 @@ private: AeroButton* band12mBtn; AeroButton* band10mBtn; AeroButton* band6mBtn; + AeroButton* band2mBtn; + AeroButton* band125cmBtn; + AeroButton* band70cmBtn; + AeroButton* band33cmBtn; AeroButton* bandGenBtn; //AeroButton* bandxxBtn; diff --git a/Source/src/cusdr_radioWidget.cpp b/Source/src/cusdr_radioWidget.cpp index a62a5f7..7a19c1d 100644 --- a/Source/src/cusdr_radioWidget.cpp +++ b/Source/src/cusdr_radioWidget.cpp @@ -343,6 +343,42 @@ void RadioWidget::createBandBtnGroup() { bandBtnList.append(band6mBtn); CHECKED_CONNECT(band6mBtn, SIGNAL(clicked()), this, SLOT(bandChangedByBtn())); + band2mBtn = new AeroButton("2 m", this); + band2mBtn->setRoundness(0); + //band6mBtn->setGlass(false); + band2mBtn->setFixedSize(btn_widths, btn_height); + band2mBtn->setStyleSheet(set->getMiniButtonStyle()); + //band6mBtn->setTextColor(QColor(200, 200, 200)); + bandBtnList.append(band2mBtn); + CHECKED_CONNECT(band2mBtn, SIGNAL(clicked()), this, SLOT(bandChangedByBtn())); + + band125cmBtn = new AeroButton("125 cm", this); + band125cmBtn->setRoundness(0); + //band6mBtn->setGlass(false); + band125cmBtn->setFixedSize(btn_widths, btn_height); + band125cmBtn->setStyleSheet(set->getMiniButtonStyle()); + //band6mBtn->setTextColor(QColor(200, 200, 200)); + bandBtnList.append(band125cmBtn); + CHECKED_CONNECT(band125cmBtn, SIGNAL(clicked()), this, SLOT(bandChangedByBtn())); + + band70cmBtn = new AeroButton("70 cm", this); + band70cmBtn->setRoundness(0); + //band6mBtn->setGlass(false); + band70cmBtn->setFixedSize(btn_widths, btn_height); + band70cmBtn->setStyleSheet(set->getMiniButtonStyle()); + //band6mBtn->setTextColor(QColor(200, 200, 200)); + bandBtnList.append(band70cmBtn); + CHECKED_CONNECT(band70cmBtn, SIGNAL(clicked()), this, SLOT(bandChangedByBtn())); + + band33cmBtn = new AeroButton("33 cm", this); + band33cmBtn->setRoundness(0); + //band6mBtn->setGlass(false); + band33cmBtn->setFixedSize(btn_widths, btn_height); + band33cmBtn->setStyleSheet(set->getMiniButtonStyle()); + //band6mBtn->setTextColor(QColor(200, 200, 200)); + bandBtnList.append(band33cmBtn); + CHECKED_CONNECT(band33cmBtn, SIGNAL(clicked()), this, SLOT(bandChangedByBtn())); + bandGenBtn = new AeroButton("Gen", this); bandGenBtn->setRoundness(0); //bandGenBtn->setGlass(false); @@ -382,6 +418,10 @@ void RadioWidget::createBandBtnGroup() { layout->addWidget(band12mBtn, 1, 4); layout->addWidget(band10mBtn, 1, 5); layout->addWidget(band6mBtn, 2, 0); + layout->addWidget(band2mBtn, 2, 0); + layout->addWidget(band125cmBtn, 2, 0); + layout->addWidget(band70cmBtn, 2, 0); + layout->addWidget(band33cmBtn, 2, 0); layout->addWidget(bandGenBtn, 2, 1); //layout->addWidget(bandxxBtn, 2, 3); @@ -1177,6 +1217,18 @@ void RadioWidget::bandChangedByBtn() { if (str == "6 m") set->setVFOFrequency(this, 2, m_currentRx, m_lastVfoFrequencyList.at(m6)); else + if (str == "2 m") + set->setVFOFrequency(this, 2, m_currentRx, m_lastVfoFrequencyList.at(m2)); + else + if (str == "125 cm") + set->setVFOFrequency(this, 2, m_currentRx, m_lastVfoFrequencyList.at(cm125)); + else + if (str == "70 cm") + set->setVFOFrequency(this, 2, m_currentRx, m_lastVfoFrequencyList.at(cm70)); + else + if (str == "33 cm") + set->setVFOFrequency(this, 2, m_currentRx, m_lastVfoFrequencyList.at(cm33)); + else if (str == "Gen") set->setVFOFrequency(this, 2, m_currentRx, m_lastVfoFrequencyList.at(gen)); diff --git a/Source/src/cusdr_radioWidget.h b/Source/src/cusdr_radioWidget.h index 5d30008..241bd94 100644 --- a/Source/src/cusdr_radioWidget.h +++ b/Source/src/cusdr_radioWidget.h @@ -85,6 +85,10 @@ private: AeroButton *band12mBtn; AeroButton *band10mBtn; AeroButton *band6mBtn; + AeroButton *band2mBtn; + AeroButton *band125cmBtn; + AeroButton *band70cmBtn; + AeroButton *band33cmBtn; AeroButton *bandGenBtn; //AeroButton *bandxxBtn; diff --git a/Source/src/cusdr_settings.cpp b/Source/src/cusdr_settings.cpp index 2180c0c..76e4888 100644 --- a/Source/src/cusdr_settings.cpp +++ b/Source/src/cusdr_settings.cpp @@ -1064,6 +1064,54 @@ int Settings::loadSettings() { if ((value < 50000000) || (value > 54000000)) value = 50000000; m_receiverDataList[i].lastVfoFrequencyList << value; + cstr = m_rxStringList.at(i); + cstr.append("/lastCenterFrequency2m"); + value = settings->value(cstr, 144000000).toDouble(); + if ((value < 144000000) || (value > 148000000)) value = 144000000; + m_receiverDataList[i].lastCenterFrequencyList << value; + + cstr = m_rxStringList.at(i); + cstr.append("/lastVfoFrequency2m"); + value = settings->value(cstr, 144000000).toDouble(); + if ((value < 144000000) || (value > 148000000)) value = 144000000; + m_receiverDataList[i].lastVfoFrequencyList << value; + + cstr = m_rxStringList.at(i); + cstr.append("/lastCenterFrequency125cm"); + value = settings->value(cstr, 222000000).toDouble(); + if ((value < 222000000) || (value > 225000000)) value = 222000000; + m_receiverDataList[i].lastCenterFrequencyList << value; + + cstr = m_rxStringList.at(i); + cstr.append("/lastVfoFrequency125cm"); + value = settings->value(cstr, 222000000).toDouble(); + if ((value < 222000000) || (value > 225000000)) value = 222000000; + m_receiverDataList[i].lastVfoFrequencyList << value; + + cstr = m_rxStringList.at(i); + cstr.append("/lastCenterFrequency70cm"); + value = settings->value(cstr, 420000000).toDouble(); + if ((value < 420000000) || (value > 450000000)) value = 420000000; + m_receiverDataList[i].lastCenterFrequencyList << value; + + cstr = m_rxStringList.at(i); + cstr.append("/lastVfoFrequency70cm"); + value = settings->value(cstr, 420000000).toDouble(); + if ((value < 420000000) || (value > 450000000)) value = 420000000; + m_receiverDataList[i].lastVfoFrequencyList << value; + + cstr = m_rxStringList.at(i); + cstr.append("/lastCenterFrequency33cm"); + value = settings->value(cstr, 902000000).toDouble(); + if ((value < 902000000) || (value > 928000000)) value = 902000000; + m_receiverDataList[i].lastCenterFrequencyList << value; + + cstr = m_rxStringList.at(i); + cstr.append("/lastVfoFrequency33cm"); + value = settings->value(cstr, 902000000).toDouble(); + if ((value < 902000000) || (value > 928000000)) value = 902000000; + m_receiverDataList[i].lastVfoFrequencyList << value; + cstr = m_rxStringList.at(i); cstr.append("/lastCenterFrequencyGen"); value = settings->value(cstr, 1800000).toDouble(); diff --git a/Source/src/cusdr_settings.h b/Source/src/cusdr_settings.h index 9d9884b..a3982bd 100644 --- a/Source/src/cusdr_settings.h +++ b/Source/src/cusdr_settings.h @@ -81,7 +81,7 @@ // receiver settings #define MAX_RECEIVERS 16 -#define MAX_BANDS 16 //RRK seems to be the max for rcvrs? +#define MAX_BANDS 18 #define BUFFER_SIZE 1024 #define SAMPLE_BUFFER_SIZE 4096 #define BANDSCOPE_BUFFER_SIZE 4096 diff --git a/Source/src/cusdr_transmitPAWidget.cpp b/Source/src/cusdr_transmitPAWidget.cpp index 831e2c0..1adc23a 100644 --- a/Source/src/cusdr_transmitPAWidget.cpp +++ b/Source/src/cusdr_transmitPAWidget.cpp @@ -133,7 +133,7 @@ void TransmitPAWidget::createGainGroup() { // band label QStringList bandNames; - bandNames << "2200m" << "630m" << "160 m" << "80 m" << "60 m" << "40 m" << "30 m" << "20 m" << "17 m" << "15 m" << "12 m" << "10 m" << "6 m" << "gen" << "1" << "2" << "3" << "4"; + bandNames << "2200m" << "630m" << "160 m" << "80 m" << "60 m" << "40 m" << "30 m" << "20 m" << "17 m" << "15 m" << "12 m" << "10 m" << "6 m" << "2 m" << "125 cm" << "70 cm" << "33 cm" << "gen"; QList bandLabelList;