From 43cdd1df3c81cc003e4b13dd007589011916708c Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Fri, 17 Feb 2017 12:32:26 +0000 Subject: [PATCH] Add deley to rig resolution detection with DX Lab Suite Commander Commander queues rig control commands and can return stale or invalid results immediately after state change commands so this change waits a couple of seconds hoping that Commander gets around to polling the rig before we read back the state. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7564 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- DXLabSuiteCommanderTransceiver.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/DXLabSuiteCommanderTransceiver.cpp b/DXLabSuiteCommanderTransceiver.cpp index 5cfa45fe6..4961c2a69 100644 --- a/DXLabSuiteCommanderTransceiver.cpp +++ b/DXLabSuiteCommanderTransceiver.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "NetworkServerLookup.hpp" @@ -69,7 +70,13 @@ int DXLabSuiteCommanderTransceiver::do_start () throw error {tr ("Failed to connect to DX Lab Suite Commander\n") + commander_->errorString ()}; } + // sleeps here are to ensure Commander has actually queried the rig + // rather than returning cached data which maybe stale or simply + // read backs of not yet committed values, the 2s delays are + // arbitrary but hopefully enough as the actual time required is rig + // and Commander setting dependent int resolution {0}; + QThread::msleep (2000); auto reply = command_with_reply ("CmdGetFreq"); if (0 == reply.indexOf ("" + f_string).arg (f_string.size ()); simple_command (("CmdSetFreq" + params).arg (params.size ())); + QThread::msleep (2000); reply = command_with_reply ("CmdGetFreq"); if (0 == reply.indexOf ("" + f_string).arg (f_string.size ()); simple_command (("CmdSetFreq" + params).arg (params.size ())); + QThread::msleep (2000); reply = command_with_reply ("CmdGetFreq"); new_frequency = string_to_frequency (reply.mid (reply.indexOf ('>') + 1)); if (9 == static_cast (new_frequency - test_frequency))