コード例 #1
0
ファイル: EFIS_Adapter.cs プロジェクト: gemgit7/AvionicsSIM
        public ActionResult HSIReadout(int symbolGeneratorId, string categoryId)
        {
            // Make sure we can load the requested category first.
            Category category = categoryService.getCategory(categoryId);

            // Read the airframe data from the central symbol generator
            // first before attempting to cross-read from the co-pilot's
            // SG.
            AirframeData airframeData = airframeDataService.read(GenType.CENTRAL, category);

            if (airframeData == null)
            {
                airframeData = airframeDataService.read(GenType.COPILOT, category);
            }

            // Split the data based on EFIS components
            HSIDTO hsiDto = airframeData.splitHsi();

            // Extract/transform the data required for the PFD
            ViewData.hsi = hsiDto.floatV();

            // Use the SimSecurityService to sanitize the category ID
            string sanitizedCatId = simSecurityService.sanitizeForXSS(categoryId);

            // Spit out the category ID as well, for SIM tracking purposes.
            // In a real EFIS, the category is not a display item.
            ViewData.categoryId = sanitizedCatId;

            return(View());
        }
コード例 #2
0
ファイル: EFIS_Adapter.cs プロジェクト: gemgit7/AvionicsSIM
        public ActionResult NavModeReadout(int symbolGeneratorId, string categoryId)
        {
            // Make sure we can load the requested category first.
            Category category = categoryService.getCategory(categoryId);

            // Read the airframe data from the central symbol generator
            // first before attempting to cross-read from the co-pilot's
            // SG.
            AirframeData airframeData = airframeDataService.read(GenType.CENTRAL, category);

            if (airframeData == null)
            {
                airframeData = airframeDataService.read(GenType.COPILOT, category);
            }

            // Split out the AP system data as well
            APSystem apSys = apDataService.readAPData(categoryId);

            // Extract/transform the data required for the PFD
            // TODO: For LNAV, make sure to read Vertical Guidance data
            ViewData.navMode = apSys.navMode.floatV();

            // Use the SimSecurityService to sanitize the category ID
            string sanitizedCatId = simSecurityService.sanitizeForXSS(categoryId);

            // Spit out the category ID as well, for SIM tracking purposes.
            // In a real EFIS, the category is not a display item.
            ViewData.categoryId = sanitizedCatId;

            return(View());
        }