added connection field to subscribe node

This commit is contained in:
Niko Vujić
2025-12-31 09:52:14 +01:00
parent 38a3d1caf9
commit 608a308b5a
2 changed files with 124 additions and 6 deletions

View File

@@ -5,6 +5,7 @@ RED.nodes.registerType('xilica-subscribe', {
defaults: {
name: { value: "" },
action: { value: "subscribe" },
connection: { value: "", type: "xilica-connection" },
rules: { value: [] },
transport: { value: "TCP" }
},
@@ -120,6 +121,10 @@ RED.nodes.registerType('xilica-subscribe', {
<label for="node-input-name">Name</label>
<input type="text" id="node-input-name">
</div>
<div class="form-row">
<label for="node-input-connection">Connection</label>
<input type="text" id="node-input-connection">
</div>
<div class="form-row">
<label for="node-input-action">Action</label>
<select id="node-input-action">
@@ -142,13 +147,13 @@ RED.nodes.registerType('xilica-subscribe', {
<script type="text/x-red" data-help-name="xilica-subscribe">
<p>Builds <code>SUBSCRIBE</code> or <code>UNSUBSCRIBE</code> commands for a Xilica Solaro processor.</p>
<p>On each input message, the node sets <code>msg.payload</code> to one or more commands separated by carriage returns. Wire the output into a <code>xilica-command</code> node to send them over TCP.</p>
<p>On each input message, the node builds the commands and sends them directly to the selected <code>xilica-connection</code>. It then outputs a message with the commands that were sent.</p>
<p><strong>Action</strong> selects whether to generate <code>SUBSCRIBE</code> or <code>UNSUBSCRIBE</code> commands.</p>
<p><strong>Rules</strong> define which control names to generate, similar to the Switch node's rule list:</p>
<ul>
<li><strong>Type ==</strong>: the Value field is used as a full control name (e.g. <code>MASTER_GAIN</code>).</li>
<li><strong>Type Indexed</strong>: the Value field is a base string (e.g. <code>CH</code>), and the From/To fields define a numeric range (e.g. 148 <code>CH1</code><code>CH48</code>).</li>
</ul>
<p><strong>Transport</strong> selects the subscription transport (<code>TCP</code> or <code>UDP</code>). The node generates commands like <code>SUBSCRIBE CH1 "TCP"</code> or <code>SUBSCRIBE CH1 "UDP"</code>.</p>
<p>The actual Xilica device connection (IP/port/password) is chosen by the <code>xilica-command</code> node that this node is wired into, via its <code>xilica-connection</code> config.</p>
<p><strong>Transport</strong> selects the subscription transport (<code>TCP</code> or <code>UDP</code>). The node generates commands like <code>SUBSCRIBE CH1 "TCP"</code> or <code>SUBSCRIBE CH1 "UDP"</code> and sends them over the selected connection.</p>
<p>The Xilica device connection (IP/port/password) is chosen directly on this node via the <strong>Connection</strong> field.</p>
</script>