Exemplo n.º 1
0
        public void OnFlaggedAlarmMessageReceived(EventWithMessage e)
        {
            // Let's make a local copy (thread safety)
            IList <MeasurePoint> _mbAlarms = DriverContainer.Driver.MbAlarm;

            if (e.value == 1) // show annotations
            {
                _showAlarms = true;
                // Refresh Annotations
                Plotter.ClearAnnotations(Plot00);
                Plotter.ClearAnnotations(Plot01);
                Plotter.ClearAnnotations(Plot10);
                Plotter.ClearAnnotations(Plot11);
                if (_mbAlarms != null)
                {
                    List <string> alarmNames = _mbAlarms.Select(x => x.Reg_Name).ToList().Distinct().ToList();
                    Plotter.ShowAnnotations(alarmNames, _mbAlarms, Plot00, true);
                    Plotter.ShowAnnotations(alarmNames, _mbAlarms, Plot01, true);
                    Plotter.ShowAnnotations(alarmNames, _mbAlarms, Plot10, true);
                    Plotter.ShowAnnotations(alarmNames, _mbAlarms, Plot11, true);
                }
            }
            else // unshow annotations
            {
                _showAlarms = false;
                Plotter.ClearAnnotations(Plot00);
                Plotter.ClearAnnotations(Plot01);
                Plotter.ClearAnnotations(Plot10);
                Plotter.ClearAnnotations(Plot11);
            }
            Plot00.InvalidatePlot(true);
            Plot01.InvalidatePlot(true);
            Plot10.InvalidatePlot(true);
            Plot11.InvalidatePlot(true);
        }
Exemplo n.º 2
0
 public void ClearAll(PlotModel pM)
 {
     Plotter.ClearAnnotations(pM);
     Plotter.ClearPoints(pM);
     pM.InvalidatePlot(true);
 }