mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-05-29 12:52:28 -04:00
Enable/Disable catPort controls and labels according to need.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3292 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
2ea895ac11
commit
30e9b3649d
108
devsetup.cpp
108
devsetup.cpp
@ -36,19 +36,6 @@ void DevSetup::initDlg()
|
|||||||
char pa_device_name[128];
|
char pa_device_name[128];
|
||||||
char pa_device_hostapi[128];
|
char pa_device_hostapi[128];
|
||||||
|
|
||||||
/*
|
|
||||||
if(m_firstCall) {
|
|
||||||
QString t;
|
|
||||||
for(int i=14; i<100; i++) {
|
|
||||||
t.sprintf("COM%d",i);
|
|
||||||
ui.pttComboBox->addItem(t);
|
|
||||||
}
|
|
||||||
for(int i=0; i<10; i++) {
|
|
||||||
m_macro.append("");
|
|
||||||
}
|
|
||||||
m_firstCall=false;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
k=0;
|
k=0;
|
||||||
for(id=0; id<numDevices; id++ ) {
|
for(id=0; id<numDevices; id++ ) {
|
||||||
pdi=Pa_GetDeviceInfo(id);
|
pdi=Pa_GetDeviceInfo(id);
|
||||||
@ -148,23 +135,9 @@ void DevSetup::initDlg()
|
|||||||
ui.cbPSKReporter->setChecked(m_pskReporter);
|
ui.cbPSKReporter->setChecked(m_pskReporter);
|
||||||
m_paInDevice=m_inDevList[m_nDevIn];
|
m_paInDevice=m_inDevList[m_nDevIn];
|
||||||
m_paOutDevice=m_outDevList[m_nDevOut];
|
m_paOutDevice=m_outDevList[m_nDevOut];
|
||||||
ui.cbEnableCAT->setChecked(m_catEnabled);
|
|
||||||
ui.cbDTRoff->setChecked(m_bDTRoff);
|
enableWidgets();
|
||||||
ui.catPortComboBox->setEnabled(m_catEnabled);
|
|
||||||
ui.rigComboBox->setEnabled(m_catEnabled);
|
|
||||||
ui.serialRateComboBox->setEnabled(m_catEnabled);
|
|
||||||
ui.dataBitsComboBox->setEnabled(m_catEnabled);
|
|
||||||
ui.stopBitsComboBox->setEnabled(m_catEnabled);
|
|
||||||
ui.handshakeComboBox->setEnabled(m_catEnabled);
|
|
||||||
ui.testCATButton->setEnabled(m_catEnabled);
|
|
||||||
ui.cbDTRoff->setEnabled(m_catEnabled);
|
|
||||||
ui.rbData->setEnabled(m_catEnabled);
|
|
||||||
ui.rbMic->setEnabled(m_catEnabled);
|
|
||||||
ui.pollSpinBox->setEnabled(m_catEnabled);
|
|
||||||
bool b=m_pttMethodIndex==1 or m_pttMethodIndex==2;
|
|
||||||
ui.pttComboBox->setEnabled(b);
|
|
||||||
b=b or m_catEnabled;
|
|
||||||
ui.testPTTButton->setEnabled(b);
|
|
||||||
ui.rigComboBox->setCurrentIndex(m_rigIndex);
|
ui.rigComboBox->setCurrentIndex(m_rigIndex);
|
||||||
ui.catPortComboBox->setCurrentIndex(m_catPortIndex);
|
ui.catPortComboBox->setCurrentIndex(m_catPortIndex);
|
||||||
ui.serialRateComboBox->setCurrentIndex(m_serialRateIndex);
|
ui.serialRateComboBox->setCurrentIndex(m_serialRateIndex);
|
||||||
@ -364,7 +337,7 @@ void DevSetup::on_pttMethodComboBox_activated(int index)
|
|||||||
{
|
{
|
||||||
m_pttMethodIndex=index;
|
m_pttMethodIndex=index;
|
||||||
bool b=m_pttMethodIndex==1 or m_pttMethodIndex==2 or
|
bool b=m_pttMethodIndex==1 or m_pttMethodIndex==2 or
|
||||||
(m_catEnabled and m_pttMethodIndex==0);
|
(m_catEnabled and m_pttMethodIndex==0 and m_rig!=9999);
|
||||||
ui.testPTTButton->setEnabled(b);
|
ui.testPTTButton->setEnabled(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -377,17 +350,7 @@ void DevSetup::on_catPortComboBox_activated(int index)
|
|||||||
void DevSetup::on_cbEnableCAT_toggled(bool b)
|
void DevSetup::on_cbEnableCAT_toggled(bool b)
|
||||||
{
|
{
|
||||||
m_catEnabled=b;
|
m_catEnabled=b;
|
||||||
ui.catPortComboBox->setEnabled(b);
|
enableWidgets();
|
||||||
ui.rigComboBox->setEnabled(b);
|
|
||||||
ui.serialRateComboBox->setEnabled(b);
|
|
||||||
ui.dataBitsComboBox->setEnabled(b);
|
|
||||||
ui.stopBitsComboBox->setEnabled(b);
|
|
||||||
ui.handshakeComboBox->setEnabled(b);
|
|
||||||
ui.testCATButton->setEnabled(b);
|
|
||||||
ui.cbDTRoff->setEnabled(b);
|
|
||||||
ui.rbData->setEnabled(b);
|
|
||||||
ui.rbMic->setEnabled(b);
|
|
||||||
ui.pollSpinBox->setEnabled(m_catEnabled);
|
|
||||||
bool b2=(m_pttMethodIndex==1 or m_pttMethodIndex==2 or m_catEnabled) and
|
bool b2=(m_pttMethodIndex==1 or m_pttMethodIndex==2 or m_catEnabled) and
|
||||||
!(m_pttMethodIndex==3);
|
!(m_pttMethodIndex==3);
|
||||||
ui.testPTTButton->setEnabled(b2);
|
ui.testPTTButton->setEnabled(b2);
|
||||||
@ -422,6 +385,7 @@ void DevSetup::on_rigComboBox_activated(int index)
|
|||||||
m_rigIndex=index;
|
m_rigIndex=index;
|
||||||
QString t=ui.rigComboBox->itemText(index);
|
QString t=ui.rigComboBox->itemText(index);
|
||||||
m_rig=t.mid(0,7).toInt();
|
m_rig=t.mid(0,7).toInt();
|
||||||
|
enableWidgets();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DevSetup::on_cbID73_toggled(bool checked)
|
void DevSetup::on_cbID73_toggled(bool checked)
|
||||||
@ -534,41 +498,33 @@ void DevSetup::on_pttMethodComboBox_currentIndexChanged(int index)
|
|||||||
ui.pttComboBox->setEnabled(b);
|
ui.pttComboBox->setEnabled(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
void DevSetup::enableWidgets()
|
||||||
void DevSetup::on_pbHRD_clicked()
|
|
||||||
{
|
{
|
||||||
|
ui.cbEnableCAT->setChecked(m_catEnabled);
|
||||||
|
ui.cbDTRoff->setChecked(m_bDTRoff);
|
||||||
|
ui.rigComboBox->setEnabled(m_catEnabled);
|
||||||
|
ui.testCATButton->setEnabled(m_catEnabled);
|
||||||
|
ui.label_4->setEnabled(m_catEnabled);
|
||||||
|
ui.label_47->setEnabled(m_catEnabled);
|
||||||
|
|
||||||
bool bConnect=false;
|
bool bSerial=m_catEnabled and (m_rig!=9999);
|
||||||
bConnect = HRDInterfaceConnect(L"localhost",7809);
|
ui.catPortComboBox->setEnabled(bSerial);
|
||||||
if(bConnect) {
|
ui.serialRateComboBox->setEnabled(bSerial);
|
||||||
QString t2;
|
ui.dataBitsComboBox->setEnabled(bSerial);
|
||||||
|
ui.stopBitsComboBox->setEnabled(bSerial);
|
||||||
|
ui.handshakeComboBox->setEnabled(bSerial);
|
||||||
|
ui.cbDTRoff->setEnabled(bSerial);
|
||||||
|
ui.rbData->setEnabled(bSerial);
|
||||||
|
ui.rbMic->setEnabled(bSerial);
|
||||||
|
ui.label_21->setEnabled(bSerial);
|
||||||
|
ui.label_22->setEnabled(bSerial);
|
||||||
|
ui.label_23->setEnabled(bSerial);
|
||||||
|
ui.label_24->setEnabled(bSerial);
|
||||||
|
ui.label_25->setEnabled(bSerial);
|
||||||
|
|
||||||
const wchar_t* context=HRDInterfaceSendMessage(L"Get Context");
|
ui.pollSpinBox->setEnabled(m_catEnabled);
|
||||||
QString qc="[" + QString::fromWCharArray (context,-1) + "] ";
|
bool b=(m_pttMethodIndex==1 or m_pttMethodIndex==2) and m_rig!=9999;
|
||||||
|
ui.pttComboBox->setEnabled(b);
|
||||||
const wchar_t* cmnd = (const wchar_t*) (qc+"Get Frequency").utf16();
|
b=b or m_catEnabled;
|
||||||
const wchar_t* freqString=HRDInterfaceSendMessage(cmnd);
|
ui.testPTTButton->setEnabled(b);
|
||||||
t2=QString::fromWCharArray (freqString,-1);
|
|
||||||
qDebug() << "Freq1:" << t2;
|
|
||||||
|
|
||||||
cmnd = (const wchar_t*) (qc+"Set Frequency-Hz 14070000").utf16();
|
|
||||||
const wchar_t* result=HRDInterfaceSendMessage(cmnd);
|
|
||||||
t2=QString::fromWCharArray (result,-1);
|
|
||||||
qDebug() << "Freq2:" << t2;
|
|
||||||
|
|
||||||
cmnd = (const wchar_t*) (qc+"Get Frequency").utf16();
|
|
||||||
freqString=HRDInterfaceSendMessage(cmnd);
|
|
||||||
t2=QString::fromWCharArray (freqString,-1);
|
|
||||||
qDebug() << "Freq3:" << t2;
|
|
||||||
|
|
||||||
|
|
||||||
HRDInterfaceDisconnect();
|
|
||||||
bConnect = HRDInterfaceIsConnected();
|
|
||||||
HRDInterfaceFreeString(context);
|
|
||||||
HRDInterfaceFreeString(freqString);
|
|
||||||
HRDInterfaceFreeString(cmnd);
|
|
||||||
} else {
|
|
||||||
qDebug() << "Connection to HRD failed.";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
@ -95,6 +95,7 @@ private slots:
|
|||||||
private:
|
private:
|
||||||
Rig* rig;
|
Rig* rig;
|
||||||
void msgBox(QString t);
|
void msgBox(QString t);
|
||||||
|
void enableWidgets();
|
||||||
Ui::DialogSndCard ui;
|
Ui::DialogSndCard ui;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user