using Yw.WinFrmUI.Phart;
|
|
namespace HStation.WinFrmUI
|
{
|
public partial class PumpChartExcelImportCtrl : DevExpress.XtraEditors.XtraUserControl
|
{
|
public PumpChartExcelImportCtrl()
|
{
|
InitializeComponent();
|
}
|
|
/// <summary>
|
/// 绑定数据
|
/// </summary>
|
public void SetBindingData(string file_path)
|
{
|
var err_msg = Yw.WinFrmUI.PhartExcelHelper.ParsePumpExcel(file_path, out List<Yw.Geometry.Point2d> qh, out List<Yw.Geometry.Point2d> qe, out List<Yw.Geometry.Point2d> qp);
|
if (!string.IsNullOrEmpty(err_msg))
|
{
|
XtraMessageBox.Show(err_msg);
|
return;
|
}
|
this.pumpChartExcelEditCtrl1.SetBindingData(qh, qe, qp);
|
}
|
|
|
/// <summary>
|
/// 获取
|
/// </summary>
|
public Yw.Vmo.PhartDiagramExGraphListVmo Get()
|
{
|
if (!this.pumpChartExcelEditCtrl1.Get
|
(
|
out List<Yw.Geometry.Point2d> def_qh_pt_list,
|
out List<Yw.Geometry.Point2d> def_qe_pt_list,
|
out List<Yw.Geometry.Point2d> def_qp_pt_list,
|
out Yw.Ahart.eFeatType feat_type_qh,
|
out Yw.Ahart.eFeatType feat_type_qe,
|
out Yw.Ahart.eFeatType feat_type_qp
|
)
|
)
|
{
|
return default;
|
}
|
|
var vmo = new Yw.Vmo.PhartDiagramExGraphListVmo();
|
vmo.DiagramType = (int)HStation.PhartRelation.eDiagramType.Feat;
|
vmo.GraphList = new List<Yw.Vmo.PhartGraphVmo>()
|
{
|
new ()
|
{
|
Name ="扬程线",
|
GraphType =(int)Yw.Ahart.eCurveType.QH,
|
GraphParas= new QHGraphParasViewModel()
|
{
|
Hz=50,
|
}.ToJson(),
|
GeometryParas= new Yw.WinFrmUI.Phart.CurveGeometryParasViewModel
|
{
|
DefinePoints = def_qh_pt_list
|
}.ToJson(),
|
GeometryStyle = (int) HStation.PhartRelation.eGeometryStyle.FeatCurve,
|
GeometryInfo = def_qh_pt_list.ToDbString(Yw.Ahart.eCurveType.QH,feat_type_qh)
|
},
|
new ()
|
{
|
Name ="效率线",
|
GraphType =(int)Yw.Ahart.eCurveType.QE,
|
GraphParas= new QEGraphParasViewModel()
|
{
|
Hz=50,
|
}.ToJson(),
|
GeometryParas= new Yw.WinFrmUI.Phart.CurveGeometryParasViewModel
|
{
|
DefinePoints = def_qe_pt_list
|
}.ToJson(),
|
GeometryStyle = (int) HStation.PhartRelation.eGeometryStyle.FeatCurve,
|
GeometryInfo = def_qe_pt_list.ToDbString(Yw.Ahart.eCurveType.QE,feat_type_qe)
|
},
|
new ()
|
{
|
Name ="功率线",
|
GraphType =(int)Yw.Ahart.eCurveType.QP,
|
GraphParas= new QPGraphParasViewModel()
|
{
|
Hz=50,
|
}.ToJson(),
|
GeometryParas= new Yw.WinFrmUI.Phart.CurveGeometryParasViewModel
|
{
|
DefinePoints = def_qp_pt_list
|
}.ToJson(),
|
GeometryStyle = (int) HStation.PhartRelation.eGeometryStyle.FeatCurve,
|
GeometryInfo = def_qp_pt_list.ToDbString(Yw.Ahart.eCurveType.QP,feat_type_qp)
|
},
|
};
|
|
return vmo;
|
}
|
|
|
}
|
}
|