Beispiel #1
0
 public AsyncDaq(ConcurrentQueue <RawData> rawDataQueue, ConcurrentQueue <RawData> saveDataQueue, DAQSettingsDTO daqSettingsDTO)
 {
     _rawDataQueue   = rawDataQueue;
     _saveDataQueue  = saveDataQueue;
     _daqSettingsDTO = daqSettingsDTO;
     _queueMode      = false;
 }
Beispiel #2
0
 public DeQueue(ConcurrentQueue <RawData> rawDataQueue, DAQSettingsDTO daqSettingsDTO)
 {
     _stopThread     = false;
     _rawDataQueue   = rawDataQueue;
     _listOfRawData  = new List <double>();
     _daqSettingsDTO = daqSettingsDTO;
     _converter      = new Converter(_daqSettingsDTO);
 }
 public CtrlOPVitalsBL(iOPVitalsDAL currentDal)
 {
     this.currentDal    = currentDal;
     rsquaredCalculator = new RsquaredCalculator();
     calibration        = new Calibration(rsquaredCalculator);
     daqSettings        = new DAQSettingsDTO();
     employee           = new EmployeeDTO();
     this.currentDal.StartDaq();
 }
Beispiel #4
0
 public CalcPuls(DAQSettingsDTO daqDTO, AutoResetEvent dataReadyEvent, DeQueue deQueue)
 {
     _daqDTO         = daqDTO;
     analysisList    = new List <double>();
     _puls           = 0;
     _dataReadyEvent = dataReadyEvent;
     _deQueue        = deQueue;
     _deQueue.Attach(this);
 }
Beispiel #5
0
 public CalcMeanBloodPressure(DAQSettingsDTO daqDTO, AutoResetEvent dataReadyEvent, DeQueue deQueue)
 {
     _dataReadyEvent    = dataReadyEvent;
     _meanBloodPressure = 0;
     analyselist        = new List <double>();
     _daqDTO            = daqDTO;
     _deQueue           = deQueue;
     _deQueue.Attach(this);
 }
 public void AddDAQ(SqlCommand cmd, DAQSettingsDTO DAQ)
 {
     cmd.Parameters.AddWithValue("@Samplerate_hz", DAQ.SampleRate);
     cmd.Parameters.AddWithValue("@Interval_sec", DAQ.Interval_ms);
     cmd.Parameters.AddWithValue("@Data_Format", DAQ.Data_Format_);
     cmd.Parameters.AddWithValue("@Bin_or_Text", DAQ.Bin_or_text_);
     cmd.Parameters.AddWithValue("@Measurement_Format_Type", DAQ.Data_Format_);
     cmd.Parameters.AddWithValue("@ConversionConstant_mmhgprmV", DAQ.ConversionConstant_);
     cmd.Parameters.AddWithValue("@ZeroPoint_mmHg", DAQ.ZeroPoint_);
 }
 public SaveDataInFile(DAQSettingsDTO daqDTO, ConcurrentQueue <RawData> saveDataQueue, FileManager fileManager, BPDataSequenceDTO bpDataSequenceDTO)
 {
     savelist           = new List <double>();
     _daqDTO            = daqDTO;
     _saveDataQueue     = saveDataQueue;
     _fileManager       = fileManager;
     _stopThread        = false;
     _sequenceNumber    = 1;
     _bpDataSequenceDTO = bpDataSequenceDTO;
 }
Beispiel #8
0
 public CalcSys(DAQSettingsDTO daqDTO, AutoResetEvent dataReadyEvent, DeQueue deQueue, IAlarm alarm)
 {
     analyselist     = new List <double>();
     _sys            = 0;
     _daqDTO         = daqDTO;
     _dataReadyEvent = dataReadyEvent;
     _deQueue        = deQueue;
     _deQueue.Attach(this);
     _alarm = alarm;
     sys    = 0;
 }
Beispiel #9
0
        public void SaveMeasurement_InsertEmployee_AddEmployeeWasCalled()
        {
            var               parameterBuilder = new MuckParameterBuilder();
            var               uut            = new ClinicalDatabase(parameterBuilder);
            EmployeeDTO       employee       = new EmployeeDTO();
            OperationDTO      operation      = new OperationDTO();
            PatientDTO        patient        = new PatientDTO();
            DAQSettingsDTO    daq            = new DAQSettingsDTO();
            BPDataSequenceDTO bpDataSequence = new BPDataSequenceDTO();
            TransdusorDTO     transdusor     = new TransdusorDTO();

            uut.SaveMeasurement(employee, operation, patient, daq, bpDataSequence, transdusor);

            Assert.That(parameterBuilder.WasAddEmployeeCalled, Is.EqualTo(true));
        }
        public void CalculatePuls_SinusSignal4point166Hz_Puls250()
        {
            DAQSettingsDTO            _daqSettings    = new DAQSettingsDTO();
            AutoResetEvent            _autoresetevent = new AutoResetEvent(false);
            ConcurrentQueue <RawData> _dataQueues     = new ConcurrentQueue <RawData>();
            DeQueue dequeue = new DeQueue(_dataQueues, _daqSettings);

            uut = new CalcPuls(_daqSettings, _autoresetevent, dequeue);

            List <double> data = Generate.Sinusoidal(6000, 1000, 4.166, 2, 1, 0, 0).ToList();

            uut.CalculatePuls(data);

            Assert.That(uut.GetPuls(), Is.EqualTo(250));
        }
