private void RunInterpreterMainSchematic( string outputdirname, string testBenchPath, CyPhy2Schematic.CyPhy2Schematic_Settings config = null) { if (Directory.Exists(outputdirname)) { Directory.Delete(outputdirname, true); } Directory.CreateDirectory(outputdirname); Assert.True(Directory.Exists(outputdirname), "Output directory wasn't created for some reason."); MgaFCO testObj = null; project.PerformInTransaction(delegate { testObj = project.ObjectByPath[testBenchPath] as MgaFCO; }); var interpreter = new CyPhy2Schematic.CyPhy2SchematicInterpreter(); interpreter.Initialize(project); var mainParameters = new CyPhyGUIs.InterpreterMainParameters() { config = (config == null) ? new CyPhy2Schematic.CyPhy2Schematic_Settings() { doPlaceRoute = "true" } : config, Project = project, CurrentFCO = testObj, SelectedFCOs = (MgaFCOs)Activator.CreateInstance(Type.GetTypeFromProgID("Mga.MgaFCOs")), StartModeParam = 128, ConsoleMessages = false, ProjectDirectory = project.GetRootDirectoryPath(), OutputDirectory = outputdirname }; var result = interpreter.Main(mainParameters); interpreter.DisposeLogger(); Assert.True(result.Success, "Interpreter run was unsuccessful"); }
public CyPhyGUIs.IInterpreterResult RunInterpreterMainAndReturnResult(string outputdirname, string testBenchPath, CyPhy2Schematic.CyPhy2Schematic_Settings config = null) { if (Directory.Exists(outputdirname)) { foreach (string filename in Directory.GetFiles(outputdirname, "*", SearchOption.AllDirectories)) { File.Delete(Path.Combine(outputdirname, filename)); } } Directory.CreateDirectory(outputdirname); Assert.True(Directory.Exists(outputdirname), "Output directory wasn't created for some reason."); CyPhyGUIs.IInterpreterResult result = null; project.PerformInTransaction(delegate { MgaFCO testObj = null; testObj = project.ObjectByPath[testBenchPath] as MgaFCO; Assert.NotNull(testObj); var interpreter = new CyPhy2Schematic.CyPhy2SchematicInterpreter(); interpreter.Initialize(project); var mainParameters = new CyPhyGUIs.InterpreterMainParameters() { config = (config == null) ? new CyPhy2Schematic.CyPhy2Schematic_Settings() { Verbose = false } : config, Project = project, CurrentFCO = testObj, SelectedFCOs = (MgaFCOs)Activator.CreateInstance(Type.GetTypeFromProgID("Mga.MgaFCOs")), StartModeParam = 128, ConsoleMessages = false, ProjectDirectory = project.GetRootDirectoryPath(), OutputDirectory = outputdirname }; result = interpreter.Main(mainParameters); interpreter.DisposeLogger(); }, abort: true); return(result); }