.Net Windows DECL Reference
 
Loading...
Searching...
No Matches
MWSDK.Wpf.MedWandController Class Reference

Represents a controller for managing and interacting with various MedWand devices in a WPF application. More...

Inherits MWSDK.NetCore.MedWandControllerBase.

Public Member Functions

void Configure (Grid? ecgContainer)
 Configures the MedWandController by initializing its modules based on available features and optionally setting up the ECG module with the provided container.
 
new void Dispose ()
 Releases all resources used by the MWSDK.Wpf.MedWandController instance.
 
string? StethoscopeWavFromCapture (byte[] bytes)
 Converts the provided stethoscope capture data into a WAV audio file format.
 
string? CameraBmpFromCapture (byte[] bytes)
 Converts a captured byte array from the camera into a Base64-encoded bitmap string.
 
void CameraMove (int? incrementLeft, int? incrementTop)
 Moves the camera by the specified increments in the horizontal and vertical directions.
 
void CameraZoom (int increment)
 Adjusts the zoom level of the camera by the specified increment.
 
void CameraReset ()
 Resets the camera to its default state by invoking the reset functionality of the associated camera module.
 
string? EcgBmpFromCapture (byte[] bytes)
 Converts a captured byte array from the ECG into a Base64-encoded bitmap string.
 
new bool StartThermometer ()
 Starts the thermometer sensor for temperature measurement.
 
new bool StartPulseOximeter ()
 Starts the pulse oximeter sensor.
 
new bool StartEcg ()
 Starts the ECG (Electrocardiogram) monitoring process.
 
bool SetStethoscopeMode (MicrophoneModes microphoneMode, string? speakerName)
 Configures the stethoscope to operate in the specified microphone mode and optionally sets the speaker name.
 
bool SetCameraMode (Image previewTarget, CameraModes cameraMode)
 Configures the camera mode and optionally starts the camera preview.
 
new void StartRecording ()
 Starts recording data for the currently active sensor.
 
new void StopRecording ()
 Stops the recording process for the currently active sensor, if applicable.
 
bool StopSensor ()
 Stops the currently active sensor, if any, and performs necessary cleanup operations.
 
- Public Member Functions inherited from MWSDK.NetCore.MedWandControllerBase
void Construct (string licenseString, string publicKey)
 Initializes the MedWand controller with the provided license information and public key.
 
void Connect ()
 Establishes a connection to the MedWand device.
 
void Initialize ()
 Initializes the MedWand device, setting it to the DeviceState.Initialized state if successful.
 
bool IsBootloaderMode (bool forceCheck=false)
 Determines whether the device is currently in bootloader mode.
 

Properties

bool HasValidStethoscope [get]
 Gets a value indicating whether a valid stethoscope module is available.
 
bool StethoscopeIsMonitoring [get]
 Gets a value indicating whether the stethoscope is currently monitoring.
 
StethoscopeModuleStethoscope [get]
 Gets the instance of the MWSDK.Wpf.Modules.StethoscopeModule associated with the controller.
 
string StethoscopeModel [get]
 Gets the model name of the connected stethoscope.
 
MicrophoneModes StethoscopeMode [get]
 Gets the current microphone mode of the stethoscope.
 
bool HasValidOtoscope [get]
 Gets a value indicating whether a valid otoscope is available.
 
CameraModuleCamera [get]
 Gets the camera module associated with the MedWandController.
 
bool CameraIsMonitoring [get]
 Gets a value indicating whether the camera is currently monitoring.
 
string CameraModel [get]
 Gets the model name of the connected camera.
 
CameraModes CameraMode [get]
 Gets the current camera mode of the connected camera module.
 
bool CameraHasOnTimer [get]
 Gets a value indicating whether the camera associated with the controller has an "On Timer" feature.
 
int CameraOnTimeMax [get]
 Gets the maximum duration, in seconds, that the camera can remain active before requiring a cooldown period.
 
int CameraCoolTimeMin [get]
 Gets the minimum cooldown time, in seconds, required for the camera to be operational again after it has been turned off.
 
bool CameraLedIntensityAdjustable [get]
 Gets a value indicating whether the camera's LED intensity is adjustable.
 
