Bläddra i källkod

1.优化Home断开重连
2.waferoffset 加上数据查看功能

lixiang 11 månader sedan
förälder
incheckning
52e8bd8f7a

+ 44 - 29
Venus/Framework/Common/Communications/AsyncSerialPort.cs

@@ -9,13 +9,19 @@ using System.Linq;
 
 namespace MECF.Framework.Common.Communications
 {
-    
+
     public class AsyncSerialPort : IDisposable
     {
-        public string PortName { get { return _port.PortName; } set {
+        public string PortName
         {
-            _port.PortName = value;
-        } } }
+            get { return _port.PortName; }
+            set
+            {
+                {
+                    _port.PortName = value;
+                }
+            }
+        }
 
         public event Action<string> OnErrorHappened;
 
@@ -37,7 +43,10 @@ namespace MECF.Framework.Common.Communications
 
         private static BitArray _EnableLog;
 
-        public AsyncSerialPort(string name, int baudRate, int dataBits, Parity parity = Parity.None, StopBits stopBits = StopBits.One, string newline = "\r", bool isAsciiMode=true)
+        private Stopwatch timeoutStopWatch = new Stopwatch();
+
+        public bool IsConnected => timeoutStopWatch.ElapsedMilliseconds < 5 * 1000;
+        public AsyncSerialPort(string name, int baudRate, int dataBits, Parity parity = Parity.None, StopBits stopBits = StopBits.One, string newline = "\r", bool isAsciiMode = true)
         {
             _isAsciiMode = isAsciiMode;
 
@@ -78,7 +87,7 @@ namespace MECF.Framework.Common.Communications
 
         public bool Open()
         {
-            
+
             if (_port.IsOpen) Close();
 
             try
@@ -92,7 +101,7 @@ namespace MECF.Framework.Common.Communications
             catch (Exception e)
             {
                 string reason = _port.PortName + " port open failed,please check configuration。" + e.Message;
-                 //ProcessError( reason );
+                //ProcessError( reason );
                 //LOG.Write(reason);
                 return false;
             }
@@ -116,7 +125,7 @@ namespace MECF.Framework.Common.Communications
                 catch (Exception e)
                 {
                     string reason = _port.PortName + " port close failed。" + e.Message;
-                    ProcessError( reason );
+                    ProcessError(reason);
                     return false;
                 }
             }
@@ -137,7 +146,7 @@ namespace MECF.Framework.Common.Communications
                         {
                             //LOG.Info(string.Format("Communication {0} Send {1} succeeded.", _port.PortName, msg));
                         }
-                        
+
                     }
                 }
                 return true;
@@ -146,7 +155,7 @@ namespace MECF.Framework.Common.Communications
             {
                 string reason = string.Format("Communication {0} Send {1} failed. {2}.", _port.PortName, msg, e.Message);
                 //LOG.Info(reason);
-                ProcessError( reason );
+                ProcessError(reason);
                 return false;
             }
         }
@@ -178,14 +187,14 @@ namespace MECF.Framework.Common.Communications
                 return false;
             }
         }
