diff --git a/copper/src/config.rs b/copper/src/config.rs index 6b091f36e..b76215f35 100644 --- a/copper/src/config.rs +++ b/copper/src/config.rs @@ -1,20 +1,17 @@ use std::collections::HashMap; -use std::iter::Map; -use std::path::Iter; use petgraph::dot::Config as PetConfig; use petgraph::dot::Dot; -use petgraph::graph::NodeIndex; -use petgraph::stable_graph::{NodeIndices, StableDiGraph}; +use petgraph::stable_graph::StableDiGraph; use ron::extensions::Extensions; -use ron::value::Value as RonValue; use ron::Options; +use ron::value::Value as RonValue; use serde::{Deserialize, Serialize}; use uom::si::rational::Time; use uom::si::time::nanosecond; pub type ConfigNodeId = u32; -pub type NodeConfig = HashMap; +pub type NodeInstanceConfig = HashMap; #[derive(Serialize, Deserialize, Debug, Clone)] pub struct Value(RonValue); @@ -82,7 +79,7 @@ pub struct ConfigNode { #[serde(skip_serializing_if = "Option::is_none")] base_period_ns: Option, #[serde(skip_serializing_if = "Option::is_none")] - instance_config: Option, + instance_config: Option, } impl ConfigNode { @@ -105,6 +102,10 @@ impl ConfigNode { self.type_name.as_ref().unwrap() } + pub fn get_instance_config(&self) -> Option<&NodeInstanceConfig> { + self.instance_config.as_ref() + } + #[allow(dead_code)] pub fn base_period(&self) -> Option