Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #21 - rework ct7aup's Rx CW Speed adjustment #22

Merged
merged 2 commits into from
Sep 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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