package com.ruoyi.sim.config;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * 本项目自定义配置类。
 */
@Configuration
@ConfigurationProperties(prefix = "sim-module-config")
public class SimConfig {

    /**
     * 路由器ip。
     */
    private String routerIp;

    /**
     * 模拟器的 RS485网关ip。
     */
    private String rs485Ip;

    /**
     * 模拟器的 RS485网关port。
     */
    private int rs485Port;

    /**
     * 模拟器通信总开关。
     */
    private boolean commGlobal;

    /**
     * 自主练习时长 单位min。
     */
    private int selfExamDuration;

    public String getRouterIp() {
        return routerIp;
    }

    public void setRouterIp(String routerIp) {
        this.routerIp = routerIp;
    }

    public String getRs485Ip() {
        return rs485Ip;
    }

    public void setRs485Ip(String rs485Ip) {
        this.rs485Ip = rs485Ip;
    }

    public int getRs485Port() {
        return rs485Port;
    }

    public void setRs485Port(int rs485Port) {
        this.rs485Port = rs485Port;
    }

    public boolean isCommGlobal() {
        return commGlobal;
    }

    public void setCommGlobal(boolean commGlobal) {
        this.commGlobal = commGlobal;
    }

    public int getSelfExamDuration() {
        return selfExamDuration;
    }

    public void setSelfExamDuration(int selfExamDuration) {
        this.selfExamDuration = selfExamDuration;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this)
                .append("routerIp", routerIp)
                .append("rs485Ip", rs485Ip)
                .append("rs485Port", rs485Port)
                .append("commGlobal", commGlobal)
                .append("selfExamDuration", selfExamDuration)
                .toString();
    }
}
