internal void UpdateState(IEnumerable <IPsdzTalLine> talLines) { ProgrammingActionState?programmingActionState = null; foreach (IPsdzTalLine talLine in talLines) { ProgrammingActionState value = this.CalculateProgrammingState(talLine); if (programmingActionState == null || value.CompareTo(programmingActionState) > 0) { programmingActionState = new ProgrammingActionState?(value); } } if (programmingActionState != null) { this.UpdateState(programmingActionState.Value, false); } }
private ProgrammingActionState CalculateProgrammingState(IPsdzTalLine talLine) { ProgrammingActionState programmingActionState; if (talLine.TaCategories != PsdzTaCategories.FscDeploy) { programmingActionState = this.MapState(talLine.ExecutionState); } else { programmingActionState = ProgrammingActionState.ActionSuccessful; foreach (IPsdzTa psdzTa in this.GetFscTas(talLine.FscDeploy)) { ProgrammingActionState programmingActionState2 = this.MapState(psdzTa.ExecutionState); if (programmingActionState2.CompareTo(programmingActionState) > 0) { programmingActionState = programmingActionState2; } } } return(programmingActionState); }
internal void Update(IEnumerable <IPsdzTalLine> talLines, int escalationSteps) { DateTime?dateTime = null; DateTime?dateTime2 = null; ProgrammingActionState?programmingActionState = null; foreach (IPsdzTalLine psdzTalLine in talLines) { ProgrammingActionState value = this.CalculateProgrammingState(psdzTalLine); if (programmingActionState == null || value.CompareTo(programmingActionState) > 0) { programmingActionState = new ProgrammingActionState?(value); } if (dateTime == null || psdzTalLine.StartTime < dateTime) { dateTime = new DateTime?(psdzTalLine.StartTime); } if (dateTime2 == null || psdzTalLine.EndTime > dateTime2) { dateTime2 = new DateTime?(psdzTalLine.EndTime); } } }