Browse Source

添加数据分析界面

lixiang 1 year ago
parent
commit
ec1eeba67c

+ 35 - 0
Venus/Venus_MainPages/Unity/ChartParameter.cs

@@ -0,0 +1,35 @@
+using System.Collections.ObjectModel;
+using Caliburn.Micro.Core;
+
+namespace Venus_MainPages.Unity
+{
+  
+
+    public class RecipeItem
+    {
+        public bool Selected { get; set; }
+        public string Recipe { get; set; }
+        public string Guid { get; set; }
+        public string RecipeRunGuid { get; set; }
+        public string Chamber { get; set; }
+        public string Status { get; set; }
+        public string StartTime { get; set; }
+        public string EndTime { get; set; }
+        public string LotID { get; set; }
+        public string SlotID { get; set; }
+    }
+
+    public class ParameterNode : PropertyChangedBase
+    {    
+        private bool _Selected = false;
+        public bool Selected
+        {
+            get { return _Selected; }
+            set { _Selected = value; NotifyOfPropertyChange("Selected"); }
+        }
+
+        public string Name { get; set; }
+        public ObservableCollection<ParameterNode> ChildNodes { get; set; }
+        public ParameterNode ParentNode { get; set; }
+    }
+}

+ 122 - 0
Venus/Venus_MainPages/Unity/RealtimeProvider.cs

@@ -0,0 +1,122 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using Aitex.Core.RT.Log;
+using MECF.Framework.Common.DataCenter;
+using OpenSEMI.ClientBase.ServiceProvider;
+
+
+namespace Venus_MainPages.Unity
+{
+    public class RealtimeProvider : IProvider
+    {
+        //private static RealtimeProvider _Instance = null;
+        //public static RealtimeProvider Instance
+        //{
+        //    get
+        //    {
+        //        if (_Instance == null)
+        //            _Instance = new RealtimeProvider();
+
+        //        return _Instance;
+        //    }
+        //}
+
+        ObservableCollection<ParameterNode> _rootNode = new ObservableCollection<ParameterNode>();
+        Dictionary<string, ParameterNode> _indexer = new Dictionary<string, ParameterNode>();
+
+        public void Create()
+        {
+
+        }
+ 
+        public ObservableCollection<ParameterNode> GetParameters()
+        {
+            try
+            {
+                List<string> dataList = (List<string>)QueryDataClient.Instance.Service.GetConfig("System.NumericDataList");
+                dataList.Sort();
+                List<string> removeList = _indexer.Keys.ToList();
+                foreach (string dataName in dataList)
+                {
+                    string[] nodeName = dataName.Split('.');
+                    ParameterNode parentNode = null;
+                    string pathName="";
+                    for (int i = 0; i < nodeName.Length; i++)
+                    {
+                        pathName = (i == 0) ? nodeName[i] : (pathName + "." + nodeName[i]);
+
+                        removeList.Remove(pathName);
+
+                        if (!_indexer.ContainsKey(pathName))
+                        {
+                            _indexer[pathName] = new ParameterNode() {Name = pathName, ChildNodes = new ObservableCollection<ParameterNode>(), ParentNode = parentNode};
+
+                            if (parentNode == null)
+                            {
+                                _rootNode.Add(_indexer[pathName]);
+                            }
+                            else
+                            {
+                                parentNode.ChildNodes.Add(_indexer[pathName]);
+                            }
+                        }
+
+                        parentNode = _indexer[pathName];
+
+                        removeList.Remove(pathName);
+                    }
+                }
+
+                foreach (var key in removeList)
+                {
+                    if (_indexer[key].ParentNode == null)
+                        _rootNode.Remove(_indexer[key]);
+                    else
+                    {
+                        _indexer[key].ParentNode.ChildNodes.Remove(_indexer[key]);
+                    }
+                }
+
+                return _rootNode;
+            }
+            catch (Exception ex)
+            {
+                //LOG.Write(ex);
+            }
+            
+
+            #region Test code
+            ObservableCollection<ParameterNode> result = new ObservableCollection<ParameterNode>();
+
+            ParameterNode node1 = new ParameterNode() { Name = "Para Node 1", Selected = false, ChildNodes = new ObservableCollection<ParameterNode>() };
+            ParameterNode node2 = new ParameterNode() { Name = "Para Node 2", Selected = false, ChildNodes = new ObservableCollection<ParameterNode>() };
+            ParameterNode node3 = new ParameterNode() { Name = "Para Node 3", Selected = false, ChildNodes = new ObservableCollection<ParameterNode>() };
+
+            for (int i = 0; i < 5; i++)
+            {
+                ParameterNode node = new ParameterNode() { Name = node1.Name + "_" + i.ToString(), Selected = false, ChildNodes = new ObservableCollection<ParameterNode>() };
+                node1.ChildNodes.Add(node);
+            }
+
+            for (int i = 0; i < 3; i++)
+            {
+                ParameterNode node = new ParameterNode() { Name = node2.Name + "_" + i.ToString(), Selected = false, ChildNodes = new ObservableCollection<ParameterNode>() };
+                node2.ChildNodes.Add(node);
+            }
+
+            for (int i = 0; i < 4; i++)
+            {
+                ParameterNode node = new ParameterNode() { Name = node3.Name + "_" + i.ToString(), Selected = false, ChildNodes = new ObservableCollection<ParameterNode>() };
+                node3.ChildNodes.Add(node);
+            }
+
+            result.Add(node1);
+            result.Add(node2);
+            result.Add(node3);
+            return result;
+            #endregion
+        }
+    }
+}

+ 2 - 8
Venus/Venus_MainPages/Venus_MainPages.csproj

@@ -123,6 +123,7 @@
     <Compile Include="PMS\UiRecipeManager.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="RTData.cs" />
+    <Compile Include="Unity\ChartParameter.cs" />
     <Compile Include="Unity\CommonFunction.cs" />
     <Compile Include="Unity\ConfigValueTemplateSelector.cs" />
     <Compile Include="Unity\ContextMenuManager.cs" />
@@ -132,6 +133,7 @@
     <Compile Include="Unity\GridOptions.cs" />
     <Compile Include="Unity\IHandler.cs" />
     <Compile Include="Unity\ModuleManager.cs" />
+    <Compile Include="Unity\RealtimeProvider.cs" />
     <Compile Include="Unity\VATPerformanceResult.cs" />
     <Compile Include="Unity\SystemConfig.cs" />
     <Compile Include="Unity\SystemConfigProvider.cs" />
@@ -139,7 +141,6 @@
     <Compile Include="Unity\WaferStatusHandler.cs" />
     <Compile Include="Unity\WaferStatusImp.cs" />
     <Compile Include="ViewModels\ButterflyValveViewModel.cs" />
-    <Compile Include="ViewModels\DataAnalysisViewModel.cs" />
     <Compile Include="ViewModels\DataHistoryViewModel.cs" />
     <Compile Include="ViewModels\EventViewModel.cs" />
     <Compile Include="ViewModels\GasLeakCheckViewModel.cs" />
@@ -162,9 +163,6 @@
     <Compile Include="Views\ButterflyValveView.xaml.cs">
       <DependentUpon>ButterflyValveView.xaml</DependentUpon>
     </Compile>
-    <Compile Include="Views\DataAnalysisView.xaml.cs">
-      <DependentUpon>DataAnalysisView.xaml</DependentUpon>
-    </Compile>
     <Compile Include="Views\DataHistoryView.xaml.cs">
       <DependentUpon>DataHistoryView.xaml</DependentUpon>
     </Compile>
@@ -256,10 +254,6 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\DataAnalysisView.xaml">
-      <SubType>Designer</SubType>
-      <Generator>MSBuild:Compile</Generator>
-    </Page>
     <Page Include="Views\DataHistoryView.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 0 - 17
Venus/Venus_MainPages/ViewModels/DataAnalysisViewModel.cs

@@ -1,17 +0,0 @@
-using Aitex.Core.RT.SCCore;
-using Aitex.Core.Utilities;
-using Prism.Mvvm;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-
-namespace Venus_MainPages.ViewModels
-{
-    public class DataAnalysisViewModel : BindableBase
-    {
-          
-    }
-}

+ 247 - 2
Venus/Venus_MainPages/ViewModels/DataHistoryViewModel.cs

@@ -1,12 +1,257 @@
-using System;
+using Aitex.Core.RT.DataCenter;
+using Aitex.Core.RT.Log;
+using Aitex.Core.UI.ControlDataContext;
+using ControlzEx.Standard;
+using LiveCharts.Wpf;
+using MECF.Framework.Common.CommonData;
+using MECF.Framework.Common.ControlDataContext;
+using MECF.Framework.Common.DataCenter;
+using OpenSEMI.ClientBase;
+using Prism.Commands;
+using Prism.Mvvm;
+using System;
+using System.Collections.Concurrent;
 using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Data;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Forms;
+using System.Windows.Media;
+using Venus_MainPages.Unity;
+using Venus_MainPages.Views;
+using Xceed.Wpf.DataGrid;
 
 namespace Venus_MainPages.ViewModels
 {
-    internal class DataHistoryViewModel
+    public class DataHistoryViewModel : BindableBase
     {
+        #region 私有字段
+        private DataHistoryView DataHistoryView;
+        private ObservableCollection<ParameterNode> _ParameterNodes;
+        RealtimeProvider _provider = new RealtimeProvider();
+        private object _lockSelection = new object();
+        ConcurrentBag<QueryIndexer> _lstTokenTimeData = new ConcurrentBag<QueryIndexer>();
+        List<string> keys=new List<string> ();
+        #endregion
+
+        #region 属性
+        public ObservableCollection<ParameterNode> ParameterNodes
+        {
+            get { return _ParameterNodes; }
+            set { SetProperty(ref _ParameterNodes, value); }
+        }
+
+        #endregion
+
+        #region 命令
+        private DelegateCommand<object> _LoadCommand;
+        public DelegateCommand<object> LoadCommand =>
+            _LoadCommand ?? (_LoadCommand = new DelegateCommand<object>(OnLoad));
+
+        private DelegateCommand<object> _ParameterCheckCommand;
+        public DelegateCommand<object> ParameterCheckCommand =>
+            _ParameterCheckCommand ?? (_ParameterCheckCommand = new DelegateCommand<object>(OnParameterCheck));
+
+        private DelegateCommand _StartCommand;
+        public DelegateCommand StartCommand =>
+            _StartCommand ?? (_StartCommand = new DelegateCommand(OnStart));
+        #endregion
+
+        #region 构造函数
+        public DataHistoryViewModel() 
+        {
+            ParameterNodes = _provider.GetParameters();
+        }
+        #endregion
+
+        #region 命令方法
+        private void OnLoad(Object eventView)
+        {
+            this.DataHistoryView = (DataHistoryView)eventView;
+            this.DataHistoryView.wfTimeFrom.Value = DateTime.Today;
+            this.DataHistoryView.wfTimeTo.Value = new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day, 23, 59, 59, 999);
+            //this.DataHistoryView.MyDrawGraphicsControl.PointCollections=new PointCollection(new Point[] {})
+
+        }
+        private void OnParameterCheck(object obj)
+        {      
+            ParameterNode node = obj as ParameterNode;
+            //keys.Add(node.Name);
+            if (!RefreshTreeStatusToChild(node))
+            {
+                node.Selected = !node.Selected;
+            }
+            else
+            {
+                RefreshTreeStatusToParent(node);
+            }
+        }
+        private bool RefreshTreeStatusToChild(ParameterNode node)
+        {
+            if (node.ChildNodes.Count > 0)
+            {
+                for (int i = 0; i < node.ChildNodes.Count; i++)
+                {
+                    ParameterNode n = node.ChildNodes[i];
+                    n.Selected = node.Selected;
+
+                    if (!RefreshTreeStatusToChild(n))
+                    {
+                        //uncheck left node
+                        for (int j = i; j < node.ChildNodes.Count; j++)
+                        {
+                            node.ChildNodes[j].Selected = !node.Selected;
+                        }
+                        //node.Selected = !node.Selected;
+                        return false;
+                    }
+                }
+            }
+            else
+            {
+                if (node.Selected == true)
+                {
+                    keys.Add(node.Name);
+                }
+                else
+                { 
+                keys.Remove(node.Name);
+                }
+            }     
+            return true;
+        }
+        private void RefreshTreeStatusToParent(ParameterNode node)
+        {
+            if (node.ParentNode != null)
+            {
+                if (node.Selected)
+                {
+                    bool flag = true;
+                    for (int i = 0; i < node.ParentNode.ChildNodes.Count; i++)
+                    {
+                        if (!node.ParentNode.ChildNodes[i].Selected)
+                        {
+                            flag = false;  //as least one child is unselected
+                            break;
+                        }
+                    }
+                    if (flag)
+                        node.ParentNode.Selected = true;
+                }
+                else
+                {
+                    node.ParentNode.Selected = false;
+                }
+                RefreshTreeStatusToParent(node.ParentNode);
+            }        
+        }
+
+        private Dictionary<string, List<HistoryDataItem>> GetData(List<string> keys, DateTime from, DateTime to)
+        {                        
+            string sql = "select time AS InternalTimeStamp";
+            foreach (var dataId in keys)
+            {
+                sql += "," + string.Format("\"{0}\"", dataId);
+            }
+            sql += string.Format(" from \"{0}\" where time > {1} and time <= {2} order by time asc",
+                from.ToString("yyyyMMdd") + "." + "Data", from.Ticks, to.Ticks);
+
+            DataTable dataTable = QueryDataClient.Instance.Service.QueryData(sql);
+
+            Dictionary<string, List<HistoryDataItem>> historyData = new Dictionary<string, List<HistoryDataItem>>();
+            if (dataTable == null || dataTable.Rows.Count == 0)
+                return null;
+
+            DateTime dt = new DateTime();
+            Dictionary<int, string> colName = new Dictionary<int, string>();
+            for (int colNo = 0; colNo < dataTable.Columns.Count; colNo++)
+            {
+                colName.Add(colNo, dataTable.Columns[colNo].ColumnName);
+                historyData[dataTable.Columns[colNo].ColumnName] = new List<HistoryDataItem>();
+            }
+            for (int rowNo = 0; rowNo < dataTable.Rows.Count; rowNo++)
+            {
+                PointCollection points = new PointCollection();
+
+                var row = dataTable.Rows[rowNo];
+
+                for (int i = 0; i < dataTable.Columns.Count; i++)
+                {
+                    HistoryDataItem data = new HistoryDataItem();
+                    if (i == 0)
+                    {
+                        long ticks = (long)row[i];
+                        dt = new DateTime(ticks);
+                        continue;
+                    }
+                    else
+                    {
+                        string dataId = colName[i];
+                        if (row[i] is DBNull || row[i] == null)
+                        {
+                            data.dateTime = dt;
+                            data.dbName = colName[i];
+                            data.value = 0;
+                        }
+                        else if (row[i] is bool)
+                        {
+                            data.dateTime = dt;
+                            data.dbName = colName[i];
+                            data.value = (bool)row[i] ? 1 : 0;
+                        }
+                        else
+                        {
+                            data.dateTime = dt;
+                            data.dbName = colName[i];
+                            data.value = float.Parse(row[i].ToString());
+                        }
+                    }
+                    historyData[data.dbName].Add(data);
+                }
+
+            }
+
+            foreach (var item in historyData)
+            {
+                item.Value.Sort((x, y) => DateTime.Compare(x.dateTime, y.dateTime));
+            }
+            return historyData;
+
+        }
+
+        private void OnStart()
+        {
+            this.DataHistoryView.MyDrawGraphicsControl.ClearPlot();
+            var result = GetData(keys.Distinct().ToList(), this.DataHistoryView.wfTimeFrom.Value, this.DataHistoryView.wfTimeTo.Value);
+            if (result == null)
+            {
+                return;
+            }
+            List<PointCollection> cls = new List<PointCollection>(); 
+            for (int i = 0; i < keys.Count; i++)
+            {
+                PointCollection points = new PointCollection();
+                int k = 1;
+                result[keys[i]].ForEach(point => 
+                {
+                    points.Add(new Point() { X = point.dateTime.ToOADate(), Y = point.value });
+                    k += 1;
+                });
+                cls.Add(points);
+            }
+            this.DataHistoryView.MyDrawGraphicsControl.PointCollections = cls;
+        }
+
+        #endregion
+    }
+
+    public class QueryIndexer
+    {
+        public DateTime TimeToken { get; set; }
+        public List<string> DataList { get; set; }
+        public string Module { get; set; }
     }
 }

