first commit

This commit is contained in:
2026-10-22 14:31:58 +07:00
parent 55228b3772
commit 62d33e8ef0
24 changed files with 1073 additions and 25 deletions

View File

@@ -0,0 +1,31 @@
namespace Lab505.Shared;
/// <summary>
/// Bố cục kho ASRS theo gateway AsrsOpcUaServer: 3 cột × 4 tầng.
/// Slot index giống PLC (PlcAddressMap.ToSlotIndex): (shelf-1)*3 + (col-1).
/// </summary>
public static class AsrsOpcLayout
{
public const int Columns = 3;
public const int Shelves = 4;
public const int SlotCount = Columns * Shelves;
public static int SlotIndex(int column, int shelf) => (shelf - 1) * Columns + (column - 1);
}
/// <summary>
/// State ASRS đọc qua OPC UA (gateway AsrsOpcUaServer), push qua SignalR.
/// Available=false trên sim stack (ASRS OPC UA chỉ có trên real stack).
/// </summary>
public record AsrsOpcPushDto(
bool Available,
bool Online,
bool? Homed,
bool? Ready,
bool? Busy,
bool? Fault,
bool?[] Occupied, // AsrsOpcLayout.SlotCount phần tử, index = AsrsOpcLayout.SlotIndex(col, shelf)
bool DriverBusy, // Lab505 đang thực thi 1 lệnh ASRS
string? CurrentOp,
string? LastError
);

View File

@@ -14,6 +14,7 @@ public static class HubContracts
public const string AmrStateEvent = "amr-state";
public const string ConveyorStateEvent = "conveyor-state";
public const string AsrsStateEvent = "asrs-state";
public const string AsrsOpcStateEvent = "asrs-opc-state";
public const string WorkflowStateEvent = "workflow-state";
public const string SystemStateEvent = "system-state";