int CameraLedIntensityMax [get]
 Gets the maximum LED intensity value for the camera.
 
bool HasValidEcg [get]
 Gets a value indicating whether a valid ECG (Electrocardiogram) module is available.
 
EcgModuleEcg [get]
 Gets the ECG module associated with the MedWand device.
 
List< double >? EcgRecordedData [get]
 Gets the recorded ECG (Electrocardiogram) data as a list of double values.
 
- Properties inherited from MWSDK.NetCore.MedWandControllerBase
bool IsLicenseValid [get]
 Gets a value indicating whether the license associated with the MedWand device is valid.
 
DeviceState DeviceState [get]
 Gets the current state of the MedWand device.
 
ReadingState ReadingState [get]
 Gets the current state of the reading process for the MedWand device.
 
bool IsConnected [get]
 Gets a value indicating whether the MedWand device is currently connected.
 
bool IsInitialized [get]
 Gets a value indicating whether the MedWand device has been successfully initialized.
 
string LicenseInfo [get]
 Gets the license information associated with the current instance of the MedWand controller.
 
bool CanUseStethoscope [get]
 Gets a value indicating whether the stethoscope feature can be used with the current license.
 
bool CanUseCamera [get]
 Gets a value indicating whether the camera feature can be used based on the current license.
 
bool CanUseEcg [get]
 Gets a value indicating whether the ECG (Electrocardiogram) feature can be used.
 
string? ComPort [get]
 Gets the name of the COM port associated with the MedWand device.
 
string? VendorId [get]
 Gets the Vendor ID of the connected MedWand device.
 
string? ProductId [get]
 Gets the product identifier of the connected MedWand device.
 
Version? FirmwareVersion [get]
 Gets the firmware version of the connected MedWand device.
 
string DeviceId [get]
 Gets the unique identifier of the connected MedWand device.
 
MedWandGeneration Generation [get]
 Gets the generation of the MedWand device.
 
string Udi [get]
 Gets the Unique Device Identifier (UDI) of the connected MedWand device.
 
MedWandReading LastReading [get]
 Gets the most recent reading data from the MedWand sensor.
 
MedWandSensor ActiveSensor [get]
 Gets the currently active sensor on the MedWand device.
 
int LedIntensity [get]
 Gets the current intensity level of the LED.
 

Additional Inherited Members

- Public Attributes inherited from MWSDK.NetCore.MedWandControllerBase
string DeviceName = "MedWand"
 Represents the name of the MedWand device.
 
- Events inherited from MWSDK.NetCore.MedWandControllerBase
Action< LicenseState >? LicenseError
 Occurs when there is an issue with the license state of the MedWand device.
 
Action< DeviceState >? DeviceStateChanged
 Occurs when the state of the MedWand device changes.
 
Action< MedWandDeviceError >? DeviceError
 Occurs when an error related to the MedWand device is encountered.
 
Action< ReadingState >? ReadingStateChanged
 Occurs when the reading state of the MedWand device changes.
 
Action< MedWandReading >? ReadingReceived
 Occurs when a new reading is received from the MedWand device.
 
Action< int >? LedIntensityChanged
 Occurs when the LED intensity of the MedWand device changes.
 

Detailed Description

Represents a controller for managing and interacting with various MedWand devices in a WPF application.

This class provides functionality to configure and control devices such as stethoscopes, cameras, and ECG modules. It extends MWSDK.NetCore.MedWandControllerBase and includes additional features specific to WPF.

Member Function Documentation

◆ CameraBmpFromCapture()

string? MWSDK.Wpf.MedWandController.CameraBmpFromCapture ( byte[] bytes)

Converts a captured byte array from the camera into a Base64-encoded bitmap string.

Parameters
bytesThe byte array representing the captured camera frame.
Returns
A Base64-encoded string representation of the bitmap if the conversion is successful; otherwise, null if the camera module is not available.

This method utilizes the camera module to process the provided byte array and generate a Base64-encoded bitmap string. Ensure that the camera module is valid before invoking this method.

◆ CameraMove()

void MWSDK.Wpf.MedWandController.CameraMove ( int? incrementLeft,
int? incrementTop )

Moves the camera by the specified increments in the horizontal and vertical directions.

