Exemple #1
0
 private void offlineAnlyzeProcess()
 {
     try
     {
         //double[,] result =
         IVitalSignsService vitalSignsService = ServiceManager.getOneVitalSignsService();
         FrequencyInfo      frequency         = vitalSignsService.offlineAnalyze(filename);
         ServiceManager.closeService(vitalSignsService);
         double[] heartbeat     = frequency.heartbeat;
         double[] breath        = frequency.breath;
         double[] t             = frequency.t;
         double   meanBreath    = frequency.meanBreath;
         double   meanHeartbeat = frequency.meanHeartbeat;
         this.BeginInvoke(method: new Action(() =>
         {
             for (int i = 0; i < heartbeat.Length; i++)
             {
                 chart1.Series[BREATH_RATE].Points.AddXY(t[i], breath[i]);
                 chart1.Series[HEART_RATE].Points.AddXY(t[i], heartbeat[i]);
             }
             updateBreathAndHeartbeat(meanBreath, meanHeartbeat);
             updateGauge();
         }));
     }
     catch (Exception ex)
     {
         Console.WriteLine("服务调用失败" + ex.ToString());
     }
 }
Exemple #2
0
 public EprService(
     IVitalSignsService vitalSignsService,
     IPhysicalExamService physicalExamService,
     IDietService dietService,
     IExerciseService exerciseService,
     ITreatmentService treatmentService,
     IMedicalRecordService medicalRecordService)
 {
     _vitalSignsService    = vitalSignsService;
     _physicalExamService  = physicalExamService;
     _dietService          = dietService;
     _exerciseService      = exerciseService;
     _treatmentService     = treatmentService;
     _medicalRecordService = medicalRecordService;
 }
Exemple #3
0
        public void realtimeAnalyze()
        {
            IVitalSignsService vitalSignsService = ServiceManager.getOneVitalSignsService();
            FrequencyInfo      fre = vitalSignsService.realtimeAnalyze();

            ServiceManager.closeService(vitalSignsService);
            if (fre != null)
            {
                _vitalSignsForm.updateFail(fre.fail);
                if (fre.fail == 3 || fre.fail == 0)
                {
                    _vitalSignsForm.updateBreathAndHeartbeat(fre.meanBreath, fre.meanHeartbeat);
                    frequencyTable.add(fre.meanBreath, fre.meanHeartbeat, DateTime.Now.ToString("hh:mm:ss"));
                }
            }
        }
Exemple #4
0
 public void startVitalSignsMonitoring()
 {
     //vitalSignsTiming = 0;
     frequencyTable = new FrequencyTable();
     vitalSignsTimer.Start();
     vitalSignsTimer.Enabled = true;
     try
     {
         IVitalSignsService vitalS = ServiceManager.getOneVitalSignsService();
         vitalS.cleanBuffer();
         ServiceManager.closeService(vitalS);
     }catch (Exception ex)
     {
         Console.WriteLine(ex.ToString());
     }
     //vitalSignsTimer.AutoReset = true;
 }
 public OpdRecordController(
     IVitalSignsService vitalSignsService,
     IPhysicalExamService physicalExamService,
     IDietService dietService,
     IExerciseService exerciseService,
     ITreatmentService treatmentService,
     IEprService eprService,
     IPatientInfoService patientInfoService,
     IMedicalRecordService medicalRecordService)
 {
     _vitalSignsService    = vitalSignsService;
     _physicalExamService  = physicalExamService;
     _dietService          = dietService;
     _exerciseService      = exerciseService;
     _treatmentService     = treatmentService;
     _eprService           = eprService;
     _patientInfoService   = patientInfoService;
     _medicalRecordService = medicalRecordService;
 }
Exemple #6
0
        /// <summary>
        /// Update display forms(TagTableForm, RSSIGraphForm...) once receiving a new tag report from RFID reader
        /// </summary>
        /// <param name="tagInfo">an object containing all information of a tag in one tag report</param>
        public void UpdateDisplayForms(TagInfo tagInfo, bool isSimulation)
        {
            if (tagInfo.TotalTagCount == 1)
            {
                _firstReportTime = tagInfo.FirstSeenTime;
            }
            tagInfo.TimeStamp = tagInfo.FirstSeenTime - _firstReportTime;

            // Update status strip in MainForm
            UpdateStatusStrip(tagInfo, isSimulation);

            // Update Tag Filter in ReaderSettingsFrom
            if (_readerSettingsForm.Visible)
            {
                _readerSettingsForm.UpdateTagFilter(tagInfo);
            }

            // Update TagTableForm
            if (_tagTableForm.Visible)
            {
                _tagTableForm.UpdateTagTable(tagInfo);
            }

            // Update RSSIGraphForm
            if (_rssiGraphForm.Visible)
            {
                _rssiGraphForm.UpdateRSSIGraph(tagInfo);
            }

            // Update PhaseGraphForm
            if (_phaseGraphForm.Visible)
            {
                _phaseGraphForm.UpdatePhaseGraph(tagInfo);
            }

            _tagsTable.AddTagInfo(tagInfo);

            /* tagInfoQueue.Enqueue(tagInfo);
             * if (vitalSignsTiming >= 3)
             * {
             *   tagInfoQueue.Dequeue();
             * }
             * if (isFinish)
             * {
             *   tagInfos = tagInfoQueue.ToList<TagInfo>();
             * }*/
            try
            {
                IVitalSignsService vitalSignsService = ServiceManager.getOneVitalSignsService();
                long   timestamp = (long)tagInfo.TimeStamp;
                double phase     = tagInfo.AcutalPhaseInRadian;
                int    frequency = tagInfo.Frequency;
                string epc       = tagInfo.EPC;
                vitalSignsService.addTagInfo(timestamp, phase, frequency, epc);
                if (vitalSignsTiming >= DELAY_TIME_SECOND)
                {
                    vitalSignsService.removeHead();
                }
                ServiceManager.closeService(vitalSignsService);
            }catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }
Exemple #7
0
 public static void closeService(IVitalSignsService service)
 {
     ((VitalSignsServiceClient)service).Close();
 }