public override void SetActiveState(
ISystemContext context,
bool active)
{
// set it inactive.
if (!active)
{
SetLimitState(context, LimitAlarmStates.Inactive);
return;
}
// check if the level state machine needs an initial state.
if (this.LimitState.CurrentState.Id.Value != null)
{
base.SetActiveState(context, true);
return;
}
// assume a high if the high limit is specified.
if (this.HighLimit != null)
{
SetLimitState(context, LimitAlarmStates.High);
}
else
{
SetLimitState(context, LimitAlarmStates.Low);
}
}