Add artmap polling to discover sACN unicast receivers

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Ian Gulliver
2026-01-30 13:03:35 -08:00
parent e3aa25d85f
commit 1618ef1b87
9 changed files with 176 additions and 15 deletions

View File

@@ -131,7 +131,8 @@ export function showFlowView(flowSpec) {
if (protocol === 'sacn') {
if ((node.sacn_outputs || []).includes(universe)) sourceIds.push(node.id);
const groups = node.multicast_groups || [];
if (groups.some(g => g === 'sacn:' + universe)) destIds.push(node.id);
const unicastInputs = node.sacn_unicast_inputs || [];
if (groups.some(g => g === 'sacn:' + universe) || unicastInputs.includes(universe)) destIds.push(node.id);
} else {
if ((node.artnet_outputs || []).includes(universe)) sourceIds.push(node.id);
if ((node.artnet_inputs || []).includes(universe)) destIds.push(node.id);

View File

@@ -210,21 +210,23 @@ export function render(data, config) {
const sacnUniverseInputs = new Map();
const sacnUniverseOutputs = new Map();
function getSacnInputsFromMulticast(node) {
const groups = node.multicast_groups || [];
function getSacnInputs(node) {
const inputs = [];
groups.forEach(g => {
(node.multicast_groups || []).forEach(g => {
if (typeof g === 'string' && g.startsWith('sacn:')) {
const u = parseInt(g.substring(5), 10);
if (!isNaN(u)) inputs.push(u);
}
});
(node.sacn_unicast_inputs || []).forEach(u => {
if (!inputs.includes(u)) inputs.push(u);
});
return inputs;
}
nodes.forEach(node => {
const name = getShortLabel(node);
getSacnInputsFromMulticast(node).forEach(u => {
getSacnInputs(node).forEach(u => {
if (!sacnUniverseInputs.has(u)) sacnUniverseInputs.set(u, []);
sacnUniverseInputs.get(u).push(name);
});
@@ -242,7 +244,7 @@ export function render(data, config) {
nodes.forEach(node => {
const nodeId = node.id;
const sacnInputs = getSacnInputsFromMulticast(node);
const sacnInputs = getSacnInputs(node);
const sacnOutputs = node.sacn_outputs || [];
if (sacnInputs.length === 0 && sacnOutputs.length === 0) return;

View File

@@ -338,6 +338,12 @@ export function renderSacnTable() {
}
}
});
(node.sacn_unicast_inputs || []).forEach(u => {
if (!rxByUniverse.has(u)) rxByUniverse.set(u, []);
if (!rxByUniverse.get(u).includes(name)) {
rxByUniverse.get(u).push(name);
}
});
});
const allUniverses = new Set([...txByUniverse.keys(), ...rxByUniverse.keys()]);