Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
emiMobile
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mac Stephens
emiMobile
Commits
3171db77
Commit
3171db77
authored
Sep 14, 2026
by
Mac Stephens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refresh AVL unit locations on the map every 15 seconds
parent
c34c8c72
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
4 deletions
+24
-4
Ws.DataModel.pas
emiMobileServer/Source/Ws.DataModel.pas
+23
-3
emiMobileServer.ini
emiMobileServer/bin/emiMobileServer.ini
+1
-1
No files found.
emiMobileServer/Source/Ws.DataModel.pas
View file @
3171db77
...
@@ -50,6 +50,9 @@ implementation
...
@@ -50,6 +50,9 @@ implementation
uses
uses
System
.
StrUtils
,
System
.
DateUtils
;
System
.
StrUtils
,
System
.
DateUtils
;
const
UNIT_MAP_REFRESH_INTERVAL_MS
=
15000
;
{ TWsDataModel }
{ TWsDataModel }
constructor
TWsDataModel
.
Create
(
ABroadcast
:
TWsBroadcastProc
;
AIntervalMs
:
Integer
);
constructor
TWsDataModel
.
Create
(
ABroadcast
:
TWsBroadcastProc
;
AIntervalMs
:
Integer
);
...
@@ -77,20 +80,37 @@ begin
...
@@ -77,20 +80,37 @@ begin
end
;
end
;
procedure
TWsDataModel
.
Execute
;
procedure
TWsDataModel
.
Execute
;
var
unitMapElapsedMs
:
Integer
;
begin
begin
unitMapElapsedMs
:=
0
;
try
try
while
not
TThread
.
CurrentThread
.
CheckTerminated
do
while
not
TThread
.
CurrentThread
.
CheckTerminated
do
begin
begin
if
FStopEvent
.
WaitFor
(
FIntervalMs
)
=
wrSignaled
then
if
FStopEvent
.
WaitFor
(
FIntervalMs
)
=
wrSignaled
then
Break
;
Break
;
if
not
FDb
.
StartUpdateListener
then
Inc
(
unitMapElapsedMs
,
FIntervalMs
);
Continue
;
if
not
FDb
.
ConsumeCADUpdate
then
if
not
FDb
.
StartUpdateListener
then
Continue
;
Continue
;
if
FDb
.
ConsumeCADUpdate
then
begin
BroadcastAll
;
BroadcastAll
;
unitMapElapsedMs
:=
0
;
end
else
if
unitMapElapsedMs
>=
UNIT_MAP_REFRESH_INTERVAL_MS
then
begin
try
FBroadcast
(
BuildUnitMapJson
);
except
on
E
:
Exception
do
Logger
.
Log
(
2
,
'WsDataModel UNIT_MAP refresh error: '
+
E
.
Message
);
end
;
unitMapElapsedMs
:=
0
;
end
;
end
;
end
;
except
except
on
E
:
Exception
do
on
E
:
Exception
do
...
...
emiMobileServer/bin/emiMobileServer.ini
View file @
3171db77
[Settings]
[Settings]
LogFileNum
=
10
7
LogFileNum
=
10
9
webClientVersion
=
0.9.4.3
webClientVersion
=
0.9.4.3
[Database]
[Database]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment