exportRenderPath only if not benchmark

This commit is contained in:
glax 2024-07-29 01:40:54 +02:00
parent adc91c1edc
commit c5038b79d4

View File

@ -28,7 +28,6 @@ Dictionary<Argument, string[]> 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);