ÎļþÃû´Ó WinFrmUI/Yw.WinFrmUI.Phart.Core/v1/01-perform/01-pump-chart/05-import/01-excel/ImportPumpPerform2dByExcelCtrl.cs ÐÞ¸Ä |
| | |
| | | using NPOI.HSSF.UserModel; |
| | | using System.IO; |
| | | |
| | | //ç¼è¾åå§çæ§è½æ²çº¿ |
| | | namespace Yw.WinFrmUI.Phart |
| | | { |
| | | public partial class ImportPumpPerform2dByExcelCtrl : DevExpress.XtraEditors.XtraUserControl |
| | | public partial class PumpImportByExcelCtrl : DevExpress.XtraEditors.XtraUserControl |
| | | { |
| | | public ImportPumpPerform2dByExcelCtrl() |
| | | public PumpImportByExcelCtrl() |
| | | { |
| | | InitializeComponent(); |
| | | |
| | | this.gridView1.SetDefaultEditView(); |
| | | this.gridView1.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder; |
| | | |
| | | _allBindList = new List<CurrentViewModel>(); |
| | | this.bindingSource1.DataSource = _allBindList; |
| | | _all_bind_list = new List<CurrentViewModel>(); |
| | | this.bindingSource1.DataSource = _all_bind_list; |
| | | } |
| | | |
| | | #region CurrentViewModel |
| | |
| | | |
| | | #endregion CurrentViewModel |
| | | |
| | | private List<CurrentViewModel> _allBindList; |
| | | private List<CurrentViewModel> _all_bind_list; |
| | | |
| | | private Yw.Geometry.CubicSpline2d |
| | | _qh = null, |
| | |
| | | col_index_p = 3; |
| | | } |
| | | |
| | | _allBindList.Clear(); |
| | | _all_bind_list.Clear(); |
| | | |
| | | double q, h, eta, power; |
| | | NPOI.SS.UserModel.IRow rowtemp = null; |
| | |
| | | { |
| | | throw new Exception("æç大äº100%"); |
| | | } |
| | | _allBindList.Add(new CurrentViewModel(index++, q, h, eta, power)); |
| | | _all_bind_list.Add(new CurrentViewModel(index++, q, h, eta, power)); |
| | | } |
| | | |
| | | if (_allBindList.Count < 4) |
| | | if (_all_bind_list.Count < 4) |
| | | { |
| | | this.xtrPerform2dChart1.InitialChartData(); |
| | | XtraMessageBox.Show("导å
¥ç¹è¿å°,请æå¨æ·»å ç¹,ç¹æ°è³å°4个ç¹"); |
| | |
| | | //å è½½æ²çº¿ |
| | | private bool loadChart() |
| | | { |
| | | if (_allBindList == null || _allBindList.Count < 4) |
| | | if (_all_bind_list == null || _all_bind_list.Count < 4) |
| | | { |
| | | this.xtrPerform2dChart1.InitialChartData(); |
| | | return false; |
| | |
| | | _qh_pt_list = new List<Yw.Geometry.Point2d>(); |
| | | _qe_pt_list = new List<Yw.Geometry.Point2d>(); |
| | | _qp_pt_list = new List<Yw.Geometry.Point2d>(); |
| | | for (int i = 0; i < _allBindList.Count; i++) |
| | | for (int i = 0; i < _all_bind_list.Count; i++) |
| | | { |
| | | var model = _allBindList[i]; |
| | | var model = _all_bind_list[i]; |
| | | if (model.H > 0) |
| | | _qh_pt_list.Add(new Yw.Geometry.Point2d() { X = model.Q, Y = model.H }); |
| | | if (model.E >= 0) |