mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-10-31 15:47:10 -04:00
Compare dial freq with user's default freq, not the startup default freq.
Also some minor code cleanup. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3476 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
f226e4cbc8
commit
4cc9a9be7a
@ -208,9 +208,8 @@ MainWindow::MainWindow(QSharedMemory *shdmem, QWidget *parent) :
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
mem_jt9 = shdmem;
|
mem_jt9 = shdmem;
|
||||||
|
|
||||||
readSettings(); //Restore user's setup params
|
readSettings(); //Restore user's setup params
|
||||||
if(m_dFreq.length()<=1) {
|
if(m_dFreq.length()<=1) { //Use the startup default frequencies
|
||||||
m_dFreq.clear();
|
m_dFreq.clear();
|
||||||
for(int i=0; i<16; i++) {
|
for(int i=0; i<16; i++) {
|
||||||
QString t;
|
QString t;
|
||||||
@ -239,6 +238,7 @@ MainWindow::MainWindow(QSharedMemory *shdmem, QWidget *parent) :
|
|||||||
border-color: black; min-width: 5em; padding: 3px;}";
|
border-color: black; min-width: 5em; padding: 3px;}";
|
||||||
|
|
||||||
genStdMsgs(m_rpt);
|
genStdMsgs(m_rpt);
|
||||||
|
if(m_mode!="JT9" and m_mode!="JT65" and m_mode!="JT9+JT65") m_mode="JT9";
|
||||||
on_actionWide_Waterfall_triggered(); //###
|
on_actionWide_Waterfall_triggered(); //###
|
||||||
g_pWideGraph->setRxFreq(m_rxFreq);
|
g_pWideGraph->setRxFreq(m_rxFreq);
|
||||||
g_pWideGraph->setTxFreq(m_txFreq);
|
g_pWideGraph->setTxFreq(m_txFreq);
|
||||||
@ -971,13 +971,14 @@ void MainWindow::bumpFqso(int n) //bumpFqso()
|
|||||||
|
|
||||||
void MainWindow::dialFreqChanged2(double f)
|
void MainWindow::dialFreqChanged2(double f)
|
||||||
{
|
{
|
||||||
if(m_band<0 or m_band>15) return;
|
|
||||||
m_dialFreq=f;
|
m_dialFreq=f;
|
||||||
|
if(m_band<0 or m_band>15 or m_dFreq.length()<=1) return;
|
||||||
QString t;
|
QString t;
|
||||||
t.sprintf("%.6f",m_dialFreq);
|
t.sprintf("%.6f",m_dialFreq);
|
||||||
int n=t.length();
|
int n=t.length();
|
||||||
t=t.mid(0,n-3) + " " + t.mid(n-3,3);
|
t=t.mid(0,n-3) + " " + t.mid(n-3,3);
|
||||||
if(qAbs(m_dialFreq-dFreq[m_band])<0.01) {
|
double fBand=m_dFreq[m_band].toDouble();
|
||||||
|
if(qAbs(m_dialFreq-fBand)<0.01) {
|
||||||
ui->labDialFreq->setStyleSheet( \
|
ui->labDialFreq->setStyleSheet( \
|
||||||
"QLabel { background-color : black; color : yellow; }");
|
"QLabel { background-color : black; color : yellow; }");
|
||||||
} else {
|
} else {
|
||||||
@ -2128,8 +2129,11 @@ void MainWindow::genStdMsgs(QString rpt) //genStdMsgs()
|
|||||||
ui->tx3->setText("");
|
ui->tx3->setText("");
|
||||||
ui->tx4->setText("");
|
ui->tx4->setText("");
|
||||||
ui->tx5->setText("");
|
ui->tx5->setText("");
|
||||||
t="CQ " + m_myCall + " " + m_myGrid.mid(0,4);
|
ui->tx6->setText("");
|
||||||
msgtype(t, ui->tx6);
|
if(m_myCall!="" and m_myGrid!="") {
|
||||||
|
t="CQ " + m_myCall + " " + m_myGrid.mid(0,4);
|
||||||
|
msgtype(t, ui->tx6);
|
||||||
|
}
|
||||||
ui->genMsg->setText("");
|
ui->genMsg->setText("");
|
||||||
ui->freeTextMsg->setText("");
|
ui->freeTextMsg->setText("");
|
||||||
return;
|
return;
|
||||||
|
11
rigclass.cpp
11
rigclass.cpp
@ -112,13 +112,11 @@ int Rig::open(int n) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
QString t;
|
QString t;
|
||||||
// qint32 nkHz=14076;
|
|
||||||
// t.sprintf("<command:10>CmdSetFreq<parameters:17><xcvrfreq:5>%5d",nkHz);
|
|
||||||
t="<command:10>CmdGetFreq<parameters:0>";
|
t="<command:10>CmdGetFreq<parameters:0>";
|
||||||
QByteArray ba = t.toLocal8Bit();
|
QByteArray ba = t.toLocal8Bit();
|
||||||
const char* buf=ba.data();
|
const char* buf=ba.data();
|
||||||
int n=socket->write(buf);
|
socket->write(buf);
|
||||||
bool bret=socket->waitForReadyRead(1000);
|
socket->waitForReadyRead(1000);
|
||||||
QByteArray reply=socket->read(128);
|
QByteArray reply=socket->read(128);
|
||||||
if(reply.indexOf("<CmdFreq:")==0) {
|
if(reply.indexOf("<CmdFreq:")==0) {
|
||||||
m_cmndr=true;
|
m_cmndr=true;
|
||||||
@ -150,7 +148,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) {
|
||||||
#ifdef WIN32 // Ham Radio Deluxe only on Windows
|
#ifdef WIN32 // Ham Radio Deluxe (only on Windows)
|
||||||
if(m_hrd) {
|
if(m_hrd) {
|
||||||
QString t;
|
QString t;
|
||||||
int nhz=(int)freq;
|
int nhz=(int)freq;
|
||||||
@ -231,7 +229,7 @@ int Rig::setSplitFreq(freq_t tx_freq, vfo_t vfo) {
|
|||||||
freq_t Rig::getFreq(vfo_t vfo)
|
freq_t Rig::getFreq(vfo_t vfo)
|
||||||
{
|
{
|
||||||
freq_t freq;
|
freq_t freq;
|
||||||
#ifdef WIN32 // Ham Radio Deluxe only on Windows
|
#ifdef WIN32 // Ham Radio Deluxe (only on Windows)
|
||||||
if(m_hrd) {
|
if(m_hrd) {
|
||||||
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);
|
||||||
@ -305,7 +303,6 @@ int Rig::setPTT(ptt_t ptt, vfo_t vfo)
|
|||||||
const char* buf=ba.data();
|
const char* buf=ba.data();
|
||||||
socket->write(buf);
|
socket->write(buf);
|
||||||
socket->waitForBytesWritten(1000);
|
socket->waitForBytesWritten(1000);
|
||||||
// qDebug() << ptt << buf;
|
|
||||||
return 0;
|
return 0;
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user