Add artmap polling to discover sACN unicast receivers
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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()]);
|
||||
|
||||
Reference in New Issue
Block a user