FirstModulAR 0.1.0
Loading...
Searching...
No Matches
FMAR.UI.Widgets.CPRTrainer.CprTrainer Class Reference

The CPR Trainer widget, allows the user to simulate CPR compression and provides feedback on the quality of the compression. More...

Inheritance diagram for FMAR.UI.Widgets.CPRTrainer.CprTrainer:
FMAR.UI.Widgets.Widget FMAR.Comms.Vitals.IVitalsProvider

Public Member Functions

override void SetWidgetContainer (WidgetContainer widgetContainer)
 Sets the widget container and updates UI activation based on the container's scale factor.
 
bool TryGetVital (DataType vital, out List<(double time, double value)> list)
 Tries to get a vital from the vital data.
 
- Public Member Functions inherited from FMAR.UI.Widgets.Widget
void SetBorderPositions (Vector2 size)
 Sets the border positions.
 
void UpdateBorderTransparency ()
 Updates the border transparency based on the widget container's border transparency.
 
void DetachFromContainer ()
 Detaches the widget from the widget container.
 
void PlaySound (AudioClip clip)
 Plays a sound localized to the widget.
 
bool TryMove ()
 Tries to move the widget out of the widget container.
 
void SetBackgroundEnabled (bool enabled)
 Sets the background's enabled state.
 
- Public Member Functions inherited from FMAR.Comms.Vitals.IVitalsProvider

Protected Member Functions

override void Awake ()
 Initializes widget, setting up vital data, connecting to the server, and setting up UI listeners.
 
override void Start ()
 Starts the widget, setting up a coroutine to log pulse data to the console and start the widget.
 
override void Update ()
 Updates the widget every frame, processing data, updating UI, and handling input.
 
- Protected Member Functions inherited from FMAR.UI.Widgets.Widget
void CreateBorder (Vector2 size)
 Creates a border for the widget, around the edges.
 

Properties

IReadOnlyCollection< DataType > VitalsProvided [get]
 Gets the collection of data types for the provided vital signs.
 
IReadOnlyDictionary< VitalsThreshold, float > VitalsThresholdAlertTimers [get]
 Provides the dictionary of alert timers for the vital sign thresholds.
 
- Properties inherited from FMAR.UI.Widgets.Widget
WidgetContainer WidgetContainer [get]
 
Vector2 PreferredFloatingDisplaySize [get]
 
Color BackgroundBaseColor [get]
 
RectTransform Rt [get]
 
bool Locked [get]
 
- Properties inherited from FMAR.Comms.Vitals.IVitalsProvider

Additional Inherited Members

- Public Attributes inherited from FMAR.UI.Widgets.Widget
Sprite widgetIcon
 
- Protected Attributes inherited from FMAR.UI.Widgets.Widget
Image bg
 
RectTransform rt
 
AudioSource aud
 

Detailed Description

The CPR Trainer widget, allows the user to simulate CPR compression and provides feedback on the quality of the compression.

Member Function Documentation

◆ Awake()

override void FMAR.UI.Widgets.CPRTrainer.CprTrainer.Awake ( )
inlineprotectedvirtual

Initializes widget, setting up vital data, connecting to the server, and setting up UI listeners.

Reimplemented from FMAR.UI.Widgets.Widget.

◆ SetWidgetContainer()

override void FMAR.UI.Widgets.CPRTrainer.CprTrainer.SetWidgetContainer ( WidgetContainer widgetContainer)
inlinevirtual

Sets the widget container and updates UI activation based on the container's scale factor.

Parameters
widgetContainerThe widget container to set.

Reimplemented from FMAR.UI.Widgets.Widget.

◆ Start()

override void FMAR.UI.Widgets.CPRTrainer.CprTrainer.Start ( )
inlineprotectedvirtual

Starts the widget, setting up a coroutine to log pulse data to the console and start the widget.

Reimplemented from FMAR.UI.Widgets.Widget.

◆ TryGetVital()

bool FMAR.UI.Widgets.CPRTrainer.CprTrainer.TryGetVital ( DataType vital,
out List<(double time, double value)> list )
inline

Tries to get a vital from the vital data.

Parameters
vitalThe vital to get.
listThe output list of vital data.
Returns
Whether the vital was found.

Implements FMAR.Comms.Vitals.IVitalsProvider.

◆ Update()

override void FMAR.UI.Widgets.CPRTrainer.CprTrainer.Update ( )
inlineprotectedvirtual

Updates the widget every frame, processing data, updating UI, and handling input.

Reimplemented from FMAR.UI.Widgets.Widget.

Property Documentation

◆ VitalsProvided

IReadOnlyCollection<DataType> FMAR.UI.Widgets.CPRTrainer.CprTrainer.VitalsProvided
get

Gets the collection of data types for the provided vital signs.

Implements FMAR.Comms.Vitals.IVitalsProvider.

◆ VitalsThresholdAlertTimers

IReadOnlyDictionary<VitalsThreshold, float> FMAR.UI.Widgets.CPRTrainer.CprTrainer.VitalsThresholdAlertTimers
get

Provides the dictionary of alert timers for the vital sign thresholds.

Implements FMAR.Comms.Vitals.IVitalsProvider.


The documentation for this class was generated from the following file: