public void PrepareRunProcessNode(RunProcessNodeControl node, Experiment experiment) { experiment.Then(CreateExperimentNode(node)); }
public void PrepareAlgorithmNode(AlgorithmNodeControl node, Experiment experiment) { DataTable algParams = node.ParamsTable.Copy(); foreach (DataRow row in algParams.Rows) { if (node.VarLoop.Keys.Contains(row["Name"].ToString())) row["Value"] = node.VarLoop[row["Name"].ToString()].RunValue; } if (string.IsNullOrEmpty(node.InitPath)) { experiment.Then(hydrologyCore.Algorithm(node.AlgorithmType.Name).SetParams(algParams)); } else { if (Directory.Exists(node.InitPath)) { experiment.Then(hydrologyCore.Algorithm(node.AlgorithmType.Name).InitFromFolder(node.InitPath).SetParams(algParams)); } else { MessageBox.Show(string.Format("Путь {0}, указанный для алгоритма {1} не существует", node.InitPath, node.AlgorithmType.Name), "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error); return; } } }
public void PrepareExperiment(BackgroundWorker worker, DoWorkEventArgs e) { experiment = new Experiment(); var chain = experimentGraph.CreateExecutionChain(); double percentInc = 100.0 / chain.Count; percent += percentInc / 2; worker.ReportProgress((int)percent); for (int i = 0; i < chain.Count; i++) { if (chain[i] is InitNodeControl) PrepareInitNode(chain[i] as InitNodeControl, experiment); else experiment.Then(CreateExperimentNode(chain[i])); if (worker.CancellationPending == true) { e.Cancel = true; return; } percent += percentInc; worker.ReportProgress((int)percent); } }