refactor: 将Framework库和RT、UI放在同一个解决方案中。

This commit is contained in:
SL
2026-06-01 17:48:28 +08:00
parent 1948f4290d
commit b73d39a6b1
4331 changed files with 506148 additions and 49363 deletions
@@ -0,0 +1,78 @@
using Aitex.Core.RT.Routine;
using Aitex.Core.Util;
namespace SicModules.UnLoads.Routines
{
public class UnLoadCoolingRoutine : UnLoadBaseRoutine
{
enum RoutineStep
{
TimeDealy
}
private DeviceTimer _dt = new DeviceTimer();
private int _coolingTime;
public UnLoadCoolingRoutine()
{
Name = "UnLoad Cooling";
}
public void Init(int coolingTime)
{
_coolingTime = coolingTime;
}
public override Result Start(params object[] objs)
{
Reset();
_dt.Start(0);
Notify("Start");
return Result.RUN;
}
public override Result Monitor()
{
try
{
Delay((int)RoutineStep.TimeDealy, _coolingTime);
}
catch (RoutineBreakException)
{
return Result.RUN;
}
catch (RoutineFaildException)
{
return Result.FAIL;
}
_dt.Stop();
Notify("Finished");
return Result.DONE;
}
public override void Abort()
{
if (!_dt.IsIdle())
{
_dt.Stop();
}
base.Abort();
}
public int GetRemainedTime()
{
if (!_dt.IsIdle())
{
int coolingRemain = _coolingTime - (int)(_dt.GetElapseTime() / 1000);
return coolingRemain >= 0 ? coolingRemain : 0;
}
return 0;
}
}
}