Use Logbook record

* Added Dial button in logbook editor to set frequency / mode / operator
    to the the current record.
    - allows easy retrieval of logged data to either continue a QSO or
      set one up based on a log entry.
pull/2/head
Remi Chateauneu 2011-11-12 21:19:49 +00:00 zatwierdzone przez David Freese
rodzic ee27d64e6e
commit 11d699ea27
8 zmienionych plików z 76 dodań i 11 usunięć

Wyświetl plik

@ -83,6 +83,8 @@ extern void cb_btnUpdateCancel(Fl_Button*, void*);
extern Fl_Button *bUpdateCancel;
extern void cb_btnDelete(Fl_Button*, void*);
extern Fl_Button *bDelete;
extern void cb_btnDialFreq(Fl_Button*, void*);
extern Fl_Button *bDialFreq;
extern Fl_Input2 *txtNbrRecs_log;
extern Fl_Input2 *inpSerNoOut_log;
extern Fl_Input2 *inpMyXchg_log;

Wyświetl plik

@ -52,6 +52,7 @@ extern void clearRecord ();
extern void updateRecord ();
extern void deleteRecord ();
extern void AddRecord ();
extern void DisplayRecord (int idxRec);
extern void SearchLastQSO (const char *);
extern cQsoRec* SearchLog(const char *callsign);
extern void DupCheck();

Wyświetl plik

@ -30,7 +30,7 @@ public:
void putField (int, const char *);
void putField (int, const char *, int);
void addtoField (int, const char *);
const char *getField (int);
const char *getField (int) const;
void trimFields();
void clearRec ();
int validRec();

Wyświetl plik

