Skip to content

Commit 3b9cf82

Browse files
authored
Update model.xml
An updated version of the example, with a Python-based Filter window.
1 parent e71b292 commit 3b9cf82

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

Advanced/geofence/model.xml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<project name="geofence_lua" threads="8" pubsub="auto" heartbeat-interval="1" luaroot="@ESP_PROJECT_OUTPUT@/luaroot">
1+
<project name="geofence" threads="8" pubsub="auto" heartbeat-interval="1" luaroot="@ESP_PROJECT_OUTPUT@/luaroot">
22
<description><![CDATA[This example creates a model that displays a list of wanted vehicles found in close proximity of critical infrastructure sites. The model performs the following actions:
33
44
streams a list of vehicles, including vehicle locations
@@ -7,10 +7,6 @@ streams a list of critical infrastructure sites, including site locations
77
processes the list of vehicles and attempts to match any wanted vehicles that are in close proximity to critical infrastructure sites
88
produces a list of wanted vehicles found in close proximity to critical infrastructure sites]]></description>
99
<metadata>
10-
<meta id="studioUploadedBy">anonymousUser</meta>
11-
<meta id="studioUploaded">1696244939262</meta>
12-
<meta id="studioModifiedBy">anonymousUser</meta>
13-
<meta id="studioModified">1696245968466</meta>
1410
<meta id="layout">{"cq1":{"ANPR":{"x":330,"y":50},"CriticalInfrastructure":{"x":610,"y":420},"Geofence":{"x":470,"y":295},"GeofenceMatches":{"x":330,"y":420},"VehicleWatchlist":{"x":50,"y":295},"WantedVehicleMatch":{"x":330,"y":175}}}</meta>
1511
<meta id="studioTags">Example</meta>
1612
</metadata>
@@ -114,9 +110,8 @@ produces a list of wanted vehicles found in close proximity to critical infrastr
114110
<window-filter pubsub="true" name="GeofenceMatches">
115111
<description><![CDATA[The GeofenceMatches window is a Filter window. This is where matches with null values are filtered out.]]></description>
116112
<use><![CDATA[geoid]]></use>
117-
<code><![CDATA[function filter(data)
118-
return data.geoid ~= nil
119-
end]]></code>
113+
<code><![CDATA[def filter(event,context):
114+
return "geoid" in event and event["geoid"] is not None]]></code>
120115
<connectors>
121116
<connector class="fs" name="sub">
122117
<properties>
@@ -159,4 +154,4 @@ end]]></code>
159154
<edge source="pub2" target="pub3"/>
160155
</edges>
161156
</project-connectors>
162-
</project>
157+
</project>

0 commit comments

Comments
 (0)