Isomet Modular Synthesiser (iMS) API
v1.4.2
iMS API
|
Provides a mechanism for retrieving diagnostics data about the attached iMS System. More...
#include <include\Diagnostics.h>
Public Types | |
enum | TARGET { TARGET::SYNTH, TARGET::AO_DEVICE, TARGET::RF_AMPLIFIER } |
Sets which iMS device to request diagnostics data for. More... | |
enum | MEASURE { MEASURE::FORWARD_POWER_CH1, MEASURE::FORWARD_POWER_CH2, MEASURE::FORWARD_POWER_CH3, MEASURE::FORWARD_POWER_CH4, MEASURE::REFLECTED_POWER_CH1, MEASURE::REFLECTED_POWER_CH2, MEASURE::REFLECTED_POWER_CH3, MEASURE::REFLECTED_POWER_CH4, MEASURE::DC_CURRENT_CH1, MEASURE::DC_CURRENT_CH2, MEASURE::DC_CURRENT_CH3, MEASURE::DC_CURRENT_CH4 } |
Selects which diagnostics measurement to access. More... | |
Public Member Functions | |
Constructor & Destructor | |
Diagnostics (const IMSSystem &ims) | |
Constructor for Diagnostics Object. More... | |
~Diagnostics () | |
Destructor for Diagnostics Object. | |
Event Notifications | |
void | DiagnosticsEventSubscribe (const int message, IEventHandler *handler) |
Subscribe a callback function handler to a given DiagnosticsEvents event. More... | |
void | DiagnosticsEventUnsubscribe (const int message, const IEventHandler *handler) |
Unsubscribe a callback function handler from a given DiagnosticsEvents event. More... | |
Read Temperatures | |
bool | GetTemperature (const TARGET &tgt) const |
Triggers a temperature reading from the target device. More... | |
Read Hours | |
bool | GetLoggedHours (const TARGET &tgt) const |
Triggers a logged hours reading from the target device. More... | |
Get Diagnostics Information | |
bool | UpdateDiagnostics () |
Triggers a Diagnostics Conversion to read measurement data from the RF Power Amplifier. More... | |
const std::map< MEASURE, Percent > & | GetDiagnosticsData () const |
Returns a reference to the map of diagnostics data values currently stored by the Diagnostics class. More... | |
Provides a mechanism for retrieving diagnostics data about the attached iMS System.
|
strong |
Selects which diagnostics measurement to access.
|
strong |
Sets which iMS device to request diagnostics data for.
Enumerator | |
---|---|
SYNTH |
Access the Synthesiser Diagnostics (Hours only) |
AO_DEVICE |
Access the AO Device Diagnostics. |
RF_AMPLIFIER |
Access the RF Amplifier Diagnostics. |
iMS::Diagnostics::Diagnostics | ( | const IMSSystem & | ims | ) |
Constructor for Diagnostics Object.
An IMSSystem object, representing the configuration of an iMS target must be passed by const reference to the Diagnostics constructor.
The IMSSystem object must exist before the Diagnostics object, and must remain valid (not destroyed) until the Diagnostics object itself is destroyed.
Once constructed, the object can neither be copied or assigned to another instance.
[in] | ims | A const reference to the iMS System |
void iMS::Diagnostics::DiagnosticsEventSubscribe | ( | const int | message, |
IEventHandler * | handler | ||
) |
Subscribe a callback function handler to a given DiagnosticsEvents event.
Diagnostics can callback user application code when an event occurs that affects the signal path. Supported events are listed under DiagnosticsEvents. The callback function must inherit from the IEventHandler interface and override its EventAction() method.
Use this member function call to subscribe a callback function to a DiagnosticsEvents event. For the period that a callback is subscribed, each time an event in Diagnostics occurs that would trigger the subscribed DiagnosticsEvents event, the user function callback will be executed.
[in] | message | Use the DiagnosticsEvents::Event enum to specify an event to subscribe to |
[in] | handler | A function pointer to the user callback function to execute on the event trigger. |
void iMS::Diagnostics::DiagnosticsEventUnsubscribe | ( | const int | message, |
const IEventHandler * | handler | ||
) |
Unsubscribe a callback function handler from a given DiagnosticsEvents event.
Removes all links to a user callback function from the Event Trigger map so that any events that occur in the Diagnostics object following the Unsubscribe request will no longer execute that function
[in] | message | Use the DiagnosticsEvents::Event enum to specify an event to unsubscribe from |
[in] | handler | A function pointer to the user callback function that will no longer execute on an event |
Returns a reference to the map of diagnostics data values currently stored by the Diagnostics class.
The map contains a set of key-value pairs representing the diagnostics data, one value per entry in the MEASURE enum. Each value is represented as a percentage where 100% represents the full scale analog measured value.
Call UpdateDiagnostics() first to retrieve the latest measurements from the system.
The map of values will be updated after the UpdateDiagnostics() function call and before the DIAGNOSTICS_UPDATE_AVAILABLE event is fired so design the application to avoid accessing the map between these two timings to prevent a potential race condition.
bool iMS::Diagnostics::GetLoggedHours | ( | const TARGET & | tgt | ) | const |
Triggers a logged hours reading from the target device.
Calling this function will read back the current logged hours count from the timing circuit built into the Synthesiser, RF Power Amplifier or Acoust-Optic Device.
The function returns as soon as the request has been sent and a DiagnosticsEvents LoggedHours event will fire as soon as the result returns so ensure that the user code has subscribed to the appropriate event first.
[in] | tgt | Which of the connected devices to read logged hours data from |
bool iMS::Diagnostics::GetTemperature | ( | const TARGET & | tgt | ) | const |
Triggers a temperature reading from the target device.
Calling this function will cause the Synthesiser to initiate a temperature conversion on either the RF Power Amplifier or the Acousto-Optic Device. There is no sensor built into the Synthesiser itself.
The function returns as soon as the conversion has been initiated and the result will become available in the background, causing a DiagnosticsEvents TempUpdate event to fire so ensure that the user code has subscribed to the appropriate event first.
[in] | tgt | Which of the connected devices to read temperature data from |
bool iMS::Diagnostics::UpdateDiagnostics | ( | ) |
Triggers a Diagnostics Conversion to read measurement data from the RF Power Amplifier.
Calling this function will result in a new analog-to-digital conversion sequence being triggered in the diagnostics circuit built into the RF Power Amplifier. This will result in updated values being made available for Forward power, Reflected Power and DC Current across all 4 RF signal channels.
The function returns as soon as the request has been sent and a DiagnosticsEvents UpdateAvailable event will fire as soon as the result returns so ensure that the user code has subscribed to the appropriate event first. If for any reason the conversion was not able to be completed, a ReadFailed event will instead be returned