Esempio n. 1
0
 //TODO:: allow end users to add more events to the throttle than the default
 // battery and fuel events.
 public bool hasThrottle(GuidEntity entity)
 {
     return((EventTypes.Contains(EventType.LowBattery) &&
             ((Event)entity).EventType == EventType.LowBattery)
            ||
            (EventTypes.Contains(EventType.LowFuel) &&
             ((Event)entity).EventType == EventType.LowFuel));
 }
Esempio n. 2
0
 public virtual bool isThrottled(GuidEntity entity)
 {
     // Now earlier than the next broadcast.
     return(Throttle != null &&
            NextAllowedBroadcast != null &&
            DateTime.Compare(DateTime.UtcNow,
                             NextAllowedBroadcast.GetValueOrDefault()) < 0);
 }
Esempio n. 3
0
 public override bool UpdateThrottle(GuidEntity entity)
 {
     return(hasThrottle(entity) &&
            Throttle != null);
 }
Esempio n. 4
0
 public override bool isThrottled(GuidEntity entity)
 {
     return(hasThrottle(entity) &&
            base.isThrottled(entity));
 }
Esempio n. 5
0
 public virtual bool UpdateThrottle(GuidEntity entity)
 {
     return(Throttle != null);
 }