diff --git a/mainwindow.cpp b/mainwindow.cpp index 268c94c63..2c2c5eedd 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -643,8 +643,8 @@ void MainWindow::readSettings() m_fMin=settings.value("fMin",2500).toInt(); m_bSplit=settings.value("TxSplit",false).toBool(); m_bXIT=settings.value("UseXit",false).toBool(); - m_plus2kHz=settings.value("Plus2kHz",false).toBool(); - ui->cbPlus2kHz->setChecked(m_plus2kHz); + m_plus2kHz=settings.value("Plus2kHz",false).toBool(); + ui->cbPlus2kHz->setChecked(m_plus2kHz); settings.endGroup(); if(!ui->actionLinrad->isChecked() and !ui->actionCuteSDR->isChecked()and @@ -1861,7 +1861,16 @@ void MainWindow::guiUpdate() } if(m_catEnabled and !m_bRigOpen) { - rigOpen(); + rigOpen(); + if(m_bSplit or m_bXIT) setXIT(m_txFreq); + if(m_bRigOpen and !m_bSplit) { + int ret=rig->setSplitFreq(MHz(m_dialFreq),RIG_VFO_B); + if(ret!=RIG_OK) { + QString rt; + rt.sprintf("Setting VFO_B failed: %d",ret); + msgBox(rt); + } + } } if(nsec != m_sec0) { //Once per second diff --git a/plotter.cpp b/plotter.cpp index 9aad79453..537382601 100644 --- a/plotter.cpp +++ b/plotter.cpp @@ -488,28 +488,29 @@ void CPlotter::setPalette(QString palette) //setPalette() return; } - FILE* fp=NULL; - if(palette=="Blue") fp=fopen("blue.dat","r"); - if(palette=="AFMHot") fp=fopen("afmhot.dat","r"); - if(palette=="Gray1") fp=fopen("gray1.dat","r"); - if(fp==NULL) { + QFile f; + if(palette=="Blue") f.setFileName("blue.dat"); + if(palette=="AFMHot") f.setFileName("afmhot.dat"); + if(palette=="Gray1") f.setFileName("gray1.dat"); + if(f.open(QIODevice::ReadOnly)) { + QTextStream in(&f); + int n,r,g,b; + float xr,xg,xb; + for(int i=0; i<256; i++) { + in >> n >> xr >> xg >> xb; + r=255.0*xr + 0.5; + g=255.0*xg + 0.5; + b=255.0*xb + 0.5; + m_ColorTbl[i].setRgb(r,g,b); + } + f.close(); + } else { QMessageBox msgBox0; QString t="Error: Cannot find requested palette file."; msgBox0.setText(t); msgBox0.exec(); return; - } - - int n,r,g,b; - float xr,xg,xb; - for(int i=0; i<256; i++) { - int nn=fscanf(fp,"%d%f%f%f",&n,&xr,&xg,&xb); - r=255.0*xr + 0.5; - g=255.0*xg + 0.5; - b=255.0*xb + 0.5; - m_ColorTbl[i].setRgb(r,g,b); - if(nn==-999999) i++; //Silence compiler warning - } + } } double CPlotter::fGreen()