Parameters
incrementLeftThe amount to move the camera horizontally. A positive value moves the camera to the right, a negative value moves it to the left, and null indicates no horizontal movement.
incrementTopThe amount to move the camera vertically. A positive value moves the camera downward, a negative value moves it upward, and null indicates no vertical movement.

◆ CameraReset()

void MWSDK.Wpf.MedWandController.CameraReset ( )

Resets the camera to its default state by invoking the reset functionality of the associated camera module.

This method is a wrapper around the MWSDK.Wpf.Modules.CameraModule.Reset method, which resets the camera's zoom and position to their initial values. It has no effect if the camera module is not valid or initialized.

◆ CameraZoom()

void MWSDK.Wpf.MedWandController.CameraZoom ( int increment)

Adjusts the zoom level of the camera by the specified increment.

Parameters
incrementThe amount by which to adjust the zoom level. Positive values zoom in, while negative values zoom out.

This method delegates the zoom functionality to the associated CameraModule. Ensure that a valid camera module is available before invoking this method.

◆ Configure()

void MWSDK.Wpf.MedWandController.Configure ( Grid? ecgContainer)

Configures the MedWandController by initializing its modules based on available features and optionally setting up the ECG module with the provided container.

Parameters
ecgContainerA Grid instance used to initialize the ECG module if the ECG feature is available. Pass null if the ECG module should not be initialized.

This method initializes the stethoscope, camera, and ECG modules if their respective features are enabled.

◆ Dispose()

new void MWSDK.Wpf.MedWandController.Dispose ( )

Releases all resources used by the MWSDK.Wpf.MedWandController instance.

This method unsubscribes from the ReadingReceived event and calls the base class's Dispose method to ensure proper cleanup of resources.

◆ EcgBmpFromCapture()

string? MWSDK.Wpf.MedWandController.EcgBmpFromCapture ( byte[] bytes)

Converts a captured byte array from the ECG into a Base64-encoded bitmap string.

Parameters
bytesThe byte array representing the captured ECG data.
Returns
A Base64-encoded string representation of the bitmap if the conversion is successful; otherwise, null if the camera module is not available.

This method utilizes the ecg module to process the provided byte array and generate a Base64-encoded bitmap string. Ensure that the ecg module is valid before invoking this method.

◆ SetCameraMode()

bool MWSDK.Wpf.MedWandController.SetCameraMode ( Image previewTarget,
CameraModes cameraMode )

Configures the camera mode and optionally starts the camera preview.

Parameters
previewTargetThe System.Windows.Controls.Image control where the camera preview will be displayed.
cameraModeThe desired camera mode, specified as one of the MWSDK.NetCore.Internal.CameraHelper.CameraModes values.
Returns
true if the camera mode was successfully set; otherwise, false.
Exceptions
System.NullReferenceExceptionThrown if the camera module is not initialized.
System.ArgumentOutOfRangeExceptionThrown if the specified cameraMode is not a valid value.

This method stops any ongoing camera preview or operation before setting the new mode. Depending on the selected mode, it may also adjust the LED intensity and start the camera.

◆ SetStethoscopeMode()

bool MWSDK.Wpf.MedWandController.SetStethoscopeMode ( MicrophoneModes microphoneMode,
string? speakerName )

Configures the stethoscope to operate in the specified microphone mode and optionally sets the speaker name.

Parameters
microphoneModeThe desired MWSDK.NetCore.Internal.StethoscopeHelpers.MicrophoneModes for the stethoscope. Supported modes include Off, Heart, Lungs, and Bowel.
speakerNameThe name of the speaker to use for audio output. Can be null if no specific speaker is required.
Returns
true if the stethoscope mode was successfully set; otherwise, false.
Exceptions
System.NullReferenceExceptionThrown if the stethoscope module is not initialized.
System.ArgumentOutOfRangeExceptionThrown if an unsupported microphone mode is provided.

This method stops any ongoing stethoscope preview or monitoring before applying the new mode. Debugging information is logged when running in debug mode.

◆ StartEcg()

new bool MWSDK.Wpf.MedWandController.StartEcg ( )

Starts the ECG (Electrocardiogram) monitoring process.

