public Object CreateandReturnObj(PatientClassesEnumeration objectToGet) { object createdObject = null; switch (objectToGet) { case PatientClassesEnumeration.PatientAlarmer: PatientAlarmer alarmer = new PatientAlarmer(); createdObject = alarmer; break; case PatientClassesEnumeration.PatientDataReader: PatientDataReader dataReader = new PatientDataReader(); createdObject = dataReader; break; case PatientClassesEnumeration.PatientData: PatientData patientData = new PatientData(); createdObject = patientData; break; default: throw new ArgumentException("Invalid parameter passed"); } return createdObject; }
public Object CreateandReturnObj(PatientClassesEnumeration objectToGet) { object createdObject = null; switch (objectToGet) { case PatientClassesEnumeration.PatientAlarmer: PatientAlarmer alarmer = new PatientAlarmer(); createdObject = alarmer; break; case PatientClassesEnumeration.PatientDataReader: PatientDataReader dataReader = new PatientDataReader(); createdObject = dataReader; break; case PatientClassesEnumeration.PatientData: PatientData patientData = new PatientData(); createdObject = patientData; break; default: throw new ArgumentException("Invalid parameter passed"); } return(createdObject); }
public void GoodUnconnectedCreation() { var pdr = new PatientDataReader(); pdr.Connect(@"..\..\..\TestData.csv"); Assert.AreEqual(dataLine1, pdr.getData()); Assert.AreEqual(dataLine2, pdr.getData()); }
public void BadUnconnectedFileName() { var pdr = new PatientDataReader(); string fileName = @"..\..\..\" + "NonExistant.csv"; string fileName1 = @"..\..\..\" + "NonExistant.csv"; string fileName2 = @"..\..\..\" + "NonExistant.csv"; string fileName3 = @"..\..\..\" + "NonExistant.csv"; string fileName4 = @"..\..\..\" + "NonExistant.csv"; string fileName5 = @"..\..\..\" + "NonExistant.csv"; string fileName6 = @"..\..\..\" + "NonExistant.csv"; string fileName7 = @"..\..\..\" + "NonExistant.csv"; pdr.Connect(fileName, fileName1, fileName2, fileName3, fileName4, fileName5, fileName6, fileName7); }
void setupComponents() { _patientData = (PatientData)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientData); _dataReader = (PatientDataReader)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientDataReader); _alarmer = (PatientAlarmer)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientAlarmer); _alarmer.BreathingRateAlarm += new EventHandler(soundMutableAlarm); _alarmer.DiastolicBloodPressureAlarm += new EventHandler(soundMutableAlarm); _alarmer.PulseRateAlarm += new EventHandler(soundMutableAlarm); _alarmer.SystolicBloodPressureAlarm += new EventHandler(soundMutableAlarm); _alarmer.TemperatureAlarm += new EventHandler(soundMutableAlarm); _tickTimer.Stop(); _tickTimer.Interval= TimeSpan.FromMilliseconds(1000); _tickTimer.Tick += new EventHandler(updateReadings); }
public void GoodUnconnectedCreation() { var pdr = new PatientDataReader(); string fileName = @"..\..\..\" + "TestData.csv"; string fileName1 = @"..\..\..\" + "TestData.csv"; string fileName2 = @"..\..\..\" + "TestData.csv"; string fileName3 = @"..\..\..\" + "TestData.csv"; string fileName4 = @"..\..\..\" + "TestData.csv"; string fileName5 = @"..\..\..\" + "TestData.csv"; string fileName6 = @"..\..\..\" + "TestData.csv"; string fileName7 = @"..\..\..\" + "TestData.csv"; pdr.Connect(fileName,fileName1,fileName2, fileName3, fileName4, fileName5,fileName6, fileName7); Assert.AreEqual(dataLine1, pdr.getData()); Assert.AreEqual(dataLine2, pdr.getData()); }
public void DataInit() { string fileName; _listPatientDataReader = new List <PatientDataReader>(); _ListPulseRates = new List <Label>(); _ListBloodPressure = new List <Label>(); _ListTemperatures = new List <Label>(); _ListBreathingRates = new List <Label>(); _ListModuleBloodCanvas = new List <Canvas>(); _ListModuleHeartCanvas = new List <Canvas>(); _ListModulePulseCanvas = new List <Canvas>(); _ListModuleTemparatureCanvas = new List <Canvas>(); for (int i = 0; i < 8; i++) { fileName = @"..\..\..\" + "Bed " + (i + 1) + ".csv"; PatientDataReader _dataReader = (PatientDataReader)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientDataReader); _dataReader.Connect(fileName); _listPatientDataReader.Add(_dataReader); } }
void setupComponents() { _patientData = (PatientData)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientData); _patientData1 = (PatientData)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientData); _dataReader = (PatientDataReader)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientDataReader); _dataReader1 = (PatientDataReader)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientDataReader); _alarmer = (PatientAlarmer)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientAlarmer); _alarmer.BreathingRateAlarm += new EventHandler(soundMutableAlarm); _alarmer.DiastolicBloodPressureAlarm += new EventHandler(soundMutableAlarm); _alarmer.PulseRateAlarm += new EventHandler(soundMutableAlarm); _alarmer.SystolicBloodPressureAlarm += new EventHandler(soundMutableAlarm); _alarmer.TemperatureAlarm += new EventHandler(soundMutableAlarm); /*string fileName = @"..\..\..\" + "Bed 1" + ".csv"; * _dataReader.Connect(fileName); * * string fileName2 = @"..\..\..\" + "Bed 2" + ".csv"; * _dataReader1.Connect(fileName2);*/ _tickTimer.Stop(); _tickTimer.Interval = TimeSpan.FromMilliseconds(1000); _tickTimer.Tick += new EventHandler(updateReadings); _tickTimer.Start(); }
void setupComponents() { _patientData = (PatientData)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientData); _dataReader = (PatientDataReader)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientDataReader); _alarmer = (PatientAlarmer)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientAlarmer); _alarmer1 = (PatientAlarmer)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientAlarmer); _alarmer2 = (PatientAlarmer)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientAlarmer); _alarmer3 = (PatientAlarmer)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientAlarmer); _alarmer4 = (PatientAlarmer)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientAlarmer); _alarmer5 = (PatientAlarmer)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientAlarmer); _alarmer6 = (PatientAlarmer)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientAlarmer); _alarmer7 = (PatientAlarmer)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientAlarmer); _alarmer.BreathingRateAlarm += new EventHandler(soundMutableAlarm); _alarmer.DiastolicBloodPressureAlarm += new EventHandler(soundMutableAlarm); _alarmer.PulseRateAlarm += new EventHandler(soundMutableAlarm); _alarmer.SystolicBloodPressureAlarm += new EventHandler(soundMutableAlarm); _alarmer.TemperatureAlarm += new EventHandler(soundMutableAlarm); _alarmer1.BreathingRateAlarm += new EventHandler(soundMutableAlarm1); _alarmer1.DiastolicBloodPressureAlarm += new EventHandler(soundMutableAlarm1); _alarmer1.PulseRateAlarm += new EventHandler(soundMutableAlarm1); _alarmer1.SystolicBloodPressureAlarm += new EventHandler(soundMutableAlarm1); _alarmer1.TemperatureAlarm += new EventHandler(soundMutableAlarm1); _alarmer2.BreathingRateAlarm2 += new EventHandler(soundMutableAlarm2); _alarmer2.DiastolicBloodPressureAlarm2 += new EventHandler(soundMutableAlarm2); _alarmer2.PulseRateAlarm2 += new EventHandler(soundMutableAlarm2); _alarmer2.SystolicBloodPressureAlarm2 += new EventHandler(soundMutableAlarm2); _alarmer2.TemperatureAlarm2 += new EventHandler(soundMutableAlarm2); _alarmer3.BreathingRateAlarm3 += new EventHandler(soundMutableAlarm3); _alarmer3.DiastolicBloodPressureAlarm3 += new EventHandler(soundMutableAlarm3); _alarmer3.PulseRateAlarm3 += new EventHandler(soundMutableAlarm3); _alarmer3.SystolicBloodPressureAlarm3 += new EventHandler(soundMutableAlarm3); _alarmer3.TemperatureAlarm3 += new EventHandler(soundMutableAlarm3); _alarmer4.BreathingRateAlarm4 += new EventHandler(soundMutableAlarm4); _alarmer4.DiastolicBloodPressureAlarm4 += new EventHandler(soundMutableAlarm4); _alarmer4.PulseRateAlarm4 += new EventHandler(soundMutableAlarm4); _alarmer4.SystolicBloodPressureAlarm4 += new EventHandler(soundMutableAlarm4); _alarmer4.TemperatureAlarm4 += new EventHandler(soundMutableAlarm4); _alarmer5.BreathingRateAlarm5 += new EventHandler(soundMutableAlarm5); _alarmer5.DiastolicBloodPressureAlarm5 += new EventHandler(soundMutableAlarm5); _alarmer5.PulseRateAlarm5 += new EventHandler(soundMutableAlarm5); _alarmer5.SystolicBloodPressureAlarm5 += new EventHandler(soundMutableAlarm5); _alarmer5.TemperatureAlarm5 += new EventHandler(soundMutableAlarm5); _alarmer6.BreathingRateAlarm6 += new EventHandler(soundMutableAlarm6); _alarmer6.DiastolicBloodPressureAlarm6 += new EventHandler(soundMutableAlarm6); _alarmer6.PulseRateAlarm6 += new EventHandler(soundMutableAlarm6); _alarmer6.SystolicBloodPressureAlarm6 += new EventHandler(soundMutableAlarm6); _alarmer6.TemperatureAlarm6 += new EventHandler(soundMutableAlarm6); _alarmer7.BreathingRateAlarm7 += new EventHandler(soundMutableAlarm7); _alarmer7.DiastolicBloodPressureAlarm7 += new EventHandler(soundMutableAlarm7); _alarmer7.PulseRateAlarm7 += new EventHandler(soundMutableAlarm7); _alarmer7.SystolicBloodPressureAlarm7 += new EventHandler(soundMutableAlarm7); _alarmer7.TemperatureAlarm7 += new EventHandler(soundMutableAlarm7); _tickTimer.Stop(); _tickTimer.Interval = TimeSpan.FromMilliseconds(1000); _tickTimer.Tick += new EventHandler(updateReadings); }
void setupComponents() { _patientData = (PatientData)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientData); _dataReader = (PatientDataReader)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientDataReader); _alarmer = (PatientAlarmer)_patientFactory.CreateandReturnObj(PatientClassesEnumeration.PatientAlarmer); #region old code //_alarmer.BreathingRateAlarm += new EventHandler(soundMutableAlarm); //_alarmer.DiastolicBloodPressureAlarm += new EventHandler(soundMutableAlarm); //_alarmer.PulseRateAlarm += new EventHandler(soundMutableAlarm); //_alarmer.SystolicBloodPressureAlarm += new EventHandler(soundMutableAlarm); //_alarmer.TemperatureAlarm += new EventHandler(soundMutableAlarm); foreach (Patient p in pCreator.bay) { foreach (Mod _mods in p.pAlarmer.Mods) { _mods.ModAlarm += new EventHandler(soundMutableAlarm); } //p.pAlarmer.Mod1Alarm += new EventHandler(soundMutableAlarm); //p.pAlarmer.Mod3BAlarm += new EventHandler(soundMutableAlarm); //p.pAlarmer.Mod2Alarm += new EventHandler(soundMutableAlarm); //p.pAlarmer.Mod3AAlarm += new EventHandler(soundMutableAlarm); //p.pAlarmer.Mod4Alarm += new EventHandler(soundMutableAlarm); } #endregion _tickTimer.Start(); _tickTimer.Interval= TimeSpan.FromMilliseconds(1000); _tickTimer.Tick += new EventHandler(updateReadings); }
public void BadUnconnectedFileName() { var pdr = new PatientDataReader(); pdr.Connect(@"..\..\..\NonExistant.csv"); }