Beispiel #1
0
 internal void UpdateState(ProgrammingActionState state, bool executed)
 {
     if (this.IsFailureIgnored && executed && state != ProgrammingActionState.ActionSuccessful)
     {
         this.StateProgramming = ProgrammingActionState.ActionWarning;
         return;
     }
     if (this.IsFailureIgnored && !executed && (state == ProgrammingActionState.ActionFailed || state == ProgrammingActionState.MissingPrerequisitesForAction))
     {
         this.StateProgramming = ProgrammingActionState.ActionWarning;
         return;
     }
     this.StateProgramming = state;
 }
Beispiel #2
0
 internal bool UpdateSingleProgrammingAction(ProgrammingActionType type, ProgrammingActionState state, bool executed)
 {
     using (IEnumerator <ProgrammingAction> enumerator = this.programmingActionList.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             ProgrammingAction programmingAction = enumerator.Current;
             if (programmingAction.Type == type)
             {
                 programmingAction.UpdateState(state, executed);
                 return(true);
             }
         }
         return(false);
     }
 }
Beispiel #3
0
        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);
            }
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
        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);
                }
            }
        }
Beispiel #6
0
        private void SetStateDiag()
        {
            ProgrammingActionState stateProgramming = this.data.StateProgramming;

            if (stateProgramming <= ProgrammingActionState.ActionPlanned)
            {
                if (stateProgramming - ProgrammingActionState.ActionSuccessful <= 1)
                {
                    this.State = typeDiagObjectState.Performed;
                    return;
                }
                if (stateProgramming == ProgrammingActionState.ActionPlanned)
                {
                    this.State = typeDiagObjectState.NotCalled;
                    return;
                }
            }
            else
            {
                if (stateProgramming == ProgrammingActionState.MissingPrerequisitesForAction)
                {
                    this.State = typeDiagObjectState.NotCalled;
                    return;
                }
                if (stateProgramming == ProgrammingActionState.ActionFailed)
                {
                    this.State = typeDiagObjectState.Canceled;
                    return;
                }
                if (stateProgramming == ProgrammingActionState.ActionInProcess)
                {
                    this.State = typeDiagObjectState.Running;
                    return;
                }
            }
            throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, "Unsupported programming state {0}.", this.data.StateProgramming));
        }
Beispiel #7
0
 public void OnProgrammingActionStateChanged(IEcu ecu, ProgrammingActionType programmingActionType, ProgrammingActionState programmingActionState)
 {
     if (this.ProgrammingEventRaised != null)
     {
         this.ProgrammingEventRaised(this, new ProgrammingActionStateChangedEventArgs(DateTime.Now, ecu, programmingActionType, programmingActionState));
     }
 }
Beispiel #8
0
 public ProgrammingActionStateChangedEventArgs(DateTime timestamp, IEcu ecu, ProgrammingActionType programmingActionType, ProgrammingActionState programmingActionState) : base(timestamp)
 {
     this.Ecu = ecu;
     this.ProgrammingActionType  = programmingActionType;
     this.ProgrammingActionState = programmingActionState;
 }