/// <summary> /// <param name="accelerometerLow">Lower bound for the accelerometer, any accelerometer above this threshold fires an observation event</param> /// <param name="accelerometerHigh">Optional Upper bound, any accelerometer below this threshold and above LowAccelerometer, fires an observe event</param> /// </summary> public AccelerometerObserver(Guid vehicleId, bool events = false, Accelerometer accelerometerLow = null, Accelerometer accelerometerHigh = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.Accelerometer, events == true ? typeof(Event) : typeof(Vehicle), // events == true means observe events for a vehicle events == true ? typeof(Vehicle) : null, // events == false means observe a vehicle timing) { if (accelerometerLow == null) { accelerometerLow = new Accelerometer { X = 2.0, Y = 2.0, Z = 2.0 } } ; if (events) { ParentId = vehicleId; } else { SubjectId = vehicleId; } SetCondition(accelerometerLow, accelerometerHigh); }
public DiagnosticCodeObserver(Guid vehicleId, bool events = false, string[] diagnosticCodes = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.Diagnostic, events == true ? typeof(Event) : typeof(Vehicle), // events == true means observe events for a vehicle events == true ? typeof(Vehicle) : null, // events == false means observe a vehicle timing) { if (diagnosticCodes == null) { diagnosticCodes = new string[] { "All" } } ; if (events) { ParentId = vehicleId; } else { SubjectId = vehicleId; } DiagnosticCodes = diagnosticCodes; } }
/// <summary> /// The operators can be <, > , <=, >=, ==, != /// <param name="type"></param> /// <param name="subject">The</param> /// <param name="parent"></param> /// <param name="field">The name of the field on the entity where the condition will be applied</param> /// </summary> public BooleanFieldObserver(Type subject = null, Guid subjectId = new Guid(), string field = "Speed", ObserverTiming timing = ObserverTiming.edge ) : this(subject, subjectId, null, new Guid(), field, timing) { }
/// <summary> /// <param name="accelerationLow">Lower bound for the acceleration, any acceleration above this threshold fires an observation event</param> /// <param name="accelerationHigh">Optional Upper bound, any acceleration below this threshold and above LowAcceleration, fires an observe event</param> /// </summary> public AccelerationObserver(Guid vehicleId, double accelerationLow = 80.0, double?accelerationHigh = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.Acceleration, typeof(Vehicle), // events == true means observe events for a vehicle null, // events == false means observe a vehicle timing) { SubjectId = vehicleId; SetCondition(accelerationLow, accelerationHigh); }
/// <summary> /// <param name="odometerLow">Lower bound for the odometer, any odometer above this threshold fires an observation event</param> /// <param name="odometerHigh">Optional Upper bound, any odometer below this threshold and above LowOdometer, fires an observe event</param> /// </summary> public OdometerObserver(Guid vehicleId, bool events = false, double odometerLow = 80.0, double? odometerHigh = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.Odometer, events == true ? typeof(Event) : typeof(Vehicle), // events == true means observe events for a vehicle events == true ? typeof(Vehicle) : null, // events == false means observe a vehicle timing) { ParentId = vehicleId; SetCondition(odometerLow, odometerHigh); }
/// <summary> /// <param name="headingLow">Lower bound for the heading, any heading above this threshold fires an observation event</param> /// <param name="headingHigh">Optional Upper bound, any heading below this threshold and above LowHeading, fires an observe event</param> /// </summary> public HeadingObserver(Guid vehicleId, double headingLow = 80.0, double? headingHigh = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.Heading, typeof(Vehicle), // events == true means observe events for a vehicle null, // events == false means observe a vehicle timing) { SubjectId = vehicleId; SetCondition(headingLow, headingHigh); }
/// <summary> /// <param name="distanceLow">Lower bound for the distance, any distance above this threshold fires an observation event</param> /// <param name="distanceHigh">Optional Upper bound, any distance below this threshold and above LowDistance, fires an observe event</param> /// </summary> public DistanceObserver(Guid vehicleId, double distanceLow = 80.0, double? distanceHigh = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.Distance, typeof(Vehicle), // events == true means observe events for a vehicle null, // events == false means observe a vehicle timing) { SubjectId = vehicleId; SetCondition(distanceLow, distanceHigh); }
/// <summary> /// The operators can be <, > , <=, >=, ==, != /// <param name="type"></param> /// <param name="subject">The</param> /// <param name="parent"></param> /// <param name="field">The name of the field on the entity where the condition will be applied</param> /// <param name="operator1">Comparitor against the threshold</param> /// <param name="threshold1">The threshold</param> /// <param name="operator2">Optional second operator for a second threshold</param> /// <param name="threshold2">Optional second threshold</param> /// <param name="conjunction">Logical operator to combine the two thresholds.</param> /// </summary> public ConditionalObserver(Type subject = null, Guid subjectId = new Guid(), string field="Speed", string operator1=">", double threshold1=80.0, ObserverTiming timing = ObserverTiming.edge ) : this(subject, subjectId, null, new Guid(), field, operator1, threshold1, null, null, null, timing) { }
/// <summary> /// <param name="fuelLow">Lower bound for the fuel, any fuel above this threshold fires an observation event</param> /// <param name="fuelHigh">Optional Upper bound, any fuel below this threshold and above LowFuel, fires an observe event</param> /// </summary> public FuelLevelObserver(Guid vehicleId, double fuelLow = 80.0, double? fuelHigh = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.FuelLevel, typeof(Vehicle), // events == true means observe events for a vehicle null, // events == false means observe a vehicle timing) { SubjectId = vehicleId; SetCondition(fuelLow, fuelHigh); }
/// <summary> /// The operators can be <, > , <=, >=, ==, != /// <param name="type"></param> /// <param name="subject">The</param> /// <param name="parent"></param> /// <param name="field">The name of the field on the entity where the condition will be applied</param> /// <param name="operator1">Comparitor against the threshold</param> /// <param name="threshold1">The threshold</param> /// <param name="operator2">Optional second operator for a second threshold</param> /// <param name="threshold2">Optional second threshold</param> /// <param name="conjunction">Logical operator to combine the two thresholds.</param> /// </summary> public ConditionalObserver(Type subject = null, Guid subjectId = new Guid(), string field = "Speed", string operator1 = ">", double threshold1 = 80.0, ObserverTiming timing = ObserverTiming.edge ) : this(subject, subjectId, null, new Guid(), field, operator1, threshold1, null, null, null, timing) { }
/// <summary> /// <param name="speedLow">Lower bound for the speed, any speed above this threshold fires an observation event</param> /// <param name="speedHigh">Optional Upper bound, any speed below this threshold and above LowSpeed, fires an observe event</param> /// </summary> public SpeedObserver(Guid vehicleId, double speedLow = 80.0, double? speedHigh = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.Speed, typeof(Vehicle), // events == true means observe events for a vehicle null, // events == false means observe a vehicle timing) { SubjectId = vehicleId; SetCondition(speedLow, speedHigh); }
/// <summary> /// <param name="distanceLow">Lower bound for the distance, any distance above this threshold fires an observation event</param> /// <param name="distanceHigh">Optional Upper bound, any distance below this threshold and above LowDistance, fires an observe event</param> /// </summary> public DistanceObserver(Guid vehicleId, double distanceLow = 80.0, double?distanceHigh = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.Distance, typeof(Vehicle), // events == true means observe events for a vehicle null, // events == false means observe a vehicle timing) { SubjectId = vehicleId; SetCondition(distanceLow, distanceHigh); }
/// <summary> /// <param name="speedLow">Lower bound for the speed, any speed above this threshold fires an observation event</param> /// <param name="speedHigh">Optional Upper bound, any speed below this threshold and above LowSpeed, fires an observe event</param> /// </summary> public SpeedObserver(Guid vehicleId, double speedLow = 80.0, double?speedHigh = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.Speed, typeof(Vehicle), // events == true means observe events for a vehicle null, // events == false means observe a vehicle timing) { SubjectId = vehicleId; SetCondition(speedLow, speedHigh); }
/// <summary> /// <param name="rpmLow">Lower bound for the rpm, any rpm above this threshold fires an observation event</param> /// <param name="rpmHigh">Optional Upper bound, any rpm below this threshold and above LowRpm, fires an observe event</param> /// </summary> public RPMObserver(Guid vehicleId, double rpmLow = 80.0, double?rpmHigh = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.Rpm, typeof(Vehicle), // events == true means observe events for a vehicle null, // events == false means observe a vehicle timing) { SubjectId = vehicleId; SetCondition(rpmLow, rpmHigh); }
/// <summary> /// <param name="accelerationLow">Lower bound for the acceleration, any acceleration above this threshold fires an observation event</param> /// <param name="accelerationHigh">Optional Upper bound, any acceleration below this threshold and above LowAcceleration, fires an observe event</param> /// </summary> public AccelerationObserver(Guid vehicleId, double accelerationLow = 80.0, double? accelerationHigh = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.Acceleration, typeof(Vehicle), // events == true means observe events for a vehicle null, // events == false means observe a vehicle timing) { SubjectId = vehicleId; SetCondition(accelerationLow, accelerationHigh); }
/// <summary> /// <param name="batteryVoltageLow">Lower bound for the batteryVoltage, any batteryVoltage above this threshold fires an observation event</param> /// <param name="batteryVoltageHigh">Optional Upper bound, any batteryVoltage below this threshold and above LowBatteryVoltage, fires an observe event</param> /// </summary> public BatteryVoltageObserver(Guid vehicleId, double batteryVoltageLow = 80.0, double? batteryVoltageHigh = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.BatteryVoltage, typeof(Vehicle), // events == true means observe events for a vehicle null, // events == false means observe a vehicle timing) { SubjectId = vehicleId; SetCondition(batteryVoltageLow, batteryVoltageHigh); }
/// <summary> /// <param name="odometerLow">Lower bound for the odometer, any odometer above this threshold fires an observation event</param> /// <param name="odometerHigh">Optional Upper bound, any odometer below this threshold and above LowOdometer, fires an observe event</param> /// </summary> public OdometerObserver(Guid vehicleId, bool events = false, double odometerLow = 80.0, double?odometerHigh = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.Odometer, events == true ? typeof(Event) : typeof(Vehicle), // events == true means observe events for a vehicle events == true ? typeof(Vehicle) : null, // events == false means observe a vehicle timing) { ParentId = vehicleId; SetCondition(odometerLow, odometerHigh); }
/// <summary> /// <param name="altitudeLow">Lower bound for the altitude, any altitude above this threshold fires an observation event</param> /// <param name="altitudeHigh">Optional Upper bound, any altitude below this threshold and above LowAltitude, fires an observe event</param> /// </summary> public AltitudeObserver(Guid vehicleId, double altitudeLow = 80.0, double? altitudeHigh = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.Altitude, typeof(Vehicle), // events == true means observe events for a vehicle null, // events == false means observe a vehicle timing) { SubjectId = vehicleId; SetCondition(altitudeLow, altitudeHigh); }
/// <summary> /// <param name="altitudeLow">Lower bound for the altitude, any altitude above this threshold fires an observation event</param> /// <param name="altitudeHigh">Optional Upper bound, any altitude below this threshold and above LowAltitude, fires an observe event</param> /// </summary> public AltitudeObserver(Guid vehicleId, double altitudeLow = 80.0, double?altitudeHigh = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.Altitude, typeof(Vehicle), // events == true means observe events for a vehicle null, // events == false means observe a vehicle timing) { SubjectId = vehicleId; SetCondition(altitudeLow, altitudeHigh); }
/// <summary> /// <param name="rpmLow">Lower bound for the rpm, any rpm above this threshold fires an observation event</param> /// <param name="rpmHigh">Optional Upper bound, any rpm below this threshold and above LowRpm, fires an observe event</param> /// </summary> public RPMObserver(Guid vehicleId, double rpmLow = 80.0, double? rpmHigh = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.Rpm, typeof(Vehicle), // events == true means observe events for a vehicle null, // events == false means observe a vehicle timing) { SubjectId = vehicleId; SetCondition(rpmLow, rpmHigh); }
/// <summary> /// <param name="headingLow">Lower bound for the heading, any heading above this threshold fires an observation event</param> /// <param name="headingHigh">Optional Upper bound, any heading below this threshold and above LowHeading, fires an observe event</param> /// </summary> public HeadingObserver(Guid vehicleId, double headingLow = 80.0, double?headingHigh = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.Heading, typeof(Vehicle), // events == true means observe events for a vehicle null, // events == false means observe a vehicle timing) { SubjectId = vehicleId; SetCondition(headingLow, headingHigh); }
public BooleanFieldObserver(Type subject = null, Guid subjectId = new Guid(), Type parent = null, Guid parentId = new Guid(), string field = "Speed", ObserverTiming timing = ObserverTiming.edge ) : base(ObserverType.BooleanField, subject, parent, timing) { SubjectId = subjectId; ParentId = parentId; Field = field; }
/// <summary> /// <param name="fuelLow">Lower bound for the fuel, any fuel above this threshold fires an observation event</param> /// <param name="fuelHigh">Optional Upper bound, any fuel below this threshold and above LowFuel, fires an observe event</param> /// </summary> public FuelLevelObserver(Guid vehicleId, double fuelLow = 80.0, double?fuelHigh = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.FuelLevel, typeof(Vehicle), // events == true means observe events for a vehicle null, // events == false means observe a vehicle timing) { SubjectId = vehicleId; SetCondition(fuelLow, fuelHigh); SetDefaultThrottle(); }
/// <summary> /// <param name="batteryVoltageLow">Lower bound for the batteryVoltage, any batteryVoltage above this threshold fires an observation event</param> /// <param name="batteryVoltageHigh">Optional Upper bound, any batteryVoltage below this threshold and above LowBatteryVoltage, fires an observe event</param> /// </summary> public BatteryVoltageObserver(Guid vehicleId, double batteryVoltageLow = 80.0, double?batteryVoltageHigh = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.BatteryVoltage, typeof(Vehicle), // events == true means observe events for a vehicle null, // events == false means observe a vehicle timing) { SubjectId = vehicleId; SetCondition(batteryVoltageLow, batteryVoltageHigh); SetDefaultThrottle(); }
public ConditionalObserver(Type subject = null, Guid subjectId = new Guid(), string field = "Speed", string operator1 = ">", double threshold1 = 80.0, string operator2 = "<", double? threshold2 = 100.0, string conjunction = "and", ObserverTiming timing = ObserverTiming.edge ) : this(subject, subjectId, null, new Guid(), field, operator1, threshold1, operator2, threshold2, conjunction, timing) { }
public ConditionalObserver(Type subject = null, Guid subjectId = new Guid(), string field = "Speed", string operator1 = ">", double threshold1 = 80.0, string operator2 = "<", double?threshold2 = 100.0, string conjunction = "and", ObserverTiming timing = ObserverTiming.edge ) : this(subject, subjectId, null, new Guid(), field, operator1, threshold1, operator2, threshold2, conjunction, timing) { }
public EventObserver(Guid vehicleId, EventType[] eventTypes = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.Event, typeof(Event), typeof(Vehicle), timing) { if (eventTypes == null) eventTypes = new EventType[] { }; ParentId = vehicleId; EventTypes = eventTypes; }
public ConditionalObserver(Type subject = null, Guid subjectId = new Guid(), Type parent = null, Guid parentId = new Guid(), string field = "Speed", string operator1 = ">", double threshold1 = 80.0, string operator2 = "<", double? threshold2 = 100.0, string conjunction = "and", ObserverTiming timing = ObserverTiming.edge ) : base(ObserverType.Conditional, subject, parent, timing) { SubjectId = subjectId; ParentId = parentId; SetCondition(field, operator1, threshold1, operator2, threshold2, conjunction); }
/// <summary> /// <param name="accelerometerLow">Lower bound for the accelerometer, any accelerometer above this threshold fires an observation event</param> /// <param name="accelerometerHigh">Optional Upper bound, any accelerometer below this threshold and above LowAccelerometer, fires an observe event</param> /// </summary> public AccelerometerObserver(Guid vehicleId, Accelerometer accelerometerLow = null, Accelerometer accelerometerHigh = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.Accelerometer, typeof(Vehicle), // events == true means observe events for a vehicle null, // events == false means observe a vehicle timing) { if (accelerometerLow == null) accelerometerLow = new Accelerometer { X = 2.0, Y = 2.0, Z = 2.0 }; SubjectId = vehicleId; SetCondition(accelerometerLow, accelerometerHigh); }
public ConditionalObserver(Type subject = null, Guid subjectId = new Guid(), Type parent = null, Guid parentId = new Guid(), string field = "Speed", string operator1 = ">", double threshold1 = 80.0, string operator2 = "<", double?threshold2 = 100.0, string conjunction = "and", ObserverTiming timing = ObserverTiming.edge ) : base(ObserverType.Conditional, subject, parent, timing) { SubjectId = subjectId; ParentId = parentId; SetCondition(field, operator1, threshold1, operator2, threshold2, conjunction); }
/// <summary> /// <param name="altitudeLow">Lower bound for the altitude, any altitude above this threshold fires an observation event</param> /// <param name="altitudeHigh">Optional Upper bound, any altitude below this threshold and above LowAltitude, fires an observe event</param> /// </summary> public DiagnosticCodeObserver(Guid vehicleId, string[] diagnosticCodes = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.Diagnostic, typeof(Vehicle), // events == true means observe events for a vehicle null, // events == false means observe a vehicle timing) { if (diagnosticCodes == null) diagnosticCodes = new string[] { "All" }; SubjectId = vehicleId; DiagnosticCodes = diagnosticCodes; }
/// <summary> /// <param name="accelerationLow">Lower bound for the acceleration, any acceleration above this threshold fires an observation event</param> /// <param name="accelerationHigh">Optional Upper bound, any acceleration below this threshold and above LowAcceleration, fires an observe event</param> /// </summary> public AccelerationObserver(Guid vehicleId, bool events = false, double accelerationLow = 80.0, double? accelerationHigh = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.Acceleration, events == true ? typeof(Event) : typeof(Vehicle), // events == true means observe events for a vehicle events == true ? typeof(Vehicle) : null, // events == false means observe a vehicle timing) { if (events) ParentId = vehicleId; else SubjectId = vehicleId; SetCondition(accelerationLow, accelerationHigh); }
/// <summary> /// <param name="batteryVoltageLow">Lower bound for the batteryVoltage, any batteryVoltage above this threshold fires an observation event</param> /// <param name="batteryVoltageHigh">Optional Upper bound, any batteryVoltage below this threshold and above LowBatteryVoltage, fires an observe event</param> /// </summary> public BatteryVoltageObserver(Guid vehicleId, bool events = false, double batteryVoltageLow = 80.0, double? batteryVoltageHigh = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.BatteryVoltage, events == true ? typeof(Event) : typeof(Vehicle), // events == true means observe events for a vehicle events == true ? typeof(Vehicle) : null, // events == false means observe a vehicle timing) { if (events) ParentId = vehicleId; else SubjectId = vehicleId; SetCondition(batteryVoltageLow, batteryVoltageHigh); }
/// <summary> /// <param name="distanceLow">Lower bound for the distance, any distance above this threshold fires an observation event</param> /// <param name="distanceHigh">Optional Upper bound, any distance below this threshold and above LowDistance, fires an observe event</param> /// </summary> public DistanceObserver(Guid vehicleId, bool events = false, double distanceLow = 80.0, double? distanceHigh = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.Distance, events == true ? typeof(Event) : typeof(Vehicle), // events == true means observe events for a vehicle events == true ? typeof(Vehicle) : null, // events == false means observe a vehicle timing) { if (events) ParentId = vehicleId; else SubjectId = vehicleId; SetCondition(distanceLow, distanceHigh); }
/// <summary> /// <param name="speedLow">Lower bound for the speed, any speed above this threshold fires an observation event</param> /// <param name="speedHigh">Optional Upper bound, any speed below this threshold and above LowSpeed, fires an observe event</param> /// </summary> public SpeedObserver(Guid vehicleId, bool events = false, double speedLow = 80.0, double? speedHigh = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.Speed, events == true ? typeof(Event) : typeof(Vehicle), // events == true means observe events for a vehicle events == true ? typeof(Vehicle) : null, // events == false means observe a vehicle timing) { if (events) ParentId = vehicleId; else SubjectId = vehicleId; SetCondition(speedLow, speedHigh); }
/// <summary> /// <param name="fuelLow">Lower bound for the fuel, any fuel above this threshold fires an observation event</param> /// <param name="fuelHigh">Optional Upper bound, any fuel below this threshold and above LowFuel, fires an observe event</param> /// </summary> public FuelLevelObserver(Guid vehicleId, bool events = false, double fuelLow = 80.0, double? fuelHigh = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.FuelLevel, events == true ? typeof(Event) : typeof(Vehicle), // events == true means observe events for a vehicle events == true ? typeof(Vehicle) : null, // events == false means observe a vehicle timing) { if (events) ParentId = vehicleId; else SubjectId = vehicleId; SetCondition(fuelLow, fuelHigh); }
public EventObserver(Guid vehicleId, EventType[] eventTypes = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.Event, typeof(Event), typeof(Vehicle), timing) { if (eventTypes == null) { eventTypes = new EventType[] { } } ; ParentId = vehicleId; EventTypes = eventTypes; }
/// <summary> /// <param name="altitudeLow">Lower bound for the altitude, any altitude above this threshold fires an observation event</param> /// <param name="altitudeHigh">Optional Upper bound, any altitude below this threshold and above LowAltitude, fires an observe event</param> /// </summary> public DiagnosticCodeObserver(Guid vehicleId, string[] diagnosticCodes = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.Diagnostic, typeof(Vehicle), // events == true means observe events for a vehicle null, // events == false means observe a vehicle timing) { if (diagnosticCodes == null) { diagnosticCodes = new string[] { "All" } } ; SubjectId = vehicleId; DiagnosticCodes = diagnosticCodes; }
/// <summary> /// <param name="accelerometerLow">Lower bound for the accelerometer, any accelerometer above this threshold fires an observation event</param> /// <param name="accelerometerHigh">Optional Upper bound, any accelerometer below this threshold and above LowAccelerometer, fires an observe event</param> /// </summary> public AccelerometerObserver(Guid vehicleId, Accelerometer accelerometerLow = null, Accelerometer accelerometerHigh = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.Accelerometer, typeof(Vehicle), // events == true means observe events for a vehicle null, // events == false means observe a vehicle timing) { if (accelerometerLow == null) { accelerometerLow = new Accelerometer { X = 2.0, Y = 2.0, Z = 2.0 } } ; SubjectId = vehicleId; SetCondition(accelerometerLow, accelerometerHigh); }
public DiagnosticCodeObserver(Guid vehicleId, bool events = false, string[] diagnosticCodes = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.Diagnostic, events == true ? typeof(Event) : typeof(Vehicle), // events == true means observe events for a vehicle events == true ? typeof(Vehicle) : null, // events == false means observe a vehicle timing) { if (diagnosticCodes == null) diagnosticCodes = new string[] { "All" }; if (events) ParentId = vehicleId; else SubjectId = vehicleId; DiagnosticCodes = diagnosticCodes; }
/// <summary> /// <param name="speedLow">Lower bound for the speed, any speed above this threshold fires an observation event</param> /// <param name="speedHigh">Optional Upper bound, any speed below this threshold and above LowSpeed, fires an observe event</param> /// </summary> public SpeedObserver(Guid vehicleId, bool events = false, double speedLow = 80.0, double?speedHigh = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.Speed, events == true ? typeof(Event) : typeof(Vehicle), // events == true means observe events for a vehicle events == true ? typeof(Vehicle) : null, // events == false means observe a vehicle timing) { if (events) { ParentId = vehicleId; } else { SubjectId = vehicleId; } SetCondition(speedLow, speedHigh); }
/// <summary> /// <param name="accelerationLow">Lower bound for the acceleration, any acceleration above this threshold fires an observation event</param> /// <param name="accelerationHigh">Optional Upper bound, any acceleration below this threshold and above LowAcceleration, fires an observe event</param> /// </summary> public AccelerationObserver(Guid vehicleId, bool events = false, double accelerationLow = 80.0, double?accelerationHigh = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.Acceleration, events == true ? typeof(Event) : typeof(Vehicle), // events == true means observe events for a vehicle events == true ? typeof(Vehicle) : null, // events == false means observe a vehicle timing) { if (events) { ParentId = vehicleId; } else { SubjectId = vehicleId; } SetCondition(accelerationLow, accelerationHigh); }
/// <summary> /// <param name="distanceLow">Lower bound for the distance, any distance above this threshold fires an observation event</param> /// <param name="distanceHigh">Optional Upper bound, any distance below this threshold and above LowDistance, fires an observe event</param> /// </summary> public DistanceObserver(Guid vehicleId, bool events = false, double distanceLow = 80.0, double?distanceHigh = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.Distance, events == true ? typeof(Event) : typeof(Vehicle), // events == true means observe events for a vehicle events == true ? typeof(Vehicle) : null, // events == false means observe a vehicle timing) { if (events) { ParentId = vehicleId; } else { SubjectId = vehicleId; } SetCondition(distanceLow, distanceHigh); }
/// <summary> /// <param name="fuelLow">Lower bound for the fuel, any fuel above this threshold fires an observation event</param> /// <param name="fuelHigh">Optional Upper bound, any fuel below this threshold and above LowFuel, fires an observe event</param> /// </summary> public FuelLevelObserver(Guid vehicleId, bool events = false, double fuelLow = 80.0, double?fuelHigh = null, ObserverTiming timing = ObserverTiming.edge) : base(ObserverType.FuelLevel, events == true ? typeof(Event) : typeof(Vehicle), // events == true means observe events for a vehicle events == true ? typeof(Vehicle) : null, // events == false means observe a vehicle timing) { if (events) { ParentId = vehicleId; } else { SubjectId = vehicleId; } SetCondition(fuelLow, fuelHigh); SetDefaultThrottle(); }
//public ConditionalObserverBase(Type subject = null, Type parent = null, // ObserverTiming timing = ObserverTiming.edge) // : this(ObserverType.Generic, subject, parent, timing) //{ //} public ConditionalObserverBase(ObserverType type, Type subject = null, Type parent = null, ObserverTiming timing = ObserverTiming.edge) : base(type, subject, parent) { Timing = timing; }
public ConditionalObserverBase(ObserverType type, ObserverTiming timing = ObserverTiming.edge) : base(type) { Timing = timing; }