| | |
| | | |
| | | private string _objectType; |
| | | |
| | | public Action<List<PhartDiagramRelationExtensionsVmo>> SelectDataEvent; |
| | | public Action<PhartDiagramRelationExtensionsVmo> SelectDataEvent; |
| | | |
| | | /// <summary> |
| | | /// 绑定数据 |
| | | /// </summary> |
| | | public async void SetBindingData(string objectType, long objectId) |
| | | public async void SetBindingData(string objectType, long objectId, long? curveId) |
| | | { |
| | | _objectType = objectType; |
| | | var allList = await BLLFactory<HStation.BLL.PhartDiagramRelation>.Instance.GetByObjectTypeAndObjectID(objectType, objectId); |
| | | SetBindingData(allList); |
| | | SetBindingData(allList, curveId); |
| | | gridView1_FocusedRowChanged(null, null); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 绑定数据 |
| | | /// </summary> |
| | | public void SetBindingData(List<PhartDiagramRelationVmo> allList) |
| | | public void SetBindingData(List<PhartDiagramRelationVmo> allList, long? curveId) |
| | | { |
| | | _allBindingList = new List<PhartDiagramRelationGridItemViewModel>(); |
| | | allList?.OrderBy(x => x.SortCode).ToList().ForEach(x => _allBindingList.Add(new PhartDiagramRelationGridItemViewModel(x))); |
| | | this.phartDiagramRelationGridItemViewModelBindingSource.DataSource = _allBindingList; |
| | | this.phartDiagramRelationGridItemViewModelBindingSource.ResetBindings(false); |
| | | if (curveId != null) |
| | | { |
| | | for (int i = 0; i < _allBindingList.Count; i++) |
| | | { |
| | | if (_allBindingList[i].ID == curveId) |
| | | { |
| | | gridView1.FocusedRowHandle = i; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //行点击事件 |
| | |
| | | if (vm == null) |
| | | return; |
| | | var list = await new BLL.PhartDiagramRelation().GetExByObjectTypeAndObjectID(_objectType, vm.Vmo.ObjectID); |
| | | SelectDataEvent.Invoke(list); |
| | | var targetItem = list.FirstOrDefault(x => x.ID == vm.ID); |
| | | if (targetItem != null) |
| | | { |
| | | SelectDataEvent.Invoke(targetItem); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | private AssetsValveSingleMatchingViewModel _row; |
| | | private ValveMatchingViewModel _viewModel; |
| | | |
| | | private long _curveDbId; |
| | | |
| | | public class ValveMatchingViewModel |
| | | { |
| | | public ValveMatchingViewModel() |
| | |
| | | /// <summary> |
| | | /// 绑定数据 |
| | | /// </summary> |
| | | public async void SetBindingData(string dbId) |
| | | public async void SetBindingData(string dbId, string curveDbId) |
| | | { |
| | | var allList = await BLLFactory<HStation.BLL.AssetsValveMain>.Instance.GetAll(); |
| | | _allList = new List<AssetsValveSingleMatchingViewModel>(); |
| | |
| | | { |
| | | var item = allList?.Find(x => x.ID == id); |
| | | _selected = item; |
| | | } |
| | | if (long.TryParse(curveDbId, out long curveId)) |
| | | { |
| | | _curveDbId = curveId; |
| | | } |
| | | Search(); |
| | | await Task.Delay(300); |
| | |
| | | } |
| | | _row = row; |
| | | _viewModel.Vmo = row.Vmo; |
| | | this.phartDiagramRelationGridViewCtrl1.SetBindingData(HStation.Assets.DataType.ValveMain, row.Vmo.ID); |
| | | this.phartDiagramRelationGridViewCtrl1.SetBindingData(HStation.Assets.DataType.ValveMain, row.Vmo.ID, _curveDbId); |
| | | } |
| | | |
| | | //曲线数据关联变化 |
| | | private void SelectData(List<PhartDiagramRelationExtensionsVmo> list) |
| | | private void SelectData(PhartDiagramRelationExtensionsVmo def) |
| | | { |
| | | if (list != null && list.Count > 0) |
| | | if (def != null) |
| | | { |
| | | var def = list.OrderByDescending(x => x.Importance).First(); |
| | | _viewModel.MatchingCurveDbId = def.ID.ToString(); |
| | | var curve = def.Diagram.GraphList[0].GetFeatPointList(); |
| | | if (_row.ValveType == HStation.Assets.eValveType.GPV) |
| | |
| | | return; |
| | | } |
| | | _input = input; |
| | | this.assetsValveSingleMatchingCtrl2.SetBindingData(input.DbId); |
| | | this.assetsValveSingleMatchingCtrl2.SetBindingData(input.DbId, input.CurveDbId); |
| | | } |
| | | |
| | | private void GeneralOkAndCancelCtrl1_OkEvent() |
| | |
| | | private AssetsTankSingleMatchingViewModel _row; |
| | | private TankMatchingViewModel _viewModel; |
| | | |
| | | private long _curveDbid; |
| | | |
| | | public class TankMatchingViewModel |
| | | { |
| | | public TankMatchingViewModel() |
| | |
| | | /// <summary> |
| | | /// 绑定数据 |
| | | /// </summary> |
| | | public async void SetBindingData(string dbId) |
| | | public async void SetBindingData(string dbId, string curveDbId) |
| | | { |
| | | var allList = await BLLFactory<HStation.BLL.AssetsTankMain>.Instance.GetAll(); |
| | | _allList = new List<AssetsTankSingleMatchingViewModel>(); |
| | |
| | | { |
| | | var item = allList?.Find(x => x.ID == id); |
| | | _selected = item; |
| | | } |
| | | if (long.TryParse(curveDbId, out long curveId)) |
| | | { |
| | | _curveDbid = curveId; |
| | | } |
| | | Search(); |
| | | await Task.Delay(300); |
| | |
| | | } |
| | | _row = row; |
| | | _viewModel.Vmo = row.Vmo; |
| | | this.phartDiagramRelationGridViewCtrl1.SetBindingData(HStation.Assets.DataType.TankMain, row.Vmo.ID); |
| | | this.phartDiagramRelationGridViewCtrl1.SetBindingData(HStation.Assets.DataType.TankMain, row.Vmo.ID, _curveDbid); |
| | | } |
| | | |
| | | //曲线数据关联变化 |
| | | private void SelectData(List<PhartDiagramRelationExtensionsVmo> list) |
| | | private void SelectData(PhartDiagramRelationExtensionsVmo def) |
| | | { |
| | | if (list != null && list.Count > 0) |
| | | if (def != null) |
| | | { |
| | | var def = list.OrderByDescending(x => x.Importance).First(); |
| | | _viewModel.MatchingCurveDbId = def.ID.ToString(); |
| | | var curve = def.Diagram.GraphList[0].GetFeatPointList(); |
| | | _viewModel.MatchingCurve = new List<HydroCurvePointViewModel>(); |
| | |
| | | return; |
| | | } |
| | | _input = input; |
| | | this.assetsTankSingleMatchingCtrl1.SetBindingData(input.DbId); |
| | | this.assetsTankSingleMatchingCtrl1.SetBindingData(input.DbId, input.CurveDbId); |
| | | } |
| | | |
| | | private void GeneralOkAndCancelCtrl1_OkEvent() |
| | |
| | | private AssetsCompressorSingleMatchingViewModel _row; |
| | | private CompressorMatchingViewModel _viewModel; |
| | | |
| | | private long _curveDbId; |
| | | |
| | | public class CompressorMatchingViewModel |
| | | { |
| | | public CompressorMatchingViewModel() |
| | |
| | | /// <summary> |
| | | /// 绑定数据 |
| | | /// </summary> |
| | | public async void SetBindingData(string dbId) |
| | | public async void SetBindingData(string dbId, string curveDbId) |
| | | { |
| | | var allList = await BLLFactory<HStation.BLL.AssetsCompressorMain>.Instance.GetAll(); |
| | | _allList = new List<AssetsCompressorSingleMatchingViewModel>(); |
| | |
| | | { |
| | | var item = allList?.Find(x => x.ID == id); |
| | | _selected = item; |
| | | } |
| | | if (long.TryParse(curveDbId, out long curveid)) |
| | | { |
| | | _curveDbId = curveid; |
| | | } |
| | | Search(); |
| | | await Task.Delay(300); |
| | |
| | | } |
| | | _row = row; |
| | | _viewModel.Vmo = row.Vmo; |
| | | this.phartDiagramRelationGridViewCtrl1.SetBindingData(HStation.Assets.DataType.CompressorMain, row.Vmo.ID); |
| | | this.phartDiagramRelationGridViewCtrl1.SetBindingData(HStation.Assets.DataType.CompressorMain, row.Vmo.ID, _curveDbId); |
| | | } |
| | | |
| | | //曲线数据关联变化 |
| | | private void SelectData(List<PhartDiagramRelationExtensionsVmo> list) |
| | | private void SelectData(PhartDiagramRelationExtensionsVmo def) |
| | | { |
| | | if (list != null && list.Count > 0) |
| | | if (def != null) |
| | | { |
| | | var def = list.OrderByDescending(x => x.Importance).First(); |
| | | _viewModel.MatchingCurveDbId = def.ID.ToString(); |
| | | var curve = def.Diagram.GraphList[0].GetFeatPointList(); |
| | | |
| | |
| | | return; |
| | | } |
| | | _input = input; |
| | | this.assetsCompressorSingleMatchingCtrl1.SetBindingData(input.DbId); |
| | | this.assetsCompressorSingleMatchingCtrl1.SetBindingData(input.DbId, input.CurveDbId); |
| | | } |
| | | |
| | | private void GeneralOkAndCancelCtrl1_OkEvent() |
| | |
| | | private AssetsExchangerSingleMatchingViewModel _row; |
| | | private ExchangerMatchingViewModel _viewModel; |
| | | |
| | | private long _curveDbId; |
| | | |
| | | public class ExchangerMatchingViewModel |
| | | { |
| | | public ExchangerMatchingViewModel() |
| | |
| | | /// <summary> |
| | | /// 绑定数据 |
| | | /// </summary> |
| | | public async void SetBindingData(string dbId) |
| | | public async void SetBindingData(string dbId, string curveDbId) |
| | | { |
| | | var allList = await BLLFactory<HStation.BLL.AssetsExchangerMain>.Instance.GetAll(); |
| | | _allList = new List<AssetsExchangerSingleMatchingViewModel>(); |
| | |
| | | { |
| | | var item = allList?.Find(x => x.ID == id); |
| | | _selected = item; |
| | | } |
| | | if (long.TryParse(curveDbId, out long curveId)) |
| | | { |
| | | _curveDbId = curveId; |
| | | } |
| | | Search(); |
| | | await Task.Delay(300); |
| | |
| | | } |
| | | _row = row; |
| | | _viewModel.Vmo = row.Vmo; |
| | | this.phartDiagramRelationGridViewCtrl1.SetBindingData(HStation.Assets.DataType.ExchangerMain, row.Vmo.ID); |
| | | this.phartDiagramRelationGridViewCtrl1.SetBindingData(HStation.Assets.DataType.ExchangerMain, row.Vmo.ID, _curveDbId); |
| | | } |
| | | |
| | | //曲线数据关联变化 |
| | | private void SelectData(List<PhartDiagramRelationExtensionsVmo> list) |
| | | private void SelectData(PhartDiagramRelationExtensionsVmo def) |
| | | { |
| | | if (list != null && list.Count > 0) |
| | | if (def != null) |
| | | { |
| | | var def = list.OrderByDescending(x => x.Importance).First(); |
| | | _viewModel.MatchingCurveDbId = def.ID.ToString(); |
| | | var curve = def.Diagram.GraphList[0].GetFeatPointList(); |
| | | |
| | |
| | | return; |
| | | } |
| | | _input = input; |
| | | this.assetsExchangerSingleMatchingCtrl1.SetBindingData(input.DbId); |
| | | this.assetsExchangerSingleMatchingCtrl1.SetBindingData(input.DbId, input.CurveDbId); |
| | | } |
| | | |
| | | private void GeneralOkAndCancelCtrl1_OkEvent() |