瀏覽代碼

Merge branch 'master' of http://10.4.3.168:3000/JetPlasma/Venus

chenkui 7 月之前
父節點
當前提交
9332919378

+ 1 - 1
Venus/Framework/Common/Event/EventManager.cs

@@ -250,7 +250,7 @@ namespace Aitex.Core.RT.Event
                 //LOG.Error("Event name not registered, " + eventName);
                 return;
             }
-            WriteEvent(_eventDic[eventName].Source, dvid);
+            WriteEvent(_eventDic[eventName].Source,eventName, dvid);
         }
 
         public void WriteEvent(string eventName, SerializableDictionary<string, object> dvid)

+ 8 - 0
Venus/Venus_MainPages/Venus_MainPages.csproj

@@ -183,6 +183,7 @@
     <Compile Include="ViewModels\OverVenusDEViewModel.cs" />
     <Compile Include="ViewModels\OverVenusSEViewModel.cs" />
     <Compile Include="ViewModels\OverVenusViewModel.cs" />
+    <Compile Include="ViewModels\KeplerPartialPressureViewModel.cs" />
     <Compile Include="ViewModels\PartialPressureViewModel.cs" />
     <Compile Include="ViewModels\PlatformViewModel.cs" />
     <Compile Include="ViewModels\ProcessHistoryViewModel.cs" />
@@ -284,6 +285,9 @@
     <Compile Include="Views\OverVenusView.xaml.cs">
       <DependentUpon>OverVenusView.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\KeplerPartialPressureView.xaml.cs">
+      <DependentUpon>KeplerPartialPressureView.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\PartialPressureView.xaml.cs">
       <DependentUpon>PartialPressureView.xaml</DependentUpon>
     </Compile>
@@ -521,6 +525,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\KeplerPartialPressureView.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
     <Page Include="Views\PartialPressureView.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 275 - 0
Venus/Venus_MainPages/ViewModels/KeplerPartialPressureViewModel.cs

