@parallaxcontrol/node-red-control
Version:
A comprehensive package of Node-RED nodes designed to seamlessly integrate with the Parallax Control Engine, offering enhanced control capabilities for AV Automation.
72 lines (64 loc) • 2.71 kB
HTML
<!--
Copyright (c) 2025 Parallax AV Design Inc.
All rights reserved.
This software is licensed, not sold. You may not copy, modify, merge,
publish, distribute, sublicense, or sell copies of this file or substantial
portions of it except as expressly permitted by the LICENSE file included
with this package. Use is restricted to building manifests for the
Parallax Control Node-RED nodes. See LICENSE for details.
-->
<script type="text/javascript">
RED.nodes.registerType('and-gate', {
category: 'parallax',
color: '#C0C0C0',
defaults: {
name: { value: "" },
numInputs: { value: 2, required: true }
},
inputs: 1,
outputs: 1,
llmNotes: `
Purpose:
- Logical AND gate: outputs true only if all configured inputs are true.
Inputs:
- Accepts msg.payload = {"Input": <int>, "Value": <bool>}.
- Required fields: Input (1-based index), Value (boolean).
- Each Input index (1..numInputs) must provide a Value over time.
Outputs:
- Number of outputs: 1.
- Output labels: ["Output"].
- Emits msg.payload = true|false representing the AND of all inputs.
Usage Rules:
- This node uses "Virtual Inputs" meaning it can accept multiple upstream signals as a single input.
- Always set numInputs to the total number of expected virtual inputs, or upstream signals to combine. For instance, if you are comparing 2 inputs, set numInputs to 2 and connect both upstream signals to this node.
- Downstream: wire this gate to the consumer (e.g., set-feedback).`,
outputLabels: ["Output"],
icon: "arrow-in.svg",
label: function() {
return this.name || "and-gate";
},
labelStyle: function() {
return this.name ? "node_label_italic" : "";
}
});
</script>
<script type="text/html" data-template-name="and-gate">
<!-- Name -->
<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>
<!-- Inputs -->
<div class="form-row">
<label for="node-input-numInputs"><i class="icon-tag"></i> Number of Inputs</label>
<input type="number" id="node-input-numInputs" placeholder="Number of inputs">
</div>
<!-- Node Property Window Notes -->
<div>
<small>Use the input-select node to specify the input to connect to.<br>
Expects: msg.payload of type JSON Object {"Input":1,"Value":true} </small>
</div>
</script>
<script type="text/html" data-help-name="and-gate">
<p>Logic Node: This node acts as an AND gate, outputting true only if all configured inputs are true.</p>
</script>