initial commit
This commit is contained in:
26
Lab505.Script/Sim/SimContext.cs
Normal file
26
Lab505.Script/Sim/SimContext.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
namespace Lab505.Script.Sim;
|
||||
|
||||
/// <summary>
|
||||
/// Isolated per-user simulation context.
|
||||
/// Each FlowContext built from this context has its own independent robot state.
|
||||
/// </summary>
|
||||
public sealed class SimContext
|
||||
{
|
||||
public SimConveyor Conveyor { get; } = new();
|
||||
public SimImr IMR { get; } = new();
|
||||
public SimAmr AMR { get; } = new();
|
||||
public SimAsrs ASRS { get; } = new();
|
||||
public SimDobot Dobot { get; } = new();
|
||||
public SimFlow Workflow { get; }
|
||||
|
||||
/// <summary>Fires whenever any simulated robot/device changes state.</summary>
|
||||
public event Action? OnChanged;
|
||||
|
||||
public SimContext()
|
||||
{
|
||||
Workflow = new SimFlow(this);
|
||||
IMR.OnMoved += _ => OnChanged?.Invoke();
|
||||
AMR.OnMoved += _ => OnChanged?.Invoke();
|
||||
Conveyor.OnChanged += () => OnChanged?.Invoke();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user