mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-19 10:32:02 -05:00
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:
parent
811c207a19
commit
2ea895ac11
@ -534,6 +534,7 @@ void DevSetup::on_pttMethodComboBox_currentIndexChanged(int index)
|
||||
ui.pttComboBox->setEnabled(b);
|
||||
}
|
||||
|
||||
/*
|
||||
void DevSetup::on_pbHRD_clicked()
|
||||
{
|
||||
|
||||
@ -570,3 +571,4 @@ void DevSetup::on_pbHRD_clicked()
|
||||
qDebug() << "Connection to HRD failed.";
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
@ -90,11 +90,8 @@ private slots:
|
||||
void on_rbData_toggled(bool checked);
|
||||
void on_pollSpinBox_valueChanged(int n);
|
||||
void on_pttComboBox_currentIndexChanged(int index);
|
||||
|
||||
void on_pttMethodComboBox_currentIndexChanged(int index);
|
||||
|
||||
void on_pbHRD_clicked();
|
||||
|
||||
private:
|
||||
Rig* rig;
|
||||
void msgBox(QString t);
|
||||
|
@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>548</width>
|
||||
<height>465</height>
|
||||
<height>468</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
@ -104,13 +104,6 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pbHRD">
|
||||
<property name="text">
|
||||
<string>HRD</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="sizePolicy">
|
||||
|
@ -1,4 +1,4 @@
|
||||
//-------------------------------------------------------------- MainWindow
|
||||
//--------------------------------------------------------------- MainWindow
|
||||
#include "mainwindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
#include "devsetup.h"
|
||||
|
@ -80,6 +80,7 @@ int Rig::init(rig_model_t rig_model)
|
||||
int Rig::open(int n) {
|
||||
m_hrd=(n==9999);
|
||||
if(m_hrd) {
|
||||
#ifdef WIN32
|
||||
bool bConnect=false;
|
||||
bConnect = HRDInterfaceConnect(L"localhost",7809);
|
||||
if(bConnect) {
|
||||
@ -91,6 +92,7 @@ int Rig::open(int n) {
|
||||
m_hrd=false;
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
return rig_open(theRig);
|
||||
}
|
||||
@ -98,8 +100,9 @@ int Rig::open(int n) {
|
||||
|
||||
int Rig::close(void) {
|
||||
if(m_hrd) {
|
||||
#ifdef WIN32
|
||||
HRDInterfaceDisconnect();
|
||||
|
||||
#endif
|
||||
} else {
|
||||
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) {
|
||||
if(m_hrd) {
|
||||
#ifdef WIN32
|
||||
QString t;
|
||||
int nhz=(int)freq;
|
||||
t=m_context + "Set Frequency-Hz " + QString::number(nhz);
|
||||
@ -124,6 +128,7 @@ int Rig::setFreq(freq_t freq, vfo_t vfo) {
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
return rig_set_freq(theRig, vfo, freq);
|
||||
}
|
||||
@ -133,12 +138,14 @@ freq_t Rig::getFreq(vfo_t vfo)
|
||||
{
|
||||
freq_t freq;
|
||||
if(m_hrd) {
|
||||
#ifdef WIN32
|
||||
const wchar_t* cmnd = (const wchar_t*) (m_context+"Get Frequency").utf16();
|
||||
const wchar_t* freqString=HRDInterfaceSendMessage(cmnd);
|
||||
QString t2=QString::fromWCharArray (freqString,-1);
|
||||
HRDInterfaceFreeString(freqString);
|
||||
freq=t2.toDouble();
|
||||
return freq;
|
||||
#endif
|
||||
} else {
|
||||
rig_get_freq(theRig, vfo, &freq);
|
||||
return freq;
|
||||
|
Loading…
Reference in New Issue
Block a user