private void FindValueFlowTargets(CyPhy.ValueFlowTarget start, List <CyPhy.CADParameter> vftFound, List <CyPhy.ValueFlowTarget> vftVisited) { IEnumerable <CyPhy.ValueFlowTarget> ends; vftVisited.Add(start); ends = start .DstConnections .ValueFlowCollection .Select(x => x.DstEnds.ValueFlowTarget) .Concat( start .SrcConnections .ValueFlowCollection .Select(x => x.SrcEnds.ValueFlowTarget)) .Where(x => vftVisited.Any(y => y.ID == x.ID) == false); foreach (var vftEnd in ends) { if (vftEnd.DstConnections.CADParameterPortMapCollection.Any()) { vftFound.AddRange(vftEnd .DstConnections .CADParameterPortMapCollection .Select(x => x.DstEnds.CADParameter) .Where(x => vftFound.Any(y => y.ID == x.ID) == false)); } FindValueFlowTargets(vftEnd, vftFound, vftVisited); } }
private static string GetOrSetID(CyPhy.ValueFlowTarget vft) { var id = GetIdAttribute(vft); if (string.IsNullOrWhiteSpace(id)) { id = vft.Guid.ToString("D"); SetIdAttributeString(vft, id); } return(id); }
public void TraverseValueFlow(CyPhyML.ValueFlowTarget vft) { if (!Traversed.Contains(vft.ID)) { Traversed.Add(vft.ID); foreach (var conn in vft.SrcConnections.ValueFlowCollection) { TraverseValueFlow(conn.SrcEnds.ValueFlowTarget); } foreach (var conn in vft.DstConnections.ValueFlowCollection) { TraverseValueFlow(conn.DstEnds.ValueFlowTarget); } foreach (var conn in vft.DstConnections.CADParameterPortMapCollection) { Found.Add(conn.DstEnds.CADParameter); } } }