Skip to content

Commit

Permalink
Merge pull request #22 from w7sst/21-rework-ct7aups-rx-cw-speed-adjus…
Browse files Browse the repository at this point in the history
…tment

Issue #21 - rework ct7aup's Rx CW Speed adjustment
  • Loading branch information
ct7aup authored Sep 17, 2022
2 parents 8f953bc + 2755574 commit 3d7826e
Showing 1 changed file with 10 additions and 28 deletions.
38 changes: 10 additions & 28 deletions DxOper.pas
Original file line number Diff line number Diff line change
Expand Up @@ -57,40 +57,22 @@ function TDxOperator.GetSendDelay: integer;
// Result := Max(1, SecondsToBlocks(1 / Sqr(4*Skills)));
// Result := Round(RndGaussLim(Result, 0.7 * Result));

if State = osNeedPrevEnd
then Result := NEVER
else if RunMode = rmHst
then Result := SecondsToBlocks(0.05 + 0.5*Random * 10/Wpm)
if State = osNeedPrevEnd then
Result := NEVER
else if RunMode = rmHst then
Result := SecondsToBlocks(0.05 + 0.5*Random * 10/Wpm)
else
Result := SecondsToBlocks(0.1 + 0.5*Random);
end;

function TDxOperator.GetWpm: integer;
Var
xmin: integer;
xmax: integer;
xupdown: integer;
begin
if RunMode = rmHst
then Result := Ini.Wpm
else begin
if (MaxRxWpm=0) and (MinRxWpm=0) then
Result := Round(Ini.Wpm * 0.5 * (1 + Random))
else begin
if (MinRxWpm > 0) and (MaxRxWpm > 0) then begin
xupdown := random (2);
end else begin
if MinRxWpm > 0 then
xupdown := 0
else
xupdown := 1;
end;
if xupdown = 0 then
result := Ini.Wpm - random(MinRxWpm+1)
else
result := Ini.Wpm + random(maxRxWpm+1);
end;
end;
if RunMode = rmHst then
Result := Ini.Wpm
else if (MaxRxWpm = -1) or (MinRxWpm = -1) then { use original algorithm }
Result := Round(Ini.Wpm * 0.5 * (1 + Random))
else
Result := Round(Ini.Wpm - MinRxWpm + (MinRxWpm + MaxRxWpm) * Random);
end;

function TDxOperator.GetNR: integer;
Expand Down

0 comments on commit 3d7826e

Please sign in to comment.