From 6639fef3dbd864be0af79644ab43d107653bc2c5 Mon Sep 17 00:00:00 2001 From: David Freese Date: Fri, 12 Mar 2010 16:27:45 -0600 Subject: [PATCH] macro Added new macro tag which shadows the function of the T/R button. T/R button requires a mouse click. Macro key T/R can be accessed from the keyboard. Note: The Pause / Esc key combination also serves this purpose. This was added to accommodate users migrating from Digipan a very popular MS application. Modified the default macro definitions to make F9 the T/R function key button. --- src/misc/macroedit.cxx | 1 + src/misc/macros.cxx | 26 ++++++++++++++++++++++++++ src/misc/newinstall.cxx | 35 ++++++++++++++++++++--------------- 3 files changed, 47 insertions(+), 15 deletions(-) diff --git a/src/misc/macroedit.cxx b/src/misc/macroedit.cxx index 5115a192..a0d596ac 100644 --- a/src/misc/macroedit.cxx +++ b/src/misc/macroedit.cxx @@ -111,6 +111,7 @@ void loadBrowser(Fl_Widget *widget) { w->add(LINE_SEP); w->add(_("\treceive")); w->add(_("\ttransmit")); + w->add(_("\ttoggle T/R")); w->add(_("\tsearch UP for signal")); w->add(_("\tsearch DOWN for signal")); w->add(_("\treturn to sweet spot")); diff --git a/src/misc/macros.cxx b/src/misc/macros.cxx index 74a4e9b4..b6d6b0bf 100644 --- a/src/misc/macros.cxx +++ b/src/misc/macros.cxx @@ -42,6 +42,7 @@ #include "trx.h" #include "modem.h" #include "qrunner.h" +#include "waterfall.h" #include #include @@ -59,6 +60,7 @@ using namespace std; MACROTEXT macros; CONTESTCNTR contest_count; static bool TransmitON = false; +static bool ToggleTXRX = false; int mNbr; struct MTAGS { const char *mTAG; void (*fp)(string &, size_t &);}; @@ -85,6 +87,7 @@ void pTEXT(string &, size_t &); void pCWID(string &, size_t &); void pRX(string &, size_t &); void pTX(string &, size_t &); +void pTXRX(string &, size_t &); void pVER(string &, size_t &); void pCNTR(string &, size_t &); void pDECR(string &, size_t &); @@ -144,6 +147,7 @@ MTAGS mtags[] = { {"", pCWID}, {"", pRX}, {"", pTX}, +{"", pTXRX}, {"", pVER}, {"", pCNTR}, {"", pDECR}, @@ -501,6 +505,13 @@ void pTX(string &s, size_t &i) TransmitON = true; } +void pTXRX(string &s, size_t &i) +{ + s.erase(i, 6); + ToggleTXRX = true; +} + + void pVER(string &s, size_t &i) { string progname; @@ -1010,6 +1021,7 @@ string MACROTEXT::expandMacro(int n) size_t idx = 0; expand = true; TransmitON = false; + ToggleTXRX = false; mNbr = n; expanded = text[n]; MTAGS *pMtags; @@ -1115,9 +1127,23 @@ void finishWait(void *) text2send.clear(); } +static void set_button(Fl_Button* button, bool value) +{ + button->value(value); + button->do_callback(); +} + void MACROTEXT::execute(int n) { text2send = expandMacro(n); + if (ToggleTXRX) { + text2send.clear(); + if (!wf->xmtrcv->value()) + REQ(set_button, wf->xmtrcv, true); + else + REQ(set_button, wf->xmtrcv, false); + return; + } if (useWait && waitTime > 0) { Fl::add_timeout(waitTime, finishWait); useWait = false; diff --git a/src/misc/newinstall.cxx b/src/misc/newinstall.cxx index ee8c56c3..18a70523 100644 --- a/src/misc/newinstall.cxx +++ b/src/misc/newinstall.cxx @@ -70,14 +70,14 @@ tnx fer QSO , 73, God bless.\n\ de sk\n\ "; -label[5] = "Me"; -text[5] = " my name is "; +label[5] = "Me/Qth"; +text[5] = "\n\ +my name ... \n\ +my QTH .... \n\ +my LOC .... \n"; -label[6] = "QTH"; -text[6] = " my QTH is , loc: "; - -label[7] = "Brag"; -text[7] = "\n\ +label[6] = "Brag"; +text[6] = "\n\ << , >>\n\ Age: \n\ Rig: \n\ @@ -88,17 +88,22 @@ Soft: \n\ Web: \n\ Email: "; -label[8] = "Tx @>>"; -text[8] = ""; +label[7] = ""; +text[7] = ""; -label[9] = "Rx @||"; -text[9] = ""; +label[8] = "T/R"; +text[8] = ""; -label[10] = ""; -text[10] = ""; +label[9] = "Tx @>>"; +text[9] = ""; -label[11] = ""; -text[11] = ""; +label[10] = "Rx @||"; +text[10] = ""; + +label[11] = "TX @>|"; +text[11] = "\n\ +de k\n\ +"; label[12] = "C Ans @>|"; text[12] = "de ";