@@ -0,0 +1,275 @@
+using LiveCharts;
+using MECF.Framework.Common.DataCenter;
+using MECF.Framework.Common.OperationCenter;
+using Microsoft.Win32;
+using Prism.Commands;
+using Prism.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Threading;
+using Venus_Core;
+//using Venus_Core;
+using Venus_MainPages.Unity;
+using Venus_Unity;
+
+namespace Venus_MainPages.ViewModels
+{
+    internal class KeplerPartialPressureViewModel : BindableBase
+    {
+        #region 私有字段
+
+        private ObservableCollection<string> m_GasFlows = new ObservableCollection<string>();
+        //private object[] m_GasPressures = new object[10];
+
+        public string ModuleName;
+        private int m_GasIndex;
+        ChartValues<double> m_CurrentLineSeries= new ChartValues<double>();
+        ChartValues<double> m_ReferenceLineSeries = new ChartValues<double>();
+        ObservableCollection<string> CurrentGasFlows = new ObservableCollection<string>();
+        DispatcherTimer timer = new DispatcherTimer();
+        private int m_GasTime;
+        private string m_GasName;
+        //private PartialPressureResult m_partialPressureResult;
+        string value;
+        int maxScale;
+        ObservableCollection<string> m_ReferenceFlow = new ObservableCollection<string>();
+        private bool m_MFC7IsEnable;
+        private bool m_MFC8IsEnable;
+        private bool m_MFC9IsEnable;
+        private bool m_MFC10IsEnable;
+        private bool m_MFC11IsEnable;
+        private bool m_MFC12IsEnable;
+        private bool m_IsAutoMode;
+        private PressureType m_PressureType;
+
+        #endregion
+
+        #region 属性
+        public PressureType PressureType
+        {
+            get { return m_PressureType; }
+            set { SetProperty(ref m_PressureType, value); }
+        }
+        public ObservableCollection<string> ReferenceFlow
+        {
+            get { return m_ReferenceFlow; }
+            set { SetProperty(ref m_ReferenceFlow, value); }
+        }
+        public ObservableCollection<string> GasFlows
+        {
+            get { return m_GasFlows; }
+            set { SetProperty(ref m_GasFlows, value); }
+        }
+        public ChartValues<double> CurrentLineSeries
+        {
+            get { return m_CurrentLineSeries; }
+            set { SetProperty(ref m_CurrentLineSeries, value); }
+        }
+        public ChartValues<double> ReferenceLineSeries
+        {
+            get { return m_ReferenceLineSeries; }
+            set { SetProperty(ref m_ReferenceLineSeries, value); }
+        }
+        public int GasTime
+        {
+            get { return m_GasTime; }
+            set { SetProperty(ref m_GasTime, value); }
+        }
+        public string GasName
+        {
+            get { return m_GasName; }
+            set { SetProperty(ref m_GasName, value); }
+        }
+        public bool MFC7IsEnable
+        {
+            get { return m_MFC7IsEnable; }
+            set { SetProperty(ref m_MFC7IsEnable, value); }
+        }
+        public bool MFC8IsEnable
+        {
+            get { return m_MFC8IsEnable; }
+            set { SetProperty(ref m_MFC8IsEnable, value); }
+        }
+        public bool MFC9IsEnable
+        {
+            get { return m_MFC9IsEnable; }
+            set { SetProperty(ref m_MFC9IsEnable, value); }
+        }
+        public bool MFC10IsEnable
+        {
+            get { return m_MFC10IsEnable; }
+            set { SetProperty(ref m_MFC10IsEnable, value); }
+        }
+        public bool MFC11IsEnable
+        {
+            get { return m_MFC11IsEnable; }
+            set { SetProperty(ref m_MFC11IsEnable, value); }
+        }
+        public bool MFC12IsEnable
+        {
+            get { return m_MFC12IsEnable; }
+            set { SetProperty(ref m_MFC12IsEnable, value); }
+        }
+        public bool IsAutoMode
+        {
+            get { return m_IsAutoMode; }
+            set { SetProperty(ref m_IsAutoMode, value); }
+        }
+        #endregion
+
+        #region 命令
+        private DelegateCommand<object> _SelectGasCommand;
+        public DelegateCommand<object> SelectGasCommand =>
+            _SelectGasCommand ?? (_SelectGasCommand = new DelegateCommand<object>(OnSelectGas));
+
+        private DelegateCommand _StartCommand;
+        public DelegateCommand StartCommand =>
+            _StartCommand ?? (_StartCommand = new DelegateCommand(OnStart));
+
+        private DelegateCommand _SaveCommand;
+        public DelegateCommand SaveCommand =>
+            _SaveCommand ?? (_SaveCommand = new DelegateCommand(OnSave));
+
+        private DelegateCommand _LoadReferenceCommand;
+        public DelegateCommand LoadReferenceCommand =>
+            _LoadReferenceCommand ?? (_LoadReferenceCommand = new DelegateCommand(OnLoadReference));
+
+        private DelegateCommand _AbortCommand;
+        public DelegateCommand AbortCommand =>
+            _AbortCommand ?? (_AbortCommand = new DelegateCommand(OnAbort));
+
+        private DelegateCommand _LoadCommand;
+        public DelegateCommand LoadCommand =>
+            _LoadCommand ?? (_LoadCommand = new DelegateCommand(OnLoad));
+        #endregion
+
+        #region 构造函数
+        public KeplerPartialPressureViewModel()
+        {
+            GasTime = 60;
+            m_GasIndex = 1;
+            for (int i = 1; i < 11; i++)
+            {
+                GasFlows.Add((10 * i).ToString());
+            }
+            timer.Interval = TimeSpan.FromSeconds(1);
+            timer.Tick += Timer_Tick;           
+        }
+
+        #endregion
+
+        #region 命令方法
+        private void OnLoad()
+        {
+            var jetChamber = (JetChamber)Enum.Parse(typeof(JetChamber), QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.ChamberType").ToString());
+            if (jetChamber == JetChamber.Kepler2200A || jetChamber == JetChamber.Kepler2200B)
+            {
+                PressureType = PressureType.Pa;
+            }
+        }
+        private void OnSelectGas(object obj)
+        {
+            CurrentGasFlows.Clear();
+            GasFlows.Clear();
+            value = $"MfcGas{obj}";
+            maxScale= Convert.ToInt32(QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.{value}.MfcN2Scale"));
+            var xishu = Convert.ToDouble(QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.{value}.MfcScaleFactor"));
+            GasName = QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.{value}.GasName").ToString();
+
+            for (int i = 1; i < 11; i++)
+            {
+                CurrentGasFlows.Add((maxScale * xishu / 10 * i).ToString());
+            }
+            GasFlows = CurrentGasFlows;
+            m_GasIndex = Convert.ToInt32(obj);
+        }
+        private  void OnStart()
+        {
+            timer.Start();
+            InvokeClient.Instance.Service.DoOperation($"{ModuleName}.PartialPressureTest", m_GasIndex,1000* GasTime);         
+        }
+
+        private void OnSave()
+        {
+            //SerializeHelper.Instance.WriteToJsonFile<PartialPressureResult>(m_partialPressureResult, $"PartialPressureResult/{m_partialPressureResult.GasName}/{DateTime.Now.ToString("yyyyMMddHHmm")}.json");
+        }
+        private void OnLoadReference()
+        {
+            OpenFileDialog dialog = new OpenFileDialog();
+            dialog.Filter = ".json|*.json";
+            dialog.InitialDirectory = Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "PartialPressureResult", ModuleName);
+            if (dialog.ShowDialog() == true)
+            {
+                string SelectedPath = dialog.FileName;
+                var value = SerializeHelper.Instance.ReadFromJsonFile<PartialPressureResult>(SelectedPath);
+                ReferenceLineSeries.Clear();
+                ReferenceFlow.Clear();
+                value.ValuePairs.ForEach(x =>
+                {
+                    ReferenceFlow.Add(x.Flow);
+                    ReferenceLineSeries.Add(x.Pressure);
+                });
+            }
+            else
+            {
+                ReferenceLineSeries.Clear();
+                //ReferenceLineSeries.Insert(20, 0);
+                ReferenceLineSeries.Add(0);
+                ReferenceFlow.Clear();
+            }       
+        }
+        private void OnAbort()
+        {
+            timer.Stop();
+            InvokeClient.Instance.Service.DoOperation($"{ModuleName}.Abort");
+            CurrentLineSeries = new ChartValues<double>();
+        }
+        #endregion
+
+        #region 私有方法
+        private void Timer_Tick(object sender, EventArgs e)
+        {           
+
+            CurrentLineSeries.Clear();
+
+            var values = QueryDataClient.Instance.Service.GetData($"{ModuleName}.PartialPressureResult").ToString();
+            values.Split(',').ToList().ForEach(x =>
+            {
+                if (x != "")
+                {
+                    CurrentLineSeries.Add(Math.Round(Convert.ToDouble(x), 3));
+                }
+            });
+
+            if (CurrentLineSeries.Count == 10)
+            {
+                timer.Stop();
+            }
+            IsAutoMode = (bool)QueryDataClient.Instance.Service.GetData($"{ModuleName}.IsOnline");
+        }
+        public void Init()
+        {                
+           
+            var jetChamber = (JetChamber)Enum.Parse(typeof(JetChamber), QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.ChamberType").ToString());
+            if (jetChamber != JetChamber.Kepler2200A && jetChamber != JetChamber.Kepler2200B)
+            {
+                MFC7IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas7.Enable");
+                MFC8IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas8.Enable");
+            }
+            if (jetChamber == JetChamber.VenusSE|| jetChamber == JetChamber.VenusDE)
+            {
+                MFC9IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas9.Enable");
+                MFC10IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas10.Enable");
+                MFC11IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas11.Enable");
+                MFC12IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas12.Enable");
+            }
+
+        }
+        #endregion
+    }
+}

+ 226 - 0
Venus/Venus_MainPages/Views/KeplerPartialPressureView.xaml

@@ -0,0 +1,226 @@
+<UserControl x:Class="Venus_MainPages.Views.KeplerPartialPressureView"
+             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:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
+             xmlns:local="clr-namespace:Venus_MainPages.Views"
+             xmlns:prism="http://prismlibrary.com/"
+             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
+             prism:ViewModelLocator.AutoWireViewModel="True"
+             xmlns:unity="clr-namespace:Venus_MainPages.Unity"
+             xmlns:sys="clr-namespace:System;assembly=mscorlib"
+             xmlns:customControls="clr-namespace:Venus_Themes.CustomControls;assembly=Venus_Themes"
+             mc:Ignorable="d" 
+             d:DesignHeight="450" d:DesignWidth="800">
+    <i:Interaction.Triggers>
+        <i:EventTrigger EventName="Loaded">
+            <i:InvokeCommandAction Command="{Binding LoadCommand}"/>
+        </i:EventTrigger>
+    </i:Interaction.Triggers>
+    <UserControl.Resources>
+        <sys:String x:Key="Module">PMA</sys:String>
+    </UserControl.Resources>
+    <Grid>
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="*"/>
+            <ColumnDefinition Width="2*" />
+            <ColumnDefinition Width="6*"/>
+        </Grid.ColumnDefinitions>
+        <Canvas>
+            <TextBlock Text="Flow Time:"   Canvas.Left="10"  Canvas.Top="120" FontSize="15"/>
+            <TextBox    FontSize="15"      Canvas.Left="92"  Canvas.Top="120" Width="80" Text="{Binding GasTime,UpdateSourceTrigger=PropertyChanged}" BorderThickness="0,0,0,1" Background="Transparent" BorderBrush="Black" HorizontalContentAlignment="Center"/>
+            <TextBlock  FontSize="15"      Canvas.Left="176" Canvas.Top="120" Text="(s)"/>
+
+            <TextBlock Text="Gas Name:"          Canvas.Left="10"  Canvas.Top="160" FontSize="15"/>
+            <TextBlock Text="{Binding GasName}"  Canvas.Left="90"  Canvas.Top="160" FontSize="15"/>
+            <RadioButton Content="Gas1" Canvas.Left="20" Canvas.Top="200" FontSize="15" IsChecked="True">
+                <i:Interaction.Triggers>
+                    <i:EventTrigger EventName="Checked">
+                        <i:InvokeCommandAction Command="{Binding SelectGasCommand}"
+                                   CommandParameter="1"/>
+                    </i:EventTrigger>
+                </i:Interaction.Triggers>
+            </RadioButton>
+           
+
+            <RadioButton Content="Gas2" Canvas.Left="20" Canvas.Top="240" FontSize="15">
+                <i:Interaction.Triggers>
+                    <i:EventTrigger EventName="Checked">
+                        <i:InvokeCommandAction Command="{Binding SelectGasCommand}"
+                                   CommandParameter="2"/>
+                    </i:EventTrigger>
+                </i:Interaction.Triggers>
+            </RadioButton>
+          
+
+            <RadioButton Content="Gas3" Canvas.Left="20" Canvas.Top="280" FontSize="15">
+                <i:Interaction.Triggers>
+                    <i:EventTrigger EventName="Checked">
+                        <i:InvokeCommandAction Command="{Binding SelectGasCommand}"
+                                   CommandParameter="3"/>
+                    </i:EventTrigger>
+                </i:Interaction.Triggers>
+            </RadioButton>
+          
+
+            <RadioButton Content="Gas4" Canvas.Left="20" Canvas.Top="320" FontSize="15">
+                <i:Interaction.Triggers>
+                    <i:EventTrigger EventName="Checked">
+                        <i:InvokeCommandAction Command="{Binding SelectGasCommand}"
+                                   CommandParameter="4"/>
+                    </i:EventTrigger>
+                </i:Interaction.Triggers>
+            </RadioButton>
+          
+
+            <RadioButton Content="Gas5" Canvas.Left="20" Canvas.Top="360" FontSize="15">
+                <i:Interaction.Triggers>
+                    <i:EventTrigger EventName="Checked">
+                        <i:InvokeCommandAction Command="{Binding SelectGasCommand}"
+                                   CommandParameter="5"/>
+                    </i:EventTrigger>
+                </i:Interaction.Triggers>
+            </RadioButton>
+           
+
+            <RadioButton Content="Gas6" Canvas.Left="20" Canvas.Top="400" FontSize="15">
+                <i:Interaction.Triggers>
+                    <i:EventTrigger EventName="Checked">
+                        <i:InvokeCommandAction Command="{Binding SelectGasCommand}"
+                                   CommandParameter="6"/>
+                    </i:EventTrigger>
+                </i:Interaction.Triggers>
+            </RadioButton>
+
+
+            <RadioButton Content="Gas7" Canvas.Left="20" Canvas.Top="440" FontSize="15" >
+                <i:Interaction.Triggers>
+                    <i:EventTrigger EventName="Checked">
+                        <i:InvokeCommandAction Command="{Binding SelectGasCommand}"
+                                   CommandParameter="7"/>
+                    </i:EventTrigger>
+                </i:Interaction.Triggers>
+            </RadioButton>
+
+
+            <RadioButton Content="Gas8" Canvas.Left="20" Canvas.Top="480" FontSize="15">
+                <i:Interaction.Triggers>
+                    <i:EventTrigger EventName="Checked">
+                        <i:InvokeCommandAction Command="{Binding SelectGasCommand}"
+                                   CommandParameter="8"/>
+                    </i:EventTrigger>
+                </i:Interaction.Triggers>
+            </RadioButton>
+            
+
+            <customControls:PathButton Content="Start" Canvas.Left="10" Canvas.Top="700"  Width="90" Height="25" Command="{Binding StartCommand}" IsEnabled="{Binding IsAutoMode,Converter={StaticResource BoolToBool}}"/>
+            <customControls:PathButton Content="Abort" Canvas.Left="110" Canvas.Top="700" Width="90" Height="25" Command="{Binding AbortCommand}" IsEnabled="{Binding IsAutoMode,Converter={StaticResource BoolToBool}}"/>
+
+        </Canvas>
+        <Canvas Grid.Column="1">
+            <TextBlock Text="Test Result:" FontSize="15" FontWeight="Bold" Canvas.Left="10" Canvas.Top="160"/>
+
+            <Grid Canvas.Left="10" Canvas.Top="200" Height="440" unity:GridOptions.ShowBorder="True" unity:GridOptions.LineBrush="#D8DEE5"  Width="400" Background="WhiteSmoke">
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition/>
+                    <ColumnDefinition Width="2*"/>
+                    <ColumnDefinition/>
+                    <ColumnDefinition Width="2*"/>
+                </Grid.ColumnDefinitions>
+                <Grid.RowDefinitions>
+                    <RowDefinition Height="33.846"/>
+                    <RowDefinition/>
+                    <RowDefinition Height="33.846"/>
+                    <RowDefinition/>
+                    <RowDefinition/>
+                    <RowDefinition/>
+                    <RowDefinition/>
+                    <RowDefinition/>
+                    <RowDefinition/>
+                    <RowDefinition/>
+                    <RowDefinition/>
+                    <RowDefinition/>
+                    <RowDefinition/>
+
+                </Grid.RowDefinitions>
+                <TextBlock Text="Current"                 Grid.ColumnSpan="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="Reference" Grid.Column="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="Flow"     Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="Pressure" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="Flow"     Grid.Row="1" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="Pressure" Grid.Row="1" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+
+                <TextBlock Text="{Binding Path=GasFlows[0], Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding Path=GasFlows[1], Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="3" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding Path=GasFlows[2], Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="4" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding Path=GasFlows[3], Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="5" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding Path=GasFlows[4], Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="6" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding Path=GasFlows[5], Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="7" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding Path=GasFlows[6], Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"  Grid.Row="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding Path=GasFlows[7], Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"  Grid.Row="9" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding Path=GasFlows[8], Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"  Grid.Row="10" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding Path=GasFlows[9], Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="11" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+
+                <TextBlock Text="{Binding CurrentLineSeries[0]}" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding CurrentLineSeries[1]}" Grid.Row="3" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding CurrentLineSeries[2]}" Grid.Row="4" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding CurrentLineSeries[3]}" Grid.Row="5" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding CurrentLineSeries[4]}" Grid.Row="6" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding CurrentLineSeries[5]}" Grid.Row="7" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding CurrentLineSeries[6]}"  Grid.Row="8" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding CurrentLineSeries[7]}"  Grid.Row="9" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding CurrentLineSeries[8]}"  Grid.Row="10" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding CurrentLineSeries[9]}" Grid.Row="11" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+
+                <TextBlock Text="{Binding ReferenceFlow[0], Mode=TwoWay}" Grid.Row="2" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding ReferenceFlow[1], Mode=TwoWay}" Grid.Row="3" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding ReferenceFlow[2], Mode=TwoWay}" Grid.Row="4" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding ReferenceFlow[3], Mode=TwoWay}" Grid.Row="5" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding ReferenceFlow[4], Mode=TwoWay}" Grid.Row="6" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding ReferenceFlow[5], Mode=TwoWay}" Grid.Row="7" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding ReferenceFlow[6], Mode=TwoWay}" Grid.Row="8" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding ReferenceFlow[7], Mode=TwoWay}" Grid.Row="9" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding ReferenceFlow[8], Mode=TwoWay}" Grid.Row="10" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding ReferenceFlow[9], Mode=TwoWay}" Grid.Row="11" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+
+                <TextBlock Text="{Binding ReferenceLineSeries[0]}" Grid.Row="2" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding ReferenceLineSeries[1]}" Grid.Row="3" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding ReferenceLineSeries[2]}" Grid.Row="4" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding ReferenceLineSeries[3]}" Grid.Row="5" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding ReferenceLineSeries[4]}" Grid.Row="6" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding ReferenceLineSeries[5]}" Grid.Row="7" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding ReferenceLineSeries[6]}"  Grid.Row="8" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding ReferenceLineSeries[7]}"  Grid.Row="9" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding ReferenceLineSeries[8]}"  Grid.Row="10" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                <TextBlock Text="{Binding ReferenceLineSeries[9]}" Grid.Row="11" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+            </Grid>
+            <customControls:PathButton Content="Save"   Canvas.Left="10"  Canvas.Top="700"  Width="100"  Height="26" Command="{Binding SaveCommand}" IsEnabled="{Binding IsAutoMode,Converter={StaticResource BoolToBool}}"/>
+            <customControls:PathButton Content="Compare"   Canvas.Left="310" Canvas.Top="700"  Width="100"  Height="26" Command="{Binding LoadReferenceCommand}" IsEnabled="{Binding IsAutoMode,Converter={StaticResource BoolToBool}}"/>
+
+        </Canvas>
+        <Grid Grid.Column="2">
+
+            <lvc:CartesianChart   LegendLocation="Right"  Hoverable="True"  DataTooltip="{x:Null}" Grid.Row="1" Height="700" >
+                <lvc:CartesianChart.Series>
+                    <lvc:LineSeries Title="Current"    Width="1"  Values="{Binding CurrentLineSeries}"  Fill="Transparent" LineSmoothness="0" PointGeometry="{x:Null}" />
+                    <lvc:LineSeries Title="Reference"  Width="1"  Values="{Binding ReferenceLineSeries}" Fill="Transparent" LineSmoothness="0" PointGeometry="{x:Null}"/>
+                </lvc:CartesianChart.Series>
+
+                <lvc:CartesianChart.AxisX>
+                    <lvc:Axis Title="SetPoint(%)" Labels="10%,20%,30%,40%,50%,60%,70%,80%,90%,100%" FontSize="15" Foreground="Black">
+                        <lvc:Axis.Separator>
+                            <lvc:Separator Step="1"/>
+                        </lvc:Axis.Separator>
+                    </lvc:Axis>
+                </lvc:CartesianChart.AxisX>
+                <lvc:CartesianChart.AxisY>
+                    <lvc:Axis Title="{Binding PressureType, StringFormat=Pressure({0})}"  FontSize="15" Foreground="Black">
+
+                    </lvc:Axis>
+                </lvc:CartesianChart.AxisY>
+            </lvc:CartesianChart>
+        </Grid>
+       
+    </Grid>
+</UserControl>

