Ejemplo n.º 1
0
//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);
}
Ejemplo n.º 2
0
Archivo: vfo.cpp Proyecto: radi8/vfo
void vfo::on_pBtnvfoA_clicked()
{
    if (selectedVFO != 'A') {
        if (ui->pBtnRIT->isChecked()) {
            ui->pBtnRIT->setChecked(false);
            on_pBtnRIT_clicked();
        }
        selectedVFO = 'A';
        ui->pBtnvfoA->setStyleSheet("background-color: rgb(85, 255, 0)"); //Set button to Green
        ui->pBtnvfoB->setStyleSheet("background-color: normal");
        ui->pBtnSplit->setStyleSheet("background-color: normal");
        vfoEnabled(true, false);
        setBandButton(readA());
        writeA(readA());
    }
}
Ejemplo n.º 3
0
Archivo: vfo.cpp Proyecto: 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.
}
Ejemplo n.º 4
0
Archivo: vfo.cpp Proyecto: radi8/vfo
// When we arrive here from a right button click on the bandButtons group the variable
// cur_Band will hold the index to the required band button
void vfo::storeVFO()
{
    int retrievedFreq;
    int cnt;

    qDebug() << "From storeVFO(), band button = " << cur_Band;

    if (selectedVFO != 'B') {
        retrievedFreq = readA(); //Using vfoA
    } else {
        retrievedFreq = readB();
    }
    // Search to see if the freq is already stored
    for (cnt = 0; cnt < 4; cnt++) {       //If the freq is in one of the memories then set
        if (retrievedFreq == bands[cur_Band][cnt]) break;  // the browsePtr to point to it.
    }
    if (cnt != 4) { //cnt will be 4 if no matching memory freq.
        browsePtr = cnt; // Points to matching memory position & we don't need to store it.
    }   else {
        bands[cur_Band][bDat_index]--;
        bands[cur_Band][bDat_index] &= 0x03;
        bands[cur_Band][bands[cur_Band][bDat_index]] = retrievedFreq;
        browsePtr = bands[cur_Band][bDat_index]; //Point to last stored freq.
    }
    timer.start(500,this);
    ui->btnGrpBand->checkedButton()->setStyleSheet("background-color: yellow");
}
Ejemplo n.º 5
0
// read model file
void readModelFile(double *pi, 
                double **A, 
                double **B, 
                int N, 
                int M, 
                int T, 
                char **alphabet,
                FILE *filename )
{
	int N1, M1, T1;
	char str[80];
	//FILE *in = fopen(filename, "r");
	if (filename != NULL) 
	{	
		fscanf(filename, "N=%d, M=%d, T=%d\n", &N1, &M1, &T1);
		if (N1 != N || M1 != M) {
			fprintf(stderr, "\nN, or M is not the same parameters!\n\n");
			exit(0);
		}

		fgets(str, sizeof(str), filename); //I:
		readPi(pi, N, filename);
		while (strstr(str, "A:")==NULL)
			fgets(str, sizeof(str), filename); //A:
		readA(A, N, filename);
		while (strstr(str, "B:")==NULL)
			fgets(str, sizeof(str), filename); //B:
		readBT(B, N, M, alphabet, filename);
	}
	//fclose(filename);
}
Ejemplo n.º 6
0
Archivo: vfo.cpp Proyecto: radi8/vfo
vfo::vfo(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::vfo)
{
    ui->setupUi(this);

    cur_Band = 20; // Initialise to a value which is != to any band.
    browsePtr = 0;
    selectedVFO = 'A';
    ptt = false;
    bands = new int*[12];  // Create 12 rows (there are 12 buttons)
    for (int nCount=0; nCount < 12; nCount++)
        bands[nCount] = new int[bDat_index + 1];  // Create 8 columns

    for (int row = 0; row < 12; row ++) {
        for (int col = 0; col == bDat_index; col++) {
            bands[row][col] = 10000000;
        }
        bands[row][bDat_index] = 0; // Overwrite the index to zero for each row
    }
    readSettings();
    setBandButton(readA());
    connect(ui->btnGrpBand, SIGNAL(buttonClicked(int)),
                this, SLOT(btnGrpBand(int)));
    connect(ui->hSlider, SIGNAL(valueChanged(int)),
                this, SLOT(processRIT(int)));
    connect(ui->pBtnClrTrail, SIGNAL(toggled(bool)),
            this, SLOT(togglePTT(bool)));
}
Ejemplo n.º 7
0
long long vfo::getTxFrequency()
{
    if(selectedVFO == 'A') {
        return readA();
    } else {
        return readB();
    }
}
Ejemplo n.º 8
0
Archivo: vfo.cpp Proyecto: radi8/vfo
void vfo::on_pBtnExch_clicked()
{
    int exchTemp;

    exchTemp = readA();
    writeA(readB());
    writeB(exchTemp);
}
Ejemplo n.º 9
0
void vfo::pttChange(bool pttState)
{
    long long temp;

    ptt = pttState;
    if(ptt) { // Going from Rx to Tx
        if(selectedVFO=='S') { //We are going to transmit on vfoB frequency
            temp = readA();                 //Because we are switched to vfoA we will place the
            emit frequencyChanged(readB()); //value of vfoB in it when doing the frequency change
            writeA(temp);                   //hence needing to save and restore vfoA via temp.
        }
    } else { // Going from Tx to Rx
        if(selectedVFO=='S') { //We are going to receive on vfoA frequency
            emit frequencyChanged(readA());
        }
    }
    setVfoBtnColour();
}
Ejemplo n.º 10
0
Archivo: vfo.cpp Proyecto: 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());
        }
    }
}
Ejemplo n.º 11
0
Archivo: vfo.cpp Proyecto: radi8/vfo
void vfo::on_toolBtnDn_clicked()
{
    switch (selectedVFO) {
    case 'A':
    case 'S': {
        writeA(readA() - 24000);
        break;
    }
    case 'B':
        writeB(readB() - 24000);
    }
}
Ejemplo n.º 12
0
Archivo: vfo.cpp Proyecto: 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);
    }
}
Ejemplo n.º 13
0
void vfo::on_pBtnSplit_clicked()
{
    if (selectedVFO != 'S' && ptt == false) {
        if (ui->pBtnRIT->isChecked()) {
            ui->pBtnRIT->setChecked(false);
            on_pBtnRIT_clicked();
        }
        selectedVFO = 'S';
        setVfoBtnColour();
        vfoEnabled(true, false);
        emit frequencyChanged(readA());
    }
}
Ejemplo n.º 14
0
Archivo: vfo.cpp Proyecto: 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;
}
Ejemplo n.º 15
0
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);
    }
}
Ejemplo n.º 16
0
Archivo: vfo.cpp Proyecto: 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);
    }
}
Ejemplo n.º 17
0
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.
}
Ejemplo n.º 18
0
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.
}
Ejemplo n.º 19
0
Archivo: vfo.cpp Proyecto: radi8/vfo
void vfo::writeSettings()
{
    QSettings settings("freesoftware","vfo");

    settings.setValue("vfoA_f", readA());
    settings.setValue("vfoB_f", readB());
    settings.setValue("Band0_Mem00",bands[0][bDat_mem00]);
    settings.setValue("Band0_Mem01",bands[0][bDat_mem01]);
    settings.setValue("Band0_Mem02",bands[0][bDat_mem02]);
    settings.setValue("Band0_Mem03",bands[0][bDat_mem03]);
    settings.setValue("Band0_Cfreq",bands[0][bDat_cFreq]);
    settings.setValue("Band0_Fqmin",bands[0][bDat_fqmin]);
    settings.setValue("Band0_Fqmax",bands[0][bDat_fqmax]);
    settings.setValue("Band0_Modee",bands[0][bDat_modee]);
    settings.setValue("Band0_FiltH",bands[0][bDat_filtH]);
    settings.setValue("Band0_FiltL",bands[0][bDat_filtL]);
    settings.setValue("Band0_Index",bands[0][bDat_index]);

    settings.setValue("Band1_Mem00",bands[1][bDat_mem00]);
    settings.setValue("Band1_Mem01",bands[1][bDat_mem01]);
    settings.setValue("Band1_Mem02",bands[1][bDat_mem02]);
    settings.setValue("Band1_Mem03",bands[1][bDat_mem03]);
    settings.setValue("Band1_Cfreq",bands[1][bDat_cFreq]);
    settings.setValue("Band1_Fqmin",bands[1][bDat_fqmin]);
    settings.setValue("Band1_Fqmax",bands[1][bDat_fqmax]);
    settings.setValue("Band1_Modee",bands[1][bDat_modee]);
    settings.setValue("Band1_FiltH",bands[1][bDat_filtH]);
    settings.setValue("Band1_FiltL",bands[1][bDat_filtL]);
    settings.setValue("Band1_Index",bands[1][bDat_index]);

    settings.setValue("Band2_Mem00",bands[2][bDat_mem00]);
    settings.setValue("Band2_Mem01",bands[2][bDat_mem01]);
    settings.setValue("Band2_Mem02",bands[2][bDat_mem02]);
    settings.setValue("Band2_Mem03",bands[2][bDat_mem03]);
    settings.setValue("Band2_Cfreq",bands[2][bDat_cFreq]);
    settings.setValue("Band2_Fqmin",bands[2][bDat_fqmin]);
    settings.setValue("Band2_Fqmax",bands[2][bDat_fqmax]);
    settings.setValue("Band2_Modee",bands[2][bDat_modee]);
    settings.setValue("Band2_FiltH",bands[2][bDat_filtH]);
    settings.setValue("Band2_FiltL",bands[2][bDat_filtL]);
    settings.setValue("Band2_Index",bands[2][bDat_index]);

    settings.setValue("Band3_Mem00",bands[3][bDat_mem00]);
    settings.setValue("Band3_Mem01",bands[3][bDat_mem01]);
    settings.setValue("Band3_Mem02",bands[3][bDat_mem02]);
    settings.setValue("Band3_Mem03",bands[3][bDat_mem03]);
    settings.setValue("Band3_Cfreq",bands[3][bDat_cFreq]);
    settings.setValue("Band3_Fqmin",bands[3][bDat_fqmin]);
    settings.setValue("Band3_Fqmax",bands[3][bDat_fqmax]);
    settings.setValue("Band3_Modee",bands[3][bDat_modee]);
    settings.setValue("Band3_FiltH",bands[3][bDat_filtH]);
    settings.setValue("Band3_FiltL",bands[3][bDat_filtL]);
    settings.setValue("Band3_Index",bands[3][bDat_index]);

    settings.setValue("Band4_Mem00",bands[4][bDat_mem00]);
    settings.setValue("Band4_Mem01",bands[4][bDat_mem01]);
    settings.setValue("Band4_Mem02",bands[4][bDat_mem02]);
    settings.setValue("Band4_Mem03",bands[4][bDat_mem03]);
    settings.setValue("Band4_Cfreq",bands[4][bDat_cFreq]);
    settings.setValue("Band4_Fqmin",bands[4][bDat_fqmin]);
    settings.setValue("Band4_Fqmax",bands[4][bDat_fqmax]);
    settings.setValue("Band4_Modee",bands[4][bDat_modee]);
    settings.setValue("Band4_FiltH",bands[4][bDat_filtH]);
    settings.setValue("Band4_FiltL",bands[4][bDat_filtL]);
    settings.setValue("Band4_Index",bands[4][bDat_index]);

    settings.setValue("Band5_Mem00",bands[5][bDat_mem00]);
    settings.setValue("Band5_Mem01",bands[5][bDat_mem01]);
    settings.setValue("Band5_Mem02",bands[5][bDat_mem02]);
    settings.setValue("Band5_Mem03",bands[5][bDat_mem03]);
    settings.setValue("Band5_Cfreq",bands[5][bDat_cFreq]);
    settings.setValue("Band5_Fqmin",bands[5][bDat_fqmin]);
    settings.setValue("Band5_Fqmax",bands[5][bDat_fqmax]);
    settings.setValue("Band5_Modee",bands[5][bDat_modee]);
    settings.setValue("Band5_FiltH",bands[5][bDat_filtH]);
    settings.setValue("Band5_FiltL",bands[5][bDat_filtL]);
    settings.setValue("Band5_Index",bands[5][bDat_index]);

    settings.setValue("Band6_Mem00",bands[6][bDat_mem00]);
    settings.setValue("Band6_Mem01",bands[6][bDat_mem01]);
    settings.setValue("Band6_Mem02",bands[6][bDat_mem02]);
    settings.setValue("Band6_Mem03",bands[6][bDat_mem03]);
    settings.setValue("Band6_Cfreq",bands[6][bDat_cFreq]);
    settings.setValue("Band6_Fqmin",bands[6][bDat_fqmin]);
    settings.setValue("Band6_Fqmax",bands[6][bDat_fqmax]);
    settings.setValue("Band6_Modee",bands[6][bDat_modee]);
    settings.setValue("Band6_FiltH",bands[6][bDat_filtH]);
    settings.setValue("Band6_FiltL",bands[6][bDat_filtL]);
    settings.setValue("Band6_Index",bands[6][bDat_index]);

    settings.setValue("Band7_Mem00",bands[7][bDat_mem00]);
    settings.setValue("Band7_Mem01",bands[7][bDat_mem01]);
    settings.setValue("Band7_Mem02",bands[7][bDat_mem02]);
    settings.setValue("Band7_Mem03",bands[7][bDat_mem03]);
    settings.setValue("Band7_Cfreq",bands[7][bDat_cFreq]);
    settings.setValue("Band7_Fqmin",bands[7][bDat_fqmin]);
    settings.setValue("Band7_Fqmax",bands[7][bDat_fqmax]);
    settings.setValue("Band7_Modee",bands[7][bDat_modee]);
    settings.setValue("Band7_FiltH",bands[7][bDat_filtH]);
    settings.setValue("Band7_FiltL",bands[7][bDat_filtL]);
    settings.setValue("Band7_Index",bands[7][bDat_index]);

    settings.setValue("Band8_Mem00",bands[8][bDat_mem00]);
    settings.setValue("Band8_Mem01",bands[8][bDat_mem01]);
    settings.setValue("Band8_Mem02",bands[8][bDat_mem02]);
    settings.setValue("Band8_Mem03",bands[8][bDat_mem03]);
    settings.setValue("Band8_Cfreq",bands[8][bDat_cFreq]);
    settings.setValue("Band8_Fqmin",bands[8][bDat_fqmin]);
    settings.setValue("Band8_Fqmax",bands[8][bDat_fqmax]);
    settings.setValue("Band8_Modee",bands[8][bDat_modee]);
    settings.setValue("Band8_FiltH",bands[8][bDat_filtH]);
    settings.setValue("Band8_FiltL",bands[8][bDat_filtL]);
    settings.setValue("Band8_Index",bands[8][bDat_index]);

    settings.setValue("Band9_Mem00",bands[9][bDat_mem00]);
    settings.setValue("Band9_Mem01",bands[9][bDat_mem01]);
    settings.setValue("Band9_Mem02",bands[9][bDat_mem02]);
    settings.setValue("Band9_Mem03",bands[9][bDat_mem03]);
    settings.setValue("Band9_Cfreq",bands[9][bDat_cFreq]);
    settings.setValue("Band9_Fqmin",bands[9][bDat_fqmin]);
    settings.setValue("Band9_Fqmax",bands[9][bDat_fqmax]);
    settings.setValue("Band9_Modee",bands[9][bDat_modee]);
    settings.setValue("Band9_FiltH",bands[9][bDat_filtH]);
    settings.setValue("Band9_FiltL",bands[9][bDat_filtL]);
    settings.setValue("Band9_Index",bands[9][bDat_index]);

    settings.setValue("Band10_Mem00",bands[10][bDat_mem00]);
    settings.setValue("Band10_Mem01",bands[10][bDat_mem01]);
    settings.setValue("Band10_Mem02",bands[10][bDat_mem02]);
    settings.setValue("Band10_Mem03",bands[10][bDat_mem03]);
    settings.setValue("Band10_Cfreq",bands[10][bDat_cFreq]);
    settings.setValue("Band10_Fqmin",bands[10][bDat_fqmin]);
    settings.setValue("Band10_Fqmax",bands[10][bDat_fqmax]);
    settings.setValue("Band10_Modee",bands[10][bDat_modee]);
    settings.setValue("Band10_FiltH",bands[10][bDat_filtH]);
    settings.setValue("Band10_FiltL",bands[10][bDat_filtL]);
    settings.setValue("Band10_Index",bands[10][bDat_index]);

    settings.setValue("Band11_Mem00",bands[11][bDat_mem00]);
    settings.setValue("Band11_Mem01",bands[11][bDat_mem01]);
    settings.setValue("Band11_Mem02",bands[11][bDat_mem02]);
    settings.setValue("Band11_Mem03",bands[11][bDat_mem03]);
    settings.setValue("Band11_Cfreq",bands[11][bDat_cFreq]);
    settings.setValue("Band11_Fqmin",bands[11][bDat_fqmin]);
    settings.setValue("Band11_Fqmax",bands[11][bDat_fqmax]);
    settings.setValue("Band11_Modee",bands[11][bDat_modee]);
    settings.setValue("Band11_FiltH",bands[11][bDat_filtH]);
    settings.setValue("Band11_FiltL",bands[11][bDat_filtL]);
    settings.setValue("Band11_Index",bands[11][bDat_index]);
}
Ejemplo n.º 20
0
Archivo: vfo.cpp Proyecto: radi8/vfo
void vfo::on_pBtnAtoB_clicked()
{
    writeB(readA());
}
Ejemplo n.º 21
0
void vfo::on_pBtnAtoB_clicked()
{
    writeB(readA());
    emit frequencyChanged(readA()); //Doesn't matter which vfo as both now the same freq
}
Ejemplo n.º 22
0
Archivo: vfo.cpp Proyecto: 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);
        }
    }
}