Exemplo n.º 1
0
        public IStandardSvk Build(IPsdzStandardSvk svkInput)
        {
            if (svkInput == null)
            {
                return(null);
            }
            SystemVerbauKennung systemVerbauKennung = new SystemVerbauKennung();

            systemVerbauKennung.SvkVersion     = svkInput.SvkVersion;
            systemVerbauKennung.ProgDepChecked = svkInput.ProgDepChecked;
            IEnumerable <IPsdzSgbmId> sgbmIds = svkInput.SgbmIds;

            if (sgbmIds != null)
            {
                List <ISgbmId> list = new List <ISgbmId>();
                foreach (IPsdzSgbmId psdzSgbmId in sgbmIds)
                {
                    list.Add(new SgbmIdentifier
                    {
                        ProcessClass = psdzSgbmId.ProcessClass,
                        Id           = psdzSgbmId.IdAsLong,
                        MainVersion  = psdzSgbmId.MainVersion,
                        SubVersion   = psdzSgbmId.SubVersion,
                        PatchVersion = psdzSgbmId.PatchVersion
                    });
                }
                list.Sort();
                systemVerbauKennung.SgbmIds = list;
            }
            return(systemVerbauKennung);
        }
Exemplo n.º 2
0
        private IPsdzEcu CreateEcu(IEcuObj ecuInput)
        {
            if (ecuInput == null)
            {
                return(null);
            }
            PsdzEcu psdzEcu = new PsdzEcu();

            psdzEcu.PrimaryKey  = this.BuildEcuIdentifier(ecuInput.EcuIdentifier);
            psdzEcu.BaseVariant = ecuInput.BaseVariant;
            psdzEcu.EcuVariant  = ecuInput.EcuVariant;
            psdzEcu.BnTnName    = ecuInput.BnTnName;
            if (ecuInput.GatewayDiagAddrAsInt != null)
            {
                psdzEcu.GatewayDiagAddr = this.BuildDiagAddress(ecuInput.GatewayDiagAddrAsInt.Value);
            }
            psdzEcu.DiagnosticBus = this.busEnumMapper.GetValue(ecuInput.DiagnosticBus);
            psdzEcu.SerialNumber  = ecuInput.SerialNumber;
            if (ecuInput.EcuDetailInfo != null)
            {
                psdzEcu.EcuDetailInfo = new PsdzEcuDetailInfo
                {
                    ByteValue = ecuInput.EcuDetailInfo.Value
                };
            }
            if (ecuInput.EcuStatusInfo != null)
            {
                psdzEcu.EcuStatusInfo = new PsdzEcuStatusInfo
                {
                    ByteValue         = ecuInput.EcuStatusInfo.Value,
                    HasIndividualData = ecuInput.EcuStatusInfo.HasIndividualData
                };
            }
            psdzEcu.BusConnections = ((ecuInput.BusConnections != null) ? ecuInput.BusConnections.Select(new Func <Bus, PsdzBus>(this.busEnumMapper.GetValue)) : null);
            IPsdzStandardSvk standardSvk = this.BuildSvk(ecuInput.StandardSvk);

            psdzEcu.StandardSvk    = standardSvk;
            psdzEcu.PsdzEcuPdxInfo = this.BuildPdxInfo(ecuInput.EcuPdxInfo);
            return(psdzEcu);
        }