* Allow US units of distance for QRB
pull/1/head
David Freese 2015-04-13 14:27:27 -05:00
rodzic 91ab73f919
commit 41beca0078
13 zmienionych plików z 227 dodań i 215 usunięć

Wyświetl plik

@ -35,7 +35,6 @@ XMLRPC_SRC = include/xmlrpc.h misc/xmlrpc.cxx
FLDIGI_WIN32_RES_SRC = fldigirc.rc
FLARQ_WIN32_RES_SRC = flarq-src/flarqrc.rc
COMMON_WIN32_RES_SRC = common.rc
LOCATOR_SRC = misc/locator.c
BENCHMARK_SRC = include/benchmark.h misc/benchmark.cxx
REGEX_SRC = compat/regex.h compat/regex.c
STACK_SRC = include/stack.h misc/stack.cxx
@ -44,7 +43,7 @@ NLS_SRC = misc/nls.cxx include/nls.h
# We distribute these but do not always compile them
EXTRA_fldigi_SOURCES = $(HAMLIB_SRC) $(XMLRPC_SRC) $(FLDIGI_WIN32_RES_SRC) $(COMMON_WIN32_RES_SRC) \
$(LOCATOR_SRC) $(BENCHMARK_SRC) $(REGEX_SRC) $(STACK_SRC) $(MINGW32_SRC) $(NLS_SRC)
$(BENCHMARK_SRC) $(REGEX_SRC) $(STACK_SRC) $(MINGW32_SRC) $(NLS_SRC)
EXTRA_flarq_SOURCES = $(FLARQ_WIN32_RES_SRC) $(COMMON_WIN32_RES_SRC)
fldigi_SOURCES =
@ -474,6 +473,7 @@ fldigi_SOURCES += \
logger/speak.cxx \
main.cxx \
mfsk/interleave.cxx \
misc/locator.cxx \
mfsk/mfsk.cxx \
mfsk/mfskvaricode.cxx \
wefax/wefax.cxx \

Wyświetl plik

