@page "/plc/controller"
@rendermode InteractiveWebAssemblyNoPrerender
@implements IAsyncDisposable
@using RobotNet10.RobotApp.Client.Clients
@using RobotNet10.RobotApp.Client.Shared.Plc
@using Microsoft.AspNetCore.SignalR.Client
@using Microsoft.Extensions.DependencyInjection
@using MudBlazor
PLC Controller
@* Sticky Header Section *@
PLC Controller Status
@* Connection Status *@
@if (hubClient?.IsConnected == true)
{
Connected to PlcControllerHub
}
else
{
Disconnected from PlcControllerHub
}
@* Control Section *@
Enable Update
Disable Update
@(isUpdateEnabled ? "Updating (2Hz)" : "Stopped")
@* Scrollable Content Area *@
@if (status != null)
{
@* System Status Card *@
System Status
@(status.IsReady ? "Ready" : "Not Ready")
Peripheral Mode:
@status.PeripheralMode
Safety Speed:
@status.SafetySpeed
Stop State:
@status.StopState
@* Lift State Card *@
Lift State
@StatusIndicator(("Lifted Up", status.LiftedUp, false))
@StatusIndicator(("Lifted Down", status.LiftedDown, false))
@StatusIndicator(("Lift Home", status.LiftHome, false))
@* (Lift Module control removed; now use LiftModuleCard in Motion/ManualControl page) *@
@* Motor State Card *@
Motor State
@StatusIndicator(("Left Motor", status.LeftMotorReady, false))
@StatusIndicator(("Right Motor", status.RightMotorReady, false))
@StatusIndicator(("Lift Motor", status.LiftMotorReady, false))
@* Safety Sensors Card *@
Safety Sensors
@StatusIndicator(("Emergency", status.Emergency, true))
@StatusIndicator(("Bumper", status.Bumper, true))
@StatusIndicator(("Lidar Front", status.LidarFrontProtectField, true))
@StatusIndicator(("Lidar Back", status.LidarBackProtectField, true))
@StatusIndicator(("Lidar Tim", status.LidarFrontTimProtectField, true))
@* Button State Card *@
Button State
@StatusIndicator(("Start Button", status.ButtonStart, false))
@StatusIndicator(("Stop Button", status.ButtonStop, true))
@StatusIndicator(("Reset Button", status.ButtonReset, false))
@* Other State Card *@
Other State
@StatusIndicator(("Has Load", status.HasLoad, false))
@StatusIndicator(("Charger Enabled", status.EnabledCharger, false))
@StatusIndicator(("Charging", status.Charging, false))
@StatusIndicator(("Muted Base", status.MutedBase, false))
@StatusIndicator(("Muted Load", status.MutedLoad, false))
@* Command State Card - Các lệnh đã ghi xuống PLC *@
Command State
System State:
@status.CurrentSystemState
Operation State:
@status.CurrentOperationState
RF Mode:
@status.CurrentRFMode
@* Command Values Card - Các giá trị điều khiển đã ghi *@
Command Values
@StatusIndicator(("Horizontal Load", status.SetHorizontalLoadValue, false))
@StatusIndicator(("Muted Base (Set)", status.SetMutedBaseValue, false))
@StatusIndicator(("Muted Load (Set)", status.SetMutedLoadValue, false))
@* Command Values Card - Các giá trị điều khiển đã ghi *@
Command Values
@StatusIndicator(("Charger Enable (Set)", status.SetEnableChargerValue, false))
@StatusIndicator(("Has Load (Set)", status.SetHasLoadValue, false))
@StatusIndicator(("RF E-Stop (Set)", status.SetRFEStopValue, true))
@StatusIndicator(("Batter Low (Set)", status.SetBatteryLowValue, true))
}