Ejemplo n.º 1
0
 public void OnProgrammingActionStateChanged(IEcu ecu, ProgrammingActionType programmingActionType, ProgrammingActionState programmingActionState)
 {
     if (this.ProgrammingEventRaised != null)
     {
         this.ProgrammingEventRaised(this, new ProgrammingActionStateChangedEventArgs(DateTime.Now, ecu, programmingActionType, programmingActionState));
     }
 }
Ejemplo n.º 2
0
        public static bool IsUsedSpecificRoutingTable(IEcu ecu)
        {
            IList <long> list = new List <long>();

            list.Add(41L);
            return(ecu != null && !list.Contains(ecu.ID_SG_ADR) && !ecu.IsVirtualOrVirtualBusCheck());
        }
Ejemplo n.º 3
0
 internal EcuProgrammingInfo GetItem(IEcu ecu)
 {
     if (this.ecuProgrammingInfosMap.ContainsKey(ecu))
     {
         return(this.ecuProgrammingInfosMap[ecu]);
     }
     return(null);
 }
Ejemplo n.º 4
0
        IEcuProgrammingInfo IEcuProgrammingInfos.GetItem(IEcu ecu)
        {
            EcuProgrammingInfo item = this.GetItem(ecu);

            if (item == null)
            {
                return(null);
            }
            return(item.Data);
        }
Ejemplo n.º 5
0
 public static bool IsFlashableOverMost(IEcu ecu)
 {
     if (ecu.BUS != BusType.MOST)
     {
         if (ecu.BUS != BusType.VIRTUAL || ecu.ID_SG_ADR != 160L)
         {
             return(false);
         }
     }
     return(true);
 }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
 internal ProgrammingAction(IEcu parentEcu, ProgrammingActionType type, bool isEditable, int order)
 {
     this.data                  = new ProgrammingActionData();
     this.ParentEcu             = parentEcu;
     this.data.ParentEcu        = parentEcu;
     this.data.Type             = type;
     this.data.IsEditable       = isEditable;
     this.data.Order            = order;
     this.data.StateProgramming = ProgrammingActionState.ActionPlanned;
     this.SgbmIds               = new List <ISgbmIdChange>();
     //this.EscalationSteps = new List<IEscalationStep>();
     //this.Title = ProgrammingAction.BuildTitle(this.Type, this.ParentEcu, ConfigSettings.CurrentUICulture);
     this.data.Channel = string.Empty;
     this.data.Note    = string.Empty;
 }
Ejemplo n.º 8
0
        internal EcuProgrammingInfo AddEcuProgrammingInfo(IEcu ecu)
        {
            if (this.GetItemFromProgrammingInfos(ecu.ID_SG_ADR) != null)
            {
                throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, "Diagnosis address 0x{0:X2} is already added.", ecu.ID_SG_ADR));
            }
            EcuProgrammingInfo ecuProgrammingInfo = new EcuProgrammingInfo(ecu, this.programmingObjectBuilder, true);

            this.RegisterEventHandler(ecuProgrammingInfo);
            this.ecuProgrammingInfos.Add(ecuProgrammingInfo);
            this.DataContext.List.Add(ecuProgrammingInfo.Data);
            this.AddProgrammingInfoBeforeReplace(ecuProgrammingInfo.Data);
            this.ecuProgrammingInfosMap.Add(ecuProgrammingInfo.Ecu, ecuProgrammingInfo);
            return(ecuProgrammingInfo);
        }
Ejemplo n.º 9
0
 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();
 }
Ejemplo n.º 10
0
        public void SelectReplacementForIndustrialCustomer(IEcu ecu, string category, bool value)
        {
            IEcuProgrammingInfo item = this.GetItem(ecu, category);

            if (item == null)
            {
                throw new ArgumentNullException("ecu");
            }
            IProgrammingAction programmingAction = item.GetProgrammingAction(ProgrammingActionType.Replacement);

            if (programmingAction == null)
            {
                return;
            }
            programmingAction.Select(value);
        }
Ejemplo n.º 11
0
 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;
     }
 }
Ejemplo n.º 12
0
        public void SelectCodingForIndustrialCustomer(IEcu ecu, string category, bool value)
        {
            IEcuProgrammingInfo item = this.GetItem(ecu, category);

            if (item == null)
            {
                throw new ArgumentNullException("ecu");
            }
            IProgrammingAction programmingAction = item.GetProgrammingAction(ProgrammingActionType.Coding);

            if (programmingAction != null)
            {
                programmingAction.Select(value);
            }
            if (programmingAction != null)
            {
                item.IsCodingScheduled = value;
            }
        }
Ejemplo n.º 13
0
 public ProgrammingActionStateChangedEventArgs(DateTime timestamp, IEcu ecu, ProgrammingActionType programmingActionType, ProgrammingActionState programmingActionState) : base(timestamp)
 {
     this.Ecu = ecu;
     this.ProgrammingActionType  = programmingActionType;
     this.ProgrammingActionState = programmingActionState;
 }
Ejemplo n.º 14
0
 public virtual IEcuProgrammingInfo GetItem(IEcu ecu, string category)
 {
     return(this.GetItem(ecu));
 }