From 982210157fba8c2084f7c68966dbe8dce21ad4b7 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Thu, 18 Jul 2013 11:55:29 +0000 Subject: [PATCH] Fix frequency-setting through Commander so that it works to nearest Hz. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3493 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- mainwindow.cpp | 2 +- rigclass.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index cc3d44c8c..ce7809d48 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1,4 +1,4 @@ -//-------------------------------------------------------------- MainWindow +//--------------------------------------------------------------- MainWindow #include "mainwindow.h" #include "ui_mainwindow.h" #include "devsetup.h" diff --git a/rigclass.cpp b/rigclass.cpp index 4df2efe29..3f61e0373 100644 --- a/rigclass.cpp +++ b/rigclass.cpp @@ -164,8 +164,8 @@ int Rig::setFreq(freq_t freq, vfo_t vfo) { } } else if(m_cmndr) { QString t; - qint32 nkHz=int(0.001*freq); - t.sprintf("CmdSetFreq%6d",nkHz); + double f=0.001*freq; + t.sprintf("CmdSetFreq%10.3f",f); QByteArray ba = t.toLocal8Bit(); const char* buf=ba.data(); socket->write(buf); @@ -212,8 +212,8 @@ int Rig::setSplitFreq(freq_t tx_freq, vfo_t vfo) { } } else if(m_cmndr) { QString t; - qint32 nkHz=int(0.001*tx_freq); - t.sprintf("CmdSetTxFreq%6d",nkHz); + double f=0.001*tx_freq; + t.sprintf("CmdSetTxFreq%10.3f",f); QByteArray ba = t.toLocal8Bit(); const char* buf=ba.data(); socket->write(buf);