Skip to content

Commit

Permalink
Merge branch 'main' into 260-add-callers-to-the-pile-up
Browse files Browse the repository at this point in the history
  • Loading branch information
w7sst committed Feb 20, 2024
2 parents bd8123b + 04ba474 commit 6eed198
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 14 deletions.
10 changes: 8 additions & 2 deletions Ini.pas
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ TContestDefinition = record
Pitch: integer = 600;
Qsk: boolean = false;
Rit: integer = 0;
RitStepIncr: integer = 50;
BufSize: integer = DEFAULTBUFSIZE;
WebServer: string = '';
SubmitHiScoreURL: string= '';
Expand Down Expand Up @@ -285,7 +286,6 @@ procedure FromIni;
MainForm.UpdNRDigits(ReadInteger(SEC_STN, 'NRDigits', NRDigits));

Wpm := ReadInteger(SEC_STN, 'Wpm', Wpm);
WpmStepRate := Max(1, Min(20, ReadInteger(SEC_STN, 'WpmStepRate', WpmStepRate)));
Qsk := ReadBool(SEC_STN, 'Qsk', Qsk);
CallsFromKeyer := ReadBool(SEC_STN, 'CallsFromKeyer', CallsFromKeyer);
GetWpmUsesGaussian := ReadBool(SEC_STN, 'GetWpmUsesGaussian', GetWpmUsesGaussian);
Expand Down Expand Up @@ -324,6 +324,9 @@ procedure FromIni;

// [Settings]
FarnsworthCharRate := ReadInteger(SEC_SET, 'FarnsworthCharacterRate', FarnsworthCharRate);
WpmStepRate := Max(1, Min(20, ReadInteger(SEC_SET, 'WpmStepRate', WpmStepRate)));
RitStepIncr := ReadInteger(SEC_SET, 'RitStepIncr', RitStepIncr);
RitStepIncr := Max(-500, Min(500, RitStepIncr));

// [Debug]
DebugExchSettings := ReadBool(SEC_DBG, 'DebugExchSettings', DebugExchSettings);
Expand Down Expand Up @@ -362,7 +365,6 @@ procedure ToIni;
WriteInteger(SEC_STN, 'Pitch', MainForm.ComboBox1.ItemIndex);
WriteInteger(SEC_STN, 'BandWidth', MainForm.ComboBox2.ItemIndex);
WriteInteger(SEC_STN, 'Wpm', Wpm);
WriteInteger(SEC_STN, 'WpmStepRate', WpmStepRate);
WriteBool(SEC_STN, 'Qsk', Qsk);

