From 8e1444f103e8a4e0d2257662c6e7128298ed34b5 Mon Sep 17 00:00:00 2001 From: fyf Date: Fri, 23 Sep 2022 10:05:50 +0800 Subject: [PATCH] 1 --- .../CustomerControls/TheDataGrid.xaml.cs | 29 +++++++++++++++++-- BeDesignerSCADA/Controls/MainCanvasPanel.xaml | 2 +- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/BPASmartClient.SCADAControl/CustomerControls/TheDataGrid.xaml.cs b/BPASmartClient.SCADAControl/CustomerControls/TheDataGrid.xaml.cs index 898fb51f..8f7d0ed0 100644 --- a/BPASmartClient.SCADAControl/CustomerControls/TheDataGrid.xaml.cs +++ b/BPASmartClient.SCADAControl/CustomerControls/TheDataGrid.xaml.cs @@ -119,9 +119,34 @@ namespace BPASmartClient.SCADAControl.CustomerControls { if (!string.IsNullOrEmpty(DataSouceInformation)) { - if (Class_DataBus.GetInstance().Dic_APIData.ContainsKey(DataSouceInformation)) + if (DataSouceType == DataTypeEnum.API接口) { - FDataSouce= Class_DataBus.GetInstance().Dic_APIData[DataSouceInformation];// = GenerateData; + if (Class_DataBus.GetInstance().Dic_APIData.ContainsKey(DataSouceInformation)) + { + FDataSouce = Class_DataBus.GetInstance().Dic_APIData[DataSouceInformation];// = GenerateData; + } + } + else if (DataSouceType == DataTypeEnum.Redis) + { + if (DataSouceInformation.Contains(".") && DataSouceInformation.Contains("{Binding ")) + { + string[] str = DataSouceInformation.Replace("{Binding ", "").Replace("}", "").Split("."); + if (str.Length > 1) + { + if (Class_DataBus.GetInstance().Dic_DeviceData.ContainsKey(str[0])) + { + Dictionary b = Class_DataBus.GetInstance().Dic_DeviceData[str[0]]; + if (b != null && b.ContainsKey(str[1])) + { + FDataSouce = b[str[1]].VarVaule; + } + } + } + } + } + else if (DataSouceType == DataTypeEnum.静态数据) + { + FDataSouce = ""; } } } diff --git a/BeDesignerSCADA/Controls/MainCanvasPanel.xaml b/BeDesignerSCADA/Controls/MainCanvasPanel.xaml index 7a4290c9..b4d9d45b 100644 --- a/BeDesignerSCADA/Controls/MainCanvasPanel.xaml +++ b/BeDesignerSCADA/Controls/MainCanvasPanel.xaml @@ -361,7 +361,7 @@ - +