// Recursively build the firing pattern dependency chains public AbstractFiringPattern NestedFiringPatterns(AbstractFiringPattern firingPattern, XElement xlevel) { if (xlevel == null) { return(null); } foreach (XElement xel in xlevel.Elements("firingpattern")) { //var newFiringPattern = NestedFiringPatterns(firingPattern,); string name = xel.Attribute("type").Value; AbstractFiringPattern newFiringPattern = FiringFactory.Build(name); double start = Double.Parse(xel.Attribute("start").Value); double stop = Double.Parse(xel.Attribute("stop").Value); newFiringPattern.SetTimeWindow(start, stop); if (xel.Element("options") != null) { var options = xel.Element("options"); newFiringPattern.WithOptions(options); newFiringPattern.WithCoreOptions(options); } firingPattern.And(newFiringPattern); // continue on the dependency chain NestedFiringPatterns(newFiringPattern, xel); } return(firingPattern); }
public AbstractFiringPattern Pattern(AbstractFiringPattern fp) { fp.SetName();; fp.SetReferences(fromModel, ref MainContent); fp.SetTimeWindow(start, stop); return(fp.Exec()); }