ACAT.Lib.Core.PanelManagement.PreferredPanelConfig.GetConfigName C# (CSharp) Method

GetConfigName() public method

Looks up the map table and returns the name of the configuration for the specified scanner
public GetConfigName ( String panelClass ) : String
panelClass String scanner
return String
        public String GetConfigName(String panelClass)
        {
            foreach (var configName in _preferredConfigNames)
            {
                if (_mapping.ContainsKey(configName))
                {
                    var panelMapping = _mapping[configName];
                    String str = panelClass.ToLower().Trim();
                    if (panelMapping.ContainsKey(str))
                    {
                        return panelMapping[str];
                    }
                }
            }
            return String.Empty;
        }

Usage Example

Example #1
0
        /// <summary>
        /// Returns the config map for the specified scanner.  Looks up
        /// the preferred config map first to see if there is a config
        /// entry that has been specifically configured for the scanner.
        /// If not, it looks up the map talbe
        /// </summary>
        /// <param name="panel">Name of the scanner</param>
        /// <returns>Panel config map object</returns>
        public static PanelConfigMapEntry GetPanelConfigMapEntry(String panel)
        {
            PanelConfigMapEntry        retVal = null;
            List <PanelConfigMapEntry> list   = null;

            _mapTable.TryGetValue(panel, out list);

            if (list == null || list.Count <= 0)
            {
                return(null);
            }

            var configName = _preferredPanelConfig.GetConfigName(panel);

            if (!String.IsNullOrEmpty(configName))
            {
                retVal = findMapEntryInList(configName, list);
            }

            if (retVal == null)
            {
                retVal = findMapEntryInMapTable(configName);
            }

            if (retVal == null)
            {
                retVal = list[0];
            }

            return(retVal);
        }