59 lines
2.3 KiB
Plaintext
59 lines
2.3 KiB
Plaintext
@using RobotNet.VDA5050.State
|
||
|
||
<MudPaper Class="pa-4" Elevation="2">
|
||
<MudText Typo="Typo.h6" Class="mb-3">Loads</MudText>
|
||
@if (State?.Loads != null && State.Loads.Length > 0)
|
||
{
|
||
<MudTable Items="@State.Loads" T="Load" Hover="true" Dense="true" Height="400px" FixedHeader="true" Elevation="0">
|
||
<HeaderContent>
|
||
<MudTh>Load ID</MudTh>
|
||
<MudTh>Load Type</MudTh>
|
||
<MudTh>Position</MudTh>
|
||
<MudTh>Weight</MudTh>
|
||
<MudTh>Dimensions</MudTh>
|
||
</HeaderContent>
|
||
<RowTemplate>
|
||
<MudTd DataLabel="Load ID">
|
||
<MudText Typo="Typo.body2" Style="max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
|
||
@(context.LoadId ?? "N/A")
|
||
</MudText>
|
||
</MudTd>
|
||
<MudTd DataLabel="Load Type">@(context.LoadType ?? "N/A")</MudTd>
|
||
<MudTd DataLabel="Position">@(context.LoadPosition ?? "N/A")</MudTd>
|
||
<MudTd DataLabel="Weight">@(context.Weight > 0 ? context.Weight?.ToString("F2") + " kg" : "N/A")</MudTd>
|
||
<MudTd DataLabel="Dimensions">
|
||
@if (context.LoadDimensions != null)
|
||
{
|
||
<MudText Typo="Typo.body2">
|
||
@($"{context.LoadDimensions.Length:F2} × {context.LoadDimensions.Width:F2}")
|
||
@if (context.LoadDimensions.Height > 0)
|
||
{
|
||
<text> × @context.LoadDimensions.Height.ToString("F2")</text>
|
||
}
|
||
<text> m</text>
|
||
</MudText>
|
||
}
|
||
else
|
||
{
|
||
<MudText Typo="Typo.body2">N/A</MudText>
|
||
}
|
||
</MudTd>
|
||
</RowTemplate>
|
||
</MudTable>
|
||
}
|
||
else
|
||
{
|
||
<MudText Typo="Typo.body2" Align="Align.Center">No loads available</MudText>
|
||
}
|
||
</MudPaper>
|
||
|
||
@code {
|
||
public StateMsg? State { get; set; }
|
||
|
||
public void Update(StateMsg? state)
|
||
{
|
||
State = state;
|
||
StateHasChanged();
|
||
}
|
||
}
|