Exemplo n.º 1
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            LineItem       curve  = DiagramaDinamicoTiempoReal.GraphPane.CurveList[0] as LineItem;
            IPointListEdit list   = curve.Points as IPointListEdit;
            double         time   = (Environment.TickCount - tickStart) / 1000.0;
            Globales       global = new Globales();

            valueCPUSecuencial = this.theCPUCounter.NextValue();


            list.Add(DateTime.Now.ToOADate(), valueCPUSecuencial);
            DateTime now = DateTime.Now;

            DiagramaDinamicoTiempoReal.GraphPane.XAxis.Scale.Max = now.ToOADate();
            DiagramaDinamicoTiempoReal.GraphPane.XAxis.Scale.Min = DateTime.Now.AddSeconds(-displaySeconds).ToOADate();
            DiagramaDinamicoTiempoReal.AxisChange();
            DiagramaDinamicoTiempoReal.Invalidate();
        }
Exemplo n.º 2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            GraphPane            myPane = DiagramaDinamicoTiempoReal.GraphPane;
            RollingPointPairList list   = new RollingPointPairList(1200);
            LineItem             curve  = myPane.AddCurve("Voltage", list, Color.Blue, SymbolType.None);

            timer1.Interval = 50;
            timer1.Enabled  = true;
            timer1.Tick    += new EventHandler(timer1_Tick);
            timer1.Start();
            int numberOfDivisions = 4;

            myPane.XAxis.Scale.MinorStep = (int)displaySeconds / numberOfDivisions;
            myPane.XAxis.Scale.MajorStep = (int)displaySeconds / numberOfDivisions;

            myPane.XAxis.Scale.Format = "HH:mm:ss";
            //myPane.XAxis.Scale.MajorStepAuto = false;
            //myPane.XAxis.Scale.MinorStepAuto = false;
            myPane.XAxis.Scale.MajorUnit = DateUnit.Second;
            myPane.XAxis.Scale.MinorUnit = DateUnit.Second;
            DiagramaDinamicoTiempoReal.AxisChange();
            tickStart = Environment.TickCount;
        }