public static void SaveToDot(StaticFlow sFlow, DynamicFlow dFlow, string filename) { var displayGraph = new QuickGraph.AdjacencyGraph <string, TaggedEdge <string, string> >(); foreach (var vertex in dFlow.Graph.Vertices) { displayGraph.AddVertex(vertex); } foreach (var edge in dFlow.Graph.Edges) { int lineNumber = dFlow.LineNumber(edge.Source); string displayInfo = sFlow.Get_Line_Str(lineNumber) + "\n" + edge.Tag.StateUpdate.ToString2(); displayGraph.AddEdge(new TaggedEdge <string, string>(edge.Source, edge.Target, displayInfo)); } DotVisualizer.Visualize(displayGraph, filename); }
public string Run(GraphvizImageType imageType, string dot, string outputFileName) { string output = outputFileName; File.WriteAllText(output, dot); if (true) { // assumes dot.exe is on the path: var args = string.Format(@"{0} -Tjpg -O", output); var process = System.Diagnostics.Process.Start("dot.exe", args); if (true) { process.WaitForExit(); DotVisualizer.ShowPicture(outputFileName + ".jpg"); } } return(output); }