namespace HStation.WinFrmUI
|
{
|
public partial class ValveChartViewCtrl : DevExpress.XtraEditors.XtraUserControl
|
{
|
public ValveChartViewCtrl()
|
{
|
InitializeComponent();
|
this.bar2.OptionsBar.AllowQuickCustomization = false;
|
}
|
|
/// <summary>
|
/// 绑定数据
|
/// </summary>
|
public void SetBindingData(Yw.Vmo.PhartDiagramExGraphListVmo vmo)
|
{
|
if (vmo == null || vmo.GraphList == null || !vmo.GraphList.Any())
|
{
|
this.valveViewChart1.Clear();
|
return;
|
}
|
|
var vm_list = new List<Yw.WinFrmUI.Phart.ValveViewChartViewModel>();
|
|
for (int i = 0; i < vmo.GraphList.Count; i++)
|
{
|
var graph = vmo.GraphList[i];
|
var curve_info = graph.GetCurveInfo();
|
var vm = new Yw.WinFrmUI.Phart.ValveViewChartViewModel();
|
vm.Id = graph.ID.ToString();
|
vm.Name = graph.Name;
|
vm.Color = Yw.WinFrmUI.PhartColorHelper.Get(i);
|
vm.CurveType = curve_info.curve_type;
|
vm.FeatType = curve_info.feat_type;
|
vm.FitPointList = curve_info.line_pt_list;
|
vm.DefPointList = curve_info.define_pt_list;
|
vm_list.Add(vm);
|
}
|
|
vm_list[0].IsSelect = true;
|
|
this.valveViewChart1.SetBindingData(vm_list);
|
}
|
|
/// <summary>
|
/// 清空绑定数据
|
/// </summary>
|
public void ClearBindingData()
|
{
|
this.valveViewChart1.Clear();
|
}
|
|
//查询线
|
private void barCekLineVisible_CheckedChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
{
|
this.valveViewChart1.LineVisible = this.barCekLineVisible.Checked;
|
}
|
|
/// <summary>
|
/// 获取
|
/// </summary>
|
public Yw.Vmo.PhartDiagramExGraphListVmo Get()
|
{
|
return new();
|
}
|
}
|
}
|