예제 #1
0
 public void UpdateView(FlightStatus status)
 {
     if (status.CurrentPosition != null)
     {
         lbl_hdg.Text = status.CurrentPosition.Heading.ToString("000") + "°";
         lbl_speed.Text = status.CurrentPosition.IndicatedAirspeedSpeed.ToString("000");
     }
     else
     {
         lbl_hdg.Text = "---°";
         lbl_speed.Text = "-";
     }
 }
예제 #2
0
 /// <summary>
 /// Da invocare per aggiornare i dati visualizzati
 /// </summary>
 /// <param name="status"></param>
 public void UpdateView(FlightStatus status)
 {
     lock (this)
     {
         if(status != null)
             lastStatus = status;
         BeginInvoke(new DrawDelegate(this.Draw), new object[0]);
     }
 }
예제 #3
0
        /// <summary>
        /// Costruttore. Richiede un riferimento alla vista principale per poter
        /// richiedere delle update della vista quando necessario
        /// </summary>
        /// <param name="view"></param>
        public IPSController(MainForm view)
        {
            Log("Init application...");
            viewMainForm = view;
            //Titolo della form principale con la versione dell'assembly
            //da modificare nelle proprietà di progetto SOLO da fede.caste in accordo con le milestones
            viewMainForm.Text = "IVaPS " + Assembly.GetExecutingAssembly().GetName().Version;

            #region Costruzione preliminare delle proprietà interne
            flightSim = new FSWrapper();
            status = new FlightStatus();
            checklistSpeaker = new ChecklistSpeaker();
            checklistSpeaker.Controller = this;
            //voiceRecognizer = new VoiceCommandRecognizer();
            //voiceRecognizer.Controller = this;

            utilBar = new UtilityBar();
            viewMainForm.mainPanel.SetStatus(status);

            try
            {
                IPSConfiguration.Load();
                Log("Configuration loaded");
                if (IPSConfiguration.AUTO_ALWAYSONTOP)
                    viewMainForm.mainPanel.btn_top_Click(null, null);
                //issue 42
                if (IPSConfiguration.AUTOLOAD_FLIGHTPLAN)
                {
                    Thread oThread = new Thread(new ThreadStart(viewMainForm.mainPanel.AsyncFPLoad));
                    oThread.Start();
                }
            }
            catch (FileNotFoundException fnfex)
            {
                //gestione dell'assenza di configurazione
                Log("Configuration file not found: " + fnfex.FileName);
            }

            Log("..Init successifully terminated");
            #endregion
        }
예제 #4
0
 public void DrawStatus(FlightStatus stat)
 {
     BeginInvoke(new DrawDelegate(this.Draw), new object[] { stat });
 }
예제 #5
0
        private void Draw(FlightStatus stat)
        {
            SetStatus(stat);
            if (stat.CurrentPosition != null)
            {
                lbl_lat.Text = stat.CurrentPosition.Latitude.ToString("00.000000") + "°";
                lbl_lon.Text = stat.CurrentPosition.Longitude.ToString("00.000000") + "°";
                lbl_speed.Text = stat.CurrentPosition.TrueAirspeedSpeed.ToString("000.0") + " Knots";
                lbl_alt.Text = stat.CurrentPosition.Altitude.ToString("00000") + " ft";
                lbl_hdg.Text = stat.CurrentPosition.Heading.ToString("000") + "°";
            }
            lbl_dist.Text = stat.Distance.ToString("000") + " nm";
            lbl_maxHeight.Text = stat.MaxAltitude.ToString("000") + " ft";
            lbl_maxSpeed.Text = stat.MaxSpeed.ToString("000") + " kn";
            lbl_currFuel.Text = stat.CurrentFuel.ToString("0");
            lbl_fuelDep.Text = stat.DepartureFuel.ToString("0");
            lbl_fuelArr.Text = stat.ArrivalFuel.ToString("0");

            if (stat.FlightPlan != null)
            {
                if (stat.ArrivalTime != DateTime.MinValue)
                {
                    lbl_arrTime.Text = stat.ArrivalTime.ToUniversalTime().ToShortTimeString();
                }
                if (stat.DepartureTime != DateTime.MinValue)
                {
                    lbl_depTime.Text = stat.DepartureTime.ToUniversalTime().ToShortTimeString();
                }
                if (stat.FlightPlan.Arrival != null)
                {
                    lbl_arrIcao.Text = stat.FlightPlan.Arrival.ICAOCode;
                }
                if (stat.FlightPlan.Departure != null)
                {
                    lbl_depIcao.Text = stat.FlightPlan.Departure.ICAOCode;
                }
                if (stat.FlightPlan.Route != null)
                {
                    //issue 17
                    if (stat.FlightPlan.Route.Length > 23)
                    {
                        lbl_route.Text = stat.FlightPlan.Route.Substring(0,23) + "...";
                        lbl_route_tooltip.SetToolTip(lbl_route, stat.FlightPlan.Route);
                    }
                    else
                    {
                        lbl_route.Text = stat.FlightPlan.Route;
                        lbl_route_tooltip.SetToolTip(lbl_route, "");
                    }
                }
            }

            //issue 29
            switch (stat.CurrentStatus)
            {
                case FlightStates.Before_Departed:
                    lbl_status.Text = "Parked"; break;
                case FlightStates.Engine_Started:
                    lbl_status.Text = "Engine ON"; break;
                case FlightStates.TakeOffTaxi:
                    lbl_status.Text = "Taxi"; break;
                case FlightStates.Airborne:
                    lbl_status.Text = "Airborne"; break;
                case FlightStates.Landed:
                    lbl_status.Text = "Landed"; break;
                case FlightStates.OnBlocks:
                    lbl_status.Text = "On blocks"; break;
                case FlightStates.EngineOff:
                    lbl_status.Text = "Engine OFF"; break;
            }
        }
예제 #6
0
 public void SetStatus(FlightStatus stat)
 {
     model = stat;
 }
예제 #7
0
 public void UpdateView(FlightStatus status)
 {
     //todo
 }
예제 #8
0
 public void FillPirep(FlightStatus fs)
 {
     this.fs = fs;
     Text = "loading...";
     webBrowser1.Url = new Uri(IVAO_SITE_VA_PIREP_PAGE + fs.VirtualAirlineID);
 }
예제 #9
0
 public void UpdateView(FlightStatus status)
 {
     if (status.CurrentPosition != null)
     {
         lbl_hdg.Text = status.CurrentPosition.Nav1OBS.ToString("000") + "°";
     }
     else
     {
         lbl_hdg.Text = "---°";
     }
 }
예제 #10
0
 public void UpdateView(FlightStatus status)
 {
     if(status.CurrentPosition != null)
     {
         lbl_freq.Text = status.CurrentPosition.Nav1.ToString("000.00");
     }
     else
     {
         lbl_freq.Text = "---.--";
     }
 }
예제 #11
0
 public void UpdateView(FlightStatus status)
 {
     //noop
 }