Пример #1
0
        /// <summary>
        /// Legge la fase di checklist richiesta
        /// </summary>
        /// <param name="phase"></param>
        public void ReadPhase(ChecklistPhase phase)
        {

            backgroundSpeaker = new SpeakingThread(Controller);
 
            if (phase == null)
            {
                string s = "Checklist phase unavailable, select it on config section";
                backgroundSpeaker.AddInSpeakingBuffer(s,s);
                backgroundThread = new Thread(new ThreadStart(backgroundSpeaker.Run));
                backgroundThread.IsBackground = true;//issue 107
                backgroundThread.Start();
                return;
            }

            StringBuilder toBeSpeeked = new StringBuilder();
            string msg = string.Empty;

            #region lettura dell'header di checklist
            msg = string.Format(TEMPLATE_READ_CHECKLISTPHASE, phase.PhaseName);
            toBeSpeeked.Append(msg);
            toBeSpeeked.Append(SSML_PAUSE_MEDIUM);
            backgroundSpeaker.AddInSpeakingBuffer(toBeSpeeked.ToString(), phase.PhaseName + " checklist:");
            #endregion


            foreach (ChecklistItem item in phase.Items)
            {
                toBeSpeeked = new StringBuilder();
                msg = string.Format(TEMPLATE_READ_COUPLE, item.Description, item.Value);
                toBeSpeeked.Append(msg);
                toBeSpeeked.Append(string.Format(TEMPLATE_SSML_PAUSE_IN_SECONDS, item.Delay));

                backgroundSpeaker.AddInSpeakingBuffer(toBeSpeeked.ToString(), item.Description + " : " + item.Value);
            }

            #region lettura del footer
            toBeSpeeked = new StringBuilder();
            msg = string.Empty;

            toBeSpeeked.Append(SSML_PAUSE_MEDIUM);
            msg = string.Format(TEMPLATE_READ_CHECKLISTPHASECOMPLETED, phase.PhaseName);
            toBeSpeeked.Append(msg);

            backgroundSpeaker.AddInSpeakingBuffer(toBeSpeeked.ToString(), phase.PhaseName + " checklist completed");
            #endregion

            if (backgroundThread != null && backgroundThread.IsAlive)
            {
                backgroundThread.Abort();
            }

            backgroundThread = new Thread(new ThreadStart(backgroundSpeaker.Run));
            backgroundThread.IsBackground = true;//issue 107
            backgroundThread.Start();

        }
Пример #2
0
        /// <summary>
        /// Legge la fase di checklist richiesta
        /// </summary>
        /// <param name="phase"></param>
        public void ReadPhase(ChecklistPhase phase)
        {
            backgroundSpeaker = new SpeakingThread(Controller);

            if (phase == null)
            {
                string s = "Checklist phase unavailable, select it on config section";
                backgroundSpeaker.AddInSpeakingBuffer(s, s);
                backgroundThread = new Thread(new ThreadStart(backgroundSpeaker.Run));
                backgroundThread.IsBackground = true;//issue 107
                backgroundThread.Start();
                return;
            }

            StringBuilder toBeSpeeked = new StringBuilder();
            string        msg         = string.Empty;

            #region lettura dell'header di checklist
            msg = string.Format(TEMPLATE_READ_CHECKLISTPHASE, phase.PhaseName);
            toBeSpeeked.Append(msg);
            toBeSpeeked.Append(SSML_PAUSE_MEDIUM);
            backgroundSpeaker.AddInSpeakingBuffer(toBeSpeeked.ToString(), phase.PhaseName + " checklist:");
            #endregion


            foreach (ChecklistItem item in phase.Items)
            {
                toBeSpeeked = new StringBuilder();
                msg         = string.Format(TEMPLATE_READ_COUPLE, item.Description, item.Value);
                toBeSpeeked.Append(msg);
                toBeSpeeked.Append(string.Format(TEMPLATE_SSML_PAUSE_IN_SECONDS, item.Delay));

                backgroundSpeaker.AddInSpeakingBuffer(toBeSpeeked.ToString(), item.Description + " : " + item.Value);
            }

            #region lettura del footer
            toBeSpeeked = new StringBuilder();
            msg         = string.Empty;

            toBeSpeeked.Append(SSML_PAUSE_MEDIUM);
            msg = string.Format(TEMPLATE_READ_CHECKLISTPHASECOMPLETED, phase.PhaseName);
            toBeSpeeked.Append(msg);

            backgroundSpeaker.AddInSpeakingBuffer(toBeSpeeked.ToString(), phase.PhaseName + " checklist completed");
            #endregion

            if (backgroundThread != null && backgroundThread.IsAlive)
            {
                backgroundThread.Abort();
            }

            backgroundThread = new Thread(new ThreadStart(backgroundSpeaker.Run));
            backgroundThread.IsBackground = true;//issue 107
            backgroundThread.Start();
        }
