private ProgrammingActionState?Map(PsdzTransactionInfo transactionInfo) { ProgrammingActionState?result = null; switch (transactionInfo) { case PsdzTransactionInfo.Started: case PsdzTransactionInfo.Repeating: case PsdzTransactionInfo.ProgressInfo: result = new ProgrammingActionState?(ProgrammingActionState.ActionInProcess); break; case PsdzTransactionInfo.Finished: result = new ProgrammingActionState?(ProgrammingActionState.ActionSuccessful); break; case PsdzTransactionInfo.FinishedWithError: result = new ProgrammingActionState?(ProgrammingActionState.ActionFailed); break; default: break; } return(result); }
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) { } }