Beispiel #1
0
        protected virtual void FireStateChange(AircraftState State)
        {
            AnalyseurStateEvent e = new AnalyseurStateEvent();

            e.Data = State;
            OnStateChange?.Invoke(this, e);
        }
Beispiel #2
0
 private void M_Analyseur_OnStateChange(object sender, AnalyseurStateEvent e)
 {
     if ((e.Data.OnGround == true) && (m_Analyseur.ADernier.OnGround == false) && Properties.Settings.Default.EnaDropDisp)
     {
         string Message = string.Format("Taux de chute : {0:0.} ft/min", e.Data.Vario);
         Log.LogMessage(DateTime.Now.ToShortTimeString() + " :" + Message);
         m_SCM.SendScrollingText(Message);
         if (Properties.Settings.Default.EnaDropSend)
         {
             Send_Tchat(Message);
         }
     }
 }
Beispiel #3
0
        /// <summary>
        /// Réception de la mise à jour de la position et de l'atitude de l'avion de l'hôte
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnStateChange(object sender, AnalyseurStateEvent e)
        {
            bool Title_Changed = false;

            if (m_SendData.Title != e.Data.Title)
            {
                Title_Changed = true;
            }
            m_SendData.Clone(e.Data);
            if ((e.Data.TimeStamp - m_LastStateEvent) < m_SendInterval)
            {
                return;
            }
            if ((!m_OnLine) || (m_EP == null) || (m_Version < 1))
            {
                return;
            }
            //On envoi les données aux peers
            SendData();
            //Test du changement d'appareil
            if (Title_Changed)
            {
                SendVersion();
            }
            m_LastStateEvent = e.Data.TimeStamp;
            // Gestion de l'affichage de l'AI
            m_bSpawnable = (m_Distance < Properties.Settings.Default.P2PRadius) && (m_Distance >= 0);
            if (m_bSpawnable)
            {
                m_SendInterval = (uint)Properties.Settings.Default.P2PRate;
            }
            else
            {
                m_SendInterval = 5000;
            }
            if (m_bSpawnable && Visible && (m_Spawned == 0))
            {
                Spawn_AI(true);
#if DEBUG
                Log.LogMessage("Peer [" + CallSign + "] Construction de l'objet AI", Color.DarkBlue, 1);
#endif
            }
            if (((!m_bSpawnable) || (!Visible)) && (m_Spawned > 0))
            {
                Spawn_AI(false);
#if DEBUG
                Log.LogMessage("Peer [" + CallSign + "] Destruction de l'objet AI Visible=" + Visible.ToString() + " , Spawnable = " + m_bSpawnable.ToString(), Color.DarkBlue, 1);
#endif
            }
        }