Exemple #1
0
        public void UpdateZedGraphThreadSafe(PointPairList data, USBControlDock.ChannelGain gain)
        {
            if (this.InvokeRequired)
            {
                this.Invoke(new UpdateZedgraphDelegate(this.UpdateZedGraphThreadSafe), data, gain);
            }
            else
            {
                this.zedGraphControl1.GraphPane.AxisChange();

                double min = Double.MaxValue;
                double max = Double.MinValue;

                CurveItem curve;
                if (gain == USBControlDock.ChannelGain.High)
                {
                    curve = this.zedGraphControl1.GraphPane.CurveList[1];
                }
                else if (gain == USBControlDock.ChannelGain.Low)
                {
                    curve = this.zedGraphControl1.GraphPane.CurveList[0];
                }

                if (data.Count > this.zedGraphControl1.GraphPane.XAxis.Scale.Max)
                {
                    this.zedGraphControl1.GraphPane.XAxis.Scale.Max = data.Count + 250000;
                }

                this.zedGraphControl1.Update();
                this.Refresh();
            }
        }
Exemple #2
0
        public void UpdateZedGraphViewThreadSafe(USBControlDock.ChannelGain gain)
        {
            if (this.InvokeRequired)
            {
                this.Invoke(new UpdateZedgraphViewDelegate(this.UpdateZedGraphViewThreadSafe), gain);
            }
            else
            {
                this.zedGraphControl1.GraphPane.AxisChange();

                CurveItem highCurve = this.zedGraphControl1.GraphPane.CurveList[1];
                CurveItem lowCurve = this.zedGraphControl1.GraphPane.CurveList[0];
                if (gain == USBControlDock.ChannelGain.High)
                {
                    highCurve.IsVisible = true;
                    lowCurve.IsVisible = false;
                }
                else if (gain == USBControlDock.ChannelGain.Low)
                {
                    highCurve.IsVisible = false;
                    lowCurve.IsVisible = true;
                }
                else if (gain == USBControlDock.ChannelGain.Both)
                {
                    highCurve.IsVisible = true;
                    lowCurve.IsVisible = true;
                }

                this.zedGraphControl1.Update();
                this.Refresh();
            }
        }
 public void UpdateUSBGraphGainView(USBControlDock.ChannelGain gainView)
 {
     if (GraphDockList.Count > 0)
     {
         GraphDock dock = (GraphDock)GraphDockList[GraphListComboBoxIndex];
         if(dock.ZedGraphControl.GraphPane.CurveList.Count > 0)
             dock.UpdateZedGraphViewThreadSafe(gainView);
     }
 }