Beispiel #1
0
        /// <summary>Enqueue a <see cref="FlightCtrlState"/> to the flight control queue.</summary>
        /// <param name="fs">The <see cref="FlightCtrlState"/> to be queued.</param>
        private void Enqueue(FlightCtrlState fs)
        {
            var dfs = new DelayedFlightCtrlState(fs);

            dfs.TimeStamp += Delay;

            if (StockAutopilotCommand.IsAutoPilotEngaged(this) && RTSettings.Instance.EnableSignalDelay) // remove the delay if the autopilot is engaged
            {
                var autopilotfs = new DelayedFlightCtrlState(fs);                                        // make copy of FS and apply no delay

                //nullify autopilot inputs in the delayed fs
                dfs.State.roll      = 0f;
                dfs.State.rollTrim  = 0f;
                dfs.State.pitch     = 0f;
                dfs.State.pitchTrim = 0f;
                dfs.State.yaw       = 0f;
                dfs.State.yawTrim   = 0f;

                //nullify throttle
                autopilotfs.State.mainThrottle = 0f;

                _flightCtrlQueue.Enqueue(autopilotfs);
            }

            _flightCtrlQueue.Enqueue(dfs);
        }
Beispiel #2
0
        /// <summary>Enqueue a <see cref="FlightCtrlState"/> to the flight control queue.</summary>
        /// <param name="fs">The <see cref="FlightCtrlState"/> to be queued.</param>
        private void Enqueue(FlightCtrlState fs)
        {
            var dfs = new DelayedFlightCtrlState(fs);

            dfs.TimeStamp += Delay;

            if (StockAutopilotCommand.IsAutoPilotEngaged(this)) // remove the delay if the autopilot is engaged
            {
                dfs.TimeStamp -= Delay;
            }

            _flightCtrlQueue.Enqueue(dfs);
        }