Removing GUI widgets not needed fot JTMS3.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/jtms3@2490 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2012-07-05 19:18:58 +00:00
parent 93224b3b31
commit 9512b47f78
4 changed files with 71 additions and 101 deletions

View File

@ -6,40 +6,9 @@
extern "C" { extern "C" {
extern struct { //This is "common/datcom/..." in Fortran extern struct { //This is "common/datcom/..." in Fortran
float d2[30*48000]; //Raw data short int d2[30*48000]; //Raw data
int kin; int kin;
int ndiskdat; int ndiskdat;
/*
float ss[4*322*NFFT]; //Half-symbol spectra at 0,45,90,135 deg pol
float savg[4*NFFT]; //Avg spectra at 0,45,90,135 deg pol
double fcenter; //Center freq from Linrad (MHz)
int nutc; //UTC as integer, HHMM
int idphi; //Phase correction for Y pol'n, degrees
int mousedf; //User-selected DF
int mousefqso; //User-selected QSO freq (kHz)
int nagain; //1 ==> decode only at fQSO +/- Tol
int ndepth; //How much hinted decoding to do?
int ndiskdat; //1 ==> data read from *.tf2 or *.iq file
int neme; //Hinted decoding tries only for EME calls
int newdat; //1 ==> new data, must do long FFT
int nfa; //Low decode limit (kHz)
int nfb; //High decode limit (kHz)
int nfcal; //Frequency correction, for calibration (Hz)
int nfshift; //Shift of displayed center freq (kHz)
int mcall3; //1 ==> CALL3.TXT has been modified
int ntimeout; //Max for timeouts in Messages and BandMap
int ntol; //+/- decoding range around fQSO (Hz)
int nxant; //1 ==> add 45 deg to measured pol angle
int map65RxLog; //Flags to control log files
int nfsample; //Input sample rate
int nxpol; //1 if using xpol antennas, 0 otherwise
int mode65; //JT65 sub-mode: A=1, B=2, C=4
char mycall[12];
char mygrid[6];
char hiscall[12];
char hisgrid[6];
char datetime[20];
*/
} datcom_; } datcom_;
} }

View File

