32 lines
1011 B
C#
32 lines
1011 B
C#
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
|
||
);
|