using System.Windows.Forms; using TProduct.Model; namespace TProduct.WinFrmUI.TValve { /// /// 性能测试 /// 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); } } }