package com.example.agvcontroller.protocol; import com.example.agvcontroller.action.AllResetAction; import com.example.agvcontroller.action.BackPaddle; import com.example.agvcontroller.action.CameraResetAction; import com.example.agvcontroller.action.ForceStopAction; import com.example.agvcontroller.action.ForceSwitchAction; import com.example.agvcontroller.action.ForkResetAction; import com.example.agvcontroller.action.ForwardBackAction; import com.example.agvcontroller.action.FrontPaddle; import com.example.agvcontroller.action.GyroResetAction; import com.example.agvcontroller.action.HandExtendCollect; import com.example.agvcontroller.action.HandForkRotatopn; import com.example.agvcontroller.action.HandInAction; import com.example.agvcontroller.action.HandLift; import com.example.agvcontroller.action.HandOutAction; import com.example.agvcontroller.action.LiftResetAction; import com.example.agvcontroller.action.LoadResetAction; import com.example.agvcontroller.action.RotatopnLeftRight; import com.example.agvcontroller.action.SingleSwitchAction; import com.example.agvcontroller.action.SingleSwitchRunAction; public enum HandleCmdType { HAND_OUT(0x02, "退出手动模式", HandOutAction.class), HAND_IN(0x01, "进入手动模式", HandInAction.class), FORCE_SWITCH(0x80, "开启/关闭强制", ForceSwitchAction.class), SINGLE_SWITCH(0x8C , "单轴使能", SingleSwitchAction.class), SINGLE_SWITCH_RUN(0x8D , "强制单轴点动", SingleSwitchRunAction.class), FORCE_STOP(0xF0, "急停", ForceStopAction.class), ALL_RESET(0x60, "整机复位", AllResetAction.class), CAMERA_RESET(0x61, "相机复位", CameraResetAction.class), GYRO_RESET(0x62, "陀螺仪复位", GyroResetAction.class), LOAD_RESET(0x65, "清除路径", LoadResetAction.class), FORK_RESET(0x66, "货叉归零", ForkResetAction.class), LIFT_RESET(0x68, "升降归零", LiftResetAction.class), FORWARD_BACK(0x81, "点动前进(后退)", ForwardBackAction.class), ROTATOPN_LEFT_RIGHT(0x82, "点动旋转(底盘)", RotatopnLeftRight.class), HAND_LIFT(0x86, "手动控制升降", HandLift.class), HAND_FORK_ROTATOPN(0x87, "手动控制货叉旋转", HandForkRotatopn.class), HAND_EXTEND_COLLECT(0x88, "手动控制伸缩", HandExtendCollect.class), FRONT_PADDLE(0x89, "手动控制前拨杆", FrontPaddle.class), BACK_PADDLE(0x8A, "手动控制后拨杆", BackPaddle.class), ; public int cmdCode; public String desc; public Class cls; HandleCmdType(int cmdCode, String desc, Class cls) { this.cmdCode = cmdCode; this.desc = desc; this.cls = cls; } public static HandleCmdType find(Class cls) { for (HandleCmdType value : HandleCmdType.values()) { if (value.cls.equals(cls)) { return value; } } return null; } }