-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsignalk-geofence.html
89 lines (83 loc) · 3.39 KB
/
signalk-geofence.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<script type="text/javascript">
RED.nodes.registerType('signalk-geofence',{
category: 'Signal K',
color: '#ffcc01',
defaults: {
name: {value:""},
mode: {value:"sendAll"},
context: {value: "vessels.self"},
period: {value: 10000},
myposition: { value: false },
lat: {value: 0},
lon: {value: 0},
distance: { value: 10 }
},
inputs:1,
inputLabels: [ 'lat/lon/distance' ],
outputs:3,
outputLabels: [ 'inside fence', 'outside fence', 'either' ],
icon: "bridge.png",
label: function() {
return this.name||"signalk-geofence";
},
paletteLabel: 'geofence'
});
</script>
<script type="text/x-red" data-template-name="signalk-geofence">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-mode"><i class="icon-tag"></i> Mode</label>
<select id="node-input-mode" placeholder="Mode">
<option value="sendAll">send all messages</option>
<option value="sendChanges">send when value changes</option>
<option value="sendChangesIgnore">send when value changes (ignoring initial value)</option>
</select>
</div>
<div class="form-row">
<label for="node-input-context"><i class="icon-tag"></i> Context</label>
<input type="text" id="node-input-context" placeholder="Context">
</div>
<div class="form-row">
<label for="node-input-period"><i class="icon-tag"></i> Period (ms)</label>
<input type="text" id="node-input-period" placeholder="Period">
</div>
<div class="form-row">
<label for="node-input-myposition"><i class="icon-tag"></i> Use My Position</label>
<input type="checkbox" id="node-input-myposition" placeholder="Use My Position">
</div>
<div class="form-row">
<label for="node-input-lat"><i class="icon-tag"></i> Latitude</label>
<input type="text" id="node-input-lat" placeholder="Latitude">
</div>
<div class="form-row">
<label for="node-input-lon"><i class="icon-tag"></i> Longitude</label>
<input type="text" id="node-input-lon" placeholder="Longitude">
</div>
<div class="form-row">
<label for="node-input-distance"><i class="icon-tag"></i> Distance (m)</label>
<input type="text" id="node-input-distance" placeholder="Distance">
</div>
</script>
<script type="text/x-red" data-help-name="signalk-geofence">
<p>Input that checks if a vessel is inside of the specified geofence</p>
<h3>Outputs</h3>
<dl class="message-properties">
<dt>payload</dt>
<dd>Contains 'inside' or 'outside'</dd>
</dl>
<h3>Details</h3>
<p><code>Period</code> specifies how often to check the position</p>
<p><code>Use My Position</code> If checked, the Latitude and Longitude setting is ignored and instead the vessel.self position is used. Use this if specifying the context of another vessel and you want the fence to be around the other vessel. It will then fire 'inside' when you're near that vessel.</p>
<p><code>Latitude and Longitude</code> specifies the center of the geofence</p>
<p><code>Distance</code> The radius of te geofence in meters.
<p>The input payload can be json containing lat, lon, and distance. Distance is optional. </p>
<pre><code class="javascript">{
"latitude": 72.1213,
"longitude": 39.23232,
"distance": 10
}
</code></pre>
</script>