package com.jiayue.ipfcst.common.data.entity.gathertunnelinfo;

import com.jiayue.ipfcst.common.data.constant.enums.TunnelType;
import com.jiayue.ipfcst.common.data.entity.BaseTunnelInfo;
import com.jiayue.ipfcst.common.data.entity.ProtocolGatherDataPoint;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.Proxy;

import javax.persistence.Column;
import javax.persistence.Entity;

/**
 * cdt协议rtu通道信息
 *
 * @author 修唯xiuwei
 * @version 3.0
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Entity
@Proxy(lazy = false)
public class GatherCdtRtuTunnelInfo extends BaseTunnelInfo<ProtocolGatherDataPoint> {


    /**
     * 串口名称
     */
    @Column(length = 50)
    private String serialName;
    /**
     * 波特率
     */
    @Column(length = 7)
    private Integer baudRate;

    /**
     * 奇偶校验
     * PARITY_NONE = 0  无校验;
     * PARITY_ODD = 1  奇校验;
     * PARITY_EVEN = 2  偶校验;
     * PARITY_MARK = 3  0校验;
     * PARITY_SPACE = 4  1校验;
     */
    private Integer parity = 0;

    /**
     * 同步字1
     */
    private Integer synchronousWord1 = 0xEB;
    /**
     * 同步字2
     */
    private Integer synchronousWord2 = 0x90;

    /**
     * 初始化时确定通道类型
     */
    public GatherCdtRtuTunnelInfo() {
        this.setTunnelType(TunnelType.CDTRTUMASTER);
    }


}