@ -90,13 +90,13 @@ FIELD fields[] = {
{XCHG1, 0, &btnSelectXchgIn} // contest exchange #1 / free1 in xlog
};
void initfields()
static void initfields()
{
for (int i = 0; i < NUMFIELDS; i++)
fields[i].name = new string(fieldnames[i]);
}
int findfield( char *p )
static int findfield( const char *p )
{
int m;
int test;

Wyświetl plik

@ -261,6 +261,8 @@ Fl_Button *bUpdateCancel=(Fl_Button *)0;
Fl_Button *bDelete=(Fl_Button *)0;
Fl_Button *bDialFreq=(Fl_Button *)0;
Fl_Input2 *txtNbrRecs_log=(Fl_Input2 *)0;
Fl_Input2 *inpSerNoOut_log=(Fl_Input2 *)0;
@ -818,23 +820,33 @@ void create_logbook_dialogs() {
inpNotes_log->when(FL_WHEN_RELEASE);
} // Fl_Input2* inpNotes_log
{ bNewSave = new Fl_Button(163, 263, 55, 22, _("New"));
bNewSave->tooltip(_("New record / Save record"));
bNewSave->shortcut(0x8004e);
bNewSave->color((Fl_Color)FL_LIGHT1);
bNewSave->selection_color((Fl_Color)48);
bNewSave->callback((Fl_Callback*)cb_btnNewSave);
} // Fl_Button* bNewSave
{ bUpdateCancel = new Fl_Button(235, 263, 55, 22, _("Update"));
bUpdateCancel->tooltip(_("Update the current record"));
bUpdateCancel->shortcut(0x80055);
bUpdateCancel->color((Fl_Color)FL_LIGHT1);
bUpdateCancel->selection_color((Fl_Color)48);
bUpdateCancel->callback((Fl_Callback*)cb_btnUpdateCancel);
} // Fl_Button* bUpdateCancel
{ bDelete = new Fl_Button(307, 263, 55, 22, _("Delete"));
bDelete->tooltip(_("Delete the current record"));
bDelete->shortcut(0x80044);
bDelete->color((Fl_Color)FL_LIGHT1);
bDelete->selection_color((Fl_Color)48);
bDelete->callback((Fl_Callback*)cb_btnDelete);
} // Fl_Button* bDelete
{ bDialFreq = new Fl_Button(380, 263, 55, 22, _("Dial"));
bDialFreq->tooltip(_("Retrieve for active modem use"));
bDialFreq->shortcut(0x50066);
bDialFreq->color((Fl_Color)FL_LIGHT1);
bDialFreq->selection_color((Fl_Color)48);
bDialFreq->callback((Fl_Callback*)cb_btnDialFreq);
} // Fl_Button* bDialFreq
{ txtNbrRecs_log = new Fl_Input2(41, 263, 65, 22, _("Recs"));
txtNbrRecs_log->tooltip(_("# Records in logbook"));
txtNbrRecs_log->box(FL_DOWN_BOX);

Wyświetl plik

@ -20,7 +20,7 @@ Function {create_logbook_dialogs()} {open return_type void
} {
Fl_Window wExport {
label {Export Setup} open
xywh {588 534 655 385} type Double modal visible
xywh {588 534 655 385} type Double hide modal
} {
Fl_Group {} {
label {Select Records to Export} open
@ -283,7 +283,7 @@ btnSelectNotes->value(0);}
label Logbook open
xywh {574 55 585 410} type Double color 47 resizable visible
} {
Fl_Group editGroup {open selected
Fl_Group editGroup {open
xywh {2 2 602 290} box ENGRAVED_FRAME color 52
} {
Fl_Input inpDate_log {
@ -420,17 +420,22 @@ btnSelectNotes->value(0);}
Fl_Button bNewSave {
label New
callback cb_btnNewSave
xywh {163 263 55 22} shortcut 0x8004e color 50 selection_color 48
tooltip {New record / Save record} xywh {163 263 55 22} shortcut 0x8004e color 50 selection_color 48
}
Fl_Button bUpdateCancel {
label Update
callback cb_btnUpdateCancel
xywh {235 263 55 22} shortcut 0x80055 color 50 selection_color 48
tooltip {Update the current record} xywh {235 263 55 22} shortcut 0x80055 color 50 selection_color 48
}
Fl_Button bDelete {
label Delete
callback cb_btnDelete
xywh {307 263 55 22} shortcut 0x80044 color 50 selection_color 48
tooltip {Delete the current record} xywh {307 263 55 22} shortcut 0x80044 color 50 selection_color 48
}
Fl_Button bDialFreq {
label Dial
callback cb_btnDialFreq
tooltip {Retrieve for active modem use} xywh {380 263 55 22} shortcut 0x50066 color 50 selection_color 48
}
Fl_Input txtNbrRecs_log {
label Recs
@ -475,7 +480,7 @@ btnSelectNotes->value(0);}
code0 {bSearchPrev->image(new Fl_Pixmap(left_arrow_icon));}
}
Fl_Button bSearchNext {
callback cb_search
callback cb_search selected
tooltip {Find next} xywh {550 263 24 22} color 50 selection_color 48 align 16
code0 {bSearchNext->image(new Fl_Pixmap(right_arrow_icon));}
}

Wyświetl plik

@ -42,6 +42,7 @@
#include "adif_io.h"
#include "textio.h"
#include "logbook.h"
#include "rigsupport.h"
#include "logger.h"
#include "fl_digi.h"
@ -547,7 +548,51 @@ int log_search_handler(int)
return 1;
}
int editNbr = 0;
static int editNbr = 0;
void cb_btnDialFreq(Fl_Button* b, void* d)
{
double drf = atof(inpFreq_log->value());
if (!drf) return;
int rf1, rf, audio;
rf1 = drf * 1e6;
rf = rf1 / 10000;
rf *= 10000;
audio = rf1 - rf;
// try to keep within normal xcvr bw, 500 - 3000 Hz
while (audio > 3000) {
audio -= 3000;
rf += 3000;
}
if (audio < 500) {
audio += 500;
rf -= 500;
}
qsy(rf, audio);
std::string mode_name = inpMode_log->value();
trx_mode m;
for (m = 0; m < NUM_MODES; m++)
if (mode_name == mode_info[m].adif_name)
break;
// do we have a valid modem?
if (m < NUM_MODES && active_modem->get_mode() != mode_info[m].mode)
init_modem(mode_info[m].mode);
const cQsoRec *qsoPtr = qsodb.getRec(editNbr);
inpCall->value(qsoPtr->getField(CALL));
inpName->value (qsoPtr->getField(NAME));
inpTimeOn->value (inpTimeOff->value());
inpState->value (qsoPtr->getField(STATE));
inpCountry->value (qsoPtr->getField(COUNTRY));
inpXchgIn->value(qsoPtr->getField(XCHG1));
inpQth->value (qsoPtr->getField(QTH));
inpLoc->value (qsoPtr->getField(GRIDSQUARE));
inpNotes->value (qsoPtr->getField(NOTES));
wBrowser->take_focus();
}
void clearRecord() {
Date tdy;

Wyświetl plik

@ -106,7 +106,7 @@ void cQsoRec::trimFields () {
}
}
const char * cQsoRec::getField (int n) {
const char * cQsoRec::getField (int n) const {
if (n < 0 || n >= NUMFIELDS) return 0;
return (qsofield[n].c_str());
}