Просмотр исходного кода

代码合并

# Conflicts:
#	Venus/Venus_RT/Modules/PMs/PMEntity.cs
lixiang лет назад: 2
Родитель
Сommit
b2c09224e9

+ 4 - 4
Venus/Framework/Common/Communications/AsyncSocketDevice.cs

@@ -171,7 +171,7 @@ namespace MECF.Framework.Common.Communications
             }
             catch (Exception ex)
             {
-                LOG.WriteExeption(ex);
+                //LOG.WriteExeption(ex);
                 string reason = string.Format("TCP Socket recevice data failed:{0}", ex.Message);
                 //LOG.Error(string.Format("Communication  {0}:{1:D} {2}.", _ip, _port, reason));
                 OnErrorHappened(new ErrorEventArgsDevice(reason));
@@ -196,7 +196,7 @@ namespace MECF.Framework.Common.Communications
             }
             catch (Exception ex)
             {
-                LOG.WriteExeption(ex);
+                //LOG.WriteExeption(ex);
                 //LOG.Info(string.Format("Communication {0}:{1:D} Send {2}. failed", _ip, _port, data));
 
                 string reason = string.Format("Send command failed:{0}", ex.Message);
@@ -218,7 +218,7 @@ namespace MECF.Framework.Common.Communications
             }
             catch (Exception ex)
             {
-                LOG.WriteExeption(ex);
+                //LOG.WriteExeption(ex);
                 string reason = string.Format("Send command failed:{0}", ex.Message);
 
                 OnErrorHappened(new ErrorEventArgsDevice(reason));
@@ -246,7 +246,7 @@ namespace MECF.Framework.Common.Communications
             }
             catch (Exception ex)
             {
-                LOG.WriteExeption(ex);
+                //LOG.WriteExeption(ex);
                 string reason = string.Format("释放socket资源失败:{0}", ex.Message);
                 OnErrorHappened(new ErrorEventArgsDevice(reason));
             }

+ 1 - 1
Venus/Framework/RTCore/IoProviders/Mitsubishis/MCSocket.cs

@@ -113,7 +113,7 @@ namespace MECF.Framework.RT.Core.IoProviders
             }
             catch (Exception ex)
             {
-                LOG.WriteExeption($"Receive data failed, from {m_strAddress}:{m_nPort}", ex);
+                //LOG.WriteExeption($"Receive data failed, from {m_strAddress}:{m_nPort}", ex);
                 return false;
             }
 

+ 124 - 33
Venus/Venus_MainPages/ViewModels/OverViewModel.cs

@@ -11,6 +11,7 @@ using System.Collections.ObjectModel;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using System.Windows;
 using System.Windows.Threading;
 using Venus_Core;
 
@@ -59,9 +60,14 @@ namespace Venus_MainPages.ViewModels
 
         //private ObservableCollection<IOItem<float>> m_RtAiValues;
         //private ObservableCollection<AOItem> m_RtAOs;
+
+        //private string m_BasePressureSetPoint;
+        //private string m_PumpLimitSetPoint;
         #endregion
 
         #region  属性      
+
+      
         public Dictionary<string, object> RtConfigValues
         {
             get { return m_RtConfigValues; }
@@ -210,6 +216,16 @@ namespace Venus_MainPages.ViewModels
             get { return m_IsVAC; }
             set { SetProperty(ref m_IsVAC, value); }
         }
+
+        public string BasePressureSetPoint
+        {
+            get { return RtConfigValues[$"{ModuleName}.Pump.PumpBasePressure"].ToString(); }
+        }
+
+        public string PumpLimitSetPoint
+        {
+            get { return RtConfigValues[$"{ModuleName}.Pump.PumpTimeLimit"].ToString(); }
+        }
         #endregion
 
         #region 命令
