private void Open_with_step_Click(object sender, RoutedEventArgs e) { int steps = 0; StepSetup stepSetup = new StepSetup(); bool? result = stepSetup.ShowDialog(); if (result == true) { steps = Int32.Parse(stepSetup.StepTB.Text); LogTB.Text += ($"{DateTime.Now.ToString("HH:mm:ss")} Были открыты клапаны: "); for (int i = 0; i <= 125; i++) { if (i % (steps + 1) == 0) { ValveOpening(i); LogTB.Text += ($"{i + 1}, "); } else { ValveClosing(i); } } LogTB.Text += ($" Остальные закрыты\n"); } }
private void SetWithStep_Click(object sender, RoutedEventArgs e) { List <int> vls = new List <int>(); int steps = 0; StepSetup stepSetup = new StepSetup(); bool? result = stepSetup.ShowDialog(); if (result == true) { steps = Int32.Parse(stepSetup.StepTB.Text); for (int i = 0; i <= 125; i++) { if (i % (steps + 1) == 0) { vls.Add(new int { }); vls[vls.Count - 1] = i; PaintTo("yellow", vls[vls.Count - 1]); } } TimeSetup(vls); } }