private PGradientAndPressures SendWellsForGradient(PGradient gradient) { WellsList wellsList = _gvm.wellsList; GradientAndWellsList <PGradient> gradientAndWellsList = new GradientAndWellsList <PGradient> { Gradient = gradient, WellsList = wellsList, }; PGradientAndPressures pGradientAndPressures = Functions.PGradientMethod(gradientAndWellsList); return(pGradientAndPressures); }
public override void Execute(object parameter) { var parameters = (object[])parameter; PGradient g = new PGradient(); if (!_gvm.IsFirstTimeGradientClicked) { var lastGrad = _gvm.PGradientAndPressures?.LastOrDefault()?.Grad; if (lastGrad is not null) { lastGrad.Lambda = Convert.ToDouble(parameters[0]); lastGrad.ChangedK = Convert.ToDouble(parameters[1]) * Math.Pow(10.0, -15); lastGrad.ChangedKappa = Convert.ToDouble(parameters[2]) * (1.0 / 3600.0); lastGrad.ChangedKsi = Convert.ToDouble(parameters[3]); lastGrad.ChangedP0 = Convert.ToDouble(parameters[4]) * Math.Pow(10.0, 6); FillDeltas(parameters, lastGrad); lastGrad.UsedK = (bool?)parameters[9]; lastGrad.UsedKappa = (bool?)parameters[10]; lastGrad.UsedKsi = (bool?)parameters[11]; lastGrad.UsedP0 = (bool?)parameters[12]; g = lastGrad; _gvm.IsFirstTimeGradientClicked = true; } } else { g = _gvm.PGradientAndPressures.Last().Grad; g.Lambda = Convert.ToDouble(parameters[0]); FillDeltas(parameters, g); } PGradientAndPressures pGradientAndPressures = SendWellsForGradient(g); if (pGradientAndPressures.ValuesAndTimes != null) { _gvm.PGradientAndPressures.Add(pGradientAndPressures); _gvm.Gradients.Add(pGradientAndPressures.Grad); _gvm.SelectedGradient = _gvm.PGradientAndPressures.Last().Grad; } }