Skip to content

Commit

Permalink
Updated some comments #192 #187
Browse files Browse the repository at this point in the history
  • Loading branch information
jr8ppg committed Feb 28, 2023
1 parent 567eacb commit 55dbcfa
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 26 deletions.
32 changes: 19 additions & 13 deletions ACAG.pas
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ interface
TAcagCallRec = class
public
Call: string; // call sign
Number: string; // CQ-Zone
Number: string; // <city|gun|ku><power>
UserText: string; // optional UserText (displayed in status bar)
function GetString: string; // returns CQ-Zone N (e.g. 'CQ-Zone 3')
function GetString: string;
class function compareCall(const left, right: TAcagCallRec) : integer; static;
end;

Expand All @@ -36,7 +36,7 @@ TACAG = class(TContest)
procedure GetExchange(id : integer; out station : TDxStation); override;

function getExch1(id:integer): string; // returns RST (e.g. 5NN)
function getExch2(id:integer): string; // returns section info (e.g. 3)
function getExch2(id:integer): string; // return <city|gun|ku><power> (e.g. 1002H)
function FindCallRec(out fdrec: TAcagCallRec; const ACall: string): Boolean;
function GetStationInfo(const ACallsign: string) : string; override;
function ExtractMultiplier(Qso: PQso) : string; override;
Expand Down Expand Up @@ -173,12 +173,18 @@ function TACAG.GetStationInfo(const ACallsign: string) : string;
end;
end;

// Exch2
// <city|gun|ku><power>
//
// The extracted multiplier string is simply the <city|gun|ku> location number from Exchange Field 2.
// however, exclude <power> string from multiplier string.
//
// Exchange number format is follows.
// Exch1 Exch2
// 599 <city|gun|ku><power>
//
// <city> 0102-4715 4digits, city-code
// <gun> 01001-47005 5digits, gun(country)-code
// <ku> 010101-430105 6digits, ku-code
// <ku> 010101-430105 6digits, ku(ward)-code
//
// <power> L|M|H|P 1digit
//
function TACAG.ExtractMultiplier(Qso: PQso) : string;
Expand All @@ -189,34 +195,34 @@ function TACAG.ExtractMultiplier(Qso: PQso) : string;
S := Qso.Exch2;
P := S[Length(S)];
if CharInSet(P, ['L', 'M', 'H', 'P']) then begin
// If the last letter is P, L, M, H, the string without them will be the multiplier.
Result := Copy(S, 1, Length(S) - 1);
end
else begin
// If the last letter is not P, L, M, H, consider the whole as a multiplier.
Result := S;
end;

Qso^.Points := 1;
end;


function TACAG.getCall(id : integer): string; // returns station callsign
function TACAG.getCall(id : integer): string; // returns station callsign
begin
result := CallList.Items[id].Call;
end;


procedure TACAG.GetExchange(id : integer; out station : TDxStation);
begin
station.Exch1 := getExch1(station.Operid); // RST
station.Exch2 := getExch2(station.Operid);
station.Exch2 := getExch2(station.Operid); // <city|gun|ku><power>
end;

function TACAG.getExch1(id:integer): string; // returns RST (e.g. 599)
function TACAG.getExch1(id:integer): string; // returns RST (e.g. 5NN)
begin
result := '599';
end;

function TACAG.getExch2(id:integer): string; // returns section info (e.g. 3)
function TACAG.getExch2(id:integer): string; // return <city|gun|ku><power> (e.g. 1002H)
begin
result := CallList.Items[id].Number;
end;
Expand All @@ -226,7 +232,7 @@ class function TAcagCallRec.compareCall(const left, right: TAcagCallRec) : integ
Result := CompareStr(left.Call, right.Call);
end;

