package com.ho.business.constant;

import com.ho.business.entity.Topology;

/**
 * @author fancl
 * @desc: 设备类型枚举
 * @date 2022/9/6
 */
public interface DeviceTypeConstant {
    //集团级
    Integer SCOPE_GROUP = 1;
    //电站级
    Integer SCOPE_STATION = 2;

    //device_complex
    String DEVICE_COMPLEX = "device_complex";
    //
    String DEVICE_SIMPLE = "device_simple";

    String STORAGE = "storage";
    //电池管理系统
    String BMS = "bms";
    //防逆流
    String AMMETERFNL = "ammeter_fnl";
    //火电厂
    String BAT = "BAT";
    String BIGBMS = "BMS";
    //站端统计
    String STATISTICS = "statistics";
    //计划曲线
    String PLANCURVE = "planCurve";

    //储能高压计量表
    String DDB = "ddb";

    //储能变流器
    String PCS = "pcs";
    //IO模块
    String IO_MODULE = "io_module";
    //空调
    String AIR_CONDITION = "air_condition";
    //电表
    String ELE_METER = "ele_meter";
    //pcs状态字
    String STATUS_PCS = "statusPCS";
    //温度湿度仪
    String TRANSMITTER = "transmitter";

    //消防设备
    String STORAGE_FIRE = "storage_fire";
    //液冷
    String LIQUID_COOLING = "yl";
    //管理机
    String MANAGEMENT_MACHINE = "glj";
    //合并点设备
    String VIRTUAL_DEVICE = "virtualDevice";
    //并网侧电表
    String MAINS_POWER = "mainsPower";
    //负载侧电表
    String LOAD_SIDE_METER = "load_side_meter";
    //光伏并网
    String PHON_GRID = "phon_grid";
    //光储一体机
    String OPTICAL_STORAGE = "optical_storage";
    //电表
    String AGC = "agc";

    String EMU = "emu";

    //英博DC/DCMPPT
    String DCDC = "dcdc";

    String MPPT ="mppt";

    //柴油发电机_济宁微山湖
    String CF = "cf";

    //集团
    String GROUP = "group";

    //电池芯
    String CELL = "cell";
    //电池包
    String PACK = "pack";
    //电池堆
    String STACK = "stack";
    //电池簇
    String CLUSTER = "cluster";
    //间隔
    String BAY = "bay";
    //电站
    String STATION = "station";
    //舱
    String WAREHOUSE = "warehouse";
    //气象
    String METEOROLOGICAL = "Meteorological";
    //气象站
    String WEATHER_STATION = "weatherStation";
    //通用电表
    String COMMON_ELEMETER = "commonElemeter";
    //其它类型
    String OTHER = "other";
    //外部电表
    String OUTSIDE_ELE = "outsideEle";

    //并网点统计电表
    String GRID_METER = "gridMeter";
    //厂(站)用电电表
    String STATION_METER = "stationMeter";
    //单项电量表
    String SINGLE_HASE = "singleHase";
    //光伏逆变器
    String PVINVERTER = "pvinverter";
    //充电桩
    String CHARGE_PILE = "chargePile";
    //充电枪
    String CHARGE_GUN = "chargeGun";
    //充电桩-通用
    String CHARGE_PILE1 = "chargePile_1";
    //充电桩-汽车快充
    String CHARGE_PILE2 = "chargePile_2";
    //充电桩-汽车慢充
    String CHARGE_PILE3 = "chargePile_3";
    //充电桩-电动车充电桩
    String CHARGE_PILE4 = "chargePile_4";
    //电能质量
    String ELEC_QUALITY = "elecQuality";
    //耗能设备
    String ENERGY_EQUIPMENT = "energyEquipment";
    //能耗表
    String ENERGY_CONSUMPTION = "energyConsumption";
    //充电桩电表
    String CHARGE_PILE_METER = "chargePileMeter";
    //泛着各种逆变器
    String INVERTER_PREFIX = "inverter_";
    //泛着各种逆变器
    String INVERTER = "inverter";
    //防逆流电表
    String AMMETER_FNL = "ammeter_fnl";

