Clean up the devsetup window. Some fixes to getfile and savewav.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/jtms3@2486 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2012-07-04 18:22:38 +00:00
parent e3b980ad85
commit a199729efb
4 changed files with 140 additions and 193 deletions

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>392</width> <width>462</width>
<height>379</height> <height>341</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -23,16 +23,16 @@
<attribute name="title"> <attribute name="title">
<string>Station</string> <string>Station</string>
</attribute> </attribute>
<widget class="QWidget" name="layoutWidget"> <widget class="QWidget" name="">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>12</x> <x>10</x>
<y>33</y> <y>34</y>
<width>348</width> <width>421</width>
<height>267</height> <height>216</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_6"> <layout class="QVBoxLayout" name="verticalLayout_8">
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<item> <item>
@ -121,6 +121,12 @@
</item> </item>
<item> <item>
<widget class="QSpinBox" name="idIntSpinBox"> <widget class="QSpinBox" name="idIntSpinBox">
<property name="maximumSize">
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
<property name="minimum"> <property name="minimum">
<number>-20</number> <number>-20</number>
</property> </property>
@ -245,52 +251,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QLabel" name="label_8">
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="text">
<string>Timeout (min):</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_9">
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="text">
<string>Fcal (Hz):</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_11">
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="text">
<string>Fadd (MHz)</string>
</property>
</widget>
</item>
<item> <item>
<spacer name="verticalSpacer"> <spacer name="verticalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeType"> <property name="sizeType">
<enum>QSizePolicy::Fixed</enum> <enum>QSizePolicy::Expanding</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
@ -308,7 +275,7 @@
<widget class="QLineEdit" name="dxccEntry"> <widget class="QLineEdit" name="dxccEntry">
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>16777215</width> <width>60</width>
<height>16777215</height> <height>16777215</height>
</size> </size>
</property> </property>
@ -317,37 +284,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QSpinBox" name="timeoutSpinBox">
<property name="maximum">
<number>20</number>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="fCalSpinBox">
<property name="minimum">
<number>-2000</number>
</property>
<property name="maximum">
<number>2000</number>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="faddEntry">
<property name="text">
<string>0.0</string>
</property>
</widget>
</item>
<item> <item>
<spacer name="verticalSpacer_3"> <spacer name="verticalSpacer_3">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeType"> <property name="sizeType">
<enum>QSizePolicy::Fixed</enum> <enum>QSizePolicy::Expanding</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
@ -362,116 +305,130 @@
</layout> </layout>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_3"> <spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item> <item>
<widget class="QLabel" name="label_10"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="minimumSize"> <item>
<widget class="QLabel" name="label_6">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Audio In:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBoxSndIn">
<property name="enabled">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="label_7">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Audio Out:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBoxSndOut"/>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size> <size>
<width>75</width> <width>20</width>
<height>20</height> <height>40</height>
</size> </size>
</property> </property>
<property name="text"> </spacer>
<string>Save Directory:</string>
</property>
</widget>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="saveDirEntry"> <layout class="QHBoxLayout" name="horizontalLayout">
<property name="text"> <item>
<string>C:\Users\joe\wsjt\map65\save</string> <widget class="QLabel" name="label_10">
</property> <property name="sizePolicy">
</widget> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>75</width>
<height>20</height>
</size>
</property>
<property name="text">
<string>Save Directory:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="saveDirEntry">
<property name="text">
<string>C:\Users\joe\wsjt\map65\save</string>
</property>
</widget>
</item>
</layout>
</item> </item>
</layout> </layout>
</item> </item>
</layout> </layout>
</widget> </widget>
</widget> </widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>I/O Devices</string>
</attribute>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>1</x>
<y>73</y>
<width>351</width>
<height>151</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_7">
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>55</height>
</size>
</property>
<property name="title">
<string>Input Device (Rx Audio)</string>
</property>
<widget class="QComboBox" name="comboBoxSndIn">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>15</x>
<y>16</y>
<width>291</width>
<height>22</height>
</rect>
</property>
</widget>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>55</height>
</size>
</property>
<property name="title">
<string>Output Device (Tx Audio)</string>
</property>
<widget class="QComboBox" name="comboBoxSndOut">
<property name="geometry">
<rect>
<x>10</x>
<y>20</y>
<width>291</width>
<height>22</height>
</rect>
</property>
</widget>
</widget>
</item>
</layout>
</widget>
</widget>
</widget> </widget>
</item> </item>
<item> <item>

View File

