Ejemplo n.º 1
0
    // checks the values obtained from the graphs to see if we need to raise an alarm
    private void HandleAlarms()
    {
        alarmManager = GameObject.FindGameObjectWithTag("AlarmObj").GetComponent <AlarmManager>();

        if (alarmManager.playing == false)
        {
            if (spo2 < 90f)
            {
                alarmManager.StartAlarm((int)EventTypes.SPO2LOW);
            }
            /// the alarms below were commented by jawad on the request of kylie
            /// They were commented because simulating the operating room, alarms are only present for SPO2 decrease and HR change.
            /// HR alarms were also commented because kylie said that we are not presenting HR change cues, and HR changes with SPO2 in
            /// our scenarios, so they would trigger together, and thus there isnt a need for the HR alarm

            //else if (heartRate >= 90f && heartRate <= 110f)
            //{
            //    alarmManager.StartAlarm((int)EventTypes.HRHIGH);
            //}
            //else if (heartRate > 110f)
            //{
            //    alarmManager.StartAlarm((int)EventTypes.XTACHY);
            //}
            //else if (heartRate <= 50f && heartRate > 30f)
            //{
            //    alarmManager.StartAlarm((int)EventTypes.HRLOW);
            //}
            //else if (heartRate <= 30f)
            //{
            //    alarmManager.StartAlarm((int)EventTypes.XBRADY);
            //}
            //else if (heartRate == 0f)
            //{
            //    alarmManager.StartAlarm((int)EventTypes.ASYSTOLE);
            //}
            //else if (arhythmia)
            //{
            //    alarmManager.StartAlarm((int)EventTypes.ARHYTHMIA);
            //}
            //else if (meanArterialPressure < 60f)
            //{
            //    alarmManager.StartAlarm((int)EventTypes.BPLOW);
            //}
            //else if (meanArterialPressure > 110f)
            //{
            //    alarmManager.StartAlarm((int)EventTypes.BPHIGH);
            //}
        }
        else
        {
            if (spo2 >= 90f)
            {
                alarmManager.StopAlarm();
            }
            /// the alarms below were commented by jawad on the request of kylie
            /// They were commented because simulating the operating room, alarms are only present for SPO2 decrease and HR change.
            /// HR alarms were also commented because kylie said that we are not presenting HR change cues, and HR changes with SPO2 in
            /// our scenarios, so they would trigger together, and thus there isnt a need for the HR alarm

            //if (heartRate >= 60f && heartRate <= 90f && spo2 >= 90f && meanArterialPressure >= 60f && meanArterialPressure <= 110f && !arhythmia)
            //{
            //    alarmManager.StopAlarm();
            //}
        }
    }