コード例 #1
0
ファイル: vfo.cpp プロジェクト: GadgetUK/ghpsdr3-alex
//Called when subRx is checked in main menu via actionSubRx()
void vfo::checkSubRx(long long f, int samplerate)
{
    long long vfoAfreq;

    if(selectedVFO == 'B') {
        on_pBtnBtoA_clicked();
    }
    vfoAfreq = readA();
    if ((f < (vfoAfreq - (samplerate / 2))) || (f > (vfoAfreq + (samplerate / 2)))) {
        f=vfoAfreq;
    }
    writeB(f);
    emit frequencyChanged(readA());
//    on_pBtnvfoA_clicked();
    ui->pBtnvfoB->setText("subRx");
    ui->pBtnvfoA->setText("mainRx");
    selectedVFO = 'B';
    ui->pBtnvfoB->setStyleSheet("background-color: rgb(85, 255, 0)");
    ui->pBtnvfoA->setStyleSheet("background-color: normal");
    ui->pBtnSplit->setStyleSheet("background-color: normal");
    ui->pBtnvfoA->setEnabled(FALSE);
    vfoEnabled(false, true);

//    ui->pBtnvfoA->setEnabled(FALSE);
//qDebug()<<Q_FUNC_INFO<<": About to check pBtnSubRx";
    ui->pBtnSubRx->setChecked(TRUE);
}
コード例 #2
0
ファイル: vfo.cpp プロジェクト: GadgetUK/ghpsdr3-alex
// Called by UI::frequencyMoved() in response to spectra freq move action.
void vfo::setSubRxFrequency(long long f)
{
    subRxFrequency = f;
    if(ui->pBtnSubRx->isChecked()) {
        writeB(f);
    }
}
コード例 #3
0
ファイル: vfo.cpp プロジェクト: radi8/vfo
void vfo::wheelEvent(QWheelEvent *event)
{
    QString str;
    int x, digit;
    int direction = 0;
    static const int mult[2][9] = {
        {100000000,10000000,1000000,100000,10000,1000,100,10,1},            // Retrieve with mult[0][0 ... 8]
        {-100000000,-10000000,-1000000,-100000,-10000,-1000,-100,-10,-1}    // Retrieve with mult[1][0 ... 8]
    };

    digit = getDigit(event->x(), event->y());
    if (digit != 9) {  // getDigit returns 9 if click was outside display area so we just fall through.
        if (event->delta() < 0) direction = 1;  // x becomes pos or neg depending on wheel rotation.
        if (digit < 9) { // getDigit returns 0 ... 8 if we clicked on vfoA
            x = mult[direction][digit];
            x = x + readA();
            if (x >= 0 && x <= 999999999)  // Safe to update the display without overflow or underflow.
                writeA(x);
        } else {                  // getDigit returns 10 ... 18 if we clicked on vfoB
            digit = digit - 10; // so convert to 1 ... 8.
            x = mult[direction][digit];
            x = x + readB();
            if (x >= 0 && x <= 999999999)  // Safe to update the display without overflow or underflow.
                writeB(x);
        }
    }  //We fall through to here without processing the wheel if getDigit returns 9.
}
コード例 #4
0
ファイル: vfo.cpp プロジェクト: GadgetUK/ghpsdr3-alex
void vfo::setFrequency(int freq)
{
    if (selectedVFO == 'A' || selectedVFO == 'S') {
        writeA(freq);
    } else if (!ui->pBtnSubRx->isChecked()) {
        writeB(freq);
    } else writeA(freq);
}
コード例 #5
0
ファイル: vfo.cpp プロジェクト: radi8/vfo
void vfo::on_pBtnExch_clicked()
{
    int exchTemp;

    exchTemp = readA();
    writeA(readB());
    writeB(exchTemp);
}
コード例 #6
0
void RGBElement::setB(byte value, bool force) {
    m_Bnext = value;
    m_sync = force;
    if(force)
    {
        switchColor();
        writeB();
    }
}
コード例 #7
0
ファイル: vfo.cpp プロジェクト: radi8/vfo
void vfo::on_toolBtnDn_clicked()
{
    switch (selectedVFO) {
    case 'A':
    case 'S': {
        writeA(readA() - 24000);
        break;
    }
    case 'B':
        writeB(readB() - 24000);
    }
}
コード例 #8
0
ファイル: vfo.cpp プロジェクト: radi8/vfo
void vfo::on_pBtnRIT_clicked()
{
    int chkd = -1;

    if (ui->pBtnRIT->isChecked()) {
        chkd = 1;
    }
    if (selectedVFO != 'B') { // Using vfoA or Split if 'B' is not selectedVFO.
        writeA(readA() + ui->hSlider->value() * chkd);
    } else {
        writeB(readB() + ui->hSlider->value() * chkd);
    }
}
コード例 #9
0
ファイル: vfo.cpp プロジェクト: radi8/vfo
void vfo::processRIT(int rit)
{
    static int freq = 0;

    freq = rit - freq; // freq now holds difference between last rit and this.
    if (selectedVFO != 'B') { // Using vfoA or Split if 'B' is not selectedVFO.
        freq += readA();
        if (ui->pBtnRIT->isChecked()) writeA(freq);
    } else {
        freq += readB();
        if (ui->pBtnRIT->isChecked()) writeB(freq);
    }
    freq = rit;
}
コード例 #10
0
ファイル: nmfile.cpp プロジェクト: Shwe-123/netmeter
/**
  \brief Write the information to disk. The changes will only be commited if autocommit is set or if the commit call is issued.
  \param buffer Information to write.
  \param size Information size
  \return On success, the number of bytes write is returned.
*/
int NMFile::write (const void * buffer, int size)
{
	int rc;
	if(fd < 0) {
		cerr << "NMFile write failed: Create or open a file first." << '\n';
		return -1;
	}
	if(mode == ReadOnly) {
		cerr << "NMFile write failed: You don't have permission for write this file." << '\n';
		return -1;
	}
	rc = writeB (buffer, size);
	if(autocommit)
		commit(); 
	return rc;
}
コード例 #11
0
ファイル: vfo.cpp プロジェクト: GadgetUK/ghpsdr3-alex
void vfo::on_pBtnExch_clicked()
{
    long long exchTemp1;
    long long exchTemp2;

    exchTemp1 = readA();
    exchTemp2 = readB();

    writeA(exchTemp2);
    writeB(exchTemp1);
    if(selectedVFO == 'B') {
        emit frequencyChanged(exchTemp1);
    } else {
        emit frequencyChanged(exchTemp2);
    }
}
コード例 #12
0
ファイル: vfo.cpp プロジェクト: radi8/vfo
void vfo::on_pBtnvfoB_clicked()
{
    if (selectedVFO != 'B') {
        if (ui->pBtnRIT->isChecked()) {
            ui->pBtnRIT->setChecked(false);
            on_pBtnRIT_clicked();
        }
        selectedVFO = 'B';
        ui->pBtnvfoB->setStyleSheet("background-color: rgb(85, 255, 0)");
        ui->pBtnvfoA->setStyleSheet("background-color: normal");
        ui->pBtnSplit->setStyleSheet("background-color: normal");
        vfoEnabled(false, true);
        setBandButton(readB());
        writeB(readB());
    }
}
コード例 #13
0
ファイル: vfo.cpp プロジェクト: radi8/vfo
void vfo::on_pBtnSplit_clicked()
{
    if (selectedVFO != 'S') {
        if (ui->pBtnRIT->isChecked()) {
            ui->pBtnRIT->setChecked(false);
            on_pBtnRIT_clicked();
        }
        selectedVFO = 'S';
        ui->pBtnvfoA->setStyleSheet("background-color: rgb(85, 255, 0)");
        ui->pBtnvfoB->setStyleSheet("background-color: rgb(255, 155, 155)");
        ui->pBtnSplit->setStyleSheet("background-color: rgb(0, 170, 255)");
        vfoEnabled(true, false);
        setBandButton(readA());
        if (ptt == true) {
            writeB(readB());
        } else {
            writeA(readA());
        }
    }
}
コード例 #14
0
ファイル: vfo.cpp プロジェクト: radi8/vfo
void vfo::mousePressEvent(QMouseEvent *event)
{
    bool isVFOa = false;
    int digit, cnt;
    QString myStr = "";

    if (event->button() == Qt::RightButton) {

// qDebug() << (QString::number(event->x()) + "/" + QString::number(event->y()));
        //Check to see if we have right clicked on the band button group
        if ((event->x() > 414) && (event->x() < 573) && (event->y() > 6) && (event->y() < 111)) {
//            qDebug() << "Button Group Clicked";
            storeVFO();

        // Check to see if we have right clicked the RIT slider
        } else if ((event->x() > 189) && (event->x() < 403) && (event->y() > 89) && (event->y() < 111)) {
                ui->hSlider->setValue(0);
        } else { // We have clicked either on the display or somewhere else on the widget
            digit = getDigit(event->x(), event->y());
            if (digit != 9) {  // getDigit returns 9 if click was outside display area.
                if (digit < 9) { // getDigit returns 0 ... 8 if we clicked on vfoA
                    isVFOa = true;
                    myStr = ui->lbl_Amhz->text() + ui->lbl_Akhz->text() + ui->lbl_Ahz->text();
                } else {                  // getDigit returns 10 ... 18 if we clicked on vfoB
                    digit = digit - 10; // so convert to 1 ... 8.
                    myStr = ui->lbl_Bmhz->text() + ui->lbl_Bkhz->text() + ui->lbl_Bhz->text();
                }
                for (cnt = myStr.length(); cnt < 9; cnt++) {
                    myStr = "0" + myStr;
                }
                for (cnt = digit; cnt < 9; cnt++) {
                    myStr[cnt] = QChar('0');
                    ui->hSlider->setValue(0);
                }
                if (isVFOa) {
                    writeA(myStr.toInt());
                } else writeB(myStr.toInt());
            }
        }
    }
}
コード例 #15
0
ファイル: vfo.cpp プロジェクト: radi8/vfo
void vfo::btnGrpBand(int btn)
{
    int retrievedFreq;
    int vfoFreq;
    int cnt;
//    bool vfoBflag;

    btn = -1 * (btn + 2); //Map buttons (-2 .. -14) to (0 .. 11)
    // Test to see if we are changing band.
    if (btn != cur_Band) {
        cur_Band = btn; //Yes, so retrieve current freq for band.
        retrievedFreq = bands[btn][bDat_cFreq];
        for (cnt = 0; cnt < 4; cnt++) {   //If the freq is in one of the memories then set
            if (retrievedFreq == bands[btn][cnt]) break;  // the browsePtr to point to it.
        }
        if (cnt != 4) { //cnt will be 4 if no matching memory.
            browsePtr = cnt; // Points to matching memory position
        }   else {
            browsePtr = bands[btn][bDat_index]; //Initialised to point to last stored freq.
        }
    } else {
        retrievedFreq = bands[btn][browsePtr];
        if (selectedVFO != 'B') {
        vfoFreq = readA();
        }   else {
        vfoFreq = readB();
        }
        if (vfoFreq == retrievedFreq) {
            browsePtr++;
            browsePtr &= 0x03;
            retrievedFreq = bands[btn][browsePtr];
        }
    }
    if (selectedVFO != 'B') {
        writeA(retrievedFreq);
    } else {
        writeB(retrievedFreq);
    }
}
コード例 #16
0
ファイル: vfo.cpp プロジェクト: GadgetUK/ghpsdr3-alex
void vfo::wheelEvent(QWheelEvent *event)
{
    QString str;
    long long x;
    int digit;
    int direction = 1;
    bool isVfoA = true;
    static const int mult[9] = {100000000,10000000,1000000,100000,10000,1000,100,10,1};

    digit = getDigit(event->x(), event->y());
    if (digit != 9) {  // getDigit returns 9 if click was outside display area so we just fall through.
        if (event->delta() < 0) direction = -1;  // x becomes pos or neg depending on wheel rotation.
        if (digit > 9) { // getDigit returns 10 ... 18 if we clicked on vfoB
            digit = digit - 10; // so convert to 1 ... 8.
            isVfoA = false;
        }
        x = mult[digit]*direction;
        if(isVfoA) {    //If true we scrolled on vfoA
//qDebug()<<Q_FUNC_INFO<<"The value of x = "<<", & readA() = "<<readA();
            if(selectedVFO == 'A' || selectedVFO == 'S') {
                emit frequencyMoved(x, 1);
            }
            else {
                writeA(readA() - x);
            }
        }
        else {  //We scrolled on vfoB
//qDebug()<<Q_FUNC_INFO<<"The value of x = "<< x<<", & readB() = "<<readB();
            if(selectedVFO == 'B') {
                emit frequencyMoved(x, 1);
            }
            else {
                writeB(readB() - x);
            }
        }
    }  //We fall through to here without processing the wheel if getDigit returns 9.
}
コード例 #17
0
ファイル: vfo.cpp プロジェクト: GadgetUK/ghpsdr3-alex
void vfo::mousePressEvent(QMouseEvent *event)
{
    bool isVFOa = false;
    int digit, cnt;
    QString myStr = "";
    long long freq;

    if (event->button() == Qt::RightButton) {

//qDebug()<<Q_FUNC_INFO<<": event x/y = "<<event->x()<<"/"<<event->y();

        //Check to see if we have right clicked on the band button group
        if ((event->x() > 414) && (event->x() < 573) &&
            (event->y() > 6) && (event->y() < 111)) {
//            storeVFO(); //make the selected button flash yellow & call store routine
            timer.start(500,this);
            ui->btnGrpBand->checkedButton()->setStyleSheet("background-color: yellow");
            emit rightBandClick();  //connected to Band:quickMemStore via UI:quickMemStore

        }   // Check to see if we have right clicked the RIT slider
        else if ((event->x() > 189) && (event->x() < 403) &&
                 (event->y() > 89) && (event->y() < 111)) {
                ui->hSlider->setValue(0);
        }
        // We have clicked either on the display or somewhere else on the widget

        else {  // Check to see if we have clicked outside the vfo display area
            digit = getDigit(event->x(), event->y());
//qDebug()<<Q_FUNC_INFO<<": The value of digit is ..."<<digit;
            if (digit != 9) {       // getDigit returns 9 if click was outside display area.
                if (digit < 9) {    // getDigit returns 0 ... 8 if we clicked on vfoA
                    freq = readA();
                    isVFOa = true;
                    myStr = ui->lbl_Amhz->text() + ui->lbl_Akhz->text() + ui->lbl_Ahz->text();
                }
                else {                  // getDigit returns 10 ... 18 if we clicked on vfoB
                    digit = digit - 10; // so convert to 1 ... 8.
                    freq = readB();
                    myStr = ui->lbl_Bmhz->text() + ui->lbl_Bkhz->text() + ui->lbl_Bhz->text();
                }
                for (cnt = myStr.length(); cnt < 9; cnt++) {
                    myStr = "0" + myStr;
                }
                for (cnt = digit; cnt < 9; cnt++) {
                    myStr[cnt] = QChar('0');
                    ui->hSlider->setValue(0);
                }
                freq = freq - myStr.toLongLong();
                if (isVFOa) {   //We right clicked on vfoA
                    if(selectedVFO == 'A' || selectedVFO == 'S') {
                        emit frequencyMoved(freq, 1);
//qDebug()<<Q_FUNC_INFO<<": vfoA, emit frequencyChanged(myStr.toLongLong()) = "<<freq;
                    }
                    else {
                        writeA(myStr.toLongLong());
//qDebug()<<Q_FUNC_INFO<<": vfoA, writeA(myStr.toInt()) = "<<freq;
                    }
                }
//                else if(ui->pBtnSubRx->isChecked()) { //We right clicked on vfoB
//qDebug()<<Q_FUNC_INFO<<": vfoB and subRx mode";
//                }
                else if(selectedVFO == 'B') {
                        emit frequencyMoved(freq, 1);
//qDebug()<<Q_FUNC_INFO<<": Line 187 ... vfoB, emit frequencyMoved(freq, 1) = "<<freq;
                }
                else {
                        writeB(myStr.toLongLong());
//qDebug()<<Q_FUNC_INFO<<": vfoB, writeA(myStr.toInt()) = "<<freq;
                }
            }
        }
    }   //If event not right button or getDigit = 9, fall thru to here with no processing.
}
コード例 #18
0
ファイル: vfo.cpp プロジェクト: radi8/vfo
void vfo::readSettings()
{
    QSettings settings("freesoftware", "vfo");

    bands[0][bDat_mem00] = (settings.value("Band0_Mem00",1850000).toInt());
    bands[0][bDat_mem01] = (settings.value("Band0_Mem01",1860000).toInt());
    bands[0][bDat_mem02] = (settings.value("Band0_Mem02",1870000).toInt());
    bands[0][bDat_mem03] = (settings.value("Band0_Mem03",1880000).toInt());
    bands[0][bDat_cFreq] = (settings.value("Band0_Cfreq",1840000).toInt());
    bands[0][bDat_fqmin] = (settings.value("Band0_Fqmin",1800000).toInt());
    bands[0][bDat_fqmax] = (settings.value("Band0_Fqmax",1950000).toInt());
    bands[0][bDat_modee] = (settings.value("Band0_Modee",1).toInt());
    bands[0][bDat_filtH] = (settings.value("Band0_FiltH",2800).toInt());
    bands[0][bDat_filtL] = (settings.value("Band0_FiltL",200).toInt());
    bands[0][bDat_index] = (settings.value("Band0_Index",0).toInt());

    bands[1][bDat_mem00] = (settings.value("Band1_Mem00",3550000).toInt());
    bands[1][bDat_mem01] = (settings.value("Band1_Mem01",3560000).toInt());
    bands[1][bDat_mem02] = (settings.value("Band1_Mem02",3570000).toInt());
    bands[1][bDat_mem03] = (settings.value("Band1_Mem03",3580000).toInt());
    bands[1][bDat_cFreq] = (settings.value("Band1_Cfreq",3540000).toInt());
    bands[1][bDat_fqmin] = (settings.value("Band1_Fqmin",3500000).toInt());
    bands[1][bDat_fqmax] = (settings.value("Band1_Fqmax",3900000).toInt());
    bands[1][bDat_modee] = (settings.value("Band1_Modee",1).toInt());
    bands[1][bDat_filtH] = (settings.value("Band1_FiltH",2800).toInt());
    bands[1][bDat_filtL] = (settings.value("Band1_FiltL",200).toInt());
    bands[1][bDat_index] = (settings.value("Band1_Index",0).toInt());

    bands[2][bDat_mem00] = (settings.value("Band2_Mem00",7050000).toInt());
    bands[2][bDat_mem01] = (settings.value("Band2_Mem01",7060000).toInt());
    bands[2][bDat_mem02] = (settings.value("Band2_Mem02",7070000).toInt());
    bands[2][bDat_mem03] = (settings.value("Band2_Mem03",7080000).toInt());
    bands[2][bDat_cFreq] = (settings.value("Band2_Cfreq",7040000).toInt());
    bands[2][bDat_fqmin] = (settings.value("Band2_Fqmin",7000000).toInt());
    bands[2][bDat_fqmax] = (settings.value("Band2_Fqmax",7300000).toInt());
    bands[2][bDat_modee] = (settings.value("Band2_Modee",1).toInt());
    bands[2][bDat_filtH] = (settings.value("Band2_FiltH",2800).toInt());
    bands[2][bDat_filtL] = (settings.value("Band2_FiltL",200).toInt());
    bands[2][bDat_index] = (settings.value("Band2_Index",0).toInt());

    bands[3][bDat_mem00] = (settings.value("Band3_Mem00",10110000).toInt());
    bands[3][bDat_mem01] = (settings.value("Band3_Mem01",10120000).toInt());
    bands[3][bDat_mem02] = (settings.value("Band3_Mem02",10130000).toInt());
    bands[3][bDat_mem03] = (settings.value("Band3_Mem03",10140000).toInt());
    bands[3][bDat_cFreq] = (settings.value("Band3_Cfreq",10125000).toInt());
    bands[3][bDat_fqmin] = (settings.value("Band3_Fqmin",10100000).toInt());
    bands[3][bDat_fqmax] = (settings.value("Band3_Fqmax",10150000).toInt());
    bands[3][bDat_modee] = (settings.value("Band3_Modee",1).toInt());
    bands[3][bDat_filtH] = (settings.value("Band3_FiltH",2800).toInt());
    bands[3][bDat_filtL] = (settings.value("Band3_FiltL",200).toInt());
    bands[3][bDat_index] = (settings.value("Band3_Index",0).toInt());

    bands[4][bDat_mem00] = (settings.value("Band4_Mem00",14020000).toInt());
    bands[4][bDat_mem01] = (settings.value("Band4_Mem01",14120000).toInt());
    bands[4][bDat_mem02] = (settings.value("Band4_Mem02",14130000).toInt());
    bands[4][bDat_mem03] = (settings.value("Band4_Mem03",14140000).toInt());
    bands[4][bDat_cFreq] = (settings.value("Band4_Cfreq",14125000).toInt());
    bands[4][bDat_fqmin] = (settings.value("Band4_Fqmin",14000000).toInt());
    bands[4][bDat_fqmax] = (settings.value("Band4_Fqmax",14350000).toInt());
    bands[4][bDat_modee] = (settings.value("Band4_Modee",1).toInt());
    bands[4][bDat_filtH] = (settings.value("Band4_FiltH",2800).toInt());
    bands[4][bDat_filtL] = (settings.value("Band4_FiltL",200).toInt());
    bands[4][bDat_index] = (settings.value("Band4_Index",0).toInt());

    bands[5][bDat_mem00] = (settings.value("Band5_Mem00",18010000).toInt());
    bands[5][bDat_mem01] = (settings.value("Band5_Mem01",18020000).toInt());
    bands[5][bDat_mem02] = (settings.value("Band5_Mem02",18030000).toInt());
    bands[5][bDat_mem03] = (settings.value("Band5_Mem03",18040000).toInt());
    bands[5][bDat_cFreq] = (settings.value("Band5_Cfreq",18025000).toInt());
    bands[5][bDat_fqmin] = (settings.value("Band5_Fqmin",18068000).toInt());
    bands[5][bDat_fqmax] = (settings.value("Band5_Fqmax",18168000).toInt());
    bands[5][bDat_modee] = (settings.value("Band5_Modee",1).toInt());
    bands[5][bDat_filtH] = (settings.value("Band5_FiltH",2800).toInt());
    bands[5][bDat_filtL] = (settings.value("Band5_FiltL",200).toInt());
    bands[5][bDat_index] = (settings.value("Band5_Index",0).toInt());

    bands[6][bDat_mem00] = (settings.value("Band6_Mem00",21010000).toInt());
    bands[6][bDat_mem01] = (settings.value("Band6_Mem01",21020000).toInt());
    bands[6][bDat_mem02] = (settings.value("Band6_Mem02",21130000).toInt());
    bands[6][bDat_mem03] = (settings.value("Band6_Mem03",21140000).toInt());
    bands[6][bDat_cFreq] = (settings.value("Band6_Cfreq",21225000).toInt());
    bands[6][bDat_fqmin] = (settings.value("Band6_Fqmin",21000000).toInt());
    bands[6][bDat_fqmax] = (settings.value("Band6_Fqmax",21450000).toInt());
    bands[6][bDat_modee] = (settings.value("Band6_Modee",1).toInt());
    bands[6][bDat_filtH] = (settings.value("Band6_FiltH",2800).toInt());
    bands[6][bDat_filtL] = (settings.value("Band6_FiltL",200).toInt());
    bands[6][bDat_index] = (settings.value("Band6_Index",0).toInt());

    bands[7][bDat_mem00] = (settings.value("Band7_Mem00",24900000).toInt());
    bands[7][bDat_mem01] = (settings.value("Band7_Mem01",24920000).toInt());
    bands[7][bDat_mem02] = (settings.value("Band7_Mem02",24930000).toInt());
    bands[7][bDat_mem03] = (settings.value("Band7_Mem03",24940000).toInt());
    bands[7][bDat_cFreq] = (settings.value("Band7_Cfreq",24925000).toInt());
    bands[7][bDat_fqmin] = (settings.value("Band7_Fqmin",24890000).toInt());
    bands[7][bDat_fqmax] = (settings.value("Band7_Fqmax",24990000).toInt());
    bands[7][bDat_modee] = (settings.value("Band7_Modee",1).toInt());
    bands[7][bDat_filtH] = (settings.value("Band7_FiltH",2800).toInt());
    bands[7][bDat_filtL] = (settings.value("Band7_FiltL",200).toInt());
    bands[7][bDat_index] = (settings.value("Band7_Index",0).toInt());

    bands[8][bDat_mem00] = (settings.value("Band8_Mem00",26955000).toInt());
    bands[8][bDat_mem01] = (settings.value("Band8_Mem01",26960000).toInt());
    bands[8][bDat_mem02] = (settings.value("Band8_Mem02",26970000).toInt());
    bands[8][bDat_mem03] = (settings.value("Band8_Mem03",26980000).toInt());
    bands[8][bDat_cFreq] = (settings.value("Band8_Cfreq",26990000).toInt());
    bands[8][bDat_fqmin] = (settings.value("Band8_Fqmin",26950000).toInt());
    bands[8][bDat_fqmax] = (settings.value("Band8_Fqmax",27300000).toInt());
    bands[8][bDat_modee] = (settings.value("Band8_Modee",1).toInt());
    bands[8][bDat_filtH] = (settings.value("Band8_FiltH",2800).toInt());
    bands[8][bDat_filtL] = (settings.value("Band8_FiltL",200).toInt());
    bands[8][bDat_index] = (settings.value("Band8_Index",0).toInt());

    bands[9][bDat_mem00] = (settings.value("Band9_Mem00",28010000).toInt());
    bands[9][bDat_mem01] = (settings.value("Band9_Mem01",28420000).toInt());
    bands[9][bDat_mem02] = (settings.value("Band9_Mem02",28430000).toInt());
    bands[9][bDat_mem03] = (settings.value("Band9_Mem03",28440000).toInt());
    bands[9][bDat_cFreq] = (settings.value("Band9_Cfreq",28425000).toInt());
    bands[9][bDat_fqmin] = (settings.value("Band9_Fqmin",28000000).toInt());
    bands[9][bDat_fqmax] = (settings.value("Band9_Fqmax",29700000).toInt());
    bands[9][bDat_modee] = (settings.value("Band9_Modee",1).toInt());
    bands[9][bDat_filtH] = (settings.value("Band9_FiltH",2800).toInt());
    bands[9][bDat_filtL] = (settings.value("Band9_FiltL",200).toInt());
    bands[9][bDat_index] = (settings.value("Band9_Index",0).toInt());

    bands[10][bDat_mem00] = (settings.value("Band10_Mem00",51010000).toInt());
    bands[10][bDat_mem01] = (settings.value("Band10_Mem01",51060000).toInt());
    bands[10][bDat_mem02] = (settings.value("Band10_Mem02",51070000).toInt());
    bands[10][bDat_mem03] = (settings.value("Band10_Mem03",51080000).toInt());
    bands[10][bDat_cFreq] = (settings.value("Band10_Cfreq",51940000).toInt());
    bands[10][bDat_fqmin] = (settings.value("Band10_Fqmin",51000000).toInt());
    bands[10][bDat_fqmax] = (settings.value("Band10_Fqmax",53000000).toInt());
    bands[10][bDat_modee] = (settings.value("Band10_Modee",1).toInt());
    bands[10][bDat_filtH] = (settings.value("Band10_FiltH",2800).toInt());
    bands[10][bDat_filtL] = (settings.value("Band10_FiltL",200).toInt());
    bands[10][bDat_index] = (settings.value("Band10_Index",0).toInt());

    bands[11][bDat_mem00] = (settings.value("Band11_Mem00",8050000).toInt());
    bands[11][bDat_mem01] = (settings.value("Band11_Mem01",9060000).toInt());
    bands[11][bDat_mem02] = (settings.value("Band11_Mem02",10070000).toInt());
    bands[11][bDat_mem03] = (settings.value("Band11_Mem03",11080000).toInt());
    bands[11][bDat_cFreq] = (settings.value("Band11_Cfreq",15040000).toInt());
    bands[11][bDat_fqmin] = (settings.value("Band11_Fqmin",000000).toInt());
    bands[11][bDat_fqmax] = (settings.value("Band11_Fqmax",999000000).toInt());
    bands[11][bDat_modee] = (settings.value("Band11_Modee",1).toInt());
    bands[11][bDat_filtH] = (settings.value("Band11_FiltH",2800).toInt());
    bands[11][bDat_filtL] = (settings.value("Band11_FiltL",200).toInt());
    bands[11][bDat_index] = (settings.value("Band11_Index",0).toInt());

    writeA(settings.value("vfoA_f",3502000).toInt());  // These need to be done after all the frequency
    writeB(settings.value("vfoB_f",14234567).toInt()); // settings have been read and set.
}
コード例 #19
0
ファイル: vfo.cpp プロジェクト: radi8/vfo
void vfo::on_pBtnAtoB_clicked()
{
    writeB(readA());
}
コード例 #20
0
ファイル: vfo.cpp プロジェクト: radi8/vfo
void vfo::togglePTT(bool pttRq)
{
    int freq;
    bool vfoUsed; // true = vfoA, false = vfoB.

    if (selectedVFO == 'A') {
        freq = readA();
        vfoUsed = true;
    } else if (selectedVFO == 'B') {
        freq = readB();
        vfoUsed = false;
    } else if (pttRq == true) { // Must be split and
        freq = readB();         //we will Tx on vfoB
        vfoUsed = false;
    } else {                // We are receiving so we
        freq = readA();     // will Rx on vfoA.
        vfoUsed = true;
    }  // We have decided on vfo to use and got basic freq. Lets now see if we
       // are doing a valid changeover and if it is Rx to Tx or Tx to Rx.
    if (pttRq == true && ptt == false) { // Going from Rx to Tx
        ptt = true;
        if (ui->pBtnRIT->isChecked()) {
            if (selectedVFO == 'A' || selectedVFO == 'B'){
                freq = freq + ui->hSlider->value() * -1;
                ui->pBtnRIT->setEnabled(false);
                ui->hSlider->setEnabled(false);
            } // We don't modify the vfo frequencies if on split
        }     // and of course no modification if RIT not checked.
        if (vfoUsed == true) { // Using vfoA for transmit frequency
            writeA(freq);
            ui->pBtnvfoA->setStyleSheet("background-color: rgb(255, 0, 0)"); //Red
        } else {
            writeB(freq);
            //TODO set vfoA background to light green and disable display vfoEnabled(false, true)
            vfoEnabled(false, true);
            ui->pBtnvfoA->setStyleSheet("background-color: normal"); //Red
            ui->pBtnvfoB->setStyleSheet("background-color: rgb(255, 0, 0)"); //Red
        }
    } else if (pttRq == false && ptt == true) { //Going from Tx to Rx
        ptt = false;
        if (ui->pBtnRIT->isChecked()) {
            if (selectedVFO == 'A' || selectedVFO == 'B'){
                freq = freq + ui->hSlider->value();
                ui->pBtnRIT->setEnabled(true);
                ui->hSlider->setEnabled(true);
            } // We don't modify the vfo frequencies if on split
        }     // and again no modification if RIT not checked.
        if (selectedVFO == 'A') { // Using vfoA for receive frequency
            writeA(freq);
            ui->pBtnvfoA->setStyleSheet("background-color: rgb(85, 255, 0)"); //Green
        } else  if (selectedVFO == 'B'){
            writeB(freq);
            ui->pBtnvfoB->setStyleSheet("background-color: rgb(85, 255, 0)"); //Green
        } else {
            writeA(freq);
            ui->pBtnvfoB->setStyleSheet("background-color: rgb(255, 155, 155)"); //Light Red
            ui->pBtnvfoA->setStyleSheet("background-color: rgb(85, 255, 0)"); //Green
            vfoEnabled(true, false);
        }
    }
}
コード例 #21
0
ファイル: vfo.cpp プロジェクト: GadgetUK/ghpsdr3-alex
void vfo::on_pBtnAtoB_clicked()
{
    writeB(readA());
    emit frequencyChanged(readA()); //Doesn't matter which vfo as both now the same freq
}
コード例 #22
0
ファイル: vfo.cpp プロジェクト: GadgetUK/ghpsdr3-alex
void vfo::readSettings(QSettings* settings)
{
    settings->beginGroup("vfo");
    writeB(settings->value("vfoB_f",14234567).toInt()); // vfoA initial settings from band.ccp
    settings->endGroup();
}
コード例 #23
0
void RGBElement::writeRGB() {
    writeR();
    writeG();
    writeB();
}