Ejemplo 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));
 }
Ejemplo 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);
 }
Ejemplo n.º 3
0
 public override bool UpdateThrottle(GuidEntity entity)
 {
     return(hasThrottle(entity) &&
            Throttle != null);
 }
Ejemplo n.º 4
0
 public override bool isThrottled(GuidEntity entity)
 {
     return(hasThrottle(entity) &&
            base.isThrottled(entity));
 }
Ejemplo n.º 5
0
 public virtual bool UpdateThrottle(GuidEntity entity)
 {
     return(Throttle != null);
 }