Adding initial fixes for geo dashboard

revert-dabc3590
Megala 8 years ago
parent c4ac1db382
commit 09805d451c

@ -12,9 +12,9 @@ define stream dataIn (id string, latitude double, longitude double, timeStamp lo
@Export('org.wso2.geo.ProcessedSpatialEvents:1.0.0') @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); 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 select id , latitude, longitude,timeStamp, type, speed, heading ,eventId , "ALERTED" as state, "This device is in $areaName restricted area!!!" as information
insert into dataOut; 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 select id , latitude, longitude,timeStamp, type, speed, heading ,eventId , "NORMAL" as state, "" as information
insert into dataOut; insert into dataOut;

@ -281,7 +281,8 @@ function setWithinAlert(leafletId) {
'parseData': JSON.stringify({ 'parseData': JSON.stringify({
'geoFenceGeoJSON': selectedAreaGeoJson, 'geoFenceGeoJSON': selectedAreaGeoJson,
'executionPlanName': createExecutionPlanName(queryName, "WithIn", deviceId), 'executionPlanName': createExecutionPlanName(queryName, "WithIn", deviceId),
'areaName': areaName 'areaName': areaName,
'deviceId' : deviceId
}), }),
'executionPlan': 'Within', 'executionPlan': 'Within',
'customName': areaName, // TODO: fix , When template copies there can be two queryName and areaName id elements in the DOM '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 + .constance.TENANT_INDEX + ApplicationOptions.constance.PATH_SEPARATOR + data.user.domain +
ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance
.CEP_WEB_SOCKET_OUTPUT_ADAPTOR_NAME + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance.VERSION .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 alertWebSocketURL = 'wss://' + data.ip + ':' + data.httpsPort + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance
.CEP_WEB_SOCKET_OUTPUT_ADAPTOR_WEBAPP_NAME + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions .CEP_WEB_SOCKET_OUTPUT_ADAPTOR_WEBAPP_NAME + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions
.constance.TENANT_INDEX + ApplicationOptions.constance.PATH_SEPARATOR + data.user.domain + .constance.TENANT_INDEX + ApplicationOptions.constance.PATH_SEPARATOR + data.user.domain +
ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance
.CEP_ON_ALERT_WEB_SOCKET_OUTPUT_ADAPTOR_NAME + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance.VERSION .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(); initializeWebSocket();
initializeOnAlertWebSocket(); initializeOnAlertWebSocket();
}); });

