package com.njcn.utils.sagDomain;

public class DipZoneModel {
    /// <summary>
    /// 首端编号
    /// </summary>
    public int head;
    /// <summary>
    /// 末端编号
    /// </summary>
    public int tail;
    /// <summary>
    /// 0-不在暂降域内
    /// 3-整条都在暂降域内
    /// 1-暂降域为临界点-线路末端
    /// 2-暂降域为线路首端-临界点1 临界点2-线路末端
    /// </summary>
    public SagJudge judgeType;
    /// <summary>
    /// 临界点1
    /// </summary>
    public double node1;
    /// <summary>
    /// 临界点2
    /// </summary>
    public double node2;

    /// <summary>
    /// 临界点1长度
    /// </summary>
    public double nodeLength1;
    /// <summary>
    /// 临界点2长度
    /// </summary>
    public double nodeLength2;

    public int getHead() {
        return head;
    }

    public void setHead(int head) {
        this.head = head;
    }

    public int getTail() {
        return tail;
    }

    public void setTail(int tail) {
        this.tail = tail;
    }

    public SagJudge getJudgeType() {
        return judgeType;
    }

    public void setJudgeType(SagJudge judgeType) {
        this.judgeType = judgeType;
    }

    public double getNode1() {
        return node1;
    }

    public void setNode1(double node1) {
        this.node1 = node1;
    }

    public double getNode2() {
        return node2;
    }

    public void setNode2(double node2) {
        this.node2 = node2;
    }

    public double getNodeLength1() {
        return nodeLength1;
    }

    public void setNodeLength1(double nodeLength1) {
        this.nodeLength1 = nodeLength1;
    }

    public double getNodeLength2() {
        return nodeLength2;
    }

    public void setNodeLength2(double nodeLength2) {
        this.nodeLength2 = nodeLength2;
    }

    public enum SagJudge
    {
        //没有暂降,只有一段暂降,有两段暂降,全是暂降
        SAG_NONE("SAG_NONE"),SAG_SIGLE("SAG_SIGLE"),SAG_MUL("SAG_MUL"),SAG_ALL("SAG_ALL");

        private final String type;

        public String getType() {
            return type;
        }

        SagJudge(String type) {
            this.type = type;
        }
    }

    public String toString() {
        return  head +
                "," + tail +
                "," + judgeType.getType() +
                "," + node1 +
                "," + node2 +
                "," + nodeLength1 +
                "," + nodeLength2 +
                "\r\n";
    }
}
