Files
Lab505/Lab505.Shared/AsrsOpcPushDto.cs
2026-10-22 14:31:58 +07:00

32 lines
1011 B
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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
);