Hi,
I've been participating into the french contest "Coupe du REF" this
weekend, a lot of fun.
Even though I've been using TLF since long time, only this week-end I
took the time
to write a fully working rule file, well sort-of.
Let's start first in this mail with multipliers/section. I wanted to
track wanted sections.
Using TLF freshly built from git tree, I've been unable to configure
this rule :
/Multiplier is DXCC country or section from multiplier file, basically a
list of french departments./
This should be covered by these statements :
DX_&_SECTIONS
SERIAL_OR_SECTION
MULT_LIST=ref_deptmults
Loading an existing logfile would leave the "Sect" line flat, the "Show
multipliers" screen
would be empty. However, logging new QSO would increment the Section
stats and multi screen.
Diving into the source code, it looks like the statement DX_&_SECTIONS
is very tied to ARRL contests,
certainly for historical reasons. This is what is revealed by the
variable dx_arrlsections
set by cfg_dx_n_sections(). I've made a quick fix, please see attached
file tlf_dx_sections_quick_fix.patch
I tried to not break existing contest rules, however I haven't tested them.
I can make a fork for that, but IMO it'd be better to split the
dx_arrlsections variable as
something like one variable dx_arrl_contest and one dx_and_sections.
What do you think about it ?
The fixes in src/changepars.c would enable the "Show multipliers" screen,
and also not misinterpret serial numbers as section (a test has to be done
to not break existing contest rules).
The issue #235[2] might benefit from this fix.
[1] https://concours.r-e-f.org/reglements/actuels/reg_cdfhf_fr_202011.pdf
[2] https://github.com/Tlf/tlf/issues/235 (Mults on bandmap with custom
rules)
Anyway, thanks for maintaining and improving TLF over the years.
Last year, TLF was merely crashing (stack smashing,..) at moment,
I see a lot of work has been done since. It's much appreciated!
73
Stephane, F8CFE
diff --git a/src/addcall.c b/src/addcall.c
index 24d0b6d..0f5f02b 100644
--- a/src/addcall.c
+++ b/src/addcall.c
@@ -112,7 +112,7 @@ int addcall(void) {
add_ok = 1;
if ((dx_arrlsections == 1)
- && ((countrynr == w_cty) || (countrynr == ve_cty)))
+ && (!CONTEST_IS_ARRLDX() || (((countrynr == w_cty) || (countrynr == ve_cty)))))
add_ok = 0;
if (CONTEST_IS(PACC_PA))
diff --git a/src/addmult.c b/src/addmult.c
index 74e4af7..52b1d3a 100644
--- a/src/addmult.c
+++ b/src/addmult.c
@@ -106,7 +106,7 @@ int addmult(void) {
// ------------------------------- section ----------------------------
if ((dx_arrlsections == 1) &&
- ((countrynr == w_cty) || (countrynr == ve_cty))) {
+ (!CONTEST_IS_ARRLDX() || ((countrynr == w_cty) || (countrynr == ve_cty)))) {
/* check all possible mults for match and remember the longest one */
for (i = 0; i < mults_possible->len; i++) {
diff --git a/src/changepars.c b/src/changepars.c
index eb47f49..ddaff65 100644
--- a/src/changepars.c
+++ b/src/changepars.c
@@ -774,6 +774,7 @@ void multiplierinfo(void) {
}
if (serial_section_mult == 1 || sectn_mult_once
+ || (dx_arrlsections == 1 && !CONTEST_IS_ARRLDX())
|| (sectn_mult == 1 && !CONTEST_IS(ARRL_SS))) {
char *tmp;
int worked_at;
@@ -792,7 +793,8 @@ void multiplierinfo(void) {
/* lookup if already worked */
for (k = 0; k < nr_multis; k++) {
- if (strstr(multis[k].name, get_mult(cnt)) != NULL) {
+ // section must match exactly
+ if (strcmp(multis[k].name, get_mult(cnt)) == 0) {
worked_at = multis[k].band;
break;
}
diff --git a/src/makelogline.c b/src/makelogline.c
index 2da7f16..af614d1 100644
--- a/src/makelogline.c
+++ b/src/makelogline.c
@@ -357,8 +357,8 @@ void prepare_specific_part(void) {
fillto(77);
- } else if ((dx_arrlsections == 1) && (countrynr != w_cty)
- && (countrynr != ve_cty)) {
+ } else if ((dx_arrlsections == 1) && (!CONTEST_IS_ARRLDX() || ((countrynr != w_cty)
+ && (countrynr != ve_cty)))) {
logline4[68] = '\0';
if (addcty != 0) {
@@ -387,7 +387,7 @@ void prepare_specific_part(void) {
fillto(77);
} else if ((dx_arrlsections == 1)
- && ((countrynr == w_cty) || (countrynr == ve_cty))) {
+ && (!CONTEST_IS_ARRLDX() || (((countrynr == w_cty) || (countrynr == ve_cty))))) {
logline4[68] = '\0';
if (shownewmult >= 0) {
diff --git a/src/readcalls.c b/src/readcalls.c
index a96433f..c63dc86 100644
--- a/src/readcalls.c
+++ b/src/readcalls.c
@@ -290,7 +290,7 @@ int readcalls(void) {
sectn_mult == 1 ||
sectn_mult_once == 1 ||
((dx_arrlsections == 1)
- && ((countrynr == w_cty) || (countrynr == ve_cty)))) {
+ && (!CONTEST_IS_ARRLDX() || ((countrynr == w_cty) || (countrynr == ve_cty))))) {
// get multi info
char *multbuffer = get_multi_from_line(inputbuffer);
remember_multi(multbuffer, bandindex, 0);
@@ -419,7 +419,7 @@ int readcalls(void) {
if (dx_arrlsections == 1) {
for (int cntr = 1; cntr < MAX_DATALINES; cntr++) {
- if (cntr != w_cty && cntr != ve_cty) { // W and VE don't count here...
+ if (!CONTEST_IS_ARRLDX() || (cntr != w_cty && cntr != ve_cty)) { // W and VE don't count here...
count_contest_bands(countries[cntr], countryscore);
}
}
diff --git a/src/setcontest.h b/src/setcontest.h
index 41064fa..03a8d2a 100644
--- a/src/setcontest.h
+++ b/src/setcontest.h
@@ -24,6 +24,7 @@
#include "globalvars.h"
#define CONTEST_IS(cid) (contest->id == cid)
+#define CONTEST_IS_ARRLDX() (CONTEST_IS(ARRLDX_USA)||CONTEST_IS(ARRLDX_DX))
#define IS_ALL_BAND (CONTEST_IS(QSO) || !iscontest)
extern contest_config_t config_qso;