Bläddra i källkod

添加N2Purge 图表展示

git-svn-id: http://10.4.3.168:50001/svn/Furnace@70 dbcde07d-dcf5-c148-8a84-ac3097b7778e
Jiangjinyuan 1 månad sedan
förälder
incheckning
a50c1428fc

+ 12 - 0
Furnace/FurnaceUI/FurnaceUI.csproj

@@ -75,8 +75,18 @@
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\..\ThirdParty\dlls\Newtonsoft.Json.dll</HintPath>
     </Reference>
+    <Reference Include="OxyPlot, Version=2.1.0.0, Culture=neutral, PublicKeyToken=638079a8f0bd61e9, processorArchitecture=MSIL">
+      <HintPath>..\packages\OxyPlot.Core.2.1.0\lib\net45\OxyPlot.dll</HintPath>
+    </Reference>
+    <Reference Include="OxyPlot.Wpf, Version=2.1.0.0, Culture=neutral, PublicKeyToken=75e952ba404cdbb0, processorArchitecture=MSIL">
+      <HintPath>..\packages\OxyPlot.Wpf.2.1.0\lib\net45\OxyPlot.Wpf.dll</HintPath>
+    </Reference>
+    <Reference Include="OxyPlot.Wpf.Shared, Version=2.1.0.0, Culture=neutral, PublicKeyToken=75e952ba404cdbb0, processorArchitecture=MSIL">
+      <HintPath>..\packages\OxyPlot.Wpf.Shared.2.1.0\lib\net45\OxyPlot.Wpf.Shared.dll</HintPath>
+    </Reference>
     <Reference Include="PresentationFramework.Aero" />
     <Reference Include="presentationframework.aero2" />
+    <Reference Include="ReachFramework" />
     <Reference Include="SciChart.Charting">
       <HintPath>..\..\ThirdParty\dlls\SciCart\SciChart.Charting.dll</HintPath>
     </Reference>
@@ -94,6 +104,7 @@
     <Reference Include="System.Configuration" />
     <Reference Include="System.Data" />
     <Reference Include="System.Drawing" />
+    <Reference Include="System.Printing" />
     <Reference Include="System.Runtime.Serialization" />
     <Reference Include="System.ServiceModel" />
     <Reference Include="System.ServiceProcess" />
@@ -2095,6 +2106,7 @@
       <SubType>Designer</SubType>
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
+    <None Include="packages.config" />
     <None Include="Properties\Settings.settings">
       <Generator>SettingsSingleFileGenerator</Generator>
       <LastGenOutput>Settings.Designer.cs</LastGenOutput>

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 14 - 32
Furnace/FurnaceUI/Views/Parameter/N2PurgeEditView.xaml


+ 106 - 4
Furnace/FurnaceUI/Views/Parameter/N2PurgeEditViewModel.cs

@@ -1,4 +1,5 @@
 using Aitex.Core.RT.SCCore;
+using Aitex.Core.Util;
 using Caliburn.Micro;
 using DocumentFormat.OpenXml.Drawing;
 using FurnaceUI.Client.Dialog;
@@ -9,12 +10,16 @@ using MECF.Framework.UI.Client.CenterViews.Dialogs;
 using MECF.Framework.UI.Client.CenterViews.Editors.Recipe;
 using MECF.Framework.UI.Client.ClientBase;
 using OpenSEMI.ClientBase;
+using OxyPlot;
+using OxyPlot.Axes;
+using OxyPlot.Series;
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
 using System.Globalization;
 using System.Linq;
 using System.Text;
+using System.Threading;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Controls;
@@ -113,6 +118,28 @@ namespace FurnaceUI.Views.Parameter
         private string path;
         private string currentValue;
         private ObservableCollection<PageValue> valueList { get; set; } = new ObservableCollection<PageValue>();
