Skip to content

Commit

Permalink
HST Competition - add error check for correct settings (#279)
Browse files Browse the repository at this point in the history
HST Competition - add error check for correct settings

- HST Competition requires HST Contest and default 'Start of Contest'
Serial Numbers to be set.
- disabled Exchange edit field when HST is running.
- disabled Serial NR menu when HST is running.
- disabled CW Min/Max menu items when HST is running.
  • Loading branch information
w7sst authored Mar 8, 2024
2 parents 409d6bd + 2835b10 commit b3cbe3b
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions Main.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1726,6 +1726,22 @@ procedure TMainForm.Run(Value: TRunMode);
if not SetMyExchange(Trim(ExchangeEdit.Text)) then
Exit;

// if requesting an HST run, verify the correct contest and serial NR
// mode is selected.
if (Value = rmHst) and
((SimContest <> scHst) or (Ini.SerialNR <> snStartContest)) then
begin
var S : string :=
'Error: HST Competition mode requires the following settings:'#13 +
' 1. ''HST (High Speed Test)'' in the Contest dropdown.'#13 +
' 2. ''Start of Contest'' in the ''Settings | Serial NR'' menu.'#13 +
'Please correct these settings and try again.';
Application.MessageBox(PChar(S),
'Error',
MB_OK or MB_ICONERROR);
Exit;
end;

// load call history and other contest-specific setup before starting
if not Tst.OnContestPrepareToStart(Ini.Call, ExchangeEdit.Text) then
Exit;
Expand All @@ -1743,7 +1759,7 @@ procedure TMainForm.Run(Value: TRunMode);
//main ctls
EnableCtl(SimContestCombo, BStop);
EnableCtl(Edit4, BStop);
EnableCtl(ExchangeEdit, BStop);
EnableCtl(ExchangeEdit, BStop and ActiveContest.ExchFieldEditable);
EnableCtl(SpinEdit2, BStop);
SetToolbuttonDown(ToolButton1, not BStop);

Expand Down Expand Up @@ -1795,10 +1811,12 @@ procedure TMainForm.Run(Value: TRunMode);
Flutter1.Enabled := not BCompet;
Lids1.Enabled := not BCompet;


//hst specific
Activity1.Enabled := Value <> rmHst;
CWBandwidth2.Enabled := Value <> rmHst;
CWMinRxSpeed1.Enabled := Value <> rmHst;
CWMaxRxSpeed1.Enabled := Value <> rmHst;
NRDigits1.Enabled := Value <> rmHst;

EnableCtl(SpinEdit3, RunMode <> rmHst);
if RunMode = rmHst then SpinEdit3.Value := 4;
Expand Down

0 comments on commit b3cbe3b

Please sign in to comment.