package com.huatek.busi.common;

import java.io.Serializable;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

import lombok.Data;
import lombok.Getter;

/**
 * 二级告警界面折线图类型定义
 *
 * @author anker_cheng
 * @date 2019/09/05
 */
@Data
public final class CurveSubType implements Serializable {
    /**
     *
     */
    private static final long serialVersionUID = 1L;

    private String column;

    private String name;

    public CurveSubType(String column, String name) {
        super();
        this.column = column;
        this.name = name;
    }

    /** 油色谱气体 */
    public static enum YspGasEnum {
        H2("h2", "H2"),

        CH4("ch4", "CH4"),

        C2H6("c2h6", "C2H6"),

        C2H4("c2h4", "C2H4"),

        C2H2("c2h2", "C2H2"),

        CO("co", "CO"),

        CO2("co2", "CO2"),

        O2("o2", "O2"),

        N2("n2", "N2"),

        TEMP("tmp", "温度"),

        DEW("dew", "湿度"),

        MST("mst", "微水"),

        FLATGAS("flatgas", "瓦斯继电器中故障气"),

        CMBUGAS("cmbugas", "总可燃气体"),

        TOTAL_HYDROCARBON("total_hydrocarbon", "总烃"),

        GAS_PRESS("gas_press", "载气"),

        H2O("h2o", "H2O");

        private final String value;
        private final String name;

        public static final List<CurveSubType> LIST =
            Arrays.stream(values()).map(e -> new CurveSubType(e.getValue(), e.getName())).collect(Collectors.toList());

        private YspGasEnum(String value, String name) {
            this.value = value;
            this.name = name;
        }

        public String getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }

    /** 变压器运维工况曲线定义 */
    public static enum RunStatusSubTypeEnum {

        OIL_TEMPERATURE("oil_temperature", "油温"),

        OIL_POSITION("oil_position", "油位"),

        COOLING_ENTRY_PRESSURE("cooling_entry_pressure", "冷却水进口压力"),

        COOLING_EXIT_PRESSURE("cooling_exit_pressure", "冷却水出口压力");
        private final String value;
        private final String name;

        public static final List<CurveSubType> LIST =
            Arrays.stream(values()).map(e -> new CurveSubType(e.getValue(), e.getName())).collect(Collectors.toList());

        private RunStatusSubTypeEnum(String value, String name) {
            this.value = value;
            this.name = name;
        }

        public String getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }

    /** 测温柜 */
    public static enum CwgSubTypeEnum {

        TMP("TMP", "测温柜温度");
        private final String value;
        private final String name;

        public static final List<CurveSubType> LIST =
            Arrays.stream(values()).map(e -> new CurveSubType(e.getValue(), e.getName())).collect(Collectors.toList());

        private CwgSubTypeEnum(String value, String name) {
            this.value = value;
            this.name = name;
        }

        public String getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }

    /** 红外测温 */
    public static enum InfraredTmpTypeEnum {

        MAX_TMP("max_tmp", "红外测温温度");

        private final String value;
        private final String name;

        public static final List<CurveSubType> LIST =
            Arrays.stream(values()).map(e -> new CurveSubType(e.getValue(), e.getName())).collect(Collectors.toList());

        private InfraredTmpTypeEnum(String value, String name) {
            this.value = value;
            this.name = name;
        }

        public String getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }

    /**绕组测温 */
    public static enum RzcwTmpTypeEnum {

        MAX_TMP("max_tmp", "温度");

        private final String value;
        private final String name;

        public static final List<CurveSubType> LIST =
                Arrays.stream(values()).map(e -> new CurveSubType(e.getValue(), e.getName())).collect(Collectors.toList());

        private RzcwTmpTypeEnum(String value, String name) {
            this.value = value;
            this.name = name;
        }

        public String getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }

    /** 测温装置（无线/光纤） */
    public static enum CwzzTmpTypeEnum {

        MAX_TMP("tmp", "测温温度");

        private final String value;
        private final String name;

        public static final List<CurveSubType> LIST =
                Arrays.stream(values()).map(e -> new CurveSubType(e.getValue(), e.getName())).collect(Collectors.toList());

