this repo has no description
1use crate::{
2 runtime::nodes::RuntimeNode,
3 structs::{nodes::Node, parameter_types::ParameterType},
4};
5
6pub struct Debug {
7 outputs: Vec<Vec<(String, isize, isize)>>,
8 inputs: Vec<Option<(String, isize, isize)>>
9}
10
11impl Debug {
12 pub fn new(node: Node) -> Box<Self> {
13 Box::new(Self {
14 outputs: node.outputs.iter().map(|x| {
15 x.connections.iter()
16 .map(|x| (x.node.clone(), x.index, x.value_type)).collect()}).collect(),
17
18 inputs: node.inputs.iter().map(|x| {
19 let y = x.connections.get(0);
20 if let Some(y) = y{
21 Some((y.node.clone(), y.index, y.value_type))
22 } else{
23 None
24 }
25 }).collect(),
26 })
27 }
28}
29
30impl RuntimeNode for Debug {
31 fn outputs(&self) -> Vec<Vec<(String, isize, isize)>> {
32 self.outputs.clone()
33 }
34
35 fn inputs(&self) -> Vec<Option<(String, isize, isize)>> {
36 self.inputs.clone()
37 }
38
39 fn execute(&mut self, args: Vec<ParameterType>) -> Vec<ParameterType> {
40 dbg!(&args); // TODO: Debug to actual UI instead of console
41 vec![]
42 }
43
44 fn is_entrypoint(&self) -> bool {
45 false
46 }
47}