+ 2 - 1
Venus/Venus_MainPages/ViewModels/EventViewModel.cs

@@ -276,6 +276,7 @@ namespace Venus_MainPages.ViewModels
             {
                 try
                 {
+                    SearchedResult = new ObservableCollection<Aitex.Core.UI.View.Common.SystemLogItem>();
                     this.SearchBeginTime = this.view.wfTimeFrom.Value;
                     this.SearchEndTime = this.view.wfTimeTo.Value;
 
@@ -332,7 +333,7 @@ namespace Venus_MainPages.ViewModels
                         }
                     }
 
-
+                    
                     if (!string.IsNullOrEmpty(sql) && QueryDBEventFunc != null)
                     {
                         sql += " order by \"occur_time\" DESC limit 2000;";

+ 23 - 4
Venus/Venus_MainPages/ViewModels/OverViewModel.cs

@@ -179,7 +179,7 @@ namespace Venus_MainPages.ViewModels
 
         private RecipeStep   m_CurrentRecipeStep = new RecipeStep();
 
-
+        private double m_ChamberPressureFeedBack;
 
 
         #endregion
@@ -857,6 +857,12 @@ namespace Venus_MainPages.ViewModels
             get { return m_ChillerIsOn; }
             set { SetProperty(ref m_ChillerIsOn, value); }
         }
+
+        public double ChamberPressureFeedBack
+        {
+            get { return m_ChamberPressureFeedBack; }
+            set { SetProperty(ref m_ChamberPressureFeedBack, value); }
+        }
         #endregion
 
         #region 命令
@@ -1394,9 +1400,13 @@ namespace Venus_MainPages.ViewModels
 
         private void OnEndStep()
         {
-            if (CurrentRecipeResult?.RecipeStepNumber != null)
-            { 
-            InvokeClient.Instance.Service.DoOperation($"{ModuleName}.ManualEndStep");
+            if (CurrentRecipeResult?.RecipeStepNumber != null && CurrentRecipeResult?.RecipeStepNumber != CurrentRecipeResult?.RecipeStepCount)
+            {
+                InvokeClient.Instance.Service.DoOperation($"{ModuleName}.ManualEndStep");
+            }
+            else if (CurrentRecipeResult?.RecipeStepNumber != null && CurrentRecipeResult?.RecipeStepNumber == CurrentRecipeResult?.RecipeStepCount)
+            {
+                InvokeClient.Instance.Service.DoOperation($"{ModuleName}.Abort");
             }
         }
         #endregion
@@ -1552,6 +1562,15 @@ namespace Venus_MainPages.ViewModels
                 CurrentRecipeResult = null;
                 CurrentRecipeStep = null;
             }
+
+            if (Math.Abs(100 - ProcessLowPressure) > 1 && ProcessLowPressure<100)
+            {
+                ChamberPressureFeedBack = ProcessLowPressure;
+            }
+            else
+            { 
+                ChamberPressureFeedBack = ProcessHighPressure;
+            }
         }
        
 

+ 279 - 1
Venus/Venus_MainPages/ViewModels/RFCalibrationViewModel.cs

@@ -1,12 +1,290 @@
 using System;
 using System.Collections.Generic;
+using System.Collections.ObjectModel;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using Venus_Core;
+using Prism.Commands;
+using Prism.Mvvm;
+using MECF.Framework.Common.DataCenter;
+using Aitex.Core.Common.DeviceData;
+using MECF.Framework.Common.CommonData;
+using System.Xml.Serialization;
+using Aitex.Core.Util;
 
 namespace Venus_MainPages.ViewModels
 {
-    internal class RFCalibrationViewModel
+    public class RFCalibrationViewModel:BindableBase
     {
+        #region 字段
+        public ObservableCollection<CalibrationTableItem> m_CalibrationItems=new ObservableCollection<CalibrationTableItem>();
+        public string ModuleName { get; set; }
+        private CalibrationTableItem m_CurrentSelection;
+        public AITRfData rf;
+        private string _GeneratorSerialNumber;
+        private string _SensorSerialNumber;
+        private double _RFPhysicalMaxPower;
+        private double _CurrentRFMaxPower;
+        private double _RFCalibratedMaxPower;
+        private bool   _IsSelectedAllEnable;
+        private ObservableCollection<NotifiableCalibrationTableItem> _TableData;
+        private AITRfData _CurrentSelectionRF;
+        #endregion
+
+        #region 属性
+        public ObservableCollection<CalibrationTableItem> CalibrationItems
+        {
+            get { return m_CalibrationItems; }
+            set { SetProperty(ref m_CalibrationItems, value); }
+
+        }
+        public CalibrationTableItem CurrentSelection
+        {
+            get { return m_CurrentSelection; }
+            set 
+            {
+                ChangeSelection(value);
+                SetProperty(ref m_CurrentSelection, value); 
+            }
+
+        }
+        public string GeneratorSerialNumber
+        {
+            get { return _GeneratorSerialNumber; }
+            set { SetProperty(ref _GeneratorSerialNumber, value); }
+
+        }
+        public string SensorSerialNumber
+        {
+            get { return _SensorSerialNumber; }
+            set { SetProperty(ref _SensorSerialNumber, value); }
+
+        }
+        public double RFPhysicalMaxPower
+        {
+            get { return _RFPhysicalMaxPower; }
+            set { SetProperty(ref _RFPhysicalMaxPower, value); }
+        }
+        public double CurrentRFMaxPower
+        {
+            get { return _CurrentRFMaxPower; }
+            set { SetProperty(ref _CurrentRFMaxPower, value); }
+        }
+        public double RFCalibratedMaxPower
+        {
+            get { return _RFCalibratedMaxPower; }
+            set { SetProperty(ref _RFCalibratedMaxPower, value); }
+        }
+        public ObservableCollection<NotifiableCalibrationTableItem> TableData
+        {
+            get { return _TableData; }
+            set { SetProperty(ref _TableData, value); }
+        }
+        public AITRfData CurrentSelectionRF
+        {
+            get { return _CurrentSelectionRF; }
+            set { SetProperty(ref _CurrentSelectionRF, value); }
+        }
+        public bool IsSelectedAllEnable
+        {
+            get { return _IsSelectedAllEnable; }
+            set { SetProperty(ref _IsSelectedAllEnable, value); }
+        }
+        #endregion
+
+        #region 命令
+        private DelegateCommand _CheckCommand;
+        public DelegateCommand CheckCommand =>
+            _CheckCommand ?? (_CheckCommand = new DelegateCommand(OnCheck));
+
+        private DelegateCommand _UnCheckCommand;
+        public DelegateCommand UnCheckCommand =>
+            _UnCheckCommand ?? (_UnCheckCommand = new DelegateCommand(OnUnCheck));
+        #endregion
+
+        #region 构造函数
+        public RFCalibrationViewModel() 
+        {
+            CalibrationItems.Add(new CalibrationTableItem()
+            {
+                DisplayName = "Source RF",
+                ItemEnableScName = $"{ModuleName}.Rf.EnableCalibration",
+                ItemTableScName = $"{ModuleName}.Rf.CalibrationTable",
+            });
+            CalibrationItems.Add(new CalibrationTableItem()
+            {
+                DisplayName = "Bias RF",
+                ItemEnableScName = $"{ModuleName}.BiasRf.EnableCalibration",
+                ItemTableScName = $"{ModuleName}.BiasRf.CalibrationTable",
+            });
+            
+        }
+        #endregion
+
+        #region 命令方法
+        public void OnCheck()
+        {
+            if (TableData != null && TableData.Count > 0) { }
+            //TableData.ForEachDo(x =>
+            //{
+            //    x.IsSelected = true;
+            //    x.InvokePropertyChanged("IsSelected");
+            //});
+            //for(int i=0;i<)
+        }
+
+        public void OnUnCheck()
+        {
+            //if (TableData != null && TableData.Count > 0)
+            //    TableData.ForEachDo(x =>
+            //    {
+            //        x.IsSelected = false;
+            //        x.InvokePropertyChanged("IsSelected");
+            //    });
+        }
+        #endregion
+
+        #region 私有方法
+        protected void ChangeSelection(CalibrationTableItem item)
+        {
+            string name=item.DisplayName== "Source RF"?VenusDevice.Rf.ToString():VenusDevice.BiasRf.ToString();
+            CurrentSelectionRF= rf = (AITRfData)QueryDataClient.Instance.Service.GetData($"{ModuleName}.{name}.DeviceData");
+            if (rf == null) return;
+
+            
+            GeneratorSerialNumber =  QueryDataClient.Instance.Service.GetConfig($"{rf.Module}.{rf.DeviceName}.GeneratorSerialNumber")?.ToString();
+            SensorSerialNumber    =  QueryDataClient.Instance.Service.GetConfig($"{rf.Module}.{rf.DeviceName}.SensorSerialNumber")?.ToString();
+            double result;
+            double.TryParse(QueryDataClient.Instance.Service.GetConfig($"{rf.Module}.{rf.DeviceName}.RFPhysicalMaxPower")?.ToString(),out result);
+            RFPhysicalMaxPower = result;
+            double.TryParse(QueryDataClient.Instance.Service.GetConfig($"{rf.Module}.{rf.DeviceName}.CurrentRFMaxPower")?.ToString(),out result);
+            CurrentRFMaxPower = result;
+            double.TryParse(QueryDataClient.Instance.Service.GetConfig($"{rf.Module}.{rf.DeviceName}.RFCalibratedMaxPower")?.ToString(),out result);
+            RFCalibratedMaxPower = result;
+
+            var tableValues = QueryDataClient.Instance.Service.GetConfig($"{ModuleName}{item.ItemTableDetailScName}");
+            if (tableValues == null)
+                return;
+
+            var scValue = (string)tableValues;
+
+            if (string.IsNullOrEmpty(scValue))
+            {
+                InitTableData(item);
+                return;
+            }
+
+            try
+            {
+                var tableData = CustomXmlSerializer.Deserialize<List<NotifiableCalibrationTableItem>>(scValue);
+                TableData = new ObservableCollection<NotifiableCalibrationTableItem>(tableData);
+            }
+            catch (Exception ex)
+            {
+                InitTableData(item);
+            }
+
+
+        }
+        private void InitTableData(CalibrationTableItem item)
+        {
+            var tableData = new List<NotifiableCalibrationTableItem>();
+            for (int i = 0; i < 20; i++)
+            {
+                tableData.Add(new NotifiableCalibrationTableItem() { DisplayName = item.DisplayName, SetPoint = (i + 1) * 100, ForwardPowerUI = (i + 1) * 100, ForwardPowerMeter = (i + 1) * 100 });
+            }
+
+            TableData = new ObservableCollection<NotifiableCalibrationTableItem>(tableData);
+        }
+
+
+        #endregion
+    }
+    public class CalibrationTableItem
+    {
+        public string DisplayName { get; set; }
+        public string ItemTableScName { get; set; }
+        public string ItemTableDetailScName
+        {
+            get => ItemTableScName + "Detail";
+        }
+        public string ItemEnableScName { get; set; }
+    }
+    public class NotifiableCalibrationTableItem : NotifiableItem
+    {
+        public string DisplayName { get; set; }
+
+        public bool IsSelected { get; set; }
+
+        [XmlIgnore]
+        public bool IsSelectedEnable { get; set; } = true;
+
+        public float _setPoint;
+        public float SetPoint
+        {
+            get
+            {
+                return _setPoint;
+            }
+            set
+            {
+                _setPoint = value;
+                InvokePropertyChanged("SetPoint");
+            }
+        }
+
+        [XmlIgnore]
+        public bool SetPointEnable { get; set; } = true;
+
+        public float _forwardPowerUI;
+        public float ForwardPowerUI
+        {
+            get
+            {
+                return _forwardPowerUI;
+            }
+            set
+            {
+                _forwardPowerUI = value;
+                InvokePropertyChanged("ForwardPowerUI");
+            }
+        }
+
+        private float _forwardPowerMeter;
+        public float ForwardPowerMeter
+        {
+            get
+            {
+                return _forwardPowerMeter;
+            }
+            set
+            {
+                _forwardPowerMeter = value;
+                InvokePropertyChanged("ForwardPowerMeter");
+                InvokePropertyChanged("Difference");
+                InvokePropertyChanged("DifferenceBackground");
+            }
+        }
+
+        public float ReflectedPower { get; set; }
+
+        public float Difference
+        {
+            get
+            {
+                if (SetPoint == 0)
+                    return 0;
+                return (ForwardPowerMeter - SetPoint) * 100 / SetPoint;
+            }
+        }
+
+        public string DifferenceBackground
+        {
+            get
+            {
+                return Math.Abs(Difference) <= 3 ? "LightGreen" : "Red";
+            }
+        }
     }
 }

