Use artmap sender IPs for ArtNet flow association
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
22
artmap.go
22
artmap.go
@@ -93,23 +93,22 @@ func (t *Tendrils) processArtmapConfig(cfg *artmapConfig, artmapNode *Node) {
|
|||||||
updated = true
|
updated = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Targets are destinations that receive ArtNet/sACN from artmap.
|
||||||
|
// They have artnet_outputs (output to DMX, input from network).
|
||||||
for _, target := range cfg.Targets {
|
for _, target := range cfg.Targets {
|
||||||
ip := parseTargetIP(target.Address)
|
ip := parseTargetIP(target.Address)
|
||||||
if ip == nil {
|
if ip == nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
node := t.nodes.GetByIP(ip)
|
node := t.nodes.Update(nil, nil, []net.IP{ip}, "", "", "artmap")
|
||||||
if node == nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
universe := int(target.Universe.Number)
|
universe := int(target.Universe.Number)
|
||||||
switch target.Universe.Protocol {
|
switch target.Universe.Protocol {
|
||||||
case "artnet":
|
case "artnet":
|
||||||
t.nodes.UpdateArtNet(node, []int{universe}, nil)
|
t.nodes.UpdateArtNet(node, nil, []int{universe})
|
||||||
if t.DebugArtmap {
|
if t.DebugArtmap {
|
||||||
log.Printf("[artmap] marked %s (%s) as artnet input for universe %d", node.DisplayName(), ip, universe)
|
log.Printf("[artmap] marked %s (%s) as artnet output for universe %d", node.DisplayName(), ip, universe)
|
||||||
}
|
}
|
||||||
case "sacn":
|
case "sacn":
|
||||||
t.nodes.UpdateSACNUnicastInputs(node, []int{universe})
|
t.nodes.UpdateSACNUnicastInputs(node, []int{universe})
|
||||||
@@ -122,23 +121,22 @@ func (t *Tendrils) processArtmapConfig(cfg *artmapConfig, artmapNode *Node) {
|
|||||||
updated = true
|
updated = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Senders are sources that send ArtNet/sACN to artmap.
|
||||||
|
// They have artnet_inputs (input from DMX, output to network).
|
||||||
for _, sender := range cfg.Senders {
|
for _, sender := range cfg.Senders {
|
||||||
ip := net.ParseIP(sender.IP)
|
ip := net.ParseIP(sender.IP)
|
||||||
if ip == nil {
|
if ip == nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
node := t.nodes.GetByIP(ip)
|
node := t.nodes.Update(nil, nil, []net.IP{ip}, "", "", "artmap")
|
||||||
if node == nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
universe := int(sender.Universe.Number)
|
universe := int(sender.Universe.Number)
|
||||||
switch sender.Universe.Protocol {
|
switch sender.Universe.Protocol {
|
||||||
case "artnet":
|
case "artnet":
|
||||||
t.nodes.UpdateArtNet(node, nil, []int{universe})
|
t.nodes.UpdateArtNet(node, []int{universe}, nil)
|
||||||
if t.DebugArtmap {
|
if t.DebugArtmap {
|
||||||
log.Printf("[artmap] marked %s (%s) as artnet output for universe %d", node.DisplayName(), ip, universe)
|
log.Printf("[artmap] marked %s (%s) as artnet input for universe %d", node.DisplayName(), ip, universe)
|
||||||
}
|
}
|
||||||
case "sacn":
|
case "sacn":
|
||||||
t.nodes.UpdateSACN(node, []int{universe})
|
t.nodes.UpdateSACN(node, []int{universe})
|
||||||
|
|||||||
@@ -137,8 +137,10 @@ export function showFlowView(flowSpec) {
|
|||||||
const unicastInputs = node.sacn_unicast_inputs || [];
|
const unicastInputs = node.sacn_unicast_inputs || [];
|
||||||
if (groups.some(g => g === 'sacn:' + universe) || unicastInputs.includes(universe)) destIds.push(node.id);
|
if (groups.some(g => g === 'sacn:' + universe) || unicastInputs.includes(universe)) destIds.push(node.id);
|
||||||
} else {
|
} else {
|
||||||
if ((node.artnet_outputs || []).includes(universe)) sourceIds.push(node.id);
|
// artnet_inputs = sources (input from DMX, send to network)
|
||||||
if ((node.artnet_inputs || []).includes(universe)) destIds.push(node.id);
|
// artnet_outputs = destinations (output to DMX, receive from network)
|
||||||
|
if ((node.artnet_inputs || []).includes(universe)) sourceIds.push(node.id);
|
||||||
|
if ((node.artnet_outputs || []).includes(universe)) destIds.push(node.id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (sourceIdent) {
|
if (sourceIdent) {
|
||||||
|
|||||||
Reference in New Issue
Block a user