#
zhou zhou
7 小时以前 1bfb3738a3560bf106e6751bffea9fb42e71c402
src/main/java/com/zy/core/properties/SlaveProperties.java
@@ -3,6 +3,9 @@
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;
@@ -12,11 +15,29 @@
/**
 * Created by vincent on 2020/8/4
 *
 */
/**
 * 该类整个就是一个通过配置文件来实体化对象类
 */
@Data
@Configuration
@ConfigurationProperties(prefix = "wcs-slave")
public class SlaveProperties {
    private boolean doubleDeep;
    private List<Integer> doubleLocs = new ArrayList<>();
    private int groupCount;
    /**
     * 检查堆垛机出库站状态
     * true: 检查出库站状态(默认值)
     * false: 不检查,默认出库站可用
     */
    private boolean checkOutStationStatus = true;
    private List<CrnSlave> crn = new ArrayList<>();
@@ -24,8 +45,58 @@
    private List<Slave> barcode = new ArrayList<>();
    private List<Slave> led = new ArrayList<>();
    private List<LedSlave> led = new ArrayList<>();
    private List<Slave> scale = new ArrayList<>();
    private List<Slave> car = new ArrayList<>();
    private List<RgvSlave> rgv = new ArrayList<>();
    private List<RFIDSlave> 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;
        }
    }
}