+ 28 - 8
Venus/Venus_MainPages/ViewModels/RecipeViewModel.cs

@@ -2,11 +2,13 @@
 using Aitex.Core.UI.View.Common;
 using Aitex.UI.RecipeEditor;
 using Aitex.UI.RecipeEditor.View;
+using Microsoft.Win32;
 using Prism.Commands;
 using Prism.Mvvm;
 using Prism.Regions;
 using System;
 using System.Collections.Generic;
+using System.IO;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -225,20 +227,20 @@ namespace Venus_MainPages.ViewModels
             menuItem = new MenuItem();
             menuItem.Tag = "\\";
             menuItem.Click += new RoutedEventHandler(menuItem_MouseClick_CreateRecipe);
-            menuItem.Header = Application.Current.Resources["GlobalLableMenuNewRecipe"];
+            menuItem.Header = "New Recipe";
             treeViewRcpList.ContextMenu.Items.Add(menuItem);
 
             menuItem = new MenuItem();
             menuItem.Tag = "\\";
             menuItem.Click += new RoutedEventHandler(menuItem_MouseClick_DeleteRecipe);
-            menuItem.Header = "删除配方";
+            menuItem.Header = "Delete Recipe";
             treeViewRcpList.ContextMenu.Items.Add(menuItem);
 
-            //menuItem = new MenuItem();
-            //menuItem.Tag = "\\";
-            ////menuItem.Click += new RoutedEventHandler(menuItem_MouseClick_ImportRecipe);
-            //menuItem.Header = Application.Current.Resources["GlobalLableMenuImportRecipe"];
-            //treeViewRcpList.ContextMenu.Items.Add(menuItem);
+            menuItem = new MenuItem();
+            menuItem.Tag = "\\";
+            menuItem.Click += new RoutedEventHandler(menuItem_MouseClick_SaveAsRecipe);
+            menuItem.Header = "Save As Recipe";
+            treeViewRcpList.ContextMenu.Items.Add(menuItem);
 
             //treeViewRcpList.ContextMenu.Items.Add(new Separator());
 
@@ -314,7 +316,25 @@ namespace Venus_MainPages.ViewModels
             //PerformCreateRecipe(folderName);
             treeViewRcpList.Items.Remove(selectedItem);
         }
-
+        /// <summary>
+        /// 另存为配方
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void menuItem_MouseClick_SaveAsRecipe(object sender, RoutedEventArgs e)
+        {
+            var dlg = new SaveFileDialog()
+            {
+                Title = "Save As",
+                DefaultExt = "rcp",
+                Filter = "rcp files (*.rcp)|*.rcp|All files|*.*",
+            };
+            if (dlg.ShowDialog() == true)
+            {
+                File.WriteAllText(dlg.FileName, m_uiRecipeManager.LoadRecipe(m_chamId, CurrentRecipeName));
+            }
+            UpdateRecipeFileList();
+        }
         /// <summary>
         /// SaveAs recipe by recipe name and recipe data
         /// </summary>

+ 0 - 15
Venus/Venus_MainPages/Views/DataAnalysisView.xaml

@@ -1,15 +0,0 @@
-<UserControl x:Class="Venus_MainPages.Views.DataAnalysisView"
-             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
-             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
-             xmlns:local="clr-namespace:Venus_MainPages.Views"
-             mc:Ignorable="d" 
-             xmlns:prism="http://prismlibrary.com/"
-             prism:ViewModelLocator.AutoWireViewModel="True"
-             xmlns:ctrls="clr-namespace:Venus_Themes.UserControls;assembly=Venus_Themes"
-             d:DesignHeight="450" d:DesignWidth="800">
-    <Grid>
-        <ctrls:DrawGraphicsControl/>
-    </Grid>
-</UserControl>

+ 0 - 28
Venus/Venus_MainPages/Views/DataAnalysisView.xaml.cs

@@ -1,28 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
-
-namespace Venus_MainPages.Views
-{
-    /// <summary>
-    /// DataAnalysisView.xaml 的交互逻辑
-    /// </summary>
-    public partial class DataAnalysisView : UserControl
-    {
-        public DataAnalysisView()
-        {
-            InitializeComponent();
-        }
-    }
-}

File diff suppressed because it is too large
+ 87 - 2
Venus/Venus_MainPages/Views/DataHistoryView.xaml


+ 49 - 49
Venus/Venus_MainPages/Views/OverView.xaml

@@ -782,16 +782,16 @@
 
 
 
-                <TextBlock Grid.Row="1"   Text="Top RF Forward Power"           Background="#D0D8E8"    Padding="10,6,0,0"/>
-                <TextBlock Grid.Row="2"   Text="Top RF Reflected Power"           Background="#E9EDF4"   Padding="10,6,0,0" />
-                <TextBlock Grid.Row="3"  Text="Bias RF Forward Power"           Background="#D0D8E8"    Padding="10,6,0,0" />
-                <TextBlock Grid.Row="4"   Text="Bias RF Reflected Power"           Background="#E9EDF4"    Padding="10,6,0,0" />
-                <TextBlock Grid.Row="5"   Text="Bias RF Match C1%"           Background="#D0D8E8"    Padding="10,6,0,0" />
-                <TextBlock Grid.Row="6"  Text="Bias RF Match C2%"           Background="#E9EDF4"   Padding="10,6,0,0" />
-                <TextBlock Grid.Row="7"   Text="Bias Voltage"           Background="#D0D8E8"    Padding="10,6,0,0" />
-                <TextBlock Grid.Row="8"   Text="Pressure"       Background="#E9EDF4"    Padding="10,6,0,0" />
-                <TextBlock Grid.Row="9"   Text="Pressure Control Valve Position"       Background="#D0D8E8"    Padding="10,6,0,0"/>
-                <TextBlock Grid.Row="10"          Background="#E9EDF4"    Padding="10,6,0,0" >
+                <TextBlock Grid.Row="1"   Text="Top RF Forward Power"           Background="#D0D8E8"    Padding="10,5,0,0"/>
+                <TextBlock Grid.Row="2"   Text="Top RF Reflected Power"           Background="#E9EDF4"   Padding="10,5,0,0" />
+                <TextBlock Grid.Row="3"  Text="Bias RF Forward Power"           Background="#D0D8E8"    Padding="10,5,0,0" />
+                <TextBlock Grid.Row="4"   Text="Bias RF Reflected Power"           Background="#E9EDF4"    Padding="10,5,0,0" />
+                <TextBlock Grid.Row="5"   Text="Bias RF Match C1%"           Background="#D0D8E8"    Padding="10,5,0,0" />
+                <TextBlock Grid.Row="6"  Text="Bias RF Match C2%"           Background="#E9EDF4"   Padding="10,5,0,0" />
+                <TextBlock Grid.Row="7"   Text="Bias Voltage"           Background="#D0D8E8"    Padding="10,5,0,0" />
+                <TextBlock Grid.Row="8"   Text="Pressure"       Background="#E9EDF4"    Padding="10,5,0,0" />
+                <TextBlock Grid.Row="9"   Text="Pressure Control Valve Position"       Background="#D0D8E8"    Padding="10,5,0,0"/>
+                <TextBlock Grid.Row="10"          Background="#E9EDF4"    Padding="10,5,0,0" >
                     <TextBlock.Text>
                         <MultiBinding StringFormat="{}Gas1({0}:{1})">
                             <Binding Path="MFC1Data.DisplayName"></Binding>
@@ -799,7 +799,7 @@
                         </MultiBinding>
                     </TextBlock.Text>
                 </TextBlock>
-                <TextBlock Grid.Row="11"         Background="#D0D8E8"    Padding="10,6,0,0" >
+                <TextBlock Grid.Row="11"         Background="#D0D8E8"    Padding="10,5,0,0" >
                     <TextBlock.Text>
                         <MultiBinding StringFormat="{}Gas2({0}:{1})">
                             <Binding Path="MFC2Data.DisplayName"></Binding>
@@ -807,7 +807,7 @@
                         </MultiBinding>
                     </TextBlock.Text>
                 </TextBlock>
-                <TextBlock Grid.Row="12"        Background="#E9EDF4"    Padding="10,6,0,0" >
+                <TextBlock Grid.Row="12"        Background="#E9EDF4"    Padding="10,5,0,0" >
                     <TextBlock.Text>
                         <MultiBinding StringFormat="{}Gas13({0}:{1})">
                             <Binding Path="MFC3Data.DisplayName"></Binding>
@@ -815,7 +815,7 @@
                         </MultiBinding>
                     </TextBlock.Text>
                 </TextBlock>
-                <TextBlock Grid.Row="13"         Background="#D0D8E8"   Padding="10,6,0,0" >
+                <TextBlock Grid.Row="13"         Background="#D0D8E8"   Padding="10,5,0,0" >
                     <TextBlock.Text>
                         <MultiBinding StringFormat="{}Gas4({0}:{1})">
                             <Binding Path="MFC4Data.DisplayName"></Binding>
@@ -823,7 +823,7 @@
                         </MultiBinding>
                     </TextBlock.Text>
                 </TextBlock>
-                <TextBlock Grid.Row="14"         Background="#E9EDF4"    Padding="10,6,0,0">
+                <TextBlock Grid.Row="14"         Background="#E9EDF4"    Padding="10,5,0,0">
                     <TextBlock.Text>
                         <MultiBinding StringFormat="{}Gas5({0}:{1})">
                             <Binding Path="MFC5Data.DisplayName"></Binding>
@@ -831,7 +831,7 @@
                         </MultiBinding>
                     </TextBlock.Text>
                 </TextBlock>
-                <TextBlock Grid.Row="15"          Background="#D0D8E8"   Padding="10,6,0,0">
+                <TextBlock Grid.Row="15"          Background="#D0D8E8"   Padding="10,5,0,0">
                     <TextBlock.Text>
                         <MultiBinding StringFormat="{}Gas6({0}:{1})">
                             <Binding Path="MFC6Data.DisplayName"></Binding>
@@ -839,7 +839,7 @@
                         </MultiBinding>
                     </TextBlock.Text>
                 </TextBlock>
-                <TextBlock Grid.Row="16"         Background="#E9EDF4"  Padding="10,6,0,0">
+                <TextBlock Grid.Row="16"         Background="#E9EDF4"  Padding="10,5,0,0">
                     <TextBlock.Text>
                         <MultiBinding StringFormat="{}Gas7({0}:{1})">
                             <Binding Path="MFC7Data.DisplayName"></Binding>
@@ -847,7 +847,7 @@
                         </MultiBinding>
                     </TextBlock.Text>
                 </TextBlock>
-                <TextBlock Grid.Row="17"        Background="#D0D8E8"    Padding="10,6,0,0" >
+                <TextBlock Grid.Row="17"        Background="#D0D8E8"    Padding="10,5,0,0" >
                     <TextBlock.Text>
                         <MultiBinding StringFormat="{}Gas8({0}:{1})">
                             <Binding Path="MFC8Data.DisplayName"></Binding>
@@ -855,40 +855,40 @@
                         </MultiBinding>
                     </TextBlock.Text>
                 </TextBlock>
