#
whycq
2024-08-15 4e3fdde993a3ae960eedf1c1df8341583d7825da
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package com.example.agvcontroller.protocol;
 
import com.example.agvcontroller.action.ForceStopAction;
import com.example.agvcontroller.action.ForceSwitchAction;
import com.example.agvcontroller.action.HandInAction;
import com.example.agvcontroller.action.HandOutAction;
import com.example.agvcontroller.action.SingleSwitchAction;
import com.example.agvcontroller.action.SingleSwitchRunAction;
 
public enum HandleCmdType {
 
    HAND_OUT(0x00, "退出手动模式", HandOutAction.class),
 
    HAND_IN(0x01, "进入手动模式", HandInAction.class),
 
    FORCE_SWITCH(0x80, "开启/关闭强制", ForceSwitchAction.class),
 
    SINGLE_SWITCH(0x8C  , "单轴使能", SingleSwitchAction.class),
 
    SINGLE_SWITCH_RUN(0x8C  , "强制单轴点动", SingleSwitchRunAction.class),
 
    FORCE_STOP(0xF0, "急停", ForceStopAction.class),
    ;
 
    public int cmdCode;
 
    public String desc;
 
    public Class<? extends IActionBody> cls;
 
    HandleCmdType(int cmdCode, String desc, Class<? extends IActionBody> cls) {
        this.cmdCode = cmdCode;
        this.desc = desc;
        this.cls = cls;
    }
 
    public static HandleCmdType find(Class<? extends IActionBody> cls) {
        for (HandleCmdType value : HandleCmdType.values()) {
            if (value.cls.equals(cls)) {
                return value;
            }
        }
        return null;
    }
 
}