function TAcagCallRec.GetString: string; // returns CQ-Zone N (e.g. 'CQ-Zone 3')
function TAcagCallRec.GetString: string;
begin
Result := Format(' - NR %s', [Number]);
end;
Expand Down
30 changes: 18 additions & 12 deletions ALLJA.pas
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ interface
TAllJaCallRec = class
public
Call: string; // call sign
Number: string; // CQ-Zone
Number: string; // <pref><power>
UserText: string; // optional UserText (displayed in status bar)
function GetString: string; // returns CQ-Zone N (e.g. 'CQ-Zone 3')
function GetString: string;
class function compareCall(const left, right: TAllJaCallRec) : integer; static;
end;

Expand All @@ -36,7 +36,7 @@ TALLJA = class(TContest)
procedure GetExchange(id : integer; out station : TDxStation); override;

function getExch1(id:integer): string; // returns RST (e.g. 5NN)
function getExch2(id:integer): string; // returns section info (e.g. 3)
function getExch2(id:integer): string; // return <pref><power> (e.g. 10H)
function FindCallRec(out fdrec: TAllJaCallRec; const ACall: string): Boolean;
function GetStationInfo(const ACallsign: string) : string; override;
function ExtractMultiplier(Qso: PQso) : string; override;
Expand Down Expand Up @@ -173,11 +173,17 @@ function TALLJA.GetStationInfo(const ACallsign: string) : string;
end;
end;

// Exch2
// <pref><power>
//
// <pref> 02-49 2digits prefecture code
// 101-114 3digits Hokkaido branch office code
// The extracted multiplier string is simply the <pref> location number from Exchange Field 2.
// however, exclude <power> string from multiplier string.
//
// Exchange number format is follows.
// Exch1 Exch2
// 599 <pref><power>
//
// <pref> 02-49 2digits, prefecture code
// 101-114 3digits, Hokkaido promotion bureau code
//
// <power> L|M|H|P 1digit
//
function TALLJA.ExtractMultiplier(Qso: PQso) : string;
Expand All @@ -188,34 +194,34 @@ function TALLJA.ExtractMultiplier(Qso: PQso) : string;
S := Qso.Exch2;
P := S[Length(S)];
if CharInSet(P, ['L', 'M', 'H', 'P']) then begin
// If the last letter is P, L, M, H, the string without them will be the multiplier.
Result := Copy(S, 1, Length(S) - 1);
end
else begin
// If the last letter is not P, L, M, H, consider the whole as a multiplier.
Result := S;
end;

Qso^.Points := 1;
end;


function TALLJA.getCall(id : integer): string; // returns station callsign
begin
result := CallList.Items[id].Call;
end;


procedure TALLJA.GetExchange(id : integer; out station : TDxStation);
begin
station.Exch1 := getExch1(station.Operid); // RST
station.Exch2 := getExch2(station.Operid);
end;

function TALLJA.getExch1(id:integer): string; // returns RST (e.g. 599)
function TALLJA.getExch1(id:integer): string; // returns RST (e.g. 599)
begin
result := '599';
end;

function TALLJA.getExch2(id:integer): string; // returns section info (e.g. 3)
function TALLJA.getExch2(id:integer): string; // return <pref><power> (e.g. 10H)
begin
result := CallList.Items[id].Number;
end;
Expand All @@ -225,7 +231,7 @@ class function TAllJaCallRec.compareCall(const left, right: TAllJaCallRec) : int
Result := CompareStr(left.Call, right.Call);
end;

function TAllJaCallRec.GetString: string; // returns CQ-Zone N (e.g. 'CQ-Zone 3')
function TAllJaCallRec.GetString: string;
begin
Result := Format(' - NR %s', [Number]);
end;
Expand Down
2 changes: 1 addition & 1 deletion Main.pas
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ procedure TMainForm.Edit3KeyPress(Sender: TObject; var Key: Char);
end;
etJaPref, etJaCity:
begin
// log what the user types - assuming alpha numeric characters
// valid Pref/City/Gun/Ku characters(numeric) and power characters (e.g. P|L|M|H)
if not CharInSet(Key, ['0'..'9', 'L', 'M', 'H', 'P', 'l', 'm', 'h', 'p', #8]) then
Key := #0;
end;
Expand Down

0 comments on commit 55dbcfa

Please sign in to comment.