+ 34 - 0
Venus/Venus_MainPages/Views/KeplerPartialPressureView.xaml.cs

@@ -0,0 +1,34 @@
+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;
+using Venus_MainPages.ViewModels;
+
+namespace Venus_MainPages.Views
+{
+    /// <summary>
+    /// PartialPressureView.xaml 的交互逻辑
+    /// </summary>
+    public partial class KeplerPartialPressureView : UserControl
+    {
+        public KeplerPartialPressureView()
+        {
+            InitializeComponent();
+        }
+        public void Init(string systemName)
+        {
+            (this.DataContext as KeplerPartialPressureViewModel).ModuleName = systemName;
+            (this.DataContext as KeplerPartialPressureViewModel).Init();
+        }
+    }
+}

二進制
Venus/Venus_RT/Config/PM/Kepler2200A/Kepler2200ADeviceModel.xml


二進制
Venus/Venus_RT/Config/PM/Kepler2200B/Kepler2200BDeviceModel.xml


+ 12 - 1
Venus/Venus_RT/Devices/EFEM/EfemMessage.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.IO;
+using System.Linq;
 using System.Reflection;
 using System.Runtime.Serialization;
 using System.Runtime.Serialization.Formatters.Binary;
@@ -151,7 +152,17 @@ namespace Venus_RT.Devices.YASKAWA
                                 msg.Data.Add(sBodies[3]);
                                 break;
                             case EfemOperation.CarrierId:
-                                msg.Data.Add(msg.RawString.Substring("INF:CSTID/P1/".Length));
+                                string data = msg.RawString.Substring("INF:CSTID/P1/".Length);
+                                var item = data.Split(new char[] { ';' });
+                                if ( item.Length > 0)
+                                {
+                                    msg.Data.Add(item[0]);
+                                }
+                                else
+                                {
+                                    msg.Data.Add("");
+                                }
+                                //msg.Data.Add(msg.RawString.Substring("INF:CSTID/P1/".Length));
                                 break;
                             case EfemOperation.SigStatus:
                                 msg.Data.Add(sBodies[2]);

+ 8 - 8
Venus/Venus_RT/Devices/EFEM/JetEfem.cs

@@ -880,7 +880,7 @@ namespace Venus_RT.Devices.EFEM
                             LOG.Write(eEvent.ERR_EFEM_COMMON_FAILED, ModuleName.EFEM, "FFU alarm");
                             Singleton<RouteManager>.Instance.EFEM.PostMsg(EfemEntity.MSG.Error);
                         }
-                        if (!baData1[13])   // Bit[13] ON=RUN, OFF=Maintain
+                        if (!baData1[8])   // Bit[13] ON=RUN, OFF=Maintain
                         {
                             //EV.Notify(EFEMOffline);
                             LOG.Write(eEvent.ERR_EFEM_COMMON_FAILED, ModuleName.EFEM, "EFEM switch to Maintain mode, HomeAll to recover");
@@ -975,14 +975,14 @@ namespace Venus_RT.Devices.EFEM
                     break;
                 case EfemOperation.CarrierId:
                     {
-                        if (message.Head == EfemMessage.MsgHead.GET)
-                        {
+                        //if (message.Head == EfemMessage.MsgHead.GET)
+                        //{
                             _LPMs[message.Port - ModuleName.LP1].OnCarrierIDRead(message.Data.First());
-                        }
-                        else
-                        {
-                            _LPMs[message.Port - ModuleName.LP1].OnCarrierIDWrite(message.Data.First());
-                        }
+                        //}
+                        //else
+                        //{
+                        //    _LPMs[message.Port - ModuleName.LP1].OnCarrierIDWrite(message.Data.First());
+                        //}
 
                         _status = RState.End;
                     }

+ 8 - 2
Venus/Venus_RT/Devices/EFEM/Loadport.cs

@@ -738,7 +738,7 @@ namespace Venus_RT.Devices.EFEM
                             this.HasCassette = false;
                             this.IsMapped = false;
                             //EV.PostInfoLog(mod.ToString(), "Cassette removed");
-                            OP.DoOperation("System.CassetteLeave");     //For unload light control off afer job done
+                            //OP.DoOperation("System.CassetteLeave");     //For unload light control off afer job done
                             CarrierManager.Instance.DeleteCarrier(Module.ToString());
                             WaferManager.Instance.DeleteWafer(this.Module, 0, 25);
 
@@ -1031,7 +1031,13 @@ namespace Venus_RT.Devices.EFEM
 
             public void IDRead(Loadport lp)
             {
-                
+                var dvid = new SerializableDictionary<string, string>
+                {
+                    ["CarrierID"] = lp.CarrierId ?? "",
+                    ["PortID"] = lp.PortId.ToString(),
+                    ["SmartTag"]=lp.SmartTag,
+                };
+                EV.Notify(CARRIER_ID_READ, dvid);
             }
 
             public void ReadIDFailed(Loadport lp)

+ 4 - 1
Venus/Venus_RT/Devices/JetKepler2200APM.cs

@@ -87,6 +87,7 @@ namespace Venus_RT.Devices
 
         private readonly IoSensor _TopShieldCoverClosedAlarm;
 
+        private readonly IoSensor _ScrubberIsOK;
 
 
         //private readonly IoHeartbeat _Heartbeat;
@@ -221,6 +222,8 @@ namespace Venus_RT.Devices
         public override float PendulumPosition => _pendulumValve.Position;
 
         public override bool IsAllowRobotTransfer => _WaferTransferPosi_sw.Value;
+
+        public override bool ScrubberIsOK =>_ScrubberIsOK.Value;
         public new ModuleName Module { get; }
 
         //public override bool CheckAtm()
@@ -341,8 +344,8 @@ namespace Venus_RT.Devices
             _WallTC = DEVICE.GetDevice<IoHeater>($"{Module}.WallHeater");
             _WaferTransferPosi_sw = DEVICE.GetDevice<IoSensor>($"{Module}.WaferTransferPosi");
             _TopShieldCoverClosedAlarm = DEVICE.GetDevice<IoSensor>($"{Module}.TOPShieldCoverClosedAlarm");
-
             //_SignalTower = DEVICE.GetDevice<IoSignalTower>($"{Module}.SignalTower");
+            _ScrubberIsOK = DEVICE.GetDevice<IoSensor>($"{Module}.SCRUBBEROK");
 
             _CDAPressure = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCDAPressureOk");
             _pressureController = DEVICE.GetDevice<IoPressureControl>($"{Module}.{VenusDevice.PressureControl}");

+ 3 - 0
Venus/Venus_RT/Devices/JetKepler2200BPM.cs

@@ -87,6 +87,7 @@ namespace Venus_RT.Devices
         private readonly IoSensor _WaferTransferPosi_sw;
 
         private readonly IoSensor _TopShieldCoverClosedAlarm;
+        private readonly IoSensor _ScrubberIsOK;
 
 
 
@@ -219,6 +220,7 @@ namespace Venus_RT.Devices
         public override float PendulumPressure => _pendulumValve.Pressure;
         public override float PendulumPosition => _pendulumValve.Position;
         public override bool IsAllowRobotTransfer => _WaferTransferPosi_sw.Value;
+        public override bool ScrubberIsOK => _ScrubberIsOK.Value;
 
         public new ModuleName Module { get; }
 
@@ -342,6 +344,7 @@ namespace Venus_RT.Devices
             _WallTC = DEVICE.GetDevice<IoHeater>($"{Module}.WallHeater");
             _WaferTransferPosi_sw= DEVICE.GetDevice<IoSensor>($"{Module}.WaferTransferPosi");
             _TopShieldCoverClosedAlarm = DEVICE.GetDevice<IoSensor>($"{Module}.TOPShieldCoverClosedAlarm");
+            _ScrubberIsOK = DEVICE.GetDevice<IoSensor>($"{Module}.SCRUBBEROK");
 
             //_SignalTower = DEVICE.GetDevice<IoSignalTower>($"{Module}.SignalTower");
 

+ 1 - 0
Venus/Venus_RT/Devices/JetPMBase.cs

@@ -108,6 +108,7 @@ namespace Venus_RT.Devices
 
         public virtual float RFBoxC1 { get; }
 
+        public virtual bool ScrubberIsOK => true;
 
         public new ModuleName Module;
 

+ 1 - 0
Venus/Venus_Simulator/Instances/SimulatorSystem.cs

@@ -456,6 +456,7 @@ namespace Venus_Simulator.Instances
                     IO.DI[$"{mod}.DI_Arm_Not_Extend_to_PM"].Value = true;
 
                     IO.DI[$"{mod}.DI_CHB_Water_Flow_Switch"].Value = true;
+                    IO.DI[$"{mod}.DI_SCRUBBER_OK"].Value = true;
 
 
 

+ 16 - 16
Venus/Venus_UI/Config/Menu_Kepler.json

@@ -48,7 +48,7 @@
         "FirstMenu": "PMA",
         "Permission": 2,
         "SecondMenu": "Partial Pressure",
-        "View": "PartialPressureView"
+        "View": "KeplerPartialPressureView"
       },
       {
         "FirstMenu": "PMA",
@@ -90,7 +90,7 @@
         "FirstMenu": "PMB",
         "Permission": 2,
         "SecondMenu": "Partial Pressure",
-        "View": "PartialPressureView"
+        "View": "KeplerPartialPressureView"
       },
       {
         "FirstMenu": "PMB",
@@ -132,7 +132,7 @@
         "FirstMenu": "PMC",
         "Permission": 2,
         "SecondMenu": "Partial Pressure",
-        "View": "PartialPressureView"
+        "View": "KeplerPartialPressureView"
       },
       {
         "FirstMenu": "PMC",
@@ -174,7 +174,7 @@
         "FirstMenu": "PMD",
         "Permission": 2,
         "SecondMenu": "Partial Pressure",
-        "View": "PartialPressureView"
+        "View": "KeplerPartialPressureView"
       },
       {
         "FirstMenu": "PMD",
@@ -319,7 +319,7 @@
         "FirstMenu": "PMA",
         "Permission": 2,
         "SecondMenu": "Partial Pressure",
-        "View": "PartialPressureView"
+        "View": "KeplerPartialPressureView"
       },
       {
         "FirstMenu": "PMA",
@@ -361,7 +361,7 @@
         "FirstMenu": "PMB",
         "Permission": 2,
         "SecondMenu": "Partial Pressure",
-        "View": "PartialPressureView"
+        "View": "KeplerPartialPressureView"
       },
       {
         "FirstMenu": "PMB",
@@ -403,7 +403,7 @@
         "FirstMenu": "PMC",
         "Permission": 2,
         "SecondMenu": "Partial Pressure",
-        "View": "PartialPressureView"
+        "View": "KeplerPartialPressureView"
       },
       {
         "FirstMenu": "PMC",
@@ -445,7 +445,7 @@
         "FirstMenu": "PMD",
         "Permission": 2,
         "SecondMenu": "Partial Pressure",
-        "View": "PartialPressureView"
+        "View": "KeplerPartialPressureView"
       },
       {
         "FirstMenu": "PMD",
@@ -590,7 +590,7 @@
         "FirstMenu": "PMA",
         "Permission": 2,
         "SecondMenu": "Partial Pressure",
-        "View": "PartialPressureView"
+        "View": "KeplerPartialPressureView"
       },
       {
         "FirstMenu": "PMA",
@@ -632,7 +632,7 @@
         "FirstMenu": "PMB",
         "Permission": 2,
         "SecondMenu": "Partial Pressure",
-        "View": "PartialPressureView"
+        "View": "KeplerPartialPressureView"
       },
       {
         "FirstMenu": "PMB",
@@ -674,7 +674,7 @@
         "FirstMenu": "PMC",
         "Permission": 2,
         "SecondMenu": "Partial Pressure",
-        "View": "PartialPressureView"
+        "View": "KeplerPartialPressureView"
       },
       {
         "FirstMenu": "PMC",
@@ -716,7 +716,7 @@
         "FirstMenu": "PMD",
         "Permission": 2,
         "SecondMenu": "Partial Pressure",
-        "View": "PartialPressureView"
+        "View": "KeplerPartialPressureView"
       },
       {
         "FirstMenu": "PMD",
@@ -861,7 +861,7 @@
         "FirstMenu": "PMA",
         "Permission": 2,
         "SecondMenu": "Partial Pressure",
-        "View": "PartialPressureView"
+        "View": "KeplerPartialPressureView"
       },
       {
         "FirstMenu": "PMA",
@@ -903,7 +903,7 @@
         "FirstMenu": "PMB",
         "Permission": 2,
         "SecondMenu": "Partial Pressure",
-        "View": "PartialPressureView"
+        "View": "KeplerPartialPressureView"
       },
       {
         "FirstMenu": "PMB",
@@ -945,7 +945,7 @@
         "FirstMenu": "PMC",
         "Permission": 2,
         "SecondMenu": "Partial Pressure",
-        "View": "PartialPressureView"
+        "View": "KeplerPartialPressureView"
       },
       {
         "FirstMenu": "PMC",
@@ -987,7 +987,7 @@
         "FirstMenu": "PMD",
         "Permission": 2,
         "SecondMenu": "Partial Pressure",
-        "View": "PartialPressureView"
+        "View": "KeplerPartialPressureView"
       },
       {
         "FirstMenu": "PMD",