From f123d982f9b79320e03494dbc4bafd26ccda469b Mon Sep 17 00:00:00 2001 From: HQQ <24525@QQ.COM> Date: Sun, 16 Jul 2023 21:26:41 +0800 Subject: [PATCH] =?UTF-8?q?[Common]=20=E6=B0=94=E4=BD=93=E7=94=A8=E9=87=8F?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E5=AF=B9=E8=B1=A1=EF=BC=8C=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=A0=87=E8=AE=B0=20[UI.Client]=20=E6=B7=BB=E5=8A=A0=E6=B0=94?= =?UTF-8?q?=E4=BD=93=E6=9F=A5=E8=AF=A2=E5=AF=B9=E8=B1=A1=E5=92=8C=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E6=A1=86=E5=AF=B9=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Core/Common/DeviceData/GasFlowSum.cs | 10 +++ .../Core/Common/DeviceData/GasUseData.cs | 49 ---------- .../MECF.Framework.Common.csproj | 1 - .../HardwareUnits/GasFlow/Class1.cs | 12 --- .../HardwareUnits/GasFlow/PMGsaFlow.cs | 90 ++++++++++++++++--- .../MECF.Framework.RT.EquipmentLibrary.csproj | 1 - .../CenterViews/Modules/PM/PMProcessView.xaml | 6 +- .../Modules/PM/PMProcessViewModel.cs | 66 ++++++-------- Sic.Framework.sln | 1 - 9 files changed, 117 insertions(+), 119 deletions(-) delete mode 100644 MECF.Framework.Common/Aitex/Core/Common/DeviceData/GasUseData.cs delete mode 100644 MECF.Framework.RT.EquipmentLibrary/HardwareUnits/GasFlow/Class1.cs diff --git a/MECF.Framework.Common/Aitex/Core/Common/DeviceData/GasFlowSum.cs b/MECF.Framework.Common/Aitex/Core/Common/DeviceData/GasFlowSum.cs index 7c1d935..8746d48 100644 --- a/MECF.Framework.Common/Aitex/Core/Common/DeviceData/GasFlowSum.cs +++ b/MECF.Framework.Common/Aitex/Core/Common/DeviceData/GasFlowSum.cs @@ -18,11 +18,15 @@ namespace MECF.Framework.Common.Aitex.Core.Common.DeviceData /// /// 气体名称 /// + [DataMember] public string Name { get; set; } + + private double _runVolume; /// /// Run使用的体积 /// + [DataMember] public double RunVolume { get { return _runVolume; } @@ -32,10 +36,13 @@ namespace MECF.Framework.Common.Aitex.Core.Common.DeviceData Volume = _runVolume + _ventVolume; } } + + private double _ventVolume; /// /// Vent使用的体积 /// + [DataMember] public double VentVolume { get { return _ventVolume; } @@ -45,9 +52,12 @@ namespace MECF.Framework.Common.Aitex.Core.Common.DeviceData Volume = _runVolume + _ventVolume; } } + + /// /// 气体用量总和 /// + [DataMember] public double Volume { get; set; } } } diff --git a/MECF.Framework.Common/Aitex/Core/Common/DeviceData/GasUseData.cs b/MECF.Framework.Common/Aitex/Core/Common/DeviceData/GasUseData.cs deleted file mode 100644 index 8c9711f..0000000 --- a/MECF.Framework.Common/Aitex/Core/Common/DeviceData/GasUseData.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace MECF.Framework.Common.Aitex.Core.Common.DeviceData -{ - /// - /// 气体流量实体对象 - /// - public class GasUseData - { - /// - /// 气体名称 - /// - public string Name { get; set; } - private double _runVolume; - /// - /// 气体Run的用量 - /// - public double RunVolume - { - get { return _runVolume; } - set - { - _runVolume = value; - Volume = _runVolume + _ventVolume; - } - } - private double _ventVolume; - /// - /// 气体Vent用量 - /// - public double VentVolume - { - get { return _ventVolume; } - set - { - _ventVolume = value; - Volume = _runVolume + _ventVolume; - } - } - /// - /// 气体用量总和 - /// - public double Volume { get; set; } - } -} diff --git a/MECF.Framework.Common/MECF.Framework.Common.csproj b/MECF.Framework.Common/MECF.Framework.Common.csproj index 403cf60..94a999c 100644 --- a/MECF.Framework.Common/MECF.Framework.Common.csproj +++ b/MECF.Framework.Common/MECF.Framework.Common.csproj @@ -239,7 +239,6 @@ - diff --git a/MECF.Framework.RT.EquipmentLibrary/HardwareUnits/GasFlow/Class1.cs b/MECF.Framework.RT.EquipmentLibrary/HardwareUnits/GasFlow/Class1.cs deleted file mode 100644 index 30451cc..0000000 --- a/MECF.Framework.RT.EquipmentLibrary/HardwareUnits/GasFlow/Class1.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.GasFlow -{ - internal class Class1 - { - } -} diff --git a/MECF.Framework.RT.EquipmentLibrary/HardwareUnits/GasFlow/PMGsaFlow.cs b/MECF.Framework.RT.EquipmentLibrary/HardwareUnits/GasFlow/PMGsaFlow.cs index 1b2874d..5c3b713 100644 --- a/MECF.Framework.RT.EquipmentLibrary/HardwareUnits/GasFlow/PMGsaFlow.cs +++ b/MECF.Framework.RT.EquipmentLibrary/HardwareUnits/GasFlow/PMGsaFlow.cs @@ -1,11 +1,15 @@ using Aitex.Core.RT.DataCenter; +using Aitex.Core.RT.OperationCenter; using Aitex.Core.RT.SCCore; using Aitex.Core.Util; using MECF.Framework.Common.Aitex.Core.Common.DeviceData; using MECF.Framework.Common.Equipment; +using System; using System.Collections.Generic; using System.IO; using System.Linq; +using System.Reflection; +using System.Threading.Tasks; using System.Xml.Linq; using System.Xml.Serialization; @@ -22,28 +26,45 @@ namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.GasFlow public string ModuleName { get; set; } + public List GasNameList { get; set; } + public List GasFlowSumList { get; set; } - /// - /// 初始化单个气体,设置模块名称和对应气体的流量系数,注册界面要显示的数值 - /// - /// + private DateTime start; + private DateTime end; + public void Initialize(string moduleName) { IniGasUnit(moduleName); + DATA.Subscribe($"{ModuleName}.PMGasNameList", () => GasNameList); DATA.Subscribe($"{ModuleName}.PMGasFlowSumList", () => GasFlowSumList); + OP.Subscribe($"{ModuleName}.GasFlowSum.Query", (string cmd, object[] args) => Query(args)); + var _thread = new PeriodicJob(1000, OnTimer, $"{moduleName}.ModuleGsaFlow", true); } + private bool OnTimer() + { + foreach (var Unit in GasFlowUnitList) + { + Unit.GetGasFlowFeedBack(); + } + return true; + } + + /// + /// 初始化单个气体和界面气体统计对象 + /// + /// private void IniGasUnit(string moduleName) { ModuleName = moduleName; GasFlowSumList = new(); - List moduleNameList = new(); + GasNameList = new(); //单中气体初始化 foreach (var unit in GasFlowUnitList) @@ -60,23 +81,68 @@ namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.GasFlow gasName = unit.GasName.Replace("_Vent", ""); } - if (!moduleNameList.Contains(gasName)) - moduleNameList.Add(gasName); + if (!GasNameList.Contains(gasName)) + GasNameList.Add(gasName); } - foreach (var name in moduleNameList) + foreach (var name in GasNameList) { GasFlowSumList.Add(new GasFlowSum() { Name = name }); } } - private bool OnTimer() + + /// + /// 气体体积使用查询 + /// + /// + /// + private bool Query(object[] objects) { - foreach (var Unit in GasFlowUnitList) + Task.Run(() => { - Unit.GetGasFlowFeedBack(); - } + string flowName = objects[0].ToString(); + start = Convert.ToDateTime(objects[1]); + end = Convert.ToDateTime(objects[2]); + + if (flowName == "All") + { + foreach (var item in GasFlowSumList) + { + QueryRunVentVolume(item.Name + "_Run"); + QueryRunVentVolume(item.Name + "_Vent"); + } + } + else + { + QueryRunVentVolume(flowName + "_Run"); + QueryRunVentVolume(flowName + "_Vent"); + } + }); return true; } + private void QueryRunVentVolume(string flowName) + { + Task.Run(() => + { + double values = GasFlowSqlHelp.Query(ModuleName, "GasRealTimeFlow." + flowName, start, end); + foreach (var item in GasFlowSumList) + { + if (flowName.Contains(item.Name)) + { + if (flowName.Contains("Run")) + item.RunVolume = values * 1.66667 * Math.Pow(10, -7); + else + item.VentVolume = values * 1.66667 * Math.Pow(10, -7); + return; + } + } + }); + + } + + + + } } diff --git a/MECF.Framework.RT.EquipmentLibrary/MECF.Framework.RT.EquipmentLibrary.csproj b/MECF.Framework.RT.EquipmentLibrary/MECF.Framework.RT.EquipmentLibrary.csproj index 320773b..e729e69 100644 --- a/MECF.Framework.RT.EquipmentLibrary/MECF.Framework.RT.EquipmentLibrary.csproj +++ b/MECF.Framework.RT.EquipmentLibrary/MECF.Framework.RT.EquipmentLibrary.csproj @@ -178,7 +178,6 @@ - diff --git a/MECF.Framework.UI.Client/CenterViews/Modules/PM/PMProcessView.xaml b/MECF.Framework.UI.Client/CenterViews/Modules/PM/PMProcessView.xaml index a924bf8..55474e6 100644 --- a/MECF.Framework.UI.Client/CenterViews/Modules/PM/PMProcessView.xaml +++ b/MECF.Framework.UI.Client/CenterViews/Modules/PM/PMProcessView.xaml @@ -2143,8 +2143,8 @@ Width="100" Height="30" Margin="25,10" - ItemsSource="{Binding FlowNameList}" - SelectedItem="{Binding FlowName}"> + ItemsSource="{Binding GasNameList}" + SelectedItem="{Binding SelectGasName}">