28 lines
1.2 KiB
C#
28 lines
1.2 KiB
C#
using System.Collections.Generic;
|
|
using SimpleLite.RCS.CarTypes;
|
|
using StandardScene.Signal.Model;
|
|
using StandardScene.Signal.Plc;
|
|
|
|
namespace StandardScene.Signal.Logic
|
|
{
|
|
/// <summary>
|
|
/// 无条件放行点。对齐反编译 <c>StarSignManage</c> / <c>StartSignModel</c>。
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// 车在配置站点停稳且 <see cref="ReleasePointModel.IsUse"/> 为 true 时:停充并启动,不读 PLC。
|
|
/// 用于任务在某点停住、充完电或人工暂停后需要自动续跑的站点。
|
|
/// 机构口应配握手点,不要同时配放行点——扫车线程在握手 Handler 之后仍会执行本方法,可能提前开走。
|
|
/// </remarks>
|
|
public static class ReleasePointHandler
|
|
{
|
|
/// <summary>按当前站点号查放行表;未配置或未启用则什么都不做。</summary>
|
|
public static void OnStopped(Car car, int sit, IReadOnlyDictionary<int, ReleasePointModel> points)
|
|
{
|
|
if (points == null || !points.TryGetValue(sit, out var p) || p == null || !p.IsUse)
|
|
return;
|
|
SignalCarAdapter.StopCharge(car);
|
|
SignalCarAdapter.Start(car);
|
|
}
|
|
}
|
|
}
|