@ -54,7 +54,7 @@ void getfile(QString fname, bool xpol, int dbDgrd)
} }
} }
void savetf2(QString fname, bool xpol) void savewav(QString fname)
{ {
/* /*
int npts=2*52*96000; int npts=2*52*96000;

View File

@ -14,7 +14,7 @@ short int iwave[30*48000]; //Wave file for Tx audio
int nwave; //Length of Tx waveform int nwave; //Length of Tx waveform
bool btxok; //True if OK to transmit bool btxok; //True if OK to transmit
double outputLatency; //Latency in seconds double outputLatency; //Latency in seconds
qint16 id[4*60*96000]; qint16 id[30*48000];
WideGraph* g_pWideGraph = NULL; WideGraph* g_pWideGraph = NULL;
QSharedMemory mem_m65("mem_m65"); QSharedMemory mem_m65("mem_m65");
@ -23,9 +23,6 @@ QString rev="$Rev$";
QString Program_Title_Version=" JTMS3 v0.1, r" + rev.mid(6,4) + QString Program_Title_Version=" JTMS3 v0.1, r" + rev.mid(6,4) +
" by K1JT"; " by K1JT";
extern const int RxDataFrequency = 96000;
extern const int TxDataFrequency = 11025;
//-------------------------------------------------- MainWindow constructor //-------------------------------------------------- MainWindow constructor
MainWindow::MainWindow(QWidget *parent) : MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent), QMainWindow(parent),
@ -206,12 +203,7 @@ MainWindow::MainWindow(QWidget *parent) :
m_diskData=false; m_diskData=false;
m_tol=500; m_tol=500;
g_pWideGraph->setTol(m_tol); g_pWideGraph->setTol(m_tol);
g_pWideGraph->setFcal(m_fCal); g_pWideGraph->setFsample(48000);
if(m_fs96000) g_pWideGraph->setFsample(96000);
if(!m_fs96000) g_pWideGraph->setFsample(95238);
g_pWideGraph->m_mult570=m_mult570;
g_pWideGraph->m_cal570=m_cal570;
if(m_initIQplus) g_pWideGraph->initIQplus();
// Create "m_worked", a dictionary of all calls in wsjt.log // Create "m_worked", a dictionary of all calls in wsjt.log
QFile f("wsjt.log"); QFile f("wsjt.log");
@ -462,23 +454,19 @@ void MainWindow::dataSink(int k)
n60z=n60; n60z=n60;
n=0; n=0;
} }
*/
int ihsym=0;
if(ihsym == 279) { if(ihsym == 279) {
datcom_.newdat=1;
datcom_.nagain=0;
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");
decode(); //Start the decoder
if(m_saveAll) { if(m_saveAll) {
QString fname=m_saveDir + "/" + t.date().toString("yyMMdd") + "_" + QString fname=m_saveDir + "/" + t.date().toString("yyMMdd") + "_" +
t.time().toString("hhmm"); t.time().toString("hhmm") + ".wav";
if(m_xpol) fname += ".tf2"; *future2 = QtConcurrent::run(savewav, fname);
if(!m_xpol) fname += ".iq";
*future2 = QtConcurrent::run(savetf2, fname, m_xpol);
watcher2->setFuture(*future2); watcher2->setFuture(*future2);
} }
} }
*/
soundInThread.m_dataSinkBusy=false; soundInThread.m_dataSinkBusy=false;
} }
@ -838,11 +826,12 @@ void MainWindow::on_actionDecode_remaining_files_in_directory_triggered()
void MainWindow::diskDat() //diskDat() void MainWindow::diskDat() //diskDat()
{ {
double hsym;
//These may be redundant?? //These may be redundant??
m_diskData=true; m_diskData=true;
// datcom_.newdat=1; // datcom_.newdat=1;
/*
double hsym;
if(m_fs96000) hsym=2048.0*96000.0/11025.0; //Samples per JT65 half-symbol if(m_fs96000) hsym=2048.0*96000.0/11025.0; //Samples per JT65 half-symbol
if(!m_fs96000) hsym=2048.0*95238.1/11025.0; if(!m_fs96000) hsym=2048.0*95238.1/11025.0;
for(int i=0; i<281; i++) { // Do the half-symbol FFTs for(int i=0; i<281; i++) { // Do the half-symbol FFTs
@ -850,6 +839,7 @@ void MainWindow::diskDat() //diskDat()
dataSink(k); dataSink(k);
if(i%10 == 0) qApp->processEvents(); //Keep the GUI responsive if(i%10 == 0) qApp->processEvents(); //Keep the GUI responsive
} }
*/
} }
void MainWindow::diskWriteFinished() //diskWriteFinished void MainWindow::diskWriteFinished() //diskWriteFinished

View File

@ -239,7 +239,7 @@ private:
}; };
extern void getfile(QString fname, bool xpol, int idInt); extern void getfile(QString fname, bool xpol, int idInt);
extern void savetf2(QString fname, bool xpol); extern void savewav(QString fname);
extern int killbyname(const char* progName); extern int killbyname(const char* progName);
extern void getDev(int* numDevices,char hostAPI_DeviceName[][50], extern void getDev(int* numDevices,char hostAPI_DeviceName[][50],
int minChan[], int maxChan[], int minChan[], int maxChan[],