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
5a8f87eb
Commit
5a8f87eb
authored
Jan 27, 2026
by
Mac Stephens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add unit popup endpoint, update uqMapUnit sql, add unit popup to map form with new additions
parent
f952c2be
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
98 additions
and
14 deletions
+98
-14
Api.Database.dfm
emiMobileServer/Source/Api.Database.dfm
+26
-2
Api.Database.pas
emiMobileServer/Source/Api.Database.pas
+9
-6
Api.ServiceImpl.pas
emiMobileServer/Source/Api.ServiceImpl.pas
+10
-2
emiMobileServer.ini
emiMobileServer/emiMobileServer.ini
+1
-1
View.Map.pas
webEMIMobile/View.Map.pas
+52
-3
No files found.
emiMobileServer/Source/Api.Database.dfm
View file @
5a8f87eb
...
@@ -18,8 +18,18 @@ object ApiDatabaseModule: TApiDatabaseModule
...
@@ -18,8 +18,18 @@ object ApiDatabaseModule: TApiDatabaseModule
' COALESCE(uc.UNITNAME, uc.CAR_NUMBER) AS UNITNAME,'
' COALESCE(uc.UNITNAME, uc.CAR_NUMBER) AS UNITNAME,'
' uc.UNIT_DISTRICT,'
' uc.UNIT_DISTRICT,'
' uc.GPS_LATITUDE,'
' uc.GPS_LATITUDE,'
' uc.GPS_LONGITUDE'
' uc.GPS_LONGITUDE,'
'FROM UNITS_CURRENT@AVL_LINK uc')
' cdc.CODE_DESC AS CALL_TYPE,'
' cap.PRIORITY AS PRIORITY,'
' cus.CODE_DESC AS UNIT_STATUS_DESC'
'FROM UNITS_CURRENT@AVL_LINK uc'
'LEFT JOIN CFS_ACTIVE cfs ON uc.UNITID = cfs.UNITID'
'LEFT JOIN COMPLAINT_ACTIVE cap ON cap.COMPLAINTID = cfs.COMPLAIN' +
'TID'
'LEFT JOIN CD_DISPATCHCODES cdc ON cdc.CODE = cap.DISPATCHCODE'
'LEFT JOIN CD_UNITSTATUS cus ON cus.CODE = cfs.UNITSTATUS'
'')
ReadOnly = True
ReadOnly = True
Left = 470
Left = 470
Top = 414
Top = 414
...
@@ -43,6 +53,20 @@ object ApiDatabaseModule: TApiDatabaseModule
...
@@ -43,6 +53,20 @@ object ApiDatabaseModule: TApiDatabaseModule
object uqMapUnitsGPS_LONGITUDE: TFloatField
object uqMapUnitsGPS_LONGITUDE: TFloatField
FieldName = 'GPS_LONGITUDE'
FieldName = 'GPS_LONGITUDE'
end
end
object uqMapUnitsCALL_TYPE: TStringField
FieldName = 'CALL_TYPE'
ReadOnly = True
Size = 60
end
object uqMapUnitsPRIORITY: TStringField
FieldName = 'PRIORITY'
ReadOnly = True
Size = 6
end
object uqMapUnitsUNIT_STATUS_DESC: TStringField
FieldName = 'UNIT_STATUS_DESC'
ReadOnly = True
end
end
end
object uqUnitList: TUniQuery
object uqUnitList: TUniQuery
Connection = ucENTCAD
Connection = ucENTCAD
...
...
emiMobileServer/Source/Api.Database.pas
View file @
5a8f87eb
...
@@ -60,12 +60,6 @@ type
...
@@ -60,12 +60,6 @@ type
uqCFSMemosTIMESTAMP
:
TDateTimeField
;
uqCFSMemosTIMESTAMP
:
TDateTimeField
;
uqCFSMemosBADGE_NUMBER
:
TStringField
;
uqCFSMemosBADGE_NUMBER
:
TStringField
;
uqCFSMemosREMARKS
:
TStringField
;
uqCFSMemosREMARKS
:
TStringField
;
uqMapUnitsENTRYID
:
TFloatField
;
uqMapUnitsUNITID
:
TFloatField
;
uqMapUnitsUNITNAME
:
TStringField
;
uqMapUnitsUNIT_DISTRICT
:
TStringField
;
uqMapUnitsGPS_LATITUDE
:
TFloatField
;
uqMapUnitsGPS_LONGITUDE
:
TFloatField
;
uqComplaintListcomplaintNumber
:
TStringField
;
uqComplaintListcomplaintNumber
:
TStringField
;
uqComplaintListPRIORITY_COLOR
:
TFloatField
;
uqComplaintListPRIORITY_COLOR
:
TFloatField
;
uqComplaintListDISTRICT_DESC
:
TStringField
;
uqComplaintListDISTRICT_DESC
:
TStringField
;
...
@@ -128,6 +122,15 @@ type
...
@@ -128,6 +122,15 @@ type
uqMapComplaintUnitsListDATECLEARED
:
TDateTimeField
;
uqMapComplaintUnitsListDATECLEARED
:
TDateTimeField
;
uqMapComplaintUnitsListLOCATION
:
TStringField
;
uqMapComplaintUnitsListLOCATION
:
TStringField
;
uqMapComplaintsADDRESS
:
TStringField
;
uqMapComplaintsADDRESS
:
TStringField
;
uqMapUnitsENTRYID
:
TFloatField
;
uqMapUnitsUNITID
:
TFloatField
;
uqMapUnitsUNITNAME
:
TStringField
;
uqMapUnitsUNIT_DISTRICT
:
TStringField
;
uqMapUnitsGPS_LATITUDE
:
TFloatField
;
uqMapUnitsGPS_LONGITUDE
:
TFloatField
;
uqMapUnitsCALL_TYPE
:
TStringField
;
uqMapUnitsPRIORITY
:
TStringField
;
uqMapUnitsUNIT_STATUS_DESC
:
TStringField
;
procedure
uqComplaintListCalcFields
(
DataSet
:
TDataSet
);
procedure
uqComplaintListCalcFields
(
DataSet
:
TDataSet
);
procedure
uqMapComplaintsCalcFields
(
DataSet
:
TDataSet
);
procedure
uqMapComplaintsCalcFields
(
DataSet
:
TDataSet
);
private
private
...
...
emiMobileServer/Source/Api.ServiceImpl.pas
View file @
5a8f87eb
...
@@ -186,8 +186,6 @@ begin
...
@@ -186,8 +186,6 @@ begin
end
;
end
;
function
TApiService
.
GetUnitMap
:
TJSONObject
;
function
TApiService
.
GetUnitMap
:
TJSONObject
;
var
var
data
:
TJSONArray
;
data
:
TJSONArray
;
...
@@ -214,6 +212,16 @@ begin
...
@@ -214,6 +212,16 @@ begin
item
.
AddPair
(
'District'
,
ApiDB
.
uqMapUnitsUNIT_DISTRICT
.
AsString
);
item
.
AddPair
(
'District'
,
ApiDB
.
uqMapUnitsUNIT_DISTRICT
.
AsString
);
item
.
AddPair
(
'Lat'
,
TJSONNumber
.
Create
(
ApiDB
.
uqMapUnitsGPS_LATITUDE
.
AsFloat
));
item
.
AddPair
(
'Lat'
,
TJSONNumber
.
Create
(
ApiDB
.
uqMapUnitsGPS_LATITUDE
.
AsFloat
));
item
.
AddPair
(
'Lng'
,
TJSONNumber
.
Create
(
ApiDB
.
uqMapUnitsGPS_LONGITUDE
.
AsFloat
));
item
.
AddPair
(
'Lng'
,
TJSONNumber
.
Create
(
ApiDB
.
uqMapUnitsGPS_LONGITUDE
.
AsFloat
));
item
.
AddPair
(
'CallType'
,
ApiDB
.
uqMapUnitsCALL_TYPE
.
AsString
);
item
.
AddPair
(
'Priority'
,
ApiDB
.
uqMapUnitsPRIORITY
.
AsString
);
var
unitStatus
:=
ApiDB
.
uqMapUnitsUNIT_STATUS_DESC
.
AsString
;
if
Trim
(
unitStatus
)
=
''
then
unitStatus
:=
'Available'
;
item
.
AddPair
(
'Status'
,
unitStatus
);
data
.
AddElement
(
item
);
data
.
AddElement
(
item
);
end
;
end
;
Next
;
Next
;
...
...
emiMobileServer/emiMobileServer.ini
View file @
5a8f87eb
[Settings]
[Settings]
LogFileNum
=
5
25
LogFileNum
=
5
33
webClientVersion
=
0.1.0
webClientVersion
=
0.1.0
webEMIMobile/View.Map.pas
View file @
5a8f87eb
...
@@ -34,6 +34,7 @@ type
...
@@ -34,6 +34,7 @@ type
FComplaintsLoaded
:
Boolean
;
FComplaintsLoaded
:
Boolean
;
[
async
]
procedure
LoadPointsAsync
;
[
async
]
procedure
LoadPointsAsync
;
function
CarIconForDistrict
(
const
DistrictCode
:
string
):
string
;
function
CarIconForDistrict
(
const
DistrictCode
:
string
):
string
;
procedure
ShowUnitDetails
(
const
unitId
:
string
);
public
public
end
;
end
;
...
@@ -64,10 +65,24 @@ begin
...
@@ -64,10 +65,24 @@ begin
console.log('Error in TFViewMain.ShowComplaintDetails', e);
console.log('Error in TFViewMain.ShowComplaintDetails', e);
}
}
};
};
window
.
showUnitDetails
=
function
(
id
)
{
console.log('JS bridge showUnitDetails called, id=', id);
try {
pas['View.Map'].FViewMap.ShowUnitDetails(id);
}
catch
(
e
)
{
console.log('Error in TFViewMap.ShowUnitDetails', e);
}
};
end
;
end
;
{$ENDIF}
{$ENDIF}
end
;
end
;
procedure
TFViewMap
.
ShowUnitDetails
(
const
unitId
:
string
);
begin
ShowMessage
(
'Link to Unit Details form'
);
end
;
[
async
]
procedure
TFViewMap
.
httpReqGeoJsonResponse
(
Sender
:
TObject
;
AResponse
:
string
);
[
async
]
procedure
TFViewMap
.
httpReqGeoJsonResponse
(
Sender
:
TObject
;
AResponse
:
string
);
var
var
...
@@ -158,7 +173,8 @@ var
...
@@ -158,7 +173,8 @@ var
i
,
ui
:
Integer
;
i
,
ui
:
Integer
;
m
:
TTMSFNCMapsMarker
;
m
:
TTMSFNCMapsMarker
;
lat
,
lng
:
Double
;
lat
,
lng
:
Double
;
uname
,
dist
:
string
;
uName
,
dist
:
string
;
unitId
,
callType
,
priorityText
,
statusText
:
string
;
complaintId
,
codeDesc
,
dispatchDist
,
priority
:
string
;
complaintId
,
codeDesc
,
dispatchDist
,
priority
:
string
;
pngName
,
iconUrl
,
rowsHtml
:
string
;
pngName
,
iconUrl
,
rowsHtml
:
string
;
begin
begin
...
@@ -182,13 +198,46 @@ begin
...
@@ -182,13 +198,46 @@ begin
lat
:=
Double
(
item
[
'Lat'
]);
lat
:=
Double
(
item
[
'Lat'
]);
lng
:=
Double
(
item
[
'Lng'
]);
lng
:=
Double
(
item
[
'Lng'
]);
u
n
ame
:=
string
(
item
[
'UnitName'
]);
u
N
ame
:=
string
(
item
[
'UnitName'
]);
dist
:=
string
(
item
[
'District'
]);
dist
:=
string
(
item
[
'District'
]);
unitId
:=
string
(
item
[
'UnitId'
]);
callType
:=
string
(
item
[
'CallType'
]);
priorityText
:=
string
(
item
[
'Priority'
]);
statusText
:=
string
(
item
[
'Status'
]);
m
:=
lfMap
.
Markers
.
Add
;
m
:=
lfMap
.
Markers
.
Add
;
m
.
Latitude
:=
lat
;
m
.
Latitude
:=
lat
;
m
.
Longitude
:=
lng
;
m
.
Longitude
:=
lng
;
m
.
Title
:=
uname
+
IfThen
(
dist
<>
''
,
' / '
+
dist
,
''
);
m
.
Title
:=
'<div class="d-flex flex-column gap-1 px-1 py-1" style="width:260px;">'
+
'<div class="fw-semibold small">'
+
'<span class="fw-bold">Unit:</span> '
+
uname
+
'</div>'
+
IfThen
(
dist
<>
''
,
'<div class="small"><span class="fw-bold">District:</span> '
+
dist
+
'</div>'
,
''
)
+
IfThen
(
Trim
(
callType
)
<>
''
,
'<div class="small"><span class="fw-bold">Call Type:</span> '
+
callType
+
'</div>'
,
''
)
+
IfThen
(
Trim
(
priorityText
)
<>
''
,
'<div class="small"><span class="fw-bold">Priority:</span> '
+
priorityText
+
'</div>'
,
''
)
+
IfThen
(
Trim
(
statusText
)
<>
''
,
'<div class="small mb-1"><span class="fw-bold">Status:</span> '
+
statusText
+
'</div>'
,
''
)
+
'<div class="d-flex justify-content-end mt-0">'
+
'<button type="button" class="btn btn-primary btn-sm px-2 py-1" '
+
'onclick="window.showUnitDetails('''
+
unitId
+
''')">'
+
'Details'
+
'</button>'
+
'</div>'
+
'</div>'
;
m
.
DataString
:=
'unit'
;
m
.
DataString
:=
'unit'
;
m
.
IconURL
:=
CarIconForDistrict
(
dist
);
m
.
IconURL
:=
CarIconForDistrict
(
dist
);
end
;
end
;
...
...
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