diff --git a/MECF.Framework.RT.EquipmentLibrary/Devices/IoTC.cs b/MECF.Framework.RT.EquipmentLibrary/Devices/IoTC.cs index d4e62ce..4b17fda 100644 --- a/MECF.Framework.RT.EquipmentLibrary/Devices/IoTC.cs +++ b/MECF.Framework.RT.EquipmentLibrary/Devices/IoTC.cs @@ -1,6 +1,5 @@ using System; using System.Diagnostics; -using System.Runtime.InteropServices; using System.Xml; using Aitex.Core.RT.DataCenter; using Aitex.Core.RT.Device.PmDevices; @@ -768,93 +767,75 @@ namespace Aitex.Core.RT.Device.Devices /// /// /// 目标温度 - /// + /// SP爬升时间。如果为1,表示Recipe中定义为Jump模式。 /// public bool SetTargetSP(string loop, float targetTemp, int time) { - // float startPoint = 0; switch (loop) { case "L1": - //如果是Pyro模式直接设置SP即可 - if (HeaterModeSetPoint == HeatStrategy.PyroFollow || - HeaterModeSetPoint == HeatStrategy.PyroAuto) + //如果是Power模式直接设置SP即可 + if (HeaterModeSetPoint == HeatStrategy.Power) { L1TargetSPSetPoint = targetTemp; return true; } - - /* else + else { + _rampTimerL1.Stop(); // 停止正在Ramp的过程 + _rampInitValueL1 = L1InputTempSetPoint; // 保存当前温度SP + _rampTimeL1 = time; // 接下来Ramp的总耗时 + if (time == 0) // 如果没有指定Ramp耗时,则根据系统配置的温度爬升速率计算当前温差所需的爬升时间 + _rampTimeL1 = Math.Abs((int)((targetTemp - _rampInitValueL1) / _tempRampRatio.DoubleValue) * 1000); - _rampTimerL1.Stop(); - - _rampInitValueL1 = L1InputTempSetPoint; - startPoint = L1InputTempSetPoint; - - _rampTimeL1 = time; - if (time == 0) - { - _rampTimeL1 = Math.Abs((int)((TargetSP - startPoint) / _tempRampRatio.DoubleValue) * 1000); - } - - _rampTargetL1 = TargetSP; - _rampTimerL1.Start(_rampTimeL1); + _rampTargetL1 = targetTemp; // 本次温度Ramp的目标值 + _rampTimerL1.Start(_rampTimeL1); // 启动Ramp计时器 } -*/ break; + case "L2": - //如果是Pyro模式直接设置SP即可 - if (HeaterModeSetPoint == HeatStrategy.PyroFollow || - HeaterModeSetPoint == HeatStrategy.PyroAuto) + //如果是Power模式直接设置SP即可 + if (HeaterModeSetPoint == HeatStrategy.Power) { L2TargetSPSetPoint = targetTemp; return true; } - /*else + else { _rampTimerL2.Stop(); - _rampInitValueL2 = L2InputTempSetPoint; - startPoint = L2InputTempSetPoint; - _rampTimeL2 = time; if (time == 0) - { - _rampTimeL2 = Math.Abs((int)((TargetSP - startPoint) / _tempRampRatio.DoubleValue) * 1000); - } + _rampTimeL2 = Math.Abs((int)((targetTemp - _rampInitValueL2) / _tempRampRatio.DoubleValue) * 1000); - _rampTargetL2 = TargetSP; + _rampTargetL2 = targetTemp; _rampTimerL2.Start(_rampTimeL2); - }*/ + } break; case "L3": - //如果是Pyro模式直接设置SP即可 - if (HeaterModeSetPoint == HeatStrategy.PyroFollow || - HeaterModeSetPoint == HeatStrategy.PyroAuto) + //如果是Power模式直接设置SP即可 + if (HeaterModeSetPoint == HeatStrategy.Power) { L3TargetSPSetPoint = targetTemp; return true; } - /*else + else { _rampTimerL3.Stop(); _rampInitValueL3 = L3InputTempSetPoint; - startPoint = L3InputTempSetPoint; _rampTimeL3 = time; if (time == 0) - { - _rampTimeL3 = Math.Abs((int)((TargetSP - startPoint) / _tempRampRatio.DoubleValue) * 1000); - } + _rampTimeL3 = Math.Abs((int)((targetTemp - _rampInitValueL3) / _tempRampRatio.DoubleValue) * 1000); - _rampTargetL3 = TargetSP; + _rampTargetL3 = targetTemp; _rampTimerL3.Start(_rampTimeL3); - }*/ + + } break; } @@ -862,8 +843,7 @@ namespace Aitex.Core.RT.Device.Devices return true; } - /* - private void MonitorL1Ramping() + private void MonitorL1Ramping() { if (!_rampTimerL1.IsIdle()) { @@ -895,22 +875,22 @@ namespace Aitex.Core.RT.Device.Devices } } - private void MonitorL3Ramping() - { - if (!_rampTimerL3.IsIdle()) - { - if (_rampTimerL3.IsTimeout() || _rampTimeL3 == 0) - { - _rampTimerL3.Stop(); - L3TargetSPSetPoint = _rampTargetL3; - } - else - { - L3TargetSPSetPoint = _rampInitValueL3 + (_rampTargetL3 - _rampInitValueL3) * (float)_rampTimerL3.GetElapseTime() / _rampTimeL3; - } - } - } - */ + private void MonitorL3Ramping() + { + if (!_rampTimerL3.IsIdle()) + { + if (_rampTimerL3.IsTimeout() || _rampTimeL3 == 0) + { + _rampTimerL3.Stop(); + L3TargetSPSetPoint = _rampTargetL3; + } + else + { + L3TargetSPSetPoint = _rampInitValueL3 + (_rampTargetL3 - _rampInitValueL3) * (float)_rampTimerL3.GetElapseTime() / _rampTimeL3; + } + } + + } #endregion Pyro自动模式 @@ -986,9 +966,9 @@ namespace Aitex.Core.RT.Device.Devices { try { - /* MonitorL1Ramping(); - MonitorL2Ramping(); - MonitorL3Ramping();*/ + MonitorL1Ramping(); + MonitorL2Ramping(); + MonitorL3Ramping(); MonitorSetOP(); @@ -1754,7 +1734,7 @@ namespace Aitex.Core.RT.Device.Devices /// 将数字转换为枚举。 /// /// - /// 如果传入的mode不在定义范围内,则默认返回HeaterControlMode.Power。 + /// 如果传入的mode不在定义范围内,则默认返回HeatStrategy.Power。 /// /// ///