private void InvokeOpenInitDialog() { var result = _windowDialogService.ShowDialog("", InitDialogViewModel); if (result == null || !result.Value) { return; } // обработка полученных путей var adjacencyMatrix = DataLoaderService.LoadAdjacencyMatrix(InitDialogViewModel.AdjacencyMatrixFilePath); _network.AdjacencyMatrix = adjacencyMatrix; double[,] direcTravelersMatrix; if (InitDialogViewModel.HasDirectTravelersMatrix) { direcTravelersMatrix = DataLoaderService.LoadDirectTravelersMatrix(InitDialogViewModel.DirectTravelersMatrixFilePath); } else { var arrivals = DataLoaderService.LoadArrivals(InitDialogViewModel.ArrivalsFilePath); var departures = DataLoaderService.LoadDepartures(InitDialogViewModel.DeparturesFilePath); direcTravelersMatrix = Algorithms.FindCorrespMatrix(adjacencyMatrix, arrivals, departures); } _network.DirectTravelersMatrix = direcTravelersMatrix; DataLoaderService.LoadNodesAtrributes(InitDialogViewModel.NodesPositionsFilePath); }
private void LoadAdjacencyMatrixFile(string path) { _dataSource.AdjacencyMatrixFilePath = path; _dataSource.AdjacencyMatrix = DataLoaderService.LoadAdjacencyMatrix(path); IsAdjacencyMatrixCorrect = true; }