|
@@ -16,8 +16,52 @@ import java.util.*;
|
|
* @date 2024/5/12 02:18
|
|
* @date 2024/5/12 02:18
|
|
*/
|
|
*/
|
|
public class Tools {
|
|
public class Tools {
|
|
- public static void main(String[] args) {
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 允许的告警编号
|
|
|
|
+ * Alarm_unit_1 BOOL GB1伺服通讯故障
|
|
|
|
+ * Alarm_unit_2 BOOL GB2伺服通讯故障
|
|
|
|
+ * Alarm_unit_3 BOOL GB3伺服通讯故障
|
|
|
|
+ * Alarm_unit_4 BOOL GB4伺服通讯故障
|
|
|
|
+ * Alarm_unit_5 BOOL GB5伺服通讯故障
|
|
|
|
+ * Alarm_unit_6 BOOL 牵引伺服通讯故障
|
|
|
|
+ * Alarm_unit_7 BOOL 卷曲伺服通讯故障
|
|
|
|
+ * Alarm_unit_8 BOOL 断纱故障
|
|
|
|
+ * Alarm_unit_9 BOOL 电源故障
|
|
|
|
+ * Alarm_unit_10 BOOL 联动未完全啮合
|
|
|
|
+ * Alarm_unit_11 BOOL 米长到达
|
|
|
|
+ * Alarm_unit_12 BOOL GB1剩余圈数报警
|
|
|
|
+ * Alarm_unit_13 BOOL GB2剩余圈数报警
|
|
|
|
+ * Alarm_unit_14 BOOL GB3剩余圈数报警
|
|
|
|
+ * Alarm_unit_15 BOOL GB4剩余圈数报警
|
|
|
|
+ * Alarm_unit_16 BOOL GB5剩余圈数报警
|
|
|
|
+ * Alarm_unit_17 BOOL 主轴变频掉线
|
|
|
|
+ * Alarm_unit_18 BOOL 主轴变频故障
|
|
|
|
+ * Alarm_unit_19 BOOL GB1伺服故障
|
|
|
|
+ * Alarm_unit_20 BOOL GB2伺服故障
|
|
|
|
+ * Alarm_unit_21 BOOL GB3伺服故障
|
|
|
|
+ * Alarm_unit_22 BOOL GB4伺服故障
|
|
|
|
+ * Alarm_unit_23 BOOL GB5伺服故障
|
|
|
|
+ * Alarm_unit_24 BOOL 牵引伺服故障
|
|
|
|
+ * Alarm_unit_25 BOOL 卷曲伺服故障
|
|
|
|
+ * Alarm_unit_26 BOOL 拍照自停
|
|
|
|
+ * Alarm_unit_27 UINT CCD位置报警信息显示
|
|
|
|
+ */
|
|
|
|
+ public static final int[] ALLOW_ALARM = {8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 26, 27};
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 查找编号是否允许告警
|
|
|
|
+ *
|
|
|
|
+ * @param x 编号
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public static boolean findAllow(int x) {
|
|
|
|
+ OptionalInt result = Arrays.stream(ALLOW_ALARM)
|
|
|
|
+ .filter(element -> element == x)
|
|
|
|
+ .findFirst();
|
|
|
|
+ return result.isPresent();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static void main(String[] args) {
|
|
int p = 12;
|
|
int p = 12;
|
|
LocalDateTime ldt = LocalDateTime.of(LocalDate.now(), LocalTime.MIN);
|
|
LocalDateTime ldt = LocalDateTime.of(LocalDate.now(), LocalTime.MIN);
|
|
System.err.println(ldt.plusHours(2 * p));
|
|
System.err.println(ldt.plusHours(2 * p));
|