package com.gyee.runeconomy.service.performacompare;


import com.gyee.common.util.ClassUtil;
import com.gyee.common.vo.benchmark.DjhxdbInitVo;
import com.gyee.common.vo.benchmark.DjhxdbtopVo;
import com.gyee.common.vo.benchmark.FzyVo;
import com.gyee.runeconomy.init.CacheContext;
import com.gyee.runeconomy.model.auto.ProEconWtAlysisDay;
import com.gyee.runeconomy.model.auto.ProEconWtPowerCurveFitting;
import com.gyee.runeconomy.model.auto.ProEconWtwindDayInfo;
import com.gyee.runeconomy.service.auto.IProEconWtAlysisDayService;
import com.gyee.runeconomy.service.auto.IProEconWtPowerCurveFittingService;
import com.gyee.runeconomy.service.auto.IProEconWtwindDayInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.*;
import java.util.stream.Collectors;

@Service
public class EquipmentPerformaCompareService {


    @Autowired
    private IProEconWtAlysisDayService proEconWtAlysisDayService;

    @Autowired
    private IProEconWtwindDayInfoService proEconWtwindDayInfoService;

    @Autowired
    private IProEconWtPowerCurveFittingService proEconWtPowerCurveFittingService;

    /**
     * 单机横向对比列表
     *
     * @param dateType
     * @param windturbineIds
     * @param date
     * @return
     */
    public List<Object> getEquipmentPerformaCompareList(String dateType, String windturbineIds, String date, String type) {
        List<Object> objects = new ArrayList<>();
        if ("-1".equals(type)) {
            List<ProEconWtAlysisDay> list = proEconWtAlysisDayService.getProEconWtAlysisDayList(windturbineIds, date);//风机性能分析数据
            List<ProEconWtwindDayInfo> fzyList = proEconWtwindDayInfoService.getProEconWtwindDayInfoList(windturbineIds, date);//风资源
            List<DjhxdbtopVo> resultList = alysisConversionMethod(list, fzyList, dateType);//日月年指标转换记录
            objects = convert(resultList);
        }
        return objects;
    }


    /***
     * 获取实际拟合曲线
     * @param windturbineIds
     * @return
     */
    public Map<String, List<ProEconWtPowerCurveFitting>> getgroupProEconWtPowerCurveFittingList(String windturbineIds) {

        Map<String, List<ProEconWtPowerCurveFitting>> map = proEconWtPowerCurveFittingService.getgroupProEconWtPowerCurveFittingList(windturbineIds);
        System.out.println("返回查询" + System.currentTimeMillis());
        return map;
    }


