forked from community/device-mgt-core
parent
dcac19480f
commit
cec1e1393e
@ -1,47 +0,0 @@
|
||||
<div class="modal-header">
|
||||
<button class="close" type="button" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">
|
||||
<div class="col-lg-5 col-md-6 col-centered">
|
||||
<h4>
|
||||
Set 'Exit Fence' alerts
|
||||
<br>
|
||||
</h4>
|
||||
</div>
|
||||
</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-md-8 col-centered">
|
||||
<div class="">
|
||||
<table class="table table-hover" id="exit-alert">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Fence Name</th>
|
||||
<th>Query Name</th>
|
||||
<th>Created On</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<div class="alert alert-info fence-not-exist" role="alert">
|
||||
<strong>Oh snap!</strong> Can't find any geofence area, please draw a new area or try again.
|
||||
</div>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<button style="background-color: #f4f4f4;" type="button" class="btn btn-default"
|
||||
onclick="openTools('Exit')">Draw area
|
||||
</button>
|
||||
<button style="background-color: #f4f4f4;" type="button" class="btn btn-default"
|
||||
onclick="$('#editExitGeoJSON').modal('toggle')">Enter area
|
||||
</button>
|
||||
<br/>
|
||||
<br/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/devicemgt/public/cdmf.unit.geo-dashboard/js/geo_exit_fence.js"></script>
|
@ -1,95 +0,0 @@
|
||||
<!--~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
~
|
||||
~ WSO2 Inc. licenses this file to you under the Apache License,
|
||||
~ Version 2.0 (the "License"); you may not use this file except
|
||||
~ in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing,
|
||||
~ software distributed under the License is distributed on an
|
||||
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
~ KIND, either express or implied. See the License for the
|
||||
~ specific language governing permissions and limitations
|
||||
~ under the License.-->
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head lang="en">
|
||||
<link href="/portal/store/carbon.super/fs/gadget/geo-dashboard/css/leaflet/L.Grid.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="/portal/store/carbon.super/fs/gadget/geo-dashboard/css/main.css" rel="stylesheet" type="text/css"/>
|
||||
<script src="/portal/store/carbon.super/fs/gadget/geo-dashboard/js/leaflet/L.Grid.js"></script>
|
||||
<script src="/portal/store/carbon.super/fs/gadget/geo-dashboard/js/leaflet/L.MeasuringTool.js"></script>
|
||||
<style>
|
||||
.leaflet-grid-label .lng {
|
||||
margin-left: 8px;
|
||||
-webkit-transform: rotate(90deg);
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
.measuring-line-for-look {
|
||||
stroke-dasharray: 3, 20;
|
||||
}
|
||||
|
||||
.measuring-label-tooltip .leaflet-popup-content-wrapper {
|
||||
border-radius: 4px 4px 4px 4px;
|
||||
opacity: 0.7;
|
||||
padding: 1px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.measuring-label-tooltip .leaflet-popup-content {
|
||||
margin: 0 5px;
|
||||
/*width: 0;*/
|
||||
}
|
||||
|
||||
.measuring-label-tooltip .leaflet-popup-tip-container {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="modal-header"
|
||||
style="cursor: move;background: #f9f9f9;-webkit-box-shadow: inset 0px 0px 14px 1px rgba(0,0,0,0.2);-moz-box-shadow: inset 0px 0px 14px 1px rgba(0,0,0,0.2);box-shadow: inset 0px 0px 14px 1px rgba(0,0,0,0.2);">
|
||||
<button class="close" type="button" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">
|
||||
<!-- TODO: Trigger bootstrap tooltip $('#aboutTileUrl').tooltip(); to enable tooltip -->
|
||||
Define proximity
|
||||
</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id="proximityMap" style="height: 50%; margin: 0 auto;"></div>
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
<div class="col-md-10 col-md-offset-1">
|
||||
<form class="form-inline" role="form">
|
||||
<div class="input-group input-group-sm">
|
||||
<input type="text" id="proximityDistance" class="form-control" placeholder="Distance" >
|
||||
<span class="input-group-addon">m</span>
|
||||
</div>
|
||||
<div class="input-group input-group-sm">
|
||||
<input autofocus="enable" id="proximityTime" type="number" class="form-control"
|
||||
placeholder="Close time in S" >
|
||||
<span class="input-group-addon">Seconds</span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom: -15px" class="btn-group btn-group-justified">
|
||||
<div class="btn-group">
|
||||
<button style="background-color: #f4f4f4;" type="button" class="btn btn-default"
|
||||
onclick="setProximityAlert()">Set Proximity
|
||||
</button>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<button style="background-color: #f4f4f4;" type="button" class="btn btn-default"
|
||||
onclick="closeAll()">Cancel
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/portal/store/carbon.super/fs/gadget/geo-dashboard/js/geo_proximity.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -1,49 +0,0 @@
|
||||
<!--~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
~
|
||||
~ WSO2 Inc. licenses this file to you under the Apache License,
|
||||
~ Version 2.0 (the "License"); you may not use this file except
|
||||
~ in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing,
|
||||
~ software distributed under the License is distributed on an
|
||||
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
~ KIND, either express or implied. See the License for the
|
||||
~ specific language governing permissions and limitations
|
||||
~ under the License.-->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head lang="en">
|
||||
<meta charset="UTF-8">
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="modal-header">
|
||||
<button class="close" type="button" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<div class="col-lg-5 col-md-6 col-centered">
|
||||
<h4>
|
||||
Setup global speed limit
|
||||
<br>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-5 col-md-6 col-centered">
|
||||
<div class="input-group input-group-sm">
|
||||
<input autofocus="enable" id="speedAlertValue" type="number" min="0" class="form-control" placeholder="Speed alert value " autocomplete="off">
|
||||
<span class="input-group-addon">km/h</span>
|
||||
</div>
|
||||
<br>
|
||||
<button type="button" class="btn btn-default pull-right btn-sm" onclick="closeAll()">Cancel</button>
|
||||
<button type="button" class="btn btn-info pull-right btn-sm" onclick="setSpeedAlert()" style="margin-right: 10px;">Set speed alert</button>
|
||||
<br><br>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/devicemgt/public/cdmf.unit.geo-dashboard/js/geo_speed.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -1,80 +0,0 @@
|
||||
<!--~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
~
|
||||
~ WSO2 Inc. licenses this file to you under the Apache License,
|
||||
~ Version 2.0 (the "License"); you may not use this file except
|
||||
~ in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing,
|
||||
~ software distributed under the License is distributed on an
|
||||
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
~ KIND, either express or implied. See the License for the
|
||||
~ specific language governing permissions and limitations
|
||||
~ under the License.-->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head lang="en">
|
||||
<meta charset="UTF-8">
|
||||
<title></title>
|
||||
<style>
|
||||
.fa-trash-o:hover {
|
||||
color: red;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="modal-header">
|
||||
<button class="close" type="button" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<div class="col-lg-5 col-md-6 col-centered">
|
||||
<h4>
|
||||
Set 'Stationary' alerts
|
||||
<br>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-md-8 col-centered">
|
||||
<div class="">
|
||||
<table class="table table-hover" id="stationary-alert-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Stationary Name</th>
|
||||
<th>Stationary Time</th>
|
||||
<th>Fluctuation Radius</th>
|
||||
<th>Query Name</th>
|
||||
<th>Created On</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<div class="alert alert-info fence-not-exist" role="alert">
|
||||
<strong>Oh snap!</strong> Can't find any geofence area, please draw a new area or try again.
|
||||
</div>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<br/>
|
||||
<br/>
|
||||
<div class="pull-right">
|
||||
<button style="background-color: #f4f4f4;" type="button" class="btn btn-default"
|
||||
onclick="openTools('Stationery')">Draw area
|
||||
</button>
|
||||
<button style="background-color: #f4f4f4;" type="button" class="btn btn-default"
|
||||
onclick="$('#editWithinGeoJSON').modal('toggle')">Enter area
|
||||
</button>
|
||||
</div>
|
||||
<br/>
|
||||
<br/>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/devicemgt/public/cdmf.unit.geo-dashboard/js/geo_stationary.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -1,104 +0,0 @@
|
||||
<!--~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
~
|
||||
~ WSO2 Inc. licenses this file to you under the Apache License,
|
||||
~ Version 2.0 (the "License"); you may not use this file except
|
||||
~ in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing,
|
||||
~ software distributed under the License is distributed on an
|
||||
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
~ KIND, either express or implied. See the License for the
|
||||
~ specific language governing permissions and limitations
|
||||
~ under the License.-->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head lang="en">
|
||||
<meta charset="UTF-8">
|
||||
<title></title>
|
||||
<style>
|
||||
.fa-trash-o:hover{color:red;}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
$(".removeGeoFence").tooltip();
|
||||
|
||||
$('.viewGeoFenceRow td:not(:last-child)').click(function () {
|
||||
viewFence(this.parentElement,'Traffic');
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="modal-header" style="cursor: move;background: #f9f9f9;-webkit-box-shadow: inset 0px 0px 14px 1px rgba(0,0,0,0.2);-moz-box-shadow: inset 0px 0px 14px 1px rgba(0,0,0,0.2);box-shadow: inset 0px 0px 14px 1px rgba(0,0,0,0.2);">
|
||||
<button class="close" type="button" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">
|
||||
<!-- TODO: Trigger bootstrap tooltip $('#aboutTileUrl').tooltip(); to enable tooltip -->
|
||||
Set <i>traffic</i> alerts
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
|
||||
<p class="text-info text-center">View current fences</p>
|
||||
<div class="">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr >
|
||||
<th>Query Name</th>
|
||||
<th>Traffic Congestion Area Name</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<%
|
||||
var alerts = get('traffic');
|
||||
if(alerts){
|
||||
for each(var alert in alerts){
|
||||
%>
|
||||
<tr class="viewGeoFenceRow" style="cursor: pointer" data-areaName='<%= alert.areaName %>' data-queryName='<%= alert.queryName %>' data-geoJson='<%= alert.geoJson %>'>
|
||||
<td><%= alert.queryName %></td>
|
||||
<td><%= alert.areaName %></td>
|
||||
<td onClick="removeGeoFence(this.parentElement,'Traffic')" class="removeGeoFence" data-toggle="tooltip" title="Remove fence" ><i class="fa fa-trash-o"></i></td>
|
||||
</tr>
|
||||
<%
|
||||
}
|
||||
}
|
||||
else{
|
||||
%>
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<strong>Oh snap!</strong> Can't find any geofence area, please draw a new area or try again.
|
||||
</div>
|
||||
<%
|
||||
}
|
||||
%>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<p class="text-info text-center">Select Interested Area</p>
|
||||
|
||||
<div style="margin-bottom: -15px" class="btn-group btn-group-justified">
|
||||
<div class="btn-group">
|
||||
<button style="background-color: #f4f4f4;" type="button" class="btn btn-default" onclick="openTools('Traffic')">Draw area</button>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<button style="background-color: #f4f4f4;" type="button" class="btn btn-default" onclick="$('#editWithinGeoJSON').modal('toggle')" >Enter area</button>
|
||||
</div>
|
||||
<!--<div class="btn-group">-->
|
||||
<!--<button style="background-color: #f4f4f4;" type="button" class="btn btn-default" onclick="closeAll()">Cancel</button>-->
|
||||
<!--</div>-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,47 +0,0 @@
|
||||
<div class="modal-header">
|
||||
<button class="close" type="button" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">
|
||||
<div class="col-lg-5 col-md-6 col-centered">
|
||||
<h4>
|
||||
Set 'Within' alerts
|
||||
<br>
|
||||
</h4>
|
||||
</div>
|
||||
</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-md-8 col-centered">
|
||||
<div class="">
|
||||
<table class="table table-hover" id="within-alert">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Fence Name</th>
|
||||
<th>Query Name</th>
|
||||
<th>Created On</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<div class="alert alert-info fence-not-exist" role="alert">
|
||||
<strong>Oh snap!</strong> Can't find any geofence area, please draw a new area or try again.
|
||||
</div>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<button style="background-color: #f4f4f4;" type="button" class="btn btn-default"
|
||||
onclick="openTools('WithIn')">Draw area
|
||||
</button>
|
||||
<button style="background-color: #f4f4f4;" type="button" class="btn btn-default"
|
||||
onclick="$('#editWithinGeoJSON').modal('toggle')">Enter area
|
||||
</button>
|
||||
<br/>
|
||||
<br/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/devicemgt/public/cdmf.unit.geo-dashboard/js/geo_within.js"></script>
|
@ -1,52 +0,0 @@
|
||||
<!--~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
~
|
||||
~ WSO2 Inc. licenses this file to you under the Apache License,
|
||||
~ Version 2.0 (the "License"); you may not use this file except
|
||||
~ in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing,
|
||||
~ software distributed under the License is distributed on an
|
||||
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
~ KIND, either express or implied. See the License for the
|
||||
~ specific language governing permissions and limitations
|
||||
~ under the License.-->
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head lang="en">
|
||||
<meta charset="UTF-8">
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="viewExitAlert" >
|
||||
<h3 class="popover-title" id="viewAreaName"></h3>
|
||||
<div class="popover-content">
|
||||
<form role="form" style="width: auto" id="exitAlertForm">
|
||||
<button type="button" id="exportGeoJson" download="geoJson.json" onclick="exportToGeoJSON(this,JSON.stringify(map._layers[$(this).attr('leaflet_id')].toGeoJSON(),null, '\t'))" class="btn btn-info btn-xs" data-toggle="tooltip" data-placement="left" title="Export selected area as a geoJson file">Export</button>
|
||||
<button type="button" id="hideViewFence" class="btn btn-info btn-xs" data-toggle="tooltip" data-placement="left" title="Hide this fence" onclick="map.removeLayer(map._layers[$(this).attr('leaflet_id')])" >Hide</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="viewWithinAlert" >
|
||||
<h3 class="popover-title" id="viewAreaName"></h3>
|
||||
<div class="popover-content">
|
||||
<form role="form" style="width: auto" class="" id="withinAlertForm">
|
||||
<button type="button" id="exportGeoJson" download="geoJson.json" onclick="exportToGeoJSON(this,JSON.stringify(map._layers[$(this).attr('leaflet_id')].toGeoJSON(),null, '\t'))" class="btn btn-info btn-xs" data-toggle="tooltip" data-placement="left" title="Export selected area as a geoJson file">Export</button>
|
||||
<button type="button" id="hideViewFence" class="btn btn-info btn-xs" data-toggle="tooltip" data-placement="left" title="Hide this fence" onclick="map.removeLayer(map._layers[$(this).attr('leaflet_id')])" >Hide</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="viewStationeryAlert" >
|
||||
<h3 class="popover-title" id="viewAreaName"></h3>
|
||||
<div class="popover-content">
|
||||
<form role="form" style="width: auto" id="stationaryAlertForm">
|
||||
<h6>Stationery time(Seconds)<span id="viewAreaTime" class="label label-primary pull-right">N/A</span></h6>
|
||||
<button type="button" id="exportGeoJson" download="geoJson.json" onclick="exportToGeoJSON(this,JSON.stringify(map._layers[$(this).attr('leaflet_id')].toGeoJSON(),null, '\t'))" class="btn btn-info btn-xs" data-toggle="tooltip" data-placement="left" title="Export selected area as a geoJson file">Export</button>
|
||||
<button type="button" id="hideViewFence" class="btn btn-info btn-xs" data-toggle="tooltip" data-placement="left" title="Hide this fence" onclick="map.removeLayer(map._layers[$(this).attr('leaflet_id')])" >Hide</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,20 +0,0 @@
|
||||
/* Enter a unique ExecutionPlan */
|
||||
@Plan:name('$executionPlanName')
|
||||
|
||||
/* Enter a unique description for ExecutionPlan */
|
||||
-- @Plan:description('ExecutionPlan')
|
||||
|
||||
/* define streams/tables and write queries here ... */
|
||||
|
||||
@Import('org.wso2.geo.StandardSpatialEvents:1.0.0')
|
||||
define stream dataIn (id string, latitude double, longitude double, timeStamp long, type string ,speed float, heading float, eventId string);
|
||||
|
||||
@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")==false 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")!=false and id == "$deviceId"]
|
||||
select id , latitude, longitude,timeStamp, type, speed, heading ,eventId , "NORMAL" as state, "" as information
|
||||
insert into dataOut;
|
@ -1,140 +0,0 @@
|
||||
/* Enter a unique ExecutionPlan */
|
||||
@Plan:name('Geo-ExecutionPlan-Proximity_alert')
|
||||
|
||||
/* Enter a unique description for ExecutionPlan */
|
||||
-- @Plan:description('ExecutionPlan')
|
||||
|
||||
/* define streams/tables and write queries here ... */
|
||||
|
||||
@Import('org.wso2.geo.StandardSpatialEvents:1.0.0')
|
||||
define stream dataIn (id string, latitude double, longitude double, timeStamp long, type string, speed float, heading float, eventId string );
|
||||
|
||||
@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 );
|
||||
|
||||
@IndexBy('id')
|
||||
define table ProximityTable(id string, timeStamp long);
|
||||
|
||||
@IndexBy('id')
|
||||
define table AlertsTable(id string , proximityWith string, eventId string);
|
||||
|
||||
from dataIn#geodashboard:subscribe()
|
||||
select id, latitude, longitude, timeStamp, type, speed, heading, eventId
|
||||
insert into initialStream;
|
||||
|
||||
from initialStream[type == 'STOP']
|
||||
select id , latitude, longitude,timeStamp, type, speed, heading ,eventId , "" as proximityInfo ,"false" as isProximity
|
||||
insert into dataOutStream;
|
||||
|
||||
from initialStream[type != 'STOP']
|
||||
select *
|
||||
insert into objectInitialStream;
|
||||
|
||||
from objectInitialStream#geo:proximity(id,longitude,latitude, $proximityDistance)
|
||||
select id, latitude, longitude, timeStamp, type, speed, heading, eventId,inCloseProximity,proximityWith
|
||||
insert into proxymityStream;
|
||||
|
||||
from proxymityStream[AlertsTable.id == proxymityStream.id in AlertsTable]
|
||||
select id, latitude, longitude, timeStamp, type, speed, heading, eventId,inCloseProximity,proximityWith,true as inAlertTable
|
||||
insert into innerStreamOne;
|
||||
|
||||
from proxymityStream[not(AlertsTable.id == proxymityStream.id in AlertsTable)]
|
||||
select id, latitude, longitude, timeStamp, type, speed, heading, eventId,inCloseProximity,proximityWith,false as inAlertTable
|
||||
insert into innerStreamOne;
|
||||
|
||||
from proxymityStream[AlertsTable.id == proxymityStream.proximityWith in AlertsTable]
|
||||
select id, latitude, longitude, timeStamp, type, speed, heading, eventId,inCloseProximity,proximityWith,true as inAlertTable
|
||||
insert into innerStreamSeven;
|
||||
|
||||
from proxymityStream[not(AlertsTable.id == proxymityStream.proximityWith in AlertsTable)]
|
||||
select id, latitude, longitude, timeStamp, type, speed, heading, eventId,inCloseProximity,proximityWith,false as inAlertTable
|
||||
insert into innerStreamSeven;
|
||||
|
||||
from innerStreamOne[inCloseProximity == true AND not(inAlertTable)]
|
||||
select id,str:concat(",",proximityWith) as proximityWith , eventId
|
||||
insert into AlertsTable;
|
||||
|
||||
from innerStreamSeven[inCloseProximity == true AND not(inAlertTable)]
|
||||
select proximityWith as id,str:concat(",",id) as proximityWith , eventId
|
||||
insert into AlertsTable;
|
||||
|
||||
from innerStreamOne[innerStreamOne.inCloseProximity == true AND inAlertTable]#window.length(0) join AlertsTable
|
||||
on innerStreamOne.id == AlertsTable.id
|
||||
select innerStreamOne.id as id, str:concat(",", innerStreamOne.proximityWith, AlertsTable.proximityWith) as proximityWith, innerStreamOne.eventId as eventId
|
||||
insert into updateStream;
|
||||
|
||||
from innerStreamSeven[innerStreamSeven.inCloseProximity == true AND inAlertTable]#window.length(0) join AlertsTable
|
||||
on innerStreamSeven.proximityWith == AlertsTable.id
|
||||
select innerStreamSeven.proximityWith as id, str:concat(",", innerStreamSeven.id, AlertsTable.proximityWith) as proximityWith, innerStreamSeven.eventId as eventId
|
||||
insert into updateStream;
|
||||
|
||||
from innerStreamOne[innerStreamOne.inCloseProximity == false AND inAlertTable]#window.length(0) join AlertsTable
|
||||
on innerStreamOne.id == AlertsTable.id
|
||||
select innerStreamOne.id as id, str:replaceAll(AlertsTable.proximityWith, str:concat(",", innerStreamOne.proximityWith), "") as proximityWith, innerStreamOne.eventId as eventId
|
||||
insert into updateStream;
|
||||
|
||||
from innerStreamSeven[innerStreamSeven.inCloseProximity == false AND inAlertTable]#window.length(0) join AlertsTable
|
||||
on innerStreamSeven.proximityWith == AlertsTable.id
|
||||
select innerStreamSeven.proximityWith as id, str:replaceAll(AlertsTable.proximityWith, str:concat(",", innerStreamSeven.id), "") as proximityWith, innerStreamSeven.eventId as eventId
|
||||
insert into updateStream;
|
||||
|
||||
from updateStream
|
||||
select *
|
||||
update AlertsTable
|
||||
on id== AlertsTable.id;
|
||||
|
||||
from updateStream[proximityWith == ""]
|
||||
delete AlertsTable
|
||||
on id== AlertsTable.id;
|
||||
|
||||
from objectInitialStream[AlertsTable.id == objectInitialStream.id in AlertsTable]
|
||||
select id, latitude, longitude, timeStamp, type, speed, heading, eventId, true as inAlertTable
|
||||
insert into publishStream;
|
||||
|
||||
from objectInitialStream[not(AlertsTable.id == objectInitialStream.id in AlertsTable)]
|
||||
select id, latitude, longitude, timeStamp, type, speed, heading, eventId, false as inAlertTable
|
||||
insert into publishStream;
|
||||
|
||||
from publishStream[inAlertTable == true]#window.length(0) join AlertsTable
|
||||
on publishStream.id== AlertsTable.id
|
||||
select publishStream.id as id, publishStream.latitude as latitude, publishStream.longitude as longitude, publishStream.timeStamp as timeStamp, publishStream.type as type, publishStream.speed as speed, publishStream.heading as heading, publishStream.eventId as eventId, AlertsTable.proximityWith as proximityInfo
|
||||
insert into innerStreamTwo;
|
||||
|
||||
from publishStream[inAlertTable == false]
|
||||
delete ProximityTable on ProximityTable.id==id;
|
||||
|
||||
from publishStream[inAlertTable == false]
|
||||
select id , latitude, longitude,timeStamp, type, speed, heading ,eventId , "" as proximityInfo ,"false" as isProximity
|
||||
insert into dataOutStream;
|
||||
|
||||
from innerStreamTwo[ProximityTable.id == innerStreamTwo.id in ProximityTable]
|
||||
insert into innerStreamThree;
|
||||
|
||||
from innerStreamThree#window.length(0) join ProximityTable
|
||||
on innerStreamThree.id == ProximityTable.id
|
||||
select innerStreamThree.id , innerStreamThree.latitude, innerStreamThree.longitude,innerStreamThree.timeStamp, innerStreamThree.type, innerStreamThree.speed, innerStreamThree.heading ,innerStreamThree.eventId, ProximityTable.timeStamp as storedTime, innerStreamThree.proximityInfo as proximityInfo
|
||||
insert into innerStreamFour;
|
||||
|
||||
from innerStreamFour[(timeStamp - storedTime) >= $proximityTime]
|
||||
select id , latitude, longitude,timeStamp, type, speed, heading ,eventId ,proximityInfo,"true" as isProximity
|
||||
insert into dataOutStream;
|
||||
|
||||
from innerStreamFour[(timeStamp - storedTime) < $proximityTime]
|
||||
select id , latitude, longitude,timeStamp, type, speed, heading ,eventId , proximityInfo ,"false" as isProximity
|
||||
insert into dataOutStream;
|
||||
|
||||
from innerStreamTwo[not(ProximityTable.id == innerStreamTwo.id in ProximityTable)]
|
||||
select innerStreamTwo.id, innerStreamTwo.timeStamp
|
||||
insert into ProximityTable;
|
||||
|
||||
from innerStreamTwo[not(ProximityTable.id == innerStreamTwo.id in ProximityTable)]
|
||||
select id , latitude, longitude,timeStamp, type, speed, heading ,eventId , "" as proximityInfo ,"false" as isProximity
|
||||
insert into dataOutStream;
|
||||
|
||||
from dataOutStream[isProximity == 'true']
|
||||
select id, latitude, longitude, timeStamp, type, speed, heading, eventId,"WARNING" as state,str:concat("Proximity with "," ",proximityInfo) as information
|
||||
insert into dataOut;
|
||||
|
||||
from dataOutStream[isProximity == 'false']
|
||||
select id , latitude, longitude,timeStamp, type, speed, heading ,eventId ,"NORMAL" as state,"" as information
|
||||
insert into dataOut;
|
@ -1,20 +0,0 @@
|
||||
/* Enter a unique ExecutionPlan */
|
||||
@Plan:name('Geo-ExecutionPlan-Speed---$deviceId_alert')
|
||||
|
||||
/* Enter a unique description for ExecutionPlan */
|
||||
-- @Plan:description('ExecutionPlan')
|
||||
|
||||
/* define streams/tables and write queries here ... */
|
||||
|
||||
@Import('org.wso2.geo.StandardSpatialEvents:1.0.0')
|
||||
define stream dataIn (id string, latitude double, longitude double, timeStamp long, type string, speed float, heading float, eventId string);
|
||||
|
||||
@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[speed >= $speedAlertValue and id == "$deviceId"]#geodashboard:subscribe()
|
||||
select id , latitude, longitude,timeStamp, type ,speed, heading ,eventId , "ALERTED" as state, "This device movement is not normal!!" as information
|
||||
insert into dataOut;
|
||||
from dataIn[speed < $speedAlertValue and id == "$deviceId"]
|
||||
select id , latitude, longitude,timeStamp, type ,speed, heading ,eventId , "NORMAL" as state, "This device movement is normal" as information
|
||||
insert into dataOut;
|
@ -1,89 +0,0 @@
|
||||
/* Enter a unique ExecutionPlan */
|
||||
@Plan:name('$executionPlanName')
|
||||
|
||||
/* Enter a unique description for ExecutionPlan */
|
||||
-- @Plan:description('ExecutionPlan')
|
||||
|
||||
/* define streams/tables and write queries here ... */
|
||||
|
||||
@Import('org.wso2.geo.StandardSpatialEvents:1.0.0')
|
||||
define stream dataIn (id string, latitude double, longitude double, timeStamp long, type string ,speed float, heading float, eventId string);
|
||||
|
||||
|
||||
@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);
|
||||
|
||||
@IndexBy('id')
|
||||
define table StationeryTable(id string, timeStamp long);
|
||||
|
||||
@IndexBy('id')
|
||||
define table AlertsTable(id string, stationary bool);
|
||||
|
||||
from dataIn#geodashboard:subscribe()
|
||||
select id, latitude, longitude, timeStamp, type, speed, heading, eventId,geo:within(longitude,latitude,"$geoFenceGeoJSON") as isWithin
|
||||
insert into innerStreamOne;
|
||||
|
||||
from innerStreamOne[isWithin == false]
|
||||
delete StationeryTable on StationeryTable.id==id;
|
||||
|
||||
from innerStreamOne[isWithin == false]
|
||||
select id , latitude, longitude,timeStamp, type, speed, heading ,eventId , "false" as isStationary
|
||||
insert into dataOutStream;
|
||||
|
||||
from innerStreamOne[isWithin == true]#geo:stationary(id,longitude,latitude, $fluctuationRadius)
|
||||
select id, latitude, longitude, timeStamp, type, speed, heading, eventId,stationary
|
||||
insert into innerStreamTwo;
|
||||
|
||||
from innerStreamTwo[innerStreamTwo.stationary == true]
|
||||
select innerStreamTwo.id, innerStreamTwo.stationary
|
||||
insert into AlertsTable;
|
||||
|
||||
from innerStreamTwo[innerStreamTwo.stationary == false]
|
||||
delete AlertsTable on AlertsTable.id==id;
|
||||
|
||||
from innerStreamTwo[innerStreamTwo.stationary == false]
|
||||
delete StationeryTable on StationeryTable.id==id;
|
||||
|
||||
from innerStreamOne[isWithin == true AND not(AlertsTable.id == innerStreamOne.id in AlertsTable)]
|
||||
select id , latitude, longitude,timeStamp, type, speed, heading ,eventId , "false" as isStationary
|
||||
insert into dataOutStream;
|
||||
|
||||
from innerStreamOne[isWithin == true AND AlertsTable.id == innerStreamOne.id in AlertsTable]
|
||||
insert into innerStreamThree;
|
||||
|
||||
from innerStreamThree#window.length(0) join AlertsTable
|
||||
on innerStreamThree.id == AlertsTable.id
|
||||
select innerStreamThree.id , innerStreamThree.latitude, innerStreamThree.longitude,innerStreamThree.timeStamp, innerStreamThree.type, innerStreamThree.speed, innerStreamThree.heading ,innerStreamThree.eventId
|
||||
insert into innerStreamFour;
|
||||
|
||||
from innerStreamFour[not(StationeryTable.id == innerStreamFour.id in StationeryTable)]
|
||||
select innerStreamFour.id, innerStreamFour.timeStamp
|
||||
insert into StationeryTable;
|
||||
|
||||
from innerStreamOne[isWithin == true AND not(StationeryTable.id == innerStreamOne.id in StationeryTable)]
|
||||
select id , latitude, longitude,timeStamp, type, speed, heading ,eventId , "false" as isStationary
|
||||
insert into dataOutStream;
|
||||
|
||||
from innerStreamOne[isWithin == true AND StationeryTable.id == innerStreamOne.id in StationeryTable]
|
||||
insert into innerStreamFive;
|
||||
|
||||
from innerStreamFive#window.length(0) join StationeryTable
|
||||
on innerStreamFive.id == StationeryTable.id
|
||||
select innerStreamFive.id , innerStreamFive.latitude, innerStreamFive.longitude,innerStreamFive.timeStamp, innerStreamFive.type, innerStreamFive.speed, innerStreamFive.heading ,innerStreamFive.eventId, StationeryTable.timeStamp as storedTime
|
||||
insert into innerStreamSix;
|
||||
|
||||
from innerStreamSix[(timeStamp - storedTime) >= $stationeryTime]
|
||||
select id , latitude, longitude,timeStamp, type, speed, heading ,eventId ,"true" as isStationary
|
||||
insert into dataOutStream;
|
||||
|
||||
from innerStreamSix[(timeStamp - storedTime) < $stationeryTime]
|
||||
select id , latitude, longitude,timeStamp, type, speed, heading ,eventId ,"false" as isStationary
|
||||
insert into dataOutStream;
|
||||
|
||||
from dataOutStream[isStationary == 'true']
|
||||
select id ,latitude, longitude,timeStamp, type, speed, heading ,eventId ,"ALERTED" as state, "This device is in $stationeryName area!!!" as information
|
||||
insert into dataOut;
|
||||
|
||||
from dataOutStream[isStationary == 'false']
|
||||
select id , latitude, longitude,timeStamp, type, speed, heading ,eventId ,"NORMAL" as state,"" as information
|
||||
insert into dataOut;
|
@ -1,17 +0,0 @@
|
||||
/* Enter a unique ExecutionPlan */
|
||||
@Plan:name('$executionPlanName')
|
||||
|
||||
/* Enter a unique description for ExecutionPlan */
|
||||
-- @Plan:description('ExecutionPlan')
|
||||
|
||||
/* define streams/tables and write queries here ... */
|
||||
|
||||
@Import('rawGeoStream:1.0.0')
|
||||
define stream dataIn (id string, timeStamp long, geometry string, state string, information string);
|
||||
|
||||
@Export('AlertsNotifications:1.0.0')
|
||||
define stream dataOut (id string, state string, information string, timeStamp long, latitude double, longitude double);
|
||||
|
||||
from dataIn[geo:intersects(geometry, "$geoFenceGeoJSON")==true and geodashboard:needToNotify(id, str:concat(information, state), "sendFirst") == true and id == $deviceId]
|
||||
select id, state, str:concat("Traffic alert in $areaName. State: ", state, " ", information) as information, timeStamp, 0.0 as latitude, 0.0 as longitude
|
||||
insert into dataOut
|
@ -1,20 +0,0 @@
|
||||
/* Enter a unique ExecutionPlan */
|
||||
@Plan:name('$executionPlanName')
|
||||
|
||||
/* Enter a unique description for ExecutionPlan */
|
||||
-- @Plan:description('ExecutionPlan')
|
||||
|
||||
/* define streams/tables and write queries here ... */
|
||||
|
||||
@Import('org.wso2.geo.StandardSpatialEvents:1.0.0')
|
||||
define stream dataIn (id string, latitude double, longitude double, timeStamp long, type string ,speed float, heading float, eventId string);
|
||||
|
||||
@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()
|
||||
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"]
|
||||
select id , latitude, longitude,timeStamp, type, speed, heading ,eventId , "NORMAL" as state, "" as information
|
||||
insert into dataOut;
|
@ -1,203 +0,0 @@
|
||||
/*-- Chart --*/
|
||||
|
||||
.c3 svg {
|
||||
font: 10px sans-serif;
|
||||
}
|
||||
.c3 path, .c3 line {
|
||||
fill: none;
|
||||
stroke: #000;
|
||||
}
|
||||
.c3 text {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.c3-legend-item-tile,
|
||||
.c3-xgrid-focus,
|
||||
.c3-ygrid,
|
||||
.c3-event-rect,
|
||||
.c3-bars path {
|
||||
shape-rendering: crispEdges;
|
||||
}
|
||||
|
||||
.c3-chart-arc path {
|
||||
stroke: #fff;
|
||||
|
||||
}
|
||||
.c3-chart-arc text {
|
||||
fill: #fff;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
/*-- Axis --*/
|
||||
|
||||
.c3-axis-x .tick {
|
||||
}
|
||||
.c3-axis-x-label {
|
||||
}
|
||||
|
||||
.c3-axis-y .tick {
|
||||
}
|
||||
.c3-axis-y-label {
|
||||
}
|
||||
|
||||
.c3-axis-y2 .tick {
|
||||
}
|
||||
.c3-axis-y2-label {
|
||||
}
|
||||
|
||||
/*-- Grid --*/
|
||||
|
||||
.c3-grid line {
|
||||
stroke: #aaa;
|
||||
}
|
||||
.c3-grid text {
|
||||
fill: #aaa;
|
||||
}
|
||||
.c3-xgrid, .c3-ygrid {
|
||||
stroke-dasharray: 3 3;
|
||||
}
|
||||
.c3-xgrid-focus {
|
||||
}
|
||||
|
||||
/*-- Text on Chart --*/
|
||||
|
||||
.c3-text {
|
||||
}
|
||||
|
||||
.c3-text.c3-empty {
|
||||
fill: #808080;
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
/*-- Line --*/
|
||||
|
||||
.c3-line {
|
||||
stroke-width: 1px;
|
||||
}
|
||||
/*-- Point --*/
|
||||
|
||||
.c3-circle._expanded_ {
|
||||
stroke-width: 1px;
|
||||
stroke: white;
|
||||
}
|
||||
.c3-selected-circle {
|
||||
fill: white;
|
||||
stroke-width: 2px;
|
||||
}
|
||||
|
||||
/*-- Bar --*/
|
||||
|
||||
.c3-bar {
|
||||
stroke-width: 0;
|
||||
}
|
||||
.c3-bar._expanded_ {
|
||||
fill-opacity: 0.75;
|
||||
}
|
||||
|
||||
/*-- Arc --*/
|
||||
|
||||
.c3-chart-arcs-title {
|
||||
font-size: 1.3em;
|
||||
}
|
||||
|
||||
/*-- Focus --*/
|
||||
|
||||
.c3-target.c3-focused path.c3-line, .c3-target.c3-focused path.c3-step {
|
||||
stroke-width: 2px;
|
||||
}
|
||||
|
||||
/*-- Region --*/
|
||||
|
||||
.c3-region {
|
||||
fill: steelblue;
|
||||
fill-opacity: .1;
|
||||
}
|
||||
|
||||
/*-- Brush --*/
|
||||
|
||||
.c3-brush .extent {
|
||||
fill-opacity: .1;
|
||||
}
|
||||
|
||||
/*-- Select - Drag --*/
|
||||
|
||||
.c3-dragarea {
|
||||
}
|
||||
|
||||
/*-- Legend --*/
|
||||
|
||||
.c3-legend-item {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.c3-legend-background {
|
||||
opacity: 0.75;
|
||||
fill: white;
|
||||
stroke: lightgray;
|
||||
stroke-width: 1
|
||||
}
|
||||
|
||||
/*-- Tooltip --*/
|
||||
|
||||
.c3-tooltip {
|
||||
border-collapse:collapse;
|
||||
border-spacing:0;
|
||||
background-color:#fff;
|
||||
empty-cells:show;
|
||||
-webkit-box-shadow: 7px 7px 12px -9px rgb(119,119,119);
|
||||
-moz-box-shadow: 7px 7px 12px -9px rgb(119,119,119);
|
||||
box-shadow: 7px 7px 12px -9px rgb(119,119,119);
|
||||
opacity: 0.9;
|
||||
}
|
||||
.c3-tooltip tr {
|
||||
border:1px solid #CCC;
|
||||
}
|
||||
.c3-tooltip th {
|
||||
background-color: #aaa;
|
||||
font-size:14px;
|
||||
padding:2px 5px;
|
||||
text-align:left;
|
||||
color:#FFF;
|
||||
}
|
||||
.c3-tooltip td {
|
||||
font-size:13px;
|
||||
padding: 3px 6px;
|
||||
background-color:#fff;
|
||||
border-left:1px dotted #999;
|
||||
}
|
||||
.c3-tooltip td > span {
|
||||
display: inline-block;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
margin-right: 6px;
|
||||
}
|
||||
.c3-tooltip td.value{
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.c3-area {
|
||||
stroke-width: 0;
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
.c3-chart-arcs .c3-chart-arcs-background {
|
||||
fill: #e0e0e0;
|
||||
stroke: none;
|
||||
}
|
||||
.c3-chart-arcs .c3-chart-arcs-gauge-unit {
|
||||
fill: #000;
|
||||
font-size: 16px;
|
||||
}
|
||||
.c3-chart-arcs .c3-chart-arcs-gauge-max {
|
||||
fill: #777;
|
||||
}
|
||||
.c3-chart-arcs .c3-chart-arcs-gauge-min {
|
||||
fill: #777;
|
||||
}
|
||||
|
||||
.c3-chart-arc .c3-gauge-value {
|
||||
fill: #000;
|
||||
font-size: 28px;
|
||||
}
|
Loading…
Reference in new issue