forked from VE3NEA/MorseRunner
-
Notifications
You must be signed in to change notification settings - Fork 12
/
QrnStn.pas
54 lines (41 loc) · 1.2 KB
/
QrnStn.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//------------------------------------------------------------------------------
//This Source Code Form is subject to the terms of the Mozilla Public
//License, v. 2.0. If a copy of the MPL was not distributed with this
//file, You can obtain one at http://mozilla.org/MPL/2.0/.
//------------------------------------------------------------------------------
unit QrnStn;
interface
uses
Station;
type
TQrnStation = class(TStation)
public
constructor CreateStation;
procedure ProcessEvent(AEvent: TStationEvent); override;
end;
implementation
uses
Ini, RndFunc,
ExchFields,
Math;
constructor TQrnStation.CreateStation;
var
i: integer;
Dur: integer;
begin
inherited Create(nil);
// QrnStation doesn't send messages, so no call nor exchange types
SentExchTypes.Exch1:= TExchange1Type(-1);
SentExchTypes.Exch2:= TExchange2Type(-1);
Dur := SecondsToBlocks(Random) * Ini.BufSize;
SetLength(Envelope, Dur);
Amplitude := 1E5*Power(10, 2*Random);
for i:=0 to High(Envelope) do
if Random < 0.01 then Envelope[i] := (Random-0.5) * Amplitude;
State := stSending;
end;
procedure TQrnStation.ProcessEvent(AEvent: TStationEvent);
begin
if AEvent = evMsgSent then Free;
end;
end.