Added "#ifdef WIN32 ... #endif" around HRD interface code.

(Did I get them all??)


git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3291 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2013-05-21 21:36:34 +00:00
parent d27b171368
commit d7f2ca2bd4
5 changed files with 12 additions and 13 deletions

View File

@ -534,6 +534,7 @@ void DevSetup::on_pttMethodComboBox_currentIndexChanged(int index)
ui.pttComboBox->setEnabled(b); ui.pttComboBox->setEnabled(b);
} }
/*
void DevSetup::on_pbHRD_clicked() void DevSetup::on_pbHRD_clicked()
{ {
@ -570,3 +571,4 @@ void DevSetup::on_pbHRD_clicked()
qDebug() << "Connection to HRD failed."; qDebug() << "Connection to HRD failed.";
} }
} }
*/

View File

@ -90,11 +90,8 @@ private slots:
void on_rbData_toggled(bool checked); void on_rbData_toggled(bool checked);
void on_pollSpinBox_valueChanged(int n); void on_pollSpinBox_valueChanged(int n);
void on_pttComboBox_currentIndexChanged(int index); void on_pttComboBox_currentIndexChanged(int index);
void on_pttMethodComboBox_currentIndexChanged(int index); void on_pttMethodComboBox_currentIndexChanged(int index);
void on_pbHRD_clicked();
private: private:
Rig* rig; Rig* rig;
void msgBox(QString t); void msgBox(QString t);

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>548</width> <width>548</width>
<height>465</height> <height>468</height>
</rect> </rect>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
@ -104,13 +104,6 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item>
<widget class="QPushButton" name="pbHRD">
<property name="text">
<string>HRD</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
<property name="sizePolicy"> <property name="sizePolicy">

View File

@ -1,4 +1,4 @@
//-------------------------------------------------------------- MainWindow //--------------------------------------------------------------- MainWindow
#include "mainwindow.h" #include "mainwindow.h"
#include "ui_mainwindow.h" #include "ui_mainwindow.h"
#include "devsetup.h" #include "devsetup.h"

View File

@ -80,6 +80,7 @@ int Rig::init(rig_model_t rig_model)
int Rig::open(int n) { int Rig::open(int n) {
m_hrd=(n==9999); m_hrd=(n==9999);
if(m_hrd) { if(m_hrd) {
#ifdef WIN32
bool bConnect=false; bool bConnect=false;
bConnect = HRDInterfaceConnect(L"localhost",7809); bConnect = HRDInterfaceConnect(L"localhost",7809);
if(bConnect) { if(bConnect) {
@ -91,6 +92,7 @@ int Rig::open(int n) {
m_hrd=false; m_hrd=false;
return -1; return -1;
} }
#endif
} else { } else {
return rig_open(theRig); return rig_open(theRig);
} }
@ -98,8 +100,9 @@ int Rig::open(int n) {
int Rig::close(void) { int Rig::close(void) {
if(m_hrd) { if(m_hrd) {
#ifdef WIN32
HRDInterfaceDisconnect(); HRDInterfaceDisconnect();
#endif
} else { } else {
return rig_close(theRig); return rig_close(theRig);
} }
@ -112,6 +115,7 @@ int Rig::setConf(const char *name, const char *val)
int Rig::setFreq(freq_t freq, vfo_t vfo) { int Rig::setFreq(freq_t freq, vfo_t vfo) {
if(m_hrd) { if(m_hrd) {
#ifdef WIN32
QString t; QString t;
int nhz=(int)freq; int nhz=(int)freq;
t=m_context + "Set Frequency-Hz " + QString::number(nhz); t=m_context + "Set Frequency-Hz " + QString::number(nhz);
@ -124,6 +128,7 @@ int Rig::setFreq(freq_t freq, vfo_t vfo) {
} else { } else {
return -1; return -1;
} }
#endif
} else { } else {
return rig_set_freq(theRig, vfo, freq); return rig_set_freq(theRig, vfo, freq);
} }
@ -133,12 +138,14 @@ freq_t Rig::getFreq(vfo_t vfo)
{ {
freq_t freq; freq_t freq;
if(m_hrd) { if(m_hrd) {
#ifdef WIN32
const wchar_t* cmnd = (const wchar_t*) (m_context+"Get Frequency").utf16(); const wchar_t* cmnd = (const wchar_t*) (m_context+"Get Frequency").utf16();
const wchar_t* freqString=HRDInterfaceSendMessage(cmnd); const wchar_t* freqString=HRDInterfaceSendMessage(cmnd);
QString t2=QString::fromWCharArray (freqString,-1); QString t2=QString::fromWCharArray (freqString,-1);
HRDInterfaceFreeString(freqString); HRDInterfaceFreeString(freqString);
freq=t2.toDouble(); freq=t2.toDouble();
return freq; return freq;
#endif
} else { } else {
rig_get_freq(theRig, vfo, &freq); rig_get_freq(theRig, vfo, &freq);
return freq; return freq;