-                <TextBlock Grid.Row="18"   Text="ESC Clamp Voltage"          Background="#E9EDF4"  Padding="10,6,0,0"  />
-                <TextBlock Grid.Row="19"   Text="Esc Temperature"        Background="#D0D8E8"  Padding="10,6,0,0" />
-                <TextBlock Grid.Row="20"  Text="Helium Pressure"       Background="#E9EDF4"    Padding="10,6,0,0"/>
-                <TextBlock Grid.Row="21"   Text="Helium Flow"       Background="#D0D8E8"    Padding="10,6,0,0" />
-
-                <TextBlock Grid.Row="1" Grid.Column="1"  Text="{Binding SRfForwardPowerFeedBack}"           Background="#D0D8E8"   TextBlock.TextAlignment="Center"    Block.TextAlignment="Center" Padding="0,6,0,0"/>
-                <TextBlock Grid.Row="2"  Grid.Column="1" Text="{Binding SRfReflectPower}"           Background="#E9EDF4"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
-                <TextBlock Grid.Row="3"  Grid.Column="1" Text="{Binding BRfForwardPowerFeedBack}"           Background="#D0D8E8"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
-                <TextBlock Grid.Row="4"  Grid.Column="1" Text="{Binding BRfReflectPower}"           Background="#E9EDF4"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
-                <TextBlock Grid.Row="5"  Grid.Column="1" Text="{Binding BiasMatchC1}"           Background="#D0D8E8"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
-                <TextBlock Grid.Row="6"  Grid.Column="1" Text="{Binding BiasMatchC2}"           Background="#E9EDF4"  TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
-                <TextBlock Grid.Row="7"  Grid.Column="1" Text=""           Background="#D0D8E8"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
-                <TextBlock Grid.Row="8"  Grid.Column="1" Text=""       Background="#E9EDF4"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
-                <TextBlock Grid.Row="9"  Grid.Column="1" Text="{Binding PositionValue}"       Background="#D0D8E8"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
-                <TextBlock Grid.Row="10"  Grid.Column="1" Text="{Binding MFC1Data.FeedBack,StringFormat='F1'}"      Background="#E9EDF4"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
-                <TextBlock Grid.Row="11"  Grid.Column="1" Text="{Binding MFC2Data.FeedBack,StringFormat='F1'}"      Background="#D0D8E8"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
-                <TextBlock Grid.Row="12"  Grid.Column="1" Text="{Binding MFC3Data.FeedBack,StringFormat='F1'}"       Background="#E9EDF4"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
-                <TextBlock Grid.Row="13"  Grid.Column="1" Text="{Binding MFC4Data.FeedBack,StringFormat='F1'}"       Background="#D0D8E8"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
-                <TextBlock Grid.Row="14"  Grid.Column="1" Text="{Binding MFC5Data.FeedBack,StringFormat='F1'}"       Background="#E9EDF4"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
-                <TextBlock Grid.Row="15"  Grid.Column="1" Text="{Binding MFC6Data.FeedBack,StringFormat='F1'}"       Background="#D0D8E8"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
-                <TextBlock Grid.Row="16"  Grid.Column="1" Text="{Binding MFC7Data.FeedBack,StringFormat='F1'}"       Background="#E9EDF4"  TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
-                <TextBlock Grid.Row="17"  Grid.Column="1" Text="{Binding MFC8Data.FeedBack,StringFormat='F1'}"       Background="#D0D8E8"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
-                <TextBlock Grid.Row="18"  Grid.Column="1" Text="{Binding ESCHVOutputVoltage}"          Background="#E9EDF4"  TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center" />
-                <TextBlock Grid.Row="19"  Grid.Column="1" Text="{Binding ChillerTemperature,StringFormat='F1'}"        Background="#D0D8E8"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
-                <TextBlock Grid.Row="20"  Grid.Column="1" Text="{Binding ESCHePressure,StringFormat='F1'}"       Background="#E9EDF4"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
-                <TextBlock Grid.Row="21"  Grid.Column="1" Text="{Binding MFCHeData.FeedBack,StringFormat='F1'}"       Background="#D0D8E8"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
+                <TextBlock Grid.Row="18"   Text="ESC Clamp Voltage"          Background="#E9EDF4"  Padding="10,5,0,0"  />
+                <TextBlock Grid.Row="19"   Text="Esc Temperature"        Background="#D0D8E8"  Padding="10,5,0,0" />
+                <TextBlock Grid.Row="20"  Text="Helium Pressure"       Background="#E9EDF4"    Padding="10,5,0,0"/>
+                <TextBlock Grid.Row="21"   Text="Helium Flow"       Background="#D0D8E8"    Padding="10,5,0,0" />
+
+                <TextBlock Grid.Row="1" Grid.Column="1"  Text="{Binding SRfForwardPowerFeedBack}"           Background="#D0D8E8"   TextBlock.TextAlignment="Center"    Block.TextAlignment="Center" Padding="0,5,0,0"/>
+                <TextBlock Grid.Row="2"  Grid.Column="1" Text="{Binding SRfReflectPower}"           Background="#E9EDF4"   TextBlock.TextAlignment="Center" Padding="0,5,0,0" Block.TextAlignment="Center"/>
+                <TextBlock Grid.Row="3"  Grid.Column="1" Text="{Binding BRfForwardPowerFeedBack}"           Background="#D0D8E8"   TextBlock.TextAlignment="Center" Padding="0,5,0,0" Block.TextAlignment="Center"/>
+                <TextBlock Grid.Row="4"  Grid.Column="1" Text="{Binding BRfReflectPower}"           Background="#E9EDF4"   TextBlock.TextAlignment="Center" Padding="0,5,0,0" Block.TextAlignment="Center"/>
+                <TextBlock Grid.Row="5"  Grid.Column="1" Text="{Binding BiasMatchC1}"           Background="#D0D8E8"   TextBlock.TextAlignment="Center" Padding="0,5,0,0" Block.TextAlignment="Center"/>
+                <TextBlock Grid.Row="6"  Grid.Column="1" Text="{Binding BiasMatchC2}"           Background="#E9EDF4"  TextBlock.TextAlignment="Center" Padding="0,5,0,0" Block.TextAlignment="Center"/>
+                <TextBlock Grid.Row="7"  Grid.Column="1" Text="N/A"           Background="#D0D8E8"   TextBlock.TextAlignment="Center" Padding="0,5,0,0" Block.TextAlignment="Center"/>
+                <TextBlock Grid.Row="8"  Grid.Column="1" Text="{Binding ChamberPressureFeedBack}"       Background="#E9EDF4"   TextBlock.TextAlignment="Center" Padding="0,5,0,0" Block.TextAlignment="Center"/>
+                <TextBlock Grid.Row="9"  Grid.Column="1" Text="{Binding PositionValue}"       Background="#D0D8E8"   TextBlock.TextAlignment="Center" Padding="0,5,0,0" Block.TextAlignment="Center"/>
+                <TextBlock Grid.Row="10"  Grid.Column="1" Text="{Binding MFC1Data.FeedBack,StringFormat='F1'}"      Background="#E9EDF4"   TextBlock.TextAlignment="Center" Padding="0,5,0,0" Block.TextAlignment="Center"/>
+                <TextBlock Grid.Row="11"  Grid.Column="1" Text="{Binding MFC2Data.FeedBack,StringFormat='F1'}"      Background="#D0D8E8"   TextBlock.TextAlignment="Center" Padding="0,5,0,0" Block.TextAlignment="Center"/>
+                <TextBlock Grid.Row="12"  Grid.Column="1" Text="{Binding MFC3Data.FeedBack,StringFormat='F1'}"       Background="#E9EDF4"   TextBlock.TextAlignment="Center" Padding="0,5,0,0" Block.TextAlignment="Center"/>
+                <TextBlock Grid.Row="13"  Grid.Column="1" Text="{Binding MFC4Data.FeedBack,StringFormat='F1'}"       Background="#D0D8E8"   TextBlock.TextAlignment="Center" Padding="0,5,0,0" Block.TextAlignment="Center"/>
+                <TextBlock Grid.Row="14"  Grid.Column="1" Text="{Binding MFC5Data.FeedBack,StringFormat='F1'}"       Background="#E9EDF4"   TextBlock.TextAlignment="Center" Padding="0,5,0,0" Block.TextAlignment="Center"/>
+                <TextBlock Grid.Row="15"  Grid.Column="1" Text="{Binding MFC6Data.FeedBack,StringFormat='F1'}"       Background="#D0D8E8"   TextBlock.TextAlignment="Center" Padding="0,5,0,0" Block.TextAlignment="Center"/>
+                <TextBlock Grid.Row="16"  Grid.Column="1" Text="{Binding MFC7Data.FeedBack,StringFormat='F1'}"       Background="#E9EDF4"  TextBlock.TextAlignment="Center" Padding="0,5,0,0" Block.TextAlignment="Center"/>
+                <TextBlock Grid.Row="17"  Grid.Column="1" Text="{Binding MFC8Data.FeedBack,StringFormat='F1'}"       Background="#D0D8E8"   TextBlock.TextAlignment="Center" Padding="0,5,0,0" Block.TextAlignment="Center"/>
+                <TextBlock Grid.Row="18"  Grid.Column="1" Text="{Binding ESCHVOutputVoltage}"          Background="#E9EDF4"  TextBlock.TextAlignment="Center" Padding="0,5,0,0" Block.TextAlignment="Center" />
+                <TextBlock Grid.Row="19"  Grid.Column="1" Text="{Binding ChillerTemperature,StringFormat='F1'}"        Background="#D0D8E8"   TextBlock.TextAlignment="Center" Padding="0,5,0,0" Block.TextAlignment="Center"/>
+                <TextBlock Grid.Row="20"  Grid.Column="1" Text="{Binding ESCHePressure,StringFormat='F1'}"       Background="#E9EDF4"   TextBlock.TextAlignment="Center" Padding="0,5,0,0" Block.TextAlignment="Center"/>
+                <TextBlock Grid.Row="21"  Grid.Column="1" Text="{Binding MFCHeData.FeedBack,StringFormat='F1'}"       Background="#D0D8E8"   TextBlock.TextAlignment="Center" Padding="0,5,0,0" Block.TextAlignment="Center"/>
 
                 <TextBlock Grid.Row="1" Grid.Column="2"  Text="{Binding CurrentRecipeStep.LstUnit[1].RFPower}"          Background="#D0D8E8"   TextBlock.TextAlignment="Center"    Block.TextAlignment="Center" Padding="0,6,0,0"/>
-                <TextBlock Grid.Row="2"  Grid.Column="2" Text="{Binding CurrentRecipeStep.LstUnit[1].MaxReflectedPower}"           Background="#E9EDF4"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
-                <TextBlock Grid.Row="3"  Grid.Column="2" Text="{Binding CurrentRecipeStep.LstUnit[2].BiasRFPower}"           Background="#D0D8E8"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
-                <TextBlock Grid.Row="4"  Grid.Column="2" Text="{Binding CurrentRecipeStep.LstUnit[2].BiasMaxReflectedPower}"           Background="#E9EDF4"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
-                <TextBlock Grid.Row="5"  Grid.Column="2" Text="{Binding CurrentRecipeStep.LstUnit[2].BiasTuneCapPreset}"           Background="#D0D8E8"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
-                <TextBlock Grid.Row="6"  Grid.Column="2" Text="{Binding CurrentRecipeStep.LstUnit[2].BiasLoadCapPreset}"           Background="#E9EDF4"  TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
-                <TextBlock Grid.Row="7"  Grid.Column="2" Text=""           Background="#D0D8E8"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
+                <TextBlock Grid.Row="2"  Grid.Column="2" Text="{Binding CurrentRecipeStep.LstUnit[1].MaxReflectedPower}"           Background="#E9EDF4"   TextBlock.TextAlignment="Center" Padding="0,5,0,0" Block.TextAlignment="Center"/>
+                <TextBlock Grid.Row="3"  Grid.Column="2" Text="{Binding CurrentRecipeStep.LstUnit[2].BiasRFPower}"           Background="#D0D8E8"   TextBlock.TextAlignment="Center" Padding="0,5,0,0" Block.TextAlignment="Center"/>
+                <TextBlock Grid.Row="4"  Grid.Column="2" Text="N/A"           Background="#E9EDF4"   TextBlock.TextAlignment="Center" Padding="0,5,0,0" Block.TextAlignment="Center"/>
+                <TextBlock Grid.Row="5"  Grid.Column="2" Text="{Binding CurrentRecipeStep.LstUnit[2].BiasTuneCapPreset}"           Background="#D0D8E8"   TextBlock.TextAlignment="Center" Padding="0,5,0,0" Block.TextAlignment="Center"/>
+                <TextBlock Grid.Row="6"  Grid.Column="2" Text="{Binding CurrentRecipeStep.LstUnit[2].BiasLoadCapPreset}"           Background="#E9EDF4"  TextBlock.TextAlignment="Center" Padding="0,5,0,0" Block.TextAlignment="Center"/>
+                <TextBlock Grid.Row="7"  Grid.Column="2" Text="N/A"           Background="#D0D8E8"   TextBlock.TextAlignment="Center" Padding="0,5,0,0" Block.TextAlignment="Center"/>
                 <TextBlock Grid.Row="8"  Grid.Column="2" Text=""       Background="#E9EDF4"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
                 <TextBlock Grid.Row="9"  Grid.Column="2" Text=""       Background="#D0D8E8"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
                 <TextBlock Grid.Row="10"  Grid.Column="2" Text="{Binding CurrentRecipeStep.LstUnit[3].Gas1}"       Background="#E9EDF4"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>

+ 241 - 1
Venus/Venus_MainPages/Views/RFCalibrationView.xaml

