first commit
This commit is contained in:
31
Lab505.Shared/AsrsOpcPushDto.cs
Normal file
31
Lab505.Shared/AsrsOpcPushDto.cs
Normal 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
|
||||
);
|
||||
@@ -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";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user