@ -785,6 +785,13 @@ static void cb_inpNonword(Fl_Input2* o, void*) {
progdefaults.changed = true;
}
Fl_Check_Button *btnUSunits=(Fl_Check_Button *)0;
static void cb_btnUSunits(Fl_Check_Button* o, void*) {
progdefaults.us_units = o->value();
progdefaults.changed = true;
}
Fl_Group *tabMBars=(Fl_Group *)0;
Fl_Check_Button *btnMacroMouseWheel=(Fl_Check_Button *)0;
@ -5885,17 +5892,7 @@ Fl_Double_Window* ConfigureDialog() {
{ tabLogServer = new Fl_Group(0, 50, 600, 330, _("Log"));
tabLogServer->tooltip(_("User Interface - Logging"));
tabLogServer->hide();
{ Fl_Group* o = new Fl_Group(52, 315, 496, 55, _("Client/Server Logbook"));
o->box(FL_ENGRAVED_FRAME);
o->align(Fl_Align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE));
{ Fl_Group* o = new Fl_Group(75, 335, 468, 25, _("Server IP Address/Port configured on IO tab"));
o->box(FL_FLAT_BOX);
o->align(Fl_Align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE));
o->end();
} // Fl_Group* o
o->end();
} // Fl_Group* o
{ Fl_Group* o = new Fl_Group(52, 59, 496, 180, _("QSO logging"));
{ Fl_Group* o = new Fl_Group(52, 59, 496, 198, _("QSO logging"));
o->box(FL_ENGRAVED_FRAME);
o->align(Fl_Align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE));
{ Fl_Check_Button* o = btnNagMe = new Fl_Check_Button(69, 81, 236, 20, _("Prompt to save log on exit"));
@ -5904,19 +5901,19 @@ Fl_Double_Window* ConfigureDialog() {
btnNagMe->callback((Fl_Callback*)cb_btnNagMe);
o->value(progdefaults.NagMe);
} // Fl_Check_Button* btnNagMe
{ Fl_Check_Button* o = btnClearOnSave = new Fl_Check_Button(69, 106, 236, 20, _("Clear on save"));
{ Fl_Check_Button* o = btnClearOnSave = new Fl_Check_Button(69, 110, 236, 20, _("Clear on save"));
btnClearOnSave->tooltip(_("Clear log entries after saving or using macro <LOG>"));
btnClearOnSave->down_box(FL_DOWN_BOX);
btnClearOnSave->callback((Fl_Callback*)cb_btnClearOnSave);
o->value(progdefaults.ClearOnSave);
} // Fl_Check_Button* btnClearOnSave
{ Fl_Check_Button* o = btnCallUpperCase = new Fl_Check_Button(69, 132, 236, 20, _("Convert callsign to upper case"));
{ Fl_Check_Button* o = btnCallUpperCase = new Fl_Check_Button(69, 139, 236, 20, _("Convert callsign to upper case"));
btnCallUpperCase->tooltip(_("Force callsign field to UPPERCASE"));
btnCallUpperCase->down_box(FL_DOWN_BOX);
btnCallUpperCase->callback((Fl_Callback*)cb_btnCallUpperCase);
o->value(progdefaults.calluppercase);
} // Fl_Check_Button* btnCallUpperCase
{ Fl_Check_Button* o = btnAutoFillQSO = new Fl_Check_Button(69, 157, 236, 20, _("Auto-fill Country and Azimuth"));
{ Fl_Check_Button* o = btnAutoFillQSO = new Fl_Check_Button(69, 169, 236, 20, _("Auto-fill Country and Azimuth"));
btnAutoFillQSO->tooltip(_("Fill in Country / Azimuth using cty.dat information"));
btnAutoFillQSO->down_box(FL_DOWN_BOX);
btnAutoFillQSO->callback((Fl_Callback*)cb_btnAutoFillQSO);
@ -5928,25 +5925,25 @@ Fl_Double_Window* ConfigureDialog() {
btnDateTimeSort->callback((Fl_Callback*)cb_btnDateTimeSort);
o->value(progdefaults.sort_date_time_off);
} // Fl_Check_Button* btnDateTimeSort
{ Fl_Check_Button* o = btndate_time_force = new Fl_Check_Button(322, 106, 190, 20, _("Date time ON == OFF"));
{ Fl_Check_Button* o = btndate_time_force = new Fl_Check_Button(322, 110, 190, 20, _("Date time ON == OFF"));
btndate_time_force->tooltip(_("Force date/time ON == date/time OFF"));
btndate_time_force->down_box(FL_DOWN_BOX);
btndate_time_force->callback((Fl_Callback*)cb_btndate_time_force);
o->value(progdefaults.force_date_time);
} // Fl_Check_Button* btndate_time_force
{ Fl_Check_Button* o = btnRSTindefault = new Fl_Check_Button(322, 131, 186, 20, _("Default RST in to 599/59"));
{ Fl_Check_Button* o = btnRSTindefault = new Fl_Check_Button(322, 139, 213, 20, _("Default RST in to 599/59"));
btnRSTindefault->tooltip(_("Clear log controls sets RST in to 599/59"));
btnRSTindefault->down_box(FL_DOWN_BOX);
btnRSTindefault->callback((Fl_Callback*)cb_btnRSTindefault);
o->value(progdefaults.RSTin_default);
} // Fl_Check_Button* btnRSTindefault
{ Fl_Check_Button* o = btnRSTdefault = new Fl_Check_Button(322, 157, 184, 20, _("Default RST out to 599/59"));
{ Fl_Check_Button* o = btnRSTdefault = new Fl_Check_Button(322, 169, 216, 20, _("Default RST out to 599/59"));
btnRSTdefault->tooltip(_("Clear log controls sets RST out to 599/59"));
btnRSTdefault->down_box(FL_DOWN_BOX);
btnRSTdefault->callback((Fl_Callback*)cb_btnRSTdefault);
o->value(progdefaults.RSTdefault);
} // Fl_Check_Button* btnRSTdefault
{ Fl_Input2* o = txt_cty_dat_pathname = new Fl_Input2(189, 180, 346, 24, _("cty.dat folder"));
{ Fl_Input2* o = txt_cty_dat_pathname = new Fl_Input2(189, 196, 346, 24, _("cty.dat folder"));
txt_cty_dat_pathname->tooltip(_("Enter full path-name for cty.dat folder"));
txt_cty_dat_pathname->box(FL_DOWN_BOX);
txt_cty_dat_pathname->color(FL_BACKGROUND2_COLOR);
@ -5960,19 +5957,19 @@ Fl_Double_Window* ConfigureDialog() {
txt_cty_dat_pathname->when(FL_WHEN_CHANGED);
o->value(progdefaults.cty_dat_pathname.c_str());
} // Fl_Input2* txt_cty_dat_pathname
{ btn_select_cty_dat = new Fl_Button(70, 209, 75, 24, _("Browse"));
{ btn_select_cty_dat = new Fl_Button(70, 225, 75, 24, _("Browse"));
btn_select_cty_dat->tooltip(_("Locate cty.dat file"));
btn_select_cty_dat->callback((Fl_Callback*)cb_btn_select_cty_dat);
} // Fl_Button* btn_select_cty_dat
{ btn_default_cty_dat = new Fl_Button(165, 209, 75, 24, _("Default"));
{ btn_default_cty_dat = new Fl_Button(165, 225, 75, 24, _("Default"));
btn_default_cty_dat->tooltip(_("Restore cty.dat default folder"));
btn_default_cty_dat->callback((Fl_Callback*)cb_btn_default_cty_dat);
} // Fl_Button* btn_default_cty_dat
{ btn_reload_cty_dat = new Fl_Button(260, 209, 75, 24, _("Reload"));
{ btn_reload_cty_dat = new Fl_Button(260, 225, 75, 24, _("Reload"));
btn_reload_cty_dat->tooltip(_("Reload cty.dat"));
btn_reload_cty_dat->callback((Fl_Callback*)cb_btn_reload_cty_dat);
} // Fl_Button* btn_reload_cty_dat
{ Fl_Input2* o = inpMyPower = new Fl_Input2(485, 209, 50, 24, _("Transmit Power"));
{ Fl_Input2* o = inpMyPower = new Fl_Input2(485, 225, 50, 24, _("Transmit Power"));
inpMyPower->tooltip(_("Tx power used for logbook entries"));
inpMyPower->box(FL_DOWN_BOX);
inpMyPower->color(FL_BACKGROUND2_COLOR);
@ -5989,22 +5986,22 @@ Fl_Double_Window* ConfigureDialog() {
} // Fl_Input2* inpMyPower
o->end();
} // Fl_Group* o
{ Fl_Group* o = new Fl_Group(52, 240, 496, 74, _("Rx Text Capture"));
{ Fl_Group* o = new Fl_Group(52, 263, 496, 110, _("Rx Text"));
o->box(FL_ENGRAVED_FRAME);
o->align(Fl_Align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE));
{ Fl_Check_Button* o = btnRXClicks = new Fl_Check_Button(75, 287, 191, 20, _("Single-click to capture"));
{ Fl_Check_Button* o = btnRXClicks = new Fl_Check_Button(75, 318, 191, 20, _("Single-click to capture"));
btnRXClicks->tooltip(_("Enable for single click capure of text in Rx panel"));
btnRXClicks->down_box(FL_DOWN_BOX);
btnRXClicks->callback((Fl_Callback*)cb_btnRXClicks);
o->value(progdefaults.rxtext_clicks_qso_data);
} // Fl_Check_Button* btnRXClicks
{ Fl_Check_Button* o = btnRXTooltips = new Fl_Check_Button(277, 287, 254, 20, _("callsign tooltips in received text"));
{ Fl_Check_Button* o = btnRXTooltips = new Fl_Check_Button(277, 318, 254, 20, _("callsign tooltips in received text"));
btnRXTooltips->tooltip(_("Popup info after a 2 second hover on a callsign"));
btnRXTooltips->down_box(FL_DOWN_BOX);
btnRXTooltips->callback((Fl_Callback*)cb_btnRXTooltips);
o->value(progdefaults.rxtext_tooltips);
} // Fl_Check_Button* btnRXTooltips
{ Fl_Input2* o = inpNonword = new Fl_Input2(194, 260, 279, 24, _("Word delimiters"));
{ Fl_Input2* o = inpNonword = new Fl_Input2(194, 288, 279, 24, _("Word delimiters"));
inpNonword->tooltip(_("RX text QSO data entry is bounded by the non-word characters\ndefined here. T\
ab and newline are automatically included."));
inpNonword->box(FL_DOWN_BOX);
@ -6021,6 +6018,12 @@ ab and newline are automatically included."));
o->value(progdefaults.nonwordchars.c_str());
o->labelsize(FL_NORMAL_SIZE);
} // Fl_Input2* inpNonword
{ Fl_Check_Button* o = btnUSunits = new Fl_Check_Button(277, 343, 220, 20, _("US units of distance (QRB)"));
btnUSunits->tooltip(_("Enable for single click capure of text in Rx panel"));
btnUSunits->down_box(FL_DOWN_BOX);
btnUSunits->callback((Fl_Callback*)cb_btnUSunits);
o->value(progdefaults.us_units);
} // Fl_Check_Button* btnUSunits
o->end();
} // Fl_Group* o
tabLogServer->end();

Wyświetl plik

@ -340,7 +340,7 @@ static const char szBaudRates[] = "300|600|1200|2400|4800|9600|19200|38400|57600
static const char szProsigns[] = "~|%|&|+|=|{|}|<|>|[|]| ";} {}
Fl_Window {} {
label {Fldigi configuration} open
xywh {942 44 600 415} type Double color 45 selection_color 51 labelsize 18 align 80 non_modal visible
xywh {666 113 600 415} type Double color 45 selection_color 51 labelsize 18 align 80 non_modal visible
} {
Fl_Tabs tabsConfigure {open
xywh {0 0 600 380} color 50 selection_color 50
@ -888,18 +888,9 @@ progdefaults.changed = true;}
label Log open
tooltip {User Interface - Logging} xywh {0 50 600 330} hide
} {
Fl_Group {} {
label {Client/Server Logbook} open
xywh {52 315 496 55} box ENGRAVED_FRAME align 21
} {
Fl_Group {} {
label {Server IP Address/Port configured on IO tab} open
xywh {75 335 468 25} box FLAT_BOX align 20
} {}
}
Fl_Group {} {
label {QSO logging} open
xywh {52 59 496 180} box ENGRAVED_FRAME align 21
xywh {52 59 496 198} box ENGRAVED_FRAME align 21
} {
Fl_Check_Button btnNagMe {
label {Prompt to save log on exit}
@ -913,21 +904,21 @@ progdefaults.changed = true;}
label {Clear on save}
callback {progdefaults.ClearOnSave=o->value();
progdefaults.changed = true;}
tooltip {Clear log entries after saving or using macro <LOG>} xywh {69 106 236 20} down_box DOWN_BOX
tooltip {Clear log entries after saving or using macro <LOG>} xywh {69 110 236 20} down_box DOWN_BOX
code0 {o->value(progdefaults.ClearOnSave);}
}
Fl_Check_Button btnCallUpperCase {
label {Convert callsign to upper case}
callback {progdefaults.calluppercase = o->value();
progdefaults.changed = true;}
tooltip {Force callsign field to UPPERCASE} xywh {69 132 236 20} down_box DOWN_BOX
tooltip {Force callsign field to UPPERCASE} xywh {69 139 236 20} down_box DOWN_BOX
code0 {o->value(progdefaults.calluppercase);}
}
Fl_Check_Button btnAutoFillQSO {
label {Auto-fill Country and Azimuth}
callback {progdefaults.autofill_qso_fields = o->value();
progdefaults.changed = true;}
tooltip {Fill in Country / Azimuth using cty.dat information} xywh {69 157 236 20} down_box DOWN_BOX
tooltip {Fill in Country / Azimuth using cty.dat information} xywh {69 169 236 20} down_box DOWN_BOX
code0 {o->value(progdefaults.autofill_qso_fields);}
}
Fl_Check_Button btnDateTimeSort {
@ -942,28 +933,28 @@ reload_browser();}
label {Date time ON == OFF}
callback {progdefaults.force_date_time = o->value();
progdefaults.changed = true;}
tooltip {Force date/time ON == date/time OFF} xywh {322 106 190 20} down_box DOWN_BOX
tooltip {Force date/time ON == date/time OFF} xywh {322 110 190 20} down_box DOWN_BOX
code0 {o->value(progdefaults.force_date_time);}
}
Fl_Check_Button btnRSTindefault {
label {Default RST in to 599/59}
callback {progdefaults.RSTin_default = o->value();
progdefaults.changed = true;}
tooltip {Clear log controls sets RST in to 599/59} xywh {322 131 186 20} down_box DOWN_BOX
tooltip {Clear log controls sets RST in to 599/59} xywh {322 139 213 20} down_box DOWN_BOX
code0 {o->value(progdefaults.RSTin_default);}
}
Fl_Check_Button btnRSTdefault {
label {Default RST out to 599/59}
callback {progdefaults.RSTdefault = o->value();
progdefaults.changed = true;}
tooltip {Clear log controls sets RST out to 599/59} xywh {322 157 184 20} down_box DOWN_BOX
tooltip {Clear log controls sets RST out to 599/59} xywh {322 169 216 20} down_box DOWN_BOX
code0 {o->value(progdefaults.RSTdefault);}
}
Fl_Input txt_cty_dat_pathname {
label {cty.dat folder}
callback {progdefaults.cty_dat_pathname = o->value();
progdefaults.changed = true;}
tooltip {Enter full path-name for cty.dat folder} xywh {189 180 346 24} when 1
tooltip {Enter full path-name for cty.dat folder} xywh {189 196 346 24} when 1
code0 {o->value(progdefaults.cty_dat_pathname.c_str());}
code1 {\#include "dxcc.h"}
class Fl_Input2
@ -971,44 +962,44 @@ progdefaults.changed = true;}
Fl_Button btn_select_cty_dat {
label Browse
callback {select_cty_dat_pathname();}
tooltip {Locate cty.dat file} xywh {70 209 75 24}
tooltip {Locate cty.dat file} xywh {70 225 75 24}
}
Fl_Button btn_default_cty_dat {
label Default
callback {default_cty_dat_pathname();}
tooltip {Restore cty.dat default folder} xywh {165 209 75 24}
tooltip {Restore cty.dat default folder} xywh {165 225 75 24}
}
Fl_Button btn_reload_cty_dat {
label Reload
callback {reload_cty_dat();}
tooltip {Reload cty.dat} xywh {260 209 75 24}
tooltip {Reload cty.dat} xywh {260 225 75 24}
}
Fl_Input inpMyPower {
label {Transmit Power}
callback {progdefaults.mytxpower = o->value();
progdefaults.changed = true;}
tooltip {Tx power used for logbook entries} xywh {485 209 50 24}
tooltip {Tx power used for logbook entries} xywh {485 225 50 24}
code0 {o->value(progdefaults.mytxpower.c_str());}
code1 {o->labelsize(FL_NORMAL_SIZE);}
class Fl_Input2
}
}
Fl_Group {} {
label {Rx Text Capture} open
xywh {52 240 496 74} box ENGRAVED_FRAME align 21
label {Rx Text} open
xywh {52 263 496 110} box ENGRAVED_FRAME align 21
} {
Fl_Check_Button btnRXClicks {
label {Single-click to capture}
callback {progdefaults.rxtext_clicks_qso_data = o->value();
progdefaults.changed = true;}
tooltip {Enable for single click capure of text in Rx panel} xywh {75 287 191 20} down_box DOWN_BOX
tooltip {Enable for single click capure of text in Rx panel} xywh {75 318 191 20} down_box DOWN_BOX
code0 {o->value(progdefaults.rxtext_clicks_qso_data);}
}
Fl_Check_Button btnRXTooltips {
label {callsign tooltips in received text}
callback {progdefaults.rxtext_tooltips = o->value();
progdefaults.changed = true;}
tooltip {Popup info after a 2 second hover on a callsign} xywh {277 287 254 20} down_box DOWN_BOX
tooltip {Popup info after a 2 second hover on a callsign} xywh {277 318 254 20} down_box DOWN_BOX
code0 {o->value(progdefaults.rxtext_tooltips);}
}
Fl_Input inpNonword {
@ -1016,11 +1007,18 @@ progdefaults.changed = true;}
callback {progdefaults.nonwordchars = o->value();
progdefaults.changed = true;}
tooltip {RX text QSO data entry is bounded by the non-word characters
defined here. Tab and newline are automatically included.} xywh {194 260 279 24} textfont 4
defined here. Tab and newline are automatically included.} xywh {194 288 279 24} textfont 4
code0 {o->value(progdefaults.nonwordchars.c_str());}
code1 {o->labelsize(FL_NORMAL_SIZE);}
class Fl_Input2
}
Fl_Check_Button btnUSunits {
label {US units of distance (QRB)}
callback {progdefaults.us_units = o->value();
progdefaults.changed = true;}
tooltip {Enable for single click capure of text in Rx panel} xywh {277 343 220 20} down_box DOWN_BOX
code0 {o->value(progdefaults.us_units);}
}
}
}
Fl_Group tabMBars {

Wyświetl plik

@ -2446,9 +2446,9 @@ void cb_loc(Fl_Widget* w, void*)
}
inpLoc->value(s.c_str());
if (locator2longlat(&lon[0], &lat[0], progdefaults.myLocator.c_str()) == RIG_OK &&
locator2longlat(&lon[1], &lat[1], s.c_str()) == RIG_OK &&
qrb(lon[0], lat[0], lon[1], lat[1], &distance, &azimuth) == RIG_OK) {
if (QRB::locator2longlat(&lon[0], &lat[0], progdefaults.myLocator.c_str()) == QRB::QRB_OK &&
QRB::locator2longlat(&lon[1], &lat[1], s.c_str()) == QRB::QRB_OK &&
QRB::qrb(lon[0], lat[0], lon[1], lat[1], &distance, &azimuth) == QRB::QRB_OK) {
char az[4];
snprintf(az, sizeof(az), "%3.0f", azimuth);
inpAZ->value(az);
@ -2517,8 +2517,8 @@ if (bWF_only) return;
const struct dxcc* e = dxcc_lookup(inpCall->value());
if (e) {
double lon, lat, distance, azimuth;
if (locator2longlat(&lon, &lat, progdefaults.myLocator.c_str()) == RIG_OK &&
qrb(lon, lat, -e->longitude, e->latitude, &distance, &azimuth) == RIG_OK) {
if (QRB::locator2longlat(&lon, &lat, progdefaults.myLocator.c_str()) == QRB::QRB_OK &&
QRB::qrb(lon, lat, -e->longitude, e->latitude, &distance, &azimuth) == QRB::QRB_OK) {
char az[4];
snprintf(az, sizeof(az), "%3.0f", azimuth);
inpAZ->value(az, sizeof(az) - 1);

Wyświetl plik

@ -103,6 +103,7 @@ extern Fl_Input2 *inpMyPower;
extern Fl_Check_Button *btnRXClicks;
extern Fl_Check_Button *btnRXTooltips;
extern Fl_Input2 *inpNonword;
extern Fl_Check_Button *btnUSunits;
extern Fl_Group *tabMBars;
extern Fl_Check_Button *btnMacroMouseWheel;
#include <FL/Fl_Counter.H>

Wyświetl plik

@ -2,9 +2,9 @@
// configuration.h
//
// Copyright (C) 2006-2010
// Dave Freese, W1HKJ
// Dave Freese, W1HKJ
// Copyright (C) 2008-2010
// Stelios Bounanos, M0GLD
// Stelios Bounanos, M0GLD
//
// This file is part of fldigi.
//
@ -128,9 +128,9 @@
ELEM_(bool, disable_rsid_freq_change, "DISABLERSIDFREQCHANGE", \
"disable changing frequency on rsid modem change/reset", \
false) \
ELEM_(bool, retain_freq_lock, "RETAINFREQLOCK", \
"retain frequency lock on rsid modem change/reset", \
false) \
ELEM_(bool, retain_freq_lock, "RETAINFREQLOCK", \
"retain frequency lock on rsid modem change/reset", \
false) \
ELEM_(bool, changed, "", "", false) \
\
ELEM_(double, wfRefLevel, "WFREFLEVEL", \
@ -535,9 +535,9 @@
ELEM_(bool, contestia8bit, "CONTESTIA8BIT", \
"8-bit extended characters", \
true) \
ELEM_(bool, contestia_reset_fec, "CONTESTIARESETFEC", \
"Force Integration (FEC) depth to be reset when new BW/Tones selected", \
false) \
ELEM_(bool, contestia_reset_fec, "CONTESTIARESETFEC", \
"Force Integration (FEC) depth to be reset when new BW/Tones selected", \
false) \
/* THOR */ \
ELEM_(double, THOR_BW, "THORBW", \
"Filter bandwidth factor (bandwidth relative to signal width)", \
@ -1460,57 +1460,57 @@
false) \
/* XML-RPC/ARQ/KISS servers */ \
ELEM_(std::string, xmlrpc_address, "XMLRPC_ADDRESS", \
"IP Address of XMLRPC Socket", \
DEFAULT_XMLPRC_IP_ADDRESS) \
"IP Address of XMLRPC Socket", \
DEFAULT_XMLPRC_IP_ADDRESS) \
ELEM_(std::string, xmlrpc_port, "XMLRPC_PORT", \
"IP port number of XMLRPC socket", \
DEFAULT_XMLRPC_IP_PORT) \
"IP port number of XMLRPC socket", \
DEFAULT_XMLRPC_IP_PORT) \
ELEM_(std::string, xmlrpc_allow, "", "", "") \
ELEM_(std::string, xmlrpc_deny, "", "", "") \
ELEM_(int, rx_msgid, "", "", 9876) \
ELEM_(int, tx_msgid, "", "", 6789) \
ELEM_(std::string, arq_address, "ARQ_ADDRESS", \
"IP Address of ARQ socket", \
DEFAULT_ARQ_IP_ADDRESS) \
"IP Address of ARQ socket", \
DEFAULT_ARQ_IP_ADDRESS) \
ELEM_(std::string, arq_port, "ARQ_PORT", \
"IP port number of ARQ socket", \
DEFAULT_ARQ_IP_PORT) \
ELEM_(std::string, kiss_address, "KISS_ADDRESS", \
"IP Address of KISS socket", \
DEFAULT_KISS_IP_ADDRESS) \
ELEM_(std::string, kiss_io_port, "KISS_IO_PORT", \
"IP port number of KISS socket", \
DEFAULT_KISS_IP_IO_PORT) \
ELEM_(std::string, kiss_out_port, "KISS_OUT_PORT", \
"Out udp port used when ip address is the same", \
DEFAULT_KISS_IP_OUT_PORT) \
ELEM_(int, kiss_dual_port_enabled, "KISS_DUAL_PORT_ENABLED", \
"Required when same IP address is used.", \
0) \
ELEM_(int, data_io_enabled, "DATA_IO_ENABLED", \
"Disabled (0) ARQ socket enabled (1) KISS socket enabled (2)", \
1) \
ELEM_(bool, ax25_decode_enabled, "AX25_DECODE_ENABLED", \
"Dissasemble AX25 packet into human readable form", \
false) \
ELEM_(bool, enableBusyChannel, "ENABLE_BUSY_CHANNEL", \
"Detect busy channel and wait for a period of time before txing", \
false) \
ELEM_(int, busyChannelSeconds, "BUSY_CHANNEL_SECONDS", \
"Number of seconds to wait before transmit resume", \
3) \
ELEM_(int, kpsql_attenuation, "KPSQL_ATTENUATION", \
"KPSQL Attenuation in 1/n of 1:1 Gain", \
2) \
ELEM_(bool, csma_enabled, "CSMA_ENABLED", \
"Use CSMA on heavy traffic channels (AX25)", \
DEFAULT_ARQ_IP_PORT) \
ELEM_(std::string, kiss_address, "KISS_ADDRESS", \
"IP Address of KISS socket", \
DEFAULT_KISS_IP_ADDRESS) \
ELEM_(std::string, kiss_io_port, "KISS_IO_PORT", \
"IP port number of KISS socket", \
DEFAULT_KISS_IP_IO_PORT) \
ELEM_(std::string, kiss_out_port, "KISS_OUT_PORT", \
"Out udp port used when ip address is the same", \
DEFAULT_KISS_IP_OUT_PORT) \
ELEM_(int, kiss_dual_port_enabled, "KISS_DUAL_PORT_ENABLED", \
"Required when same IP address is used.", \
0) \
ELEM_(int, data_io_enabled, "DATA_IO_ENABLED", \
"Disabled (0) ARQ socket enabled (1) KISS socket enabled (2)", \
1) \
ELEM_(bool, ax25_decode_enabled, "AX25_DECODE_ENABLED", \
"Dissasemble AX25 packet into human readable form", \
false) \
ELEM_(bool, enableBusyChannel, "ENABLE_BUSY_CHANNEL", \
"Detect busy channel and wait for a period of time before txing", \
false) \
ELEM_(int, busyChannelSeconds, "BUSY_CHANNEL_SECONDS", \
"Number of seconds to wait before transmit resume", \
3) \
ELEM_(int, kpsql_attenuation, "KPSQL_ATTENUATION", \
"KPSQL Attenuation in 1/n of 1:1 Gain", \
2) \
ELEM_(bool, csma_enabled, "CSMA_ENABLED", \
"Use CSMA on heavy traffic channels (AX25)", \
true) \
ELEM_(std::string, flrig_ip_address, "FLRIG_IP_ADDRESS", \
"IP Address of flrig server", \
DEFAULT_FLRIG_IP_ADDRESS) \
DEFAULT_FLRIG_IP_ADDRESS) \
ELEM_(std::string, flrig_ip_port, "FLRIG_IP_PORT", \
"IP port number of flrig server", \
DEFAULT_FLRIG_IP_PORT) \
"IP port number of flrig server", \
DEFAULT_FLRIG_IP_PORT) \
ELEM_(bool, show_all_codes, "SHOW_ALL_CODES", \
"Display all rx char's using ascii3 table", \
false) \
@ -1618,7 +1618,7 @@
ELEM_(bool, wx_station_name, "WX_STATION_NAME", \
"Report station noun name", \
true) \
/* KML Keyhole Markup Language */ \
/* KML Keyhole Markup Language */ \
ELEM_(bool, kml_purge_on_startup, "KML_PURGE_ON_STARTUP", \
"Purge KML data at startup", \
false) \
@ -1711,6 +1711,9 @@
ELEM_(Fl_Font, MacroEditFontnbr, "MACROEDITFONTNBR", \
"RX text font index", \
FL_HELVETICA) \
ELEM_(bool, us_units, "US_UNITS", \
"Use US units of distance for QRB", \
false) \
ELEM_(int, MacroEditFontsize, "MACROEDITFONTSIZE", \
"RX text font size", \
16)
@ -1722,23 +1725,23 @@
#define ELEM_ ELEM_DECLARE_CONFIGURATION
struct configuration
{
CONFIG_LIST
CONFIG_LIST
void writeDefaultsXML();
void storeDefaults();
bool readDefaultsXML();
void loadDefaults();
void saveDefaults();
int setDefaults();
void resetDefaults(void);
static void reset(void);
void writeDefaultsXML();
void storeDefaults();
bool readDefaultsXML();
void loadDefaults();
void saveDefaults();
int setDefaults();
void resetDefaults(void);
static void reset(void);
void initInterface();
void testCommPorts();
const char* strBaudRate();
int BaudRate(size_t);
int nBaudRate(const char *);
void initFonts(void);
void initInterface();
void testCommPorts();
const char* strBaudRate();
int BaudRate(size_t);
int nBaudRate(const char *);
void initFonts(void);
};
extern configuration progdefaults;

Wyświetl plik

@ -23,32 +23,24 @@
#include <config.h>
#if USE_HAMLIB
# include <hamlib/rotator.h>
#else
# ifdef __cplusplus
extern "C" {
# endif
namespace QRB {
extern int qrb(double lon1, double lat1, double lon2, double lat2, double *distance, double *azimuth);
enum {QRB_OK, QRB_EINVAL};
extern double distance_long_path(double distance);
extern double azimuth_long_path(double azimuth);
int qrb(double lon1, double lat1, double lon2, double lat2, double *distance, double *azimuth);
extern int longlat2locator(double longitude, double latitude, char *locator_res, int pair_count);
extern int locator2longlat(double *longitude, double *latitude, const char *locator);
double distance_long_path(double distance);
double azimuth_long_path(double azimuth);
extern double dms2dec(int degrees, int minutes, double seconds, int sw);
extern int dec2dms(double dec, int *degrees, int *minutes, double *seconds, int *sw);
int longlat2locator(double longitude, double latitude, char *locator_res, int pair_count);
int locator2longlat(double *longitude, double *latitude, const char *locator);
extern int dec2dmmm(double dec, int *degrees, double *minutes, int *sw);
extern double dmmm2dec(int degrees, double minutes, int sw);
# define HAMLIB_API /* empty */
enum rig_errcode_e { RIG_OK = 0, RIG_EINVAL };
double dms2dec(int degrees, int minutes, double seconds, int sw);
int dec2dms(double dec, int *degrees, int *minutes, double *seconds, int *sw);
int dec2dmmm(double dec, int *degrees, double *minutes, int *sw);
double dmmm2dec(int degrees, double minutes, int sw);
# ifdef __cplusplus
}
# endif
#endif /* USE_HAMLIB */
#endif /* LOCATOR_H_ */

Wyświetl plik

@ -799,9 +799,9 @@ void SearchLastQSO(const char *callsign)
double lon1, lat1, lon2, lat2;
double azimuth, distance;
char szAZ[4];
if ( locator2longlat(&lon1, &lat1, progdefaults.myLocator.c_str()) == RIG_OK &&
locator2longlat(&lon2, &lat2, inpLoc->value()) == RIG_OK &&
qrb(lon1, lat1, lon2, lat2, &distance, &azimuth) == RIG_OK ) {
if ( QRB::locator2longlat(&lon1, &lat1, progdefaults.myLocator.c_str()) == QRB::QRB_OK &&
QRB::locator2longlat(&lon2, &lat2, inpLoc->value()) == QRB::QRB_OK &&
QRB::qrb(lon1, lat1, lon2, lat2, &distance, &azimuth) == QRB::QRB_OK ) {
snprintf(szAZ,sizeof(szAZ),"%0.f", azimuth);
inpAZ->value(szAZ);
} else

Wyświetl plik

@ -417,9 +417,9 @@ void QRZ_disp_result()
char buf[10];
buf[0] = '\0';
double distance, azimuth, lon[2], lat[2];
if (locator2longlat(&lon[0], &lat[0], progdefaults.myLocator.c_str()) == RIG_OK &&
locator2longlat(&lon[1], &lat[1], lookup_grid.c_str()) == RIG_OK &&
qrb(lon[0], lat[0], lon[1], lat[1], &distance, &azimuth) == RIG_OK)
if (QRB::locator2longlat(&lon[0], &lat[0], progdefaults.myLocator.c_str()) == QRB::QRB_OK &&
QRB::locator2longlat(&lon[1], &lat[1], lookup_grid.c_str()) == QRB::QRB_OK &&
QRB::qrb(lon[0], lat[0], lon[1], lat[1], &distance, &azimuth) == QRB::QRB_OK)
snprintf(buf, sizeof(buf), "%03.0f", round(azimuth));
inpAZ->value(buf);
}

Wyświetl plik

@ -137,9 +137,9 @@ bool xml_get_record(const char *callsign)
double lon1, lat1, lon2, lat2;
double azimuth, distance;
char szAZ[4];
if ( locator2longlat(&lon1, &lat1, progdefaults.myLocator.c_str()) == RIG_OK &&
locator2longlat(&lon2, &lat2, inpLoc->value()) == RIG_OK &&
qrb(lon1, lat1, lon2, lat2, &distance, &azimuth) == RIG_OK ) {
if ( QRB::locator2longlat(&lon1, &lat1, progdefaults.myLocator.c_str()) == QRB::QRB_OK &&
QRB::locator2longlat(&lon2, &lat2, inpLoc->value()) == QRB::QRB_OK &&
QRB::qrb(lon1, lat1, lon2, lat2, &distance, &azimuth) == QRB::QRB_OK ) {
snprintf(szAZ,sizeof(szAZ),"%0.f", azimuth);
inpAZ->value(szAZ);
} else

Wyświetl plik

@ -202,8 +202,8 @@ CoordinateT::Pair::Pair( double lon, double lat )
CoordinateT::Pair::Pair( const std::string & locator )
{
double lon, lat ;
int res = locator2longlat( &lon, &lat, locator.c_str() );
if( res != RIG_OK ) {
int res = QRB::locator2longlat( &lon, &lat, locator.c_str() );
if( res != QRB::QRB_OK ) {
throw std::runtime_error("Cannot decode Maidenhead locator:" + locator );
};
m_lon = CoordinateT( lon, true );
@ -213,11 +213,11 @@ CoordinateT::Pair::Pair( const std::string & locator )
double CoordinateT::Pair::distance( const Pair & a ) const
{
double dist, azimuth ;
int res = qrb(
int res = QRB::qrb(
longitude().angle(), latitude().angle(),
a.longitude().angle(), a.latitude().angle(),
&dist, &azimuth );
if( res != RIG_OK) {
if( res != QRB::QRB_OK) {
std::stringstream sstrm ;
sstrm << "Bad qrb result:" << *this << " <-> " << a ;
throw std::runtime_error(sstrm.str());
@ -228,13 +228,13 @@ double CoordinateT::Pair::distance( const Pair & a ) const
std::string CoordinateT::Pair::locator(void) const
{
char buf[64];
int ret = longlat2locator(
int ret = QRB::longlat2locator(
longitude().angle(),
latitude().angle(),
buf,
3 );
if( ret == RIG_OK ) {
if( ret == QRB::QRB_OK ) {
return buf ;
}
return std::string();

Wyświetl plik

@ -4,7 +4,7 @@
*/
/**
* \file src/locator.c
* \file src/locator.cxx
* \brief locator and bearing conversion interface
* \author Stephane Fillod and the Hamlib Group
* \date 2000-2006
@ -68,16 +68,23 @@
#include <ctype.h>
#include <math.h>
#include "configuration.h"
#include "locator.h"
#ifndef DOC_HIDDEN
namespace QRB {
#define RADIAN (180.0 / M_PI)
/* arc length for 1 degree, 60 Nautical Miles */
#define ARC_IN_KM 111.2
/* arc length for 1 degree, 60 Nautical Miles
* 109.728 Kilometers
* 68.182 statute miles
* arc length for 1 radian, 6286.951 Km
* 3437.746 Nm
* 3906.41 Sm
*/
#define ARC_IN_KM 6372.5639
#define ARC_IN_NM 3484.5603
#define ARC_IN_SM 3959.7276
/* The following is contributed by Dave Hines M1CXW
*
@ -118,10 +125,6 @@ const static int loc_char_range[] = { 18, 10, 24, 10, 24, 10 };
#define MAX_LOCATOR_PAIRS 6
#define MIN_LOCATOR_PAIRS 1
/* end dph */
#endif /* !DOC_HIDDEN */
/**
* \brief Convert DMS to decimal degrees
* \param degrees Degrees, whole degrees
@ -143,7 +146,7 @@ const static int loc_char_range[] = { 18, 10, 24, 10, 24, 10 };
* \sa dec2dms()
*/
double HAMLIB_API dms2dec(int degrees, int minutes, double seconds, int sw) {
double dms2dec(int degrees, int minutes, double seconds, int sw) {
double st;
if (degrees < 0)
@ -183,7 +186,7 @@ double HAMLIB_API dms2dec(int degrees, int minutes, double seconds, int sw) {
* \sa dec2dmmm()
*/
double HAMLIB_API dmmm2dec(int degrees, double minutes, int sw) {
double dmmm2dec(int degrees, double minutes, int sw) {
double st;
if (degrees < 0)
@ -221,19 +224,19 @@ double HAMLIB_API dmmm2dec(int degrees, double minutes, int sw) {
* to determine whether the DMS angle should be treated as negative
* (south or west).
*
* \retval -RIG_EINVAL if any of the pointers are NULL.
* \retval RIG_OK if conversion went OK.
* \retval -QRB_EINVAL if any of the pointers are NULL.
* \retval QRB_OK if conversion went OK.
*
* \sa dms2dec()
*/
int HAMLIB_API dec2dms(double dec, int *degrees, int *minutes, double *seconds, int *sw) {
int dec2dms(double dec, int *degrees, int *minutes, double *seconds, int *sw) {
int deg, min;
double st;
/* bail if NULL pointers passed */
if (!degrees || !minutes || !seconds || !sw)
return -RIG_EINVAL;
return -QRB_EINVAL;
/* reverse the sign if dec has a magnitude greater
* than 180 and factor out multiples of 360.
@ -273,7 +276,7 @@ int HAMLIB_API dec2dms(double dec, int *degrees, int *minutes, double *seconds,
*minutes = min;
*seconds = st;
return RIG_OK;
return QRB_OK;
}
/**
@ -297,27 +300,27 @@ int HAMLIB_API dec2dms(double dec, int *degrees, int *minutes, double *seconds,
* to determine whether the D M.MMM angle should be treated as negative
* (south or west).
*
* \retval -RIG_EINVAL if any of the pointers are NULL.
* \retval RIG_OK if conversion went OK.
* \retval -QRB_EINVAL if any of the pointers are NULL.
* \retval QRB_OK if conversion went OK.
*
* \sa dmmm2dec()
*/
int HAMLIB_API dec2dmmm(double dec, int *degrees, double *minutes, int *sw) {
int dec2dmmm(double dec, int *degrees, double *minutes, int *sw) {
int r, min;
double sec;
/* bail if NULL pointers passed */
if (!degrees || !minutes || !sw)
return -RIG_EINVAL;
return -QRB_EINVAL;
r = dec2dms(dec, degrees, &min, &sec, sw);
if (r != RIG_OK)
if (r != QRB_OK)
return r;
*minutes = (double)min + sec / 60;
return RIG_OK;
return QRB_OK;
}
/**
@ -335,9 +338,9 @@ int HAMLIB_API dec2dmmm(double dec, int *degrees, double *minutes, int *sw) {
* EM19 will return coordinates equivalent to the southwest corner
* of EM19mm.
*
* \retval -RIG_EINVAL if locator exceeds RR99xx99xx99 or exceeds length
* \retval -QRB_EINVAL if locator exceeds RR99xx99xx99 or exceeds length
* limit--currently 1 to 6 lon/lat pairs.
* \retval RIG_OK if conversion went OK.
* \retval QRB_OK if conversion went OK.
*
* \bug The fifth pair ranges from aa to xx, there is another convention
* that ranges from aa to yy. At some point both conventions should be
@ -348,7 +351,7 @@ int HAMLIB_API dec2dmmm(double dec, int *degrees, double *minutes, int *sw) {
/* begin dph */
int HAMLIB_API locator2longlat(double *longitude, double *latitude, const char *locator) {
int locator2longlat(double *longitude, double *latitude, const char *locator) {
int x_or_y, paircount;
int locvalue, pair;
int divisions;
@ -356,7 +359,7 @@ int HAMLIB_API locator2longlat(double *longitude, double *latitude, const char *
/* bail if NULL pointers passed */
if (!longitude || !latitude)
return -RIG_EINVAL;
return -QRB_EINVAL;
paircount = strlen(locator) / 2;
@ -364,7 +367,7 @@ int HAMLIB_API locator2longlat(double *longitude, double *latitude, const char *
if (paircount > MAX_LOCATOR_PAIRS)
paircount = MAX_LOCATOR_PAIRS;
else if (paircount < MIN_LOCATOR_PAIRS)
return -RIG_EINVAL;
return -QRB_EINVAL;
/* For x(=longitude) and y(=latitude) */
for (x_or_y = 0; x_or_y < 2; ++x_or_y) {
@ -380,7 +383,7 @@ int HAMLIB_API locator2longlat(double *longitude, double *latitude, const char *
/* Check range for non-letter/digit or out of range */
if ((locvalue < 0) || (locvalue >= loc_char_range[pair]))
return -RIG_EINVAL;
return -QRB_EINVAL;
divisions *= loc_char_range[pair];
ordinate += locvalue * 180.0 / divisions;
@ -394,7 +397,7 @@ int HAMLIB_API locator2longlat(double *longitude, double *latitude, const char *
*longitude = xy[0] * 2.0;
*latitude = xy[1];
return RIG_OK;
return QRB_OK;
}
/* end dph */
@ -408,9 +411,9 @@ int HAMLIB_API locator2longlat(double *longitude, double *latitude, const char *
* Convert longitude/latitude (decimal degrees) to Maidenhead grid locator.
* \a locator must point to an array at least \a pair_count * 2 char + '\\0'.
*
* \retval -RIG_EINVAL if \a locator is NULL or \a pair_count exceeds
* \retval -QRB_EINVAL if \a locator is NULL or \a pair_count exceeds
* length limit. Currently 1 to 6 lon/lat pairs.
* \retval RIG_OK if conversion went OK.
* \retval QRB_OK if conversion went OK.
*
* \bug \a locator is not tested for overflow.
* \bug The fifth pair ranges from aa to yy, there is another convention
@ -422,15 +425,15 @@ int HAMLIB_API locator2longlat(double *longitude, double *latitude, const char *
/* begin dph */
int HAMLIB_API longlat2locator(double longitude, double latitude, char *locator, int pair_count) {
int longlat2locator(double longitude, double latitude, char *locator, int pair_count) {
int x_or_y, pair, locvalue, divisions;
double square_size, ordinate;
if (!locator)
return -RIG_EINVAL;
return -QRB_EINVAL;
if (pair_count < MIN_LOCATOR_PAIRS || pair_count > MAX_LOCATOR_PAIRS)
return -RIG_EINVAL;
return -QRB_EINVAL;
for (x_or_y = 0; x_or_y < 2; ++x_or_y) {
ordinate = (x_or_y == 0) ? longitude / 2.0 : latitude;
@ -450,7 +453,7 @@ int HAMLIB_API longlat2locator(double longitude, double latitude, char *locator,
}
locator[pair_count * 2] = '\0';
return RIG_OK;
return QRB_OK;
}
/* end dph */
@ -471,9 +474,9 @@ int HAMLIB_API longlat2locator(double longitude, double latitude, char *locator,
* calculated, are considered equidistant and the bearing is
* simply resolved to be true north (0.0°).
*
* \retval -RIG_EINVAL if NULL pointer passed or lat and lon values
* \retval -QRB_EINVAL if NULL pointer passed or lat and lon values
* exceed -90 to 90 or -180 to 180.
* \retval RIG_OK if calculations are successful.
* \retval QRB_OK if calculations are successful.
*
* \return The distance in kilometers and azimuth in decimal degrees
* for the short path are stored in \a distance and \a azimuth.
@ -481,18 +484,18 @@ int HAMLIB_API longlat2locator(double longitude, double latitude, char *locator,
* \sa distance_long_path(), azimuth_long_path()
*/
int HAMLIB_API qrb(double lon1, double lat1, double lon2, double lat2, double *distance, double *azimuth) {
int qrb(double lon1, double lat1, double lon2, double lat2, double *distance, double *azimuth) {
double delta_long, tmp, arc, az;
/* bail if NULL pointers passed */
if (!distance || !azimuth)
return -RIG_EINVAL;
return -QRB_EINVAL;
if ((lat1 > 90.0 || lat1 < -90.0) || (lat2 > 90.0 || lat2 < -90.0))
return -RIG_EINVAL;
return -QRB_EINVAL;
if ((lon1 > 180.0 || lon1 < -180.0) || (lon2 > 180.0 || lon2 < -180.0))
return -RIG_EINVAL;
return -QRB_EINVAL;
/* Prevent ACOS() Domain Error */
if (lat1 == 90.0)
@ -519,7 +522,7 @@ int HAMLIB_API qrb(double lon1, double lat1, double lon2, double lat2, double *d
/* Station points coincide, use an Omni! */
*distance = 0.0;
*azimuth = 0.0;
return RIG_OK;
return QRB_OK;
}
if (tmp < -.999999) {
@ -529,9 +532,9 @@ int HAMLIB_API qrb(double lon1, double lat1, double lon2, double lat2, double *d
* So take 180 Degrees of arc times 60 nm,
* and you get 10800 nm, or whatever units...
*/
*distance = 180.0 * ARC_IN_KM;
*distance = M_PI * ARC_IN_KM;
*azimuth = 0.0;
return RIG_OK;
return QRB_OK;
}
arc = acos(tmp);
@ -543,7 +546,7 @@ int HAMLIB_API qrb(double lon1, double lat1, double lon2, double lat2, double *d
*/
*distance = ARC_IN_KM * RADIAN * arc;
*distance = arc * ARC_IN_KM;
/* Short Path */
/* Change to azimuth computation by Dave Freese, W1HKJ */
@ -558,7 +561,7 @@ int HAMLIB_API qrb(double lon1, double lat1, double lon2, double lat2, double *d
az -= 360.0;
*azimuth = floor(az + 0.5);
return RIG_OK;
return QRB_OK;
}
/**
@ -573,8 +576,8 @@ int HAMLIB_API qrb(double lon1, double lat1, double lon2, double lat2, double *d
* \sa qrb()
*/
double HAMLIB_API distance_long_path(double distance) {
return (ARC_IN_KM * 360.0) - distance;
double distance_long_path(double distance) {
return (ARC_IN_KM * 2.0 * M_PI) - distance;
}
/**
@ -589,8 +592,10 @@ double HAMLIB_API distance_long_path(double distance) {
* \sa qrb()
*/
double HAMLIB_API azimuth_long_path(double azimuth) {
double azimuth_long_path(double azimuth) {
return azimuth + (azimuth <= 180.0 ? 180.0 : -180.0);
}
} // namespace QRB
/*! @} */

Wyświetl plik

@ -665,7 +665,7 @@ const char* FTextRX::dxcc_lookup_call(int x, int y)
const vector<regmatch_t>& v = loc.suboff();
s += v[0].rm_so;
*(s + v[0].rm_eo) = '\0';
if (locator2longlat(&lon2, &lat2, s) != RIG_OK)
if (QRB::locator2longlat(&lon2, &lat2, s) != QRB::QRB_OK)
goto ret;
e = 0; qsl = 0; qso = 0;
}
@ -675,7 +675,7 @@ const char* FTextRX::dxcc_lookup_call(int x, int y)
qso = SearchLog(s);
}
if (qso && locator2longlat(&lon2, &lat2, qso->getField(GRIDSQUARE)) != RIG_OK)
if (qso && QRB::locator2longlat(&lon2, &lat2, qso->getField(GRIDSQUARE)) != QRB::QRB_OK)
lon2 = lat2 = 360.0;
if (e) {
@ -689,11 +689,21 @@ const char* FTextRX::dxcc_lookup_call(int x, int y)
<< ") CQ-" << e->cq_zone << " ITU-" << e->itu_zone << '\n';
}
if (locator2longlat(&lon1, &lat1, progdefaults.myLocator.c_str()) == RIG_OK &&
qrb(lon1, lat1, lon2, lat2, &distance, &azimuth) == RIG_OK) {
stip << "QTE " << fixed << setprecision(0) << azimuth << '\260' << " ("
<< azimuth_long_path(azimuth) << '\260' << ") QRB " << distance << "km ("
<< distance_long_path(distance) << "km)\n";
if (QRB::locator2longlat(&lon1, &lat1, progdefaults.myLocator.c_str()) == QRB::QRB_OK &&
QRB::qrb(lon1, lat1, lon2, lat2, &distance, &azimuth) == QRB::QRB_OK) {
if (progdefaults.us_units) {
stip << "QTE " << fixed << setprecision(0) << azimuth << '\260' << " ("
<< QRB::azimuth_long_path(azimuth) << '\260' << ") QRB "
<< distance * 0.62168188 << "mi"<< " (" <<
QRB::distance_long_path(distance) * 0.62168188 <<
"mi)\n";
}
else {
stip << "QTE " << fixed << setprecision(0) << azimuth << '\260' << " ("
<< QRB::azimuth_long_path(azimuth) << '\260' << ") QRB "
<< distance << "km(" <<
QRB::distance_long_path(distance) << "km)\n";
}
}
if (qso) {