예제 #1
0
        private void TimerOnTick(object sender, EventArgs eventArgs)
        {
            var    now = System.DateTime.Now;
            double number;

            if (double.TryParse(serialPort1.ReadLine(), out number))
            {
                ChartValues.Add(new MeasureModel
                {
                    DateTime = now,
                    Value    = number
                });
            }

            //Testing code:

            /*
             * Random R = new Random();
             * ChartValues.Add(new MeasureModel
             * {
             *  DateTime = now,
             *  Value = R.Next()
             * });
             */

            SetAxisLimits(now);

            //lets only use the last 30 values
            //if (ChartValues.Count > 150) ChartValues.RemoveAt(0);

            _netMqListener.Update();
            Debug.Print(diameter.ToString());
            ChartValues2.Add(new MeasureModel
            {
                DateTime = now,
                Value    = diameter
            });
        }
예제 #2
0
 private void Update()
 {
     _netMqListener.Update();
 }