@@ -281,32 +297,45 @@ namespace Venus_MainPages.ViewModels
         }
         private void OnGas()
         {
-            closeAllValve();
-            Task.Run(() =>
+            //closeAllValve();
+            //Task.Run(() =>
+            //{
+            //    //System.Threading.Thread.Sleep(100);
+            //    VN2Valve1IsOpen = true;
+            //    VN2Valve2IsOpen = true;
+            //    VN2Valve3IsOpen = true;
+            //    GasFinalValveIsOpen = true;
+            //    Gas1Valve1IsOpen = true;
+            //    Gas1Valve2IsOpen = true;
+            //    Gas1Valve3IsOpen = true;
+            //    Gas2Valve1IsOpen = true;
+            //    Gas2Valve2IsOpen = true;
+            //    Gas2Valve3IsOpen = true;
+            //    Gas3Valve1IsOpen = true;
+            //    Gas3Valve2IsOpen = true;
+            //    Gas3Valve3IsOpen = true;
+            //    Gas4Valve1IsOpen = true;
+            //    Gas4Valve2IsOpen = true;
+            //    Gas4Valve3IsOpen = true;
+            //    Gas5ValveIsOpen = true;
+            //    Gas6ValveIsOpen = true;
+            //    Gas7ValveIsOpen = true;
+            //    Gas8ValveIsOpen = true;
+            //});
+            object[] mfc = new object[8];
+            //string[] mfcSetPoint = new string[8];
+            for (int index = 0; index < mfc.Length; index++)
             {
-                //System.Threading.Thread.Sleep(100);
-                VN2Valve1IsOpen = true;
-                VN2Valve2IsOpen = true;
-                VN2Valve3IsOpen = true;
-                GasFinalValveIsOpen = true;
-                Gas1Valve1IsOpen = true;
-                Gas1Valve2IsOpen = true;
-                Gas1Valve3IsOpen = true;
-                Gas2Valve1IsOpen = true;
-                Gas2Valve2IsOpen = true;
-                Gas2Valve3IsOpen = true;
-                Gas3Valve1IsOpen = true;
-                Gas3Valve2IsOpen = true;
-                Gas3Valve3IsOpen = true;
-                Gas4Valve1IsOpen = true;
-                Gas4Valve2IsOpen = true;
-                Gas4Valve3IsOpen = true;
-                Gas5ValveIsOpen = true;
-                Gas6ValveIsOpen = true;
-                Gas7ValveIsOpen = true;
-                Gas8ValveIsOpen = true;
-            });
-
+                //mfcSetPoint[index] = PMParameters.Find(x => x.Name == $"{SystemName}.IoMfc.MfcGas{index + 1}.FeedBack").Setpoint;
+                //if (string.IsNullOrWhiteSpace(mfcSetPoint[index]))
+                //{
+                //    DialogBox.ShowError("请输入气体流量值");
+                //    return;
+                //}
+                //mfcSetPoint[index]=
+                //mfc[index] = Convert.ToDouble(string.IsNullOrEmpty(mfcSetPoint[index]) ? "0.0" : mfcSetPoint[index]);
+                //QueryDataClient.Instance.Service.GetConfig()
+            }
 
         }
 
@@ -319,11 +348,19 @@ namespace Venus_MainPages.ViewModels
 
         private void OnPurge()
         {
-            closeAllValve();
-            Task.Run(() => 
-            { 
-            PurgeValveIsOpen = true;
-            });
+            //closeAllValve();
+            //Task.Run(() => 
+            //{ 
+            //PurgeValveIsOpen = true;
+            //});
+            if (RtDataValues[$"{ModuleName}.FsmState"].ToString() == "Purge")
+            {
+                InvokeClient.Instance.Service.DoOperation($"{ModuleName}.StopPurge");
+            }
+            else
+            {
+                InvokeClient.Instance.Service.DoOperation($"{ModuleName}.Purge");
+            }
         }
 
         private void OnVent()
@@ -343,10 +380,48 @@ namespace Venus_MainPages.ViewModels
 
         private void OnPump()
         {
-            if (PumpIsOpen == true)
+            //if (PumpIsOpen == true)
+            //{
+            //    FastPumpValveIsOpen = true;
+            //}
+            //if (RtDataValues[$"{ModuleName}.FsmState"].ToString() == "LaunchingPump")
+            //{ 
+
+            //}
+            if (RtDataValues[$"{ModuleName}.FsmState"].ToString() == "Pumping")
+            {
+                InvokeClient.Instance.Service.DoOperation($"{ModuleName}.{RtOperation.Abort}");
+                return;
+            }
+
+            if (RtDataValues[$"{ModuleName}.FsmState"].ToString() == "IsPumpingOkForProcess")
+            {
+                InvokeClient.Instance.Service.DoOperation($"{ModuleName}.StopPump");
+                return;
+            }
+
+            // 设置底压
+            double basePressure = string.IsNullOrEmpty(BasePressureSetPoint) ? 0 : Convert.ToDouble(BasePressureSetPoint);
+
+            if (basePressure <= 0.01 || basePressure >= 1000)
+            {
+                MessageBox.Show($"基准压力设定值 {basePressure} 无效,应该在0到1000毫托之间");
+                return;
+            }
+
+            double pumpLimit = string.IsNullOrEmpty(PumpLimitSetPoint) ? 0 : Convert.ToDouble(PumpLimitSetPoint);
+
+            if (pumpLimit <= 0.01 || pumpLimit >= 1200)
             {
-                FastPumpValveIsOpen = true;
-            }          
+                MessageBox.Show($"抽气时间应该在0到1200之间,当前设定值{pumpLimit}");
+                return;
+            }
+
+            InvokeClient.Instance.Service.DoOperation("System.SetConfig", $"{ModuleName}.Pump.PumpBasePressure", basePressure.ToString());
+
+            InvokeClient.Instance.Service.DoOperation("System.SetConfig", $"{ModuleName}.Pump.PumpTimeLimit", pumpLimit.ToString());
+
+            InvokeClient.Instance.Service.DoOperation($"{ModuleName}.Pump");
         }
 
         private void OnOpenPump()
