//TODO: Сделать асинхронное чтение //TODO: Сделать окно с сообщением о загрузке /// <summary> /// Событие клика на начальную кнопку /// </summary> private void OpenFile() { ReadFileResult readFileResult = OpenAndReadFile(); if (!readFileResult.IsSuccess) { MessageBox.Show(readFileResult.ErrorMessage); return; } CreateStatisticResult statisticResult = CreateStatisticResult.GetStatistic( readFileResult.MeasureDates, readFileResult.MeasureWindTypes, readFileResult.FirstInformationRow, readFileResult.SecondInformationRow, readFileResult.ThirdInformationRow); //TODO: Проверить на нормальность использования string заместо WindTypes IList <string> windTypes = statisticResult.FileInformation.WindTypes.Select(_ => _.ToString()).ToList(); IList <double> windChanges = WindChange.GetWindChangesValues(statisticResult.FileInformation.WindChanges); _mainWindowViewModel.AnalyzeCenterPage = new AnalyzeCenterPage(windTypes, windChanges); _mainWindowViewModel.CurrentCenterPage = _mainWindowViewModel.AnalyzeCenterPage; _mainWindowViewModel.MenuRightPage = new MenuRightPage(statisticResult.FileInformation.FileInformationLabels); _mainWindowViewModel.CurrentRightPage = _mainWindowViewModel.MenuRightPage; _mainWindowViewModel.PeriodsLeftPage = new PeriodsLeftPage(statisticResult.FileInformation, statisticResult.PeriodInformations); _mainWindowViewModel.CurrentLeftPage = _mainWindowViewModel.PeriodsLeftPage; }
private void OpenFile() { ReadFileResult readResult = GetReadResult(); if (!readResult.IsSuccess) { MessageBox.Show(readResult.ErrorMessage); return; } CreateStatisticResult statisticResult = CreateStatisticResult.GetStatistic( readResult.MeasureDates, readResult.MeasureWindTypes, readResult.FirstInformationRow, readResult.SecondInformationRow, readResult.ThirdInformationRow); IList <string> windTypes = statisticResult.FileInformation.WindTypes.Select(_ => _.ToString()).ToList(); IList <double> windChanges = WindChange.GetWindChangesValues(statisticResult.FileInformation.WindChanges); MainWindowViewModel mainViewModel = MainWindowViewModel.GetInstance(); mainViewModel.AnalyzeCenterPage.SetWindHeaders(windTypes); mainViewModel.AnalyzeCenterPage.SetWindValues(windChanges); mainViewModel.PeriodsLeftPage.SetInformations(fileInformation: statisticResult.FileInformation, periodInformation: statisticResult.PeriodInformations); }