@ -3,10 +3,7 @@
@Plan:description('ExecutionPlan') @Plan:description('ExecutionPlan')
@Import('org.wso2.iot.android.sense:1.0.0') @Import('org.wso2.iot.android.sense:1.0.0')
define stream AndroidSense (meta_owner string, meta_deviceId string, meta_type string, meta_timestamp long, battery int, battery_state string, battery_status string, battery_temperature int, gps_lat double, gps_long double, accelerometer_x float, accelerometer_y float, accelerometer_z float, speed_limit float, turn_way string, magnetic_x float, magnetic_y float, magnetic_z float, gyroscope_x float, gyroscope_y float, gyroscope_z float, light float, pressure float, proximity float, gravity_x float, gravity_y float, gravity_z float, rotation_x float, rotation_y float, rotation_z float, word string, word_sessionId string, word_status string, beacon_major int, beacon_minor int, beacon_proximity string, beacon_uuid int, call_number string, call_type string, call_start_time long, call_end_time long, screen_state string, audio_playing bool, headset_on bool, music_volume int, activity_type int, confidence int, sms_number string, application_name string, action string, data_type string, data_sent long, data_received long); define stream AndroidSense (meta_owner string, meta_deviceId string, meta_type string, meta_timestamp long, battery int, battery_state string, battery_status string, battery_temperature int, gps_lat double, gps_long double, accelerometer_x float, accelerometer_y float, accelerometer_z float, speed_limit float, turn_way string, magnetic_x float, magnetic_y float, magnetic_z float, gyroscope_x float, gyroscope_y float, gyroscope_z float, light float, pressure float, proximity float, gravity_x float, gravity_y float, gravity_z float, rotation_x float, rotation_y float, rotation_z float, word string, word_sessionId string, word_status string, beacon_major int, beacon_minor int, beacon_proximity string, beacon_uuid int, call_number string, call_type string, call_start_time long, call_end_time long, screen_state string, audio_playing bool, headset_on bool, music_volume int, activity_type int, confidence int, sms_number string, application_name string, action string);
@Export('org.wso2.iot.android.data:1.0.0')
define stream DataStream (meta_owner string, meta_deviceId string, meta_timestamp long, type string, received long, sent long);
@Export('org.wso2.iot.android.activity:1.0.0') @Export('org.wso2.iot.android.activity:1.0.0')
define stream ActivityStream (meta_owner string, meta_deviceId string, meta_timestamp long, action string); define stream ActivityStream (meta_owner string, meta_deviceId string, meta_timestamp long, action string);
@ -29,6 +26,8 @@ define stream BatteryStream (meta_owner string, meta_deviceId string, meta_times
@Export('org.wso2.iot.android.sms:1.0.0') @Export('org.wso2.iot.android.sms:1.0.0')
define stream SmsStream (meta_owner string, meta_deviceId string, meta_timestamp long, number string, type string, body string); define stream SmsStream (meta_owner string, meta_deviceId string, meta_timestamp long, number string, type string, body string);
@Export('org.wso2.geo.LocationStream:1.0.0')
define stream geoLocationStream (id string, timeStamp long, latitude double, longitude double, type string, speed float, heading float);
from AndroidSense[meta_type == 'sms'] from AndroidSense[meta_type == 'sms']
select meta_owner, meta_deviceId, meta_timestamp, sms_number as number, action as type, "" as body select meta_owner, meta_deviceId, meta_timestamp, sms_number as number, action as type, "" as body
@ -42,7 +41,7 @@ from AndroidSense[meta_type == 'audio']
select meta_owner, meta_deviceId, meta_timestamp, audio_playing, headset_on, music_volume select meta_owner, meta_deviceId, meta_timestamp, audio_playing, headset_on, music_volume
insert into AudioStream; insert into AudioStream;
from AndroidSense[meta_type == 'location'] from AndroidSense[meta_type == 'gps']
select meta_owner, meta_deviceId, meta_timestamp, gps_lat as latitude, gps_long as longitude select meta_owner, meta_deviceId, meta_timestamp, gps_lat as latitude, gps_long as longitude
insert into LocationStream; insert into LocationStream;
@ -58,6 +57,6 @@ from AndroidSense[meta_type == 'activity']
select meta_owner, meta_deviceId, meta_timestamp, action select meta_owner, meta_deviceId, meta_timestamp, action
insert into ActivityStream; insert into ActivityStream;
from AndroidSense[meta_type == 'data'] from AndroidSense[meta_type == 'gps']
select meta_owner, meta_deviceId, meta_timestamp, data_type as type, data_received as received, data_sent as sent select meta_deviceId as id, meta_timestamp as timeStamp, gps_lat as latitude, gps_long as longitude, "android_sense" as type, speed_limit as speed, 0.0f as heading
insert into DataStream; insert into geoLocationStream;

@ -55,9 +55,6 @@
{"name": "confidence", "type": "INT"}, {"name": "confidence", "type": "INT"},
{"name": "sms_number", "type": "STRING"}, {"name": "sms_number", "type": "STRING"},
{"name": "application_name", "type": "STRING"}, {"name": "application_name", "type": "STRING"},
{"name": "action", "type": "STRING"}, {"name": "action", "type": "STRING"}
{"name": "data_type", "type": "STRING"},
{"name": "data_sent", "type": "LONG"},
{"name": "data_received", "type": "LONG"}
] ]
} }

Loading…
Cancel
Save