Exemplo n.º 1
0
        internal void HighlightRoute(IEnumerable <TestPath> solution)
        {
            var colorDict = new Dictionary <string, string> {
                { "color", "green" }
            };

            foreach (var path in solution)
            {
                pathsGraph.Add(path.GetName(), colorDict);
            }
        }
Exemplo n.º 2
0
        private void addToGraph(TestRoute mR0, GraphViz graph, GraphViz pathsGraph)
        {
            graph.Add(mR0.GetName());
            graph.SetGroup("level" + mR0.Level, mR0.GetName());
            foreach (TestRoute next in mR0.NextRoutes)
            {
                graph.Connect(mR0.GetName(), next.GetName());
                addToGraph(next, graph, pathsGraph);
            }

            foreach (TestPath path in mR0.Paths)
            {
                pathsGraph.SetGroup(mR0.GetName(), path.GetName());
                var left = path.LeftParralel as TestPath;
                if (left != null)
                {
                    pathsGraph.Connect(path.GetName(), left.GetName());
                }
                var right = path.RightParralel as TestPath;
                if (right != null)
                {
                    pathsGraph.Connect(path.GetName(), right.GetName());
                }
                foreach (TestPath next in path.NextPaths)
                {
                    pathsGraph.Connect(path.GetName(), next.GetName(), new Dictionary <string, string>()
                    {
                        { "style", "bold" }
                    });

                    left = next.LeftParralel as TestPath;
                    if (left != null)
                    {
                        pathsGraph.Connect(path.GetName(), left.GetName(), new Dictionary <string, string>()
                        {
                            { "style", "dotted" }
                        }, overwrite: false);
                    }
                    right = next.RightParralel as TestPath;
                    if (right != null)
                    {
                        pathsGraph.Connect(path.GetName(), right.GetName(), new Dictionary <string, string>()
                        {
                            { "style", "dotted" }
                        }, overwrite: false);
                    }
                }
            }
        }
Exemplo n.º 3
0
        internal void HighlightRoute(IEnumerable <TestRoute> array)
        {
            var colorDict = new Dictionary <string, string> {
                { "color", "red" }
            };
            TestRoute prev = null;

            foreach (TestRoute item in array)
            {
                routesGraph.Add(item.GetName(), colorDict);
                pathsGraph.GroupDetails(item.GetName(), colorDict);
                if (prev != null)
                {
                    routesGraph.Connect(prev.GetName(), item.GetName(), colorDict);
                }
                prev = item;
            }
        }