{
Expand Down Expand Up @@ -394,7 +396,11 @@ procedure ToIni;

WriteBool(SEC_STN, 'SaveWav', SaveWav);

// [Settings]
WriteInteger(SEC_SET, 'FarnsworthCharacterRate', FarnsworthCharRate);
WriteInteger(SEC_SET, 'WpmStepRate', WpmStepRate);
WriteInteger(SEC_SET, 'RitStepIncr', RitStepIncr);

finally
Free;
end;
Expand Down
2 changes: 1 addition & 1 deletion Main.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ object MainForm: TMainForm
Width = 225
Height = 10
Cursor = crHandPoint
Hint = 'RIT'
Hint = 'RIT -- Use Up/Down keys or Mouse Wheel; Hold Control key for BW.'
BevelOuter = bvLowered
ParentShowHint = False
ShowHint = True
Expand Down
27 changes: 20 additions & 7 deletions Main.pas
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ interface

const
WM_TBDOWN = WM_USER+1;
sVersion: String = '1.84-pr3'; { Sets version strings in UI panel. }
sVersion: String = '1.84-pr4'; { Sets version strings in UI panel. }

type

Expand Down Expand Up @@ -363,6 +363,7 @@ TMainForm = class(TForm)
MustAdvance: boolean; // Controls when Exchange fields advance
UserCallsignDirty: boolean; // SetMyCall is called after callsign edits
CWSpeedDirty: boolean; // SetWpm is called after CW Speed edits
RitLocal: integer; // tracks incremented RIT Value
function CreateContest(AContestId : TSimContest) : TContest;
procedure ConfigureExchangeFields;
procedure SetMyExch1(const AExchType: TExchange1Type; const Avalue: string);
Expand Down Expand Up @@ -971,13 +972,15 @@ procedure TMainForm.FormMouseWheelDown(Sender: TObject; Shift: TShiftState;
begin
if GetKeyState(VK_CONTROL) >= 0 then IncRit(1)
else if RunMode <> rmHst then SetBw(ComboBox2.ItemIndex-1);
Handled := true; // set Handled to prevent being called 3 times
end;

procedure TMainForm.FormMouseWheelUp(Sender: TObject; Shift: TShiftState;
MousePos: TPoint; var Handled: Boolean);
begin
if GetKeyState(VK_CONTROL) >= 0 then IncRit(-1)
else if RunMode <> rmHst then SetBw(ComboBox2.ItemIndex+1);
Handled := true; // set Handled to prevent being called 3 times
end;


Expand Down Expand Up @@ -1977,16 +1980,26 @@ procedure TMainForm.ClientHTTP1Redirect(Sender: TObject; var dest: string;


procedure TMainForm.IncRit(dF: integer);
var
RitStepIncr : integer;
begin
RitStepIncr := IfThen(RunMode = rmHST, 50, Ini.RitStepIncr);

// A negative RitStepInc will change direction of arrow/wheel movement
if RitStepIncr < 0 then begin
dF := -dF;
RitStepIncr := -RitStepIncr;
end;

case dF of
-2: Inc(Ini.Rit, -5);
-1: Inc(Ini.Rit, -50);
0: Ini.Rit := 0;
1: Inc(Ini.Rit, 50);
2: Inc(Ini.Rit, 5);
-2: if Ini.Rit > -500 then Inc(RitLocal, -5);
-1: if Ini.Rit > -500 then Inc(RitLocal, -RitStepIncr);
0: RitLocal := 0;
1: if Ini.Rit < 500 then Inc(RitLocal, RitStepIncr);
2: if Ini.Rit < 500 then Inc(RitLocal, 5);
end;

Ini.Rit := Min(500, Max(-500, Ini.Rit));
Ini.Rit := Min(500, Max(-500, RitLocal));
UpdateRitIndicator;
end;

Expand Down
23 changes: 19 additions & 4 deletions Readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,29 @@ KEY ASSIGNMENTS

Enter - sends various messages, depending on the state of the QSO;

Up/Down arrows - RIT;

Ctrl-Up/Ctrl-Down arrows - bandwidth;
Up/Down arrows, mouse wheel - RIT adjustment.
The Up/Down arrow keys or the mouse wheel can be used to adjust the
receive RIT value. RIT can be adjusted between -500 and 500 Hz.
The default RIT increment is 50Hz/Step. You can modify the RIT step
increment using the RitStepIncr entry in the MorseRunner.ini file, e.g.:
[Settings]
RitStepIncr=50

Valid values range between -500 and 500. Negative values can be used to
change the direction of Up/Down arrow keys or mouse movement. Note that a
zero value will disable this feature. HST Competition mode will ignore this
setting and is set to 50Hz/Step.

Ctrl-Up/Ctrl-Down arrows, Cntl-key with mouse wheel - Bandwidth adjustment.
Pressing the Ctrl-key while using the Up/Down arrows or moving the mouse
wheel will adjust the receive bandwidth.

PgUp/PgDn, Ctrl-F10/Ctrl-F9, Alt-F10/Alt-F9 - keying speed,
in 2 WPM increments. HST Competition uses 5 WPM increments.
The default WPM Step rate is 2. Valid values range between 1 and 20.
You can override this value by changing the WpmStepRate entry in the
MorseRunner.ini file, e.g.:
[Station]
[Settings]
WpmStepRate=2

STATISTICS AREA
Expand Down Expand Up @@ -230,6 +243,8 @@ Version 1.84 (February 2024)
- All Contests - spacebar or Tab will now select both exchange fields (Coded by W7SST)
- All Contests - Hide Dx Station's Entity status string if same as user's Entity (Coded by W7SST)
- K1USN SST - user test field in call history file should be optional (Coded by W7SST)
- Improve RIT adjustment using mouse wheel (F6FVY, W7SST)
- Add receive Bandwidth adjustment using Cntl-key and mouse wheel (F6FVY, W7SST)
- DX station will send an abbreviated exchange number in the JARL ALLJA and ACAG contests (Coded by JR8PPG)
- User's exchange number is not abbreviated (not convert 100 to 1TT) (Coded by JR8PPG)

Expand Down

0 comments on commit 6eed198

Please sign in to comment.