-        public void HandlePorts(byte[] obj, int _length, byte start, string Module, eEvent errdevice,int nOffset)
+        public void HandlePorts(byte[] obj, int _length, byte start, string Module, eEvent errdevice, int nOffset)
         {
             lock (_locker)
             {
-              GetData = (byte[])GetData.Concat(obj).ToArray();
-              //str.Append(System.Text.Encoding.Default.GetString(obj));
-              var strData1 = System.Text.Encoding.Default.GetString(GetData);
-              for (int i = 0; i < GetData.Length; i++)
+                GetData = (byte[])GetData.Concat(obj).ToArray();
+                //str.Append(System.Text.Encoding.Default.GetString(obj));
+                var strData1 = System.Text.Encoding.Default.GetString(GetData);
+                for (int i = 0; i < GetData.Length; i++)
                 {
                     if (GetData[i] == start)
                     {
@@ -215,7 +224,7 @@ namespace MECF.Framework.Common.Communications
                 //LOG.Write($"discard {_port.PortName} received data, but port not open");
                 return;
             }
-
+            timeoutStopWatch.Restart();
             if (_isAsciiMode)
             {
                 AsciiDataReceived();
@@ -232,15 +241,15 @@ namespace MECF.Framework.Common.Communications
 
             _buff += str;
 
-                int index = _buff.LastIndexOf(_port.NewLine, StringComparison.Ordinal);
+            int index = _buff.LastIndexOf(_port.NewLine, StringComparison.Ordinal);
 
-                if (index > 0)
-                {
-                    index += _port.NewLine.Length;
+            if (index > 0)
+            {
+                index += _port.NewLine.Length;
 
-                    string msg = _buff.Substring(0, index);
+                string msg = _buff.Substring(0, index);
 
-                    _buff = _buff.Substring(index);
+                _buff = _buff.Substring(index);
 
                 if (EnableLog)
                 {
@@ -252,7 +261,7 @@ namespace MECF.Framework.Common.Communications
             }
         }
 
-        public void BinaryDataReceived( )
+        public void BinaryDataReceived()
         {
             byte[] readBuffer = new byte[_port.BytesToRead];
             int readCount = _port.Read(readBuffer, 0, readBuffer.Length);
@@ -281,7 +290,7 @@ namespace MECF.Framework.Common.Communications
         {
             string reason = string.Format("Communication {0} {1}.", _port.PortName, e.EventType.ToString());
             //LOG.Error(reason);
-            ProcessError( reason );
+            ProcessError(reason);
         }
 
 
@@ -334,21 +343,27 @@ namespace MECF.Framework.Common.Communications
             return false;
         }
 
-        public bool ReConnect()
+        public bool ReConnect(string com = null)
         {
-            string[] coms  = SerialPort.GetPortNames();
+            if (IsConnected==true)
+            {
+                return true;
+            }
+            Close();
+
+            string[] coms = SerialPort.GetPortNames();
+            string newPortName = com == null ? PortName : com;
             for (int i = 0; i < coms.Length; i++)
             {
-                //找到目标串口
-                if (coms[i].ToUpper() == PortName)
+                if (coms[i].ToUpper() == newPortName)
                 {
-                    //判断目标串口是否打开
                     if (_port.IsOpen)
                     {
                         return true;
                     }
                     else
                     {
+                        _port.PortName = newPortName;
                         Open();
                         return _port.IsOpen;
                     }

+ 9 - 12
Venus/Framework/Common/Communications/AsyncSocketDevice.cs

@@ -1,17 +1,9 @@
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
+using System;
 using System.Text;
 using System.Net.Sockets;
 using System.Net;
-
-using Aitex.Sorter.Common;
-using Aitex.Core.RT.Log;
 using Aitex.Core.RT.Event;
-using System.Configuration;
 using MECF.Framework.Common.Equipment;
-using System.IO;
 
 namespace MECF.Framework.Common.Communications
 {
@@ -87,9 +79,11 @@ namespace MECF.Framework.Common.Communications
                 if (_socket == null)
                     _socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
 
+                
                 // Connect to the remote endpoint.     
                 _socket.BeginConnect(remoteEP, new AsyncCallback(ConnectCallback), _socket);
 
+
             }
             catch (Exception e)
             {
@@ -98,6 +92,7 @@ namespace MECF.Framework.Common.Communications
             }
 
         }
+      
         private void ConnectCallback(IAsyncResult ar)
         {
             try
@@ -253,16 +248,18 @@ namespace MECF.Framework.Common.Communications
             }
         }
 
-        public bool ReConnect()
+        public bool ReConnect(string ip=null)
         {
             if (IsConnected)
             {
                 return true;
             }
-            _socket.Shutdown(SocketShutdown.Both);
+            
+            //_socket.Shutdown(SocketShutdown.Both);
             _socket.Close();
             _socket.Dispose();
-            Connect(_ip);
+            string address=ip==null?_ip:ip;
+            Connect(address);
             return IsConnected;
         }
     }

+ 69 - 46
Venus/Venus_MainPages/ViewModels/OverKepler2300ViewModel.cs

@@ -18,6 +18,7 @@ using MECF.Framework.Common.CommonData.DeviceData;
 using Path = System.IO.Path;
 using Aitex.Core.RT.Log;
 using System.Windows.Controls;
+//using System.Drawing.Drawing2D;
 
 namespace Venus_MainPages.ViewModels
 {
@@ -99,6 +100,10 @@ namespace Venus_MainPages.ViewModels
         private AITRfData m_SRFData;
         private AITRfData m_BRFData;
 
+        private AITMatchData m_SMatchData;
+        private AITMatchData m_BMatchData;
+
+
         private AITPendulumValveData m_PendulumValveData;
 
         private PMState m_PMCurrentState;
@@ -176,10 +181,10 @@ namespace Venus_MainPages.ViewModels
 
         private int m_ESCHVOutputVoltage;
 
-        private float m_MatchC1;
-        private float m_MatchC2;
-        private float m_BiasMatchC1;
-        private float m_BiasMatchC2;
+        //private float m_MatchC1;
+        //private float m_MatchC2;
+        //private float m_BiasMatchC1;
+        //private float m_BiasMatchC2;
 
         private float m_PendulumValvePosition;
 
@@ -253,39 +258,48 @@ namespace Venus_MainPages.ViewModels
             get { return m_PendulumValvePosition; }
             set { SetProperty(ref m_PendulumValvePosition, value); }
         }
-
-        public float BiasMatchC1
+        public AITMatchData BMatchData
         {
-            get { return m_BiasMatchC1; }
-            set
-            {
-                SetProperty(ref m_BiasMatchC1, value);
-            }
+            get { return m_BMatchData; }
+            set { SetProperty(ref m_BMatchData, value); }
         }
-        public float BiasMatchC2
+        public AITMatchData SMatchData
         {
-            get { return m_BiasMatchC2; }
-            set
-            {
-                SetProperty(ref m_BiasMatchC2, value);
-            }
-        }
-        public float MatchC1
-        {
-            get { return m_MatchC1; }
-            set
-            {
-                SetProperty(ref m_MatchC1, value);
-            }
-        }
-        public float MatchC2
-        {
-            get { return m_MatchC2; }
-            set
-            {
-                SetProperty(ref m_MatchC2, value);
-            }
+            get { return m_SMatchData; }
+            set { SetProperty(ref m_SMatchData, value); }
         }
+        //public float BiasMatchC1
+        //{
+        //    get { return m_BiasMatchC1; }
+        //    set
+        //    {
+        //        SetProperty(ref m_BiasMatchC1, value);
+        //    }
+        //}
+        //public float BiasMatchC2
+        //{
+        //    get { return m_BiasMatchC2; }
+        //    set
+        //    {
+        //        SetProperty(ref m_BiasMatchC2, value);
+        //    }
+        //}
+        //public float MatchC1
+        //{
+        //    get { return m_MatchC1; }
+        //    set
+        //    {
+        //        SetProperty(ref m_MatchC1, value);
+        //    }
+        //}
+        //public float MatchC2
+        //{
+        //    get { return m_MatchC2; }
+        //    set
+        //    {
+        //        SetProperty(ref m_MatchC2, value);
+        //    }
+        //}
 
         public AITPendulumValveData PendulumValveData
         {
@@ -1650,6 +1664,9 @@ namespace Venus_MainPages.ViewModels
             BRFData = CommonFunction.GetValue<AITRfData>(RtDataValues, $"{ModuleName}.{VenusDevice.BiasRf}.DeviceData");
             PendulumValveData = CommonFunction.GetValue<AITPendulumValveData>(RtDataValues, $"{ModuleName}.{VenusDevice.PendulumValve}.DeviceData");
             //ESCHVData= CommonFunction.GetValue<AITHVData>(RtDataValues, $"{ModuleName}.{VenusDevice.ESCHV}.DeviceData");
+            BMatchData = CommonFunction.GetValue<AITMatchData>(RtDataValues, $"{ModuleName}.{VenusDevice.BiasMatch}.DeviceData");
+            SMatchData = CommonFunction.GetValue<AITMatchData>(RtDataValues, $"{ModuleName}.{VenusDevice.Match}.DeviceData");
+
 
 
             ValveHeaterData = (AITHeaterData)RtDataValues[$"{ModuleName}.ValveHeater.DeviceData"];
@@ -1689,11 +1706,11 @@ namespace Venus_MainPages.ViewModels
             ESCHVOutputVoltage = CommonFunction.GetValue<int>(RtDataValues, $"{ModuleName}.ESCHV.OutputVoltage");
 
 
-            MatchC1 = CommonFunction.GetValue<float>(RtDataValues, $"{ModuleName}.{VenusDevice.Match}.C1");
-            MatchC2 = CommonFunction.GetValue<float>(RtDataValues, $"{ModuleName}.{VenusDevice.Match}.C2");
+            //MatchC1 = CommonFunction.GetValue<float>(RtDataValues, $"{ModuleName}.{VenusDevice.Match}.C1");
+            //MatchC2 = CommonFunction.GetValue<float>(RtDataValues, $"{ModuleName}.{VenusDevice.Match}.C2");
 
-            BiasMatchC1 = CommonFunction.GetValue<float>(RtDataValues, $"{ModuleName}.{VenusDevice.BiasMatch}.C1");
-            BiasMatchC2 = CommonFunction.GetValue<float>(RtDataValues, $"{ModuleName}.{VenusDevice.BiasMatch}.C2");
+            //BiasMatchC1 = CommonFunction.GetValue<float>(RtDataValues, $"{ModuleName}.{VenusDevice.BiasMatch}.C1");
+            //BiasMatchC2 = CommonFunction.GetValue<float>(RtDataValues, $"{ModuleName}.{VenusDevice.BiasMatch}.C2");
             TurboPumpWaterFlowSwitch = CommonFunction.GetValue<bool>(RtDataValues, $"{ModuleName}.TurboPumpWaterFlowSwitch.Value");
             IsTurboPumpAtSpeed = CommonFunction.GetValue<bool>(RtDataValues, $"{ModuleName}.IsTurboPumpAtSpeed");
             IsHasWafer = CommonFunction.GetValue<bool>(RtDataValues, $"{ModuleName}.HasWafer");
@@ -1711,11 +1728,11 @@ namespace Venus_MainPages.ViewModels
                 currentRecipeNumber = CurrentRecipeResult.RecipeStepNumber;
 
             }
-            else
-            {
-                CurrentRecipeResult = null;
-                CurrentRecipeStep = null;
-            }
+            //else
+            //{
+            //    CurrentRecipeResult = null;
+            //    CurrentRecipeStep = null;
+            //}
 
             if (Math.Abs(100 - ProcessPressure) > 1 && ProcessPressure < 100)
             {
@@ -1797,12 +1814,12 @@ namespace Venus_MainPages.ViewModels
             m_RtDataKeys.Add($"{ModuleName}.{VenusDevice.BiasRf}.DeviceData");
 
 
-            m_RtDataKeys.Add($"{ModuleName}.{VenusDevice.Match}.C1");
-            m_RtDataKeys.Add($"{ModuleName}.{VenusDevice.Match}.C2");
+            //m_RtDataKeys.Add($"{ModuleName}.{VenusDevice.Match}.C1");
+            //m_RtDataKeys.Add($"{ModuleName}.{VenusDevice.Match}.C2");
             // m_RtDataKeys.Add($"{ModuleName}.{VenusDevice.Match}.WorkMode");
 
-            m_RtDataKeys.Add($"{ModuleName}.{VenusDevice.BiasMatch}.C1");
-            m_RtDataKeys.Add($"{ModuleName}.{VenusDevice.BiasMatch}.C2");
+            //m_RtDataKeys.Add($"{ModuleName}.{VenusDevice.BiasMatch}.C1");
+            //m_RtDataKeys.Add($"{ModuleName}.{VenusDevice.BiasMatch}.C2");
 
             m_RtDataKeys.Add($"{ModuleName}.{VenusDevice.PendulumValve}.DeviceData");
             //m_RtDataKeys.Add($"{ModuleName}.{VenusDevice.ESCHV}.DeviceData");
@@ -1832,6 +1849,12 @@ namespace Venus_MainPages.ViewModels
             m_RtDataKeys.Add($"{ModuleName}.WallHeater.DeviceData");
             m_RtDataKeys.Add($"{ModuleName}.PendulumHeater.DeviceData");
 
+            m_RtDataKeys.Add($"{ModuleName}.{VenusDevice.Match}.DeviceData");
+            m_RtDataKeys.Add($"{ModuleName}.{VenusDevice.BiasMatch}.DeviceData");
+
+
+
+
             m_RtDataKeys.Add($"{ModuleName}.FsmState");
 
             m_RtDataKeys.Add($"{ModuleName}.IsTurboPumpAtSpeed");

+ 8 - 0
Venus/Venus_MainPages/ViewModels/WaferOffsetViewModel.cs

@@ -176,6 +176,10 @@ namespace Venus_MainPages.ViewModels
             _GetDataCommand ?? (_GetDataCommand = new DelegateCommand(getdata));
         public DelegateCommand RemoveDataCommand =>
             _RemoveDataCommand ?? (_RemoveDataCommand = new DelegateCommand(() => PositionInfo = new List<(double x, double y, int arm, string info)>()));
+
+        private DelegateCommand _ShowCommand;
+        public DelegateCommand ShowCommand =>
+            _ShowCommand ?? (_ShowCommand = new DelegateCommand(OnShow));
         private void getdata()
         {
             OffsetItems = QueryDataClient.Instance.Service.QueryOffsetDataByTime(Module_Name, From_date, End_date);
@@ -207,5 +211,9 @@ namespace Venus_MainPages.ViewModels
             }
             PositionInfo = posInfo;
         }
+        private void OnShow()
+        { 
+        
+        }
     }
 }

+ 19 - 19
Venus/Venus_MainPages/Views/OverKepler2300View.xaml

@@ -637,7 +637,7 @@
                 <ctrls:FlowPipe  Height="8"  Width="194" Canvas.Left="1246"  Canvas.Top="535" IsReverse="True" IsFlowing="{Binding TurboPumpPurgeValveIsOpen,Mode=TwoWay}" >
 
                 </ctrls:FlowPipe>
-                <ctrls:FlowPipe  ToolTip="123"   Height="8"  Width="142" Canvas.Left="1448"  Canvas.Top="542" RotateTransformValue="90" IsReverse="True" IsFlowing="{Binding TurboPumpPurgeValveIsOpen}"/>
+                <ctrls:FlowPipe  ToolTip="123"   Height="8"  Width="157" Canvas.Left="1448"  Canvas.Top="542" RotateTransformValue="90" IsReverse="True" IsFlowing="{Binding TurboPumpPurgeValveIsOpen}"/>
                 <ctrls:Pipe2    Canvas.Left="1435"  Canvas.Top="535" HorizontalAlignment="Left" VerticalAlignment="Top"  />
                 <!--<ctrls:FlowPipeValve x:Name="purgevalve"   Height="20" Width="24" Canvas.Left="1458"  Canvas.Top="610" RotateTransformValue="90" IsOpen="{Binding TurboPumpPumpingValveIsOpen,Mode=TwoWay}"/>-->
                 <customControls:CommonValveControl Status="{Binding TurboPumpPurgeValveIsOpen,Mode=TwoWay}"  ValveOrientation="Vertical"  Height="20" Width="20"  Canvas.Left="1434"  Canvas.Top="610" IsCanEdit="{Binding IsAutoMode,Converter={StaticResource BoolToBool}}" Tag="26" Command="{Binding ControlValveCommand}" CommandParameter="{Binding RelativeSource={x:Static RelativeSource.Self}}"/>
@@ -701,12 +701,12 @@
                         </ContextMenu>
                     </ctrls:PendulumValve.ContextMenu>
                 </ctrls:PendulumValve>
-                <Image Canvas.Top="715" Canvas.Left="1425"  Width="40" Height="25"  Source="Pack://application:,,,/Venus_Themes;Component/Resources/Arrow.png" Stretch="Uniform">
+                <Image Canvas.Top="730" Canvas.Left="1425"  Width="40" Height="25"  Source="Pack://application:,,,/Venus_Themes;Component/Resources/Arrow.png" Stretch="Uniform">
                     <Image.RenderTransform>
                         <RotateTransform Angle="-90"/>
                     </Image.RenderTransform>
                 </Image>
-                <TextBlock Text="N2" Canvas.Top="720" Canvas.Left="1438"/>
+                <TextBlock Text="N2" Canvas.Top="735" Canvas.Left="1438"/>
 
                 <!--<Image  Canvas.Top="650" Canvas.Left="715"  Width="40" Height="25"  Source="Pack://application:,,,/Venus_Themes;Component/Resources/Arrow.png" Stretch="Uniform" >
 
@@ -835,8 +835,8 @@
 
                 <TextBlock Grid.Row="1" Grid.Column="2" Width="Auto" Height="Auto" Text="{Binding SRFData.ForwardPower,StringFormat='F1'}"  Background="#E6ECF5" Block.TextAlignment="Center" Padding="0 5 0 0" />
                 <!--<TextBlock Grid.Row="2" Grid.Column="2" Width="Auto" Height="Auto" Text="0.0"  Background="#E8E8E8" TextBlock.TextAlignment="Center" VerticalAlignment="Center" Block.TextAlignment="Center"/>-->
-                <TextBlock Grid.Row="3" Grid.Column="2" Width="Auto" Height="Auto" Text="{Binding MatchC1,StringFormat='N0'}" Background="#E6ECF5" Block.TextAlignment="Center" Padding="0 5 0 0"/>
-                <TextBlock Grid.Row="4" Grid.Column="2" Width="Auto" Height="Auto" Text="{Binding MatchC2,StringFormat='N0'}"  Background="#E6ECF5" Block.TextAlignment="Center" Padding="0 5 0 0"/>
+                <TextBlock Grid.Row="3" Grid.Column="2" Width="Auto" Height="Auto" Text="{Binding SMatchData.C1,StringFormat='N0'}" Background="#E6ECF5" Block.TextAlignment="Center" Padding="0 5 0 0"/>
+                <TextBlock Grid.Row="4" Grid.Column="2" Width="Auto" Height="Auto" Text="{Binding SMatchData.C2,StringFormat='N0'}"  Background="#E6ECF5" Block.TextAlignment="Center" Padding="0 5 0 0"/>
 
                 <TextBlock  Text="Bias RF" Grid.Row="5" FontSize="15" Grid.ColumnSpan="3" VerticalAlignment="Center"  HorizontalAlignment="Center"/>
 
@@ -855,8 +855,8 @@
 
                 <TextBlock Grid.Row="6" Grid.Column="2" Width="Auto" Height="Auto" Text="{Binding BRFData.ForwardPower,StringFormat='F1'}"  Background="#E6ECF5" Block.TextAlignment="Center" Padding="0 5 0 0"/>
                 <TextBlock Grid.Row="7" Grid.Column="1" Width="Auto" Height="Auto" Text="{Binding BRFData.ReflectPower,StringFormat='F1'}"  Background="#E6ECF5" Block.TextAlignment="Center" Padding="0 5 0 0" Grid.ColumnSpan="2"/>
-                <TextBlock Grid.Row="8" Grid.Column="2" Width="Auto" Height="Auto" Text="{Binding BiasMatchC1,StringFormat='N0'}"  Background="#E6ECF5" Block.TextAlignment="Center" Padding="0 5 0 0"/>
-                <TextBlock Grid.Row="9" Grid.Column="2" Width="Auto" Height="Auto" Text="{Binding BiasMatchC2,StringFormat='N0'}"  Background="#E6ECF5" TextBlock.TextAlignment="Center" Padding="0 5 0 0"/>
+                <TextBlock Grid.Row="8" Grid.Column="2" Width="Auto" Height="Auto" Text="{Binding BMatchData.C1,StringFormat='N0'}"  Background="#E6ECF5" Block.TextAlignment="Center" Padding="0 5 0 0"/>
+                <TextBlock Grid.Row="9" Grid.Column="2" Width="Auto" Height="Auto" Text="{Binding BMatchData.C2,StringFormat='N0'}"  Background="#E6ECF5" TextBlock.TextAlignment="Center" Padding="0 5 0 0"/>
                 <!--<TextBlock Grid.Row="10" Grid.Column="2" Width="Auto" Height="Auto" Text="0.0"  Background="#E8E8E8" TextBlock.TextAlignment="Center" VerticalAlignment="Center" Block.TextAlignment="Center"/>-->
 
             </Grid>
@@ -1155,23 +1155,23 @@
                 <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="#F5F7FA"   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="#F5F7FA"   TextBlock.TextAlignment="Center"    Block.TextAlignment="Center" Padding="0,6,0,0"/>
+                <TextBlock Grid.Row="1" Grid.Column="2"  Text="{Binding SRFData.PowerSetPoint}"          Background="#F5F7FA"   TextBlock.TextAlignment="Center"    Block.TextAlignment="Center" Padding="0,6,0,0"/>
                 <TextBlock Grid.Row="2"  Grid.Column="2" Text="N/A"           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="#F5F7FA"   TextBlock.TextAlignment="Center" Padding="0,5,0,0" Block.TextAlignment="Center"/>
+                <TextBlock Grid.Row="3"  Grid.Column="2" Text="{Binding BRFData.PowerSetPoint}"            Background="#F5F7FA"   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="#F5F7FA"   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="5"  Grid.Column="2" Text="{Binding MatchData.C1SetPoint}"           Background="#F5F7FA"   TextBlock.TextAlignment="Center" Padding="0,5,0,0" Block.TextAlignment="Center"/>
+                <TextBlock Grid.Row="6"  Grid.Column="2" Text="{Binding MatchData.C2SetPoint}"          Background="#E9EDF4"  TextBlock.TextAlignment="Center" Padding="0,5,0,0" Block.TextAlignment="Center"/>
                 <TextBlock Grid.Row="7"  Grid.Column="2" Text="N/A"           Background="#F5F7FA"   TextBlock.TextAlignment="Center" Padding="0,5,0,0" Block.TextAlignment="Center"/>
                 <TextBlock Grid.Row="8"  Grid.Column="2" Text="{Binding CurrentRecipeStep.LstUnit[0].StartPressure}"      Background="#E9EDF4"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
                 <TextBlock Grid.Row="9"  Grid.Column="2" Text="{Binding CurrentRecipeStep.LstUnit[0].ValvePositionPreset}"       Background="#F5F7FA"   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"/>
-                <TextBlock Grid.Row="11"  Grid.Column="2" Text="{Binding CurrentRecipeStep.LstUnit[3].Gas2}"       Background="#F5F7FA"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
-                <TextBlock Grid.Row="12"  Grid.Column="2" Text="{Binding CurrentRecipeStep.LstUnit[3].Gas3}"       Background="#E9EDF4"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
-                <TextBlock Grid.Row="13"  Grid.Column="2" Text="{Binding CurrentRecipeStep.LstUnit[3].Gas4}"       Background="#F5F7FA"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
-                <TextBlock Grid.Row="14"  Grid.Column="2" Text="{Binding CurrentRecipeStep.LstUnit[3].Gas5}"      Background="#E9EDF4"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
-                <TextBlock Grid.Row="15"  Grid.Column="2" Text="{Binding CurrentRecipeStep.LstUnit[3].Gas6}"       Background="#F5F7FA"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
-                <TextBlock Grid.Row="16"  Grid.Column="2" Text="{Binding CurrentRecipeStep.LstUnit[3].Gas7}"       Background="#E9EDF4"  TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
-                <TextBlock Grid.Row="17"  Grid.Column="2" Text="{Binding CurrentRecipeStep.LstUnit[3].Gas8}"       Background="#F5F7FA"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
+                <TextBlock Grid.Row="10"  Grid.Column="2" Text="{Binding MFC1Data.SetPoint}"       Background="#E9EDF4"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
+                <TextBlock Grid.Row="11"  Grid.Column="2" Text="{Binding MFC2Data.SetPoint}"       Background="#F5F7FA"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
+                <TextBlock Grid.Row="12"  Grid.Column="2" Text="{Binding MFC3Data.SetPoint}"       Background="#E9EDF4"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
+                <TextBlock Grid.Row="13"  Grid.Column="2" Text="{Binding MFC4Data.SetPoint}"       Background="#F5F7FA"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
+                <TextBlock Grid.Row="14"  Grid.Column="2" Text="{Binding MFC5Data.SetPoint}"      Background="#E9EDF4"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
+                <TextBlock Grid.Row="15"  Grid.Column="2" Text="{Binding MFC6Data.SetPoint}"       Background="#F5F7FA"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
+                <TextBlock Grid.Row="16"  Grid.Column="2" Text="{Binding MFC7Data.SetPoint}"       Background="#E9EDF4"  TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
+                <TextBlock Grid.Row="17"  Grid.Column="2" Text="{Binding MFC8Data.SetPoint}"       Background="#F5F7FA"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
                 <!--<TextBlock Grid.Row="18"  Grid.Column="2" Text="{Binding CurrentRecipeStep.LstUnit[4].ESCClampValtage}"          Background="#E9EDF4"  TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center" />
                 <TextBlock Grid.Row="19"  Grid.Column="2" Text="{Binding CurrentRecipeStep.LstUnit[4].Temperature}"        Background="#F5F7FA"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>
                 <TextBlock Grid.Row="20"  Grid.Column="2" Text="{Binding CurrentRecipeStep.LstUnit[4].BacksideHelum}"       Background="#E9EDF4"   TextBlock.TextAlignment="Center" Padding="0,6,0,0" Block.TextAlignment="Center"/>

+ 84 - 31
Venus/Venus_MainPages/Views/WaferOffsetView.xaml

@@ -80,38 +80,91 @@
                 <TextBlock Margin="5,0"> : Lower ARM</TextBlock>
             </StackPanel>
         </Grid>
-        <!-- 数据wafer offset栏 -->
-        <ListBox Grid.Column="1" Grid.Row="1" Margin="40,0,0,0" ItemsSource="{Binding AwcModulesList}" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
-            <ListBox.ItemContainerStyle>
-                <Style TargetType="ListBoxItem">
-                    <Setter Property="IsSelected" Value="{Binding Content.IsSelected, Mode=TwoWay, RelativeSource={RelativeSource Self}}"/>
-                    <Setter Property="Template">
-                        <Setter.Value>
-                            <ControlTemplate TargetType="ListBoxItem">
-                                <ContentPresenter/>
-                            </ControlTemplate>
-                        </Setter.Value>
-                    </Setter>
-                </Style>
-            </ListBox.ItemContainerStyle>
-            <ListBox.ItemsPanel>
-                <ItemsPanelTemplate>
-                    <WrapPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="40,0" ScrollViewer.CanContentScroll="True"/>
-                </ItemsPanelTemplate>
-            </ListBox.ItemsPanel>
-            <ListBox.ItemTemplate>
-                <DataTemplate>
-                    <Canvas Width="400" Height="350" Margin="10,0">
-                        <TextBlock Canvas.Top="0" Canvas.Left="165" Text="{Binding Module_Name,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
+        <Grid Grid.Column="1" Grid.Row="1" Margin="-30,0,0,0">
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition Width="3*"/>
+                <ColumnDefinition/>
+            </Grid.ColumnDefinitions>
+            <!-- 数据wafer offset栏 -->
+            <ListBox  ItemsSource="{Binding AwcModulesList}" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+                <ListBox.ItemContainerStyle>
+                    <Style TargetType="ListBoxItem">
+                        <Setter Property="IsSelected" Value="{Binding Content.IsSelected, Mode=TwoWay, RelativeSource={RelativeSource Self}}"/>
+                        <Setter Property="Template">
+                            <Setter.Value>
+                                <ControlTemplate TargetType="ListBoxItem">
+                                    <ContentPresenter/>
+                                </ControlTemplate>
+                            </Setter.Value>
+                        </Setter>
+                    </Style>
+                </ListBox.ItemContainerStyle>
+                <ListBox.ItemsPanel>
+                    <ItemsPanelTemplate>
+                        <WrapPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="40,0" ScrollViewer.CanContentScroll="True"/>
+                    </ItemsPanelTemplate>
+                </ListBox.ItemsPanel>
+                <ListBox.ItemTemplate>
+                    <DataTemplate>
+                        <Canvas Width="400" Height="350" Margin="10,0">
+                            <TextBlock Canvas.Top="0" Canvas.Left="165" Text="{Binding Module_Name,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
+
+                            <ctrls:Axes2D Canvas.Top="15" Canvas.Left="30" AxesHeight="300" AxesWidth="300" WaferRadius="300" SafeRadius="100" PositionAndKey="{Binding PositionInfo,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"></ctrls:Axes2D>
+                            <Button Width="50" Canvas.Right="10" Canvas.Bottom="100" Padding="3,2" Command="{Binding GetDataCommand}">Draw</Button>
+                            <Button Width="50" Canvas.Right="10" Canvas.Bottom="70"  Padding="3,2" Command="{Binding ShowCommand}">Show</Button>
+                            <Button Width="50" Canvas.Right="10" Canvas.Bottom="40"  Padding="3,2" Command="{Binding RemoveDataCommand}">Clear</Button>
+                        </Canvas>
+
+                    </DataTemplate>
+                </ListBox.ItemTemplate>
+            </ListBox>
+            <!---->
+
+            <DataGrid Grid.Column="1" Grid.Row="2" Margin="-180,-80,0,0" Height="670" Width="620" AutoGenerateColumns="False" BorderThickness="0"  FontSize="12" MinRowHeight="20" VerticalAlignment="Stretch"
+                        CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False" CanUserResizeColumns="True" CanUserResizeRows="False" CanUserSortColumns="False" 
+                        SelectionMode="Single" SelectionUnit="FullRow" Background="#05000000" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled"
+                        ItemsSource="{Binding OffsetItems}"  FontFamily="Arial,SimSun">
+                <DataGrid.Columns>
+                    <DataGridTextColumn Width="100" Binding="{Binding SourceModule}"   CanUserSort="False" CanUserReorder="False" IsReadOnly="True" >
+                        <DataGridTextColumn.HeaderTemplate >
+                            <DataTemplate>
+                                <TextBlock Text="SourceModule" />
+                            </DataTemplate>
+                        </DataGridTextColumn.HeaderTemplate>
+                    </DataGridTextColumn>
+                    <DataGridTextColumn Width="100" Binding="{Binding DestinationModule}"   CanUserSort="False" CanUserReorder="False" IsReadOnly="True" >
+                        <DataGridTextColumn.HeaderTemplate >
+                            <DataTemplate>
+                                <TextBlock Text="DestinationModule" />
+                            </DataTemplate>
+                        </DataGridTextColumn.HeaderTemplate>
+                    </DataGridTextColumn>
+                    <DataGridTextColumn Width="100" Binding="{Binding OffsetX}"   CanUserSort="False" CanUserReorder="False" IsReadOnly="True" >
+                        <DataGridTextColumn.HeaderTemplate >
+                            <DataTemplate>
+                                <TextBlock Text="OffsetX" />
+                            </DataTemplate>
+                        </DataGridTextColumn.HeaderTemplate>
+                    </DataGridTextColumn>
+                    <DataGridTextColumn Width="60" Binding="{Binding OffsetY}"   CanUserSort="False" CanUserReorder="False" IsReadOnly="True" >
+                        <DataGridTextColumn.HeaderTemplate >
+                            <DataTemplate>
+                                <TextBlock Text="OffsetY" />
+                            </DataTemplate>
+                        </DataGridTextColumn.HeaderTemplate>
+                    </DataGridTextColumn>
+                    <DataGridTextColumn Width="80" Binding="{Binding OffsetD}"   CanUserSort="False" CanUserReorder="False" IsReadOnly="True" >
+                        <DataGridTextColumn.HeaderTemplate >
+                            <DataTemplate>
+                                <TextBlock Text="OffsetD" />
+                            </DataTemplate>
+                        </DataGridTextColumn.HeaderTemplate>
+                    </DataGridTextColumn>
+                
+                </DataGrid.Columns>
+            </DataGrid>
+        </Grid>
 
-                        <ctrls:Axes2D Canvas.Top="15" Canvas.Left="30" AxesHeight="300" AxesWidth="300" WaferRadius="300" SafeRadius="100" PositionAndKey="{Binding PositionInfo,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"></ctrls:Axes2D>
-                        <Button Canvas.Right="10" Canvas.Bottom="70" Padding="3,2" Command="{Binding GetDataCommand}">Draw</Button>
-                        <Button Canvas.Right="10" Canvas.Bottom="40" Padding="3,2" Command="{Binding RemoveDataCommand}">Clear</Button>
-                    </Canvas>
 
-                </DataTemplate>
-            </ListBox.ItemTemplate>
-        </ListBox>
-        <!---->
     </Grid>
 </UserControl>

+ 1 - 1
Venus/Venus_RT/App.config

@@ -32,7 +32,7 @@
 	<connectionStrings>
 		<add name="PostgreSQL"   connectionString="Server=localhost;Port=5432;User Id=postgres;Password=123456;Database=postgres;Enlist=true;Preload Reader=true;" />
 		<!--0是other,1是kepler2300,2是Kepler2200,3是VenusSE,4是VenusDE-->
-		<add name="ConfigType"   connectionString="1"/>
+		<add name="ConfigType"   connectionString="2"/>
 	</connectionStrings>
 	<system.serviceModel>
 		<!--<diagnostics>

+ 11 - 9
Venus/Venus_RT/Devices/JetKepler2300PM.cs

@@ -718,21 +718,23 @@ namespace Venus_RT.Devices
 
         public override void Home()
         {
+
+            _pendulumValve.ReConnect();
             // 与yp讨论过,PM 初始化不需要
 
             SetLiftPin(MovementPosition.Down, out _);
 
 
-            if (_slitDoor.State == CylinderState.Open)
-            {
-                SetSlitDoor(true, out _);
-            }
-            else
-            {
-                SetSlitDoor(false, out _);
-            }
+            //if (_slitDoor.State == CylinderState.Open)
+            //{
+            //    SetSlitDoor(true, out _);
+            //}
+            //else
+            //{
+            //    SetSlitDoor(false, out _);
+            //}
 
-            SetSlitDoor(false, out _);
+            //SetSlitDoor(false, out _);
 
             //2023/03/08添加
             OpenValve(ValveType.PVN22, true);

+ 12 - 1
Venus/Venus_RT/Devices/PendulumValve.cs

@@ -198,6 +198,8 @@ namespace Venus_RT.Devices
 
         private float m_PressureSetPoint;
         private float m_PositionSetPoint;
+        //private ModuleName _mod;
+
         public AITPendulumValveData DeviceData
         {
             get
@@ -269,7 +271,7 @@ namespace Venus_RT.Devices
                 SendCommand(_querys[_queryFlag++ % _querys.Length]);
                 _queryWatch.Restart();
             }
-            //var isopen = _serial.IsOpen();
+            ClearDeviceValue();
         }
 
         public void Reset()
@@ -609,5 +611,14 @@ namespace Venus_RT.Devices
         {
             return _serial.ReConnect();
         }
+        private void ClearDeviceValue()
+        {
+            if (_serial.IsConnected==false)
+            {
+                Pressure = 0;
+                IsOpen = false;
+                Position = 0;
+            }        
+        }
     }
 }

+ 8 - 5
Venus/Venus_RT/Devices/RevtechMatch.cs

@@ -9,6 +9,7 @@ using MECF.Framework.Common.Equipment;
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Runtime.InteropServices;
 using System.Text;
 using Venus_Core;
 
@@ -43,6 +44,7 @@ namespace Venus_RT.Devices
         private float c1SetPoint;
         private float c2SetPoint;
 
+        private VenusDevice _device;
         public new AITMatchData DeviceData =>
             new AITMatchData
             {
@@ -58,8 +60,9 @@ namespace Venus_RT.Devices
             };
         public RevtechMatch(ModuleName mod, VenusDevice venusDevice, MatchCommunicationType matchCommunicationType) : base(mod.ToString(), venusDevice.ToString())
         {
+           
+            _device = venusDevice;
             //var test = System.IO.Ports.SerialPort.GetPortNames();
-
             _matchCommunicationType = matchCommunicationType;
             if (matchCommunicationType == MatchCommunicationType.RS232)
             {
@@ -197,7 +200,6 @@ namespace Venus_RT.Devices
                         Vpp = matchData[12];
                         DCBias = Convert.ToSingle(matchData[13]);
                     }
-
                 }
             }
             catch
@@ -278,12 +280,13 @@ namespace Venus_RT.Devices
         public override bool ReConnect()
         {
             if (_matchCommunicationType == MatchCommunicationType.RS232)
-            {
-              return  _serial.ReConnect();
+            {            
+                return  _serial.ReConnect();
             }
             else if (_matchCommunicationType == MatchCommunicationType.Ethernet)
             {
-               return _socket.ReConnect();
+                //var ip = SC.GetStringValue($"{Module}.{_device}.IPAddress");
+                return _socket.ReConnect();
             }
             return false;
         }