Merge origin/main: 2.0 protocol cars and traffic config

This commit is contained in:
黄兆尉
2026-08-24 15:39:36 +08:00
81 changed files with 16264 additions and 209 deletions
@@ -336,7 +336,7 @@ namespace StandardScene.Chained
/// </summary>
/// <param name="siteId">站点ID</param>
/// <returns>找到的车辆,未找到返回 null</returns>
protected Car FindCarArrivedAtSite(int siteId)
protected virtual Car FindCarArrivedAtSite(int siteId)
{
try
{
@@ -1028,7 +1028,6 @@ namespace StandardScene.Chained
/// <param name="reverse">是否倒车,默认为 false</param>
public async Task GoSite(AbstractCar car, Site targetSite, string action = "/", bool reverse = false)
{
try
{
// 创建路径规划
@@ -1039,8 +1038,8 @@ namespace StandardScene.Chained
// 查找从当前位置到目标站点的路径
plan.FindRoute(SimpleLib.GetSite(car.GetLastSite()), targetSite);
// 编译并执行移动脚本
// 编译并执行移动脚本(默认 Forecast
var program = plan.Compile("move");
// 标记车辆为占用状态
@@ -1059,6 +1058,22 @@ namespace StandardScene.Chained
}
catch (Exception ex)
{
try
{
car.tags.Remove("occupied");
if (car is Car trafficCar && car.GetLastSite() > 0)
{
var currentSite = SimpleLib.GetSite(car.GetLastSite());
if (currentSite != null)
{
trafficCar.TrafficReset(currentSite, true, strict: false);
}
}
}
catch
{
}
// 记录异常并等待后重试
Diagnosis.Post(
$"{car.name}循环任务报错{ExceptionFormatter.FormatEx(ex)}--去往循环点id:{targetSite.id},name:{targetSite.name}",
+4 -2
View File
@@ -297,11 +297,13 @@ namespace StandardScene
&& car.status.pendingLocks.Length == 0 && !car.tags.Contains("deliver") &&//pendingLocks临时增加解决车接多任务问题
(!car.tags.Contains("shouldCharge") || needCharge)
&& !car.tags.Contains("currentWorkStep") && !car.fields.ContainsKey("StopAccept") && car.tags.Contains("Online"); //巡航任务未完成的车
if (car.name.Contains("模拟"))
// Mag2Car 联调:UDP Online 即可调度,不强制 lstatus=上线(模拟器常报 state=0 未准备)
var isMag2Car = string.Equals(car.GetType().Name, "Mag2Car", StringComparison.Ordinal);
if (car.name.Contains("模拟") || isMag2Car)
{
conditions = car.GetLastSite() != -1 &&
(!car.tags.Contains("holdCar") || !checkHoldCar) && !car.tags.Contains("occupied")
&& (!isMag2Car || car.tags.Contains("Online"))
&& car.status.pendingLocks.Length == 0 && !car.tags.Contains("deliver") &&//pendingLocks临时增加解决车接多任务问题
(!car.tags.Contains("shouldCharge") || needCharge)
&& !car.tags.Contains("currentWorkStep") && !car.fields.ContainsKey("StopAccept"); //巡航任务未完成的车
+19 -20
View File
@@ -25,32 +25,31 @@
<!-- 程序集引用:SimpleComposer.exe -> SimpleLite.dllSimpleCore 配套本地产物 -->
<ItemGroup>
<Reference Include="SimpleLite">
<HintPath>E:\Work\Core\Simple-FR\Simple\SimpleLite\bin\Debug\SimpleLite.dll</HintPath>
<Reference Include="CommonUsage">
<HintPath>$(StandRefDir)CommonUsage.dll</HintPath>
</Reference>
<Reference Include="CycleGUI">
<HintPath>$(StandRefDir)CycleGUI.dll</HintPath>
</Reference>
<Reference Include="LessokajiWeaverUtilities">
<HintPath>$(StandRefDir)LessokajiWeaverUtilities.dll</HintPath>
</Reference>
<Reference Include="MDCSToolBox">
<HintPath>$(StandRefDir)MDCSToolBox.dll</HintPath>
</Reference>
<Reference Include="SimpleCore">
<HintPath>$(StandRefDir)SimpleCore.dll</HintPath>
</Reference>
<!-- CycleGUI:插件 UI 已从 WinForms 迁移到 CycleGUIDeliveryViewer 等)。
Private=false:宿主 SimpleLite 已在默认 ALC 加载 CycleGUI,插件仅编译期引用、不随产物分发,避免重复 DLL。 -->
<Reference Include="CycleGUI">
<HintPath>$(CGUILibDir)\CycleGUI.dll</HintPath>
<Private>false</Private>
<Reference Include="leegKeys-sdk">
<HintPath>$(LeegKeysSdkPath)</HintPath>
</Reference>
<Reference Include="SimpleCore">
<HintPath>E:\Work\Core\Simple-FR\Simple\SimpleCore\bin\Debug\netstandard2.0\SimpleCore.dll</HintPath>
</Reference>
<Reference Include="CommonUsage">
<HintPath>D:\MDCS\Dependencies\Commons\CommonUsage.dll</HintPath>
</Reference>
<Reference Include="MDCSToolBox">
<HintPath>D:\MDCS\Dependencies\Commons\MDCSToolBox.dll</HintPath>
<Reference Include="SimpleLite">
<HintPath>$(StandSimpleLiteDir)SimpleLite.dll</HintPath>
</Reference>
<Reference Include="Topaz">
<HintPath>E:\Work\Core\Simple-FR\Simple\tools\Topaz.dll</HintPath>
</Reference>
<Reference Include="LessokajiWeaverUtilities">
<HintPath>E:\Work\Core\Simple-FR\Simple\SimpleLite\bin\Debug\LessokajiWeaverUtilities.dll</HintPath>
</Reference>
<Reference Include="leegKeys-sdk">
<HintPath>Ref\leegKeys-sdk.dll</HintPath>
<HintPath>$(StandRefDir)Topaz.dll</HintPath>
</Reference>
</ItemGroup>