Beispiel #1
0
        public Task LoadPlotAsync(PlotMessage plot)
        {
            if (VisualComponent != null)
            {
                if (plot.IsClearAll)
                {
                    VisualComponent.Clear();
                }
                else if (plot.IsPlot)
                {
                    try {
                        VisualComponent.LoadPlot(plot.ToBitmapImage());
                    } catch (Exception e) when(!e.IsCriticalException())
                    {
                        VisualComponent.Error();
                    }
                }
                else if (plot.IsError)
                {
                    VisualComponent.Error();
                }
            }

            ActivePlotIndex = plot.ActivePlotIndex;
            PlotCount       = plot.PlotCount;
            _interactiveWorkflow.ActiveWindow?.Container.UpdateCommandStatus(false);

            PlotChanged?.Invoke(this, null);

            return(Task.CompletedTask);
        }
Beispiel #2
0
        private void Refresh(IRPlot plot)
        {
            _mainThread.Post(() => {
                if (plot != null)
                {
                    PlotImage     = plot.Image;
                    ShowWatermark = false;
                    ShowError     = plot.Image == null;
                }
                else
                {
                    PlotImage     = null;
                    ShowWatermark = true;
                    ShowError     = false;
                }

                DeviceNameChanged?.Invoke(this, EventArgs.Empty);
                PlotChanged?.Invoke(this, EventArgs.Empty);
            });
        }