Newer
Older
use crate::optic_node::{Dottable, OpticNode, Optical};
/// A virtual component referring to another existing component. This node type is necessary in order to model resonators (loops) or double-pass systems.
pub struct NodeReference {
pub fn from_node(node: Rc<RefCell<OpticNode>>) -> OpticNode {
let node_ref = Self {
reference: Rc::downgrade(&node),
};
OpticNode::new(&format!("Ref: \"{}\"", &node.borrow().name()), node_ref)
impl Optical for NodeReference {
fn node_type(&self) -> &str {
"reference"
}
self.reference.upgrade().unwrap().borrow().ports().clone()
impl Dottable for NodeReference {
fn node_color(&self) -> &str {
"lightsalmon3"