示例#1
0
 public void DisablePauseGraph()
 {
     foreach (TabPage page in graphTab.TabPages)
     {
         CtrlTestGraphPanel ctrl = page.Controls[0] as CtrlTestGraphPanel;
         ctrl.Pause = false;
     }
 }
示例#2
0
        private void SetGraphRangeAxisX(long ticks)
        {
            foreach (TabPage page in graphTab.TabPages)
            {
                CtrlTestGraphPanel ctrl = page.Controls[0] as CtrlTestGraphPanel;

                ctrl.SetRangeAxisXTicks(ticks);
            }
        }
示例#3
0
        private void RefreshGraphUnit()
        {
            foreach (TabPage page in graphTab.TabPages)
            {
                CtrlTestGraphPanel ctrl = page.Controls[0] as CtrlTestGraphPanel;

                ctrl.Method = context.Condition.Method;
                ctrl.RefreshUnit();
            }
        }
示例#4
0
        public void ResetGraph()
        {
            bufferedSeries.ClearPoints();

            foreach (TabPage page in graphTab.TabPages)
            {
                CtrlTestGraphPanel ctrl = page.Controls[0] as CtrlTestGraphPanel;

                ctrl.ResetRangeAxisX();
                ctrl.ViewGraph.MarkLine.Visible = false;
            }
        }
示例#5
0
        private void CreateGraph()
        {
            CtrlTestGraphPanel ctrl;

            foreach (TabPage page in graphTab.TabPages)
            {
                int index = int.Parse(page.Tag.ToString());

                ctrl = new CtrlTestGraphPanel(index, context, bufferedSeries);

                page.Controls.Add(ctrl);
            }

            graphTab.SelectedIndex = 0;
        }
示例#6
0
        public void DoInvalidGraph(object sender, long ticks)
        {
            if (this.InvokeRequired == true)
            {
                EventInt64Handler func = new EventInt64Handler(DoInvalidGraph);
                this.BeginInvoke(func, new object[] { sender, ticks });
            }
            else
            {
                int i = 0;
                CtrlTestGraphPanel ctrl = (graphTab.TabPages[graphTab.SelectedIndex] as TabPage).Controls[0] as CtrlTestGraphPanel;

                ctrl.RefreshUnit();

                context.Value.Lock();
                bufferedSeries.Lock();

                try
                {
                    foreach (KeyValuePair <string, ValueRow> row in context.Value.Graph)
                    {
                        ctrl.SetSeriesValue(i++, row.Value.StringValue);
                        bufferedSeries[row.Key].Points.Add(row.Value.Value);
                    }

                    ctrl.RefreshGrid();
                }
                finally
                {
                    bufferedSeries.Unlock();
                    context.Value.Unlock();
                }

                if (ctrl.Pause == false)
                {
                    SetGraphRangeAxisX(ticks);
                    InvalidateGraphSeries(graphTab.SelectedTab);
                }
            }
        }
示例#7
0
        private void InvalidateGraphSeries(TabPage activePage)
        {
            foreach (TabPage page in graphTab.TabPages)
            {
                CtrlTestGraphPanel ctrl = page.Controls[0] as CtrlTestGraphPanel;

                if (page == activePage)
                {
                    ctrl.ViewGraph.InvalidateSeries();
                }
                else
                {
                    ctrl.ViewGraph.Series.BeginUpdate();
                    try
                    {
                        ctrl.ViewGraph.ClearSeriesPoint();
                    }
                    finally
                    {
                        ctrl.ViewGraph.Series.EndUpdate();
                    }
                }
            }
        }