| | |
| | | import com.fgkj.dao.impl.*; |
| | | import com.fgkj.dto.*; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.LinkedList; |
| | | import java.util.List; |
| | | |
| | |
| | | realCap = rtState.getBatt_test_cap().doubleValue(); |
| | | }else { |
| | | //查询出当前测试容量对应标准曲线的单体电压 |
| | | Double StandVol = new Battmon_testcapImpl().searchBattStandardVol(battInf.getMonVolStd(),battInf.getMonCapStd(),rtState.getBatt_test_cap(),avg_hourRate); |
| | | /*Double StandVol = new Battmon_testcapImpl().searchBattStandardVol(battInf.getMonVolStd(),battInf.getMonCapStd(),rtState.getBatt_test_cap(),avg_hourRate); |
| | | if(StandVol!=null) { |
| | | if (battInf.getMonVolStd() == 12) { |
| | | realCap = Math.abs((double) ((rtState.getGroup_vol() - STANDARD_VOL_12V) / (StandVol * battInf.getMonCount() - STANDARD_VOL_12V)) * battInf.getMonCapStd() * 1.2); |
| | |
| | | if ((battInf.getMonCapStd() * 1.2) < realCap) { |
| | | realCap = (battInf.getMonCapStd() * 1.2); |
| | | } |
| | | }*/ |
| | | //查询出当前测试容量对应标准曲线的单体电压的第一笔,最后一笔,最小值,最大值,平均值 |
| | | String realCapStr=""; |
| | | List<Double> StandVolList = new Battmon_testcapImpl().searchBattStandardVolList(battInf.getMonVolStd(),battInf.getMonCapStd(),rtState.getBatt_test_cap(),avg_hourRate); |
| | | List<Double> volList = new LinkedList<>(); |
| | | if(StandVolList!=null) { |
| | | //求计算值 |
| | | Double maxVol = Collections.max(StandVolList); |
| | | Double minVol = Collections.min(StandVolList); |
| | | Double avgVol = StandVolList.stream().mapToDouble(vol -> vol).average().getAsDouble(); |
| | | Double fistVol = StandVolList.get(0); |
| | | Double lastVol = StandVolList.get(StandVolList.size() - 1); |
| | | |
| | | volList.add(fistVol); |
| | | volList.add(lastVol); |
| | | volList.add(minVol); |
| | | volList.add(maxVol); |
| | | volList.add(avgVol); |
| | | |
| | | for (Double StandVol:volList){ |
| | | if (battInf.getMonVolStd() == 12) { |
| | | realCapStr += Math.abs((double) ((rtState.getGroup_vol() - STANDARD_VOL_12V) / (StandVol * battInf.getMonCount() - STANDARD_VOL_12V)) * battInf.getMonCapStd() * 1.2); |
| | | } else if (battInf.getMonVolStd() == 2) { |
| | | realCapStr += Math.abs((double) ((rtState.getGroup_vol() - STANDARD_VOL_2V) / (StandVol * battInf.getMonCount() - STANDARD_VOL_2V)) * battInf.getMonCapStd() * 1.2); |
| | | } |
| | | if ((battInf.getMonCapStd() * 1.2) < realCap) { |
| | | realCapStr += (battInf.getMonCapStd() * 1.2); |
| | | } |
| | | } |
| | | rtState.setStationId(realCapStr); |
| | | } |
| | | } |
| | | } |