Browse Source

Debug devices on tools

sangwq 2 years ago
parent
commit
d22b60372f

+ 1 - 1
Venus/Venus_RT/Devices/AdixenTurboPump.cs

@@ -202,7 +202,7 @@ namespace Venus_RT.Devices
             _serial.OnDataChanged += OnPortDataChanged;
             _serial.OnBinaryDataChanged += OnPortBinaryDataChanged;
             _serial.OnErrorHappened += OnErrorOccurred;
-
+            _queryWatch.Start();
             return true;
         }
 

+ 2 - 0
Venus/Venus_RT/Devices/ESC5HighVoltage.cs

@@ -115,6 +115,8 @@ namespace Venus_RT.Devices
             _serial.OnDataChanged += OnPortDataChanged;
             _serial.OnErrorHappened += OnErrorOccurred;
             _queryWatch.Restart();
+
+            SendCommand(Operation.Attention);
             return true;
         }
 

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

@@ -234,7 +234,7 @@ namespace Venus_RT.Devices
                         {
                             int position;
                             if (int.TryParse(data[1], out position))
-                                Position = position;
+                                Position = position / 1000;
                         }
                         break;
                     case "i":

+ 31 - 3
Venus/Venus_RT/Modules/PMs/GasFlowRoutine.cs

@@ -22,10 +22,21 @@ namespace Venus_RT.Modules.PMs
 
         public RState Start(params object[] objs)
         {
-            if (!_chamber.IsFastPumpOpened)
+            //if (!_chamber.IsFastPumpOpened)
+            //{
+            //    StopFlow();
+            //    Stop("Pump 阀没有打开");
+            //    return RState.Failed;
+            //}
+
+            if(!CheckTurboPump())
             {
-                StopFlow();
-                Stop("Pump 阀没有打开");
+                return RState.Failed;
+            }
+
+            if(_chamber.GetPVPosition() == 0)
+            {
+                Stop("钟摆阀没有打开");
                 return RState.Failed;
             }
 
@@ -63,12 +74,25 @@ namespace Venus_RT.Modules.PMs
         {
             for (int index = 0; index < _mfcSetPoint.Length; index++)
             {
+                if (_mfcSetPoint[index] > 0)
+                    OpenPVNVlv(index, true);
+
                 _chamber.FlowGas(index, _mfcSetPoint[index]);
+
             }
 
             return true;
         }
 
+        private void OpenPVNVlv(int mfcIndex, bool on)
+        {
+            ValveType[] vlvs = new ValveType[] { ValveType.PV11, ValveType.PV21, ValveType.PV31, ValveType.PV41 };
+            if (mfcIndex < 4)
+            {
+                _chamber.OpenValve(vlvs[mfcIndex], on);
+            }
+        }
+
         private bool CheckRange()
         {
             if (_chamber.HasGasOutOfRange)
@@ -87,6 +111,10 @@ namespace Venus_RT.Modules.PMs
 
             _chamber.OpenValve(ValveType.GasFinal, false);
             _chamber.StopAllGases();
+            OpenPVNVlv(0, false);
+            OpenPVNVlv(1, false);
+            OpenPVNVlv(2, false);
+            OpenPVNVlv(3, false);
         }
 
     }

+ 1 - 1
Venus/Venus_RT/Modules/PMs/PMEntity.cs

@@ -314,7 +314,7 @@ namespace Venus_RT.Modules.PMs
 
             // Gas Flow sequence
             Transition(PMState.Idle,            MSG.GasFlow,        FnStartGasFlow,             PMState.GasFlowing);
-            Transition(PMState.GasFlowing,      MSG.GasFlow,        FnStartGasFlow,             PMState.GasFlowing);
+            Transition(PMState.GasFlowing,      MSG.GasFlow,        FnAbortGasFlow,             PMState.Idle);
             Transition(PMState.GasFlowing,      FSM_MSG.TIMER,      FnGasFlowTimeout,           PMState.Idle);
             Transition(PMState.GasFlowing,      MSG.StopGasFlow,    FnStopGasFlow,              PMState.Idle);
             Transition(PMState.GasFlowing,      MSG.Abort,          FnAbortGasFlow,             PMState.Idle);