Exemplo n.º 1
0
 public ConfigForm(IPSController controller)
 {
     InitializeComponent();
     this.controller = controller;
     try
     {
         IPSConfiguration.Load();
         txt_callsign.Text      = IPSConfiguration.CALLSIGN;
         txt_vaid.Text          = IPSConfiguration.VA_ID;
         chk_aot.Checked        = IPSConfiguration.AUTO_ALWAYSONTOP;
         chk_fp.Checked         = IPSConfiguration.AUTOLOAD_FLIGHTPLAN;
         ckb_trasponder.Checked = IPSConfiguration.AUTO_TRASPONDER;
         string[] tmp = ChecklistReader.ReadAvailableChecklists();
         foreach (string s in tmp)
         {
             cbo_chk.Items.Add(s);
         }
         if (IPSConfiguration.CURRENT_CHECKLIST != null)
         {
             cbo_chk.SelectedItem = IPSConfiguration.CURRENT_CHECKLIST;
         }
         ttsVolume.Value = IPSConfiguration.TTS_VOLUME;
     }
     catch
     {
         txt_callsign.Text = "xxxxxxx";
         txt_vaid.Text     = "xxxx";
         chk_aot.Checked   = false;
         chk_fp.Checked    = false;
     }
 }
Exemplo n.º 2
0
 public void SaveConfig()
 {
     try
     {
         IPSConfiguration.Save();
         status.Callsign         = IPSConfiguration.CALLSIGN;
         status.VirtualAirlineID = IPSConfiguration.VA_ID;
         viewMainForm.mainPanel.Info("Config saved");
         checklistSelectionForm = null;//per issue 89
     }
     catch (Exception ex)
     {
         Log("Error saving config: " + ex.ToString());
         viewMainForm.mainPanel.Error("Error saving config");
     }
 }
Exemplo n.º 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
        }