March 2018
Beginner to intermediate
410 pages
10h 40m
English
We also need to be able to manually trigger our observable notifications. For digital input objects, this is easy. We do this every time the digital input changes state:
public void Set(bool Value)
{
if (!this.state.BooleanValue.HasValue ||
this.state.BooleanValue.Value != Value)
{
this.state.BooleanValue = Value;
this.state.TriggerAll();
if (Value)
{
this.counter.IntegerValue++;
this.counter.TriggerAll();
}
this.TriggerAll();
}
}
}
Read now
Unlock full access