public ZedGraphSingleWindow(int id, CallObject coV, string name)
        {
            InitializeComponent();

            coV.ValueUpdatedEvent += co_UpdateCurveEvent;
            coV.PointListUpdateEvent += CoVOnPointListUpdateEvent;
            curveNumber = id;
            curveName = name;
            Text = curveName + @"——曲线" + (curveNumber + 1) + @"——" + @"飞思卡尔调试平台 V1.2.1";
        }
        public ZedGraphSingleWindow(int id, CallObject coV, string name)
        {
            InitializeComponent();

            coV.ValueUpdatedEvent    += co_UpdateCurveEvent;
            coV.PointListUpdateEvent += CoVOnPointListUpdateEvent;
            curveNumber = id;
            curveName   = name;
            Text        = curveName + @"——曲线" + (curveNumber + 1) + @"——" + @"飞思卡尔调试平台 V1.2.1";
        }
Ejemplo n.º 3
0
        private void InitzedGraph()
        {
            var myPane = zedGraph_local.GraphPane;
            myPane.Title.IsVisible = false;
            myPane.XAxis.Title.Text = "time";
            myPane.YAxis.Title.Text = "Value";

            //show grid
            myPane.XAxis.MajorGrid.IsVisible = true;
            myPane.YAxis.MajorGrid.IsVisible = true;

            // Align the Y axis labels so they are flush to the axis
            myPane.YAxis.Scale.Align = AlignP.Inside;

            // Manually set the axis range
            myPane.XAxis.Scale.Min = _xminScale;
            myPane.XAxis.Scale.Max = _xmaxScale;
            myPane.YAxis.Scale.Min = _yminScale;
            myPane.YAxis.Scale.Max = _ymaxScale;

            // Fill the axis background with a gradient
            myPane.Chart.Fill = new Fill(Color.White, Color.LightGray, 45.0f);

            // OPTIONAL: Show tooltips when the mouse hovers over a point
            zedGraph_local.IsShowPointValues = true;
            zedGraph_local.PointValueEvent += MyPointValueHandler;

            for (var i = 0; i < ScopeNumber; i++)
            {
                zedGrpahNames[i] = new ZedGrpahName();
                coOb[i] = new CallObject();
            }

            var sp = new SharedPreferences(SavefileName);
            for (var i = 0; i < ScopeNumber; i++)
            {
                zedGrpahNames[i].listZed.Add(Convert.ToDouble(zedGrpahNames[i].x), 0);
                var curve = string.Format("波形{0}", i + 1);

                //自己定义的变量名称
                var txtName_CustomPara = string.Format("SCOPE_TextName{0}", i + 1);
                var getName = sp.GetString(txtName_CustomPara, @"波形" + Convert.ToString(i + 1));
                zedGraph_local.GraphPane.AddCurve(getName.Trim() != "" ? getName : curve, zedGrpahNames[i].listZed,
                    _colorLine[i%8],
                    SymbolType.None);
            }

            refleshZedPane(zedGraph_local);
        }