    /**
     * 单机横向对比列表行转列
     *
     * @param resultList
     * @return
     */
    private List<Object> convert(List<DjhxdbtopVo> resultList) {
        List<Object> rList = new ArrayList<>();
        List<String> wtids = resultList.stream().map(i -> i.getWtid()).collect(Collectors.toList());
        List<String> nemcode = resultList.stream().map(i -> i.getNemCode()).collect(Collectors.toList());
        DjhxdbInitVo fdj = new DjhxdbInitVo();
        fdj.setName("风电机");
        try {
            LinkedHashMap addMap = new LinkedHashMap();
            LinkedHashMap addValMap = new LinkedHashMap();
            for (int j = 0; j < wtids.size(); j++) {
                addMap.put(String.valueOf(j + 1), Class.forName("java.lang.String"));
                addValMap.put(String.valueOf(j + 1), nemcode.get(j));
            }
            Object blo = new ClassUtil().dynamicClass(fdj, addMap, addValMap);
            rList.add(blo);
        } catch (Exception e) {
            e.printStackTrace();
        }
        DjhxdbInitVo fdl = new DjhxdbInitVo();
        fdl.setName("发电量");
        try {
            LinkedHashMap addMap = new LinkedHashMap();
            LinkedHashMap addValMap = new LinkedHashMap();

            for (int j = 0; j < wtids.size(); j++) {
                addMap.put(String.valueOf(j + 1), Class.forName("java.lang.Double"));
                int finalJ = j;
                addValMap.put(String.valueOf(j + 1), resultList.stream().filter(i -> i.getWtid().equals(wtids.get(finalJ))).findFirst().get().getFdl());
            }
            Object blo = new ClassUtil().dynamicClass(fdl, addMap, addValMap);
            rList.add(blo);
        } catch (Exception e) {
            e.printStackTrace();
        }

        DjhxdbInitVo yfdl = new DjhxdbInitVo();
        yfdl.setName("应发电量");
        try {
            LinkedHashMap addMap = new LinkedHashMap();
            LinkedHashMap addValMap = new LinkedHashMap();

            for (int j = 0; j < wtids.size(); j++) {
                addMap.put(String.valueOf(j + 1), Class.forName("java.lang.Double"));
                int finalJ = j;
                addValMap.put(String.valueOf(j + 1), resultList.stream().filter(i -> i.getWtid().equals(wtids.get(finalJ))).findFirst().get().getYfdl());
            }
            Object blo = new ClassUtil().dynamicClass(yfdl, addMap, addValMap);
            rList.add(blo);
        } catch (Exception e) {
            e.printStackTrace();
        }

        DjhxdbInitVo pjgl = new DjhxdbInitVo();
        pjgl.setName("平均功率");
        try {
            LinkedHashMap addMap = new LinkedHashMap();
            LinkedHashMap addValMap = new LinkedHashMap();

            for (int j = 0; j < wtids.size(); j++) {
                addMap.put(String.valueOf(j + 1), Class.forName("java.lang.Double"));
                int finalJ = j;
                addValMap.put(String.valueOf(j + 1), resultList.stream().filter(i -> i.getWtid().equals(wtids.get(finalJ))).findFirst().get().getPjgl());
            }
            Object blo = new ClassUtil().dynamicClass(pjgl, addMap, addValMap);
            rList.add(blo);
        } catch (Exception e) {
            e.printStackTrace();
        }

        DjhxdbInitVo pjfs = new DjhxdbInitVo();
        pjfs.setName("平均风速");
        try {
            LinkedHashMap addMap = new LinkedHashMap();
            LinkedHashMap addValMap = new LinkedHashMap();

            for (int j = 0; j < wtids.size(); j++) {
                addMap.put(String.valueOf(j + 1), Class.forName("java.lang.Double"));
                int finalJ = j;
                addValMap.put(String.valueOf(j + 1), resultList.stream().filter(i -> i.getWtid().equals(wtids.get(finalJ))).findFirst().get().getPjfs());
            }
            Object blo = new ClassUtil().dynamicClass(pjfs, addMap, addValMap);
            rList.add(blo);
        } catch (Exception e) {
            e.printStackTrace();
        }

        DjhxdbInitVo yxxs = new DjhxdbInitVo();
        yxxs.setName("运行小时");
        try {
            LinkedHashMap addMap = new LinkedHashMap();
            LinkedHashMap addValMap = new LinkedHashMap();

            for (int j = 0; j < wtids.size(); j++) {
                addMap.put(String.valueOf(j + 1), Class.forName("java.lang.Double"));
                int finalJ = j;
                addValMap.put(String.valueOf(j + 1), resultList.stream().filter(i -> i.getWtid().equals(wtids.get(finalJ))).findFirst().get().getYxxs());
            }
            Object blo = new ClassUtil().dynamicClass(yxxs, addMap, addValMap);
            rList.add(blo);
        } catch (Exception e) {
            e.printStackTrace();
        }

        DjhxdbInitVo djxs = new DjhxdbInitVo();
        djxs.setName("待机小时");
        try {
            LinkedHashMap addMap = new LinkedHashMap();
            LinkedHashMap addValMap = new LinkedHashMap();

            for (int j = 0; j < wtids.size(); j++) {
                addMap.put(String.valueOf(j + 1), Class.forName("java.lang.Double"));
                int finalJ = j;
                addValMap.put(String.valueOf(j + 1), resultList.stream().filter(i -> i.getWtid().equals(wtids.get(finalJ))).findFirst().get().getDjxs());
            }
            Object blo = new ClassUtil().dynamicClass(djxs, addMap, addValMap);
            rList.add(blo);
        } catch (Exception e) {
            e.printStackTrace();
        }

        DjhxdbInitVo gzxs = new DjhxdbInitVo();
        gzxs.setName("故障小时");
        try {
            LinkedHashMap addMap = new LinkedHashMap();
            LinkedHashMap addValMap = new LinkedHashMap();

            for (int j = 0; j < wtids.size(); j++) {
                addMap.put(String.valueOf(j + 1), Class.forName("java.lang.Double"));
                int finalJ = j;
                addValMap.put(String.valueOf(j + 1), resultList.stream().filter(i -> i.getWtid().equals(wtids.get(finalJ))).findFirst().get().getGzxs());
            }
            Object blo = new ClassUtil().dynamicClass(gzxs, addMap, addValMap);
            rList.add(blo);
        } catch (Exception e) {
            e.printStackTrace();
        }

        DjhxdbInitVo whxs = new DjhxdbInitVo();
        whxs.setName("维护小时");
        try {
            LinkedHashMap addMap = new LinkedHashMap();
            LinkedHashMap addValMap = new LinkedHashMap();

            for (int j = 0; j < wtids.size(); j++) {
                addMap.put(String.valueOf(j + 1), Class.forName("java.lang.Double"));
                int finalJ = j;
                addValMap.put(String.valueOf(j + 1), resultList.stream().filter(i -> i.getWtid().equals(wtids.get(finalJ))).findFirst().get().getWhxs());
            }
            Object blo = new ClassUtil().dynamicClass(whxs, addMap, addValMap);
            rList.add(blo);
        } catch (Exception e) {
            e.printStackTrace();
        }

        DjhxdbInitVo zdxs = new DjhxdbInitVo();
        zdxs.setName("中断小时");
        try {
            LinkedHashMap addMap = new LinkedHashMap();
            LinkedHashMap addValMap = new LinkedHashMap();

            for (int j = 0; j < wtids.size(); j++) {
                addMap.put(String.valueOf(j + 1), Class.forName("java.lang.Double"));
                int finalJ = j;
                addValMap.put(String.valueOf(j + 1), resultList.stream().filter(i -> i.getWtid().equals(wtids.get(finalJ))).findFirst().get().getZdxs());
            }
            Object blo = new ClassUtil().dynamicClass(zdxs, addMap, addValMap);
            rList.add(blo);
        } catch (Exception e) {
            e.printStackTrace();
        }

        DjhxdbInitVo yxfs = new DjhxdbInitVo();
        yxfs.setName("有效风时");
        try {
            LinkedHashMap addMap = new LinkedHashMap();
            LinkedHashMap addValMap = new LinkedHashMap();

            for (int j = 0; j < wtids.size(); j++) {
                addMap.put(String.valueOf(j + 1), Class.forName("java.lang.Double"));
                int finalJ = j;
                addValMap.put(String.valueOf(j + 1), resultList.stream().filter(i -> i.getWtid().equals(wtids.get(finalJ))).findFirst().get().getYxfs());
            }
            Object blo = new ClassUtil().dynamicClass(yxfs, addMap, addValMap);
            rList.add(blo);
        } catch (Exception e) {
            e.printStackTrace();
        }

        DjhxdbInitVo ssdl = new DjhxdbInitVo();
        ssdl.setName("损失电量");
        try {
            LinkedHashMap addMap = new LinkedHashMap();
            LinkedHashMap addValMap = new LinkedHashMap();

            for (int j = 0; j < wtids.size(); j++) {
                addMap.put(String.valueOf(j + 1), Class.forName("java.lang.Double"));
                int finalJ = j;
                addValMap.put(String.valueOf(j + 1), resultList.stream().filter(i -> i.getWtid().equals(wtids.get(finalJ))).findFirst().get().getSsdl());
            }
            Object blo = new ClassUtil().dynamicClass(ssdl, addMap, addValMap);
            rList.add(blo);
        } catch (Exception e) {
            e.printStackTrace();
        }
        //
        //        DjhxdbInitVo bjcs = new DjhxdbInitVo();
        //        bjcs.setName("报警次数");
        //        try {
        //            LinkedHashMap addMap = new LinkedHashMap();
        //            LinkedHashMap addValMap = new LinkedHashMap();
        //
        //            for (int j=0;j<wtids.size();j++){
        //                addMap.put(String.valueOf(j+1), Class.forName("java.lang.Double"));
        //                int finalJ = j;
        //                addValMap.put(String.valueOf(j+1), resultList.stream().filter(i->i.getWtid().equals(wtids.get(finalJ))).findFirst().get().getBjcs());
        //            }
        //            Object blo = new ClassUtil().dynamicClass(bjcs, addMap, addValMap);
        //            rList.add(blo);
        //        } catch (Exception e) {
        //            e.printStackTrace();
        //        }

        DjhxdbInitVo tjcs = new DjhxdbInitVo();
        tjcs.setName("停机次数");
        try {
            LinkedHashMap addMap = new LinkedHashMap();
            LinkedHashMap addValMap = new LinkedHashMap();

            for (int j = 0; j < wtids.size(); j++) {
                addMap.put(String.valueOf(j + 1), Class.forName("java.lang.Double"));
                int finalJ = j;
                addValMap.put(String.valueOf(j + 1), resultList.stream().filter(i -> i.getWtid().equals(wtids.get(finalJ))).findFirst().get().getTjcs());
            }
            Object blo = new ClassUtil().dynamicClass(tjcs, addMap, addValMap);
            rList.add(blo);
        } catch (Exception e) {
            e.printStackTrace();
        }

        DjhxdbInitVo bbhcs = new DjhxdbInitVo();
        bbhcs.setName("不饱和次数");
        try {
            LinkedHashMap addMap = new LinkedHashMap();
            LinkedHashMap addValMap = new LinkedHashMap();

            for (int j = 0; j < wtids.size(); j++) {
                addMap.put(String.valueOf(j + 1), Class.forName("java.lang.Double"));
                int finalJ = j;
                addValMap.put(String.valueOf(j + 1), resultList.stream().filter(i -> i.getWtid().equals(wtids.get(finalJ))).findFirst().get().getBbhcs());
            }
            Object blo = new ClassUtil().dynamicClass(bbhcs, addMap, addValMap);
            rList.add(blo);
        } catch (Exception e) {
            e.printStackTrace();
        }

        DjhxdbInitVo sbklly = new DjhxdbInitVo();
        sbklly.setName("设备可利用率");
        try {
            LinkedHashMap addMap = new LinkedHashMap();
            LinkedHashMap addValMap = new LinkedHashMap();

            for (int j = 0; j < wtids.size(); j++) {
                addMap.put(String.valueOf(j + 1), Class.forName("java.lang.Double"));
                int finalJ = j;
                addValMap.put(String.valueOf(j + 1), resultList.stream().filter(i -> i.getWtid().equals(wtids.get(finalJ))).findFirst().get().getSbklly());
            }
            Object blo = new ClassUtil().dynamicClass(sbklly, addMap, addValMap);
            rList.add(blo);
        } catch (Exception e) {
            e.printStackTrace();
        }

        DjhxdbInitVo pjwd = new DjhxdbInitVo();
        pjwd.setName("平均温度");
        try {
            LinkedHashMap addMap = new LinkedHashMap();
            LinkedHashMap addValMap = new LinkedHashMap();

            for (int j = 0; j < wtids.size(); j++) {
                addMap.put(String.valueOf(j + 1), Class.forName("java.lang.Double"));
                int finalJ = j;
                addValMap.put(String.valueOf(j + 1), resultList.stream().filter(i -> i.getWtid().equals(wtids.get(finalJ))).findFirst().get().getPjwd());
            }
            Object blo = new ClassUtil().dynamicClass(pjwd, addMap, addValMap);
            rList.add(blo);
        } catch (Exception e) {
            e.printStackTrace();
        }

        DjhxdbInitVo pjsd = new DjhxdbInitVo();
        pjsd.setName("平均湿度");
        try {
            LinkedHashMap addMap = new LinkedHashMap();
            LinkedHashMap addValMap = new LinkedHashMap();

            for (int j = 0; j < wtids.size(); j++) {
                addMap.put(String.valueOf(j + 1), Class.forName("java.lang.Double"));
                int finalJ = j;
                addValMap.put(String.valueOf(j + 1), resultList.stream().filter(i -> i.getWtid().equals(wtids.get(finalJ))).findFirst().get().getPjsd());
            }
            Object blo = new ClassUtil().dynamicClass(pjsd, addMap, addValMap);
            rList.add(blo);
        } catch (Exception e) {
            e.printStackTrace();
        }

        DjhxdbInitVo pjyq = new DjhxdbInitVo();
        pjyq.setName("平均压强");
        try {
            LinkedHashMap addMap = new LinkedHashMap();
            LinkedHashMap addValMap = new LinkedHashMap();

            for (int j = 0; j < wtids.size(); j++) {
                addMap.put(String.valueOf(j + 1), Class.forName("java.lang.Double"));
                int finalJ = j;
                addValMap.put(String.valueOf(j + 1), resultList.stream().filter(i -> i.getWtid().equals(wtids.get(finalJ))).findFirst().get().getPjyq());
            }
            Object blo = new ClassUtil().dynamicClass(pjyq, addMap, addValMap);
            rList.add(blo);
        } catch (Exception e) {
            e.printStackTrace();
        }

        DjhxdbInitVo nhyd = new DjhxdbInitVo();
        nhyd.setName("拟合优度");
        try {
            LinkedHashMap addMap = new LinkedHashMap();
            LinkedHashMap addValMap = new LinkedHashMap();

            for (int j = 0; j < wtids.size(); j++) {
                addMap.put(String.valueOf(j + 1), Class.forName("java.lang.Double"));
                int finalJ = j;
                addValMap.put(String.valueOf(j + 1), resultList.stream().filter(i -> i.getWtid().equals(wtids.get(finalJ))).findFirst().get().getNhyd());
            }
            Object blo = new ClassUtil().dynamicClass(nhyd, addMap, addValMap);
            rList.add(blo);
        } catch (Exception e) {
            e.printStackTrace();
        }

        DjhxdbInitVo sjbz = new DjhxdbInitVo();
        sjbz.setName("实际/保证");
        try {
            LinkedHashMap addMap = new LinkedHashMap();
            LinkedHashMap addValMap = new LinkedHashMap();

            for (int j = 0; j < wtids.size(); j++) {
                addMap.put(String.valueOf(j + 1), Class.forName("java.lang.Double"));
                int finalJ = j;
                addValMap.put(String.valueOf(j + 1), resultList.stream().filter(i -> i.getWtid().equals(wtids.get(finalJ))).findFirst().get().getSjbz());
            }
            Object blo = new ClassUtil().dynamicClass(sjbz, addMap, addValMap);
            rList.add(blo);
        } catch (Exception e) {
            e.printStackTrace();
        }

        DjhxdbInitVo fzy = new DjhxdbInitVo();
        fzy.setName("风资源");
        try {
            LinkedHashMap addMap = new LinkedHashMap();
            LinkedHashMap addValMap = new LinkedHashMap();

            for (int j = 0; j < wtids.size(); j++) {
                addMap.put(String.valueOf(j + 1), Class.forName("java.util.List"));
                int finalJ = j;
                addValMap.put(String.valueOf(j + 1), resultList.stream().filter(i -> i.getWtid().equals(wtids.get(finalJ))).findFirst().get().getFzyList());
            }
            Object blo = new ClassUtil().dynamicClass(fzy, addMap, addValMap);
            rList.add(blo);
        } catch (Exception e) {
            e.printStackTrace();
        }

        DjhxdbInitVo jfpl = new DjhxdbInitVo();
        jfpl.setName("静风频率");
        try {
            LinkedHashMap addMap = new LinkedHashMap();
            LinkedHashMap addValMap = new LinkedHashMap();

            for (int j = 0; j < wtids.size(); j++) {
                addMap.put(String.valueOf(j + 1), Class.forName("java.lang.Double"));
                int finalJ = j;
                addValMap.put(String.valueOf(j + 1), resultList.stream().filter(i -> i.getWtid().equals(wtids.get(finalJ))).findFirst().get().getJfpl());
            }
            Object blo = new ClassUtil().dynamicClass(jfpl, addMap, addValMap);
            rList.add(blo);
        } catch (Exception e) {
            e.printStackTrace();
        }

        return rList;
    }

