// Use this for initialization void Start() { // get the patient singleton and default values patient = Patient.Instance; heartRate = patient.HeartRate; intervalR = heartRate / 60.0f; continuousMonitor = GameObject.FindGameObjectWithTag("ContMonitor").GetComponent <ContinousMonitor>(); triggerSANode = true; // start new heartbeat // set the rates for the waves Pwavrate = 12.5f; Qrswavrate = 25.0f; Jwavrate = 25.0f; Twavrate = 4.6f; Uwavrate = 25.0f; // create the interval array intervalArrayR = new float[10]; for (var i = 0; i < 10; i++) { intervalArrayR[i] = intervalR; } }
// Use this for initialization void Start() { continuousMonitor = GameObject.FindGameObjectWithTag("ContMonitor").GetComponent <ContinousMonitor>(); patient = Patient.Instance; targetSaturation = patient.Spo2; scaledTarget = targetSaturation / 10.0f; pulse = patient.Pulse; baseLine = 1.0f; // one pulse should take the same time as the heart rate // the time between systole and diastole is about 54% of one // beat, so (60 bpm * 0.54) / targetBPM = between seconds betweenTime = (60f * 0.545f) / pulse; // for a pulse of 60, srate = 5, drate = 3.4 // so for any pulse, srate = pulse / 12, drate = pulse / 17.65 srate = pulse / 9f; drate = pulse / 15.65f; currentSum = baseLine; previousSum = baseLine; intervalArray = new float[10]; for (int i = 0; i < 10; i++) { intervalArray[i] = pulse / 60.0f; } between = true; }
void Awake() { // get our variables and set some of the boolean properties continuosMonitor = GameObject.FindGameObjectWithTag("ContMonitor").GetComponent <ContinousMonitor>(); notificationBackground = GameObject.FindGameObjectWithTag("AlarmNotify").GetComponent <Image>(); notificationText = GameObject.FindGameObjectWithTag("AlarmNotify").GetComponentInChildren <Text>(); DontDestroyOnLoad(gameObject); efxSource = GetComponent <AudioSource>(); playing = false; disabled = false; notificationBackground.color = Color.clear; notificationText.text = ""; }