public void SetCalculationResult(StagesVariableValues variableParameterValues, OutputParameters outputParameters) { FirstStageVariableParameterTextBoxes[FirstStageVariableParameterType.n_0].Text = FormatConvert.ToString(variableParameterValues.firstStageVariableValues.n_0); FirstStageVariableParameterTextBoxes[FirstStageVariableParameterType.a_to].Text = FormatConvert.ToString(variableParameterValues.firstStageVariableValues.a_to * 1E-3); FirstStageVariableParameterTextBoxes[FirstStageVariableParameterType.mu_su_pr].Text = FormatConvert.ToString(variableParameterValues.firstStageVariableValues.mu_su_pr); FirstStageVariableParameterTextBoxes[FirstStageVariableParameterType.gamma_du].Text = FormatConvert.ToString(variableParameterValues.firstStageVariableValues.gamma_du); FirstStageVariableParameterTextBoxes[FirstStageVariableParameterType.mu_k].Text = FormatConvert.ToString(variableParameterValues.firstStageVariableValues.mu_k); SecondStageVariableParameterTextBoxes[SecondStageVariableParameterType.n_0].Text = FormatConvert.ToString(variableParameterValues.secondStageVariableValues.n_0); SecondStageVariableParameterTextBoxes[SecondStageVariableParameterType.a_to].Text = FormatConvert.ToString(variableParameterValues.secondStageVariableValues.a_to * 1E-3); SecondStageVariableParameterTextBoxes[SecondStageVariableParameterType.mu_su_pr].Text = FormatConvert.ToString(variableParameterValues.secondStageVariableValues.mu_su_pr); SecondStageVariableParameterTextBoxes[SecondStageVariableParameterType.gamma_du].Text = FormatConvert.ToString(variableParameterValues.secondStageVariableValues.gamma_du); TrajectoryOutputParameters[TrajectoryOutputParameterType.phi_k1].Text = FormatConvert.ToString(outputParameters.TrajectoryOutputParameters.phi_k1 * 180 / Math.PI); TrajectoryOutputParameters[TrajectoryOutputParameterType.phi_k2].Text = FormatConvert.ToString(outputParameters.TrajectoryOutputParameters.phi_k2 * 180 / Math.PI); TrajectoryOutputParameters[TrajectoryOutputParameterType.phi_0].Text = FormatConvert.ToString(outputParameters.TrajectoryOutputParameters.phi_0 * 180 / Math.PI); TrajectoryOutputParameters[TrajectoryOutputParameterType.V].Text = FormatConvert.ToString(outputParameters.TrajectoryOutputParameters.V); TrajectoryOutputParameters[TrajectoryOutputParameterType.H].Text = FormatConvert.ToString(outputParameters.TrajectoryOutputParameters.H * 1E-3); TrajectoryOutputParameters[TrajectoryOutputParameterType.nu].Text = FormatConvert.ToString(outputParameters.TrajectoryOutputParameters.nu * 180 / Math.PI); TrajectoryOutputParameters[TrajectoryOutputParameterType.t_1].Text = FormatConvert.ToString(outputParameters.TrajectoryOutputParameters.t_1); TrajectoryOutputParameters[TrajectoryOutputParameterType.t_2].Text = FormatConvert.ToString(outputParameters.TrajectoryOutputParameters.t_2); FirstStageOutputParameterTextBoxes[FirstStageOutputParameterType.P_0].Text = FormatConvert.ToString(outputParameters.FirstStageOutputData.P_0 * 1E-3); FirstStageOutputParameterTextBoxes[FirstStageOutputParameterType.m_0].Text = FormatConvert.ToString(outputParameters.FirstStageOutputData.m_0); FirstStageOutputParameterTextBoxes[FirstStageOutputParameterType.m_k].Text = FormatConvert.ToString(outputParameters.FirstStageOutputData.m_k); FirstStageOutputParameterTextBoxes[FirstStageOutputParameterType.m_t].Text = FormatConvert.ToString(outputParameters.FirstStageOutputData.m_t); FirstStageOutputParameterTextBoxes[FirstStageOutputParameterType.m_o].Text = FormatConvert.ToString(outputParameters.FirstStageOutputData.m_o); FirstStageOutputParameterTextBoxes[FirstStageOutputParameterType.m_g].Text = FormatConvert.ToString(outputParameters.FirstStageOutputData.m_g); FirstStageOutputParameterTextBoxes[FirstStageOutputParameterType.m_to].Text = FormatConvert.ToString(outputParameters.FirstStageOutputData.m_to); FirstStageOutputParameterTextBoxes[FirstStageOutputParameterType.m_su_pr].Text = FormatConvert.ToString(outputParameters.FirstStageOutputData.m_su_pr); FirstStageOutputParameterTextBoxes[FirstStageOutputParameterType.m_du].Text = FormatConvert.ToString(outputParameters.FirstStageOutputData.m_du); FirstStageOutputParameterTextBoxes[FirstStageOutputParameterType.m_sux].Text = FormatConvert.ToString(outputParameters.FirstStageOutputData.m_sux); FirstStageOutputParameterTextBoxes[FirstStageOutputParameterType.mu_sux].Text = FormatConvert.ToString(outputParameters.FirstStageOutputData.mu_sux); SecondStageOutputParameterTextBoxes[SecondStageOutputParameterType.P_0].Text = FormatConvert.ToString(outputParameters.SecondStageOutputData.P_0 * 1E-3); SecondStageOutputParameterTextBoxes[SecondStageOutputParameterType.m_0].Text = FormatConvert.ToString(outputParameters.SecondStageOutputData.m_0); SecondStageOutputParameterTextBoxes[SecondStageOutputParameterType.m_k].Text = FormatConvert.ToString(outputParameters.SecondStageOutputData.m_k); SecondStageOutputParameterTextBoxes[SecondStageOutputParameterType.m_t].Text = FormatConvert.ToString(outputParameters.SecondStageOutputData.m_t); SecondStageOutputParameterTextBoxes[SecondStageOutputParameterType.m_o].Text = FormatConvert.ToString(outputParameters.SecondStageOutputData.m_o); SecondStageOutputParameterTextBoxes[SecondStageOutputParameterType.m_g].Text = FormatConvert.ToString(outputParameters.SecondStageOutputData.m_g); SecondStageOutputParameterTextBoxes[SecondStageOutputParameterType.m_to].Text = FormatConvert.ToString(outputParameters.SecondStageOutputData.m_to); SecondStageOutputParameterTextBoxes[SecondStageOutputParameterType.m_su_pr].Text = FormatConvert.ToString(outputParameters.SecondStageOutputData.m_su_pr); SecondStageOutputParameterTextBoxes[SecondStageOutputParameterType.m_du].Text = FormatConvert.ToString(outputParameters.SecondStageOutputData.m_du); SecondStageOutputParameterTextBoxes[SecondStageOutputParameterType.m_sux].Text = FormatConvert.ToString(outputParameters.SecondStageOutputData.m_sux); SecondStageOutputParameterTextBoxes[SecondStageOutputParameterType.mu_sux].Text = FormatConvert.ToString(outputParameters.SecondStageOutputData.mu_sux); SecondStageOutputParameterTextBoxes[SecondStageOutputParameterType.mu_k].Text = FormatConvert.ToString(outputParameters.SecondStageOutputData.mu_k); PayloadMassRatioTextBox.Text = FormatConvert.ToString(outputParameters.mu_pg); }
async void FillCalculationResult() { Grid.Rows.Clear(); if ((Result != null) && (Result.Count != 0)) { Action <DataGridViewRow, int, StageOutputData> AddStageOutputDataInGrid = (Row, StartColumnIndex, StageOutputData) => { Row.Cells[StartColumnIndex + 0].Value = FormatConvert.ToString(StageOutputData.P_0 * 1E-3); Row.Cells[StartColumnIndex + 1].Value = FormatConvert.ToString(StageOutputData.m_0); Row.Cells[StartColumnIndex + 2].Value = FormatConvert.ToString(StageOutputData.m_k); Row.Cells[StartColumnIndex + 3].Value = FormatConvert.ToString(StageOutputData.m_t); Row.Cells[StartColumnIndex + 4].Value = FormatConvert.ToString(StageOutputData.m_o); Row.Cells[StartColumnIndex + 5].Value = FormatConvert.ToString(StageOutputData.m_g); Row.Cells[StartColumnIndex + 6].Value = FormatConvert.ToString(StageOutputData.m_to); Row.Cells[StartColumnIndex + 7].Value = FormatConvert.ToString(StageOutputData.m_su_pr); Row.Cells[StartColumnIndex + 8].Value = FormatConvert.ToString(StageOutputData.m_du); Row.Cells[StartColumnIndex + 9].Value = FormatConvert.ToString(StageOutputData.m_sux); }; int i = 1; foreach (var result in Result) { Grid.Rows.Add(); var row = Grid.Rows[Grid.Rows.Count - 1]; row.Cells[0].Value = i; row.Cells[1].Value = FormatConvert.ToString(result.Key.firstStageVariableValues.n_0); row.Cells[2].Value = FormatConvert.ToString(result.Key.secondStageVariableValues.n_0); row.Cells[3].Value = FormatConvert.ToString(result.Key.firstStageVariableValues.gamma_du); row.Cells[4].Value = FormatConvert.ToString(result.Key.secondStageVariableValues.gamma_du); row.Cells[5].Value = FormatConvert.ToString(result.Key.firstStageVariableValues.a_to * 1E-3); row.Cells[6].Value = FormatConvert.ToString(result.Key.secondStageVariableValues.a_to * 1E-3); row.Cells[7].Value = FormatConvert.ToString(result.Key.firstStageVariableValues.mu_su_pr); row.Cells[8].Value = FormatConvert.ToString(result.Key.secondStageVariableValues.mu_su_pr); row.Cells[9].Value = FormatConvert.ToString(result.Key.firstStageVariableValues.mu_k); row.Cells[10].Value = FormatConvert.ToString(result.Value.SecondStageOutputData.mu_k); row.Cells[11].Value = FormatConvert.ToString(result.Value.FirstStageOutputData.mu_sux); row.Cells[12].Value = FormatConvert.ToString(result.Value.SecondStageOutputData.mu_sux); AddStageOutputDataInGrid(row, 13, result.Value.FirstStageOutputData); AddStageOutputDataInGrid(row, 23, result.Value.SecondStageOutputData); row.Cells[33].Value = FormatConvert.ToString(result.Value.TrajectoryOutputParameters.phi_k1 * 180 / Math.PI); row.Cells[34].Value = FormatConvert.ToString(result.Value.TrajectoryOutputParameters.phi_0 * 180 / Math.PI); row.Cells[35].Value = FormatConvert.ToString(result.Value.TrajectoryOutputParameters.phi_k2 * 180 / Math.PI); row.Cells[36].Value = FormatConvert.ToString(result.Value.TrajectoryOutputParameters.t_1); row.Cells[37].Value = FormatConvert.ToString(result.Value.TrajectoryOutputParameters.t_2); row.Cells[38].Value = FormatConvert.ToString(result.Value.TrajectoryOutputParameters.H * 1E-3); row.Cells[39].Value = FormatConvert.ToString(result.Value.TrajectoryOutputParameters.V); row.Cells[40].Value = FormatConvert.ToString(result.Value.TrajectoryOutputParameters.nu * 180 / Math.PI); row.Cells[41].Value = FormatConvert.ToString(result.Value.mu_pg); VariantsComboBox.Items.Add("Вариант " + i.ToString()); i++; } await Task.Run(() => { Trajectories.Clear(); var id = GetCalculationInputData(); for (int j = 0; j < Result.Count; j++) { var Key = Result.Keys.ToList()[j]; var Args = new CalculateTrajectoryEventArgs(Key, Result[Key], id); CalculateTrajectory(this, Args); Trajectories.Add(Key, Args.Trajectory); } }); VariantsComboBox.SelectedIndex = 0; VariantsComboBox_SelectedIndexChanged(this, EventArgs.Empty); } }