1. Revision 3513 mistakenly removed needed changes to plotter.cpp.

They are restored here.
2. Fix a bug that failed to compute correct audio Tx frequency after
program restart, if Split Tx is enabled.


git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3516 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor
2013-07-31 20:18:52 +00:00
parent 4ad8294620
commit 0db0574ad3
2 changed files with 30 additions and 20 deletions
+18 -17
View File
@@ -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()