From ccaafba2e1205adaf6d14d5f68c474e2dc7e453f Mon Sep 17 00:00:00 2001 From: Udo Eisenbarth <u.eisenbarth@gsi.de> Date: Fri, 23 Jun 2023 13:37:46 +0200 Subject: [PATCH] Add missing ref nodes in PA_doublepass example. --- examples/pa_doublepass_graph.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/examples/pa_doublepass_graph.rs b/examples/pa_doublepass_graph.rs index 00185e2b..e82af342 100644 --- a/examples/pa_doublepass_graph.rs +++ b/examples/pa_doublepass_graph.rs @@ -18,21 +18,22 @@ fn main() { node.set_inverted(true); let n1r=scenery.add_node(node); - - let mut node = OpticNode::new("Faraday", NodeDummy); + let ref_node= NodeReference::new(scenery.node_ref(n3).unwrap()); + let mut node = OpticNode::new("Ref", ref_node); node.set_inverted(true); - let n3i = scenery.add_node(node); + let n3r = scenery.add_node(node); - let mut node = OpticNode::new("19mm amp", NodeDummy); + let ref_node= NodeReference::new(scenery.node_ref(n2).unwrap()); + let mut node = OpticNode::new("Ref", ref_node); node.set_inverted(true); - let n2i = scenery.add_node(node); + let n2r = scenery.add_node(node); scenery.connect_nodes(n1, "rear", n2, "front").unwrap(); scenery.connect_nodes(n2, "rear", n3, "front").unwrap(); scenery.connect_nodes(n3, "rear", n4, "front").unwrap(); - scenery.connect_nodes(n4, "rear", n3i, "rear").unwrap(); - scenery.connect_nodes(n3i, "front", n2i, "rear").unwrap(); - scenery.connect_nodes(n2i, "front", n1r, "rear").unwrap(); + scenery.connect_nodes(n4, "rear", n3r, "rear").unwrap(); + scenery.connect_nodes(n3r, "front", n2r, "rear").unwrap(); + scenery.connect_nodes(n2r, "front", n1r, "rear").unwrap(); let mut group = NodeGroup::new(); let g_n1 = group.add_node(OpticNode::new("Beamsplitter", NodeDummy)); -- GitLab