public AeroSceneryManager()
        {
            bingOrthophotoSource   = new BingOrthophotoSource();
            googleOrthophotoSource = new GoogleOrthophotoSource();
            usgsOrthophotoSource   = new USGSOrthophotoSource();

            downloadManager   = new DownloadManager();
            geoConvertManager = new GeoConvertManager();
            imageTileService  = new ImageTileService();
            tileStitcher      = new TileStitcher();
            settingsService   = new SettingsService();
            gridSquareMapper  = new GridSquareMapper();
            afsFileGenerator  = new AFSFileGenerator();
            dataRepository    = new SqlLiteDataRepository();

            imageTiles         = null;
            version            = "1.0";
            incrementalVersion = 8;
        }
示例#2
0
        public void Initialize()
        {
            // Create settings if required and read them
            this.settings = settingsService.GetSettings();
            settingsService.LogSettings(this.settings);
            settingsService.CheckConfiguredDirectories(this.settings);

            this.dataRepository.Settings = settings;
            this.dataRepository.UpgradeDatabase();

            var gridSquareNameFixer = new GridSquareNameFixer(settings, this.dataRepository, this.settingsService);

            gridSquareNameFixer.FixGridSquareNames();

            bingOrthophotoSource   = new BingOrthophotoSource(settings.OrthophotoSourceSettings.BN_OrthophotoSourceUrlTemplate);
            googleOrthophotoSource = new GoogleOrthophotoSource(settings.OrthophotoSourceSettings.GM_OrthophotoSourceUrlTemplate);
            usgsOrthophotoSource   = new USGSOrthophotoSource();


            this.mainForm = new MainForm();
            this.mainForm.StartStopClicked += async(sender, eventArgs) =>
            {
                if (this.mainForm.ActionsRunning)
                {
                    await StartSceneryGenerationProcessAsync(sender, eventArgs);
                }
                else
                {
                    StopSceneryGenerationProcess(sender, eventArgs);
                }
            };

            this.mainForm.ResetGridSquare += (sender, name) =>
            {
                this.ResetGridSquare(name);
            };

            this.mainForm.Initialize();
            Application.Run(this.mainForm);
        }