Example #1
0
        /// <summary>
        /// 显示曲线
        /// </summary>
        private void DrawLine()
        {
            gdLineDefine.RowDefinitions.Clear();
            gdLineDefine.Children.Clear();
            _CanvasLine.Children.Clear();

            //gdMain.ColumnDefinitions.Clear();
            //gdMain.ColumnDefinitions.Add(new ColumnDefinition());

            if (IsShowLegend)
            {
                //gdMain.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(80, GridUnitType.Auto) });
                //
                LineList.Visibility = System.Windows.Visibility.Visible;
            }
            else
            {
                LineList.Visibility = System.Windows.Visibility.Collapsed;
            }
            //_CanvasZ.SetValue(Grid.ColumnProperty, 0);
            //_Canvas.SetValue(Grid.ColumnProperty, 0);

            if (IsShowLegend)
            {
                for (int i = 0; i < _listRealTimeLine.Count; i++)
                {
                    gdLineDefine.RowDefinitions.Add(new RowDefinition());
                }
            }
            int index = 0;
            foreach (RealTimeLineOR objOR in _listRealTimeLine)
            {
                RealLineShow obj = new RealLineShow(objOR);
               // obj.Width = 70;
                objOR.TitleShowInfo = obj;
                objOR.PicCurveShowHeight = LineCanversHeight;
                objOR.PicCurveWidth = LineCanversWidth;
                obj.ChangeLineShow += new EventHandler(RealLineShow_ChangeLineShow);
                if (IsShowLegend)
                {
                    gdLineDefine.Children.Add(obj);
                    obj.SetValue(Grid.RowProperty, index);
                }

                //添加线到界面
                _CanvasLine.Children.Add(objOR.PolyLine);
                index++;
            }
        }
Example #2
0
        /// <summary>
        /// 显示曲线
        /// </summary>
        private void DrawLine()
        {
            gdLineDefine.RowDefinitions.Clear();
            gdLineDefine.Children.Clear();

            _CanvasLine.Children.Clear();
            _CanvasPoint.Children.Clear();

            if (IsShowLegend)
            {
                LineList.Visibility = System.Windows.Visibility.Visible;
            }
            else
            {
                LineList.Visibility = System.Windows.Visibility.Collapsed;
            }

            if (IsShowLegend)
            {
                for (int i = 0; i < _listRealTimeLine.Count; i++)
                {
                    gdLineDefine.RowDefinitions.Add(new RowDefinition());
                }
            }
            int index = 0;
            foreach (RealTimeLineOR objOR in _listRealTimeLine)
            {
                RealLineShow obj = new RealLineShow(objOR);
                obj.Margin = new Thickness(5);

                objOR.TitleShowInfo = obj;
                objOR.PicCurveShowHeight = LineCanversHeight -_YZStartPosition;
                objOR.PicCurveWidth = LineCanversWidth;
                objOR.SetPolyLine();
                objOR.RealtimeObj = this;

                obj.ChangeLineShow += new EventHandler(RealLineShow_ChangeLineShow);
                if (IsShowLegend)
                {
                    gdLineDefine.Children.Add(obj);
                    obj.SetValue(Grid.RowProperty, index);
                }
                //添加线到界面
                _CanvasLine.Children.Add(objOR.PolyLine);
                index++;
            }
        }