        private CwzzTmpTypeEnum(String value, String name) {
            this.value = value;
            this.name = name;
        }

        public String getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }

    /** 读表——图像数据 */
    public static enum ReadTableTypeEnum {

        TRANSFORMER_DATAVAL("dataval", "变压器图像数据"),

        GIS_DATAVAL("dataval", "GIS图像数据"),

        ARRESTER_DATAVAL("dlval", "避雷器图像数据");

        private final String value;
        private final String name;

        public static final List<CurveSubType> LIST =
            Arrays.stream(values()).map(e -> new CurveSubType(e.getValue(), e.getName())).collect(Collectors.toList());

        private ReadTableTypeEnum(String value, String name) {
            this.value = value;
            this.name = name;
        }

        public String getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }

    /** 变压器工作状态 */
    public static enum RunStateSubTypeEnum {
        RUN_STATE("run_state", "负荷");

        private final String value;
        private final String name;

        public static final List<CurveSubType> LIST =
            Arrays.stream(values()).map(e -> new CurveSubType(e.getValue(), e.getName())).collect(Collectors.toList());

        private RunStateSubTypeEnum(String value, String name) {
            this.value = value;
            this.name = name;
        }

        public String getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }

    /** 铁芯夹件电流 */
    public static enum IcgeSubTypeEnum {
        TOTAL_CORE_CURRENT("total_core_current", "电流");

        private final String value;
        private final String name;

        public static final List<CurveSubType> LIST =
            Arrays.stream(values()).map(e -> new CurveSubType(e.getValue(), e.getName())).collect(Collectors.toList());

        private IcgeSubTypeEnum(String value, String name) {
            this.value = value;
            this.name = name;
        }

        public String getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }

    /** 气象 */
    public static enum MeteorologicalSubTypeEnum {
        AIR_TEMPERATURE("air_temperature", "温度(℃)"),

        HUMIDITY("humidity", "湿度"),

        AIR_PRESSURE("air_pressure", "气压"),

        PRECIPITATION("precipitation", "降雨量"),

        PRECIPITATION_INTENSITY("precipitation_intensity", "降水强度"),

        RADIATION_INTENSITY("radiation_intensity", "光辐射强度");

        @Getter
        private final String value;
        @Getter
        private final String name;

        public static final List<CurveSubType> LIST =
            Arrays.stream(values()).map(e -> new CurveSubType(e.value, e.name)).collect(Collectors.toList());

        private MeteorologicalSubTypeEnum(String value, String name) {
            this.value = value;
            this.name = name;
        }
    }

    /** GIS SF6 */
    public static enum GisSf6PressureSubTypeEnum {
        TEMPERATURE("temperature", "温度(℃)"),

//        ABSOLUTE_PRESSURE("absolute_pressure", "绝对压力 (MPa)"),

//        DENSITY("density", "密度(kg/m3)"),

        MOISTURE("moisture", "微水"),

        PRESSURE20C("pressure20C", "压力（20℃）"),

        DAILY_leak_RATE("daily_leak_rate", "泄露率");

        @Getter
        private final String value;
        @Getter
        private final String name;

        public static final List<CurveSubType> LIST =
            Arrays.stream(values()).map(e -> new CurveSubType(e.value, e.name)).collect(Collectors.toList());

        private GisSf6PressureSubTypeEnum(String value, String name) {
            this.value = value;
            this.name = name;
        }
    }

    /** 容性设备绝缘监测 */
    public static enum CapEquipmentImSubTypeEnum {
        CAPACITANCE("capacitance", "电容量(pF)"),

        LOSS_FACTOR("loss_factor", "介质损耗因数"),

        UNBALANCE_CURRENT("unbalance_current", "三相不平衡电流"),

        UNBALANCE_VOLTAGE("unbalance_voltage", "三相不平衡电压"),

        TOTAL_CURRENT("total_current", "泄漏电流(mA)"),

        SYSTEM_VOLTAGE("system_voltage", "系统电压(V)");

        @Getter
        private final String value;
        @Getter
        private final String name;

        public static final List<CurveSubType> LIST =
            Arrays.stream(values()).map(e -> new CurveSubType(e.value, e.name)).collect(Collectors.toList());

