新增1.0和2.0两种协议车型车型

This commit is contained in:
ykkokluo
2026-07-17 13:36:01 +08:00
parent a0dc1e6cd0
commit a28bc68e23
62 changed files with 12638 additions and 203 deletions
@@ -0,0 +1,50 @@
using System;
namespace StandardScene.Fass2Simulator
{
public sealed class Fass2SimRuntime : IDisposable
{
private readonly Fass2SimUdpHost _host;
public Fass2SimRuntime(Fass2SimConfig config, Fass2SimNodeProfileStore profiles)
{
Config = config;
Vehicle = new Fass2SimVehicle(config);
Actions = new Fass2SimActionEngine(Vehicle, config, profiles);
Motion = new Fass2SimMotionEngine(Vehicle, config, Actions);
Actions.StationActionsCompleted += Motion.OnStationActionsCompleted;
var commandHandler = new Fass2SimCommandHandler(Vehicle, Motion, Actions, config.LogRawFrames);
_host = new Fass2SimUdpHost(config, Vehicle, commandHandler, Motion, Actions);
_host.StatusReported += (_, __) => StatusChanged?.Invoke();
}
public Fass2SimConfig Config { get; }
public Fass2SimVehicle Vehicle { get; }
public Fass2SimMotionEngine Motion { get; }
public Fass2SimActionEngine Actions { get; }
public bool IsRunning => _host.IsRunning;
public event Action StatusChanged;
public void Start()
{
_host.Start();
StatusChanged?.Invoke();
}
public void Stop()
{
_host.Stop();
StatusChanged?.Invoke();
}
public void Dispose()
{
_host.Dispose();
}
}
}