From c5038b79d4bf3c781b695348e7937a0ff2c26c9d Mon Sep 17 00:00:00 2001 From: glax Date: Mon, 29 Jul 2024 01:40:54 +0200 Subject: [PATCH] exportRenderPath only if not benchmark --- Graph_Renderer/Program.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Graph_Renderer/Program.cs b/Graph_Renderer/Program.cs index bb3f61f..5f7f95b 100644 --- a/Graph_Renderer/Program.cs +++ b/Graph_Renderer/Program.cs @@ -28,7 +28,6 @@ Dictionary arguments = af.Fetch(args); if (!arguments.TryGetValue(regionArg, out string[]? regionVal) || !float.TryParse(regionVal[0], NumberFormatInfo.InvariantInfo, out float regionSize) || !arguments.TryGetValue(importPathArg, out string[]? importPathVal) || - !arguments.TryGetValue(exportRenderPathArg, out string[]? exportRenderPath) || !arguments.TryGetValue(routeCoordinateArg, out string[]? routeCoordinateVal) || !float.TryParse(routeCoordinateVal[0], NumberFormatInfo.InvariantInfo, out float startLat) || !float.TryParse(routeCoordinateVal[1], NumberFormatInfo.InvariantInfo, out float startLon) || @@ -40,7 +39,8 @@ if (!arguments.TryGetValue(regionArg, out string[]? regionVal) || Logger logger = new(LogLevel.Information, consoleOut: Console.Out); -if (!arguments.ContainsKey(benchmarkArg)) +string[]? exportRenderPath; +if (!arguments.ContainsKey(benchmarkArg) && arguments.TryGetValue(exportRenderPathArg, out exportRenderPath)) { DateTime start = DateTime.Now; Route r = new Astar().FindPath(startLat, startLon, endLat, endLon, regionSize, true, PathMeasure.Distance, importPathVal[0], logger); @@ -51,7 +51,7 @@ if (!arguments.ContainsKey(benchmarkArg)) logger.LogInformation($"Rendered in {rendered - end:hh\\:mm\\:ss\\.fff}"); logger.LogInformation($"Total {rendered - start:hh\\:mm\\:ss\\.fff}"); } -else +else if(!arguments.TryGetValue(exportRenderPathArg, out exportRenderPath)) { Directory.CreateDirectory(arguments[benchmarkArg][0]); Benchmark.Run(startLat, startLon, endLat, endLon, regionSize, importPathVal[0], arguments[benchmarkArg][0], logger);