        private CapEquipmentImSubTypeEnum(String value, String name) {
            this.value = value;
            this.name = name;
        }
    }

    /** 避雷器绝缘监测 */
    public static enum LightningrodImSubTypeEnum {
        CAPACITANCE_CURRENT("capacitance_current", "容性电流(mA)"),

        RESISTIVE_CURRENT("resistive_current", "阻性电流(mA)"),

        TOTAL_CURRENT("total_current", "全电流(mA)");

//        SYSTEM_VOLTAGE("system_voltage", "系统电压(V)");

        @Getter
        private final String value;
        @Getter
        private final String name;

        public static final List<CurveSubType> LIST =
            Arrays.stream(values()).map(e -> new CurveSubType(e.value, e.name)).collect(Collectors.toList());

        private LightningrodImSubTypeEnum(String value, String name) {
            this.value = value;
            this.name = name;
        }
    }

    /** 电缆环流 */
    public static enum CableCirculationSubTypeEnum {
        TOTAL_CORE_CURRENT("total_core_current", "电流（A）");

        private final String value;
        private final String name;

        public static final List<CurveSubType> LIST =
                Arrays.stream(values()).map(e -> new CurveSubType(e.getValue(), e.getName())).collect(Collectors.toList());

        private CableCirculationSubTypeEnum(String value, String name) {
            this.value = value;
            this.name = name;
        }

        public String getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }

    public static enum Sf6EnvTypeEnum {

        SF6_TEMPERATURE("tmp", "温度"),

        SF6_DEW("dew", "湿度"),

        SF6_O_content("o_content", "O2含量"),

        SF6_conc("conc", "SF6浓度");

        private final String value;
        private final String name;

        public static final List<CurveSubType> LIST =
                Arrays.stream(values()).map(e -> new CurveSubType(e.getValue(), e.getName())).collect(Collectors.toList());

        private Sf6EnvTypeEnum(String value, String name) {
            this.value = value;
            this.name = name;
        }

        public String getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }

    public static enum GenZdTypeEnum {
        ampl_x("ampl_x", "振动X轴位移"),
        ampl_y("ampl_y", "振动Y轴位移"),
        ampl_z("ampl_z", "振动Z轴位移"),
        aircap_am("aircap_am", "空气间隙0度位移"),
        aircap_bm("aircap_bm", "空气间隙90度位移"),
        aircap_cm("aircap_cm", "空气间隙180度位移"),
        aircap_dm("aircap_dm", "空气间隙270度位移"),
        ;
        private final String value;
        private final String name;
        public static final List<CurveSubType> LIST =
                Arrays.stream(values()).map(e -> new CurveSubType(e.getValue(), e.getName())).collect(Collectors.toList());
        private GenZdTypeEnum(String value, String name) {
            this.value = value;
            this.name = name;
        }
        public String getValue() {
            return value;
        }
        public String getName() {
            return name;
        }
    }

    public static enum GenYlTypeEnum {
        pv_a("pv_a", "压力1"),
        pv_b("pv_b", "压力2"),
        ;
        private final String value;
        private final String name;
        public static final List<CurveSubType> LIST =
                Arrays.stream(values()).map(e -> new CurveSubType(e.getValue(), e.getName())).collect(Collectors.toList());
        private GenYlTypeEnum(String value, String name) {
            this.value = value;
            this.name = name;
        }
        public String getValue() {
            return value;
        }
        public String getName() {
            return name;
        }
    }
    public static enum GenPdTypeEnum {
        discharge_capacity("discharge_capacity", "放电量，单位pC或mV 或dB"),
        discharge_position("discharge_position", "放电相位"),
        pulse_count("pulse_count", "脉冲个数"),
        discharge_waveform("discharge_waveform", "放电波形"),
        ;
        private final String value;
        private final String name;
        public static final List<CurveSubType> LIST =
                Arrays.stream(values()).map(e -> new CurveSubType(e.getValue(), e.getName())).collect(Collectors.toList());
        private GenPdTypeEnum(String value, String name) {
            this.value = value;
            this.name = name;
        }
        public String getValue() {
            return value;
        }
        public String getName() {
            return name;
        }
    }
}
