diff --git a/App/Modules/SicModules/PMs/Routines/PMExchangeMoRoutine.cs b/App/Modules/SicModules/PMs/Routines/PMExchangeMoRoutine.cs index e666a4e..7fb8188 100644 --- a/App/Modules/SicModules/PMs/Routines/PMExchangeMoRoutine.cs +++ b/App/Modules/SicModules/PMs/Routines/PMExchangeMoRoutine.cs @@ -17,8 +17,8 @@ namespace SicModules.PMs.Routines private enum RoutineStep { SetGroupK, - SetM7Or10, - SetM8Or11, + SetMfc1, + SetMfc2, SetM21, OpenV73, StartLoop, @@ -34,15 +34,23 @@ namespace SicModules.PMs.Routines CloseGroup2_2, OpenGroup1_2, CloseV73, - SetM7Or10_2, - SetM8Or11_2, - SetPC2Or3, + SetDefalutMfc1, + SetDefalutMfc2, + SetPC, + SetPCMax, TimeDelay1, TimeDelay2, + TimeDelay3, + + LoopCloseGroup2, + LoopOpenGroup3, + LoopOpenGroup1, + LoopCloseGroup3, + LoopOpenGroup2 } - private bool _isTCS = false; //标记是TMA换源还是TCS换源 + private string _type = ""; //CS2 WCO6 MORE MOCO6 private PMModule _pmModule; private ModuleName moduleName; private IoInterLock _pmIoInterLock; @@ -55,9 +63,9 @@ namespace SicModules.PMs.Routines private double _CLoseTime = 10; //默认为TMA换源参数 - private int mfc7Or10 = 7; - private int mfc8Or11 = 8; - private int pc2Or3 = 2; + private int mfc1 = 7; + private int mfc2 = 8; + private int pc = 2; private List _lstGroupV73 = new List() { "V73" }; @@ -76,14 +84,7 @@ namespace SicModules.PMs.Routines public void Init(string moName) { - if (moName.ToUpper().Contains("TCS")) - { - _isTCS = true; - } - else - { - _isTCS = false; - } + _type = moName; } public override Result Start(params object[] objs) @@ -116,26 +117,45 @@ namespace SicModules.PMs.Routines _CLoseTime = SC.GetValue($"PM.{Module}.MoExchange.VentTime"); _routineTimeOut = SC.GetValue($"PM.{Module}.MoExchange.RoutineTimeOut"); - //设置TCS换源参数 - if (_isTCS) + //设置换源参数 + switch (_type) { - mfc7Or10 = 10; - mfc8Or11 = 11; - pc2Or3 = 3; + case "CS2": + mfc1 = 11; + mfc2 = 12; + pc = 3; - _lstGroup1 = new List() { "V49" }; - _lstGroup2 = new List() { "V48", "V48s" }; - _lstGroup3 = new List() { "V50", "V50s" }; - } - else - { - mfc7Or10 = 7; - mfc8Or11 = 8; - pc2Or3 = 2; + _lstGroup1 = new List() { "V49" }; + _lstGroup2 = new List() { "V50", "V50s" }; + _lstGroup3 = new List() { "V48", "V48s" }; + break; + case "WCO6": + mfc1 = 7; + mfc2 = 8; + pc = 2; - _lstGroup1 = new List() { "V45" }; - _lstGroup2 = new List() { "V43", "V43s" }; - _lstGroup3 = new List() { "V46", "V46s" }; + _lstGroup1 = new List() { "V45" }; + _lstGroup2 = new List() { "V46", "V46s" }; + _lstGroup3 = new List() { "V43", "V43s" }; + break; + case "MORE": + mfc1 = 16; + mfc2 = 17; + pc = 9; + + _lstGroup1 = new List() { "V22" }; + _lstGroup2 = new List() { "V23", "V23s" }; + _lstGroup3 = new List() { "V21", "V21s" }; + break; + case "MOCO6": + mfc1 = 9; + mfc2 = 10; + pc = 8; + + _lstGroup1 = new List() { "V19" }; + _lstGroup2 = new List() { "V20", "V20s" }; + _lstGroup3 = new List() { "V18", "V18s" }; + break; } if (!_pmIoInterLock.SetPMExchangeMoRoutineRunning(true, out string reason)) @@ -159,59 +179,40 @@ namespace SicModules.PMs.Routines //关闭K阀组 SetIoValueByGroup((int)RoutineStep.SetGroupK, IoGroupName.K, false, _IoValueTimeout); - //设定M7,M8 80%,PC2设定Max - SetMfcValueByPercent((int)RoutineStep.SetM7Or10, mfc7Or10, 80); - SetMfcValueByPercent((int)RoutineStep.SetM21, 21, 80); - SetMfcValueByPercent((int)RoutineStep.SetM8Or11, mfc8Or11, 80); + //设定 M16 M17 80%, PC9 设定 Max; + SetMfcValueByPercent((int)RoutineStep.SetMfc1, mfc1, 80); + SetMfcValueByPercent((int)RoutineStep.SetMfc2, mfc2, 80); + SetPCValueByPercent((int)RoutineStep.SetPCMax, pc, 100); - //打开V73 + //4.先打开 V73 ,再打开 V23 和 V23S 持续 30s; SetIoValueByList((int)RoutineStep.OpenV73, _lstGroupV73, true, _IoValueTimeout); - - //循环开始 - Loop((int)RoutineStep.StartLoop, _loopCount); - - //打开Group1 - SetIoValueByList((int)RoutineStep.OpenGroup1, _lstGroup1, true, _IoValueTimeout); - - //关闭Group2 - SetIoValueByList((int)RoutineStep.CloseGroup2, _lstGroup2, false, _IoValueTimeout); - - //打开Group3 - SetIoValueByList((int)RoutineStep.OpenGroup3, _lstGroup3, true, _IoValueTimeout); - + SetIoValueByList((int)RoutineStep.OpenGroup2, _lstGroup2, true, _IoValueTimeout); TimeDelay((int)RoutineStep.TimeDelay1, _OpenTime); - //关闭Group3 - SetIoValueByList((int)RoutineStep.CloseGroup3, _lstGroup3, false, _IoValueTimeout); - - //打开Group2 - SetIoValueByList((int)RoutineStep.OpenGroup2, _lstGroup2, true, _IoValueTimeout); - - //关闭Group1 - SetIoValueByList((int)RoutineStep.CloseGroup1, _lstGroup1, false, _IoValueTimeout); + Loop((int)RoutineStep.StartLoop, _loopCount); + //5.先关闭 V23 和 V23S,再打开 V21 和 V21S,再打开 V22, 持续 10S; + SetIoValueByList((int)RoutineStep.LoopCloseGroup2, _lstGroup2, false, _IoValueTimeout); + SetIoValueByList((int)RoutineStep.LoopOpenGroup3, _lstGroup3, true, _IoValueTimeout); + SetIoValueByList((int)RoutineStep.LoopOpenGroup1, _lstGroup1, true, _IoValueTimeout); TimeDelay((int)RoutineStep.TimeDelay2, _CLoseTime); + //6.关闭 V21 和 V21S,打开 V23 和 V23S,持续 30S; + SetIoValueByList((int)RoutineStep.LoopCloseGroup3, _lstGroup3, false, _IoValueTimeout); + SetIoValueByList((int)RoutineStep.LoopOpenGroup2, _lstGroup2, true, _IoValueTimeout); + TimeDelay((int)RoutineStep.TimeDelay3, _OpenTime); + //循环开始 + EndLoop((int)RoutineStep.EndLoop); - //关闭Group3 - SetIoValueByList((int)RoutineStep.CloseGroup3_2, _lstGroup3, false, _IoValueTimeout); - - //关闭Group2 + //7.循环结束,关闭 V23 和 V23S,关闭 V73; SetIoValueByList((int)RoutineStep.CloseGroup2_2, _lstGroup2, false, _IoValueTimeout); + SetIoValueByList((int)RoutineStep.CloseV73, _lstGroupV73, false, _IoValueTimeout); - //打开Group1 - SetIoValueByList((int)RoutineStep.OpenGroup1_2, _lstGroup1, true, _IoValueTimeout); - - //关闭V73 - SetIoValueByList((int)RoutineStep.CloseV73, _lstGroupV73, true, _IoValueTimeout); - - //设定M7,M8/M10,M11到默认值 - SetMfcValueToDefaultByID((int)RoutineStep.SetM7Or10_2, mfc7Or10); - SetMfcValueToDefaultByID((int)RoutineStep.SetM8Or11_2, mfc8Or11); - - //设置PC2/PC3到默认值 - SetPcToDefault((int)RoutineStep.SetPC2Or3, new List { pc2Or3 }); + //8.设定 M16 M17 default, PC9 default。 + SetMfcValueToDefaultByID((int)RoutineStep.SetDefalutMfc1, mfc1); + SetMfcValueToDefaultByID((int)RoutineStep.SetDefalutMfc2, mfc2); + SetPcToDefault((int)RoutineStep.SetPC, new List { pc }); } catch (RoutineBreakException) { @@ -239,9 +240,9 @@ namespace SicModules.PMs.Routines _pmModule.SetIoValue(_lstGroup2, false); _pmModule.SetIoValue(_lstGroup3, false); - _pmModule.SetMfcValueToDefault(new List { mfc7Or10 }); - _pmModule.SetMfcValueToDefault(new List { mfc8Or11 }); - _pmModule.SetPCValueToDefault(new List { pc2Or3 }); + _pmModule.SetMfcValueToDefault(new List { mfc1 }); + _pmModule.SetMfcValueToDefault(new List { mfc2 }); + _pmModule.SetPCValueToDefault(new List { pc }); base.Abort(); } private void CheckRoutineTimeOut()