예제 #1
0
        public void GetWeatherExcel(string file)
        {
            ExcelController excelController = new ExcelController();
            List <Weather>  weathers        = excelController.GetWeathers(file + ".xlsx");

            BinaryController.WriteDataToBinary(file, weathers);
        }
 public void Work()
 {
     StatusProgressBar.Value = 1;
     foreach (var weatherFile in _weatherFiles)
     {
         _convertController.GetWeatherExcel(weatherFile);
         StatusProgressBar.Value += 100 / 13;
     }
     WeatherController = new WeatherController(_weatherFiles);
     var sunConditions = _convertController.GetSunConditionsFromExcel(_sunFile);
     SunConditionController = new SunConditionController(sunConditions, WeatherController.Year);
     BinaryController.WriteDataToBinary(_sunFile, SunConditionController.SunConditions);
     StatusProgressBar.Value = 100;
     Close();
 }
        private void ChooseData()
        {
            FolderBrowserDialog folderDialog = new FolderBrowserDialog();

            folderDialog.Description  = "Виберіть каталог метеорологічних даних регіону";
            folderDialog.SelectedPath = @"киев+\";
            if (folderDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                string        path  = folderDialog.SelectedPath;
                List <string> files = Directory.GetFiles(path, "*.xlsx").ToList();
                for (int i = 0; i < files.Count; i++)
                {
                    files[i] = files[i].Replace(Directory.GetCurrentDirectory(), ".").Replace(".xlsx", "");
                }
                _sunFile = files.Last(x => x.Contains("soldata"));
                files.Remove(_sunFile);
                files.Sort();
                _weatherFiles = files;
                ConvertProgressBarWindow progressBarWindow = new ConvertProgressBarWindow(_weatherFiles, _sunFile);
                progressBarWindow.Show();
                Pathes pathes = new Pathes
                {
                    SunFile      = _sunFile,
                    WeatherFiles = _weatherFiles
                };
                BinaryController.WriteDataToBinary(_fileSource, new List <Pathes> {
                    pathes
                });
                MeteorogicalAnalysisView.TimePeriodChanged -= Calculate;
                //InitData();
                // Task 1
                _weatherController = new WeatherController(_weatherFiles);
                //_weatherController.CorrectWeather();
                _sunConditionController = new SunConditionController(System.IO.Path.GetFullPath(_sunFile));
                //_sunConditionController.CorrectData(_weatherController.Year);
                MeteorogicalAnalysisView.Init(_weatherController, _sunConditionController);
                Calculate();
                MeteorogicalAnalysisView.TimePeriodChanged += Calculate;
            }
            else
            {
                Close();
            }
        }
예제 #4
0
 public void Save()
 {
     BinaryController.WriteDataToBinary(_fileName, new List <HeatPump> {
         HeatPump
     });
 }
 public static void Save(string fileName, List <DeviceOptimization> list)
 {
     BinaryController.WriteDataToBinary(fileName, list);
 }
예제 #6
0
 public void Save()
 {
     BinaryController.WriteDataToBinary(_fileName, WindGenDes);
 }
 public void Save()
 {
     BinaryController.WriteDataToBinary(_fileName, new List <House> {
         House
     });
 }