//расчет ответа в 3 модуле private void button2_Click(object sender, RoutedEventArgs e) { try { double W0 = double.Parse(textboxW0.Text); double Wf = double.Parse(textboxWf.Text); double Wr = Double.Parse(textBox10.Text); coefficient coefficient = combobox8.SelectedItem as coefficient; double y = coefficient.y;//Double.Parse(textBox13.Text); double Kf = 0; Kf = ((Wr - W0) / (Wf - W0)) * (Wf / Wr) * y; label10.Text = "= " + Math.Round(Kf, 5).ToString(); if (Kf > 0.7 && Kf < 0.9) { anwer3.Text = "Металл достиг предельного состояния."; } else { anwer3.Text = "Металл контролируемого элемента может работать без проведения ремонтно-восстановительных работ."; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void create_y() { List <coefficient> list_y = new List <coefficient>(); coefficient coefficient = new coefficient(); coefficient.name_y = "исходное состояние"; coefficient.y = 1; list_y.Add(coefficient); coefficient = new coefficient(); coefficient.name_y = "25 тыс. часов"; coefficient.y = 1.01; list_y.Add(coefficient); coefficient = new coefficient(); coefficient.name_y = "50 тыс. часов"; coefficient.y = 1.02; list_y.Add(coefficient); coefficient = new coefficient(); coefficient.name_y = "75 тыс. часов"; coefficient.y = 1.03; list_y.Add(coefficient); coefficient = new coefficient(); coefficient.name_y = "100 тыс. часов"; coefficient.y = 1.04; list_y.Add(coefficient); coefficient = new coefficient(); coefficient.name_y = "125 тыс. часов"; coefficient.y = 1.05; list_y.Add(coefficient); coefficient = new coefficient(); coefficient.name_y = "150 тыс. часов"; coefficient.y = 1.06; list_y.Add(coefficient); coefficient = new coefficient(); coefficient.name_y = "150–200 тыс. часов"; coefficient.y = 1.07; list_y.Add(coefficient); coefficient = new coefficient(); coefficient.name_y = "200–250 тыс. часов"; coefficient.y = 1.08; list_y.Add(coefficient); coefficient = new coefficient(); coefficient.name_y = "более 250 тыс. часов"; coefficient.y = 1.09; list_y.Add(coefficient); combobox8.ItemsSource = list_y; }
public _Polynom(double coefficient, int power) => Add(coefficient, power);