using adas_core.Domain.Models;
using adas_core.Domain.Utils;
namespace adas_core.module.LightBeacons.Devices;
///
/// Abstract class representing a light beacon device. This class defines the basic structure and behavior of a light beacon, including methods for controlling the beacon's colors and generating alerts based on patient observations.
/// The specific implementation of these methods will depend on the type of light beacon being used and the requirements of the application.
///
/// A dictionary containing configuration options for the light beacon. This can include settings such as the beacon's IP address, port number, color configurations, and other relevant parameters.
public abstract class LightBeacon(EquatableDictionary options)
{
///
/// A dictionary containing configuration options for the light beacon. This can include settings such as the beacon's IP address, port number, color configurations, and other relevant parameters.
///
protected readonly EquatableDictionary Options = options;
///
/// Turns the light beacon blue. This method should be implemented to control the beacon's hardware or software interface to change its color to blue.
///
/// A task representing the asynchronous operation.
public abstract Task BlueCode();
///
/// Turns the light beacon red. This method should be implemented to control the beacon's hardware or software interface to change its color to red.
///
/// A task representing the asynchronous operation.
public abstract Task RedCode();
///
/// Turns the light beacon yellow. This method should be implemented to control the beacon's hardware or software interface to change its color to yellow.
///
/// A task representing the asynchronous operation.
public abstract Task YellowCode();
///
/// Turns off the light beacon. This method should be implemented to control the beacon's hardware or software interface to turn off the light, regardless of its current color.
///
///
public abstract Task PowerOffLed();
///
/// Generates a color alert based on the provided patient observation. This method should analyze the patient observation and determine the appropriate color alert to display on the light beacon.
/// The specific logic for determining the color alert will depend on the criteria defined in the patient observation, such as thresholds for vital signs or other relevant parameters.
///
/// The patient observation used to determine the appropriate color alert.
/// A task representing the asynchronous operation.
public abstract Task GenerateColorAlert(PatientObservation obs);
///
/// Retrieves the current color of the light beacon. This method should be implemented to query the beacon's hardware or software interface to determine its current color state and return it as a value from the LightBeaconColor enumeration.
///
/// A task representing the asynchronous operation, with a result of the current color of the light beacon.
public abstract Task GetBeaconColor();
}