public EcuFunctionStructs.EcuFaultData GetEcuFaultData(string language) { string fileName = FaultDataBaseName + language.ToLowerInvariant(); EcuFunctionStructs.EcuFaultData ecuFaultData = GetEcuDataObject(fileName, typeof(EcuFunctionStructs.EcuFaultData)) as EcuFunctionStructs.EcuFaultData; if (ecuFaultData == null) { fileName = FaultDataBaseName + "en"; ecuFaultData = GetEcuDataObject(fileName, typeof(EcuFunctionStructs.EcuFaultData)) as EcuFunctionStructs.EcuFaultData; } return(ecuFaultData); }
public EcuFunctionStructs.EcuFaultData GetEcuFaultDataCached(string language) { if (IsInitRequired(language)) { Reset(); _ecuFaultData = GetEcuFaultData(language); if (_ecuFaultData != null) { _ecuFaultDataLanguage = language; if (_ecuFaultData.EcuFaultCodeLabelList != null) { foreach (EcuFunctionStructs.EcuFaultCodeLabel ecuFaultCodeLabel in _ecuFaultData.EcuFaultCodeLabelList) { string key = ecuFaultCodeLabel.Id.ToLowerInvariant(); _ecuFaultCodeLabelDict.TryAdd(key, ecuFaultCodeLabel); } } if (_ecuFaultData.EcuFaultModeLabelList != null) { foreach (EcuFunctionStructs.EcuFaultModeLabel ecuFaultModeLabel in _ecuFaultData.EcuFaultModeLabelList) { string key = ecuFaultModeLabel.Id.ToLowerInvariant(); _ecuFaultModeLabelDict.TryAdd(key, ecuFaultModeLabel); } } if (_ecuFaultData.EcuEnvCondLabelList != null) { foreach (EcuFunctionStructs.EcuEnvCondLabel ecuEnvCondLabel in _ecuFaultData.EcuEnvCondLabelList) { string key = ecuEnvCondLabel.Id.ToLowerInvariant(); _ecuEnvCondLabelDict.TryAdd(key, ecuEnvCondLabel); } } } } return(_ecuFaultData); }