Read mode before attempting to change it when using DX Lab Suite Commander

This change is  specifically to work around  some surprising behaviour
in the Elecraft K3[S] which suffers  audio drop outs when null changes
that might effect the internal DSP are processed.  This manifests when
a blind mode  change is sent through Commander. Here  we read the mode
and  only subsequently  command a  mode change  if it  is not  what we
expect.  Blind  mode changes were  preferred with Commander  until now
since state queries through Commander are occasionally unreliable.

This issue  has been reported to  Elecraft so may not  be permanent if
they can and will address it in the rig's firmware.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7565 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Bill Somerville 2017-02-17 12:32:33 +00:00
parent 43cdd1df3c
commit db111b6529
2 changed files with 10 additions and 3 deletions

View File

@ -163,7 +163,7 @@ void DXLabSuiteCommanderTransceiver::do_frequency (Frequency f, MODE m, bool /*n
{
TRACE_CAT ("DXLabSuiteCommanderTransceiver", f << state ());
auto f_string = frequency_to_string (f);
if (UNK != m)
if (UNK != m && m != get_mode ())
{
auto m_string = map_mode (m);
auto params = ("<xcvrfreq:%1>" + f_string + "<xcvrmode:%2>" + m_string + "<preservesplitanddual:1>Y").arg (f_string.size ()).arg (m_string.size ());
@ -281,11 +281,16 @@ void DXLabSuiteCommanderTransceiver::poll ()
throw error {tr ("DX Lab Suite Commander didn't respond correctly polling split status")};
}
reply = command_with_reply ("<command:11>CmdSendMode<parameters:0>", quiet);
get_mode (quiet);
}
auto DXLabSuiteCommanderTransceiver::get_mode (bool no_debug) -> MODE
{
MODE m {UNK};
auto reply = command_with_reply ("<command:11>CmdSendMode<parameters:0>", no_debug);
if (0 == reply.indexOf ("<CmdMode:"))
{
auto mode = reply.mid (reply.indexOf ('>') + 1);
MODE m {UNK};
if ("AM" == mode)
{
m = AM;
@ -338,6 +343,7 @@ void DXLabSuiteCommanderTransceiver::poll ()
TRACE_CAT_POLL ("DXLabSuiteCommanderTransceiver", "unexpected response");
throw error {tr ("DX Lab Suite Commander didn't respond correctly polling mode")};
}
return m;
}
void DXLabSuiteCommanderTransceiver::simple_command (QString const& cmd, bool no_debug)

View File

@ -42,6 +42,7 @@ protected:
void poll () override;
private:
MODE get_mode (bool no_debug = false);
void simple_command (QString const&, bool no_debug = false);
QString command_with_reply (QString const&, bool no_debug = false);
bool write_to_port (QString const&);