Merge pull request #447 from Megala21/embed

Adding minor fixes to geo fencing
revert-dabc3590
sinthuja 8 years ago committed by GitHub
commit 9e9a480486

@ -12,9 +12,9 @@ define stream dataIn (id string, latitude double, longitude double, timeStamp lo
@Export('org.wso2.geo.ProcessedSpatialEvents:1.0.0')
define stream dataOut (id string, latitude double, longitude double, timeStamp long, type string ,speed float, heading float, eventId string, state string, information string);
from dataIn[geo:within(longitude,latitude,"$geoFenceGeoJSON")==true and id == $deviceId]#geodashboard:subscribe()
from dataIn[geo:within(longitude,latitude,"$geoFenceGeoJSON")==true and id == "$deviceId"]#geodashboard:subscribe()
select id , latitude, longitude,timeStamp, type, speed, heading ,eventId , "ALERTED" as state, "This device is in $areaName restricted area!!!" as information
insert into dataOut;
from dataIn[geo:within(longitude,latitude,"$geoFenceGeoJSON")!=true and id == $deviceId]
from dataIn[geo:within(longitude,latitude,"$geoFenceGeoJSON")!=true and id == "$deviceId"]
select id , latitude, longitude,timeStamp, type, speed, heading ,eventId , "NORMAL" as state, "" as information
insert into dataOut;

@ -281,7 +281,8 @@ function setWithinAlert(leafletId) {
'parseData': JSON.stringify({
'geoFenceGeoJSON': selectedAreaGeoJson,
'executionPlanName': createExecutionPlanName(queryName, "WithIn", deviceId),
'areaName': areaName
'areaName': areaName,
'deviceId' : deviceId
}),
'executionPlan': 'Within',
'customName': areaName, // TODO: fix , When template copies there can be two queryName and areaName id elements in the DOM

@ -677,13 +677,14 @@ function intializeWebsocketUrls() {
.constance.TENANT_INDEX + ApplicationOptions.constance.PATH_SEPARATOR + data.user.domain +
ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance
.CEP_WEB_SOCKET_OUTPUT_ADAPTOR_NAME + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance.VERSION
+ "?token=ee9971c8-bf09-3c83-b097-ce87a0c88806&deviceId=" + deviceId + "&deviceType=" + deviceType;
+ "?deviceId=" + deviceId + "&deviceType=" + deviceType;
alertWebSocketURL = 'wss://' + data.ip + ':' + data.httpsPort + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance
.CEP_WEB_SOCKET_OUTPUT_ADAPTOR_WEBAPP_NAME + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions
.constance.TENANT_INDEX + ApplicationOptions.constance.PATH_SEPARATOR + data.user.domain +
ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance
.CEP_ON_ALERT_WEB_SOCKET_OUTPUT_ADAPTOR_NAME + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance.VERSION
+ "?token=ee9971c8-bf09-3c83-b097-ce87a0c88806&deviceId=" + deviceId + "&deviceType=" + deviceType;
+ "?deviceId=" + deviceId + "&deviceType=" + deviceType;
document.cookie = "websocket-token=f98d6142-e988-3c7f-a8c9-7e6d74da7113; path=/";
initializeWebSocket();
initializeOnAlertWebSocket();
});
@ -705,7 +706,8 @@ intializeWebsocketUrls();
SpatialObject.prototype.stateIcon = function () {
var iconUrl = "/portal/store/carbon.super/fs/gadget/geo-dashboard/img/markers/object-types/" + this.type.toLowerCase();
//TODO : Need to add separate icons for each device type
var iconUrl = "/portal/store/carbon.super/fs/gadget/geo-dashboard/img/markers/object-types/default_icons";
if (0 < this.speed && (-360 <= this.heading && 360 >= this.heading)) {
iconUrl = iconUrl + "/moving/" + this.state.toLowerCase();
} else {

@ -12,7 +12,7 @@
define stream dataIn (id string, latitude double, longitude double, timeStamp long, type string, speed float, heading float, eventId string, state string, information string );
@Export('org.wso2.geo.AlertsNotifications:1.0.0')
define stream alertsOut ( id string, state string, information string, timeStamp long, latitude double, longitude double );
define stream alertsOut ( id string, state string, information string, timeStamp long, latitude double, longitude double, type string);
@Export('org.wso2.geo.FusedSpatialEvent:1.0.0')
define stream dataOut ( id string, latitude double, longitude double, timeStamp long, type string, speed float, heading float, state string, information string, notify bool );
@ -25,5 +25,5 @@ select id, latitude, longitude, timeStamp, type, speed, heading, state , informa
insert into dataOut;
from dataOut[notify == true]
select id,state,information,timeStamp, latitude, longitude
select id, state, information,timeStamp, latitude, longitude, type
insert into alertsOut;

@ -7,8 +7,8 @@
"messageType" : "Point",
"type": "Feature",
"id": {{id}},
"deviceId": "rkxb293yw2t2",
"deviceType": "virtual_firealarm",
"deviceId": {{id}},
"deviceType": {{type}},
"properties": {
"speed": {{speed}},
"heading": {{heading}},

@ -8,8 +8,8 @@
"messageType" : "Alert",
"type": "Feature",
"id": {{id}},
"deviceId": "rkxb293yw2t2",
"deviceType" : "virtual_firealarm",
"deviceId": {{id}},
"deviceType" : "{{type}}",
"state": {{state}},
"information": {{information}},
"longitude" : {{longitude}},

Loading…
Cancel
Save