mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
Debug & tidy up
Make the colours the same as the RPi equivalents. Remove ‘BBB’ from the node names. Further debug output
This commit is contained in:
@@ -14,8 +14,7 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<!-- First, the content of the edit dialog is defined. -->
|
||||
|
||||
<!-- Define the edit dialog -->
|
||||
<script type="text/x-red" data-template-name="discrete-in">
|
||||
<div class="form-row">
|
||||
<label for="node-input-pin"><i class="icon-asterisk"></i>Input pin</label>
|
||||
@@ -66,9 +65,6 @@
|
||||
<label for="node-input-topic"><i class="icon-tasks"></i> Topic</label>
|
||||
<input type="text" id="node-input-topic" placeholder="Topic">
|
||||
</div>
|
||||
|
||||
<!-- By convention, most nodes have a 'name' property. The following div -->
|
||||
<!-- provides the necessary field. -->
|
||||
<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">
|
||||
@@ -76,38 +72,42 @@
|
||||
</script>
|
||||
|
||||
|
||||
<!-- Next, some simple help text is provided for the node. -->
|
||||
<!-- Add help text -->
|
||||
<script type="text/x-red" data-help-name="discrete-in">
|
||||
<p>Discrete input for the Beaglebone Black. Sends a message on the first output
|
||||
each time the pin changes state, and records the total time in the active state</p>
|
||||
<p>A timer updates the total active time, sending a message on the second output
|
||||
at the chosen update interval.
|
||||
Any input message will reset the total active time</p><p>The active
|
||||
state may be set to be high or low: this only affects the active time, not the
|
||||
value read from the pin and sent on the first output</p>
|
||||
<p>
|
||||
Discrete input for the Beaglebone Black. Sends a message on the first output
|
||||
each time the pin changes state, and records the total time in the active state
|
||||
</p>
|
||||
<p>
|
||||
A timer updates the total active time, sending a message on the second output
|
||||
at the chosen update interval. Any input message will reset the total active time
|
||||
</p>
|
||||
<p>
|
||||
The active state may be set to be high or low: this only affects the calculation
|
||||
of the active time, not the pin state sent on the first output
|
||||
</p>
|
||||
</script>
|
||||
|
||||
<!-- Finally, the node type is registered along with all of its properties -->
|
||||
<!-- The example below shows a small subset of the properties that can be set-->
|
||||
<!-- Register the node -->
|
||||
<script type="text/javascript">
|
||||
RED.nodes.registerType('discrete-in',{
|
||||
category: 'advanced-input', // the palette category
|
||||
color:"#c6baef",
|
||||
defaults: { // defines the editable properties of the node
|
||||
name: { value:"" }, // along with default values.
|
||||
updateInterval: { value:30 },
|
||||
RED.nodes.registerType('discrete-in', {
|
||||
category: 'advanced-input', // the palette category
|
||||
color:"#c6dbef",
|
||||
defaults: { // defines the editable properties of the node
|
||||
name: { value:"" }, // along with default values.
|
||||
updateInterval: { value:60 },
|
||||
topic: { value:"", required:true },
|
||||
pin: { value:"", required:true },
|
||||
activeLow: { value:false, required:true}
|
||||
},
|
||||
inputs:1, // set the number of inputs - only 0 or 1
|
||||
outputs:2, // set the number of outputs - 0 to n
|
||||
icon: "arrow-in.png", // set the icon (held in public/icons)
|
||||
label: function() { // sets the default label contents
|
||||
inputs:1, // set the number of inputs - only 0 or 1
|
||||
outputs:2, // set the number of outputs - 0 to n
|
||||
icon: "arrow-in.png", // set the icon (held in public/icons)
|
||||
label: function() { // sets the default label contents
|
||||
return this.name || "discrete-in: " + this.pin;
|
||||
},
|
||||
labelStyle: function() { // sets the class to apply to the label
|
||||
return this.name?"node_label_italic":"";
|
||||
labelStyle: function() { // sets the class to apply to the label
|
||||
return this.name ? "node_label_italic" : "";
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user