A logical event scheme would be:
In your measurement classes you expose an event that gets fired when a measurement changes.
The main controller subscribes to that event.
When the event triggers the handler in the main controller, the main controller updates the value of the radio thread.
F.e. a temperature measurement thread class could contain this:
// function prototype (this is how the handler should look like)
public delegate void TemperatureChangedCallback(object sender, float temperature);
// public event you can subscribe to
public event TemperatureChangedCallback TemperatureChanged;
// Helper function that raises the event when there is/are one or more subscribers
private void OnTemperatureChanged(float temperature)
if (TemperatureChanged != null)
Every time the temperature changes (compared with a previous value) you fire the event by calling the helper function OnTemperatureChanged
Subscribing to the event:
tempMeasure.TemperatureChanged += new TemperatureChangedCallback(MyTempChangedCallback);
private void MyTempChangedCallback(object sender, float temperature)
// pass new temperature to radio thread
First note: I wrote the code direclty on the forum and didn’t find the compile button so bugs can happen…
Second note: that in the full .NET framework you would create a class that derives from EventArgs instead of directly passing “float temperature”… The event itself would then be declared by using the EventHandler<> template class…