public ISvt Build(IPsdzSollverbauung sollVerbauung, IDictionary <string, string> orderNumbers)
 {
     if (sollVerbauung != null && sollVerbauung.Svt != null)
     {
         IPsdzSvt            svt                 = sollVerbauung.Svt;
         IPsdzOrderList      psdzOrderList       = sollVerbauung.PsdzOrderList;
         SystemVerbauTabelle systemVerbauTabelle = new SystemVerbauTabelle();
         systemVerbauTabelle.Version         = svt.Version;
         systemVerbauTabelle.HoSignature     = svt.HoSignature;
         systemVerbauTabelle.HoSignatureDate = svt.HoSignatureDate;
         IEnumerable <IPsdzEcu> ecus = svt.Ecus;
         if (ecus != null)
         {
             foreach (IPsdzEcu psdzEcu in ecus)
             {
                 IEcuObj ecuObj = this.Build(psdzEcu);
                 if (orderNumbers != null && orderNumbers.Any <KeyValuePair <string, string> >())
                 {
                     string key = this.BuildKey(psdzEcu);
                     if (orderNumbers.ContainsKey(key))
                     {
                         ((EcuObj)ecuObj).OrderNumber = orderNumbers[key];
                     }
                 }
                 systemVerbauTabelle.AddEcu(ecuObj);
             }
         }
         return(systemVerbauTabelle);
     }
     return(null);
 }
        public ECU Build(IEcuObj ecuInput)
        {
            ECU    ecu    = null;
            EcuObj ecuObj = ecuInput as EcuObj;

            if (ecuObj != null)
            {
                ecu               = new ECU();
                ecu.ID_SG_ADR     = (long)ecuObj.EcuIdentifier.DiagAddrAsInt;
                ecu.TITLE_ECUTREE = ecuObj.EcuRep;
                ecu.ECU_SGBD      = ecuObj.EcuVariant;
                ecu.VARIANTE      = ecuObj.EcuVariant;
                ecu.ECU_GRUPPE    = ecuObj.EcuGroup;
                ecu.ECU_GROBNAME  = ecuObj.BaseVariant;
                //ecu.XepEcuClique = ecuObj.XepEcuClique;
                //ecu.ECUTitle = ((ecuObj.XepEcuClique != null) ? ecuObj.XepEcuClique.Title : string.Empty);
                //ecu.XepEcuVariant = ecuObj.XepEcuVariant;
                ecu.ProgrammingVariantName = ecuObj.BnTnName;
                ecu.StatusInfo             = ecuObj.EcuStatusInfo;
            }
#if false
            if (ecu.XepEcuVariant == null)
            {
                this.vdc.FillEcuNames(ecu, this.vehicle, this.ffmResolver);
            }
#endif
            return(ecu);
        }
        public ISvt Build(IPsdzStandardSvt svtInput)
        {
            if (svtInput == null)
            {
                return(null);
            }
            SystemVerbauTabelle systemVerbauTabelle = new SystemVerbauTabelle();

            systemVerbauTabelle.Version         = svtInput.Version;
            systemVerbauTabelle.HoSignature     = svtInput.HoSignature;
            systemVerbauTabelle.HoSignatureDate = svtInput.HoSignatureDate;
            IEnumerable <IPsdzEcu> ecus = svtInput.Ecus;

            if (ecus != null)
            {
                foreach (IPsdzEcu ecuInput in ecus)
                {
                    IEcuObj ecu = this.Build(ecuInput);
                    if (ecu != null)
                    {
                        systemVerbauTabelle.AddEcu(ecu);
                    }
                }
            }
            return(systemVerbauTabelle);
        }
        public void FillOrderNumbers(IPsdzSollverbauung sollVerbauung, IDictionary <string, string> result)
        {
            IPsdzStandardSvt       svt           = sollVerbauung.Svt;
            IPsdzOrderList         psdzOrderList = sollVerbauung.PsdzOrderList;
            IEnumerable <IPsdzEcu> ecus          = svt.Ecus;

            if (ecus == null)
            {
                return;
            }
            foreach (IPsdzEcu ecuInput in ecus)
            {
                IEcuObj ecuObj = this.Build(ecuInput);
                if (psdzOrderList != null && psdzOrderList.BntnVariantInstances != null)
                {
                    foreach (IPsdzEcuVariantInstance psdzEcuVariantInstance in psdzOrderList.BntnVariantInstances)
                    {
                        IPsdzEcu       ecu           = psdzEcuVariantInstance.Ecu;
                        string         a             = (ecu != null) ? ecu.BaseVariant : null;
                        IEcuIdentifier ecuIdentifier = ecuObj.EcuIdentifier;
                        if (a == ((ecuIdentifier != null) ? ecuIdentifier.BaseVariant : null))
                        {
                            IPsdzEcu ecu2 = psdzEcuVariantInstance.Ecu;
                            int?     num;
                            if (ecu2 == null)
                            {
                                num = null;
                            }
                            else
                            {
                                IPsdzEcuIdentifier primaryKey = ecu2.PrimaryKey;
                                num = ((primaryKey != null) ? new int?(primaryKey.DiagAddrAsInt) : null);
                            }
                            int?           num2           = num;
                            IEcuIdentifier ecuIdentifier2 = ecuObj.EcuIdentifier;
                            int?           num3           = (ecuIdentifier2 != null) ? new int?(ecuIdentifier2.DiagAddrAsInt) : null;
                            if (num2.GetValueOrDefault() == num3.GetValueOrDefault() & num2 != null == (num3 != null))
                            {
                                string         key           = this.BuildKey(psdzEcuVariantInstance.Ecu);
                                IPsdzOrderPart orderablePart = psdzEcuVariantInstance.OrderablePart;
                                result.Add(key, (orderablePart != null) ? orderablePart.SachNrTais : null);
                                break;
                            }
                        }
                    }
                }
            }
        }
