Skip to content

Commit

Permalink
DX station will send an abbreviated exchange number #204
Browse files Browse the repository at this point in the history
  • Loading branch information
jr8ppg committed Apr 22, 2023
1 parent 17731f3 commit 2b56510
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Main.pas
Expand Up @@ -62,8 +62,8 @@ TFieldDefinition = record
(C: 'Zone'; R: '[0-9]*'; L: 4; T:Ord(etItuZone)),
(C: 'Age'; R: '[0-9][0-9]'; L: 2; T:Ord(etAge)),
(C: 'Power'; R: '([0-9]*)|(K)|(KW)|([0-9A]*[OTN]*)'; L: 4; T:Ord(etPower)),
(C: 'Number'; R: '([0-9]*)([LMHP])'; L: 4; T:Ord(etJaPref)),
(C: 'Number'; R: '([0-9]*)([LMHP])'; L: 7; T:Ord(etJaCity))
(C: 'Number'; R: '([0-9AOTN]*)([LMHP])'; L: 4; T:Ord(etJaPref)),
(C: 'Number'; R: '([0-9AOTN]*)([LMHP])'; L: 7; T:Ord(etJaCity))
);

type
Expand Down
17 changes: 17 additions & 0 deletions Station.pas
Expand Up @@ -350,6 +350,23 @@ function TStation.NrAsText: string;
if Random < 0.97
then Result := StringReplace(Result, '9', 'N', [rfReplaceAll]);
end;

// for JARL ALLJA, ACAG contest
// The probability is adjusted to the domestic CW situation
if (Ini.RunMode <> rmHst) and (SentExchTypes.Exch2 in
[etJaPref, etJaCity]) and
(MyCall <> Ini.Call) then
begin
if Random < 0.4 then begin
Result := StringReplace(Result, '0', 'O', [rfReplaceAll]);

This comment has been minimized.

Copy link
@w7sst

w7sst Feb 12, 2024

Owner

Hi @jr8ppg ,
Is this what you wanted here? This first StringReplace will mask the replacement on the next line. This means that '0' will never be abbreviated with 'T', only 'O'. Perhaps you want 40% '0'->'O' replacement and 80% '0'->'T' replacement.

I am working on a fix now for this overall function and will have it posted soon. Thanks, Mike

This comment has been minimized.

Copy link
@jr8ppg

jr8ppg Feb 12, 2024

Author Collaborator

Hi Mike san
you're right.
I think it is appropriate to reverse lines 361 and 362.
Thank you, Taka

Result := StringReplace(Result, '00', 'TT', [rfReplaceAll]);
end
else if Random < 0.8
then Result := StringReplace(Result, '0', 'T', [rfReplaceAll]);

if Random < 0.1
then Result := StringReplace(Result, '9', 'N', [rfReplaceAll]);
end;
end;


Expand Down

0 comments on commit 2b56510

Please sign in to comment.