namespace HStation.WinFrmUI { public partial class ValveChartViewCtrl : DevExpress.XtraEditors.XtraUserControl { public ValveChartViewCtrl() { InitializeComponent(); this.bar2.OptionsBar.AllowQuickCustomization = false; } /// /// 绑定数据 /// 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(); 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); } /// /// 清空绑定数据 /// public void ClearBindingData() { this.valveViewChart1.Clear(); } //查询线 private void barCekLineVisible_CheckedChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { this.valveViewChart1.LineVisible = this.barCekLineVisible.Checked; } /// /// 获取 /// public Yw.Vmo.PhartDiagramExGraphListVmo Get() { return new(); } } }