Пример #3
0
        public void ReadPosition(AircraftPosition pos)
        {
            backgroundSpeaker = new SpeakingThread(Controller);

            if (pos != null)
            {
                StringBuilder toBeSpeeked = new StringBuilder();
                string        tmp         = Convert.ToInt32(pos.Heading).ToString("000");
                string        tmp2        = tmp[0] + ", " + tmp[1] + ", " + tmp[2] + ", ";
                toBeSpeeked.Append(string.Format(TEMPLATE_HEADING, tmp2));
                toBeSpeeked.Append(SSML_PAUSE_SHORT);
                int RoundedAltitude = Convert.ToInt32(pos.Altitude) / 100 * 100;                                           // /100*100 inserito per arrotondare ai 100 piedi;
                toBeSpeeked.Append(string.Format(TEMPLATE_ALTITUDE, RoundedAltitude.ToString("0,000").Replace('.', ','))); //RoundedAltitude.ToString("0,000").Replace('.',',') per issue 75
                toBeSpeeked.Append(SSML_PAUSE_SHORT);
                toBeSpeeked.Append(string.Format(TEMPLATE_SPEED, Convert.ToInt32(pos.TrueAirspeedSpeed)));
                toBeSpeeked.Append(SSML_PAUSE_SHORT);

                backgroundThread = new Thread(new ThreadStart(backgroundSpeaker.Run));
            }
            else
            {
                backgroundSpeaker.AddInSpeakingBuffer("Position unknown", "Position unknown");
                backgroundThread = new Thread(new ThreadStart(backgroundSpeaker.Run));
            }
            backgroundThread.IsBackground = true;//issue 107
            backgroundThread.Start();
        }