Beispiel #11
0
        public void CalcMeanBloodPressure_DC3_MeanIs3()
        {
            DAQSettingsDTO            daq             = new DAQSettingsDTO();
            AutoResetEvent            _autoresetevent = new AutoResetEvent(false);
            ConcurrentQueue <RawData> _dataQueues     = new ConcurrentQueue <RawData>();
            DeQueue dequeue = new DeQueue(_dataQueues, daq);

            uut = new CalcMeanBloodPressure(daq, _autoresetevent, dequeue);

            List <double> data = Generate.Sinusoidal(3000, 1000, 3, 0, 3, 0, 0).ToList();

            uut.CalculateMean(data);

            Assert.That(uut.GetMeanBloodPressure(), Is.EqualTo(3));
        }
Beispiel #12
0
 public CtrlOPVitalsDAL(ref ConcurrentQueue <RawData> RawDataQueue, ref ConcurrentQueue <RawData> saveDataQueue, ref DAQSettingsDTO daqSettings)
 {
     _RawDataQueue      = RawDataQueue;
     _saveDataQueue     = saveDataQueue;
     _daqSettings       = daqSettings;
     fileManager        = new FileManager();
     employee           = new EmployeeDatabase();
     DaqAsync           = new AsyncDaq(_RawDataQueue, _saveDataQueue, _daqSettings);
     _bpDataSequenceDTO = new BPDataSequenceDTO();
     _saveDataInFile    = new SaveDataInFile(_daqSettings, _saveDataQueue, fileManager, _bpDataSequenceDTO);
     _clinicalDatabase  = new ClinicalDatabase(new ParameterBuilder());
     _transdusorDTO     = new TransdusorDTO();
     pathcomment        = "";
     pathoperation      = "";
 }
        public void CalculateSys_sinusWithAmplityde5_akutalarmIsCalled()
        {
            DAQSettingsDTO            daq             = new DAQSettingsDTO();
            AutoResetEvent            _autoresetevent = new AutoResetEvent(false);
            ConcurrentQueue <RawData> _dataQueues     = new ConcurrentQueue <RawData>();
            DeQueue dequeue = new DeQueue(_dataQueues, daq);
            var     alarm   = new MuckAlarm();

            uut = new CalcSys(daq, _autoresetevent, dequeue, alarm);

            List <double> data = Generate.Sinusoidal(3000, 1000, 1, 5, 0, 0, 0).ToList();

            uut.CalculateSys(data);

            Assert.That(alarm.CheckAkutAlarmWasCalled, Is.EqualTo(true));
        }
Beispiel #14
0
        public void CalculateDia_sinusWithAmplityde5_diaIsminus5()
        {
            DAQSettingsDTO            daq             = new DAQSettingsDTO();
            AutoResetEvent            _autoresetevent = new AutoResetEvent(false);
            ConcurrentQueue <RawData> _dataQueues     = new ConcurrentQueue <RawData>();
            DeQueue dequeue = new DeQueue(_dataQueues, daq);
            var     alarm   = new MuckAlarm();

            uut = new CalcDia(daq, _autoresetevent, dequeue, alarm);

            List <double> data = Generate.Sinusoidal(3000, 1000, 1, -5, 0, 0, 0).ToList();

            uut.CalculateDia(data);

            Assert.That(uut.GetDia(), Is.EqualTo(-5));
        }
Beispiel #15
0
        public Program()
        {
            //Datakøer
            RawDataQueue = new ConcurrentQueue <RawData>();
            SaveQueue    = new ConcurrentQueue <RawData>();

            //DTO'er
            daqSettings = new DAQSettingsDTO();
            patientDTO  = new PatientDTO();


            currentOpVitalsDal = new CtrlOPVitalsDAL(ref RawDataQueue, ref SaveQueue, ref daqSettings);
            currentOpVitalsBl  = new CtrlOPVitalsBL(currentOpVitalsDal, ref RawDataQueue, ref daqSettings, patientDTO);
            currentOpVitalsPl  = new CtrlOPVitalsPL(currentOpVitalsBl);
            currentOpVitalsPl.StartGUI();
        }