Returns
true if the ECG monitoring started successfully; otherwise, false.
Exceptions
NullReferenceExceptionThrown when the ECG module is not initialized.

◆ StartPulseOximeter()

new bool MWSDK.Wpf.MedWandController.StartPulseOximeter ( )

Starts the pulse oximeter sensor.

Returns
true if the pulse oximeter sensor starts successfully; otherwise, false.

This method overrides the base implementation to provide functionality specific to the MWSDK.Wpf.MedWandController class.

◆ StartRecording()

new void MWSDK.Wpf.MedWandController.StartRecording ( )

Starts recording data for the currently active sensor.

This method initiates the recording process based on the active sensor type. Supported sensors include:

  • Thermometer
  • Pulse Oximeter
  • ECG
  • Stethoscope
  • Otoscope

For sensors like ECG and Stethoscope, this method delegates the recording process to their respective modules.

Exceptions
ArgumentOutOfRangeExceptionThrown when the active sensor is not recognized.

◆ StartThermometer()

new bool MWSDK.Wpf.MedWandController.StartThermometer ( )

Starts the thermometer sensor for temperature measurement.

Returns
true if the thermometer starts successfully; otherwise, false.

This method overrides the base implementation to initiate the thermometer sensor. Ensure that the necessary hardware and licenses are valid before calling this method.

◆ StethoscopeWavFromCapture()

string? MWSDK.Wpf.MedWandController.StethoscopeWavFromCapture ( byte[] bytes)

Converts the provided stethoscope capture data into a WAV audio file format.

Parameters
bytesThe byte array representing the stethoscope capture data.
Returns
A Base64-encoded string representing the WAV audio file, or null if the conversion fails or the stethoscope module is not valid.

This method utilizes the stethoscope module to process the raw capture data and generate a WAV audio file. Ensure that the stethoscope module is properly initialized before calling this method.

◆ StopRecording()

new void MWSDK.Wpf.MedWandController.StopRecording ( )

Stops the recording process for the currently active sensor, if applicable.

This method determines the active sensor and stops its recording process accordingly. If no sensor is active, or if the active sensor does not support recording, no action is taken.

Exceptions
ArgumentOutOfRangeExceptionThrown when the active sensor is not recognized.

◆ StopSensor()

bool MWSDK.Wpf.MedWandController.StopSensor ( )

Stops the currently active sensor, if any, and performs necessary cleanup operations.

Returns
true if the sensor was successfully stopped or if no sensor was active; otherwise, false.

This method determines the active sensor using the MedWandControllerBase.ActiveSensor property and stops it accordingly. Specific cleanup actions are performed for certain sensor types:

  • For MedWandSensor.Stethoscope, the stethoscope preview is stopped.
  • For MedWandSensor.Otoscope, the camera preview is stopped.
  • For MedWandSensor.Ecg, monitoring is stopped.

If the active sensor is MedWandSensor.None, the method returns true without performing any actions.

Exceptions
ArgumentOutOfRangeExceptionThrown if the active sensor is not recognized.

Property Documentation

◆ Camera

CameraModule? MWSDK.Wpf.MedWandController.Camera
get

Gets the camera module associated with the MedWandController.

The CameraModule instance if a valid camera module is available; otherwise, null.

The camera module provides functionality for managing camera operations, such as monitoring, zooming, and adjusting LED intensity.

◆ CameraCoolTimeMin

int MWSDK.Wpf.MedWandController.CameraCoolTimeMin
get

Gets the minimum cooldown time, in seconds, required for the camera to be operational again after it has been turned off.

The minimum cooldown time in seconds. Returns -100 if the camera is not available.

◆ CameraHasOnTimer

bool MWSDK.Wpf.MedWandController.CameraHasOnTimer
get

Gets a value indicating whether the camera associated with the controller has an "On Timer" feature.

true if the camera has an "On Timer" feature; otherwise, false.

This property checks if the camera's model supports the "On Timer" functionality.

◆ CameraIsMonitoring

bool MWSDK.Wpf.MedWandController.CameraIsMonitoring
get

Gets a value indicating whether the camera is currently monitoring.

true if the camera is actively monitoring; otherwise, false.

This property checks the Camera instance to determine if it is in a monitoring state.

◆ CameraLedIntensityAdjustable

