|
@@ -31,24 +31,28 @@ public class PowerTemperatureService {
|
|
|
public Object ratedPower(String ids) {
|
|
|
List<Object> result = new ArrayList<>();
|
|
|
List<Powerfittinganalysis> list = powerService.selectListByIds(ids);
|
|
|
- if (list == null || list.size() == 0)
|
|
|
+ if (list == null || list.size() == 0) {
|
|
|
return result;
|
|
|
+ }
|
|
|
|
|
|
for (Powerfittinganalysis obj : list){
|
|
|
- Powerfittinganalysis pf = powerService.selectItemById(obj.getId());
|
|
|
- List<Modelpowerdetails> ls = InitialRunner.modelPowerDetailMap.get(InitialRunner.wtMap.get(obj.getWindturbine()).getModelid());
|
|
|
- Double theoryPower = ls.get(ls.size() - 1).getTheorypower(); //理论功率
|
|
|
- Map<String, Object> map = csvParse(pf);//数据解析
|
|
|
- List<PowerPointData> data = (List<PowerPointData>) map.get("data");
|
|
|
- Object res = PowerTemperatureAlg.temperatureRatedPower(data, theoryPower, (Double) map.get("minT"), (Double) map.get("maxT"));
|
|
|
- List<int[]> rp = PowerTemperatureAlg.temperatureRatedPower(data);
|
|
|
-
|
|
|
- Map<String, Object> mp = new HashMap<>();
|
|
|
- mp.put("wt", pf.getWindturbine());
|
|
|
- mp.put("power", InitialRunner.equipmentMap.get(InitialRunner.wtMap.get(pf.getWindturbine()).getModelid()));
|
|
|
- mp.put("res1", res); //额定功率vs.温度分析
|
|
|
- mp.put("res2", rp); //额定功率vs.温度分析
|
|
|
- result.add(mp);
|
|
|
+ String[] split = obj.getProcessid().split(",");
|
|
|
+ for (String id : split){
|
|
|
+ Powerfittinganalysis pf = powerService.selectItemById(id);
|
|
|
+ List<Modelpowerdetails> ls = InitialRunner.modelPowerDetailMap.get(InitialRunner.wtMap.get(obj.getWindturbine()).getModelid());
|
|
|
+ Double theoryPower = ls.get(ls.size() - 1).getTheorypower(); //理论功率
|
|
|
+ Map<String, Object> map = csvParse(pf);//数据解析
|
|
|
+ List<PowerPointData> data = (List<PowerPointData>) map.get("data");
|
|
|
+ Object res = PowerTemperatureAlg.temperatureRatedPower(data, theoryPower, (Double) map.get("minT"), (Double) map.get("maxT"));
|
|
|
+ List<int[]> rp = PowerTemperatureAlg.temperatureRatedPower(data);
|
|
|
+
|
|
|
+ Map<String, Object> mp = new HashMap<>();
|
|
|
+ mp.put("wt", pf.getWindturbine());
|
|
|
+ mp.put("power", InitialRunner.equipmentMap.get(InitialRunner.wtMap.get(pf.getWindturbine()).getModelid()));
|
|
|
+ mp.put("res1", res); //额定功率vs.温度分析
|
|
|
+ mp.put("res2", rp); //额定功率vs.温度分析
|
|
|
+ result.add(mp);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return result;
|
|
@@ -58,8 +62,9 @@ public class PowerTemperatureService {
|
|
|
public Object curveAnalysis(String id) {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
Powerfittinganalysis obj = powerService.selectItemById(id);
|
|
|
- if (obj == null)
|
|
|
+ if (obj == null) {
|
|
|
return map;
|
|
|
+ }
|
|
|
|
|
|
//实际功率
|
|
|
List<Object> sjglList = new ArrayList<>();
|
|
@@ -79,12 +84,14 @@ public class PowerTemperatureService {
|
|
|
String[] ids = obj.getProcessid().split(",");
|
|
|
for (String pid : ids) {
|
|
|
Powerfittinganalysis pf = powerService.selectItemById(pid);
|
|
|
- List<String> lp = FileUtil.readFile(pf.getPath(), true); //数据解析
|
|
|
+ //数据解析
|
|
|
+ List<String> lp = FileUtil.readFile(pf.getPath(), true);
|
|
|
for (int i = 1; i < lp.size(); i++){
|
|
|
String[] split = lp.get(i).split(",");
|
|
|
PowerPointData pd = new PowerPointData(split, true);
|
|
|
- if (pd.getSpeed() < 0 || pd.getPower() < 0)
|
|
|
+ if (pd.getSpeed() < 0 || pd.getPower() < 0) {
|
|
|
continue;
|
|
|
+ }
|
|
|
|
|
|
Object[] temp = new Object[3];
|
|
|
temp[0] = pd.getSpeed();
|