Exemple #1
0
        public IXAccelHome()
        {
            InitializeComponent();
            graphXIndex = 0;
            accelData = new List<Int16>();

            zedGraphDataList = new NoDupePointList();
            /*for (double i = 0; i < 36; i++)
            {
                double x = i * 10.0 + 50.0;
                double y = Math.Sin(i * Math.PI / 15.0) * 16.0;
                zedGraphDataList.Add(x, y);
            }*/

            zedGraphCurve = ZedGraphFrontPage.GraphPane.AddCurve("AccelData", zedGraphDataList, Color.Red);
            zedGraphCurve.Line.Width = 1.5F;
            zedGraphCurve.Symbol.Fill = new Fill(Color.White);
            zedGraphCurve.Symbol.Size = 5;
            zedGraphCurve.Label.IsVisible = false;
            
            ZedGraphFrontPage.GraphPane.YAxis.Scale.Min = -4096;
            ZedGraphFrontPage.GraphPane.YAxis.Scale.Max = 4096;
            ZedGraphFrontPage.GraphPane.XAxis.Scale.Min = 0;
            ZedGraphFrontPage.GraphPane.XAxis.Scale.Max = 500000;
            ZedGraphFrontPage.AxisChange();
            Refresh();
        }
        /// <summary>
        /// copy constructor -- this returns a copy of the structure,
        /// but it does not duplicate the data (it just keeps a reference to the original)
        /// </summary>
        /// <param name="rhs">The NoDupePointList to be copied</param>
        public NoDupePointList(NoDupePointList rhs)
        {
            var count = rhs.TotalCount;

            for (var i = 0; i < count; i++)
            {
                Add(rhs.GetDataPointAt(i));
            }

            _filteredCount = rhs._filteredCount;
            _isFiltered    = rhs._isFiltered;
            FilterMode     = rhs.FilterMode;

            _visibleIndicies = (int[])rhs._visibleIndicies?.Clone();
        }
Exemple #3
0
        /// <summary>
        /// copy constructor -- this returns a copy of the structure,
        /// but it does not duplicate the data (it just keeps a reference to the original)
        /// </summary>
        /// <param name="rhs">The NoDupePointList to be copied</param>
        public NoDupePointList(NoDupePointList rhs)
        {
            int count = rhs.TotalCount;

            for (int i = 0; i < count; i++)
            {
                Add(rhs.GetDataPointAt(i));
            }

            _filteredCount = rhs._filteredCount;
            _isFiltered    = rhs._isFiltered;
            _filterMode    = rhs._filterMode;

            if (rhs._visibleIndicies != null)
            {
                _visibleIndicies = (int[])rhs._visibleIndicies.Clone();
            }
            else
            {
                _visibleIndicies = null;
            }
        }
Exemple #4
0
        // Basic curve test - large dataset with NoDupePointList
        private void CreateGraph_NoDupePointList( ZedGraphControl z1 )
        {
            GraphPane myPane = z1.GraphPane;

            NoDupePointList list = new NoDupePointList();
            Random rand = new Random();

            for ( int i = 0; i < 100000; i++ )
            {
                double x = rand.NextDouble() * 1000;
                double y = rand.NextDouble() * 1000;

                list.Add( x, y );
            }

            LineItem myCurve = z1.GraphPane.AddCurve( "curve", list, Color.Blue, SymbolType.Diamond );
            myCurve.Line.IsVisible = false;

            z1.AxisChange();
            list.FilterMode = 3;
            list.FilterData( myPane, myPane.XAxis, myPane.YAxis );

            MessageBox.Show( list.Count.ToString() );
            int count = list.Count;
        }
        /// <summary>
        /// copy constructor -- this returns a copy of the structure,
        /// but it does not duplicate the data (it just keeps a reference to the original)
        /// </summary>
        /// <param name="rhs">The NoDupePointList to be copied</param>
        public NoDupePointList( NoDupePointList rhs )
        {
            int count = rhs.TotalCount;
            for ( int i = 0; i < count; i++ )
                Add( rhs.GetDataPointAt( i ) );

            _filteredCount = rhs._filteredCount;
            _isFiltered = rhs._isFiltered;
            _filterMode = rhs._filterMode;

            if ( rhs._visibleIndicies != null )
                _visibleIndicies = (int[]) rhs._visibleIndicies.Clone();
            else
                _visibleIndicies = null;
        }
Exemple #6
0
 public InformationHolder()
 {
     zedGraphData = new NoDupePointList();
 }
Exemple #7
0
 public void UpdateZedGraphThreadSafe()
 {
     if (this.InvokeRequired)
     {
         this.Invoke(new UpdateZedgraphDelegate(this.UpdateZedGraphThreadSafe), null);
     }
     else
     {
         zedGraphDataList = InformationHolder.Instance().zedGraphData;
         zedGraphCurve.Points = zedGraphDataList;
         zedGraphDataList.FilterData(ZedGraphFrontPage.GraphPane, ZedGraphFrontPage.GraphPane.XAxis, ZedGraphFrontPage.GraphPane.YAxis);
         //ZedGraphFrontPage.AxisChange();
         Refresh();
     }
 }