Class DeviceUpdateTrigger
Represents an update-trigger used to update devices with a maximum update-rate.
Inherited Members
Namespace: RGB.NET.Core
Assembly: RGB.NET.Core.dll
Syntax
public class DeviceUpdateTrigger : AbstractUpdateTrigger, IBindable, INotifyPropertyChanged, IDeviceUpdateTrigger, IUpdateTrigger, IDisposable
Constructors
| Edit this page View SourceDeviceUpdateTrigger()
Initializes a new instance of the DeviceUpdateTrigger class.
Declaration
public DeviceUpdateTrigger()
DeviceUpdateTrigger(double)
Initializes a new instance of the DeviceUpdateTrigger class.
Declaration
public DeviceUpdateTrigger(double updateRateHardLimit)
Parameters
Type | Name | Description |
---|---|---|
double | updateRateHardLimit | The hard limit of the update rate of this trigger. |
Properties
| Edit this page View SourceHasDataEvent
Gets or sets the event to trigger when new data is available (TriggerHasData()).
Declaration
protected AutoResetEvent HasDataEvent { get; set; }
Property Value
Type | Description |
---|---|
AutoResetEvent |
HeartbeatTimer
Gets or sets the time in ms after which a refresh-request is sent even if no changes are made in the meantime to prevent the target from timing out or similar problems. To disable heartbeats leave it at 0.
Declaration
public int HeartbeatTimer { get; set; }
Property Value
Type | Description |
---|---|
int |
IsRunning
Gets or sets a bool indicating if the trigger is currently updating.
Declaration
protected bool IsRunning { get; set; }
Property Value
Type | Description |
---|---|
bool |
LastUpdateTime
Gets the time spent for the last update.
Declaration
public override double LastUpdateTime { get; protected set; }
Property Value
Type | Description |
---|---|
double |
Overrides
| Edit this page View SourceLastUpdateTimestamp
Gets or sets the timestamp of the last update.
Declaration
protected long LastUpdateTimestamp { get; set; }
Property Value
Type | Description |
---|---|
long |
MaxUpdateRate
Gets or sets the maximum update rate of this trigger (is overwriten if the UpdateRateHardLimit is smaller). <= 0 removes the limit.
Declaration
public double MaxUpdateRate { get; set; }
Property Value
Type | Description |
---|---|
double |
Timeout
Gets or sets the timeout used by the blocking wait for data availability.
Declaration
public int Timeout { get; set; }
Property Value
Type | Description |
---|---|
int |
UpdateFrequency
Gets the update frequency used by the trigger if not limited by data shortage.
Declaration
public double UpdateFrequency { get; }
Property Value
Type | Description |
---|---|
double |
UpdateRateHardLimit
Gets the hard limit of the update rate of this trigger. Updates will never perform faster then then this value if it's set. <= 0 removes the limit.
Declaration
public double UpdateRateHardLimit { get; protected set; }
Property Value
Type | Description |
---|---|
double |
UpdateTask
Gets or sets the update loop of this trigger.
Declaration
protected Task? UpdateTask { get; set; }
Property Value
Type | Description |
---|---|
Task |
UpdateToken
Gets or sets the cancellation token checked by the UpdateTask.
Declaration
protected CancellationToken UpdateToken { get; set; }
Property Value
Type | Description |
---|---|
CancellationToken |
UpdateTokenSource
Gets or sets the cancellation token source used to create the cancellation token checked by the UpdateTask.
Declaration
protected CancellationTokenSource? UpdateTokenSource { get; set; }
Property Value
Type | Description |
---|---|
CancellationTokenSource |
Methods
| Edit this page View SourceDispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public override void Dispose()
Overrides
| Edit this page View SourceOnUpdate(CustomUpdateData?)
Invokes the Update-event.
Declaration
protected override void OnUpdate(CustomUpdateData? updateData = null)
Parameters
Type | Name | Description |
---|---|---|
CustomUpdateData | updateData | Optional custom-data passed to the subscribers of the Update.event. |
Overrides
| Edit this page View SourceStart()
Starts the trigger.
Declaration
public override void Start()
Overrides
| Edit this page View SourceStop()
Stops the trigger.
Declaration
public virtual void Stop()
TriggerHasData()
Indicates that there's data available to process.
Declaration
public void TriggerHasData()
UpdateLoop()
The update loop called by the UpdateTask.
Declaration
protected virtual void UpdateLoop()