    //日月年指标转换方法
    List<DjhxdbtopVo> alysisConversionMethod(List<ProEconWtAlysisDay> list, List<ProEconWtwindDayInfo> fzyList, String dateType) {
        List<DjhxdbtopVo> resultList = new ArrayList<>();
        list.stream().forEach(i -> {
            DjhxdbtopVo vo = new DjhxdbtopVo();
            vo.setWtid(i.getWindturbineId());
            vo.setNemCode(CacheContext.wtmap.get(i.getWindturbineId()).getAname());
            Optional<ProEconWtwindDayInfo> first = fzyList.stream().filter(fzy -> fzy.getWindturbineId().equals(i.getWindturbineId())).findFirst();
            List<FzyVo> vos = new ArrayList<>();
            if (first.isPresent()) {
                vos = getFzyVos(first, dateType);
                vo.setJfpl(first.get().getCb());
            }

            switch (dateType) {
                case "1":
                    vo.setFdl(i.getRfdl());
                    vo.setYfdl(i.getRyfdl());
                    vo.setPjgl(i.getRpjgl());
                    vo.setPjfs(i.getRpjfs());
                    vo.setYxxs(i.getRyxxs());
                    vo.setDjxs(i.getRdjxs());
                    vo.setGzxs(i.getRgzxs());
                    vo.setWhxs(i.getRjxxs());
                    vo.setZdxs(i.getRzdxs());
                    vo.setYxfs(i.getRyxfs());
                    vo.setSsdl(i.getRssdl());
                    vo.setBjcs(i.getRbjcs());
                    vo.setTjcs(i.getRtjcs());
                    vo.setBbhcs(i.getRbbhcs());
                    vo.setSbklly(i.getRsbklyl());
                    vo.setPjwd(i.getRpjwd());
                    vo.setPjsd(i.getRpjsd());
                    vo.setPjyq(i.getRpjyq());
                    vo.setNhyd(i.getRnhyd());
                    vo.setSjbz(i.getRsjbz());
                    break;
                case "2":
                    vo.setFdl(i.getYfdl());
                    vo.setYfdl(i.getYyfdl());
                    vo.setPjgl(i.getYpjgl());
                    vo.setPjfs(i.getYpjfs());
                    vo.setYxxs(i.getYyxxs());
                    vo.setDjxs(i.getYdjxs());
                    vo.setGzxs(i.getYgzxs());
                    vo.setWhxs(i.getYjxxs());
                    vo.setZdxs(i.getYzdxs());
                    vo.setYxfs(i.getYyxfs());
                    vo.setSsdl(i.getYssdl());
                    vo.setBjcs(i.getYbjcs());
                    vo.setTjcs(i.getYtjcs());
                    vo.setBbhcs(i.getYbbhcs());
                    vo.setSbklly(i.getYsbklyl());
                    vo.setPjwd(i.getYpjwd());
                    vo.setPjsd(i.getYpjsd());
                    vo.setPjyq(i.getYpjyq());
                    vo.setNhyd(i.getYnhyd());
                    vo.setSjbz(i.getYsjbz());
                    break;
                case "3":
                    vo.setFdl(i.getNfdl());
                    vo.setYfdl(i.getNyfdl());
                    vo.setPjgl(i.getNpjgl());
                    vo.setPjfs(i.getNpjfs());
                    vo.setYxxs(i.getNyxxs());
                    vo.setDjxs(i.getNdjxs());
                    vo.setGzxs(i.getNgzxs());
                    vo.setWhxs(i.getNjxxs());
                    vo.setZdxs(i.getNzdxs());
                    vo.setYxfs(i.getNyxfs());
                    vo.setSsdl(i.getNssdl());
                    vo.setBjcs(i.getNbjcs());
                    vo.setTjcs(i.getNtjcs());
                    vo.setBbhcs(i.getNbbhcs());
                    vo.setSbklly(i.getNsbklyl());
                    vo.setPjwd(i.getNpjwd());
                    vo.setPjsd(i.getNpjsd());
                    vo.setPjyq(i.getNpjyq());
                    vo.setNhyd(i.getNnhyd());
                    vo.setSjbz(i.getNsjbz());
                    break;

            }
            vo.setFzyList(vos);


            resultList.add(vo);
        });
        return resultList;
    }


