private void CalcAndSetShifts_HeightHold(int tracker, Shifts shifts = null) { var directShift = GetShiftXY(); SetShifts(shifts, directShift * Math.Cos(Path[tracker].ShiftsData[TrackId][0]), directShift * Math.Sin(Path[tracker].ShiftsData[TrackId][0]), 0); }
private void CalcAndSetShifts_Maneuver(int tracker, Shifts shifts = null) { var directShift = GetShiftXY(); SetShifts(shifts, directShift * Math.Cos(Path[tracker].ShiftsData[TrackId][0]), directShift * Math.Sin(Path[tracker].ShiftsData[TrackId][0]), GetHeightManeuverShift(HeightToGain, AircraftOptions.TimeToGainHeight)); }
private void CalcAndSetShifts_Ordinary(int tracker, Shifts shifts = null) { var shiftXY = GetShiftXY(); var shiftZ = shiftXY / Math.Cos(Path[tracker].ShiftsData[TrackId][1]); SetShifts(shifts, shiftXY * Math.Cos(Path[tracker].ShiftsData[TrackId][0]), shiftXY * Math.Sin(Path[tracker].ShiftsData[TrackId][0]), shiftZ * Math.Sin(Path[tracker].ShiftsData[TrackId][1])); }
private void SetShifts(Shifts shifts, double dx, double dy, double dz) { if (shifts != null) { shifts.Dx = dx; shifts.Dy = dy; shifts.Dz = dz; } else { Shifts.Dx = dx; Shifts.Dy = dy; Shifts.Dz = dz; } }
private void Invoke_CalculationShifts(int tracker, Shifts shifts = null) { CalcAndSetShifts(tracker, shifts); }
/// <summary> /// Изменяет метод в делегате для расчёта смещений. Относится к обработчику /// события изменения стадии полёта /// </summary> /// <param name="action">Метод для расчёта смещений</param> private void ChangeAndInvoke_Shifts(Action <int, Shifts> action, int tracker_, Shifts shifts_ = null) { CalcAndSetShifts = (tracker, shifts) => action(tracker, shifts); Invoke_CalculationShifts(tracker_, shifts_); }