I got the TCP working for the TenTec Omni VII on HRD basically just by
ignoring the pull-down menu error.

Diff is attached and in-line here too.

 

HRD has a bug report from me which, hopefully, they will eventually fix to
give those parameters.  HRD doesn't even show buttons for mode, split, or
PTT for the Omni VII which is their problem.

 

I also made a small improvement to the error messages since what was there
was lacking specificity on where the failure was occurring.

 

What I did was default the mode to USB if there is no dropdown available for
mode select.

 

Hopefully that's the right thing to do here.

 

Mike W9MDB

 

Index: HRDTransceiver.cpp

===================================================================

--- HRDTransceiver.cpp (revision 4231)

+++ HRDTransceiver.cpp              (working copy)

@@ -214,7 +214,7 @@

   vfo_A_button_ = find_button (QRegExp ("^(VFO~A|Main)$"));

   vfo_B_button_ = find_button (QRegExp ("^(VFO~B|Sub)$"));

   vfo_toggle_button_ = find_button (QRegExp ("^(A~/~B)$"));

-  Q_ASSERT (vfo_toggle_button_ >= 0 || (vfo_A_button_ >= 0 && vfo_B_button_
>=0));

+  //Q_ASSERT (vfo_toggle_button_ >= 0 || (vfo_A_button_ >= 0 &&
vfo_B_button_ >=0));

  

   split_mode_button_ = find_button (QRegExp ("^(Spl~On|Spl_On|Split)$"));

   split_off_button_ = find_button (QRegExp ("^(Spl~Off|Spl_Off)$"));

@@ -266,11 +266,25 @@

     {

       // put the rig into a known state

       auto f = send_command ("get frequency").toUInt ();

-      auto m = lookup_mode (get_dropdown (mode_A_dropdown_), mode_A_map_);

+      auto m = USB; // default to USB if no mode select available

+      try 

+      {

+        m = lookup_mode (get_dropdown (mode_A_dropdown_), mode_A_map_);

+      }

+      catch (error const&)

+      { // defaults to m=USB

+      }

       set_button (vfo_B_button_ >= 0 ? vfo_B_button_ : vfo_toggle_button_);

       auto fo = send_command ("get frequency").toUInt ();

       update_other_frequency (fo);

-      auto mo = lookup_mode (get_dropdown (mode_A_dropdown_), mode_A_map_);

+      auto mo = USB;

+      try

+      {

+        mo = lookup_mode (get_dropdown (mode_A_dropdown_), mode_A_map_);

+      }

+      catch (error const&)

+      { // defaults to mo=USB

+      }

       set_button (vfo_A_button_ >= 0 ? vfo_A_button_ : vfo_toggle_button_);

       if (f != fo || m != mo)

         {

@@ -281,7 +295,14 @@

       else

         {

           update_rx_frequency (send_command ("get frequency").toUInt ());

-          update_mode (lookup_mode (get_dropdown (mode_A_dropdown_),
mode_A_map_));

+          try 

+          {

+            update_mode (lookup_mode (get_dropdown (mode_A_dropdown_),
mode_A_map_));

+          }

+          catch (error const&)

+          {

+            // nothing to do if there is no mode select

+          }

         }

     }

@@ -386,7 +407,7 @@

      qDebug () << "HRDTransceiver::get_dropdown bad response";

#endif

-      throw error {tr ("Ham Radio Deluxe didn't respond as expected")};

+      throw error {tr ("Ham Radio Deluxe didn't respond as expected.
get_dropdown failed")};

     }

   Q_ASSERT (reply.left (colon_index).trimmed () == dd_name);

@@ -571,7 +592,7 @@

       qDebug () << "HRDTransceiver::is_button_checked bad response";

#endif

-      throw error {tr ("Ham Radio Deluxe didn't respond as expected")};

+      throw error {tr ("Ham Radio Deluxe didn't respond as expected.
is_button_checked failed")};

     }

   return "1" == reply;

}

@@ -627,8 +648,15 @@

     {

       update_rx_frequency (send_command ("get frequency", quiet).toUInt
());

     }

-

-  update_mode (lookup_mode (get_dropdown (mode_A_dropdown_, quiet),
mode_A_map_));

+  try {

+             update_mode (lookup_mode (get_dropdown (mode_A_dropdown_,
quiet), mode_A_map_));

+  }

+  catch (error const&)

+  {

+#if WSJT_TRACE_CAT

+      qDebug () << "HRDTransceiver::poll failed:" << hrd_->errorString ();

+#endif

+  }

}

 QString HRDTransceiver::send_command (QString const& cmd, bool no_debug,
bool prepend_context, bool recurse)

@@ -765,6 +793,6 @@

       qDebug () << "HRDTransceiver::send_simple_command unexpected
response";

#endif

-      throw error {tr ("Ham Radio Deluxe didn't respond as expected")};

+      throw error {tr ("Ham Radio Deluxe didn't respond as expected.
send_simple_command failed")};

     }

}

 

Attachment: HRDTransceiver.diff
Description: Binary data

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
wsjt-devel mailing list
wsjt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wsjt-devel

Reply via email to