Beispiel #1
0
 private void UpdateProgrammingAction(IPsdzTransactionEvent psdzEvent)
 {
     try
     {
         EcuProgrammingInfo correspondingEcu = this.GetCorrespondingEcu(psdzEvent);
         if (correspondingEcu != null)
         {
             PsdzTransactionInfo transactionInfo = psdzEvent.TransactionInfo;
             PsdzTaCategories    transactionType = psdzEvent.TransactionType;
             if (transactionType != PsdzTaCategories.FscDeploy)
             {
                 if (transactionType != PsdzTaCategories.SFADeploy)
                 {
                     ProgrammingActionType? programmingActionType  = this.Map(transactionType);
                     ProgrammingActionState?programmingActionState = this.Map(transactionInfo);
                     if (programmingActionType != null && programmingActionState != null)
                     {
                         correspondingEcu.UpdateSingleProgrammingAction(programmingActionType.Value, programmingActionState.Value, false);
                         return;
                     }
                     return;
                 }
             }
             IEnumerable <IPsdzTalLine> talLines = from talLine in this.psdzContext.Tal.TalLines
                                                   where talLine.EcuIdentifier.Equals(psdzEvent.EcuId)
                                                   select talLine;
             correspondingEcu.UpdateProgrammingActions(talLines, false, 0);
         }
         return;
     }
     catch (Exception)
     {
     }
 }
Beispiel #2
0
        private ProgrammingActionType?Map(PsdzTaCategories cat)
        {
            switch (cat)
            {
            case PsdzTaCategories.BlFlash:
                return(new ProgrammingActionType?(ProgrammingActionType.BootloaderProgramming));

            case PsdzTaCategories.CdDeploy:
                return(new ProgrammingActionType?(ProgrammingActionType.Coding));

            case PsdzTaCategories.FscBackup:
                return(new ProgrammingActionType?(ProgrammingActionType.FscBakup));

            case PsdzTaCategories.FscDeploy:
                return(new ProgrammingActionType?(ProgrammingActionType.FscActivate));

            case PsdzTaCategories.GatewayTableDeploy:
            case PsdzTaCategories.SwDeploy:
                return(new ProgrammingActionType?(ProgrammingActionType.Programming));

            case PsdzTaCategories.HddUpdate:
                return(new ProgrammingActionType?(ProgrammingActionType.HddUpdate));

            case PsdzTaCategories.HwDeinstall:
                return(new ProgrammingActionType?(ProgrammingActionType.Unmounting));

            case PsdzTaCategories.HwInstall:
                return(new ProgrammingActionType?(ProgrammingActionType.Mounting));

            case PsdzTaCategories.IbaDeploy:
                return(new ProgrammingActionType?(ProgrammingActionType.IbaDeploy));

            case PsdzTaCategories.IdBackup:
                return(new ProgrammingActionType?(ProgrammingActionType.IdSave));

            case PsdzTaCategories.IdRestore:
                return(new ProgrammingActionType?(ProgrammingActionType.IdRestore));

            case PsdzTaCategories.SFADeploy:
                return(new ProgrammingActionType?(ProgrammingActionType.SFAWrite));

            case PsdzTaCategories.EcuActivate:
            case PsdzTaCategories.EcuPoll:
            case PsdzTaCategories.EcuMirrorDeploy:
                //Log.Warning(Log.CurrentMethod(), string.Format("Unimplemented TA category type {0}.", cat), Array.Empty<object>());
                return(null);
            }
            return(null);
        }