@@ -4,9 +4,249 @@
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
              xmlns:local="clr-namespace:Venus_MainPages.Views"
+             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
+             xmlns:deviceControl="clr-namespace:Aitex.Core.UI.DeviceControl;assembly=MECF.Framework.UI.Core"
+             xmlns:prism="http://prismlibrary.com/"
+             prism:ViewModelLocator.AutoWireViewModel="True"
+             xmlns:controls="http://OpenSEMI.Ctrlib.com/presentation"
              mc:Ignorable="d" 
              d:DesignHeight="450" d:DesignWidth="800">
     <Grid>
-            
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition  Width="160"/>
+            <ColumnDefinition Width="900"/>
+            <ColumnDefinition />
+        </Grid.ColumnDefinitions>
+        <DataGrid Grid.Column="0"   HorizontalAlignment="Left" CanUserAddRows="False" AutoGenerateColumns="False" RowHeaderWidth="0"
+                  VirtualizingPanel.IsVirtualizing="True" VirtualizingPanel.VirtualizationMode="Recycling"
+                  SelectedItem="{Binding CurrentSelection}"
+                  ItemsSource="{Binding CalibrationItems}" Margin="0,5,0,0" >
+            <DataGrid.Columns>
+                <DataGridTemplateColumn Header="Name" Width="150">
+                    <DataGridTemplateColumn.CellTemplate>
+                        <DataTemplate>
+                            <TextBlock Text="{Binding DisplayName}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
+                        </DataTemplate>
+                    </DataGridTemplateColumn.CellTemplate>
+                </DataGridTemplateColumn>
+            </DataGrid.Columns>
+        </DataGrid>
+        <Grid Grid.Column="1">
+            <Grid.RowDefinitions>
+                <RowDefinition Height="45"/>
+                <RowDefinition Height="75"/>
+                <RowDefinition Height="15"/>
+                <RowDefinition Height="*"/>
+                <RowDefinition Height="50"/>
+            </Grid.RowDefinitions>
+
+            <Canvas Grid.Row="0">
+                <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,1,1,1" Background="{DynamicResource Table_BG_Title}" Grid.Row="1" Padding="5,1" Height="40" Width="120">
+                    <TextBlock Text="Calibration Item" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="12" FontFamily="Arial" VerticalAlignment="Center"/>
+                </Border>
+
+                <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Row="1" Grid.Column="1" Padding="5,1" Canvas.Left="120" Height="40" Width="250">
+                    <TextBlock Text="{Binding CurrentSelection.DisplayName}" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="12" FontFamily="Arial" VerticalAlignment="Center"/>
+                </Border>
+
+
+                <Button Content="Save" Grid.Column="1" Width="70" Height="30"  Margin="0" Padding="0" Canvas.Left="385" Canvas.Top="4" IsEnabled="{Binding IsSaveEnable}" >
+                    <!--<i:Interaction.Triggers>
+                        <i:EventTrigger EventName="Click">
+                            <cal:ActionMessage MethodName="Save">
+                            </cal:ActionMessage>
+                        </i:EventTrigger>
+                    </i:Interaction.Triggers>-->
+                </Button>
+
+                <Button Content="Reload" Grid.Column="1" Width="70" Height="30"  Margin="0" Padding="0" Canvas.Left="473" Canvas.Top="4" >
+                    <!--<i:Interaction.Triggers>
+                        <i:EventTrigger EventName="Click">
+                            <cal:ActionMessage MethodName="Reload">
+                            </cal:ActionMessage>
+                        </i:EventTrigger>
+                    </i:Interaction.Triggers>-->
+                </Button>
+
+                <Button Content="Export" Grid.Column="1" Width="70" Height="30" Padding="0" Canvas.Left="561" Canvas.Top="4" HorizontalAlignment="Left" VerticalAlignment="Center" >
+                    <!--<i:Interaction.Triggers>
+                        <i:EventTrigger EventName="Click">
+                            <cal:ActionMessage MethodName="Export">
+                            </cal:ActionMessage>
+                        </i:EventTrigger>
+                    </i:Interaction.Triggers>-->
+                </Button>
+
+                <deviceControl:AITRfGenerator DeviceData="{Binding CurrentSelectionRF}" Canvas.Left="662" Canvas.Top="10" HorizontalAlignment="Left" VerticalAlignment="Center" ></deviceControl:AITRfGenerator>
+
+            </Canvas>
+
+            <Canvas Grid.Row="1">
+                <Border BorderBrush="{DynamicResource Table_BD}" Background="{DynamicResource Table_BG_Content}" BorderThickness="1,1,1,1" Padding="5,1" >
+                    <StackPanel HorizontalAlignment="Center" VerticalAlignment="Top" Margin="5,10">
+                        <Grid>
+                            <Grid.ColumnDefinitions>
+                                <ColumnDefinition Width="140"/>
+                                <ColumnDefinition Width="100"/>
+                                <ColumnDefinition Width="140"/>
+                                <ColumnDefinition Width="100"/>
+                                <ColumnDefinition Width="160"/>
+                                <ColumnDefinition Width="100"/>
+                            </Grid.ColumnDefinitions>
+                            <Grid.RowDefinitions>
+                                <RowDefinition Height="24"/>
+                                <RowDefinition Height="24"/>
+                            </Grid.RowDefinitions>
+                            <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1" Background="{DynamicResource Table_BG_Title}" Grid.Row="0" Padding="5,1">
+                                <TextBlock Text="RF电源序列号" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="12" FontFamily="Arial" VerticalAlignment="Center"/>
+                            </Border>
+                            <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Row="0" Grid.Column="1" Padding="5,1">
+                                <controls:TextBoxEx Text="{Binding Path=GeneratorSerialNumber,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center"/>
+                            </Border>
+                            <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Title}" Grid.Row="1" Padding="5,1">
+                                <TextBlock Text="SensorHead序列号" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="12" FontFamily="Arial" VerticalAlignment="Center"/>
+                            </Border>
+                            <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Row="1" Grid.Column="1" Padding="5,1">
+                                <controls:TextBoxEx Text="{Binding Path=SensorSerialNumber,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"  VerticalAlignment="Center"/>
+                            </Border>
+                            <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Title}" Grid.Row="0" Grid.Column="2" Padding="5,1">
+                                <TextBlock Text="RF Physical Max Power" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="12" FontFamily="Arial" VerticalAlignment="Center"/>
+                            </Border>
+                            <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Row="0" Grid.Column="3" Padding="5,1">
+                                <TextBlock Text="{Binding Path=RFPhysicalMaxPower,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center"/>
+                            </Border>
+                            <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Title}" Grid.Row="1" Grid.Column="2" Padding="5,1">
+                                <TextBlock Text="Current RF Max Power" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="12" FontFamily="Arial" VerticalAlignment="Center"/>
+                            </Border>
+                            <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Row="1" Grid.Column="3" Padding="5,1">
+                                <TextBlock Text="{Binding Path=CurrentRFMaxPower,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center"/>
+                            </Border>
+                            <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Title}" Grid.Row="0" Grid.Column="4" Padding="5,1">
+                                <TextBlock Text="RF Calibrated Max Power" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="12" FontFamily="Arial" VerticalAlignment="Center"/>
+                            </Border>
+                            <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Row="0" Grid.Column="5" Padding="5,1">
+                                <TextBlock Text="{Binding Path=RFCalibratedMaxPower,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged, StringFormat=\{0:F3\}}" VerticalAlignment="Center"/>
+                            </Border>
+                        </Grid>
+                    </StackPanel>
+                </Border>
+
+            </Canvas>
+
+            <Canvas Grid.Row="2">
+                <TextBlock Text="Select All:" Canvas.Left="74" Canvas.Top="0"/>
+                <CheckBox   IsEnabled="{Binding IsSelectedAllEnable,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Top" Canvas.Left="143" Canvas.Top="3" Margin="0,-4,0,0">
+                    <i:Interaction.Triggers>
+                        <i:EventTrigger EventName="Checked">
+                            <i:InvokeCommandAction  Command="{Binding CheckCommand}"/>
+
+                        </i:EventTrigger>
+                        <i:EventTrigger EventName="Unchecked">
+                            <i:InvokeCommandAction  Command="{Binding UnCheckCommand}"/>
+
+                        </i:EventTrigger>
+                    </i:Interaction.Triggers>
+                </CheckBox>
+            </Canvas>
+
+            <DataGrid Name="TableData" Grid.Row="3"   HorizontalAlignment="Left" CanUserAddRows="False" AutoGenerateColumns="False" RowHeaderWidth="0" Focusable="True"
+                      VirtualizingPanel.IsVirtualizing="True" VirtualizingPanel.VirtualizationMode="Recycling"
+                      ItemsSource="{Binding TableData}" SelectedIndex="{Binding TableDataSelectedIndex,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}" Margin="0,5,0,0" >
+                <DataGrid.Columns >
+                    <DataGridTemplateColumn Header="SetPoint" Width="100">
+                        <DataGridTemplateColumn.CellTemplate>
+                            <DataTemplate>
+                                <controls:TextBoxEx IsEnabled="{Binding SetPointEnable,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Text="{Binding SetPoint,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" MinValue="-999999" MaxValue="999999" EditBoxMode="Decimal" Width="80" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Center" VerticalAlignment="Center" >
+                                </controls:TextBoxEx>
+                            </DataTemplate>
+                        </DataGridTemplateColumn.CellTemplate>
+                    </DataGridTemplateColumn>
+
+                    <DataGridTemplateColumn Header="Selected" Width="70">
+                        <DataGridTemplateColumn.CellTemplate>
+                            <DataTemplate>
+                                <CheckBox  IsEnabled="{Binding IsSelectedEnable,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"  IsChecked="{Binding IsSelected,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Center" VerticalAlignment="Center" >
+                                </CheckBox>
+                            </DataTemplate>
+                        </DataGridTemplateColumn.CellTemplate>
+                    </DataGridTemplateColumn>
+
+                    <DataGridTemplateColumn Header="Forward Power (UI)" Width="200">
+                        <DataGridTemplateColumn.CellTemplate>
+                            <DataTemplate>
+                                <TextBlock Text="{Binding ForwardPowerUI,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="180" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" >
+                                </TextBlock>
+                            </DataTemplate>
+                        </DataGridTemplateColumn.CellTemplate>
+                    </DataGridTemplateColumn>
+
+                    <DataGridTemplateColumn Header="Forward Power (Meter)" Width="200">
+                        <DataGridTemplateColumn.CellTemplate>
+                            <DataTemplate>
+                                <controls:TextBoxEx Text="{Binding ForwardPowerMeter,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" MinValue="-999999" MaxValue="999999"  EditBoxMode="Decimal"  Width="180" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Center" VerticalAlignment="Center" >
+                                </controls:TextBoxEx>
+                            </DataTemplate>
+                        </DataGridTemplateColumn.CellTemplate>
+                    </DataGridTemplateColumn>
+
+                    <DataGridTemplateColumn Header="Reflected Power (Meter)" Width="200">
+                        <DataGridTemplateColumn.CellTemplate>
+                            <DataTemplate>
+                                <controls:TextBoxEx Text="{Binding ReflectedPower,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" MinValue="-999999" MaxValue="999999" EditBoxMode="Decimal" Width="180" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Center" VerticalAlignment="Center" >
+                                </controls:TextBoxEx>
+                            </DataTemplate>
+                        </DataGridTemplateColumn.CellTemplate>
+                    </DataGridTemplateColumn>
+
+                    <DataGridTemplateColumn Header="%Difference" Width="100">
+                        <DataGridTemplateColumn.CellTemplate>
+                            <DataTemplate>
+                                <Border Background="{Binding DifferenceBackground,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}">
+                                    <TextBlock  Text="{Binding Difference,Mode=OneWay,UpdateSourceTrigger=PropertyChanged, StringFormat=\{0:F3\}}" FontSize="14"  Height="25" HorizontalAlignment="Center" TextAlignment="Center"/>
+                                </Border>
+                            </DataTemplate>
+                        </DataGridTemplateColumn.CellTemplate>
+                    </DataGridTemplateColumn>
+
+                </DataGrid.Columns>
+            </DataGrid>
+
+            <Canvas Grid.Row="4">
+
+                <StackPanel Orientation="Horizontal" IsEnabled="{Binding SystemInManual}">
+
+                    <Button Content="Start" Width="70" Height="30"  Margin="10" Padding="0" Focusable="False">
+                        <!--<i:Interaction.Triggers>
+                            <i:EventTrigger EventName="Click">
+                                <cal:ActionMessage MethodName="Start">
+                                </cal:ActionMessage>
+                            </i:EventTrigger>
+                        </i:Interaction.Triggers>-->
+                    </Button>
+
+                    <Button Content="Next" Width="70" Height="30"  Margin="10" Padding="0" Focusable="False" IsEnabled="{Binding IsNextEnable}">
+                        <!--<i:Interaction.Triggers>
+                            <i:EventTrigger EventName="Click">
+                                <cal:ActionMessage MethodName="Next">
+                                </cal:ActionMessage>
+                            </i:EventTrigger>
+                        </i:Interaction.Triggers>-->
+                    </Button>
+
+                    <Button Content="End" Width="70" Height="30"  Margin="10" Padding="0">
+                        <!--<i:Interaction.Triggers>
+                            <i:EventTrigger EventName="Click">
+                                <cal:ActionMessage MethodName="End">
+                                </cal:ActionMessage>
+                            </i:EventTrigger>
+                        </i:Interaction.Triggers>-->
+                    </Button>
+
+                </StackPanel>
+            </Canvas>
+
+
+        </Grid>
+
     </Grid>
 </UserControl>

+ 3 - 2
Venus/Venus_MainPages/Views/RFCalibrationView.xaml.cs

@@ -1,4 +1,5 @@
-using System;
+using MECF.Framework.Common.Equipment;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -27,7 +28,7 @@ namespace Venus_MainPages.Views
         }
         public void SetSystemName(string systemName)
         {
-          
+            ((this.DataContext) as RFCalibrationViewModel).ModuleName = systemName;
         }
     }
 }