Пример #4
0
        /// <summary>
        /// Legge le velocità caratteristiche dell'aereomobile a cui appartiene la checklist
        /// </summary>
        /// <param name="cklst"></param>
        public void ReadAllSpeeds(Checklist cklst)
        {
            backgroundSpeaker = new SpeakingThread(Controller);

            if (cklst == null)
            {
                string s = "Checklist unavailable, select it on config section";
                backgroundSpeaker.AddInSpeakingBuffer(s, s);
                backgroundThread = new Thread(new ThreadStart(backgroundSpeaker.Run));
                backgroundThread.IsBackground = true;//issue 107
                backgroundThread.Start();
                return;
            }


            StringBuilder toBeSpeeked = new StringBuilder();

            toBeSpeeked.Append(CARACTERISTIC_SPEEDS);
            toBeSpeeked.Append(SSML_PAUSE_SHORT);
            toBeSpeeked.Append(string.Format(TEMPLATE_READ_COUPLE, "V rotate", cklst.Vr));

            backgroundSpeaker.AddInSpeakingBuffer(toBeSpeeked.ToString(), "V rotate: " + cklst.Vr);
            toBeSpeeked = new StringBuilder();

            toBeSpeeked.Append(SSML_PAUSE_SHORT);
            toBeSpeeked.Append(string.Format(TEMPLATE_READ_COUPLE, "approach speed", cklst.Vapp));

            backgroundSpeaker.AddInSpeakingBuffer(toBeSpeeked.ToString(), "approach speed: " + cklst.Vapp);
            toBeSpeeked = new StringBuilder();

            toBeSpeeked.Append(SSML_PAUSE_SHORT);
            toBeSpeeked.Append(string.Format(TEMPLATE_READ_COUPLE, "flaps extension speed", cklst.Vf0));

            backgroundSpeaker.AddInSpeakingBuffer(toBeSpeeked.ToString(), "flaps extension speed: " + cklst.Vf0);
            toBeSpeeked = new StringBuilder();

            toBeSpeeked.Append(SSML_PAUSE_SHORT);
            toBeSpeeked.Append(string.Format(TEMPLATE_READ_COUPLE, "touchdown speed", cklst.Vldg));

            backgroundSpeaker.AddInSpeakingBuffer(toBeSpeeked.ToString(), "touchdown speed: " + cklst.Vldg);
            toBeSpeeked = new StringBuilder();

            toBeSpeeked.Append(SSML_PAUSE_SHORT);
            toBeSpeeked.Append(string.Format(TEMPLATE_READ_COUPLE, "never exceed speed", cklst.Vne));

            backgroundSpeaker.AddInSpeakingBuffer(toBeSpeeked.ToString(), "never exceed speed: " + cklst.Vne);
            toBeSpeeked = new StringBuilder();

            toBeSpeeked.Append(SSML_PAUSE_SHORT);
            toBeSpeeked.Append(string.Format(TEMPLATE_READ_COUPLE, "stall speed", cklst.Vs));

            backgroundSpeaker.AddInSpeakingBuffer(toBeSpeeked.ToString(), "stall speed: " + cklst.Vs);
            toBeSpeeked = new StringBuilder();

            backgroundThread = new Thread(new ThreadStart(backgroundSpeaker.Run));
            backgroundThread.IsBackground = true;//issue 107
            backgroundThread.Start();
        }
Пример #5
0
        /// <summary>
        /// Annncia la frase
        /// </summary>
        /// <param name="message">la frase da annunciare (non SSML)</param>
        public void Speak(string message)
        {
            if (IsCurrentlySpeaking())
            {
                return;
            }
            backgroundSpeaker = new SpeakingThread(Controller);
            backgroundSpeaker.AddInSpeakingBuffer(message, message);

            backgroundThread = new Thread(new ThreadStart(backgroundSpeaker.Run));
            backgroundThread.IsBackground = true;//issue 107
            backgroundThread.Start();
        }
Пример #6
0
 /// <summary>
 /// Annncia la frase
 /// </summary>
 /// <param name="message">la frase da annunciare (non SSML)</param>
 public void Speak(string message)
 {
     if (IsCurrentlySpeaking()) return;
     backgroundSpeaker = new SpeakingThread(Controller);
     backgroundSpeaker.AddInSpeakingBuffer(message, message);
     
     backgroundThread = new Thread(new ThreadStart(backgroundSpeaker.Run));
     backgroundThread.IsBackground = true;//issue 107
     backgroundThread.Start();
 }
Пример #7
0
        public void ReadPosition(AircraftPosition pos)
        {
            backgroundSpeaker = new SpeakingThread(Controller);

            if (pos != null)
            {
                StringBuilder toBeSpeeked = new StringBuilder();
                string tmp = Convert.ToInt32(pos.Heading).ToString("000");
                string tmp2 = tmp[0] + ", " + tmp[1] + ", " + tmp[2] + ", ";
                toBeSpeeked.Append(string.Format(TEMPLATE_HEADING,tmp2));
                toBeSpeeked.Append(SSML_PAUSE_SHORT);
                int RoundedAltitude = Convert.ToInt32(pos.Altitude)/100*100;// /100*100 inserito per arrotondare ai 100 piedi;
                toBeSpeeked.Append(string.Format(TEMPLATE_ALTITUDE, RoundedAltitude.ToString("0,000").Replace('.', ','))); //RoundedAltitude.ToString("0,000").Replace('.',',') per issue 75
                toBeSpeeked.Append(SSML_PAUSE_SHORT);
                toBeSpeeked.Append(string.Format(TEMPLATE_SPEED, Convert.ToInt32(pos.TrueAirspeedSpeed)));
                toBeSpeeked.Append(SSML_PAUSE_SHORT);
                
                backgroundThread = new Thread(new ThreadStart(backgroundSpeaker.Run));
            }
            else
            {
                backgroundSpeaker.AddInSpeakingBuffer("Position unknown", "Position unknown");
                backgroundThread = new Thread(new ThreadStart(backgroundSpeaker.Run));
            }
            backgroundThread.IsBackground = true;//issue 107
            backgroundThread.Start();
        }
