tx
2025-04-10 2538101febc78f525945da72c7cdcb2589f9e6ea
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
using System.Windows.Forms;
using TProduct.Model;
 
 
namespace TProduct.WinFrmUI.TValve
{
    /// <summary>
    /// 性能测试
    /// </summary>
    public partial class FeatTestViewMainPage : DocumentPage
    {
        //图表控件
        private void IntialMainChart()
        {
            if (_chartMainCtrl == null)
            {
                //工具条
                this._chartBarCtrl = new TProduct.WinFrmUI.TValve.ChartFeatTestBarCtrl();
                this._chartBarCtrl.Dock = System.Windows.Forms.DockStyle.Fill;
                this._chartBarCtrl.Location = new System.Drawing.Point(3, 3);
                this._chartBarCtrl.Name = "ChartFeatTestBarCtrl";
                this._chartBarCtrl.Size = new System.Drawing.Size(961, 25);
                this._chartBarCtrl.TabIndex = 0;
                this.tableLayoutPanel1.Controls.Add(this._chartBarCtrl, 0, 0);
 
 
                //图表
                this._chartMainCtrl = new ChartValveFeatCurveCtrl();
                this._chartMainCtrl.Name = "ChartFeatTestMainCtrl";
                this._chartMainCtrl.Dock = DockStyle.Fill;
 
                this._chartMainCtrl.OnChangeCoordinate += (coord) =>
                {
                    if (this._featTestItem.CoordinateParas != coord.ToDsString() && this._featTestItem.TestType == eTestType.ValveTest)
                    {
                        this._featTestItem.CoordinateParas = coord.ToDsString();
                        new BLL.TestProjectItem().UpdateCoordinateParas(this._featTestItem.ItemID, this._featTestItem.CoordinateParas);
                        if (this.OnChangeTestItemInfo != null)
                        {
                            this.OnChangeTestItemInfo(this._featTestItem);
                        }
                    }
                };
                this.tableLayoutPanel1.Controls.Add(this._chartMainCtrl, 0, 1);
                this._chartBarCtrl.cmbSetAction += (cmd, tag) =>
                {
                    if (cmd == "显示效率线")
                    {
                        // this._chartMainCtrl.SetEtaDisp(Convert.ToBoolean(tag));
                    }
                    if (cmd == "显示功率线")
                    {
                        // this._chartMainCtrl.SetPowerDisp(Convert.ToBoolean(tag));
                    }
                    if (cmd == "设置坐标")
                    {
                        this.SetCoordinateByDlg();
                    }
                    if (cmd == "显示判定点")
                    {
                        //this._chartMainCtrl.SetJudgePointDisp(Convert.ToBoolean(tag));
                    }
                    if (cmd == "显示装置曲线")
                    {
                        // this._chartMainCtrl.SetEquipCurveDisp(Convert.ToBoolean(tag));
                    }
                    if (cmd == "查询参数")
                    {
                        //  this._chartMainCtrl.SetQueryLineDisp1(Convert.ToBoolean(tag));
                    }
                };
            }
 
            if (!string.IsNullOrEmpty(_featTestItem.CoordinateParas))
            {
                _chartMainCtrl.SetCoordinateParas(new TProduct.Model.ValveCoordinateParas(_featTestItem.CoordinateParas), false);
            }
 
            _chartMainCtrl.SetRecordPoint(this._allRecords);
 
        }
        private void SetCoordinateByDlg()
        {
            var _coordinateParas = _chartMainCtrl.GetCoordinateParas();
            SetValveCoordinateDlg theSetDlg = new SetValveCoordinateDlg();
 
            theSetDlg.SetCoordinate(_coordinateParas);
            theSetDlg.OnChangedCoord += ChangedCoordHandler;
            theSetDlg.ShowDialog();
        }
        private void ChangedCoordHandler(TProduct.Model.ValveCoordinateParas coord)
        {
            _chartMainCtrl.SetCoordinateParas(coord, true);
            if (_chartMainCtrl.OnChangeCoordinate != null)
                _chartMainCtrl.OnChangeCoordinate.Invoke(coord);
        }
    }
}