+ 6 - 6
Venus/Venus_MainPages/Views/RecipeView.xaml

@@ -66,22 +66,22 @@
 
         <Grid Grid.Column="0">
             <Grid.RowDefinitions>
-                <RowDefinition Height="60"/>
+                <RowDefinition Height="40"/>
                 <RowDefinition Height="*"/>
             </Grid.RowDefinitions>
             <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1" Background="{DynamicResource Table_BG_Title}" Padding="5,1">
                 <StackPanel VerticalAlignment="Bottom">
                     <StackPanel Orientation="Horizontal">
-                        <Button Content="New" Width="85" Height="30" Style="{StaticResource MiddleButton}" Command="{Binding NewCommand}"/>
-                        <Button Content="Rename" Margin="10,0,0,0" Width="85" Height="30" Style="{StaticResource MiddleButton}" Command="{Binding ReNameCommand}"/>
-                        <Button Content="Delete" Margin="10,0,0,0" Width="85" Height="30" Style="{StaticResource MiddleButton}" Command="{Binding DeleteCommand}"/>
+                        <!--<Button Content="New" Width="85" Height="30" Style="{StaticResource MiddleButton}" Command="{Binding NewCommand}"/>
+                        <Button Content="Rename" Margin="10,0,0,0" Width="85" Height="30" Style="{StaticResource MiddleButton}" Command="{Binding ReNameCommand}"/>-->
+                        <!--<Button Content="Delete" Margin="10,0,0,0" Width="85" Height="30" Style="{StaticResource MiddleButton}" Command="{Binding DeleteCommand}"/>-->
                     </StackPanel>
-                    <TextBlock Text="Recipe List" Margin="5" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Bottom"/>
+                    <TextBlock Text="Recipe List" Margin="5" FontFamily="Arial" FontSize="20" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Center"  VerticalAlignment="Center"/>
                 </StackPanel>
             </Border>
             <Border Grid.Row="1" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1">
                 <TreeView Name="treeViewRcpList" Margin="0,6"  
-                      FontSize="14" BorderThickness="1" BorderBrush="Black" Canvas.Top="140" Canvas.Left="4" Opacity="1" Background="LightSteelBlue"  AllowDrop="True" 
+                      FontSize="18" BorderThickness="1" BorderBrush="Black" Canvas.Top="140" Canvas.Left="4" Opacity="1" Background="LightSteelBlue"  AllowDrop="True" 
                       >
                     <i:Interaction.Triggers>
                         <i:EventTrigger EventName="MouseRightButtonDown">

+ 18 - 2
Venus/Venus_RT/Config/System.sccfg

@@ -279,6 +279,14 @@
 			<config default="3" name="RFTurnOnTimeout" nameView="RF Turn On Timeout" description="" max="10" min="0" paramter="" tag="" unit="S" type="Integer" />
 			<config default="false" name="EnableCalibration" nameView="是否校准" max="" min="" paramter="" tag="" unit="" visible="true" type="Bool" />
 			<config default="100#100;200#200;" name="CalibrationTable" nameView="校准表" max="" min="0" paramter="" tag="" unit="" visible="false" type="String" />
+
+			<config default="" name="GeneratorSerialNumber" nameView="RF电源序列号" max="" min="0" paramter="" tag="" unit="" type="String" />
+			<config default="" name="SensorSerialNumber" nameView="SensorHead序列号" max="" min="0" paramter="" tag="" unit="" type="String" />
+			<config default="2000" name="RFPhysicalMaxPower" nameView="RF Physical Max Power" description="" max="9999" min="0" paramter="" tag="" unit="" type="Double"  visible="false"/>
+			<config default="2000" name="CurrentRFMaxPower" nameView="Current RF Max Power" description="" max="2200" min="1800" paramter="" tag="" unit="" type="Double" />
+			<config default="2000" name="RFCalibratedMaxPower" nameView="RF Calibrated Max Power" description="" max="9999" min="0" paramter="" tag="" unit="" type="Double" />
+			<config default="" name="CalibrationTableDetail" nameView="详细校准表" max="" min="0" paramter="" tag="" unit="" visible="false" type="String" />
+
 		</configs>
 		<configs name="Match" nameView="Source Match" >
 			<config default="false" name="EnableMatch" nameView="Enable Source Match" description="enable match or not" max="1" min="0" tag="" unit="" type="Bool" />
@@ -314,6 +322,14 @@
 			<config default="3000" name="RfPowerAlarmTime" nameView="RF Power Alarm Time" description="" max="10000" min="0" paramter="" tag="" unit="" type="Integer" />
 			<config default="false" name="EnableCalibration" nameView="是否校准" max="" min="" paramter="" tag="" unit="" visible="true" type="Bool" />
 			<config default="100#100;200#200;" name="CalibrationTable" nameView="校准表" max="" min="0" paramter="" tag="" unit="" visible="false" type="String" />
+
+			<config default="" name="GeneratorSerialNumber" nameView="RF电源序列号" max="" min="0" paramter="" tag="" unit="" type="String" />
+			<config default="" name="SensorSerialNumber" nameView="SensorHead序列号" max="" min="0" paramter="" tag="" unit="" type="String" />
+			<config default="2000" name="RFPhysicalMaxPower" nameView="RF Physical Max Power" description="" max="9999" min="0" paramter="" tag="" unit="" type="Double"  visible="false"/>
+			<config default="2000" name="CurrentRFMaxPower" nameView="Current RF Max Power" description="" max="2200" min="1800" paramter="" tag="" unit="" type="Double" />
+			<config default="2000" name="RFCalibratedMaxPower" nameView="RF Calibrated Max Power" description="" max="9999" min="0" paramter="" tag="" unit="" type="Double" />
+			<config default="" name="CalibrationTableDetail" nameView="详细校准表" max="" min="0" paramter="" tag="" unit="" visible="false" type="String" />
+
 		</configs>
 		<configs name="BiasMatch" nameView="Bias Match" >
 			<config default="false" name="EnableBiasMatch" nameView="Enable Bias Match" description="enable bias match or not" max="1" min="0" tag="" unit="" type="Bool" />
@@ -454,7 +470,7 @@
 			<config default="10" name="MfcWarningRange" nameView="MFC Warning Range" description="" max="200" min="0" paramter="" tag="" unit="sccm" type="Integer" />
 			<config default="10" name="MfcWarningTime" nameView="MFC Warning Time" description="" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
 		</configs>
-		<configs name="Pump" nameView="Pump" >
+		<configs name="Pump" nameView="Pump">
 			<config default="30" name="LeakRate" nameView="Leak Rate" description="" max="756000" min="0" paramter="" tag="" unit="mTorrPerMin" type="Double" />
 			<config default="300" name="LeakCheckPumpingTime" nameView="Leak Check Pumping Time" description="" max="3000" min="0" paramter="" tag="" unit="" type="Integer" />
 			<config default="180" name="LeakCheckHoldTime" nameView="Leak Check Hold Time" description="" max="3000" min="0" paramter="" tag="" unit="" type="Integer" />
@@ -464,7 +480,7 @@
 			<config default="120" name="PumpTimeLimit" nameView="Pump Time Limit" description="" max="3000" min="0" paramter="" tag="" unit="" type="Double" />
 			<config default="5" name="PumpValveDelay" nameView="Pump Valve Delay" description="" max="3000" min="0" paramter="" tag="" unit="s" type="Integer" />
 			<config default="75" name="RoughPumpDownPressure" description="PM Rough Pumping Pressure" max="200" min="0" paramter="" tag="" unit="Torr" type="Integer" />
-			<config default="200" name="PumpVHe2FlowPressure" nameView="He2 Flow Pressure" description="" max="756000" min="0" paramter="" tag="" unit="mTorr" type="Integer" />
+			<config default="200" name="PumpVHe2FlowPressure" nameView="He2 Flow Pressure" description="" max="400" min="0" paramter="" tag="" unit="mTorr" type="Integer" />
 			<config default="100" name="LoadLockPumpBasePressure" description="LoadLock Pump Base Pressure" max="756000" min="0" paramter="" tag="" unit="mTorr" type="Integer" />
 			<config default="120" name="LoadLockPumpTimeLimit" description="LoadLock Pump Time Limit" max="3000" min="0" paramter="" tag="" unit="second" type="Integer" />
 			<config default="10" name="LoadLockPurgeVentPressure" description="LoadLock Purge Vent Pressure" max="760" min="0" paramter="" tag="" unit="Torr" type="Integer" />

+ 16 - 16
Venus/Venus_RT/Modules/PMs/LLPickRoutine.cs

@@ -53,22 +53,22 @@ namespace Venus_RT.Modules.PMs
                 return RState.Failed;
             }
 
-            //if (_isATMMode)
-            //{
-            //    if (!_chamber.IsATM || !_chamber.IsATMLoadlock)
-            //    {
-            //        Stop("腔体非大气状态,请先执行充气动作");
-            //        return RState.Failed;
-            //    }
-            //}
-            //else
-            //{
-            //    if (!_chamber.IsVAC || !_chamber.IsVACLoadLock)
-            //    {
-            //        Stop("腔体非真空状态,请先执行抽真空动作");
-            //        return RState.Failed;
-            //    }
-            //}
+            if (_isATMMode)
+            {
+                if (!_chamber.IsATM || !_chamber.IsATMLoadlock)
+                {
+                    Stop("腔体非大气状态,请先执行充气动作");
+                    return RState.Failed;
+                }
+            }
+            else
+            {
+                if (!_chamber.IsVAC || !_chamber.IsVACLoadLock)
+                {
+                    Stop("腔体非真空状态,请先执行抽真空动作");
+                    return RState.Failed;
+                }
+            }
 
             _chamber.OpenValve(ValveType.FastPump, false);
             _chamber.OpenValve(ValveType.LoadlockPumping, false);

+ 16 - 16
Venus/Venus_RT/Modules/PMs/LLPlaceRoutine.cs

@@ -46,22 +46,22 @@ namespace Venus_RT.Modules.PMs
                 return RState.Failed;
             }
 
-            //if (_isATMMode)
-            //{
-            //    if(!_chamber.IsATM || !_chamber.IsATMLoadlock)
-            //    {
-            //        Stop("腔体非大气状态,请先执行充气动作");
-            //        return RState.Failed;
-            //    }
-            //}
-            //else
-            //{
-            //    if(!_chamber.IsVAC || !_chamber.IsVACLoadLock)
-            //    {
-            //        Stop("腔体非真空状态,请先执行抽真空动作");
-            //        return RState.Failed;
-            //    }
-            //}
+            if (_isATMMode)
+            {
+                if (!_chamber.IsATM || !_chamber.IsATMLoadlock)
+                {
+                    Stop("腔体非大气状态,请先执行充气动作");
+                    return RState.Failed;
+                }
+            }
+            else
+            {
+                if (!_chamber.IsVAC || !_chamber.IsVACLoadLock)
+                {
+                    Stop("腔体非真空状态,请先执行抽真空动作");
+                    return RState.Failed;
+                }
+            }
 
             _chamber.OpenValve(ValveType.FastPump, false);
             _chamber.OpenValve(ValveType.LoadlockPumping, false);

+ 2 - 2
Venus/Venus_Themes/UserControls/DrawGraphicsControl.xaml

@@ -7,9 +7,9 @@
              mc:Ignorable="d" 
              d:DesignHeight="450" d:DesignWidth="800">
     <Grid>
-        <Canvas x:Name="Canvas_Main" SizeChanged="Canvas_Main_SizeChanged" MouseWheel="Canvas_Main_MouseWheel" MouseLeftButtonDown="Canvas_Main_MouseLeftButtonDown" MouseMove="Canvas_Main_MouseMove" MouseLeftButtonUp="Canvas_Main_MouseLeftButtonUp" MouseEnter="Canvas_Main_MouseEnter" MouseLeave="Canvas_Main_MouseLeave" MouseRightButtonUp="Canvas_Main_MouseRightButtonUp">
+        <Canvas x:Name="Canvas_Main"  SizeChanged="Canvas_Main_SizeChanged" MouseWheel="Canvas_Main_MouseWheel" MouseLeftButtonDown="Canvas_Main_MouseLeftButtonDown" MouseMove="Canvas_Main_MouseMove" MouseLeftButtonUp="Canvas_Main_MouseLeftButtonUp" MouseEnter="Canvas_Main_MouseEnter" MouseLeave="Canvas_Main_MouseLeave" MouseRightButtonUp="Canvas_Main_MouseRightButtonUp">
             <Canvas.Background>
-                <ImageBrush x:Name="ImageBrush_BK" Stretch="Fill"/>
+                <ImageBrush x:Name="ImageBrush_BK" Stretch="Fill" />
             </Canvas.Background>
         </Canvas>
     </Grid>

+ 124 - 120
Venus/Venus_Themes/UserControls/DrawGraphicsControl.xaml.cs