@ -25,6 +25,22 @@ void getfile(QString fname, bool xpol, int dbDgrd)
void savewav(QString fname) void savewav(QString fname)
{ {
struct {
char ariff[4];
int nchunk;
char awave[4];
char afmt[4];
int lenfmt;
short int nfmt2;
short int nchan2;
int nsamrate;
int nbytesec;
short int nbytesam2;
short int nbitsam2;
char adata[4];
int ndata;
} hdr;
int npts=30*48000; int npts=30*48000;
// qint16* buf=(qint16*)malloc(2*npts); // qint16* buf=(qint16*)malloc(2*npts);
char name[80]; char name[80];
@ -33,8 +49,33 @@ void savewav(QString fname)
if(fp != NULL) { if(fp != NULL) {
// Write a WAV header // Write a WAV header
// fwrite(&datcom_.fcenter,sizeof(datcom_.fcenter),1,fp); hdr.ariff[0]='R';
hdr.ariff[1]='I';
hdr.ariff[2]='F';
hdr.ariff[3]='F';
hdr.nchunk=0;
hdr.awave[0]='W';
hdr.awave[0]='A';
hdr.awave[0]='V';
hdr.awave[0]='E';
hdr.afmt[0]='f';
hdr.afmt[1]='m';
hdr.afmt[2]='t';
hdr.afmt[3]=' ';
hdr.lenfmt=16;
hdr.nfmt2=1;
hdr.nchan2=1;
hdr.nsamrate=48000;
hdr.nbytesec=2*48000;
hdr.nbytesam2=2;
hdr.nbitsam2=16;
hdr.adata[0]='d';
hdr.adata[1]='a';
hdr.adata[2]='t';
hdr.adata[3]='a';
hdr.ndata=2*npts;
fwrite(&hdr,sizeof(hdr),1,fp);
// memcpy(datcom_.d2,buf,2*npts); // memcpy(datcom_.d2,buf,2*npts);
// fwrite(buf,2,npts,fp); // fwrite(buf,2,npts,fp);
fwrite(datcom_.d2,2,npts,fp); fwrite(datcom_.d2,2,npts,fp);

View File

@ -174,7 +174,7 @@ MainWindow::MainWindow(QWidget *parent) :
border-style: outset; border-width: 1px; border-radius: 5px; \ border-style: outset; border-width: 1px; border-radius: 5px; \
border-color: black; min-width: 5em; padding: 3px;}"; border-color: black; min-width: 5em; padding: 3px;}";
genStdMsgs(""); genStdMsgs("-26");
on_actionWide_Waterfall_triggered(); //### on_actionWide_Waterfall_triggered(); //###
if(m_mode=="JT65A") on_actionJT65A_triggered(); if(m_mode=="JT65A") on_actionJT65A_triggered();
@ -401,6 +401,8 @@ void MainWindow::dataSink(int k)
static int nwrite=0; static int nwrite=0;
static int k0=99999999; static int k0=99999999;
static float px=0.0; static float px=0.0;
static float sq0=0.0;
static float sqave=1000.0;
if(k < k0) { if(k < k0) {
nwrite=0; nwrite=0;
@ -414,13 +416,17 @@ void MainWindow::dataSink(int k)
datcom_.ndiskdat=0; datcom_.ndiskdat=0;
} }
double sq=0.0; float sq=0.0;
float x; float x;
float fac=1.0/30.0;
for(int i=0; i<6192; i++) { for(int i=0; i<6192; i++) {
x=datcom_.d2[k-6192+i]; x=fac*datcom_.d2[k-6192+i];
sq += x*x; sq += x*x;
} }
px = 10.0*log10(sq/6192.0) + 70.0; // Why +70 ??? sqave=0.5*(sq+sq0);
sq0=sq;
// qDebug() << "rms:" << sqrt(sq/6192.0);
px = 10.0*log10(sqave/6192.0);
if(px>60.0) px=60.0; if(px>60.0) px=60.0;
if(px<0.0) px=0.0; if(px<0.0) px=0.0;
QString t; QString t;
@ -466,8 +472,12 @@ void MainWindow::dataSink(int k)
if(m_saveAll) { if(m_saveAll) {
QDateTime t = QDateTime::currentDateTimeUtc(); QDateTime t = QDateTime::currentDateTimeUtc();
m_dateTime=t.toString("yyyy-MMM-dd hh:mm"); m_dateTime=t.toString("yyyy-MMM-dd hh:mm");
QString fname=m_saveDir + "/" + t.date().toString("yyMMdd") + "_" + QString fname=m_saveDir + "/" + m_hisCall + "_" +
t.time().toString("hhmm") + ".wav"; t.date().toString("yyMMdd") + "_" +
t.time().toString("hhmmss") + ".wav";
int i0=fname.indexOf(".wav");
if(fname.mid(i0-2,2)=="29") fname=fname.mid(0,i0-2)+"00.wav";
if(fname.mid(i0-2,2)=="59") fname=fname.mid(0,i0-2)+"30.wav";
*future2 = QtConcurrent::run(savewav, fname); *future2 = QtConcurrent::run(savewav, fname);
watcher2->setFuture(*future2); watcher2->setFuture(*future2);
} }
@ -616,13 +626,13 @@ void MainWindow::keyPressEvent( QKeyEvent *e ) //keyPressEvent
break; break;
case Qt::Key_G: case Qt::Key_G:
if(e->modifiers() & Qt::AltModifier) { if(e->modifiers() & Qt::AltModifier) {
genStdMsgs(""); genStdMsgs("-26");
break; break;
} }
case Qt::Key_L: case Qt::Key_L:
if(e->modifiers() & Qt::ControlModifier) { if(e->modifiers() & Qt::ControlModifier) {
lookup(); lookup();
genStdMsgs(""); genStdMsgs("-26");
break; break;
} }
} }
@ -852,7 +862,7 @@ void MainWindow::diskWriteFinished() //diskWriteFinished
{ {
// qDebug() << "diskWriteFinished"; // qDebug() << "diskWriteFinished";
} }
//Delete ../save/*.tf2 //Delete ../save/*.wav
void MainWindow::on_actionDelete_all_wav_files_in_SaveDir_triggered() void MainWindow::on_actionDelete_all_wav_files_in_SaveDir_triggered()
{ {
int i; int i;
@ -868,7 +878,7 @@ void MainWindow::on_actionDelete_all_wav_files_in_SaveDir_triggered()
for(f=files.begin(); f!=files.end(); ++f) { for(f=files.begin(); f!=files.end(); ++f) {
fname=*f; fname=*f;
i=(fname.indexOf(".wav")); i=(fname.indexOf(".wav"));
if(i==11) dir.remove(fname); if(i>10) dir.remove(fname);
} }
} }
} }
@ -1399,6 +1409,7 @@ void MainWindow::doubleClickOnCall(QString hiscall, bool ctrl)
QString rpt=""; QString rpt="";
if(ctrl) rpt=t2.mid(23,3); if(ctrl) rpt=t2.mid(23,3);
lookup(); lookup();
rpt="-26";
genStdMsgs(rpt); genStdMsgs(rpt);
if(t2.indexOf(m_myCall)>0) { if(t2.indexOf(m_myCall)>0) {
m_ntx=2; m_ntx=2;

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>616</width> <width>616</width>
<height>477</height> <height>460</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -244,7 +244,7 @@ p, li { white-space: pre-wrap; }
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QwtThermo" name="xThermo"> <widget class="QwtThermo" name="xThermo" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -257,19 +257,19 @@ p, li { white-space: pre-wrap; }
<height>180</height> <height>180</height>
</size> </size>
</property> </property>
<property name="borderWidth"> <property name="borderWidth" stdset="0">
<number>1</number> <number>1</number>
</property> </property>
<property name="maxValue"> <property name="maxValue" stdset="0">
<double>60.000000000000000</double> <double>60.000000000000000</double>
</property> </property>
<property name="minValue"> <property name="minValue" stdset="0">
<double>0.000000000000000</double> <double>0.000000000000000</double>
</property> </property>
<property name="pipeWidth"> <property name="pipeWidth" stdset="0">
<number>8</number> <number>8</number>
</property> </property>
<property name="value"> <property name="value" stdset="0">
<double>0.000000000000000</double> <double>0.000000000000000</double>
</property> </property>
</widget> </widget>
@ -530,19 +530,6 @@ p, li { white-space: pre-wrap; }
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QPushButton" name="setTxFreqButton">
<property name="maximumSize">
<size>
<width>70</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Set Tx Freq</string>
</property>
</widget>
</item>
<item> <item>
<spacer name="verticalSpacer"> <spacer name="verticalSpacer">
<property name="orientation"> <property name="orientation">
@ -559,44 +546,6 @@ p, li { white-space: pre-wrap; }
</property> </property>
</spacer> </spacer>
</item> </item>
<item>
<widget class="QCheckBox" name="NBcheckBox">
<property name="text">
<string>NB</string>
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="NBslider">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>70</width>
<height>16777215</height>
</size>
</property>
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="value">
<number>40</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>