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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
| package com.qianwen.smartman.common.enums;
|
| import java.util.Arrays;
| import java.util.List;
| import java.util.stream.Collectors;
|
|
| public class WcsDataTypeEnums {
| public static List<Integer> ONLY_ONE_LIST = Arrays.stream(WcsDataType.values()).filter((v0) -> {
| return v0.isOnly();
| }).map((v0) -> {
| return v0.getCode();
| }).collect(Collectors.toList());
|
|
| public enum WcsDataType {
| OTHER(0, "其他", false),
| STATE(1, "状态", true),
| YIELD(2, "产量", true),
| ALARM(3, "报警", true),
| PROGRAM(4, "程序号", true),
| PULSE_YIELD(5, "脉冲产量", true),
| ALARM_NUM(6, "报警号", true),
| ALARM_INFO(7, "报警信息", true),
| COUNT(8, "计数", false),
| PULSE(9, "脉冲", false);
|
| private Integer code;
| private String name;
| private boolean only;
|
| public Integer getCode() {
| return this.code;
| }
|
| public String getName() {
| return this.name;
| }
|
| public boolean isOnly() {
| return this.only;
| }
|
| public void setCode(Integer code) {
| this.code = code;
| }
|
| public void setName(String name) {
| this.name = name;
| }
|
| WcsDataType(Integer code, String name, boolean only) {
| this.code = code;
| this.name = name;
| this.only = only;
| }
|
| public static String getNameByCode(Integer code) {
| return (String) Arrays.stream(values()).filter(o -> {
| return code.equals(o.getCode());
| }).map((v0) -> {
| return v0.getName();
| }).findFirst().orElse("");
| }
| }
| }
|
|