dockerized_openAger/nodered/rootfs/data/node_modules/node-red-contrib-msg-speed/msg_speed.html

73 lines
3.3 KiB
HTML
Raw Normal View History

2020-10-17 16:42:50 +00:00
<!--
Copyright 2017, Bart Butenaers
Licensed 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.
-->
<script type="text/x-red" data-template-name="msg-speed">
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-frequency"><i class="fa fa-random"></i> Frequency</label>
<select id="node-input-frequency">
<option value="sec">Second</option>
<option value="min">Minute</option>
<option value="hour">Hour</option>
</select>
</div>
<div class="form-row">
<input type="checkbox" id="node-input-estimation" style="display: inline-block; width: auto; vertical-align: top;">
<label for="node-input-estimation" style="width: auto">Estimate speed during startup period</label>
</div>
<div class="form-row">
<input type="checkbox" id="node-input-ignore" style="display: inline-block; width: auto; vertical-align: top;">
<label for="node-input-ignore" style="width: auto">Ignore speed during startup period</label>
</div>
</script>
<script type="text/x-red" data-help-name="msg-speed">
<p>A node to measure the flow message speed.</p>
<p><strong>Frequency</strong></p>
<p>The speed will be measured at the specified frequency.
E.g. frequency 'hour' means that (every second) the average speed of the previous hour will be calculated.</p>
<p><strong>Estimate speed</strong></p>
<p>In case estimation is disabled, the speed will be incorrect during the startup period.
E.g. when every second 1 message arrives, the calculated speed will only be correct after the first minute has passed.
When estimation is enabled, the final speed will be estimated during the startup interval (in this example during the first minute).
This setting is useless when frequency is 'second' (which has no startup period) or when the 'ignore speed' checkbox is selected.</p>
<p><strong>Ignore speed</strong></p>
<p>When speed is ignored during the startup period, no messages will be send to the output port during the startup period.
Moreover, the node status (in the flow editor) will not display the calculated speed.</p>
</script>
<script type="text/javascript">
RED.nodes.registerType("msg-speed", {
category: "performance",
defaults: {
name: {value:""},
frequency: {value:"sec"},
estimation: {value:false},
ignore: {value:false},
},
color:"#e2d96e",
inputs: 1,
outputs: 2,
outputLabels: ["speed","input msg"],
icon: "speed.png",
label: function() {
return this.name || "msg-speed";
},
labelStyle: function() {
return this.name ? "node_label_italic" : "";
},
});
</script>