feat(db): fill in the distances nothing ever recorded

The published page derives a distance as it renders, which fixed the empty
column there but not the cause: the field is empty in the database, so it goes
out empty in every ADIF export and leaves the same gap in whoever imports it.

BackfillDistances computes it from the two locators for QSOs that have both.
Only where it is EMPTY: a stored distance came from the log that recorded the
contact, which knew the real positions, and two four-character squares are a
worse answer that must not overwrite a better one. Whole kilometres, for the
same reason the published column is.

In the Database panel rather than beside the county backfill, which lives under
US Counties: this one touches the whole logbook, whatever country the QSOs are in.
This commit is contained in:
2026-08-11 19:49:03 +02:00
parent d3a405f4f6
commit 92a5f30ac0
7 changed files with 109 additions and 5 deletions
+2
View File
@@ -88,6 +88,8 @@ export function AwardRefsForQSOs(arg1:Array<number>):Promise<Record<number, Reco
export function AwardsFolder():Promise<string>;
export function BackfillDistances():Promise<main.BackfillDistancesResult>;
export function BackfillUSCounties():Promise<main.BackfillUSCountiesResult>;
export function BandSlotQSOs(arg1:string,arg2:number,arg3:string,arg4:string):Promise<Array<qso.QSO>>;
+4
View File
@@ -118,6 +118,10 @@ export function AwardsFolder() {
return window['go']['main']['App']['AwardsFolder']();
}
export function BackfillDistances() {
return window['go']['main']['App']['BackfillDistances']();
}
export function BackfillUSCounties() {
return window['go']['main']['App']['BackfillUSCounties']();
}
+16
View File
@@ -1931,6 +1931,22 @@ export namespace main {
this.to = source["to"];
}
}
export class BackfillDistancesResult {
scanned: number;
filled: number;
no_grid: number;
static createFrom(source: any = {}) {
return new BackfillDistancesResult(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.scanned = source["scanned"];
this.filled = source["filled"];
this.no_grid = source["no_grid"];
}
}
export class BackfillUSCountiesResult {
scanned: number;
county: number;