Beispiel #1
0
        protected override void OnFlightDataChanged(object sender, FlightDataChangedEventArgs e)
        {
            bool?oldValue = GetValue(e.oldFlightData);
            bool?newValue = GetValue(e.newFlightData);

            if (newValue == true)
            {
                lightBitSet = true;
            }
            else
            {
                lightBitSet = false;
            }

            // Catch case when BMS has started and e.newFlightData is null
            if (e.newFlightData != null)
            {
                newBlinkingBitSet = ((e.newFlightData.blinkBits & (int)blinkBit) != 0);
            }
            else
            {
                newBlinkingBitSet = false;
            }

            // Catch case when BMS has exited and e.oldFlightData is null
            if (e.oldFlightData != null)
            {
                oldBlinkingBitSet = ((e.oldFlightData.blinkBits & (int)blinkBit) != 0);
            }
            else
            {
                oldBlinkingBitSet = false;
            }

            if ((oldValue != newValue) || (newBlinkingBitSet != oldBlinkingBitSet))     // Data changed
            {
                timer.Stop();
                RaiseFalconLightChanged(oldValue, newValue);
                if (newValue == true)       // LB went from OFF to ON
                {
                    lampLit = true;
                    if (newBlinkingBitSet)  // Blinking - start blink timer
                    {
                        timer.Start();
                    }
                    else                    // Not Blinking - stop blink timer
                    {
                        timer.Stop();
                    }
                }
                else                        // LB went from ON to OFF
                {
                    lampLit = false;
                    timer.Stop();
                }
            }
        }
Beispiel #2
0
        protected override void OnFlightDataChanged(object sender, FlightDataChangedEventArgs e)
        {
            bool?oldValue = GetValue(e.oldFlightData);
            bool?newValue = GetValue(e.newFlightData);

            if (oldValue != newValue)
            {
                RaiseFalconLightChanged(oldValue, newValue);
            }
        }
Beispiel #3
0
        private void OnFlightDataChanged(object sender, FlightDataChangedEventArgs e)
        {
            float?oldValue = GetValue(e.oldFlightData);
            float?newValue = GetValue(e.newFlightData);

            if (oldValue != newValue)
            {
                RaiseFalconLightChanged(newValue);
            }
        }
Beispiel #4
0
        protected override void OnFlightDataChanged(object sender, FlightDataChangedEventArgs e)
        {
            bool?oldValue = GetValue(e.oldFlightData);
            bool?newValue = GetValue(e.newFlightData);

            if (newValue == true)
            {
                engaged = 1;
            }
            else
            {
                engaged = 0;
            }

            if (oldValue != newValue && newValue == true)
            {
                timer.Stop();
                RaiseFalconLightChanged(oldValue, newValue);
                timer.Start();
            }
        }
Beispiel #5
0
        protected override void OnFlightDataChanged(object sender, FlightDataChangedEventArgs e)
        {
            bool?oldValue = GetValue(e.oldFlightData);
            bool?newValue = GetValue(e.newFlightData);

            if (oldValue != null && newValue != null)
            {
                newAuxPwrOn = ((e.newFlightData.lightBits2 & (int)LightBits2.AuxPwr) != 0);
                oldAuxPwrOn = ((e.oldFlightData.lightBits2 & (int)LightBits2.AuxPwr) != 0);

                if (newAuxPwrOn)                // Only flip-flop OPEN light if RWR is ON
                {
                    if (oldValue != newValue)   // PRIORITY Light status changed. Update OPEN Light
                    {
                        if (newValue == true)   // PRIORITY light went ON. Turn OPEN light OFF
                        {
                            RaiseFalconLightChanged(true, false);
                        }
                        else                    // PRIORITY light went OFF. Turn OPEN light ON
                        {
                            RaiseFalconLightChanged(false, true);
                        }
                    }
                }

                if (oldAuxPwrOn != newAuxPwrOn)           // AuxPwr changed
                {
                    if (newAuxPwrOn && newValue == false) // AuxPwr came back on & PRIORITY light is OFF. Turn OPEN light ON
                    {
                        RaiseFalconLightChanged(false, true);
                    }
                    else                                    // AuxPwr came back on but PRIORITY light is ON. Turn OPEN light OFF
                    {
                        RaiseFalconLightChanged(true, false);
                    }
                }
            }
        }
Beispiel #6
0
 protected abstract void OnFlightDataChanged(object sender, FlightDataChangedEventArgs e);