| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 | 
							- using System;
 
- using Aitex.Core.RT.Routine;
 
- using Aitex.Core.RT.SCCore;
 
- using VirgoRT.Devices;
 
- namespace VirgoRT.Modules.PMs
 
- {
 
-     class TemperatureControlRoutine : PMRoutineBase, IRoutine
 
-     {
 
-         private enum TCSequence
 
-         {
 
-             kCheckTemperature,
 
-             kEnd
 
-         }
 
-         private int _checkSubstrateTempTimeout = 60;
 
-         private double _TargetTemp = 0.0f;
 
-         private double _OffsetTemp = 0.0f;
 
-         private double _tolerance;
 
-         public TemperatureControlRoutine(JetPM chamber) : base(chamber)
 
-         {
 
-             Name = "PreHeat";
 
-             bUINotify = true;
 
-         }
 
-         public void Terminate()
 
-         {
 
-         }
 
-         public Result Start(params object[] objs)
 
-         {
 
-             try
 
-             {
 
-                 Reset();
 
-                 _TargetTemp = (double)objs[0];
 
-                 _checkSubstrateTempTimeout = SC.GetValue<int>($"{Module}.CheckSubstrateTempTimeout");
 
-                 _tolerance = SC.GetValue<double>($"System.MaxTemperatureToleranceToTarget");
 
-                 _OffsetTemp = SC.GetValue<double>($"{Module}.Chiller.ChillerTemperatureOffset");
 
-                 Notify($"Start, target temp {_TargetTemp} ℃, offset temp { _OffsetTemp} ℃");
 
-                 return Result.RUN;
 
-             }
 
-             catch
 
-             {
 
-                 return Result.FAIL;
 
-             }
 
-         }
 
-         public Result Monitor()
 
-         {
 
-             try
 
-             {
 
-                 if (SC.GetValue<bool>($"{Module}.Chiller.EnableChiller"))
 
-                 {
 
-                     CheckCoolantTemp((int)TCSequence.kCheckTemperature, _TargetTemp, _OffsetTemp, _checkSubstrateTempTimeout, _tolerance);
 
-                 }
 
-                 else
 
-                 {
 
-                     CheckSubstrateTemp((int)TCSequence.kCheckTemperature, _TargetTemp, _checkSubstrateTempTimeout, _tolerance);
 
-                 }
 
-                 End((int)TCSequence.kEnd);
 
-             }
 
-             catch (RoutineBreakException)
 
-             {
 
-                 return Result.RUN;
 
-             }
 
-             catch (RoutineFaildException)
 
-             {
 
-                 Notify("Error");
 
-                 return Result.FAIL;
 
-             }
 
-             catch (System.Exception ex)
 
-             {
 
-                 Stop(ex.Message);
 
-                 return Result.FAIL;
 
-             }
 
-             Notify("Finish");
 
-             return Result.DONE;
 
-         }
 
-         public override void Abort() { }
 
-     }
 
- }
 
 
  |