diff --git a/ChangeLog b/ChangeLog index 0eaefcf0..67abcb3e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,7 +21,21 @@ Change Log: arq-socket threads and avoid the socket accept/timeout loop. 9) Removed fl_thread wrappers to direct pthread calls 10) Added various Qrunner updates - + 11) Added rig control freq entry. Click on Frequency Control widget for + focus. Enter digits in kHz.kHz. to use new value, to + cancel. + 12) Added qsy function. Moved the hamlib/rigcat/etc qsy if/else block + into its own function and replaced all instances of that code. + 13) Add waterfall mouse options + a) Added Mouse tab to the W-fall tab(s). + b) Added waterfall qsy option, which works well with rigcat and + hamlib (direct and rpc.rigd). + c) Added text field whose contents are appended to the RX window + when the frequency is changed via a waterfall left click. + The text will be printed by strftime if it contains any + % characters, so it's possible to have specify something + "<=== %x %H:%M ====" for RX divider line. + 3.03 1) Changes to socket server to correct shutdown process 2) Added event logging and an event viewer diff --git a/configure.ac b/configure.ac index 66e2377e..3a05538e 100644 --- a/configure.ac +++ b/configure.ac @@ -9,7 +9,7 @@ dnl major and minor must be integers; patch may dnl contain other characters or be empty m4_define(FLDIGI_MAJOR, [3]) m4_define(FLDIGI_MINOR, [0]) -m4_define(FLDIGI_PATCH, [4AC]) +m4_define(FLDIGI_PATCH, [4AD]) AC_INIT([fldigi], FLDIGI_MAJOR.FLDIGI_MINOR[FLDIGI_PATCH], [w1hkj AT w1hkj DOT com]) diff --git a/src/dialogs/confdialog.cxx b/src/dialogs/confdialog.cxx index 741043e2..9c05d3b9 100644 --- a/src/dialogs/confdialog.cxx +++ b/src/dialogs/confdialog.cxx @@ -291,6 +291,20 @@ static void cb_btnWaterfallHistoryDefault(Fl_Check_Button* o, void*) { progdefaults.changed = true; } +Fl_Check_Button *btnWaterfallQSY=(Fl_Check_Button *)0; + +static void cb_btnWaterfallQSY(Fl_Check_Button* o, void*) { + progdefaults.WaterfallQSY = o->value(); +progdefaults.changed = true; +} + +Fl_Input *inpWaterfallClickText=(Fl_Input *)0; + +static void cb_inpWaterfallClickText(Fl_Input* o, void*) { + progdefaults.WaterfallClickText = o->value(); +progdefaults.changed = true; +} + Fl_Group *tabVideo=(Fl_Group *)0; Fl_Check_Button *btnsendid=(Fl_Check_Button *)0; @@ -1668,16 +1682,23 @@ static const char szBaudRates[] = "300|600|1200|2400|4800|9600|19200|38400|57600 } // Fl_Group* o o->end(); } // Fl_Group* o - { Fl_Group* o = new Fl_Group(0, 50, 405, 166, "History"); + { Fl_Group* o = new Fl_Group(0, 50, 405, 166, "Mouse"); o->hide(); { Fl_Group* o = new Fl_Group(5, 56, 390, 158); o->box(FL_ENGRAVED_FRAME); - { Fl_Check_Button* o = btnWaterfallHistoryDefault = new Fl_Check_Button(15, 66, 266, 20, "Lft/Rt Click Replays History always"); + { btnWaterfallHistoryDefault = new Fl_Check_Button(15, 66, 276, 20, "Left/Right click always replays history"); btnWaterfallHistoryDefault->tooltip("Disabled - Ctrl-Lft click plays history"); btnWaterfallHistoryDefault->down_box(FL_DOWN_BOX); btnWaterfallHistoryDefault->callback((Fl_Callback*)cb_btnWaterfallHistoryDefault); - o->value(progdefaults.WaterfallHistoryDefault); } // Fl_Check_Button* btnWaterfallHistoryDefault + { btnWaterfallQSY = new Fl_Check_Button(15, 96, 225, 20, "Dragging changes frequency"); + btnWaterfallQSY->down_box(FL_DOWN_BOX); + btnWaterfallQSY->callback((Fl_Callback*)cb_btnWaterfallQSY); + } // Fl_Check_Button* btnWaterfallQSY + { inpWaterfallClickText = new Fl_Input(15, 126, 150, 40, "Insert text\non left click"); + inpWaterfallClickText->callback((Fl_Callback*)cb_inpWaterfallClickText); + inpWaterfallClickText->align(FL_ALIGN_RIGHT); + } // Fl_Input* inpWaterfallClickText o->end(); } // Fl_Group* o o->end(); diff --git a/src/dialogs/confdialog.fl b/src/dialogs/confdialog.fl index ce78bd4d..7ab53278 100644 --- a/src/dialogs/confdialog.fl +++ b/src/dialogs/confdialog.fl @@ -1,5 +1,5 @@ # data file for the Fltk User Interface Designer (fluid) -version 1.0108 +version 1.0109 header_name {.h} code_name {.cxx} decl {\#include } {} @@ -39,7 +39,7 @@ static const char szBaudRates[] = "300|600|1200|2400|4800|9600|19200|38400|57600 code {} {} Fl_Window {} { label {fldigi - config} open - xywh {519 158 400 250} type Double color 45 selection_color 51 align 80 visible + xywh {611 467 400 250} type Double color 45 selection_color 51 align 80 visible } { Fl_Tabs tabsConfigure {open xywh {0 0 405 220} color 47 selection_color 9 @@ -354,18 +354,30 @@ progdefaults.changed = true; } } Fl_Group {} { - label History open + label Mouse open xywh {0 50 405 166} hide } { Fl_Group {} {open xywh {5 56 390 158} box ENGRAVED_FRAME } { Fl_Check_Button btnWaterfallHistoryDefault { - label {Lft/Rt Click Replays History always} + label {Left/Right click always replays history} callback {progdefaults.WaterfallHistoryDefault = o->value(); progdefaults.changed = true;} - tooltip {Disabled - Ctrl-Lft click plays history} xywh {15 66 266 20} down_box DOWN_BOX - code0 {o->value(progdefaults.WaterfallHistoryDefault);} + tooltip {Disabled - Ctrl-Lft click plays history} xywh {15 66 276 20} down_box DOWN_BOX + } + Fl_Check_Button btnWaterfallQSY { + label {Dragging changes frequency} + callback {progdefaults.WaterfallQSY = o->value(); +progdefaults.changed = true;} + xywh {15 96 225 20} down_box DOWN_BOX + } + Fl_Input inpWaterfallClickText { + label {Insert text +on left click} + callback {progdefaults.WaterfallClickText = o->value(); +progdefaults.changed = true;} + xywh {15 126 150 40} align 8 } } } diff --git a/src/dialogs/fl_digi.cxx b/src/dialogs/fl_digi.cxx index 162236e2..7abb36d0 100644 --- a/src/dialogs/fl_digi.cxx +++ b/src/dialogs/fl_digi.cxx @@ -104,6 +104,9 @@ #include "soundconf.h" #include "htmlstrings.h" +#if USE_XMLRPC +# include "xmlrpc.h" +#endif #include "debug.h" Fl_Double_Window *fl_digi_main=(Fl_Double_Window *)0; @@ -633,7 +636,7 @@ void init_modem(trx_mode mode) clear_StatusMessages(); progStatus.lastmode = mode; - if (wf->xmtlock->value() == 1) { + if (wf->xmtlock->value() == 1 && !mailserver) { wf->xmtlock->value(0); wf->xmtlock->damage(); active_modem->set_freqlock(false); @@ -2580,3 +2583,18 @@ Fl_Color adjust_color(Fl_Color fg, Fl_Color bg) } +void qsy(long long rfc, long long fmid) +{ + if (progdefaults.chkUSERIGCATis) + REQ(rigCAT_set_qsy, rfc, fmid); + else if (progdefaults.chkUSEMEMMAPis) + REQ(rigMEM_set_qsy, rfc, fmid); +#if USE_HAMLIB + else if (progdefaults.chkUSEHAMLIBis) + REQ(hamlib_set_qsy, rfc, fmid); +#endif +#if USE_XMLRPC + else if (progdefaults.chkUSEXMLRPCis) + REQ(xmlrpc_set_qsy, rfc, fmid); +#endif +} diff --git a/src/include/FreqControl.h b/src/include/FreqControl.h index da9777fc..3a614b9c 100644 --- a/src/include/FreqControl.h +++ b/src/include/FreqControl.h @@ -40,11 +40,9 @@ #include #include -#include #include #include #include -#include #include #ifdef MAX_DIGITS @@ -52,6 +50,9 @@ #endif #define MAX_DIGITS 9 +class Fl_Box; +class Fl_Float_Input; + class cFreqControl : public Fl_Group { friend void cbSelectDigit (Fl_Widget *btn, void * nbr); public: @@ -74,6 +75,7 @@ public: int handle(int event); private: Fl_Repeat_Button *Digit[MAX_DIGITS]; + Fl_Float_Input *finp; static const char *Label[]; int mult[MAX_DIGITS]; Fl_Box *decbx; @@ -88,8 +90,9 @@ private: void DecFreq(int n); void IncFreq(int n); int (*cbFunc)(); + static void freq_input_cb(Fl_Widget* input, void* arg); protected: - long val; + long val, oldval; }; #endif diff --git a/src/include/confdialog.h b/src/include/confdialog.h index ea7c954f..608121ca 100644 --- a/src/include/confdialog.h +++ b/src/include/confdialog.h @@ -46,6 +46,8 @@ extern Fl_Button *btnCursorBWcolor; extern Fl_Button *btnCursorCenterLineColor; extern Fl_Button *btnBwTracksColor; extern Fl_Check_Button *btnWaterfallHistoryDefault; +extern Fl_Check_Button *btnWaterfallQSY; +extern Fl_Input *inpWaterfallClickText; extern Fl_Group *tabVideo; extern Fl_Check_Button *btnsendid; extern Fl_Check_Button *btnsendvideotext; diff --git a/src/include/configuration.h b/src/include/configuration.h index 418fe5c0..d0348cee 100644 --- a/src/include/configuration.h +++ b/src/include/configuration.h @@ -27,6 +27,8 @@ struct configuration { double PSKsweetspot; bool StartAtSweetSpot; bool WaterfallHistoryDefault; + bool WaterfallQSY; + string WaterfallClickText; // for PSK & PSK mail interface bool PSKmailSweetSpot; int SearchRange; diff --git a/src/include/fl_digi.h b/src/include/fl_digi.h index f9113018..6ba4a2e8 100644 --- a/src/include/fl_digi.h +++ b/src/include/fl_digi.h @@ -171,4 +171,6 @@ extern void stopMacroTimer(); Fl_Color adjust_color(Fl_Color fg, Fl_Color bg); +void qsy(long long rfc, long long fmid); + #endif diff --git a/src/include/xmlrpc.h b/src/include/xmlrpc.h index a1f89f41..4d9c7b1d 100644 --- a/src/include/xmlrpc.h +++ b/src/include/xmlrpc.h @@ -25,4 +25,6 @@ private: Socket* server_socket; }; +void xmlrpc_set_qsy(long long rfc, long long fmid); + #endif // XMLRPC_H diff --git a/src/misc/arq_io.cxx b/src/misc/arq_io.cxx index 9732e473..f0235c1e 100644 --- a/src/misc/arq_io.cxx +++ b/src/misc/arq_io.cxx @@ -106,6 +106,11 @@ void parse_arqtext() PskMailLogName += "gMFSK.log"; Maillogfile = new cLogfile(PskMailLogName.c_str()); Maillogfile->log_to_file_start(); + wf->xmtlock->value(1); + wf->xmtlock->damage(); + if (progdefaults.PSKmailSweetSpot) + active_modem->set_freq(progdefaults.PSKsweetspot); + active_modem->set_freqlock(true); } else if (strCmdText == "client" && mailclient == false && mailserver == false) { mailclient = true; mailserver = false; @@ -113,6 +118,9 @@ void parse_arqtext() PskMailLogName += "gMFSK.log"; Maillogfile = new cLogfile(PskMailLogName.c_str()); Maillogfile->log_to_file_start(); + wf->xmtlock->value(0); + wf->xmtlock->damage(); + active_modem->set_freqlock(false); } else if (strCmdText == "normal") { mailserver = false; mailclient = false; @@ -120,6 +128,9 @@ void parse_arqtext() delete Maillogfile; Maillogfile = 0; } + wf->xmtlock->value(0); + wf->xmtlock->damage(); + active_modem->set_freqlock(false); } else { if ((idxSubCmd = strCmdText.find("")) != string::npos) { idxSubCmdEnd = strCmdText.find(""); diff --git a/src/misc/configuration.cxx b/src/misc/configuration.cxx index bafdc554..3db5a728 100644 --- a/src/misc/configuration.cxx +++ b/src/misc/configuration.cxx @@ -45,6 +45,9 @@ configuration progdefaults = { 1000, // int PSKsweetspot; false, // bool StartAtSweetSpot; false, // bool WaterfallHistoryDefault; + false, // bool WaterfallQSY; + "", // string WaterfallClickText; + // for PSK mail interface false, // bool PSKmailSweetSpot; 200, // int SearchRange; @@ -287,7 +290,8 @@ enum TAG { \ IGNORE, MYCALL, MYNAME, MYQTH, MYLOC, SQUELCH, WFREFLEVEL, WFAMPSPAN, LOWFREQCUTOFF, - WATERFALLHISTORYDEFAULT, STARTATSWEETSPOT, PSKMAILSWEETSPOT, + WATERFALLHISTORYDEFAULT, WATERFALLQSY, WATERFALLCLICKTEXT, + STARTATSWEETSPOT, PSKMAILSWEETSPOT, PSKSEARCHRANGE, PSKSERVEROFFSET, ACQSN, CWSWEETSPOT, PSKSWEETSPOT, RTTYSWEETSPOT, @@ -403,6 +407,8 @@ void configuration::writeDefaultsXML() writeXMLint(f, "LOWFREQCUTOFF", LowFreqCutoff); writeXMLbool(f, "WATERFALLHISTORYDEFAULT", WaterfallHistoryDefault); + writeXMLbool(f, "WATERFALLQSY", WaterfallQSY); + writeXMLstr(f, "WATERFALLCLICKTEXT", WaterfallClickText); writeXMLbool(f, "STARTATSWEETSPOT", StartAtSweetSpot); writeXMLbool(f, "PSKMAILSWEETSPOT", PSKmailSweetSpot); writeXMLint(f, "PSKSEARCHRANGE", SearchRange); @@ -644,6 +650,12 @@ bool configuration::readDefaultsXML() case WATERFALLHISTORYDEFAULT : WaterfallHistoryDefault = atoi(xml->getNodeData()); break; + case WATERFALLQSY : + WaterfallQSY = atoi(xml->getNodeData()); + break; + case WATERFALLCLICKTEXT : + WaterfallClickText = xml->getNodeData(); + break; case STARTATSWEETSPOT : StartAtSweetSpot = atoi(xml->getNodeData()); break; @@ -1181,6 +1193,8 @@ bool configuration::readDefaultsXML() else if (!strcmp("WFAMPSPAN", nodeName)) tag = WFAMPSPAN; else if (!strcmp("LOWFREQCUTOFF", nodeName)) tag = LOWFREQCUTOFF; else if (!strcmp("WATERFALLHISTORYDEFAULT", nodeName)) tag = WATERFALLHISTORYDEFAULT; + else if (!strcmp("WATERFALLQSY", nodeName)) tag = WATERFALLQSY; + else if (!strcmp("WATERFALLCLICKTEXT", nodeName)) tag = WATERFALLCLICKTEXT; else if (!strcmp("STARTATSWEETSPOT", nodeName)) tag = STARTATSWEETSPOT; else if (!strcmp("PSKMAILSWEETSPOT", nodeName)) tag = PSKMAILSWEETSPOT; else if (!strcmp("PSKSEARCHRANGE", nodeName)) tag = PSKSEARCHRANGE; @@ -1517,6 +1531,9 @@ int configuration::setDefaults() { valRTTYsweetspot->value(RTTYsweetspot); valPSKsweetspot->value(PSKsweetspot); btnWaterfallHistoryDefault->value(WaterfallHistoryDefault); + btnWaterfallQSY->value(progdefaults.WaterfallQSY); + inpWaterfallClickText->input_type(FL_MULTILINE_INPUT); + inpWaterfallClickText->value(progdefaults.WaterfallClickText.c_str()); btnStartAtSweetSpot->value(StartAtSweetSpot); btnPSKmailSweetSpot->value(PSKmailSweetSpot); cntSearchRange->value(SearchRange); diff --git a/src/misc/macros.cxx b/src/misc/macros.cxx index f5f09bdb..348ae84d 100644 --- a/src/misc/macros.cxx +++ b/src/misc/macros.cxx @@ -190,7 +190,7 @@ void pILDT(string &s, size_t &i) tm sTime; time (&tmptr); localtime_r(&tmptr, &sTime); - mystrftime(szDt, 79, "%Y-%m-%d %H:%M:%S%z", &sTime); + mystrftime(szDt, 79, "%Y-%m-%d %H:%M%z", &sTime); s.replace( i, 6, szDt); } @@ -201,7 +201,7 @@ void pZDT(string &s, size_t &i) tm sTime; time (&tmptr); gmtime_r(&tmptr, &sTime); - mystrftime(szDt, 79, "%x %H:%M %Z", &sTime); + mystrftime(szDt, 79, "%x %H:%MZ", &sTime); s.replace( i, 5, szDt); } @@ -212,7 +212,7 @@ void pIZDT(string &s, size_t &i) tm sTime; time (&tmptr); gmtime_r(&tmptr, &sTime); - mystrftime(szDt, 79, "%Y-%m-%d %H:%M:%SZ", &sTime); + mystrftime(szDt, 79, "%Y-%m-%d %H:%M%z", &sTime); s.replace( i, 6, szDt); } diff --git a/src/misc/xmlrpc.cxx b/src/misc/xmlrpc.cxx index 85c645a6..0a5a7b64 100644 --- a/src/misc/xmlrpc.cxx +++ b/src/misc/xmlrpc.cxx @@ -694,16 +694,16 @@ public: } }; -void xmlrpc_set_qsy(long long f, long long fmid) +void xmlrpc_set_qsy(long long rfc, long long fmid) { - LOG_DEBUG("rfc = %ld, audio = %ld", f, fmid); - if (active_modem->freqlocked() == true) { + if (active_modem->freqlocked()) { active_modem->set_freqlock(false); active_modem->set_freq((int)fmid); active_modem->set_freqlock(true); - } else + } + else active_modem->set_freq((int)fmid); - wf->rfcarrier(f); + wf->rfcarrier(rfc); wf->movetocenter(); } @@ -717,20 +717,9 @@ public: } void execute(const xmlrpc_c::paramList& params, xmlrpc_c::value* retval) { - double d = params.getDouble(0, 0.0); - long long int rfc = (long long int)d; - int mc = active_modem->get_freq(); - if (progdefaults.chkUSEXMLRPCis) - xmlrpc_set_qsy(rfc, mc); - else if (progdefaults.chkUSERIGCATis) - rigCAT_set_qsy(rfc, mc); - else if (progdefaults.chkUSEMEMMAPis) - rigMEM_set_qsy(rfc, mc); -#if USE_HAMLIB - else if (progdefaults.chkUSEHAMLIBis) - hamlib_set_qsy(rfc, mc); -#endif - *retval = xmlrpc_c::value_double(d); + double rfc = wf->rfcarrier(); + qsy(params.getDouble(0, 0.0), active_modem->get_freq()); + *retval = xmlrpc_c::value_double(rfc); } }; @@ -745,22 +734,11 @@ public: void execute(const xmlrpc_c::paramList& params, xmlrpc_c::value* retval) { double rfc = wf->rfcarrier() + params.getDouble(0); - int mc = active_modem->get_freq(); - if (progdefaults.chkUSEXMLRPCis) - xmlrpc_set_qsy((long long int)rfc, mc); - if (progdefaults.chkUSERIGCATis) - rigCAT_set_qsy((long long int)rfc, mc); - if (progdefaults.chkUSEMEMMAPis) - rigMEM_set_qsy((long long int)rfc, mc); -#if USE_HAMLIB - if (progdefaults.chkUSEHAMLIBis) - hamlib_set_qsy((long long int)rfc, mc); -#endif + qsy(rfc, active_modem->get_freq()); *retval = xmlrpc_c::value_double(rfc); } }; - // ============================================================================= class Main_get_afc : public xmlrpc_c::method diff --git a/src/psk/psk.cxx b/src/psk/psk.cxx index a42005dd..5d2a0ba7 100644 --- a/src/psk/psk.cxx +++ b/src/psk/psk.cxx @@ -596,10 +596,7 @@ void psk::tx_symbol(int sym) } symbol = prevsymbol * symbol; // complex multiplication - if (mailserver && progdefaults.PSKmailSweetSpot) - delta = 2.0 * M_PI * (progdefaults.PSKsweetspot - progdefaults.TxOffset) / samplerate; - else - delta = 2.0 * M_PI * get_txfreq_woffset() / samplerate; + delta = 2.0 * M_PI * get_txfreq_woffset() / samplerate; for (int i = 0; i < symbollen; i++) { diff --git a/src/rigcontrol/FreqControl.cxx b/src/rigcontrol/FreqControl.cxx index 71505ec1..d8cc4439 100644 --- a/src/rigcontrol/FreqControl.cxx +++ b/src/rigcontrol/FreqControl.cxx @@ -24,6 +24,14 @@ #include +#include +#include +#include + +#include +#include + +#include "fl_digi.h" #include "qrunner.h" #include "FreqControl.h" @@ -69,7 +77,7 @@ cFreqControl::cFreqControl(int x, int y, int w, int h, const char *lbl): OFFCOLOR = FL_BLACK; SELCOLOR = fl_rgb_color(100, 100, 100); ILLUMCOLOR = FL_GREEN; - val = 0; + oldval = val = 0; nD = 9; // nD <= MAXDIGITS int pw = 6; // decimal width @@ -111,6 +119,14 @@ cFreqControl::cFreqControl(int x, int y, int w, int h, const char *lbl): maxVal = max * 10 - 1; minVal = 0; end(); + + finp = new Fl_Float_Input(0, 0, 1, 1); + finp->callback(freq_input_cb, this); + finp->when(FL_WHEN_CHANGED); + finp->hide(); + parent()->remove(finp); + + tooltip("Enter frequency or change with\nLeft/Right/Up/Down/Pg_Up/Pg_Down"); } cFreqControl::~cFreqControl() @@ -118,16 +134,27 @@ cFreqControl::~cFreqControl() for (int i = 0; i < nD; i++) { delete Digit[i]; } + delete finp; } void cFreqControl::updatevalue() { long v = val; - for (int n = 0; n < nD; n++) { - Digit[n]->label(v == 0 ? " " : Label[v % 10]); - v /= 10; + int i; + if (likely(v > 0L)) { + for (i = 0; i < nD; i++) { + Digit[i]->label(v == 0 ? "" : Label[v % 10]); + v /= 10; + } } + else { + for (i = 0; i < 4; i++) + Digit[i]->label("0"); + for (; i < nD; i++) + Digit[i]->label(""); + } + decbx->label("."); damage(); } @@ -169,10 +196,17 @@ void cFreqControl::SetOFFCOLOR (uchar r, uchar g, uchar b) damage(); } +static void blink_point(Fl_Widget* w) +{ + w->label(*w->label() ? "" : "."); + Fl::add_timeout(0.2, (Fl_Timeout_Handler)blink_point, w); +} + void cFreqControl::value(long lv) { - val = lv; - REQ(&cFreqControl::updatevalue, this); + oldval = val = lv; + Fl::remove_timeout((Fl_Timeout_Handler)blink_point, decbx); + REQ(&cFreqControl::updatevalue, this); } int cFreqControl::handle(int event) @@ -180,10 +214,10 @@ int cFreqControl::handle(int event) if (!Fl::event_inside(this)) return Fl_Group::handle(event); + int d; switch (event) { - int d; case FL_KEYBOARD: - switch (Fl::event_key()) { + switch (d = Fl::event_key()) { case FL_Left: d = -1; break; @@ -203,7 +237,28 @@ int cFreqControl::handle(int event) d = -100; break; default: - return 1; + if (Fl::has_timeout((Fl_Timeout_Handler)blink_point, decbx)) { + if (d == FL_Escape) { + Fl::remove_timeout((Fl_Timeout_Handler)blink_point, decbx); + val = oldval; + updatevalue(); + return 1; + } + else if (d == FL_Enter || d == FL_KP_Enter) { // append + finp->position(finp->size()); + finp->replace(finp->position(), finp->mark(), "\n", 1); + } + } + else { + if (d == FL_Escape) { + window()->do_callback(); + return 1; + } + Fl::add_timeout(0.0, (Fl_Timeout_Handler)blink_point, decbx); + finp->static_value(""); + oldval = val; + } + return finp->handle(event); } val += d; updatevalue(); @@ -227,3 +282,18 @@ int cFreqControl::handle(int event) return 1; } +void cFreqControl::freq_input_cb(Fl_Widget*, void* arg) +{ + cFreqControl* fc = reinterpret_cast(arg); + double val = strtod(fc->finp->value(), NULL); + if (val >= 0.0 && val < pow(10, MAX_DIGITS - 3)) { + val *= 1e3; + val += 0.5; + fc->val = (long)val; + fc->updatevalue(); + if (fc->finp->index(fc->finp->size() - 1) == '\n' && val > 0.0) { + Fl::remove_timeout((Fl_Timeout_Handler)blink_point, fc->decbx); + fc->do_callback(); + } + } +} diff --git a/src/rigcontrol/rigdialog.cxx b/src/rigcontrol/rigdialog.cxx index 7c5c9094..d4be0639 100644 --- a/src/rigcontrol/rigdialog.cxx +++ b/src/rigcontrol/rigdialog.cxx @@ -2,6 +2,7 @@ #include "rigdialog.h" #include +#include #include "rigsupport.h" cFreqControl *FreqDisp=(cFreqControl *)0; diff --git a/src/rigcontrol/rigdialog.fl b/src/rigcontrol/rigdialog.fl index 4e7c0090..00d2d4c3 100644 --- a/src/rigcontrol/rigdialog.fl +++ b/src/rigcontrol/rigdialog.fl @@ -4,6 +4,8 @@ header_name {.h} code_name {.cxx} decl {\#include } {} +decl {\#include } {} + decl {\#include "rigsupport.h"} {} Function {rig_dialog()} {open diff --git a/src/trx/modem.cxx b/src/trx/modem.cxx index 3ba65a8a..1a1ab514 100644 --- a/src/trx/modem.cxx +++ b/src/trx/modem.cxx @@ -139,11 +139,15 @@ bool modem::freqlocked() double modem::get_txfreq(void) { + if (mailserver && progdefaults.PSKmailSweetSpot) + return progdefaults.PSKsweetspot; return tx_frequency; } double modem::get_txfreq_woffset(void) { + if (mailserver && progdefaults.PSKmailSweetSpot) + return (progdefaults.PSKsweetspot - progdefaults.TxOffset); return (tx_frequency - progdefaults.TxOffset); } diff --git a/src/waterfall/waterfall.cxx b/src/waterfall/waterfall.cxx index e9f802ad..2b683429 100644 --- a/src/waterfall/waterfall.cxx +++ b/src/waterfall/waterfall.cxx @@ -919,13 +919,8 @@ void qsy_cb(Fl_Widget *w, void *v) } } - if (m.carrier > 0) { - rigCAT_set_qsy(m.rfcarrier, m.carrier); - rigMEM_set_qsy(m.rfcarrier, m.carrier); -#if USE_HAMLIB - hamlib_set_qsy(m.rfcarrier, m.carrier); -#endif - } + if (m.carrier > 0) + qsy(m.rfcarrier, m.carrier); restoreFocus(); } @@ -1096,13 +1091,8 @@ void btnMem_cb(Fl_Widget *, void *menu_event) m = qrg_list[elem]; if (active_modem != *mode_info[m.mode].modem) init_modem_sync(m.mode); - if (m.rfcarrier && m.rfcarrier != wf->rfcarrier()) { - rigCAT_set_qsy(m.rfcarrier, m.carrier); - rigMEM_set_qsy(m.rfcarrier, m.carrier); -#if USE_HAMLIB - hamlib_set_qsy(m.rfcarrier, m.carrier); -#endif - } + if (m.rfcarrier && m.rfcarrier != wf->rfcarrier()) + qsy(m.rfcarrier, m.carrier); else active_modem->set_freq(m.carrier); break; @@ -1442,16 +1432,31 @@ static void hide_cursor(void *w) int WFdisp::handle(int event) { - if (!(event == FL_LEAVE || Fl::event_inside(this))) + static int pxpos, push; + if (!(event == FL_LEAVE || Fl::event_inside(this))) { + if (event == FL_RELEASE) + push = 0; return 0; + } if (trx_state != STATE_RX) return 1; int xpos = Fl::event_x() - x(); + int ypos = Fl::event_y() - y(); int eb; switch (event) { case FL_MOVE: + if (progdefaults.WaterfallQSY && ypos < WFTEXT + WFSCALE) { + Fl::remove_timeout(hide_cursor, this); + if (cursor != FL_CURSOR_WE) + window()->cursor(cursor = FL_CURSOR_WE); + if (wantcursor) { + wantcursor = false; + makeMarker(); + } + break; + } if (cursor != FL_CURSOR_DEFAULT) window()->cursor(cursor = FL_CURSOR_DEFAULT); if (!Fl::has_timeout(hide_cursor, this)) @@ -1471,8 +1476,34 @@ int WFdisp::handle(int event) if (progdefaults.WaterfallHistoryDefault) bHistory = true; } - // fall through + goto lrclick; case FL_LEFT_MOUSE: + if (event == FL_PUSH) { + push = ypos; + pxpos = xpos; + if (!progdefaults.WaterfallClickText.empty()) { + if (progdefaults.WaterfallClickText.find('%') != string::npos) { + time_t t = time(NULL); + struct tm tm; + localtime_r(&t, &tm); + char buf[256]; + strftime(buf, sizeof(buf), progdefaults.WaterfallClickText.c_str(), &tm); + ReceiveText->add(buf, FTextBase::CTRL); + } + else + ReceiveText->add(progdefaults.WaterfallClickText.c_str(), FTextBase::CTRL); + } + } + if (progdefaults.WaterfallQSY && push < WFTEXT + WFSCALE) { + long long newrfc = (pxpos - xpos) * (step==4?10:step==2?5:1); + if (!USB()) + newrfc = -newrfc; + newrfc += rfcarrier(); + qsy(newrfc, active_modem->get_freq()); + pxpos = xpos; + return 1; + } + lrclick: if (Fl::event_state() & FL_CTRL) { if (event == FL_DRAG) break; @@ -1512,6 +1543,7 @@ int WFdisp::handle(int event) restoreFocus(); // fall through case FL_LEFT_MOUSE: + push = 0; oldcarrier = newcarrier; break; }