@@ -373,10 +448,23 @@ namespace Venus_MainPages.ViewModels
             m_RtConfigKeys.Add($"{ModuleName}.MfcGas6.GasName");
             m_RtConfigKeys.Add($"{ModuleName}.MfcGas7.GasName");
             m_RtConfigKeys.Add($"{ModuleName}.MfcGas8.GasName");
+
+            m_RtConfigKeys.Add($"{ModuleName}.Pump.PumpBasePressure");
+            m_RtConfigKeys.Add($"{ModuleName}.Pump.PumpTimeLimit");
         }
         private void addDataKeys()
         {
             m_RtDataKeys.Add($"{ModuleName}.FsmState");
+
+            m_RtDataKeys.Add($"{ModuleName}.MfcGas1.FeedBack");
+            m_RtDataKeys.Add($"{ModuleName}.MfcGas2.FeedBack");
+            m_RtDataKeys.Add($"{ModuleName}.MfcGas3.FeedBack");
+            m_RtDataKeys.Add($"{ModuleName}.MfcGas4.FeedBack");
+            m_RtDataKeys.Add($"{ModuleName}.MfcGas5.FeedBack");
+            m_RtDataKeys.Add($"{ModuleName}.MfcGas6.FeedBack");
+            m_RtDataKeys.Add($"{ModuleName}.MfcGas7.FeedBack");
+            m_RtDataKeys.Add($"{ModuleName}.MfcGas8.FeedBack");
+
             m_RtDataKeys.Add($"{ModuleName}.MfcGas1.FeedBack");
             m_RtDataKeys.Add($"{ModuleName}.MfcGas2.FeedBack");
             m_RtDataKeys.Add($"{ModuleName}.MfcGas3.FeedBack");
@@ -396,6 +484,9 @@ namespace Venus_MainPages.ViewModels
             m_RtDataKeys.Add($"{ModuleName}.LiftPinIsUp");
             m_RtDataKeys.Add($"{ModuleName}.LiftPinIsDown");
 
+            //m_RtDataKeys.Add($"{ModuleName}.Pump.PumpBasePressure");
+            //m_RtDataKeys.Add($"{ModuleName}.Pump.PumpTimeLimit");
+
 
 
 

+ 1 - 1
Venus/Venus_RT/Config/System.sccfg

@@ -163,7 +163,7 @@
 		<configs name="DryPump" nameView="Dry Pump" >
 			<config default="1" name="MFG" nameView="MFG" description="厂商, 1:Sky; 2:Edwards" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
 			<config default="1" name="CommunicationType" nameView="Communication Type" description="0:Analogue; 1:RS232; 2:Ethernet" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
-			<config default="COM13" name="Port" nameView="Port" description="serial port name of pump" max="" min="" paramter="" tag="" unit="" type="String" />
+			<config default="COM22" name="Port" nameView="Port" description="serial port name of pump" max="" min="" paramter="" tag="" unit="" type="String" />
 			<config default="1000" name="ChamberForelinePressureThreshold" nameView="Chamber Foreline Pressure Threshold" description="" max="10000" min="0" paramter="" tag="" unit="mtorr" type="Double" />
 			<config default="20" name="ChamberForelinePressureTimeout" nameView="Chamber Foreline Pressure Timeout" description="" max="3000" min="0" paramter="" tag="" unit="s" type="Integer" />
 		</configs>

+ 4 - 0
Venus/Venus_RT/Devices/JetPM.cs

@@ -390,6 +390,10 @@ namespace Venus_RT.Devices
             DATA.Subscribe($"{Name}.IsVAC", () => IsVAC);
             DATA.Subscribe($"{Name}.LiftPinIsUp", () => LiftPinIsUp);
             DATA.Subscribe($"{Name}.LiftPinIsDown", () => LiftPinIsDown);
+            //for (int i = 0; i < 8; i++)
+            //{
+            //    DATA.Subscribe($"{Name}.ForelinePressure", () => _gasLines[i].FlowSP);
+            //}
         }
 
 

+ 4 - 0
Venus/Venus_RT/Modules/PMs/PMPurgeRoutine.cs

@@ -37,6 +37,10 @@ namespace Venus_RT.Modules.PMs
 
         public RState Start(params object[] objs)
         {
+            var test1 = CheckLidLoadLock();
+            var test2 = CheckSlitDoor();
+            var test3 = CheckDryPump();
+            var test4 = CheckTurboPump();
             if (CheckLidLoadLock() &&
                 CheckSlitDoor() &&
                 CheckDryPump() &&