30 lines
840 B
C#
30 lines
840 B
C#
using System;
|
|
|
|
namespace DTS.DASLib.Service.StateMachine
|
|
{
|
|
public class Diagnose : DASStateSelector
|
|
{
|
|
public override State State => State.Diagnose;
|
|
|
|
public override IDASState StateSelector()
|
|
{
|
|
if (CanTransitToRealtimeStart())
|
|
{
|
|
return States.Instance.RealtimeStart;
|
|
}
|
|
|
|
return States.Instance.Diagnose;
|
|
}
|
|
private bool CanTransitToRealtimeStart()
|
|
{
|
|
if (Status.DiagnoseParams.ProceedToRealtimeWhenDone && Status.DiagnoseParams.AllUnitsPassedDiagnostic)
|
|
return true;
|
|
|
|
if (Status.DiagnoseParams.ProceedToRealtimeWhenDone && !Status.DiagnoseParams.RequireAllUnitsPassDiagnostic)
|
|
return true;
|
|
|
|
return false;
|
|
}
|
|
}
|
|
}
|