-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathuJournalSpec.pas
More file actions
164 lines (133 loc) · 3.09 KB
/
uJournalSpec.pas
File metadata and controls
164 lines (133 loc) · 3.09 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
unit uJournalSpec;
interface
uses
Classes;
Const
//’èïû çàïèñåé æóðíàëà
ABS_TIME_FIX_JOURN = 'NDA';
GPS_POSITION_JOURN = 'NDA';
STATE_JOURN = 'NDA';
EVENT_JOURN = 'NDA';
GPS_POSITION_JOURN_INVALID = 'NDA';
EXTERNAL_SENS_DATA_JOURN = 'NDA';
SENSORS_DATA_JOURN = 'NDA';
JRN_REC_SIZE = 'NDA';
SN_RECTYPE_CHANGE = 'NDA';
type
PJrnPacket = ^TJrnPacket;
TJrnPacket = record
'NDA'
end;
PGPSJrn = ^TGPSJrn;
TGPSJrn = record
'NDA'
end;
PStateJrn = ^TStateJrn;
TStateJrn = record
'NDA'
end;
PEventJrn = ^TEventJrn;
TEventJrn = record
'NDA'
end;
PSensJrn = ^TSensJrn;
TSensJrn = record
'NDA'
end;
PExtSensJrn = ^TExtSensJrn;
TExtSensJrn = record
'NDA'
end;
TExtGPSJrn = record
'NDA'
end;
PSessionData = ^TSessionData;
TSessionData = record
'NDA'
end;
TJrnSession = class(TList)
private
FSessionType: Integer;
procedure SetSessionType(const Value: Integer);
protected
function Get(Index: Integer): PSessionData;
procedure Put(Index: Integer; const Value: PSessionData);
procedure Notify(Ptr: Pointer; Action: TListNotification); override;
public
property Items[Index: Integer]: PSessionData read Get write Put; default;
function Add(SrcPtr: Pointer; Records: Integer): Integer; overload;
property SessionType: Integer read FSessionType write SetSessionType;
end;
function GetRecordFromData(Data: Pointer; Idx: Integer): PByte;
function IDUndefRec(UndefRec: PByte): Byte;
function Lg_GPSJrn(Rec: PGPSJrn): Longword;
function Lt_GPSJrn(Rec: PGPSJrn): Longword;
function Alt_GPSJrn(Rec: PGPSJrn): Longword;
function Speed_GPSJrn(Rec: PGPSJrn): Word;
function Course_GPSJrn(Rec: PGPSJrn): Word;
implementation
uses
u_ByteOrders;
function Speed_GPSJrn(Rec: PGPSJrn): Word;
begin
Result := 'NDA';
end;
function Course_GPSJrn(Rec: PGPSJrn): Word;
begin
Result := 'NDA';
end;
function Lg_GPSJrn(Rec: PGPSJrn): Longword;
begin
Result := 'NDA';
end;
function Lt_GPSJrn(Rec: PGPSJrn): Longword;
begin
Result := 'NDA';
end;
function Alt_GPSJrn(Rec: PGPSJrn): Longword;
begin
Result := 'NDA';
end;
function IDUndefRec(UndefRec: PByte): Byte;
begin
Result := 'NDA';
end;
function GetRecordFromData(Data: Pointer; Idx: Integer): PByte;
begin
Result := 'NDA';
end;
{ TJrnSession }
function TJrnSession.Add(SrcPtr: Pointer; Records: Integer): Integer;
var
ptr: PSessionData;
DataSize: Integer;
begin
New(ptr);
ptr.Records := Records;
DataSize := ptr.Records*JRN_REC_SIZE;
GetMem(ptr.Data, DataSize);
System.Move(SrcPtr^, ptr.Data^, DataSize);
Result := inherited Add(ptr);
end;
function TJrnSession.Get(Index: Integer): PSessionData;
begin
Result := PSessionData(inherited Get(Index));
end;
procedure TJrnSession.Notify(Ptr: Pointer; Action: TListNotification);
begin
inherited;
if Action = lnDeleted then
begin
FreeMem(PSessionData(Ptr).Data);
Dispose(Ptr);
end;
end;
procedure TJrnSession.Put(Index: Integer; const Value: PSessionData);
begin
inherited Put(Index, Value);
end;
procedure TJrnSession.SetSessionType(const Value: Integer);
begin
FSessionType := Value;
end;
end.