public IPsdzStandardSvt BuildStandardSvtActualFromVehicleContext(IVehicle vehicleContext, IEnumerable <IPsdzEcuIdentifier> ecuListFromPsdz = null) { MethodBase currentMethod = MethodBase.GetCurrentMethod(); IPsdzStandardSvt result; try { PsdzStandardSvt psdzStandardSvt = null; if (vehicleContext != null && vehicleContext.ECU != null) { psdzStandardSvt = new PsdzStandardSvt(); IList <IPsdzEcu> list = new List <IPsdzEcu>(); using (IEnumerator <IEcu> enumerator = vehicleContext.ECU.GetEnumerator()) { while (enumerator.MoveNext()) { IEcu srcEcu = enumerator.Current; PsdzEcu psdzEcu = new PsdzEcu(); IPsdzEcuIdentifier psdzEcuIdentifier = (ecuListFromPsdz == null) ? null : ecuListFromPsdz.FirstOrDefault((IPsdzEcuIdentifier e) => e.DiagAddrAsInt == (int)srcEcu.ID_SG_ADR); if (psdzEcuIdentifier != null) { psdzEcu.PrimaryKey = this.BuildEcuIdentifier((int)srcEcu.ID_SG_ADR, psdzEcuIdentifier.BaseVariant); } else { psdzEcu.PrimaryKey = this.BuildEcuIdentifier((int)srcEcu.ID_SG_ADR, srcEcu.ECU_GROBNAME); } PsdzStandardSvk psdzStandardSvk = new PsdzStandardSvk(); PsdzClient.Utility.SgbmIdParser sgbmIdParser = new PsdzClient.Utility.SgbmIdParser(); IList <IPsdzSgbmId> list2 = new List <IPsdzSgbmId>(); foreach (string sgbmId in srcEcu.SVK.XWE_SGBMID) { if (sgbmIdParser.ParseDec(sgbmId)) { IPsdzSgbmId item = this.BuildPsdzSgbmId(sgbmIdParser.ProcessClass, sgbmIdParser.Id, sgbmIdParser.MainVersion, sgbmIdParser.SubVersion, sgbmIdParser.PatchVersion); list2.Add(item); } } psdzStandardSvk.SgbmIds = list2; psdzEcu.StandardSvk = psdzStandardSvk; list.Add(psdzEcu); } } psdzStandardSvt.Ecus = list; } result = psdzStandardSvt; } catch (Exception) { result = null; } return(result); }
private string GetSgbmIdActual(IPsdzSgbmId target) { if (this.SvkCurrent != null && this.SvkCurrent.SgbmIds != null) { using (IEnumerator <ISgbmId> enumerator = this.data.SvkCurrent.SgbmIds.GetEnumerator()) { while (enumerator.MoveNext()) { ISgbmId sgbmId = enumerator.Current; if (sgbmId != null && target.ProcessClass == sgbmId.ProcessClass && target.IdAsLong == sgbmId.Id) { return(sgbmId.ToString()); } } } } return("--"); }
private IList <SgbmIdChange> GetSgbmIds(IPsdzTalLine talLine) { IList <SgbmIdChange> list = new List <SgbmIdChange>(); foreach (IPsdzTa psdzTa in talLine.TaCategory.Tas) { IPsdzSgbmId sgbmId = psdzTa.SgbmId; if (sgbmId != null) { SgbmIdentifier sgbmIdentifier = new SgbmIdentifier(); sgbmIdentifier.ProcessClass = sgbmId.ProcessClass; sgbmIdentifier.Id = sgbmId.IdAsLong; sgbmIdentifier.MainVersion = sgbmId.MainVersion; sgbmIdentifier.SubVersion = sgbmId.SubVersion; sgbmIdentifier.PatchVersion = sgbmId.PatchVersion; list.Add(new SgbmIdChange(this.GetSgbmIdActual(sgbmId), sgbmIdentifier.ToString())); } } return(list); }
public IPsdzNcd ReadNcdFromFile(string ncdDirectory, IPsdzVin vin, IPsdzSgbmId cafdSgbmid, string btldSgbmNumber) { return(base.CallFunction <IPsdzNcd>((ISecureCodingService service) => service.ReadNcdFromFile(ncdDirectory, vin, cafdSgbmid, btldSgbmNumber))); }
public bool SaveNCD(IPsdzNcd ncd, string btldSgbmNumber, IPsdzSgbmId cafdSgbmid, string ncdDirectory, IPsdzVin vin) { return(base.CallFunction <bool>((ISecureCodingService service) => service.SaveNCD(ncd, btldSgbmNumber, cafdSgbmid, ncdDirectory, vin))); }