diff --git a/Contest.pas b/Contest.pas index 3777468..dc1eeb7 100644 --- a/Contest.pas +++ b/Contest.pas @@ -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 diff --git a/DxOper.pas b/DxOper.pas index f5f8083..8551b16 100644 --- a/DxOper.pas +++ b/DxOper.pas @@ -44,7 +44,7 @@ TDxOperator = class implementation uses - SysUtils, Ini, Math, RndFunc, Contest, Log; + SysUtils, Ini, Math, RndFunc, Contest, Log, Main; { TDxOperator } @@ -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; @@ -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 @@ -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 @@ -240,7 +245,6 @@ procedure TDxOperator.MsgReceived(AMsg: TStationMessages); Exit; end; - if msgHisCall in AMsg then case IsMyCall of mcYes: @@ -259,7 +263,6 @@ 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); @@ -267,7 +270,6 @@ procedure TDxOperator.MsgReceived(AMsg: TStationMessages); osNeedCall, osNeedCallNr: ; //same state: correct the call end; - if msgNR in AMsg then case State of osNeedPrevEnd: ; @@ -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;