Esempio n. 1
0
        private void UpdateGraph(List <double> graphList) // skal ikke være static
        {
            if (chart1.InvokeRequired)
            {
                chart1.Invoke(new updateGraphDelegate(UpdateGraph), new object[] { graphList });
            }
            else
            {
                chart1.Series["Series1"].Points.Clear();

                foreach (var sample in graphList)
                {
                    chart1.Series["Series1"].Points.AddY(sample);
                }

                int puls = pulse.FindPulse();
                PulsL.Text = Convert.ToString(puls);

                if (puls > 0)
                {
                    bp.WindowOfConvertedData(graphList, puls);
                }
                if (puls <= 0)
                {
                    bp.WindowOfConvertedData(graphList, 1);
                }

                int diastolic = bp.FindDiastolic();
                DiastoliskL.Text = Convert.ToString(diastolic);

                int systolic = bp.FindSystolic();
                SystoliskL.Text = Convert.ToString(systolic);

                int mean = bp.FindMean();
                MiddelL.Text = Convert.ToString(mean);

                if (alarm.GetIsAlarmRunning() == true)
                {
                    ActiveAlarmUpdate();
                    //pauseB.Visible = true;
                    //pauseB.Enabled = true;
                    //if(AlarmCounter==0)
                    //{
                    //    ActiveAlarm.RunWorkerAsync();
                    //    AlarmCounter++;
                    //}
                }

                //if (alarm.GetIsAlarmRunning() == false)
                //{
                //    pauseB.Visible = false;
                //    AlarmCounter = 0;
                //}
            }
        }
Esempio n. 2
0
        private void UpdateGraph(List <ConvertedData> graphList) // skal ikke være static
        {
            if (chart1.InvokeRequired)
            {
                chart1.Invoke(new updateGraphDelegate(UpdateGraph), new object[] { graphList });
            }
            else
            {
                foreach (var sample in graphList)
                {
                    chart1.Series["Series"].Points.AddXY(sample.Second, sample.Pressure);
                }
            }

            if (alarm.GetIsAlarmRunning() == true)
            {
                ActiveAlarmUpdate();
            }

            //if (alarm.GetIsAlarmRunning() == false)
            //{
            //    alarm.DeactiveAlarmUpdate((object)this, new RunWorkerCompletedEventArgs() ); // hvordan ????
            //}
        }