Пример #1
0
        public void ShowPoints(IList <MeasurePoint> points, PlotModel pM)
        {
            // Let's make a local copy (thread safety)
            IList <MeasurePoint> _mbAlarms = DriverContainer.Driver.MbAlarm;

            if (IsFileLoaded == Visibility.Visible)
            {
                if (points != null && points.Any() && points.All(p => p != null))
                {
                    // Draw plot
                    if (points[0].unit == N3PR_Data.PERCENTAGE)
                    {
                        Plotter.ShowPoints(points, pM, Plotter.SECONDARY_AXIS);
                    }
                    else
                    {
                        Plotter.ShowPoints(points, pM, Plotter.PRIMARY_AXIS);
                    }

                    // Annotate Alarms
                    if (_showAlarms)
                    {
                        if (_mbAlarms != null)
                        {
                            List <string> alarmNames = _mbAlarms.Select(x => x.Reg_Name).ToList().Distinct().ToList();
                            Plotter.ShowAnnotations(alarmNames, _mbAlarms, pM, true);
                        }
                    }
                }
            }
        }