    List<FzyVo> getFzyVos(Optional<ProEconWtwindDayInfo> first, String dateType) {
        List<FzyVo> vos = new ArrayList<>();
        ProEconWtwindDayInfo winfo = first.get();

        switch (dateType) {
            case "1":
                for (int j = 0; j < 16; j++) {
                    FzyVo vo = new FzyVo();

                    switch (j) {
                        case 0:
                            // vo.setName("N("+winfo.getN4()+"/"+winfo.getN()+")");
                            vo.setName("N");
                            vo.setValue(winfo.getN4());
                            break;
                        case 1:
                            // vo.setName("NNE("+winfo.getNne4()+"/"+winfo.getNne()+")");
                            vo.setName("NNE");
                            vo.setValue(winfo.getNne4());
                            break;
                        case 2:
                            // vo.setName("NE("+winfo.getNe4()+"/"+winfo.getNe()+")");
                            vo.setName("NE");
                            vo.setValue(winfo.getNe4());
                            break;
                        case 3:
                            // vo.setName("ENE("+winfo.getEne4()+"/"+winfo.getEne()+")");
                            vo.setName("ENE");
                            vo.setValue(winfo.getEne4());

                            break;
                        case 4:
                            // vo.setName("E("+winfo.getE4()+"/"+winfo.getE()+")");
                            vo.setName("E");
                            vo.setValue(winfo.getE4());
                            break;
                        case 5:
                            // vo.setName("ESE("+winfo.getEse()+"/"+winfo.getEse()+")");
                            vo.setName("ESE");
                            vo.setValue(winfo.getEse4());
                            break;
                        case 6:
                            // vo.setName("SE("+winfo.getSe4()+"/"+winfo.getSe()+")");
                            vo.setName("SE");
                            vo.setValue(winfo.getSe4());
                            break;
                        case 7:
                            // vo.setName("SSE("+winfo.getSse4()+"/"+winfo.getSse()+")");
                            vo.setName("SSE");
                            vo.setValue(winfo.getSse4());
                            break;
                        case 8:
                            // vo.setName("S("+winfo.getS4()+"/"+winfo.getS()+")");
                            vo.setName("S");
                            vo.setValue(winfo.getS4());
                            break;
                        case 9:
                            // vo.setName("SSW("+winfo.getSsw4()+"/"+winfo.getSsw()+")");
                            vo.setName("SSW");
                            vo.setValue(winfo.getSsw4());
                            break;
                        case 10:
                            // vo.setName("SW("+winfo.getSw4()+"/"+winfo.getSw()+")");
                            vo.setName("SW");
                            vo.setValue(winfo.getSw4());
                            break;
                        case 11:
                            // vo.setName("WSW("+winfo.getWsw4()+"/"+winfo.getWsw()+")");
                            vo.setName("WSW");
                            vo.setValue(winfo.getWsw4());

                            break;
                        case 12:
                            // vo.setName("W("+winfo.getW4()+"/"+winfo.getW()+")");
                            vo.setName("W");
                            vo.setValue(winfo.getW4());
                            break;
                        case 13:
                            // vo.setName("WNW("+winfo.getWnw4()+"/"+winfo.getWnw()+")");
                            vo.setName("WNW");
                            vo.setValue(winfo.getWnw4());
                            break;
                        case 14:
                            // vo.setName("NW("+winfo.getNw4()+"/"+winfo.getNw()+")");
                            vo.setName("NW");
                            vo.setValue(winfo.getNw4());
                            break;
                        case 15:
                            // vo.setName("NNW("+winfo.getNnw4()+"/"+winfo.getNnw()+")");
                            vo.setName("NNW");
                            vo.setValue(winfo.getNnw4());
                            break;

                        default:
                            break;
                    }
                    vos.add(vo);
                }
                break;
            case "2":
                for (int j = 0; j < 16; j++) {
                    FzyVo vo = new FzyVo();

                    switch (j) {
                        case 0:
                            // vo.setName("N("+winfo.getN4()+"/"+winfo.getN()+")");
                            vo.setName("N");
                            vo.setValue(winfo.getN10());
                            break;
                        case 1:
                            // vo.setName("NNE("+winfo.getNne4()+"/"+winfo.getNne()+")");
                            vo.setName("NNE");
                            vo.setValue(winfo.getNne10());
                            break;
                        case 2:
                            // vo.setName("NE("+winfo.getNe4()+"/"+winfo.getNe()+")");
                            vo.setName("NE");
                            vo.setValue(winfo.getNe10());
                            break;
                        case 3:
                            // vo.setName("ENE("+winfo.getEne4()+"/"+winfo.getEne()+")");
                            vo.setName("ENE");
                            vo.setValue(winfo.getEne10());

                            break;
                        case 4:
                            // vo.setName("E("+winfo.getE4()+"/"+winfo.getE()+")");
                            vo.setName("E");
                            vo.setValue(winfo.getE10());
                            break;
                        case 5:
                            // vo.setName("ESE("+winfo.getEse()+"/"+winfo.getEse()+")");
                            vo.setName("ESE");
                            vo.setValue(winfo.getEse10());
                            break;
                        case 6:
                            // vo.setName("SE("+winfo.getSe4()+"/"+winfo.getSe()+")");
                            vo.setName("SE");
                            vo.setValue(winfo.getSe10());
                            break;
                        case 7:
                            // vo.setName("SSE("+winfo.getSse4()+"/"+winfo.getSse()+")");
                            vo.setName("SSE");
                            vo.setValue(winfo.getSse10());
                            break;
                        case 8:
                            // vo.setName("S("+winfo.getS4()+"/"+winfo.getS()+")");
                            vo.setName("S");
                            vo.setValue(winfo.getS10());
                            break;
                        case 9:
                            // vo.setName("SSW("+winfo.getSsw4()+"/"+winfo.getSsw()+")");
                            vo.setName("SSW");
                            vo.setValue(winfo.getSsw10());
                            break;
                        case 10:
                            // vo.setName("SW("+winfo.getSw4()+"/"+winfo.getSw()+")");
                            vo.setName("SW");
                            vo.setValue(winfo.getSw10());
                            break;
                        case 11:
                            // vo.setName("WSW("+winfo.getWsw4()+"/"+winfo.getWsw()+")");
                            vo.setName("WSW");
                            vo.setValue(winfo.getWsw10());

                            break;
                        case 12:
                            // vo.setName("W("+winfo.getW4()+"/"+winfo.getW()+")");
                            vo.setName("W");
                            vo.setValue(winfo.getW10());
                            break;
                        case 13:
                            // vo.setName("WNW("+winfo.getWnw4()+"/"+winfo.getWnw()+")");
                            vo.setName("WNW");
                            vo.setValue(winfo.getWnw10());
                            break;
                        case 14:
                            // vo.setName("NW("+winfo.getNw4()+"/"+winfo.getNw()+")");
                            vo.setName("NW");
                            vo.setValue(winfo.getNw10());
                            break;
                        case 15:
                            // vo.setName("NNW("+winfo.getNnw4()+"/"+winfo.getNnw()+")");
                            vo.setName("NNW");
                            vo.setValue(winfo.getNnw10());
                            break;

                        default:
                            break;
                    }
                    vos.add(vo);
                }
                break;
            case "3":
                for (int j = 0; j < 16; j++) {
                    FzyVo vo = new FzyVo();

                    switch (j) {
                        case 0:
                            // vo.setName("N("+winfo.getN4()+"/"+winfo.getN()+")");
                            vo.setName("N");
                            vo.setValue(winfo.getN16());
                            break;
                        case 1:
                            // vo.setName("NNE("+winfo.getNne4()+"/"+winfo.getNne()+")");
                            vo.setName("NNE");
                            vo.setValue(winfo.getNne16());
                            break;
                        case 2:
                            // vo.setName("NE("+winfo.getNe4()+"/"+winfo.getNe()+")");
                            vo.setName("NE");
                            vo.setValue(winfo.getNe16());
                            break;
                        case 3:
                            // vo.setName("ENE("+winfo.getEne4()+"/"+winfo.getEne()+")");
                            vo.setName("ENE");
                            vo.setValue(winfo.getEne16());

                            break;
                        case 4:
                            // vo.setName("E("+winfo.getE4()+"/"+winfo.getE()+")");
                            vo.setName("E");
                            vo.setValue(winfo.getE16());
                            break;
                        case 5:
                            // vo.setName("ESE("+winfo.getEse()+"/"+winfo.getEse()+")");
                            vo.setName("ESE");
                            vo.setValue(winfo.getEse16());
                            break;
                        case 6:
                            // vo.setName("SE("+winfo.getSe4()+"/"+winfo.getSe()+")");
                            vo.setName("SE");
                            vo.setValue(winfo.getSe16());
                            break;
                        case 7:
                            // vo.setName("SSE("+winfo.getSse4()+"/"+winfo.getSse()+")");
                            vo.setName("SSE");
                            vo.setValue(winfo.getSse16());
                            break;
                        case 8:
                            // vo.setName("S("+winfo.getS4()+"/"+winfo.getS()+")");
                            vo.setName("S");
                            vo.setValue(winfo.getS16());
                            break;
                        case 9:
                            // vo.setName("SSW("+winfo.getSsw4()+"/"+winfo.getSsw()+")");
                            vo.setName("SSW");
                            vo.setValue(winfo.getSsw16());
                            break;
                        case 10:
                            // vo.setName("SW("+winfo.getSw4()+"/"+winfo.getSw()+")");
                            vo.setName("SW");
                            vo.setValue(winfo.getSw16());
                            break;
                        case 11:
                            // vo.setName("WSW("+winfo.getWsw4()+"/"+winfo.getWsw()+")");
                            vo.setName("WSW");
                            vo.setValue(winfo.getWsw16());

                            break;
                        case 12:
                            // vo.setName("W("+winfo.getW4()+"/"+winfo.getW()+")");
                            vo.setName("W");
                            vo.setValue(winfo.getW16());
                            break;
                        case 13:
                            // vo.setName("WNW("+winfo.getWnw4()+"/"+winfo.getWnw()+")");
                            vo.setName("WNW");
                            vo.setValue(winfo.getWnw16());
                            break;
                        case 14:
                            // vo.setName("NW("+winfo.getNw4()+"/"+winfo.getNw()+")");
                            vo.setName("NW");
                            vo.setValue(winfo.getNw16());
                            break;
                        case 15:
                            // vo.setName("NNW("+winfo.getNnw4()+"/"+winfo.getNnw()+")");
                            vo.setName("NNW");
                            vo.setValue(winfo.getNnw16());
                            break;

                        default:
                            break;
                    }
                    vos.add(vo);
                }
                break;

        }

        return vos;
    }


}
