63 lines
1.9 KiB
Plaintext
63 lines
1.9 KiB
Plaintext
@using RobotNet.VDA5050.State
|
|
@using RobotNet.VDA5050.Type
|
|
|
|
<MudPaper Class="pa-4" Elevation="2">
|
|
<MudText Typo="Typo.h6" Class="mb-3">Safety State</MudText>
|
|
@if (State?.SafetyState != null)
|
|
{
|
|
<MudSimpleTable Elevation="0">
|
|
<tbody>
|
|
<tr>
|
|
<td><strong>E-Stop:</strong></td>
|
|
<td>
|
|
<MudChip T="string"
|
|
Size="Size.Small"
|
|
Color="@GetEStopColor(State.SafetyState.EStop)">
|
|
@State.SafetyState.EStop
|
|
</MudChip>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><strong>Field Violation:</strong></td>
|
|
<td>
|
|
@if (State.SafetyState.FieldViolation)
|
|
{
|
|
<MudChip T="string" Size="Size.Small" Color="Color.Error">Yes</MudChip>
|
|
}
|
|
else
|
|
{
|
|
<MudChip T="string" Size="Size.Small" Color="Color.Success">No</MudChip>
|
|
}
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</MudSimpleTable>
|
|
}
|
|
else
|
|
{
|
|
<MudText Typo="Typo.body2" Align="Align.Center">No safety state data available</MudText>
|
|
}
|
|
</MudPaper>
|
|
|
|
@code {
|
|
public StateMsg? State { get; set; }
|
|
|
|
private Color GetEStopColor(EStop eStop)
|
|
{
|
|
return eStop switch
|
|
{
|
|
EStop.NONE => Color.Success,
|
|
EStop.AUTOACK => Color.Warning,
|
|
EStop.MANUAL => Color.Error,
|
|
EStop.REMOTE => Color.Warning,
|
|
_ => Color.Default
|
|
};
|
|
}
|
|
|
|
public void Update(StateMsg? state)
|
|
{
|
|
State = state;
|
|
StateHasChanged();
|
|
}
|
|
}
|