Пример #8
0
        /// <summary>
        /// Legge le velocità caratteristiche dell'aereomobile a cui appartiene la checklist
        /// </summary>
        /// <param name="cklst"></param>
        public void ReadAllSpeeds(Checklist cklst)
        {
            backgroundSpeaker = new SpeakingThread(Controller);

            if (cklst == null)
            {
                string s = "Checklist unavailable, select it on config section";
                backgroundSpeaker.AddInSpeakingBuffer(s, s);
                backgroundThread = new Thread(new ThreadStart(backgroundSpeaker.Run));
                backgroundThread.IsBackground = true;//issue 107
                backgroundThread.Start();
                return;
            }


            StringBuilder toBeSpeeked = new StringBuilder();
            toBeSpeeked.Append(CARACTERISTIC_SPEEDS);
            toBeSpeeked.Append(SSML_PAUSE_SHORT);
            toBeSpeeked.Append(string.Format(TEMPLATE_READ_COUPLE, "V rotate" , cklst.Vr));

            backgroundSpeaker.AddInSpeakingBuffer(toBeSpeeked.ToString(), "V rotate: " + cklst.Vr);
            toBeSpeeked = new StringBuilder();

            toBeSpeeked.Append(SSML_PAUSE_SHORT);
            toBeSpeeked.Append(string.Format(TEMPLATE_READ_COUPLE, "approach speed", cklst.Vapp));

            backgroundSpeaker.AddInSpeakingBuffer(toBeSpeeked.ToString(), "approach speed: " + cklst.Vapp);
            toBeSpeeked = new StringBuilder();

            toBeSpeeked.Append(SSML_PAUSE_SHORT);
            toBeSpeeked.Append(string.Format(TEMPLATE_READ_COUPLE, "flaps extension speed", cklst.Vf0));

            backgroundSpeaker.AddInSpeakingBuffer(toBeSpeeked.ToString(), "flaps extension speed: " + cklst.Vf0);
            toBeSpeeked = new StringBuilder();

            toBeSpeeked.Append(SSML_PAUSE_SHORT);
            toBeSpeeked.Append(string.Format(TEMPLATE_READ_COUPLE, "touchdown speed", cklst.Vldg));

            backgroundSpeaker.AddInSpeakingBuffer(toBeSpeeked.ToString(), "touchdown speed: " + cklst.Vldg);
            toBeSpeeked = new StringBuilder();

            toBeSpeeked.Append(SSML_PAUSE_SHORT);
            toBeSpeeked.Append(string.Format(TEMPLATE_READ_COUPLE, "never exceed speed", cklst.Vne));

            backgroundSpeaker.AddInSpeakingBuffer(toBeSpeeked.ToString(), "never exceed speed: " + cklst.Vne);
            toBeSpeeked = new StringBuilder();

            toBeSpeeked.Append(SSML_PAUSE_SHORT);
            toBeSpeeked.Append(string.Format(TEMPLATE_READ_COUPLE, "stall speed", cklst.Vs));

            backgroundSpeaker.AddInSpeakingBuffer(toBeSpeeked.ToString(), "stall speed: " + cklst.Vs);
            toBeSpeeked = new StringBuilder();

            backgroundThread = new Thread(new ThreadStart(backgroundSpeaker.Run));
            backgroundThread.IsBackground = true;//issue 107
            backgroundThread.Start();
        }