コード例 #1
0
 private void ConnectionStatusChangedEventHandler(object sender, EventArgs e)
 {
     if (!DriverContainer.Driver.IsConnected)
     {
         Plotter.ClearPoints(Plot);
         Plotter.ClearPoints(PlotBool);
         Plotter.ClearAnnotations(Plot);
         Plotter.ClearAnnotations(PlotBool);
         Plot.InvalidatePlot(true);
         PlotBool.InvalidatePlot(true);
         IsExportDataEnabled = false;
     }
 }
コード例 #2
0
        public void UnshowPoints(string name)
        {
            Plotter.UnshowPoints(Plot, name);
            Plotter.UnshowPoints(PlotBool, name);

            // Delete Annotations too, if there are no more traces
            if (Plot.Series.ToList().Count == 0)
            {
                Plotter.ClearAnnotations(Plot);
            }
            if (PlotBool.Series.ToList().Count == 0)
            {
                Plotter.ClearAnnotations(PlotBool);
            }

            Plot.InvalidatePlot(true);
            PlotBool.InvalidatePlot(true);
        }
コード例 #3
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
                if (Plot.Series.ToList().Count > 0)
                {
                    Plotter.ClearAnnotations(Plot);
                }
                if (PlotBool.Series.ToList().Count > 0)
                {
                    Plotter.ClearAnnotations(PlotBool);
                }
                if (_mbAlarms != null)
                {
                    List <string> alarmNames = _mbAlarms.Select(x => x.Reg_Name).ToList().Distinct().ToList();
                    if (Plot.Series.ToList().Count > 0)
                    {
                        Plotter.ShowAnnotations(alarmNames, _mbAlarms, Plot, true);
                    }
                    if (PlotBool.Series.ToList().Count > 0)
                    {
                        Plotter.ShowAnnotations(alarmNames, _mbAlarms, PlotBool, false);
                    }
                }
            }
            else // unshow annotations
            {
                _showAlarms = false;
                Plotter.ClearAnnotations(Plot);
                Plotter.ClearAnnotations(PlotBool);
            }
            Plot.InvalidatePlot(true);
            PlotBool.InvalidatePlot(true);
        }