    //光伏逆变器（禾望1500DC组串）
    String INVERTER_HW = "inverterhw";
    //华为
    String INVERTER_HUAWEI = "inverterhuawei";
    //阳光
    String INVERTER_YG = "inverteryg";
    //固德威
    String INVERTER_GDW = "invertergdw";
    //地址
    String ADDRESS = "address";
    //设备型号
    String DEVICE_MODEL = "deviceModel";
    //电站接入点
    String ACCESSPOINT = "accesspoint";
    //故障字段
    String AIRCONDITIONFAULT = "airconditionFault";

    //发电机组
    String FDJZ = "fdjz";
    //虚拟节点
    String VM_NODE = "vm_node";

    //总充电量
    String TOTAL_CHARGE = "totalCharge";
    //总放电量
    String TOTAL_DISCHARGE = "totalDischarge";
    //总SOC
    String TOTAL_SOC = "totalSOC";
    //系统转换效率
    String SYSTEM_EFFICIENCY = "systemEfficiency";

    //电量的冻结值type数据
    interface ELEC_METER_VALUE_TYPE {
        //充电
        Integer CHARGE = 8;
        //放电
        Integer DISCHARGE = 9;
        //收益
        Integer INCOME = 10;
        //充电(小时)
        Integer HOUR_CHARGE = 11;
        //放电（小时）
        Integer HOUR_DISCHARGE = 12;
        //光伏充电
        Integer PV_CHARGE = 13;
        //柴发电量
        Integer CF_CHARGE = 14;
    }

    //pcs的映射字段
    interface PCS_DEVICE_TYPE {
        //PCS交流累计充电电量低
        String PCS_AC_ACCUMULATED_CHARGE_LOW = "pcsAcAccumulatedChargeLow";
        //PCS交流累计充电电量高
        String PCS_AC_ACCUMULATED_CHARGE_HIGH = "pcsAcAccumulatedChargeHigh";
        //PCS交流累计放电电量低
        String PCS_AC_ACCUMULATED_DISCHARGE_LOW = "pcsAcAccumulatedDischargeLow";
        //PCS交流累计放电电量高
        String PCS_AC_ACCUMULATED_DISCHARGE_HIGN = "pcsAcAccumulatedDischargeHign";
    }

    static Topology getDeviceType(String deviceType) {
        Topology topology = new Topology();
        switch (deviceType) {
            case CELL:
                topology.setCategory(11);
                topology.setType(4);
                topology.setSubType(8);
                return topology;
            case PACK:
                topology.setCategory(11);
                topology.setType(4);
                topology.setSubType(7);
                return topology;
            case STACK:
                topology.setCategory(11);
                topology.setType(4);
                topology.setSubType(5);
                return topology;
            case CLUSTER:
                topology.setCategory(11);
                topology.setType(4);
                topology.setSubType(6);
                return topology;
            case STATION:
                topology.setCategory(1);
                topology.setType(1);
                topology.setSubType(3);
                return topology;
            case WAREHOUSE:
                topology.setCategory(2);
                topology.setType(9);
                topology.setSubType(1);
                return topology;
            case PVINVERTER:
                topology.setCategory(2);
                topology.setType(10);
                topology.setSubType(1);
                return topology;
            case CHARGE_PILE:
                topology.setCategory(12);
                topology.setType(1);
                return topology;
            case CHARGE_GUN:
                topology.setCategory(12);
                topology.setType(2);
                return topology;
            case SINGLE_HASE:
                topology.setCategory(11);
                topology.setType(11);
                topology.setSubType(4);
                return topology;
            case ELEC_QUALITY:
                topology.setCategory(9);
                topology.setType(3);
                topology.setSubType(1);
                return topology;
            case ENERGY_CONSUMPTION:
                topology.setCategory(11);
                topology.setType(11);
                topology.setSubType(6);
                return topology;
            case CHARGE_PILE_METER:
                topology.setCategory(11);
                topology.setType(11);
                topology.setSubType(7);
                return topology;
            case ENERGY_EQUIPMENT:
                topology.setCategory(8);
                topology.setType(3);
                return topology;
        }
        return topology;
    }

