Example #1
0
        private InputSettings getInputSettings()
        {
            SaveLoadInfo saveLoadInfo = new SaveLoadInfo(tbLoadPath.Text, tbSavePath.Text, (bool)cbOnlyMainInfo.IsChecked);
            Parameters   parameters   = new Parameters(Convert.ToInt32(tbMainStationId.Text), Convert.ToDouble(tbH.Text), Convert.ToDouble(tbHMin.Text),
                                                       Convert.ToDouble(tbAccidentPercent.Text), Convert.ToDouble(tbRepairSectionMinimumLength.Text), Convert.ToDouble(tbAdditionalHeadLoss.Text));
            Pipe pipe = (Pipe)cbPipeMaterial.SelectedItem;

            return(new InputSettings(saveLoadInfo, parameters, pipe));
        }
Example #2
0
 private Task generateResult(Communications communications, SaveLoadInfo saveLoadInfo)
 {
     return(Task.Run(() =>
     {
         IDataReaderWriter data = getDataReaderWriter(saveLoadInfo.pathSave);
         for (int i = 1; i < communications.stations.Count; i++)
         {
             communications.calculateOptimalK(i);
             if (saveLoadInfo.onlyMainInfo == false)
             {
                 data.WriteInFile(saveLoadInfo.pathSave, communications, i, (i == 1) ? true : false);
             }
         }
         data.WriteInFile(saveLoadInfo.pathSave, communications, saveLoadInfo.onlyMainInfo);
     }));
 }
 public InputSettings(SaveLoadInfo saveLoadInfo, Parameters parameters, Pipe pipe)
 {
     this.saveLoadInfo = saveLoadInfo;
     this.parameters   = parameters;
     this.pipe         = pipe;
 }