bool MWSDK.Wpf.MedWandController.CameraLedIntensityAdjustable
get

Gets a value indicating whether the camera's LED intensity is adjustable.

true if the camera's LED intensity can be adjusted; otherwise, false.

◆ CameraLedIntensityMax

int MWSDK.Wpf.MedWandController.CameraLedIntensityMax
get

Gets the maximum LED intensity value for the camera.

An int representing the maximum LED intensity. Returns 0 if the camera is not available.

◆ CameraMode

CameraModes MWSDK.Wpf.MedWandController.CameraMode
get

Gets the current camera mode of the connected camera module.

The MWSDK.NetCore.Internal.CameraHelper.CameraModes representing the selected camera mode. Returns MWSDK.NetCore.Internal.CameraHelper.CameraModes.Off if no camera module is available.

◆ CameraModel

string MWSDK.Wpf.MedWandController.CameraModel
get

Gets the model name of the connected camera.

A string representing the name of the camera model if a valid camera is connected; otherwise, "Unknown".

◆ CameraOnTimeMax

int MWSDK.Wpf.MedWandController.CameraOnTimeMax
get

Gets the maximum duration, in seconds, that the camera can remain active before requiring a cooldown period.

The maximum active time for the camera, or -100 if the camera is not available.

This property retrieves the value from the camera model's MWSDK.NetCore.Internal.CameraHelper.ICameraModel.OnTimeMax property.

◆ Ecg

EcgModule? MWSDK.Wpf.MedWandController.Ecg
get

Gets the ECG module associated with the MedWand device.

An instance of MWSDK.Wpf.Modules.EcgModule if the ECG module is valid; otherwise, null.

The ECG module provides functionality for monitoring, recording, and processing ECG data.

◆ EcgRecordedData

List<double>? MWSDK.Wpf.MedWandController.EcgRecordedData
get

Gets the recorded ECG (Electrocardiogram) data as a list of double values.

This property retrieves the ECG data that was recorded during a session. The data is represented as a list of numerical values, where each value corresponds to a specific point in the ECG signal. If no data is available, the property returns null.

A List<T> of double representing the recorded ECG data, or null if no data is available.

◆ HasValidEcg

bool MWSDK.Wpf.MedWandController.HasValidEcg
get

Gets a value indicating whether a valid ECG (Electrocardiogram) module is available.

true if a valid ECG module is present; otherwise, false.

◆ HasValidOtoscope

bool MWSDK.Wpf.MedWandController.HasValidOtoscope
get

Gets a value indicating whether a valid otoscope is available.

true if a valid otoscope is available; otherwise, false.

◆ HasValidStethoscope

bool MWSDK.Wpf.MedWandController.HasValidStethoscope
get

Gets a value indicating whether a valid stethoscope module is available.

true if a valid stethoscope module is present; otherwise, false.

◆ Stethoscope

StethoscopeModule? MWSDK.Wpf.MedWandController.Stethoscope
get

Gets the instance of the MWSDK.Wpf.Modules.StethoscopeModule associated with the controller.

The Stethoscope property provides access to the stethoscope module, allowing interaction with stethoscope-related functionalities, such as monitoring and recording.

An instance of MWSDK.Wpf.Modules.StethoscopeModule if a valid stethoscope module is available; otherwise, null.

◆ StethoscopeIsMonitoring

bool MWSDK.Wpf.MedWandController.StethoscopeIsMonitoring
get

Gets a value indicating whether the stethoscope is currently monitoring.

true if the stethoscope is actively monitoring; otherwise, false.

◆ StethoscopeMode

MicrophoneModes MWSDK.Wpf.MedWandController.StethoscopeMode
get

Gets the current microphone mode of the stethoscope.

A MWSDK.NetCore.Internal.StethoscopeHelpers.MicrophoneModes value representing the mode of the stethoscope. Defaults to MWSDK.NetCore.Internal.StethoscopeHelpers.MicrophoneModes.Off if the stethoscope is not available.

◆ StethoscopeModel

string MWSDK.Wpf.MedWandController.StethoscopeModel
get

Gets the model name of the connected stethoscope.

A string representing the name of the stethoscope model if available; otherwise, "Unknown".