-
Notifications
You must be signed in to change notification settings - Fork 2
/
signalk-geofence-switch.html
74 lines (68 loc) · 2.75 KB
/
signalk-geofence-switch.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
<script type="text/javascript">
RED.nodes.registerType('signalk-geofence-switch',{
category: 'Signal K',
color: '#ffcc01',
defaults: {
name: {value:""},
context: {value: "vessels.self"},
myposition: { value: false },
lat: {value: 0},
lon: {value: 0},
distance: { value: 10 }
},
inputs:1,
outputs:2,
outputLabels: [ 'inside fence', 'outside fence' ],
icon: "function.png",
label: function() {
return this.name||"signalk-geofence-switch";
},
paletteLabel: 'geofence switch'
});
</script>
<script type="text/x-red" data-template-name="signalk-geofence-switch">
<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-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-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-switch">
<p>Function that checks if a vessel is inside of the specified geofence</p>
<h3>Outputs</h3>
<dl class="message-properties">
<dt>payload</dt>
<dd>Contains the input payload</dd>
</dl>
<h3>Details</h3>
<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>If the input topic is "signalk-config", then the 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>
</code></pre>
</script>