public bool IsVitalHigh(IAlert alert, Vital vitalobject) { if (vitalobject.Value > vitalobject.Upper) { //call alert alert.SendAlert($"The {vitalobject.Name} value is {vitalobject.Value} which is too HIGH."); return(true); } return(false); }
public bool IsVitalLow(IAlert alert, Vital vitalobject) { if (vitalobject.Value < vitalobject.Lower) { //call alert alert.SendAlert($"The {vitalobject.Name} value is {vitalobject.Value} which is too LOW."); return(true); } return(false); }
public bool vitalsAreOk(IAlert alert, string name, float value, float lower, float upper) { Vital vitalobj = new Vital(name, value, lower, upper); if (!IsVitalLow(alert, vitalobj) && !IsVitalHigh(alert, vitalobj)) { return(true); } return(false); }