void vfo::setFrequency(int freq) { if (selectedVFO == 'A' || selectedVFO == 'S') { writeA(freq); } else if (!ui->pBtnSubRx->isChecked()) { writeB(freq); } else writeA(freq); }
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. }
int main(int argc, char *argv[]) { pthread_t tid; /* the thread identifier */ pthread_attr_t attr; /* set of thread attributes */ writeA(); if(atoi(argv[1]) >= atoi(argv[2])) { struct arguments arg; arg.n = atoi(argv[1]); arg.k = atoi(argv[2]); /* get the default attributes */ pthread_attr_init( &attr ); pthread_create( &tid, &attr, combination,(void *) & arg); pthread_join( tid, NULL ); printf("El resultado de la combinacion es: %f\n", result); } else printf("El primero argumento tiene que ser mayor o igual que el segundo\n"); return 0; }
void vfo::on_pBtnExch_clicked() { int exchTemp; exchTemp = readA(); writeA(readB()); writeB(exchTemp); }
void cLog::xwriteA(LPCSTR format, ... ) { ZLockHolder holder(&m_formatWriteMutex); va_list vl; va_start (vl, format); vsnprintf_s (g_szMutiBuffer, MAX_SIZE_BUFFER, MAX_SIZE_BUFFER, format, vl); va_end (vl); writeA(g_szMutiBuffer); }
void vfo::on_toolBtnDn_clicked() { switch (selectedVFO) { case 'A': case 'S': { writeA(readA() - 24000); break; } case 'B': writeB(readB() - 24000); } }
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); } }
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; }
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); } }
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()); } }
// // write model (pi, A, B) to file // void writeModel(double *pi, double **A, double **B, int N, int M, int T, char **alphabet, FILE *out) { fprintf(out, "N=%d, M=%d, T=%d\n", N, M, T); fprintf(out, "I:\n"); writePi(pi, N, out); fprintf(out, "A:\n"); writeA(A, N, out); fprintf(out, "B:\n"); writeBT(B, N, M, alphabet, out); }
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(); }
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()); } } }
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()); } } } }
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); } }
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. }
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. }
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. }
void vfo::on_pBtnBtoA_clicked() { writeA(readB()); }
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); } } }
void vfo::on_pBtnBtoA_clicked() { writeA(readB()); emit frequencyChanged(readB()); }