@@ -503,6 +503,124 @@ namespace Venus_Themes.UserControls
                 graphics.DrawLine(m_PenLine, new PointF((float)m_StartDrawLineX, (float)(Canvas_Main.ActualHeight - 50)), new PointF((float)Canvas_Main.ActualWidth, (float)(Canvas_Main.ActualHeight - 50)));
                 graphics.DrawLine(m_PenLine, new PointF((float)Canvas_Main.ActualWidth - 1, 0), new PointF((float)Canvas_Main.ActualWidth - 1, (float)(Canvas_Main.ActualHeight - 50)));
 
+               
+
+                if (this.PlotDataPoints != null && this.PlotDataPoints.Count > 0)
+                {
+                    List<PointF> points = new List<PointF>();
+                    for (int i = 0; i < PlotDataPoints.Count; i++)
+                    {
+                        if (PlotDataPoints[i].X >= m_WavePlotX && PlotDataPoints[i].X <= m_WavePlotX + m_WavePlotWidth)
+                        {
+                            double StartX = m_StartDrawLineX + (Canvas_Main.ActualWidth - m_StartDrawLineX) / m_WavePlotWidth * (PlotDataPoints[i].X - m_WavePlotX);
+                            if (StartX < m_StartDrawLineX || PlotDataPoints[i].X < m_WavePlotX) StartX = m_StartDrawLineX;
+                            if (StartX > Canvas_Main.ActualWidth || PlotDataPoints[i].X > m_WavePlotX + m_WavePlotWidth) StartX = Canvas_Main.ActualWidth;
+                            double StartY = Canvas_Main.ActualHeight - 50 - (Canvas_Main.ActualHeight - 50.0) / m_WavePlotHeight * (PlotDataPoints[i].Y - m_WavePlotY);
+                            if (StartY < 0 || PlotDataPoints[i].Y > m_WavePlotY + m_WavePlotHeight) StartY = 0;
+                            if (StartY > Canvas_Main.ActualHeight - 50 || PlotDataPoints[i].Y < m_WavePlotY) StartY = Canvas_Main.ActualHeight - 50;
+                            points.Add(new PointF((float)StartX, (float)StartY));
+                        }
+                        if (m_WavePlotMinX == double.MaxValue || m_WavePlotMinX > PlotDataPoints[i].X) m_WavePlotMinX = PlotDataPoints[i].X;
+                        if (m_WavePlotMaxX == double.MinValue || m_WavePlotMaxX < PlotDataPoints[i].X) m_WavePlotMaxX = PlotDataPoints[i].X;
+                        if (m_WavePlotMinY == double.MaxValue || m_WavePlotMinY > PlotDataPoints[i].Y) m_WavePlotMinY = PlotDataPoints[i].Y;
+                        if (m_WavePlotMaxY == double.MinValue || m_WavePlotMaxY < PlotDataPoints[i].Y) m_WavePlotMaxY = PlotDataPoints[i].Y;
+                    }
+                    if (points.Count > 1 && points.Where(_ => float.IsNaN(_.X) || float.IsNaN(_.Y)).ToList<PointF>().Count == 0) graphics.DrawLines(m_PenData, points.ToArray());
+                }
+                if (this.PlotSDataPoints != null && this.PlotSDataPoints.Count > 0)
+                {
+                    List<PointF> points = new List<PointF>();
+                    for (int i = 0; i < PlotSDataPoints.Count; i++)
+                    {
+                        if (PlotSDataPoints[i].X >= m_WavePlotX && PlotSDataPoints[i].X <= m_WavePlotX + m_WavePlotWidth)
+                        {
+                            double StartX = 50 + (Canvas_Main.ActualWidth - m_StartDrawLineX) / m_WavePlotWidth * (PlotSDataPoints[i].X - m_WavePlotX);
+                            if (StartX < m_StartDrawLineX || PlotSDataPoints[i].X < m_WavePlotX) StartX = m_StartDrawLineX;
+                            if (StartX > Canvas_Main.ActualWidth || PlotSDataPoints[i].X > m_WavePlotX + m_WavePlotWidth) StartX = Canvas_Main.ActualWidth;
+                            double StartY = Canvas_Main.ActualHeight - 50 - (Canvas_Main.ActualHeight - 50.0) / m_WavePlotHeight * (PlotSDataPoints[i].Y - m_WavePlotY);
+                            if (StartY < 0 || PlotSDataPoints[i].Y > m_WavePlotY + m_WavePlotHeight) StartY = 0;
+                            if (StartY > Canvas_Main.ActualHeight - 50 || PlotSDataPoints[i].Y < m_WavePlotY) StartY = Canvas_Main.ActualHeight - 50;
+                            points.Add(new PointF((float)StartX, (float)StartY));
+                        }
+                        if (double.IsNaN(m_WavePlotMinX) || m_WavePlotMinX > PlotSDataPoints[i].X) m_WavePlotMinX = PlotSDataPoints[i].X;
+                        if (double.IsNaN(m_WavePlotMaxX) || m_WavePlotMaxX < PlotSDataPoints[i].X) m_WavePlotMaxX = PlotSDataPoints[i].X;
+                        if (double.IsNaN(m_WavePlotMinY) || m_WavePlotMinY > PlotSDataPoints[i].Y) m_WavePlotMinY = PlotSDataPoints[i].Y;
+                        if (double.IsNaN(m_WavePlotMaxY) || m_WavePlotMaxY < PlotSDataPoints[i].Y) m_WavePlotMaxY = PlotSDataPoints[i].Y;
+                    }
+                    if (points.Count > 1 && points.Where(_ => float.IsNaN(_.X) || float.IsNaN(_.Y)).ToList<PointF>().Count == 0) graphics.DrawLines(m_PenSData, points.ToArray());
+                }
+                if (this.PlotASDataPoints != null && this.PlotASDataPoints.Count > 0)
+                {
+                    List<PointF> points = new List<PointF>();
+                    for (int i = 0; i < PlotASDataPoints.Count; i++)
+                    {
+                        if (PlotASDataPoints[i].X >= m_WavePlotX && PlotASDataPoints[i].X <= m_WavePlotX + m_WavePlotWidth)
+                        {
+                            double StartX = m_StartDrawLineX + (Canvas_Main.ActualWidth - m_StartDrawLineX) / m_WavePlotWidth * (PlotASDataPoints[i].X - m_WavePlotX);
+                            if (StartX < m_StartDrawLineX || PlotASDataPoints[i].X < m_WavePlotX) StartX = m_StartDrawLineX;
+                            if (StartX > Canvas_Main.ActualWidth || PlotASDataPoints[i].X > m_WavePlotX + m_WavePlotWidth) StartX = Canvas_Main.ActualWidth;
+                            double StartY = Canvas_Main.ActualHeight - 50 - (Canvas_Main.ActualHeight - 50.0) / m_WavePlotHeight * (PlotASDataPoints[i].Y - m_WavePlotY);
+                            if (StartY < 0 || PlotASDataPoints[i].Y > m_WavePlotY + m_WavePlotHeight) StartY = 0;
+                            if (StartY > Canvas_Main.ActualHeight - 50 || PlotASDataPoints[i].Y < m_WavePlotY) StartY = Canvas_Main.ActualHeight - 50;
+                            points.Add(new PointF((float)StartX, (float)StartY));
+                        }
+                        if (m_WavePlotMinX == double.MaxValue || m_WavePlotMinX > PlotASDataPoints[i].X) m_WavePlotMinX = PlotASDataPoints[i].X;
+                        if (m_WavePlotMaxX == double.MinValue || m_WavePlotMaxX < PlotASDataPoints[i].X) m_WavePlotMaxX = PlotASDataPoints[i].X;
+                        if (m_WavePlotMinY == double.MaxValue || m_WavePlotMinY > PlotASDataPoints[i].Y) m_WavePlotMinY = PlotASDataPoints[i].Y;
+                        if (m_WavePlotMaxY == double.MinValue || m_WavePlotMaxY < PlotASDataPoints[i].Y) m_WavePlotMaxY = PlotASDataPoints[i].Y;
+                    }
+                    if (points.Count > 1 && points.Where(_ => float.IsNaN(_.X) || float.IsNaN(_.Y)).ToList<PointF>().Count == 0) graphics.DrawLines(m_PenASData, points.ToArray());
+                }
+                if (this.Points != null && this.Points.Count > 0)
+                {
+                    List<PointF> points = new List<PointF>();
+                    for (int i = 0; i < Points.Count; i++)
+                    {
+                        if (Points[i].X >= m_WavePlotX && Points[i].X <= m_WavePlotX + m_WavePlotWidth)
+                        {
+                            double StartX = m_StartDrawLineX + (Canvas_Main.ActualWidth - m_StartDrawLineX) / m_WavePlotWidth * (Points[i].X - m_WavePlotX);
+                            if (StartX < m_StartDrawLineX || Points[i].X < m_WavePlotX) StartX = m_StartDrawLineX;
+                            if (StartX > Canvas_Main.ActualWidth || Points[i].X > m_WavePlotX + m_WavePlotWidth) StartX = Canvas_Main.ActualWidth;
+                            double StartY = Canvas_Main.ActualHeight - 50 - (Canvas_Main.ActualHeight - 50.0) / m_WavePlotHeight * (Points[i].Y - m_WavePlotY);
+                            if (StartY < 0 || Points[i].Y > m_WavePlotY + m_WavePlotHeight) StartY = 0;
+                            if (StartY > Canvas_Main.ActualHeight - 50 || Points[i].Y < m_WavePlotY) StartY = Canvas_Main.ActualHeight - 50;
+                            points.Add(new PointF((float)StartX, (float)StartY));
+                        }
+                        if (m_WavePlotMinX == double.MaxValue || m_WavePlotMinX > Points[i].X) m_WavePlotMinX = Points[i].X;
+                        if (m_WavePlotMaxX == double.MinValue || m_WavePlotMaxX < Points[i].X) m_WavePlotMaxX = Points[i].X;
+                        if (m_WavePlotMinY == double.MaxValue || m_WavePlotMinY > Points[i].Y) m_WavePlotMinY = Points[i].Y;
+                        if (m_WavePlotMaxY == double.MinValue || m_WavePlotMaxY < Points[i].Y) m_WavePlotMaxY = Points[i].Y;
+                    }
+                    if (points.Count > 1 && points.Where(_ => float.IsNaN(_.X) || float.IsNaN(_.Y)).ToList<PointF>().Count == 0) graphics.DrawLines(m_PenData, points.ToArray());
+                }
+                if (this.PointCollections != null && this.PointCollections.Count > 0)
+                {
+                    for (int i = 0; i < this.PointCollections.Count; i++)
+                    {
+                        List<PointF> points = new List<PointF>();
+                        for (int j = 0; j < this.PointCollections[i].Count; j++)
+                        {
+                            if (this.PointCollections[i][j].X >= m_WavePlotX && this.PointCollections[i][j].X <= m_WavePlotX + m_WavePlotWidth)
+                            {
+                                double StartX = m_StartDrawLineX + (Canvas_Main.ActualWidth - m_StartDrawLineX) / m_WavePlotWidth * (this.PointCollections[i][j].X - m_WavePlotX);
+                                if (StartX < m_StartDrawLineX || this.PointCollections[i][j].X < m_WavePlotX) StartX = m_StartDrawLineX;
+                                if (StartX > Canvas_Main.ActualWidth || this.PointCollections[i][j].X > m_WavePlotX + m_WavePlotWidth) StartX = Canvas_Main.ActualWidth;
+                                double StartY = Canvas_Main.ActualHeight - 50 - (Canvas_Main.ActualHeight - 50.0) / m_WavePlotHeight * (this.PointCollections[i][j].Y - m_WavePlotY);
+                                if (StartY < 0 || this.PointCollections[i][j].Y > m_WavePlotY + m_WavePlotHeight) StartY = 0;
+                                if (StartY > Canvas_Main.ActualHeight - 50 || this.PointCollections[i][j].Y < m_WavePlotY) StartY = Canvas_Main.ActualHeight - 50;
+                                points.Add(new PointF((float)StartX, (float)StartY));
+                            }
+                            if (m_WavePlotMinX == double.MaxValue || m_WavePlotMinX > this.PointCollections[i][j].X) m_WavePlotMinX = this.PointCollections[i][j].X;
+                            if (m_WavePlotMaxX == double.MinValue || m_WavePlotMaxX < this.PointCollections[i][j].X) m_WavePlotMaxX = this.PointCollections[i][j].X;
+                            if (m_WavePlotMinY == double.MaxValue || m_WavePlotMinY > this.PointCollections[i][j].Y) m_WavePlotMinY = this.PointCollections[i][j].Y;
+                            if (m_WavePlotMaxY == double.MinValue || m_WavePlotMaxY < this.PointCollections[i][j].Y) m_WavePlotMaxY = this.PointCollections[i][j].Y;
+                        }
+                        if (points.Count > 1 && points.Where(_ => float.IsNaN(_.X) || float.IsNaN(_.Y)).ToList<PointF>().Count == 0)
+                        {
+                            graphics.DrawLines(m_PenCollencteions[i % 10], points.ToArray());
+                        }
+                    }
+                }
                 //框选
                 if (m_StartMouseMove && m_MouseMove)
                 {
@@ -513,8 +631,9 @@ namespace Venus_Themes.UserControls
                         int width = (int)Math.Abs(m_EndPoint.X - m_StartPoint.X);
                         int height = (int)Math.Abs(m_EndPoint.Y - m_StartPoint.Y);
                         System.Drawing.Rectangle rectangle = new System.Drawing.Rectangle(x, y, width, height);
+                        
                         graphics.FillRectangle(System.Drawing.Brushes.LightGray, rectangle);
-                        graphics.DrawRectangle(m_PenBlue, rectangle);
+                        graphics.DrawRectangle(new System.Drawing.Pen (System.Drawing.Color.Transparent), rectangle);
                     }
                 }
                 else
