public EcuProgrammingInfo(IEcu ecu, ProgrammingObjectBuilder programmingObjectBuilder, bool withInitData = true) { if (ecu == null) { throw new ArgumentNullException("ecu"); } if (programmingObjectBuilder == null) { throw new ArgumentNullException("programmingObjectBuilder"); } if (withInitData) { this.InitData(ecu, programmingObjectBuilder); } this.Init(); }
protected void InitData(IEcu ecu, ProgrammingObjectBuilder programmingObjectBuilder) { if (this.data == null) { this.data = new EcuProgrammingInfoData(); } this.Ecu = ecu; this.data.EcuTitle = this.Ecu.TITLE_ECUTREE; try { this.SvkCurrent = programmingObjectBuilder.Build(ecu.SVK); } catch (Exception) { //Log.WarningException("EcuProgrammingInfo.EcuProgrammingInfo()", exception); this.SvkCurrent = null; } }
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); }