    static String judgeChargePile(String deviceType) {
        switch (deviceType) {
            case CHARGE_PILE1:
            case CHARGE_PILE2:
            case CHARGE_PILE3:
            case CHARGE_PILE4:
                return "chargePile";
        }
        return "";
    }

    //时间
    String TIME = "时间";

    interface POINT_DATA {
        //时间
        String DATE = "date";
        //列名
        String ROW_NAME_DATE = "row_name_date";
        //值
        String DIGITAL = "digital";
        //中文名称
        String ROW_NAME_DIGITAL = "row_name_digital";

        String COL = "col";

        String SRC_ID = "srcId";
    }

    interface SignalPrefix {
        //EMU 温控器前缀
        String emuTempControlPrefix = "emuTempControlStateBit";
        //EMU 除湿器前缀
        String emuDehumiPrefix = "emuDehumiStateBit";
        //EMU温控字段
        String emuTempControl = "EMUBoxTemperatureControllerStatus";
        //EMU 除湿器
        String emuDehumi = "EMUDehumidifier1Status";
    }

    //堆可放电量
    String DISCHARGE_CAPACITY = "dischargeCapacity";
    //高压计量表-瞬时总有功功率
    String ACTIVE_POWER = "activePower";
    //无功功率
    String REACTIVE_POWER = "reactivePower";
    //pcs无功功率
    String REACTIVE_POWER_PCS = "reactivePowerPCS";
    //离网
    String OFF_GRID = "offGrid";
    //并网
    String ON_GRID = "onGrid";
    String SOC = "soc";
    String SOH = "soh";
    String SOC2 = "SOC";
    String SOH2 = "SOH";
    //pcs有功功率
    String OUTPUT_POWER = "outputPower";
    //光伏有功
    String AC_ACTIVE_POWER = "acActivePower";
    //eps有功功率
    String EPS_ACTIVE_POWER = "epsActivePower";
    //光伏总发电量
    String CUMULATIVE_POWER_GENERATION = "cumulativePowerGeneration";
    //光伏日电量
    String DAILY_POWER_GENERATION = "dailyPowerGeneration";
    //日充
    String DAILY_CHARGE = "dailyCharge";

    String VOLTAGE = "cSingleV";
    String TEMPERATURE = "cSingleT";
    //计算单体电压簇单体电压组合以及位置标志位
    String VOLCOMPUTE = "VolCompute";
    //计算单体温度簇单体电压组合以及位置标志位
    String TEMCOMPUTE = "TemCompute";
    //电压箱号
    String VOL_BMU_NUM = "VolBMUNum";
    //电压箱内编号
    String VOL_BOX_NUM = "VolBoxNum";
    //电压箱号
    String TEM_BMU_NUM = "TemBMUNum";
    //电压箱内编号
    String TEM_BOX_NUM = "TemBoxNum";
    //电流流向
    String FLOW_DIRECTION = "flowDirection";

    interface JING_KE_TYPE {
        String WORK_STATUS = "workStatus";
        String ACTIVE_POWER_PCS = "outputPower"; //与原来系统保持一致
        String REACTIVE_POWER_PCS = "reactivePowerPCS";
        String GRID = "grid";
        String BMS_TOTAL_VOL = "bmsTotalVol";
        String BMS_TOTAL_CURRENT = "bmsTotalCurrent";
        String SOC = "soc";
        String SOH = "soh";
        String BMS_MAX_VOL = "bmsMaxVol";
        String BMS_MIN_VOL = "bmsMinVol";
    }

    //mppt 日发起始
    String PV_DAILY_CHARGE_START = "pvDailyReleaseStart";
    //日充起始
    String DAILY_CHARGE_START = "dailyChargeStart";
    //日放起始
    String DAILY_DISCHARGE_START = "dailyDischargeStart";

    //计划曲线常量
    interface PLAN_CURVE {
        //远程控制模式
        String PLAN_CONTROL_MODEL = "planControlModel";
        //计划曲线每日刷新时间(小时)
        String PLAN_REFRESHH = "planRefreshH";
        //计划曲线每日刷新时间(分钟)
        String PLAN_REFRESHM = "planRefreshM";

        String PALN_CONTROL_DEVICE_TYPE = "planCurve_";
    }
}