@@ -664,124 +783,6 @@ namespace Venus_Themes.UserControls
                         }
                     }
                 }
-
-                if (this.PlotDataPoints != null && this.PlotDataPoints.Count > 0)
-                {
-                    List<PointF> points = new List<PointF>();
-                    for (int i = 0; i < PlotDataPoints.Count; i++)
-                    {
-                        if (PlotDataPoints[i].X >= m_WavePlotX && PlotDataPoints[i].X <= m_WavePlotX + m_WavePlotWidth)
-                        {
-                            double StartX = m_StartDrawLineX + (Canvas_Main.ActualWidth - m_StartDrawLineX) / m_WavePlotWidth * (PlotDataPoints[i].X - m_WavePlotX);
-                            if (StartX < m_StartDrawLineX || PlotDataPoints[i].X < m_WavePlotX) StartX = m_StartDrawLineX;
-                            if (StartX > Canvas_Main.ActualWidth || PlotDataPoints[i].X > m_WavePlotX + m_WavePlotWidth) StartX = Canvas_Main.ActualWidth;
-                            double StartY = Canvas_Main.ActualHeight - 50 - (Canvas_Main.ActualHeight - 50.0) / m_WavePlotHeight * (PlotDataPoints[i].Y - m_WavePlotY);
-                            if (StartY < 0 || PlotDataPoints[i].Y > m_WavePlotY + m_WavePlotHeight) StartY = 0;
-                            if (StartY > Canvas_Main.ActualHeight - 50 || PlotDataPoints[i].Y < m_WavePlotY) StartY = Canvas_Main.ActualHeight - 50;
-                            points.Add(new PointF((float)StartX, (float)StartY));
-                        }
-                        if (m_WavePlotMinX == double.MaxValue || m_WavePlotMinX > PlotDataPoints[i].X) m_WavePlotMinX = PlotDataPoints[i].X;
-                        if (m_WavePlotMaxX == double.MinValue || m_WavePlotMaxX < PlotDataPoints[i].X) m_WavePlotMaxX = PlotDataPoints[i].X;
-                        if (m_WavePlotMinY == double.MaxValue || m_WavePlotMinY > PlotDataPoints[i].Y) m_WavePlotMinY = PlotDataPoints[i].Y;
-                        if (m_WavePlotMaxY == double.MinValue || m_WavePlotMaxY < PlotDataPoints[i].Y) m_WavePlotMaxY = PlotDataPoints[i].Y;
-                    }
-                    if (points.Count > 1 && points.Where(_ => float.IsNaN(_.X) || float.IsNaN(_.Y)).ToList<PointF>().Count == 0) graphics.DrawLines(m_PenData, points.ToArray());
-                }
-                if (this.PlotSDataPoints != null && this.PlotSDataPoints.Count > 0)
-                {
-                    List<PointF> points = new List<PointF>();
-                    for (int i = 0; i < PlotSDataPoints.Count; i++)
-                    {
-                        if (PlotSDataPoints[i].X >= m_WavePlotX && PlotSDataPoints[i].X <= m_WavePlotX + m_WavePlotWidth)
-                        {
-                            double StartX = 50 + (Canvas_Main.ActualWidth - m_StartDrawLineX) / m_WavePlotWidth * (PlotSDataPoints[i].X - m_WavePlotX);
-                            if (StartX < m_StartDrawLineX || PlotSDataPoints[i].X < m_WavePlotX) StartX = m_StartDrawLineX;
-                            if (StartX > Canvas_Main.ActualWidth || PlotSDataPoints[i].X > m_WavePlotX + m_WavePlotWidth) StartX = Canvas_Main.ActualWidth;
-                            double StartY = Canvas_Main.ActualHeight - 50 - (Canvas_Main.ActualHeight - 50.0) / m_WavePlotHeight * (PlotSDataPoints[i].Y - m_WavePlotY);
-                            if (StartY < 0 || PlotSDataPoints[i].Y > m_WavePlotY + m_WavePlotHeight) StartY = 0;
-                            if (StartY > Canvas_Main.ActualHeight - 50 || PlotSDataPoints[i].Y < m_WavePlotY) StartY = Canvas_Main.ActualHeight - 50;
-                            points.Add(new PointF((float)StartX, (float)StartY));
-                        }
-                        if (double.IsNaN(m_WavePlotMinX) || m_WavePlotMinX > PlotSDataPoints[i].X) m_WavePlotMinX = PlotSDataPoints[i].X;
-                        if (double.IsNaN(m_WavePlotMaxX) || m_WavePlotMaxX < PlotSDataPoints[i].X) m_WavePlotMaxX = PlotSDataPoints[i].X;
-                        if (double.IsNaN(m_WavePlotMinY) || m_WavePlotMinY > PlotSDataPoints[i].Y) m_WavePlotMinY = PlotSDataPoints[i].Y;
-                        if (double.IsNaN(m_WavePlotMaxY) || m_WavePlotMaxY < PlotSDataPoints[i].Y) m_WavePlotMaxY = PlotSDataPoints[i].Y;
-                    }
-                    if (points.Count > 1 && points.Where(_ => float.IsNaN(_.X) || float.IsNaN(_.Y)).ToList<PointF>().Count == 0) graphics.DrawLines(m_PenSData, points.ToArray());
-                }
-                if (this.PlotASDataPoints != null && this.PlotASDataPoints.Count > 0)
-                {
-                    List<PointF> points = new List<PointF>();
-                    for (int i = 0; i < PlotASDataPoints.Count; i++)
-                    {
-                        if (PlotASDataPoints[i].X >= m_WavePlotX && PlotASDataPoints[i].X <= m_WavePlotX + m_WavePlotWidth)
-                        {
-                            double StartX = m_StartDrawLineX + (Canvas_Main.ActualWidth - m_StartDrawLineX) / m_WavePlotWidth * (PlotASDataPoints[i].X - m_WavePlotX);
-                            if (StartX < m_StartDrawLineX || PlotASDataPoints[i].X < m_WavePlotX) StartX = m_StartDrawLineX;
-                            if (StartX > Canvas_Main.ActualWidth || PlotASDataPoints[i].X > m_WavePlotX + m_WavePlotWidth) StartX = Canvas_Main.ActualWidth;
-                            double StartY = Canvas_Main.ActualHeight - 50 - (Canvas_Main.ActualHeight - 50.0) / m_WavePlotHeight * (PlotASDataPoints[i].Y - m_WavePlotY);
-                            if (StartY < 0 || PlotASDataPoints[i].Y > m_WavePlotY + m_WavePlotHeight) StartY = 0;
-                            if (StartY > Canvas_Main.ActualHeight - 50 || PlotASDataPoints[i].Y < m_WavePlotY) StartY = Canvas_Main.ActualHeight - 50;
-                            points.Add(new PointF((float)StartX, (float)StartY));
-                        }
-                        if (m_WavePlotMinX == double.MaxValue || m_WavePlotMinX > PlotASDataPoints[i].X) m_WavePlotMinX = PlotASDataPoints[i].X;
-                        if (m_WavePlotMaxX == double.MinValue || m_WavePlotMaxX < PlotASDataPoints[i].X) m_WavePlotMaxX = PlotASDataPoints[i].X;
-                        if (m_WavePlotMinY == double.MaxValue || m_WavePlotMinY > PlotASDataPoints[i].Y) m_WavePlotMinY = PlotASDataPoints[i].Y;
-                        if (m_WavePlotMaxY == double.MinValue || m_WavePlotMaxY < PlotASDataPoints[i].Y) m_WavePlotMaxY = PlotASDataPoints[i].Y;
-                    }
-                    if (points.Count > 1 && points.Where(_ => float.IsNaN(_.X) || float.IsNaN(_.Y)).ToList<PointF>().Count == 0) graphics.DrawLines(m_PenASData, points.ToArray());
-                }
-                if (this.Points != null && this.Points.Count > 0)
-                {
-                    List<PointF> points = new List<PointF>();
-                    for (int i = 0; i < Points.Count; i++)
-                    {
-                        if (Points[i].X >= m_WavePlotX && Points[i].X <= m_WavePlotX + m_WavePlotWidth)
-                        {
-                            double StartX = m_StartDrawLineX + (Canvas_Main.ActualWidth - m_StartDrawLineX) / m_WavePlotWidth * (Points[i].X - m_WavePlotX);
-                            if (StartX < m_StartDrawLineX || Points[i].X < m_WavePlotX) StartX = m_StartDrawLineX;
-                            if (StartX > Canvas_Main.ActualWidth || Points[i].X > m_WavePlotX + m_WavePlotWidth) StartX = Canvas_Main.ActualWidth;
-                            double StartY = Canvas_Main.ActualHeight - 50 - (Canvas_Main.ActualHeight - 50.0) / m_WavePlotHeight * (Points[i].Y - m_WavePlotY);
-                            if (StartY < 0 || Points[i].Y > m_WavePlotY + m_WavePlotHeight) StartY = 0;
-                            if (StartY > Canvas_Main.ActualHeight - 50 || Points[i].Y < m_WavePlotY) StartY = Canvas_Main.ActualHeight - 50;
-                            points.Add(new PointF((float)StartX, (float)StartY));
-                        }
-                        if (m_WavePlotMinX == double.MaxValue || m_WavePlotMinX > Points[i].X) m_WavePlotMinX = Points[i].X;
-                        if (m_WavePlotMaxX == double.MinValue || m_WavePlotMaxX < Points[i].X) m_WavePlotMaxX = Points[i].X;
-                        if (m_WavePlotMinY == double.MaxValue || m_WavePlotMinY > Points[i].Y) m_WavePlotMinY = Points[i].Y;
-                        if (m_WavePlotMaxY == double.MinValue || m_WavePlotMaxY < Points[i].Y) m_WavePlotMaxY = Points[i].Y;
-                    }
-                    if (points.Count > 1 && points.Where(_ => float.IsNaN(_.X) || float.IsNaN(_.Y)).ToList<PointF>().Count == 0) graphics.DrawLines(m_PenData, points.ToArray());
-                }
-                if (this.PointCollections != null && this.PointCollections.Count > 0)
-                {
-                    for (int i = 0; i < this.PointCollections.Count; i++)
-                    {
-                        List<PointF> points = new List<PointF>();
-                        for (int j = 0; j < this.PointCollections[i].Count; j++)
-                        {
-                            if (this.PointCollections[i][j].X >= m_WavePlotX && this.PointCollections[i][j].X <= m_WavePlotX + m_WavePlotWidth)
-                            {
-                                double StartX = m_StartDrawLineX + (Canvas_Main.ActualWidth - m_StartDrawLineX) / m_WavePlotWidth * (this.PointCollections[i][j].X - m_WavePlotX);
-                                if (StartX < m_StartDrawLineX || this.PointCollections[i][j].X < m_WavePlotX) StartX = m_StartDrawLineX;
-                                if (StartX > Canvas_Main.ActualWidth || this.PointCollections[i][j].X > m_WavePlotX + m_WavePlotWidth) StartX = Canvas_Main.ActualWidth;
-                                double StartY = Canvas_Main.ActualHeight - 50 - (Canvas_Main.ActualHeight - 50.0) / m_WavePlotHeight * (this.PointCollections[i][j].Y - m_WavePlotY);
-                                if (StartY < 0 || this.PointCollections[i][j].Y > m_WavePlotY + m_WavePlotHeight) StartY = 0;
-                                if (StartY > Canvas_Main.ActualHeight - 50 || this.PointCollections[i][j].Y < m_WavePlotY) StartY = Canvas_Main.ActualHeight - 50;
-                                points.Add(new PointF((float)StartX, (float)StartY));
-                            }
-                            if (m_WavePlotMinX == double.MaxValue || m_WavePlotMinX > this.PointCollections[i][j].X) m_WavePlotMinX = this.PointCollections[i][j].X;
-                            if (m_WavePlotMaxX == double.MinValue || m_WavePlotMaxX < this.PointCollections[i][j].X) m_WavePlotMaxX = this.PointCollections[i][j].X;
-                            if (m_WavePlotMinY == double.MaxValue || m_WavePlotMinY > this.PointCollections[i][j].Y) m_WavePlotMinY = this.PointCollections[i][j].Y;
-                            if (m_WavePlotMaxY == double.MinValue || m_WavePlotMaxY < this.PointCollections[i][j].Y) m_WavePlotMaxY = this.PointCollections[i][j].Y;
-                        }
-                        if (points.Count > 1 && points.Where(_ => float.IsNaN(_.X) || float.IsNaN(_.Y)).ToList<PointF>().Count == 0)
-                        {
-                            graphics.DrawLines(m_PenCollencteions[i % 10], points.ToArray());
-                        }
-                    }
-                }
-
                 ImageBrush_BK.ImageSource = BitmapToBitmapImage(bitmap);
             }
             this.InvalidateVisual();
@@ -884,7 +885,10 @@ namespace Venus_Themes.UserControls
 
         private void Canvas_Main_MouseEnter(object sender, MouseEventArgs e)
         {
-            if (this.PointCollections == null || this.PointCollections.Count <= 1) m_MouseEnter = true;
+            if (this.PointCollections == null || this.PointCollections.Count <= 1)
+            {
+                m_MouseEnter = true;
+            } 
         }
 
         private void Canvas_Main_MouseLeave(object sender, MouseEventArgs e)