Ejemplo n.º 1
0
        public Launcher434(AppRegInfo appReg, MainWindow mainWindow) : base(appReg, mainWindow)
        {
            mainWindow.Misc_Platform.IsChecked  = true;
            mainWindow.Misc_Platform.Visibility = Visibility.Hidden;
            mainWindow.Label_Platform.Content   = "Platform : BMS 4.34 is 64-bit appreciation.";

            mainWindow.CMD_BW.Visibility = Visibility.Hidden;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Read theater.lst and apply the list to Combobox.
        /// </summary>
        public static void PopulateAndSave(AppRegInfo appReg, ComboBox Combo)
        {
            if (!Directory.Exists(appReg.GetInstallDir() + "/User/Config/Backup/"))
            {
                Directory.CreateDirectory(appReg.GetInstallDir() + "/User/Config/Backup/");
            }

            string filename    = appReg.GetInstallDir() + "/Data/Terrdata/TheaterDefinition/theater.lst";
            string fbackupname = appReg.GetInstallDir() + "/User/Config/Backup/theater.lst";

            if (!File.Exists(fbackupname) & File.Exists(filename))
            {
                File.Copy(filename, fbackupname, false);
            }
            File.SetAttributes(filename, File.GetAttributes(filename) & ~FileAttributes.ReadOnly);

            var theaterFiles = Directory.GetFiles(appReg.GetInstallDir() + "/Data", "*.tdf", SearchOption.AllDirectories);

            System.Array.Sort(theaterFiles);

            // Write all TDFs to the theater list, slicing the install dir off.
            var dataDirLength = appReg.GetInstallDir().Length + "/Data/".Length;

            File.WriteAllLines(filename, theaterFiles.Select(t => t.Substring(dataDirLength)).ToArray());

            List <string> theaters = new List <string>();

            foreach (string tdf in theaterFiles)
            {
                IEnumerable <string> lines = File.ReadLines(tdf, Encoding.UTF8);
                foreach (string str in lines)
                {
                    if (str.Contains("name "))
                    {
                        theaters.Add(str.Replace("name ", "").Trim());
                        break;
                    }
                }
            }

            Combo.SelectedIndex = -1;
            Combo.Items.Clear();

            for (int ii = 0; ii < theaters.Count; ii++)
            {
                Combo.Items.Add(theaters[ii]);
                if (theaters[ii] == appReg.GetCurrentTheater())
                {
                    Combo.SelectedIndex = ii;
                }
            }
        }
Ejemplo n.º 3
0
        public Launcher432(AppRegInfo appReg, MainWindow mainWindow) : base(appReg, mainWindow)
        {
            mainWindow.Misc_Platform.IsChecked  = false;
            mainWindow.Misc_Platform.Visibility = Visibility.Hidden;
            mainWindow.Label_Platform.Content   = "Platform : BMS 4.35 64-bit.";

            mainWindow.Launch_AVC.Visibility = Visibility.Hidden;
            mainWindow.Label_AVC.Visibility  = Visibility.Hidden;

            mainWindow.Name_FLIR_Brightness.Visibility  = Visibility.Hidden;
            mainWindow.Label_FLIR_Brightness.Visibility = Visibility.Hidden;
            mainWindow.Axis_FLIR_Brightness.Visibility  = Visibility.Hidden;
            mainWindow.FLIR_Brightness.Visibility       = Visibility.Hidden;

            mainWindow.Name_AI_vs_IVC.Visibility  = Visibility.Hidden;
            mainWindow.Label_AI_vs_IVC.Visibility = Visibility.Hidden;
            mainWindow.Axis_AI_vs_IVC.Visibility  = Visibility.Hidden;
            mainWindow.AI_vs_IVC.Visibility       = Visibility.Hidden;

            mainWindow.Tab_HSI_and_Altimeter.Visibility    = Visibility.Collapsed;
            mainWindow.Misc_NaturalHeadMovement.Visibility = Visibility.Collapsed;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Read theater.lst and apply the list to Combobox.
        /// </summary>
        public static void Populate(AppRegInfo appReg, ComboBox Combo)
        {
            string filename = appReg.GetInstallDir() + "/Data/Terrdata/theaterdefinition/theater.lst";

            if (File.Exists(filename) == false)
            {
                return;
            }
            IEnumerable <string> theaterPaths = File.ReadLines(filename, Encoding.UTF8)
                                                .Select(line => line.Trim())                                // Trim whitespace
                                                .Where(line => line.Length > 0 && !line.StartsWith("#"))    // Throw out empty lines, comments, etc.
                                                .Select(line => appReg.GetInstallDir() + "\\Data\\" + line) // Construct TDF file path
                                                .Where(tdf => File.Exists(tdf));                            // Throw out paths we can't find

            List <string> theaters = new List <string>();

            foreach (string tdf in theaterPaths)
            {
                IEnumerable <string> lines = File.ReadLines(tdf, Encoding.UTF8);
                foreach (string str in lines)
                {
                    if (str.Contains("name "))
                    {
                        theaters.Add(str.Replace("name ", "").Trim());
                        break;
                    }
                }
            }
            theaters.Sort();

            for (int ii = 0; ii < theaters.Count; ii++)
            {
                Combo.Items.Add(theaters[ii]);
                if (theaters[ii] == appReg.GetCurrentTheater())
                {
                    Combo.SelectedIndex = ii;
                }
            }
        }
Ejemplo n.º 5
0
 public Launcher433(AppRegInfo appReg, MainWindow mainWindow) : base(appReg, mainWindow)
 {
     mainWindow.Tab_HSI_and_Altimeter.Visibility    = Visibility.Collapsed;
     mainWindow.Misc_NaturalHeadMovement.Visibility = Visibility.Collapsed;
 }
Ejemplo n.º 6
0
 public Launcher(AppRegInfo appReg, MainWindow mainWindow)
 {
     this.appReg     = appReg;
     this.mainWindow = mainWindow;
 }