From 922226de7a692b68ba4626b8588d8044346eb0f7 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Sun, 10 Mar 2013 02:45:12 +0000 Subject: [PATCH] Starting to implement uploading to PSKReporter. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3042 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- devsetup.cpp | 9 +++++--- devsetup.h | 4 ++-- devsetup.ui | 58 +++-------------------------------------------- libpskreporter.a | Bin 0 -> 10738 bytes mainwindow.cpp | 30 ++++++++++++++++++++---- mainwindow.h | 3 +++ wsjtx.pro | 1 + 7 files changed, 41 insertions(+), 64 deletions(-) create mode 100644 libpskreporter.a diff --git a/devsetup.cpp b/devsetup.cpp index 8bb255abb..9be04d3e3 100644 --- a/devsetup.cpp +++ b/devsetup.cpp @@ -99,12 +99,11 @@ void DevSetup::initDlg() ui.idIntSpinBox->setValue(m_idInt); ui.pttComboBox->setCurrentIndex(m_pttPort); ui.saveDirEntry->setText(m_saveDir); - ui.dxccEntry->setText(m_dxccPfx); ui.comboBoxSndIn->setCurrentIndex(m_nDevIn); ui.comboBoxSndOut->setCurrentIndex(m_nDevOut); + ui.cbPSKReporter->setChecked(m_pskReporter); m_paInDevice=m_inDevList[m_nDevIn]; m_paOutDevice=m_outDevList[m_nDevOut]; - } //------------------------------------------------------- accept() @@ -125,7 +124,6 @@ void DevSetup::accept() m_idInt=ui.idIntSpinBox->value(); m_pttPort=ui.pttComboBox->currentIndex(); m_saveDir=ui.saveDirEntry->text(); - m_dxccPfx=ui.dxccEntry->text(); m_nDevIn=ui.comboBoxSndIn->currentIndex(); m_paInDevice=m_inDevList[m_nDevIn]; m_nDevOut=ui.comboBoxSndOut->currentIndex(); @@ -146,3 +144,8 @@ void DevSetup::on_myGridEntry_editingFinished() t=t.mid(0,4).toUpper()+t.mid(4,2).toLower(); ui.myGridEntry->setText(t); } + +void DevSetup::on_cbPSKReporter_clicked(bool b) +{ + m_pskReporter=b; +} diff --git a/devsetup.h b/devsetup.h index 6a231610c..e6fd50fb9 100644 --- a/devsetup.h +++ b/devsetup.h @@ -23,20 +23,20 @@ public: bool m_restartSoundIn; bool m_restartSoundOut; + bool m_pskReporter; QString m_myCall; QString m_myGrid; QString m_saveDir; QString m_azelDir; - QString m_dxccPfx; public slots: void accept(); private slots: void on_myCallEntry_editingFinished(); - void on_myGridEntry_editingFinished(); + void on_cbPSKReporter_clicked(bool checked); private: Ui::DialogSndCard ui; diff --git a/devsetup.ui b/devsetup.ui index 70fcffe57..e4161e273 100644 --- a/devsetup.ui +++ b/devsetup.ui @@ -224,66 +224,14 @@ - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - - - 0 - 20 - - - - DXCC: - - - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 20 - - - - - + - - - - 60 - 16777215 - - + - PJ9 + ENable PSK Reporter diff --git a/libpskreporter.a b/libpskreporter.a new file mode 100644 index 0000000000000000000000000000000000000000..f479d6aef6b6608788181203abe4f94cf7e07793 GIT binary patch literal 10738 zcmeI1TW{Mo6o8NAq)EN*UKHJ}P=*u*hQN~@Tk(dX2)dzLx1uPPbQp%Bj*`f=7R51a zZ77Oi$ip6rJ@vQjc@O<9`we?ucMd6DBvF=(VJS4207;qWkQ5I;9+TACb#HPoywUjB zPKMT|+wOIGt*tHFc9=*{ZM)ZM#})P(0PrqAeGIVt7r^QtJihW90L9n7o5$t3b8eXk#kykj5w z{h{w2W~5mDO{{u<6pVr>@WSAUzq9-Kwu7?Zc-)_@A!_di2S;H}y`)Uk*zx_*XI>ai zgGVFkuhq_UXjBpPZztZim#LhUi<)2f(N5$=!88gErqp$|vQb5=e|t1InH*yqC+yvg z4Pn?2_X~hWwSjje3gU9zR@8Jo)jp}|cCzwxG#l0PbTs?WnCmr4lOeVtv&}M! zX6P`x(CpW1WSMLbt&@%gA7Gm6DI3J#a1I9DZY#r}i?-u$vh=bUYzu2##0O&Vay+jz zHzo#!zMgA(l4)Hoo=HzUr}GO~umY6Q>Re&=d6hktp>xRo#!wvtn`szC!yiXSyoB)q zFM(iYT~09Bmu#wn?gjWeXP9Qnf=;i+riu z?P(mZu+D!)R%io5qPUu2`<@K=^Z%7RG$L%&bhSdCkASVm)vB(d1Ar$ z_%M6JSiGe)Z&b-EGn$=}Gt$&E$*d=7 zzJ%l3j&=C#QEH~Sp=g$SdD12Vs!B2*$yiV%OVePv1$Qx3B+FqNjzvk?YH3Yp2U%W1-XdYjDUeT)`g7Dy1ZGzW0z?v_{0m)#&1AJBlr-okoxLv?=uO!di z&SGzY^T8diJReG)$s3jR#;b~Fbx3D4SDWW6F}unm--t^nv*24y70-#G8*Xs2@&b~# zN|L6&dFJ%c4KN#33V3$Q@{HGLEU2BvQ=HtQeexa$ zfO)jD+$aB_^*d{y9GUep`{ZBDdeSqKS1Rk7&n0-)E;j!M-uXke>h+V~t+<3T3m#&s zyfXru9KIQ9gH8d}-I7!dg$wRYV#wSnAdeSGqH3z**lHT}h8P=`x-r^!# z*Sa76C@!JQf}5DiyT^FQDQ0D90j--QX)#DVWvdGsi?uiNdQ+L2P{mRUzQR=cTW#1W zb`z2Ua?5_N>tyfL7UZfs;(7MCHA!ybs9kAt-y>`>C~|wefTb4P!(5V^9Cixcw6K8R zvR~-Bi*Fn>6?yxHdG3Tk=T|#bQ~Oo+zI2;NK{5O(FJLMD-(apYtPed4aZ+lg_#gGt BCQtwX literal 0 HcmV?d00001 diff --git a/mainwindow.cpp b/mainwindow.cpp index 8fd9a8331..b565859cf 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -218,6 +218,28 @@ MainWindow::MainWindow(QWidget *parent) : if(ui->actionCuteSDR->isChecked()) on_actionCuteSDR_triggered(); if(ui->actionAFMHot->isChecked()) on_actionAFMHot_triggered(); if(ui->actionBlue->isChecked()) on_actionBlue_triggered(); + + /* + if(m_pskReporter) { + int rc=0; + rc=ReporterInitialize(NULL,NULL); + qDebug() << "A" << m_pskReporter << rc; + + wchar_t buffer[256]; + rc=ReporterGetInformation(buffer,256); + qDebug() << "B" << rc << QString::fromStdWString(buffer); + + const wchar_t* tremote=L"call\0W8WNA\0gridsquare\0EM77\0freq\050280000\0mode\0JT9\0snr\0-17\0\0"; + const wchar_t* tlocal=L"station_callsign\0K1JT\0my_gridsquare\0FN20qi\0programid\0WSJT-X\0\0"; + int flags=REPORTER_SOURCE_AUTOMATIC | REPORTER_SOURCE_TEST; + rc=ReporterSeenCallsign(tremote,tlocal,flags); + rc=ReporterGetInformation(buffer,256); + qDebug() << "C" << rc << QString::fromStdWString(buffer); + rc=ReporterUninitialize(); + qDebug() << "D" << rc; + } + */ + } // End of MainWindow constructor //--------------------------------------------------- MainWindow destructor @@ -263,7 +285,6 @@ void MainWindow::writeSettings() settings.setValue("IDint",m_idInt); settings.setValue("PTTport",m_pttPort); settings.setValue("SaveDir",m_saveDir); - settings.setValue("DXCCpfx",m_dxccPfx); settings.setValue("SoundInIndex",m_nDevIn); settings.setValue("paInDevice",m_paInDevice); settings.setValue("SoundOutIndex",m_nDevOut); @@ -285,6 +306,7 @@ void MainWindow::writeSettings() settings.setValue("TxFreq",m_txFreq); settings.setValue("Tol",m_tol); settings.setValue("InGain",m_inGain); + settings.setValue("PSKReporter",m_pskReporter); settings.endGroup(); } @@ -310,7 +332,6 @@ void MainWindow::readSettings() m_idInt=settings.value("IDint",0).toInt(); m_pttPort=settings.value("PTTport",0).toInt(); m_saveDir=settings.value("SaveDir",m_appDir + "/save").toString(); - m_dxccPfx=settings.value("DXCCpfx","").toString(); m_nDevIn = settings.value("SoundInIndex", 0).toInt(); m_paInDevice = settings.value("paInDevice",0).toInt(); m_nDevOut = settings.value("SoundOutIndex", 0).toInt(); @@ -348,6 +369,7 @@ void MainWindow::readSettings() ui->actionF4_sets_Tx6->setChecked(m_kb8rq); m_monitorStartOFF=settings.value("MonitorOFF",false).toBool(); ui->actionMonitor_OFF_at_startup->setChecked(m_monitorStartOFF); + m_pskReporter=settings.value("PSKReporter",false).toBool(); settings.endGroup(); if(!ui->actionLinrad->isChecked() && !ui->actionCuteSDR->isChecked() && @@ -434,9 +456,9 @@ void MainWindow::on_actionDeviceSetup_triggered() //Setup Dialog dlg.m_idInt=m_idInt; dlg.m_pttPort=m_pttPort; dlg.m_saveDir=m_saveDir; - dlg.m_dxccPfx=m_dxccPfx; dlg.m_nDevIn=m_nDevIn; dlg.m_nDevOut=m_nDevOut; + dlg.m_pskReporter=m_pskReporter; dlg.initDlg(); if(dlg.exec() == QDialog::Accepted) { @@ -445,11 +467,11 @@ void MainWindow::on_actionDeviceSetup_triggered() //Setup Dialog m_idInt=dlg.m_idInt; m_pttPort=dlg.m_pttPort; m_saveDir=dlg.m_saveDir; - m_dxccPfx=dlg.m_dxccPfx; m_nDevIn=dlg.m_nDevIn; m_paInDevice=dlg.m_paInDevice; m_nDevOut=dlg.m_nDevOut; m_paOutDevice=dlg.m_paOutDevice; + m_pskReporter=dlg.m_pskReporter; if(dlg.m_restartSoundIn) { soundInThread.quit(); diff --git a/mainwindow.h b/mainwindow.h index 98ab62b87..a91a9cf7f 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -6,6 +6,7 @@ #include "soundin.h" #include "soundout.h" #include "commons.h" +#include "PSKReporter.h" //--------------------------------------------------------------- MainWindow namespace Ui { @@ -159,6 +160,7 @@ private: bool m_bsynced; bool m_bdecoded; bool m_monitorStartOFF; + bool m_pskReporter; char m_decoded[80]; @@ -223,6 +225,7 @@ extern void getDev(int* numDevices,char hostAPI_DeviceName[][50], int minChan[], int maxChan[], int minSpeed[], int maxSpeed[]); extern int ptt(int nport, int itx, int* iptt); +//extern int ReporterInitialize(char* hostname, char* port); extern "C" { diff --git a/wsjtx.pro b/wsjtx.pro index 99e713759..91dfb2625 100644 --- a/wsjtx.pro +++ b/wsjtx.pro @@ -63,6 +63,7 @@ win32 { INCLUDEPATH += c:/qwt-6.0.1/include LIBS += ../wsjtx/lib/libjt9.a LIBS += ../wsjtx/libfftw3f_win.a +LIBS += ../wsjtx/libpskreporter.a LIBS += ../QtSupport/palir-02.dll LIBS += libwsock32 LIBS += C:/MinGW/lib/libf95.a