Skip to content

Commit

Permalink
Recover from one or more bad merges.
Browse files Browse the repository at this point in the history
The changes from #260, #262 and #264 were not found in this branch.
Fixed by applying a diff between this branch and main branch.
  • Loading branch information
w7sst committed Feb 23, 2024
1 parent f9a6853 commit 54fbdfb
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 22 deletions.
25 changes: 14 additions & 11 deletions Contest.pas
Original file line number Diff line number Diff line change
Expand Up @@ -551,27 +551,30 @@ procedure TContest.OnMeFinishedSending;
var
i: integer;
z: integer;
Dx : integer;
begin
//the stations heard my CQ and want to call
if (not (RunMode in [rmSingle, {rmFieldDay,???} RmHst])) then
if (not (RunMode in [rmSingle, RmHst])) then
if (msgCQ in Me.Msg) or
((QsoList <> nil) and (msgTU in Me.Msg) and (msgMyCall in Me.Msg))then
((QsoList <> nil) and ((msgTU in Me.Msg) or (msgMyCall in Me.Msg))) then
begin
z := 0;
for i:=1 to RndPoisson(Activity / 2) do
Dx := DxCount;
if not (msgCQ in Me.Msg) then
if Dx > 0 then Dec(Dx); // The just finished Q has to be deducted
for i:=1 to RndPoisson(Activity / 2) - Dx do
begin
Stations.AddCaller;
z := 1;
end;
if z=0 then begin
// No maximo fica 3 cq sem contesters
inc(NoActivityCnt);
if ((NoActivityCnt > 2) or (NoStopActivity > 0) ) then begin
Stations.AddCaller;
NoActivityCnt := 0;
end;

if z=0 then begin
// No maximo fica 3 cq sem contesters
inc(NoActivityCnt);
if ((NoActivityCnt > 2) or (NoStopActivity > 0) ) then begin
Stations.AddCaller;
NoActivityCnt := 0;
end;
end;
end;
//tell callers that I finished sending
for i:=Stations.Count-1 downto 0 do
Expand Down
28 changes: 17 additions & 11 deletions DxOper.pas
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ TDxOperator = class
implementation

uses
SysUtils, Ini, Math, RndFunc, Contest, Log;
SysUtils, Ini, Math, RndFunc, Contest, Log, Main;

{ TDxOperator }

Expand Down Expand Up @@ -148,12 +148,14 @@ procedure TDxOperator.SetState(AState: TOperatorState);

function TDxOperator.IsMyCall: TCallCheckResult;
const
W_X = 2; W_Y = 2; W_D = 2;
W_X = 1; W_Y = 1; W_D = 1;
var
C, C0: string;
M: array of array of integer;
x, y: integer;
T, L, D: integer;

P: integer;
begin
C0 := Call;
C := Tst.Me.HisCall;
Expand Down Expand Up @@ -187,13 +189,15 @@ function TDxOperator.IsMyCall: TCallCheckResult;
M[x,y] := MinIntValue([T,D,L]);
end;

//classify by penalty
case M[High(M), High(M[0])] of
0: Result := mcYes;
1,2: Result := mcAlmost;
else Result := mcNo;
end;
P := M[High(M), High(M[0])];

if (P = 0) then
Result := mcYes
else if (((Length(C0) <= 4) and (Length(C0) - P >= 3)) or
((Length(C0) > 4) and (Length(C0) - P >= 4))) then
Result := mcAlmost
else
Result := mcNo;

//callsign-specific corrections

Expand All @@ -218,6 +222,7 @@ function TDxOperator.IsMyCall: TCallCheckResult;

procedure TDxOperator.MsgReceived(AMsg: TStationMessages);
begin

//if CQ received, we can call no matter what else was sent
if msgCQ in AMsg then
begin
Expand All @@ -240,7 +245,6 @@ procedure TDxOperator.MsgReceived(AMsg: TStationMessages);
Exit;
end;


if msgHisCall in AMsg then
case IsMyCall of
mcYes:
Expand All @@ -259,15 +263,13 @@ procedure TDxOperator.MsgReceived(AMsg: TStationMessages);
else if State = osNeedEnd then State := osDone;
end;


if msgB4 in AMsg then
case State of
osNeedPrevEnd, osNeedQso: SetState(osNeedQso);
osNeedNr, osNeedEnd: State := osFailed;
osNeedCall, osNeedCallNr: ; //same state: correct the call
end;


if msgNR in AMsg then
case State of
osNeedPrevEnd: ;
Expand All @@ -290,6 +292,10 @@ procedure TDxOperator.MsgReceived(AMsg: TStationMessages);
osNeedEnd: State := osDone;
end;

if msgQm in AMsg then
if (State = osNeedPrevEnd) and (Mainform.Edit1.Text = '') then
SetState(osNeedQso);

if (not Ini.Lids) and (AMsg = [msgGarbage]) then State := osNeedPrevEnd;


Expand Down

0 comments on commit 54fbdfb

Please sign in to comment.