RobotApp/RobotApp/Services/Robot/RobotActionStorage.cs
Đăng Nguyễn 6cd32f8c98 update
2025-12-20 15:16:59 +07:00

36 lines
2.0 KiB
C#

using RobotApp.Services.Robot.Actions;
using RobotApp.VDA5050.Type;
namespace RobotApp.Services.Robot;
public class RobotActionStorage(IServiceProvider ServiceProvider)
{
public RobotAction? this[ActionType type] => type switch
{
ActionType.startPause => new RobotStartPauseAction(ServiceProvider),
ActionType.stopPause => new RobotStopPauseAction(ServiceProvider),
ActionType.startCharging => new RobotStartChargingAction(ServiceProvider),
ActionType.stopCharging => new RobotStopChargingAction(ServiceProvider),
ActionType.initPosition => new RobotInitPositionAction(ServiceProvider),
ActionType.stateRequest => new RobotStateRequestAction(ServiceProvider),
ActionType.factsheetRequest => new RobotFactsheetRequestAction(ServiceProvider),
ActionType.cancelOrder => new RobotCancelOrderAction(ServiceProvider),
//ActionType.liftUp => new RobotLiftUpAction(ServiceProvider),
//ActionType.liftDown => new RobotLiftDownAction(ServiceProvider),
ActionType.drop => new RobotDropAction(ServiceProvider),
ActionType.pick => new RobotPickAction(ServiceProvider),
//ActionType.liftRotate => new RobotLiftRotateAction(ServiceProvider),
//ActionType.rotate => new RobotRotateAction(ServiceProvider),
//ActionType.rotateKeepLift => new RobotRotateKeepLift(ServiceProvider),
//ActionType.mutedBaseOn => new RobotMutedBaseOnAction(ServiceProvider),
//ActionType.mutedBaseOff => new RobotMutedBaseOffAction(ServiceProvider),
//ActionType.mutedLoadOn => new RobotMutedLoadOnAction(ServiceProvider),
//ActionType.mutedLoadOff => new RobotMutedLoadOffAction(ServiceProvider),
//ActionType.dockTo => new RobotDockToAction(ServiceProvider),
//ActionType.moveStraightToCoor => new RobotMoveStraightToCoorAction(ServiceProvider),
//ActionType.moveStraightWithDistance => new RobotMoveStraightWithDistanceAction(ServiceProvider),
_ => null,
};
}