package com.zy.core.properties; import com.zy.core.Slave; import com.zy.core.model.CrnSlave; import com.zy.core.model.DevpSlave; import com.zy.core.model.LedSlave; import com.zy.core.model.RFIDSlave; import com.zy.core.model.RgvSlave; import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Configuration; import java.util.ArrayList; import java.util.List; /** * Created by vincent on 2020/8/4 * */ /** * 该类整个就是一个通过配置文件来实体化对象类 */ @Data @Configuration @ConfigurationProperties(prefix = "wcs-slave") public class SlaveProperties { private boolean doubleDeep; private List doubleLocs = new ArrayList<>(); private int groupCount; /** * 检查堆垛机出库站状态 * true: 检查出库站状态(默认值) * false: 不检查,默认出库站可用 */ private boolean checkOutStationStatus = true; private List crn = new ArrayList<>(); private List devp = new ArrayList<>(); private List barcode = new ArrayList<>(); private List led = new ArrayList<>(); private List scale = new ArrayList<>(); private List car = new ArrayList<>(); private List rgv = new ArrayList<>(); private List rfid = new ArrayList<>(); /** * RFID全局配置 */ private RFIDConfig rfidConfig = new RFIDConfig(); @Data public static class RFIDConfig { /** * 重连间隔(秒) */ private Integer reconnectInterval = 5; /** * 标签检测间隔(毫秒) */ private Integer tagScanInterval = 500; /** * 标签扫描时间(单位: 100ms,默认10=1秒) */ private Integer tagScanTime = 10; /** * 获取重连间隔,如果未配置则返回默认值 */ public Integer getReconnectInterval() { return reconnectInterval != null ? reconnectInterval : 5; } /** * 获取标签检测间隔,如果未配置则返回默认值 */ public Integer getTagScanInterval() { return tagScanInterval != null ? tagScanInterval : 500; } /** * 获取标签扫描时间,如果未配置则返回默认值 */ public Integer getTagScanTime() { return tagScanTime != null ? tagScanTime : 10; } } }