package com.njcn.pojo.entityEnum;

/**
 * @Author: Sunwei 【sunW2016@163.com】
 * @Description: 高级分析返回结果
 * @Date: Create in 9:02 2018/3/6
 * @Modified By:
 */
public enum EnumEvt {
    EVT_NUM("evt_num", "高级算法返回事件个数"), EVT_BUF("evt_buf", "高级算法返回数据"), QVVR_TYPE("qvvr_type", "暂降类型"), POW_A("POW_a",
            "A相波形起始点"), POW_B("POW_b", "B相波形起始点"), POW_C("POW_c", "C相波形起始点"), SEG_T_IDX("SEG_T_idx",
            "修正分段位置"), SEG_T_NUM("SEG_T_num", "分段数目"), SEG_RMS_T_NUM("SEG_RMS_T_num", "有效值分段数目"), SEG_RMS_T_IDX(
            "SEG_RMS_T_idx", "有效值分段位置"), UA_MIN("ua_min", "A相电压特征值"), UB_MIN("ub_min",
            "B相电压特征值"), UC_MIN("uc_min", "C相电压特征值"), U3_MIN("u3_min",
            "三相电压特征值"), U_MIN_NUM("u_min_num", "特征值个数"), ORDER_MIN_IDX("order_min_idx",
            "最小值位置"), HOLD_TIME_RMS("hold_time_rms", "有效值算法持续时间"), HOLD_TIME_DQ(
            "hold_time_dq",
            "dq变换算法持续时间"), VOLTAGECHANGE_VA("Voltagechange_Va",
            "A相跳变段电压变化率"), VOLTAGECHANGE_VB("Voltagechange_Vb",
            "B相跳变段电压变化率"), VOLTAGECHANGE_VC("Voltagechange_Vc",
            "C相跳变段电压变化率"), ANGLE_DIFF_AP("angle_diff_ap",
            "A相相位正跳变"), ANGLE_DIFF_BP("angle_diff_bp",
            "B相相位正跳变"), ANGLE_DIFF_CP("angle_diff_cp",
            "C相相位正跳变"), ANGLE_DIFF_AN("angle_diff_an",
            "A相相位负跳变"), ANGLE_DIFF_BN("angle_diff_bn",
            "B相相位负跳变"), ANGLE_DIFF_CN("angle_diff_cn",
            "C相相位负跳变"), BPH_MAX_VALUE("bph_max_value",
            "不平衡度"), QVVR_CATA_CAUSE("qvvr_cata_cause",
            "暂降原因"), QVVR_PHASETYPE("qvvr_phasetype",
            "暂降相别"), QVVR_CATA_TYPE("qvvr_cata_type",
            "暂降类型"), POWER_QVVR_BEFORE_BUF("power_qvvr_before_buf",
            "暂态前基波功率参数"),POWER_QVVR_AFTER_BUF("power_qvvr_after_buf",
            "暂态前基波功率参数"),FUND_P("Fund_P", 
            "基波有功功率"),FUND_Q("Fund_Q", 
            "基波无功功率"),FUND_S("Fund_S", 
            "基波视在功率"),QVVR_DIRECTION_INFO("qvvr_direction_info",
            "暂降源定位特征参数"),TRIG_TIME("trig_time",
            "暂降触发时刻"),QVVR_BEFORE_RMS("qvvr_before_rms",
            "暂降前基波有效值"),QVVR_BEFORE_ZK("qvvr_before_zk",
            "暂降前基波阻抗值"),QVVR_OCCUR_RMS("qvvr_occur_rms",
            "暂降发生时基波有效值"),QVVR_OCCUR_ZK("qvvr_occur_zk",
            "暂降发生时基波阻抗值"),QVVR_POS_INFO("qvvr_pos_info",
            "暂降源与监测位置关系"),QVVR_UTBL_INFO("qvvr_utbl_info",
            "突变量参数"),ENTER("\n",
            "回车换行"), QUOTATION("\"",
            "双引号"), NEWLINE("\n\t",
            "换行Tab"), TAB("\t",
            "tab");
    /**
     * 字段描述
     */
    private String description;

    /**
     * 字段值
     */
    private String property;

    EnumEvt(String property, String description) {
        this.description = description;
        this.property = property;
    }

    public String getDescription() {
        return description;
    }

    public String getProperty() {
        return property;
    }

    public static String setEvtProperty(String property) {
        return QUOTATION.getProperty() + property + QUOTATION.getProperty() + ":";
    }

    public static String setEnter(String s, int lineNumber) {
        return s += "," + ENTER.getProperty() + setTab(lineNumber);
    }

    public static String setClose(int lineNumber) {
        String s = ENTER.getProperty();
        s += setTab(lineNumber);
        return s + "}";
    }

    public static String setTab(int count) {
        String string = "";

        for (int i = 0; i < count; i++) {
            string += TAB.getProperty();
        }

        return string;
    }

    public static String setNewLine() {
        return "{" + NEWLINE.getProperty();
    }
}