Esempio n. 5
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);
        }
Esempio n. 6
0
 internal void AddEcu(IEcuObj ecu)
 {
     this.ecus.Add(ecu);
 }
Esempio n. 7
0
 public bool RemoveEcu(IEcuObj ecu)
 {
     return(this.ecus.Remove(ecu));
 }
Esempio n. 8
0
        public bool UpdateVehicle(ProgrammingService programmingService, IPsdzStandardSvt psdzStandardSvt)
        {
            if (Vehicle == null)
            {
                return(false);
            }

            ProgrammingObjectBuilder programmingObjectBuilder = programmingService.ProgrammingInfos.ProgrammingObjectBuilder;

            Vehicle.VehicleIdentLevel       = IdentificationLevel.VINVehicleReadout;
            Vehicle.VehicleIdentAlreadyDone = true;
            Vehicle.ILevelWerk  = IstufeShipment;
            Vehicle.ILevel      = IstufeCurrent;
            Vehicle.BNType      = GetBnType();
            Vehicle.VIN17       = DetectVehicle.Vin;
            Vehicle.Modelljahr  = DetectVehicle.ConstructYear;
            Vehicle.Modellmonat = DetectVehicle.ConstructMonth;
            Vehicle.SetVINRangeTypeFromVINRanges();

            CharacteristicExpression.EnumBrand brand = CharacteristicExpression.EnumBrand.BMWBMWiMINI;
            if (Vehicle.IsMotorcycle())
            {
                brand = CharacteristicExpression.EnumBrand.BMWMotorrad;
            }

            ClientContext clientContext = ClientContext.GetClientContext(Vehicle);

            if (clientContext != null)
            {
                clientContext.SelectedBrand = brand;
            }

            for (int i = 0; i < 2; i++)
            {
                ObservableCollection <ECU> EcuList = new ObservableCollection <ECU>();
                foreach (PdszDatabase.EcuInfo ecuInfo in DetectVehicle.EcuList)
                {
                    IEcuObj ecuObj = programmingObjectBuilder.Build(ecuInfo.PsdzEcu);
                    ECU     ecu    = programmingObjectBuilder.Build(ecuObj);
                    if (ecu != null)
                    {
                        if (string.IsNullOrEmpty(ecu.ECU_NAME))
                        {
                            ecu.ECU_NAME = ecuInfo.Name;
                        }

                        if (string.IsNullOrEmpty(ecu.ECU_SGBD))
                        {
                            ecu.ECU_SGBD = ecuInfo.Sgbd;
                        }

                        if (string.IsNullOrEmpty(ecu.ECU_GRUPPE))
                        {
                            ecu.ECU_GRUPPE = ecuInfo.Grp;
                        }
                        EcuList.Add(ecu);
                    }
                }

                Vehicle.ECU = EcuList;
            }

            List <PdszDatabase.Characteristics> characteristicsList = programmingService.PdszDatabase.GetVehicleCharacteristics(Vehicle);

            if (characteristicsList == null)
            {
                return(false);
            }
            VehicleCharacteristicIdent vehicleCharacteristicIdent = new VehicleCharacteristicIdent();

            foreach (PdszDatabase.Characteristics characteristics in characteristicsList)
            {
                if (!vehicleCharacteristicIdent.AssignVehicleCharacteristic(characteristics.RootNodeClass, Vehicle, characteristics))
                {
                    return(false);
                }
            }

            return(true);
        }
Esempio n. 9
0
 public IPsdzEcu BuildEcu(IEcuObj ecuInput)
 {
     return(this.CreateEcu(ecuInput));
 }