+
+        private PlotModel o2Model;
+
+        public PlotModel O2Model
+        {
+            get { return o2Model; }
+            set { o2Model = value; NotifyOfPropertyChange("O2Model"); }
+        }
+        private PlotModel n2Model;
+
+        public PlotModel N2Model
+        {
+            get { return n2Model; }
+            set { n2Model = value; NotifyOfPropertyChange("N2Model"); }
+        }
+
+        [Subscription("PM1.ConcentrationO2.Value")]
+        public double ConcentrationO2Value { get; set; }
+        [Subscription("PM1.MFC51.Feedback")]
+        public double MFC51Feedback { get; set; }
+        [Subscription("PM1.MFM57.Feedback")]
+        public double MFM57Feedback { get; set; }
         protected override void OnInitialize()
         {
             base.OnInitialize();
@@ -126,9 +153,84 @@ namespace FurnaceUI.Views.Parameter
         {
             base.OnActivate();
             DefaultUnit = (string)QueryDataClient.Instance.Service.GetConfig($"PM1.APC.PressureUnit");
+            GetO2ModelSpline();
+            GetN2ModelSpline();
+        }
+
+        public void GetO2ModelSpline()
+        {
+            var tmp = new PlotModel { };
+
+            tmp.Axes.Add(new DateTimeAxis()
+            {
+                StringFormat = "HH:mm:ss",
+                IsZoomEnabled = false,
+                IsPanEnabled = false,
+                IntervalType = DateTimeIntervalType.Seconds
+            });
+
+            tmp.Series.Add(new LineSeries
+            {
+                Color = OxyColors.Blue,
+                MarkerType = MarkerType.Circle,
+                InterpolationAlgorithm = InterpolationAlgorithms.CanonicalSpline
+            });
+            this.O2Model = tmp;
+            Task.Run(() =>
+            {
+                while (true)
+                {
+                    var date = DateTime.Now;
+                    tmp.Axes[0].Maximum = DateTimeAxis.ToDouble(date.AddSeconds(1));
+                    var lineSer = this.O2Model.Series[0] as LineSeries;
+
+                    lineSer.Points.Add(new OxyPlot.DataPoint(DateTimeAxis.ToDouble(date), ConcentrationO2Value));
+                    if (lineSer.Points.Count > 30)
+                    {
+                        lineSer.Points.RemoveAt(0);
+                    }
+                    tmp.InvalidatePlot(true);
+                    Thread.Sleep(1000);
+                }
+            });
         }
+        public void GetN2ModelSpline()
+        {
+            var tmp = new PlotModel { };
 
-        
+            tmp.Axes.Add(new DateTimeAxis()
+            {
+                StringFormat = "HH:mm:ss",
+                IsZoomEnabled = false,
+                IsPanEnabled = false,
+                IntervalType = DateTimeIntervalType.Seconds
+            });
+
+            tmp.Series.Add(new LineSeries
+            {
+                Color = OxyColors.Blue,
+                MarkerType = MarkerType.Circle,
+                InterpolationAlgorithm = InterpolationAlgorithms.CanonicalSpline
+            });
+            this.N2Model = tmp;
+            Task.Run(() =>
+            {
+                while (true)
+                {
+                    var date = DateTime.Now;
+                    tmp.Axes[0].Maximum = DateTimeAxis.ToDouble(date.AddSeconds(1));
+                    var lineSer = this.N2Model.Series[0] as LineSeries;
+                    var pointValue = MFC51Feedback + MFM57Feedback;
+                    lineSer.Points.Add(new OxyPlot.DataPoint(DateTimeAxis.ToDouble(date), pointValue));
+                    if (lineSer.Points.Count > 30)
+                    {
+                        lineSer.Points.RemoveAt(0);
+                    }
+                    tmp.InvalidatePlot(true);
+                    Thread.Sleep(1000);
+                }
+            });
+        }
         private void InitTree()
         {
             var node = SystemConfigProvider.Instance.GetConfigTree(SystemName).SubNodes;
@@ -188,7 +290,7 @@ namespace FurnaceUI.Views.Parameter
         }
         public void HideAllCanvas()
         {
-          
+
         }
         public void TreeViewSelectedItemChanged(object obj)
         {
@@ -201,7 +303,7 @@ namespace FurnaceUI.Views.Parameter
             Canvas canvas = null;
             LevelOneNode = FindNodeByName(_rootNode, $"{strHeader}.{para.ConfigName}");
             LevelTwoNode = LevelOneNode.SubNodes.FirstOrDefault();
-           
+
             if (canvas == null) return;
             canvas.Visibility = Visibility.Visible;
 
@@ -501,7 +603,7 @@ namespace FurnaceUI.Views.Parameter
             NotifyOfPropertyChange("TransferRoomVisibleBackGround");
         }
     }
-   
+
 
 }
 

+ 6 - 0
Furnace/FurnaceUI/packages.config

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="OxyPlot.Core" version="2.1.0" targetFramework="net452" />
+  <package id="OxyPlot.Wpf" version="2.1.0" targetFramework="net452" />
+  <package id="OxyPlot.Wpf.Shared" version="2.1.0" targetFramework="net452" />
+</packages>