磁导航1.0内部交管和信号交互
This commit is contained in:
@@ -139,13 +139,26 @@ namespace StandardScene.Signal.Logic
|
||||
release = _release;
|
||||
}
|
||||
|
||||
PlcStationRuntime Find(string name)
|
||||
PlcStationRuntime Find(string name, string dockId)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(name))
|
||||
return null;
|
||||
var list = _runtimes() ?? Array.Empty<PlcStationRuntime>();
|
||||
return list.FirstOrDefault(x =>
|
||||
string.Equals(x.Config.JgName, name, StringComparison.OrdinalIgnoreCase));
|
||||
var ofStation = list.Where(x =>
|
||||
string.Equals(x.JgName, name, StringComparison.OrdinalIgnoreCase)).ToList();
|
||||
if (ofStation.Count == 0)
|
||||
return null;
|
||||
if (!string.IsNullOrWhiteSpace(dockId))
|
||||
{
|
||||
var hit = ofStation.FirstOrDefault(x =>
|
||||
string.Equals(x.DockId, dockId.Trim(), StringComparison.OrdinalIgnoreCase));
|
||||
if (hit != null)
|
||||
return hit;
|
||||
}
|
||||
|
||||
return ofStation.FirstOrDefault(x =>
|
||||
string.Equals(x.DockId, PlcConfigLoader.DefaultDockId, StringComparison.OrdinalIgnoreCase))
|
||||
?? ofStation[0];
|
||||
}
|
||||
|
||||
foreach (var car in SignalCarAdapter.All())
|
||||
@@ -192,7 +205,7 @@ namespace StandardScene.Signal.Logic
|
||||
/// 停稳分发。TimedCharging 优先:充电点不应再走机构逻辑。
|
||||
/// 未识别的 SignalType 按站点节流打日志,避免刷屏。
|
||||
/// </summary>
|
||||
private void DispatchStopped(Car car, SignalStopSpec spec, Func<string, PlcStationRuntime> find)
|
||||
private void DispatchStopped(Car car, SignalStopSpec spec, Func<string, string, PlcStationRuntime> find)
|
||||
{
|
||||
if (spec.Is("TimedCharging"))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user