Beispiel #16
0
 public CtrlOPVitalsBL(iOPVitalsDAL currentDal, ref ConcurrentQueue <RawData> RawDataQueue, ref DAQSettingsDTO daqSettingsDto, PatientDTO patientDto)
 {
     _RawDataQueue   = RawDataQueue;
     this.currentDal = currentDal;
     InitializeDataReadyEvents();
     InitializeCalibrationClasses();
     _daqSettings       = daqSettingsDto;
     _patientDto        = patientDto;
     _operationDTO      = new OperationDTO();
     employee           = new EmployeeDTO();
     _deQueue           = new DeQueue(_RawDataQueue, _daqSettings);
     _filterSettingsDTO = new FilterSettingsDTO();
     _filterFactory     = new FilterFactory(_daqSettings, _filterSettingsDTO);
     meanfilter_        = new MeanFilter(_dataReadyEventMeanFilter, _deQueue, _filterFactory);
     InitializeAlarmClasses();
     InitializeCalculationClasses();
     zero = 0.0;
 }
Beispiel #17
0
 public void AddDAQ(SqlCommand cmd, DAQSettingsDTO DAQ)
 {
     WasAddDAQCalled = true;
 }
 public FilterFactory(DAQSettingsDTO daqDTO, FilterSettingsDTO filterSettings)
 {
     _daqDTO         = daqDTO;
     _filterSettings = filterSettings;
 }
 public void Setup()
 {
     _daqSettingsDto = new DAQSettingsDTO();
     uut             = new Converter(_daqSettingsDto);
 }
Beispiel #20
0
 public ButterworthFilter(DAQSettingsDTO daqDTO)
 {
     _daqDTO = daqDTO;
     _CutOff = 20;
 }
Beispiel #21
0
 public Converter(DAQSettingsDTO daqSettingsDTO)
 {
     _daqSettingsDTO = daqSettingsDTO;
 }
Beispiel #22
0
        public bool SaveMeasurement(EmployeeDTO employee, OperationDTO operation, PatientDTO patient, DAQSettingsDTO DAQ, BPDataSequenceDTO dataSequence, TransdusorDTO transdusor, string pathcomment, string pathoperation)
        {
            long   OperationID_;
            bool   saved = true;
            int    BPdataID_;
            string insertStringParamOperation = @"INSERT INTO Operation(OPNurseFirstName, OPNurseLastName, OPNurseIDNumber, NumberOFAlarms, Comments, DurationOperation_hour, DurationOperation_min, DurationOperation_sec, PatientCPR, Complikations)
                                        OUTPUT INSERTED.OperationID
                                        VALUES(@OPNurseFirstName, @OPNurseLastName, @OPNurseIDNumber, @NumberOFAlarms, @Comments, @DurationOperation_hour, @DurationOperation_min, @DurationOperation_sec, @PatientCPR, @Complikations)";

            using (SqlCommand cmd = new SqlCommand(insertStringParamOperation, OpenConnection))
            {
                parameterBuilder_.AddEmployee(cmd, employee);
                parameterBuilder_.AddOperation(cmd, operation);
                parameterBuilder_.AddComments(cmd, pathcomment);
                parameterBuilder_.AddPatient(cmd, patient);
                OperationID_ = (long)cmd.ExecuteScalar();
            }

            string insertStringParamBPDataSequence = @"INSERT INTO BPDataSequence( Raw_Data, Samplerate_hz, Interval_sec, NumberOfSequences, SequenceDuration_sec, Data_Format, Bin_or_Text, Measurement_Format_Type, ConversionConstant_mmhgprmV, ZeroPoint_mmHg, Transdusor_Identification, OperationID )
                                        OUTPUT INSERTED.BPdataID 
                                        VALUES(@Raw_Data,@Samplerate_hz, @Interval_sec, @NumberOfSequences, @SequenceDuration_sec, @Data_Format, @Bin_or_Text, @Measurement_Format_Type,@ConversionConstant_mmhgprmV,@ZeroPoint_mmHg,@Transdusor_Identification,@OperationID)";

            using (SqlCommand cmd = new SqlCommand(insertStringParamBPDataSequence, OpenConnection))
            {
                parameterBuilder_.AddRawData(cmd, Zipfolder(pathoperation));
                parameterBuilder_.AddDAQ(cmd, DAQ);
                parameterBuilder_.AddDataSequence(cmd, dataSequence);
                parameterBuilder_.AddTransdusor(cmd, transdusor);
                cmd.Parameters.AddWithValue("@OperationID", OperationID_);

                BPdataID_ = (int)cmd.ExecuteScalar();
            }
            return(saved);
        }