duheng
2024-09-20 8a8983dd2053b631c559b257b1501d740bedf4a5
WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/06-simulation/01-AutoMatching/02-AsstesFormCtrl/ValveMatchingCtrl.cs
@@ -9,5 +9,37 @@
            this.gridView1.OptionsView.ShowDetailButtons = true;
            this.gridView1.OptionsView.ShowGroupPanel = false;
        }
        private List<ValveMatchingViewModel> _allBindingList = null;
        public void SetBindingData(List<ValveMatchingViewModel> valveMatchingViewModels)
        {
            if (_allBindingList != null)
            {
                _allBindingList = valveMatchingViewModels;
                this.valveMatchingViewModelBindingSource.DataSource = _allBindingList;
            }
        }
        public List<ValveMatchingViewModel> SetMatching(List<ValveMatchingViewModel> inputs, List<ValveMainVmo> alllist)
        {
            if (inputs == null)
                return null;
            var finishList = new List<ValveMatchingViewModel>();
            foreach (var item in inputs)
            {
                var result = AsstesAutoMatchingHelper.ValveMatching(item, alllist);
                if (result != null)
                {
                    finishList.Add(result);
                }
                else
                {
                }
            }
            _allBindingList = finishList;
            this.valveMatchingViewModelBindingSource.ResetBindings(false);
            return finishList;
        }
    }
}