|
@@ -1,11 +1,20 @@
|
|
|
-//package com.gyee.generation;
|
|
|
-//
|
|
|
+//package com.gyee.generation.service;
|
|
|
+//
|
|
|
+//import com.gyee.common.contant.Contant;
|
|
|
+//import com.gyee.generation.init.CacheContext;
|
|
|
+//import com.gyee.generation.model.auto.*;
|
|
|
+//import com.gyee.generation.model.vo.CureFitting;
|
|
|
+//import com.gyee.generation.model.vo.PointVo;
|
|
|
+//import com.gyee.generation.service.auto.*;
|
|
|
+//import com.gyee.generation.util.DateUtils;
|
|
|
+//import com.gyee.generation.util.StringUtils;
|
|
|
//import com.gyee.generation.util.realtimesource.IEdosUtil;
|
|
|
//import org.springframework.beans.factory.annotation.Value;
|
|
|
//
|
|
|
//import javax.annotation.Resource;
|
|
|
//import java.io.Console;
|
|
|
-//import java.util.Date;
|
|
|
+//import java.util.*;
|
|
|
+//import java.util.stream.Collectors;
|
|
|
//
|
|
|
//public class PowerCurveFittingService {
|
|
|
//
|
|
@@ -17,221 +26,253 @@
|
|
|
// @Value("${curvefitting.scale}")
|
|
|
// private Double scale;
|
|
|
//
|
|
|
+// public Map<String, Double> windturbineCapacity;
|
|
|
+//
|
|
|
+// @Resource
|
|
|
+// private IProEconWtCurveFittingMonthService proEconWtCurveFittingMonthService;
|
|
|
+// @Resource
|
|
|
+// private IProEconWtCurveFittingService proEconWtCurveFittingService;
|
|
|
+//
|
|
|
+// @Resource
|
|
|
+// private IProEconCurveFittingMainService proEconCurveFittingMainService;
|
|
|
+// @Resource
|
|
|
+// private IProEconCurveFittingSubService proEconCurveFittingSubService;
|
|
|
+// @Resource
|
|
|
+// private IProEconCurveFittMonthMainService proEconCurveFittMonthMainService;
|
|
|
+// @Resource
|
|
|
+// private IProEconCurveFittMonthSubService proEconCurveFittMonthSubService;
|
|
|
//
|
|
|
-// public void CureFitting(Date nowDate, Date begion, int insertType, String fdcId, params String[] fdjIds)
|
|
|
+// public void CureFitting(Date nowDate, Date begion, int insertType, String fdcId, List<String> fdjIds)
|
|
|
// {
|
|
|
//
|
|
|
+// //日期变为昨天
|
|
|
+// Date current = DateUtils.addDays(DateUtils.truncDay(nowDate),-1);
|
|
|
//
|
|
|
-// Date current = nowDate.Date.AddDays(-1);
|
|
|
-// int year = current.Year;
|
|
|
-// int month = current.Month;
|
|
|
-// Date begin1 = new Date(year, month, 1);
|
|
|
-// Date begin2 = current.AddDays(-6);
|
|
|
-// //Date begin2 = current;
|
|
|
-// Date end = nowDate.Date;
|
|
|
-// if (begion != Date.MaxValue && begion != Date.MinValue)
|
|
|
+// Calendar c=Calendar.getInstance();
|
|
|
+// c.setTime(current);
|
|
|
+// int year = c.get(Calendar.YEAR);
|
|
|
+// int month = c.get(Calendar.MONTH)+1;
|
|
|
+// c.set(Calendar.DAY_OF_MONTH,1);
|
|
|
+// Date begin1 = c.getTime();
|
|
|
+//
|
|
|
+// Date begin2 = DateUtils.addDays(current,-6);;
|
|
|
+//
|
|
|
+// Date end = DateUtils.truncDay(nowDate);
|
|
|
+// if (begion.getTime() != new Date(0).getTime() && begion.getTime() != new Date(Long.MAX_VALUE).getTime())
|
|
|
// {
|
|
|
// begin1 = begion;
|
|
|
// }
|
|
|
//
|
|
|
//
|
|
|
-// int dimension = ConfigurationFramework.ConfigManager.MySection.CurveFitting.dimension;
|
|
|
-// double scale = ConfigurationFramework.ConfigManager.MySection.CurveFitting.scale;
|
|
|
+// int dimension = this.dimension;
|
|
|
+// double scale = this.scale;
|
|
|
//
|
|
|
// //上个月
|
|
|
-// int year2 = begin1.AddMonths(-1).Year;
|
|
|
-// int month2 = begin1.AddMonths(-1).Month;
|
|
|
+// c.setTime(DateUtils.addMonths(begin1,-1));
|
|
|
+// int year2 = c.get(Calendar.YEAR);
|
|
|
+// int month2 = c.get(Calendar.MONTH)+1;
|
|
|
//
|
|
|
// //去年同期
|
|
|
-// int year3 = begin1.AddYears(-1).Year;
|
|
|
-// int month3 = begin1.AddYears(-1).Month;
|
|
|
+// c.setTime(DateUtils.addYears(begin1,-1));
|
|
|
+// int year3 = c.get(Calendar.YEAR);
|
|
|
+// int month3 = c.get(Calendar.MONTH)+1;
|
|
|
//
|
|
|
//
|
|
|
-// Dictionary<String, CureFitting> windDictionary = new Dictionary<String, CureFitting>();
|
|
|
-// using (GdsjEntities entities = new GdsjEntities())
|
|
|
-// {
|
|
|
+// Map<String, CureFitting> windMap = new HashMap<String, CureFitting>();
|
|
|
//
|
|
|
//
|
|
|
-// var WindturbineIds = entities.WINDTURBINE.Where(GetConditionExpression<WINDTURBINE>(WindList.ToArray<String>(), "WINDPOWERSTATIONID")).ToList();
|
|
|
+//
|
|
|
+// List<ProBasicWindturbine> wtls = CacheContext.wtls;
|
|
|
//
|
|
|
// if (windturbineCapacity == null)
|
|
|
// {
|
|
|
-// windturbineCapacity = new Dictionary<String, decimal>();
|
|
|
-// Dictionary<String, EQUIPMENTMODEL> modelDictionary = entities.EQUIPMENTMODEL.ToDictionary(it => it.ID);
|
|
|
-// foreach (var windturbine in WindturbineIds)
|
|
|
+// windturbineCapacity = new HashMap<String, Double>();
|
|
|
+// Map<String, ProEconEquipmentmodel> modelMap = CacheContext.modelMap;
|
|
|
+// for (ProBasicWindturbine windturbine : wtls)
|
|
|
// {
|
|
|
-// if (modelDictionary.ContainsKey(windturbine.MODELID))
|
|
|
+// if (modelMap.containsKey(windturbine.getModelId()))
|
|
|
// {
|
|
|
-// windturbineCapacity.Add(windturbine.ID, modelDictionary[windturbine.MODELID].POWERPRODUCTION.Value);
|
|
|
+// windturbineCapacity.put(windturbine.getId(), modelMap.get(windturbine.getModelId()).getPowerProduction());
|
|
|
// }
|
|
|
// }
|
|
|
// }
|
|
|
-// foreach (var windturbine in WindturbineIds)
|
|
|
+// for (ProBasicWindturbine wt : wtls)
|
|
|
// {
|
|
|
-// String windturbineId = windturbine.ID;
|
|
|
-// String windpowerId = windturbine.WINDPOWERSTATIONID;
|
|
|
+// String windturbineId = wt.getId();
|
|
|
+// String windpowerId = wt.getWindpowerstationId();
|
|
|
//
|
|
|
-// if (fdcId != null && fdcId != String.Empty)
|
|
|
+// if (StringUtils.notEmp(fdcId))
|
|
|
// {
|
|
|
-// if (fdcId != windpowerId)
|
|
|
+// if (!fdcId.equals(windpowerId))
|
|
|
// {
|
|
|
// continue;
|
|
|
// }
|
|
|
// }
|
|
|
// if (fdjIds != null)
|
|
|
// {
|
|
|
-// if (!fdjIds.Contains(windturbineId))
|
|
|
+// if (!fdjIds.contains(windturbineId))
|
|
|
// {
|
|
|
// continue;
|
|
|
// }
|
|
|
// }
|
|
|
//
|
|
|
-// String pointIdGL = entities.WINDTURBINETESTINGPOINTAI.Where(it => it.UNIFORMCODE == BusinessHandle.GdnxfdTarget.FJYG && it.WINDTURBINEID == windturbineId).Select(it => it.ID).FirstOrDefault();
|
|
|
+// Map<String, ProBasicEquipmentPoint> windturbinetestingpointnewMap = CacheContext.wtpAimap.get(wt.getId());
|
|
|
+//
|
|
|
+// String pointIdGL =windturbinetestingpointnewMap.get(Contant.AI130).getCode();
|
|
|
//
|
|
|
-// String pointIdZT = entities.WINDTURBINETESTINGPOINTAI.Where(it => it.UNIFORMCODE == BusinessHandle.GdnxfdTarget.ZTMX && it.WINDTURBINEID == windturbineId).Select(it => it.ID).FirstOrDefault();
|
|
|
+//
|
|
|
+// String pointIdZT =windturbinetestingpointnewMap.get(Contant.ZTMX).getCode();
|
|
|
//
|
|
|
// String pointIdFS = "";
|
|
|
-// if (type == "GDC")
|
|
|
-// pointIdFS = entities.WINDPOWERSTATIONTESTINGPOINT.Where(it => it.UNIFORMCODE == BusinessHandle.GdnxfdTarget.IRRAD && it.WINDPOWERSTATIONID == windpowerId).Select(it => it.CODE).FirstOrDefault();
|
|
|
-// else
|
|
|
-// pointIdFS = entities.WINDTURBINETESTINGPOINTAI.Where(it => it.UNIFORMCODE == BusinessHandle.GdnxfdTarget.FJFS && it.WINDTURBINEID == windturbineId).Select(it => it.ID).FirstOrDefault();
|
|
|
+// if (wt.getWindpowerstationId().endsWith("GDC"))
|
|
|
+// {
|
|
|
+// pointIdFS = windturbinetestingpointnewMap.get(Contant.IRRAD).getCode();;
|
|
|
+//
|
|
|
+// }else
|
|
|
+// {
|
|
|
+// pointIdFS = windturbinetestingpointnewMap.get(Contant.AI022).getCode();
|
|
|
+// }
|
|
|
//
|
|
|
-// //String pointIdZT2 = entities.WINDTURBINETESTINGPOINTDI2.Where(it => it.UNIFORMCODE == "DI064" && it.WINDTURBINEID == windturbineId).Select(it => it.ID).FirstOrDefault();
|
|
|
//
|
|
|
-// //if (pointIdZT2 == null)
|
|
|
-// //{
|
|
|
-// // pointIdZT2 = entities.WINDTURBINETESTINGPOINTDIS2.Where(it => it.NAME.IndexOf("发电状态")>-1 && it.WINDTURBINEID == windturbineId).Select(it => it.ID).FirstOrDefault();
|
|
|
-// //}
|
|
|
//
|
|
|
+// CureFitting item = new CureFitting();
|
|
|
//
|
|
|
-// CureFitting item = new Tools.CureFitting();
|
|
|
+// item.setPointIdFS(pointIdFS);
|
|
|
+// item.setPointIdZT(pointIdZT);
|
|
|
+// item.setPointIdGL(pointIdZT);
|
|
|
+// //获取标杆风机编号
|
|
|
+// if(CacheContext.wtstandardmap.containsKey(wt.getId()))
|
|
|
+// {
|
|
|
+// item.setStandardId(CacheContext.wtstandardmap.get(wt.getId()));
|
|
|
+// }else
|
|
|
+// {
|
|
|
+// item.setStandardId(wt.getId());
|
|
|
+// }
|
|
|
//
|
|
|
-// item.pointIdFS = pointIdFS;
|
|
|
-// item.pointIdGL = pointIdGL;
|
|
|
-// item.pointIdZT = pointIdZT;
|
|
|
-// //item.pointIdZT2 = pointIdZT2;
|
|
|
-// item.StandardId = windturbine.STANDARDID;
|
|
|
-// windDictionary.Add(windturbineId, item);
|
|
|
+// windMap.put(windturbineId, item);
|
|
|
// }
|
|
|
-// }
|
|
|
//
|
|
|
//
|
|
|
-// foreach (String key in windDictionary.Keys)
|
|
|
+//
|
|
|
+// for (String key : windMap.keySet())
|
|
|
// {
|
|
|
-// windDictionary[key].myPoints1 = new List<MyMath.Point>();
|
|
|
-// windDictionary[key].myPointsFF1 = new List<MyMath.Point>();
|
|
|
+// windMap.get(key).setMyPoints1(new ArrayList<PointVo>());
|
|
|
+// windMap.get(key).setMyPointsFF1(new ArrayList<PointVo>());
|
|
|
+// windMap.get(key).setMyPoints2(new ArrayList<PointVo>());
|
|
|
+// windMap.get(key).setMyPointsFF2(new ArrayList<PointVo>());
|
|
|
//
|
|
|
-// windDictionary[key].myPoints2 = new List<MyMath.Point>();
|
|
|
-// windDictionary[key].myPointsFF2 = new List<MyMath.Point>();
|
|
|
//
|
|
|
-// if (windDictionary[key].pointIdGL == null || windDictionary[key].pointIdFS == null || windDictionary[key].pointIdZT == null)
|
|
|
+// if (windMap.get(key).getPointIdGL() == null || windMap.get(key).getPointIdFS() == null || windMap.get(key).getPointIdZT() == null)
|
|
|
// {
|
|
|
-// Console.WriteLine(key);
|
|
|
+// System.out.println(key);
|
|
|
// continue;
|
|
|
// }
|
|
|
//
|
|
|
//
|
|
|
-// CurveFittingBuilder(begin1, end, dimension, scale, windDictionary[key].pointIdGL, windDictionary[key].pointIdFS, windDictionary[key].pointIdZT, windDictionary[key].myPoints1, windDictionary[key].myPointsFF1, key);
|
|
|
-// CurveFittingBuilder(begin2, end, dimension, scale, windDictionary[key].pointIdGL, windDictionary[key].pointIdFS, windDictionary[key].pointIdZT, windDictionary[key].myPoints2, windDictionary[key].myPointsFF2, key);
|
|
|
+// CurveFittingBuilder(begin1, end, dimension, scale, windMap.get(key).getPointIdGL(), windMap.get(key).getPointIdFS(), windMap.get(key).getPointIdZT(),windMap.get(key).getMyPoints1(), windMap.get(key).getMyPointsFF1(), key);
|
|
|
+// CurveFittingBuilder(begin2, end, dimension, scale, windMap.get(key).getPointIdGL(), windMap.get(key).getPointIdFS(), windMap.get(key).getPointIdZT(), windMap.get(key).getMyPoints2(), windMap.get(key).getMyPointsFF2(), key);
|
|
|
// }
|
|
|
//
|
|
|
-// foreach (String key in windDictionary.Keys)
|
|
|
+// for (String key : windMap.keySet())
|
|
|
// {
|
|
|
//
|
|
|
-// decimal modelpower = 1500;
|
|
|
-// if (windturbineCapacity.ContainsKey(key))
|
|
|
+// Double modelpower = 1500.0;
|
|
|
+// if (windturbineCapacity.containsKey(key))
|
|
|
// {
|
|
|
-// modelpower = windturbineCapacity[key];
|
|
|
+// modelpower = windturbineCapacity.get(key);
|
|
|
// }
|
|
|
//
|
|
|
-// using (GdsjEntities entities = new GdsjEntities())
|
|
|
-// {
|
|
|
//
|
|
|
//
|
|
|
// //月的上月
|
|
|
-// List<MyMath.Point> monthPoints = new List<MyMath.Point>();
|
|
|
+// List<PointVo> monthPoints = new ArrayList<PointVo>();
|
|
|
// //月的去年同期
|
|
|
-// List<MyMath.Point> yearPoints = new List<MyMath.Point>();
|
|
|
+// List<PointVo> yearPoints = new ArrayList<PointVo>();
|
|
|
// //月标准功率
|
|
|
-// List<MyMath.Point> standardPoints = new List<MyMath.Point>();
|
|
|
+// List<PointVo> standardPoints = new ArrayList<PointVo>();
|
|
|
//
|
|
|
//
|
|
|
// //日的昨天
|
|
|
-// List<MyMath.Point> monthdayPoints = new List<MyMath.Point>();
|
|
|
+// List<PointVo> monthdayPoints = new ArrayList<PointVo>();
|
|
|
// //日的去年同期
|
|
|
-// List<MyMath.Point> yeardayPoints = new List<MyMath.Point>();
|
|
|
+// List<PointVo> yeardayPoints = new ArrayList<PointVo>();
|
|
|
// //日标准功率
|
|
|
-// List<MyMath.Point> standarddayPoints = new List<MyMath.Point>();
|
|
|
+// List<PointVo> standarddayPoints = new ArrayList<PointVo>();
|
|
|
//
|
|
|
// //保证功率
|
|
|
-// List<MyMath.Point> powerPoints = new List<MyMath.Point>();
|
|
|
+// List<PointVo> powerPoints = new ArrayList<PointVo>();
|
|
|
//
|
|
|
//
|
|
|
//
|
|
|
//
|
|
|
-// if (windTurbineDictionary.ContainsKey(key))
|
|
|
+// if (CacheContext.wtstandardmap.containsKey(key))
|
|
|
// {
|
|
|
-// String standardId = windTurbineDictionary[key].STANDARDID;
|
|
|
-// if (!String.IsNullOrEmpty(standardId))
|
|
|
+// String standardId =CacheContext.wtstandardmap.get(key);
|
|
|
+// if (StringUtils.notEmp(standardId))
|
|
|
// {
|
|
|
-// if (windDictionary.ContainsKey(key))
|
|
|
+// if (windMap.containsKey(key))
|
|
|
// {
|
|
|
-// standardPoints = windDictionary[standardId].myPoints1;
|
|
|
-// standarddayPoints = windDictionary[standardId].myPoints2;
|
|
|
+// standardPoints = windMap.get(standardId).getMyPoints1();
|
|
|
+// standarddayPoints =windMap.get(standardId).getMyPoints2();
|
|
|
// }
|
|
|
// }
|
|
|
// }
|
|
|
//
|
|
|
-// String stringyear = year.ToString();
|
|
|
-// String stringmonth = month.ToString();
|
|
|
+// String stringyear = String.valueOf(year);
|
|
|
+// String stringmonth = String.valueOf(month);
|
|
|
//
|
|
|
-// String stringyear2 = year2.ToString();
|
|
|
-// String stringmonth2 = month2.ToString();
|
|
|
+// String stringyear2 =String.valueOf(year2);
|
|
|
+// String stringmonth2 = String.valueOf(month2);
|
|
|
//
|
|
|
-// String stringyear3 = year3.ToString();
|
|
|
-// String stringmonth3 = month3.ToString();
|
|
|
+// String stringyear3 = String.valueOf(year3);
|
|
|
+// String stringmonth3 = String.valueOf(month3);
|
|
|
//
|
|
|
-// var data = (from c in entities.WINDTURBINECURVEFITTINGMONTH
|
|
|
-// where (c.WINDTURBINEID == key && c.YEAR == stringyear2 && c.MONTH == stringmonth2)
|
|
|
-// select c).OrderBy(it => it.SPEED).ToList();
|
|
|
//
|
|
|
-// BuildPoints(data, monthPoints);
|
|
|
-// data = null;
|
|
|
-// data = (from c in entities.WINDTURBINECURVEFITTINGMONTH
|
|
|
-// where (c.WINDTURBINEID == key && c.YEAR == stringyear3 && c.MONTH == stringmonth3)
|
|
|
-// select c).OrderBy(it => it.SPEED).ToList();
|
|
|
+// List<ProEconWtCurveFittingMonth> wcfmls=proEconWtCurveFittingMonthService.list().stream().filter(i->i.getWindturbineId().equals(key) &&
|
|
|
+// i.getYear().equals(stringmonth2) && i.getMonth().equals(stringmonth2)).collect(Collectors.toList());
|
|
|
+// wcfmls.sort(Comparator.comparing(ProEconWtCurveFittingMonth::getSpeed));
|
|
|
//
|
|
|
-// BuildPoints(data, yearPoints);
|
|
|
//
|
|
|
-// Date d1 = current.AddDays(-1);
|
|
|
-// Date d2 = current.AddYears(-1);
|
|
|
+// BuildPoints(wcfmls, monthPoints);
|
|
|
+// wcfmls = null;
|
|
|
//
|
|
|
-// var data2 = (from c in entities.WINDTURBINECURVEFITTING
|
|
|
-// where (c.WINDTURBINEID == key && c.RECORDDATE.Value.CompareTo(d1) == 0)
|
|
|
-// select c).ToList();
|
|
|
+// wcfmls=proEconWtCurveFittingMonthService.list().stream().filter(i->i.getWindturbineId().equals(key) &&
|
|
|
+// i.getYear().equals(stringyear3) && i.getMonth().equals(stringmonth3)).collect(Collectors.toList());
|
|
|
+// wcfmls.sort(Comparator.comparing(ProEconWtCurveFittingMonth::getSpeed));
|
|
|
//
|
|
|
-// BuildPoints(data2, monthdayPoints);
|
|
|
+// BuildPoints(wcfmls, yearPoints);
|
|
|
//
|
|
|
-// data2 = null;
|
|
|
-// data2 = (from c in entities.WINDTURBINECURVEFITTING
|
|
|
-// where (c.WINDTURBINEID == key && c.RECORDDATE.Value.CompareTo(d2) == 0)
|
|
|
-// select c).ToList();
|
|
|
+// Date d1 = DateUtils.addDays(current,-1);
|
|
|
+// Date d2 = DateUtils.addDays(current,-1);
|
|
|
//
|
|
|
-// BuildPoints(data2, monthPoints);
|
|
|
+// List<ProEconWtCurveFitting> wcfls=proEconWtCurveFittingService.list().stream().filter(i->i.getWindturbineId().equals(key) &&
|
|
|
+// i.getRecordDate().compareTo(d1)==0).collect(Collectors.toList());
|
|
|
//
|
|
|
-// if (windTurbineDictionary.ContainsKey(key))
|
|
|
+//
|
|
|
+// BuildPoints(wcfls, monthdayPoints);
|
|
|
+//
|
|
|
+// wcfls = null;
|
|
|
+// wcfls=proEconWtCurveFittingService.list().stream().filter(i->i.getWindturbineId().equals(key) &&
|
|
|
+// i.getRecordDate().compareTo(d2)==0).collect(Collectors.toList());
|
|
|
+//
|
|
|
+//
|
|
|
+// BuildPoints(wcfls, monthPoints);
|
|
|
+//
|
|
|
+// if (CacheContext.wtmap.containsKey(key))
|
|
|
// {
|
|
|
-// String modelid = windTurbineDictionary[key].MODELID;
|
|
|
-// if (!String.IsNullOrEmpty(modelid))
|
|
|
+// String modelid = CacheContext.wtmap.get(key).getModelId();
|
|
|
+// if (StringUtils.notEmp(modelid))
|
|
|
// {
|
|
|
-// if (modelPowerDictionary.ContainsKey(modelid))
|
|
|
+// //获取模型功率曲线
|
|
|
+// if (CacheContext.modelpowermap.containsKey(modelid))
|
|
|
// {
|
|
|
-// foreach (var speed in modelPowerDictionary[modelid].Keys)
|
|
|
+// for (Double speed :CacheContext.modelpowermap.get(modelid).keySet())
|
|
|
// {
|
|
|
-// MyMath.Point point = new MyMath.Point();
|
|
|
-// point.X = (double)speed;
|
|
|
-// point.Y = (double)modelPowerDictionary[modelid][speed].ENSUREPOWER.Value;
|
|
|
-// powerPoints.Add(point);
|
|
|
+// PointVo point = new PointVo();
|
|
|
+// point.setX(speed);
|
|
|
+// point.setY(CacheContext.modelpowermap.get(modelid).get(speed).getEnsurePower());
|
|
|
+//
|
|
|
+// powerPoints.add(point);
|
|
|
// }
|
|
|
// }
|
|
|
// }
|
|
@@ -240,12 +281,12 @@
|
|
|
//
|
|
|
//
|
|
|
//
|
|
|
-// CURVEFITTINGMONTHMAIN main1 = (from c in entities.CURVEFITTINGMONTHMAIN
|
|
|
+// ProEconCurveFittMonthMain main1 = (from c : entities.ProEconCurveFittMonthMain
|
|
|
// where (c.WINDTURBINEID == key && c.YEAR == stringyear && c.MONTH == stringmonth)
|
|
|
// select c).FirstOrDefault();
|
|
|
// if (main1 == null)
|
|
|
// {
|
|
|
-// main1 = new CURVEFITTINGMONTHMAIN();
|
|
|
+// main1 = new ProEconCurveFittMonthMain();
|
|
|
// main1.ID = Guid.NewGuid().ToString();
|
|
|
// main1.WINDTURBINEID = key;
|
|
|
// main1.YEAR = year.ToString();
|
|
@@ -253,21 +294,21 @@
|
|
|
// entities.AddToCURVEFITTINGMONTHMAIN(main1);
|
|
|
// }
|
|
|
// //月---实际/最优
|
|
|
-// main1.DEVIATIONRATE1 = (decimal)pcl(windDictionary[key].myPoints1, windDictionary[key].myPointsFF1, modelpower);
|
|
|
+// main1.DEVIATIONRATE1 = (Double)pcl(windMap[key].myPoints1, windMap[key].myPointsFF1, modelpower);
|
|
|
// //月---实际/保证
|
|
|
-// main1.DEVIATIONRATE2 = (decimal)pcl(windDictionary[key].myPoints1, powerPoints, modelpower);
|
|
|
+// main1.DEVIATIONRATE2 = (Double)pcl(windMap[key].myPoints1, powerPoints, modelpower);
|
|
|
// //月---最优/保证
|
|
|
-// main1.DEVIATIONRATE3 = (decimal)pcl(windDictionary[key].myPointsFF1, powerPoints, modelpower);
|
|
|
+// main1.DEVIATIONRATE3 = (Double)pcl(windMap[key].myPointsFF1, powerPoints, modelpower);
|
|
|
// //月---实际/上月实际
|
|
|
-// main1.MONTHDEVIATIONRATE = (decimal)pcl(windDictionary[key].myPoints1, monthPoints, modelpower);
|
|
|
+// main1.MONTHDEVIATIONRATE = (Double)pcl(windMap[key].myPoints1, monthPoints, modelpower);
|
|
|
// //月---实际/同期实际
|
|
|
-// main1.YEARDEVIATIONRATE = (decimal)pcl(windDictionary[key].myPoints1, yearPoints, modelpower);
|
|
|
+// main1.YEARDEVIATIONRATE = (Double)pcl(windMap[key].myPoints1, yearPoints, modelpower);
|
|
|
// //月---实际/标杆实际
|
|
|
-// main1.STANDARDDEVIATIONRATE = (decimal)pcl(windDictionary[key].myPoints1, standardPoints, modelpower);
|
|
|
+// main1.STANDARDDEVIATIONRATE = (Double)pcl(windMap[key].myPoints1, standardPoints, modelpower);
|
|
|
//
|
|
|
//
|
|
|
//
|
|
|
-// CURVEFITTINGMAIN main2 = (from c in entities.CURVEFITTINGMAIN
|
|
|
+// CURVEFITTINGMAIN main2 = (from c : entities.CURVEFITTINGMAIN
|
|
|
// where (c.WINDTURBINEID == key && c.RECORDDATE.Value.CompareTo(current) == 0)
|
|
|
// select c).FirstOrDefault();
|
|
|
// if (main2 == null)
|
|
@@ -281,43 +322,43 @@
|
|
|
//
|
|
|
// }
|
|
|
// //日---实际/最优
|
|
|
-// main2.DEVIATIONRATE1 = (decimal)pcl(windDictionary[key].myPoints2, windDictionary[key].myPointsFF2, modelpower);
|
|
|
+// main2.DEVIATIONRATE1 = (Double)pcl(windMap[key].myPoints2, windMap[key].myPointsFF2, modelpower);
|
|
|
// //日---实际/保证
|
|
|
-// main2.DEVIATIONRATE2 = (decimal)pcl(windDictionary[key].myPoints2, powerPoints, modelpower);
|
|
|
+// main2.DEVIATIONRATE2 = (Double)pcl(windMap[key].myPoints2, powerPoints, modelpower);
|
|
|
// //日---最优/保证
|
|
|
-// main2.DEVIATIONRATE3 = (decimal)pcl(windDictionary[key].myPointsFF2, powerPoints, modelpower);
|
|
|
+// main2.DEVIATIONRATE3 = (Double)pcl(windMap[key].myPointsFF2, powerPoints, modelpower);
|
|
|
// //日---实际/上日实际
|
|
|
-// main2.MONTHDEVIATIONRATE = (decimal)pcl(windDictionary[key].myPoints2, monthdayPoints, modelpower);
|
|
|
+// main2.MONTHDEVIATIONRATE = (Double)pcl(windMap[key].myPoints2, monthdayPoints, modelpower);
|
|
|
// //日---实际/同期实际
|
|
|
-// main2.YEARDEVIATIONRATE = (decimal)pcl(windDictionary[key].myPoints2, yeardayPoints, modelpower);
|
|
|
+// main2.YEARDEVIATIONRATE = (Double)pcl(windMap[key].myPoints2, yeardayPoints, modelpower);
|
|
|
// //日---实际/标杆实际
|
|
|
-// main2.STANDARDDEVIATIONRATE = (decimal)pcl(windDictionary[key].myPoints2, standarddayPoints, modelpower);
|
|
|
+// main2.STANDARDDEVIATIONRATE = (Double)pcl(windMap[key].myPoints2, standarddayPoints, modelpower);
|
|
|
//
|
|
|
-// PLCBuild(entities, key, stringyear, stringmonth, current, windDictionary, modelpower, 3, powerPoints, monthPoints, yearPoints, standardPoints, monthdayPoints, yeardayPoints, standarddayPoints);
|
|
|
-// PLCBuild(entities, key, stringyear, stringmonth, current, windDictionary, modelpower, 4, powerPoints, monthPoints, yearPoints, standardPoints, monthdayPoints, yeardayPoints, standarddayPoints);
|
|
|
-// PLCBuild(entities, key, stringyear, stringmonth, current, windDictionary, modelpower, 5, powerPoints, monthPoints, yearPoints, standardPoints, monthdayPoints, yeardayPoints, standarddayPoints);
|
|
|
-// PLCBuild(entities, key, stringyear, stringmonth, current, windDictionary, modelpower, 6, powerPoints, monthPoints, yearPoints, standardPoints, monthdayPoints, yeardayPoints, standarddayPoints);
|
|
|
-// PLCBuild(entities, key, stringyear, stringmonth, current, windDictionary, modelpower, 7, powerPoints, monthPoints, yearPoints, standardPoints, monthdayPoints, yeardayPoints, standarddayPoints);
|
|
|
-// PLCBuild(entities, key, stringyear, stringmonth, current, windDictionary, modelpower, 8, powerPoints, monthPoints, yearPoints, standardPoints, monthdayPoints, yeardayPoints, standarddayPoints);
|
|
|
-// PLCBuild(entities, key, stringyear, stringmonth, current, windDictionary, modelpower, 9, powerPoints, monthPoints, yearPoints, standardPoints, monthdayPoints, yeardayPoints, standarddayPoints);
|
|
|
-// PLCBuild(entities, key, stringyear, stringmonth, current, windDictionary, modelpower, 10, powerPoints, monthPoints, yearPoints, standardPoints, monthdayPoints, yeardayPoints, standarddayPoints);
|
|
|
-// PLCBuild(entities, key, stringyear, stringmonth, current, windDictionary, modelpower, 11, powerPoints, monthPoints, yearPoints, standardPoints, monthdayPoints, yeardayPoints, standarddayPoints);
|
|
|
-// PLCBuild(entities, key, stringyear, stringmonth, current, windDictionary, modelpower, 12, powerPoints, monthPoints, yearPoints, standardPoints, monthdayPoints, yeardayPoints, standarddayPoints);
|
|
|
-// PLCBuild(entities, key, stringyear, stringmonth, current, windDictionary, modelpower, 13, powerPoints, monthPoints, yearPoints, standardPoints, monthdayPoints, yeardayPoints, standarddayPoints);
|
|
|
+// PLCBuild(entities, key, stringyear, stringmonth, current, windMap, modelpower, 3, powerPoints, monthPoints, yearPoints, standardPoints, monthdayPoints, yeardayPoints, standarddayPoints);
|
|
|
+// PLCBuild(entities, key, stringyear, stringmonth, current, windMap, modelpower, 4, powerPoints, monthPoints, yearPoints, standardPoints, monthdayPoints, yeardayPoints, standarddayPoints);
|
|
|
+// PLCBuild(entities, key, stringyear, stringmonth, current, windMap, modelpower, 5, powerPoints, monthPoints, yearPoints, standardPoints, monthdayPoints, yeardayPoints, standarddayPoints);
|
|
|
+// PLCBuild(entities, key, stringyear, stringmonth, current, windMap, modelpower, 6, powerPoints, monthPoints, yearPoints, standardPoints, monthdayPoints, yeardayPoints, standarddayPoints);
|
|
|
+// PLCBuild(entities, key, stringyear, stringmonth, current, windMap, modelpower, 7, powerPoints, monthPoints, yearPoints, standardPoints, monthdayPoints, yeardayPoints, standarddayPoints);
|
|
|
+// PLCBuild(entities, key, stringyear, stringmonth, current, windMap, modelpower, 8, powerPoints, monthPoints, yearPoints, standardPoints, monthdayPoints, yeardayPoints, standarddayPoints);
|
|
|
+// PLCBuild(entities, key, stringyear, stringmonth, current, windMap, modelpower, 9, powerPoints, monthPoints, yearPoints, standardPoints, monthdayPoints, yeardayPoints, standarddayPoints);
|
|
|
+// PLCBuild(entities, key, stringyear, stringmonth, current, windMap, modelpower, 10, powerPoints, monthPoints, yearPoints, standardPoints, monthdayPoints, yeardayPoints, standarddayPoints);
|
|
|
+// PLCBuild(entities, key, stringyear, stringmonth, current, windMap, modelpower, 11, powerPoints, monthPoints, yearPoints, standardPoints, monthdayPoints, yeardayPoints, standarddayPoints);
|
|
|
+// PLCBuild(entities, key, stringyear, stringmonth, current, windMap, modelpower, 12, powerPoints, monthPoints, yearPoints, standardPoints, monthdayPoints, yeardayPoints, standarddayPoints);
|
|
|
+// PLCBuild(entities, key, stringyear, stringmonth, current, windMap, modelpower, 13, powerPoints, monthPoints, yearPoints, standardPoints, monthdayPoints, yeardayPoints, standarddayPoints);
|
|
|
//
|
|
|
//
|
|
|
// if (insertType == 0)
|
|
|
// {
|
|
|
-// InsertPoints(current, stringyear, stringmonth, entities, windDictionary[key].myPoints1, windDictionary[key].myPointsFF1, windDictionary[key].myPoints2, windDictionary[key].myPointsFF2, key);
|
|
|
+// InsertPoints(current, stringyear, stringmonth, entities, windMap[key].myPoints1, windMap[key].myPointsFF1, windMap[key].myPoints2, windMap[key].myPointsFF2, key);
|
|
|
// }
|
|
|
// else
|
|
|
// {
|
|
|
-// InsertPoints2(current, stringyear, stringmonth, entities, windDictionary[key].myPoints1, windDictionary[key].myPointsFF1, windDictionary[key].myPoints2, windDictionary[key].myPointsFF2, key);
|
|
|
+// InsertPoints2(current, stringyear, stringmonth, entities, windMap[key].myPoints1, windMap[key].myPointsFF1, windMap[key].myPoints2, windMap[key].myPointsFF2, key);
|
|
|
// }
|
|
|
// Console.WriteLine(key);
|
|
|
// int z = entities.SaveChanges(false);
|
|
|
// logger.Info(String.Format("{1}:更新sqlserver数据库记录数:{0}", z, Date.Now));
|
|
|
-// }
|
|
|
+//
|
|
|
//
|
|
|
// }
|
|
|
//
|
|
@@ -325,13 +366,13 @@
|
|
|
//
|
|
|
// }
|
|
|
//
|
|
|
-// public void PLCBuild(GdsjEntities entities, String key, String stringyear, String stringmonth, Date current, Dictionary<String, CureFitting> windDictionary, decimal modelpower, double speed,
|
|
|
-// List<MyMath.Point> powerPoints, List<MyMath.Point> monthPoints, List<MyMath.Point> yearPoints, List<MyMath.Point> standardPoints, List<MyMath.Point> monthdayPoints, List<MyMath.Point> yeardayPoints, List<MyMath.Point> standarddayPoints)
|
|
|
+// public void PLCBuild(GdsjEntities entities, String key, String stringyear, String stringmonth, Date current, Map<String, CureFitting> windMap, Double modelpower, double speed,
|
|
|
+// List<PointVo> powerPoints, List<PointVo> monthPoints, List<PointVo> yearPoints, List<PointVo> standardPoints, List<PointVo> monthdayPoints, List<PointVo> yeardayPoints, List<PointVo> standarddayPoints)
|
|
|
// {
|
|
|
//
|
|
|
// String speedStr = speed.ToString();
|
|
|
//
|
|
|
-// CURVEFITTINGMONTHSUB main1 = (from c in entities.CURVEFITTINGMONTHSUB
|
|
|
+// CURVEFITTINGMONTHSUB main1 = (from c : entities.CURVEFITTINGMONTHSUB
|
|
|
// where (c.WINDTURBINEID == key && c.YEAR == stringyear && c.MONTH == stringmonth && c.SPEED == speedStr)
|
|
|
// select c).FirstOrDefault();
|
|
|
// if (main1 == null)
|
|
@@ -345,21 +386,21 @@
|
|
|
// entities.AddToCURVEFITTINGMONTHSUB(main1);
|
|
|
// }
|
|
|
// //月---实际/最优
|
|
|
-// main1.DEVIATIONRATE1 = (decimal)pcl2(windDictionary[key].myPoints1, windDictionary[key].myPointsFF1, modelpower, speed);
|
|
|
+// main1.DEVIATIONRATE1 = (Double)pcl2(windMap[key].myPoints1, windMap[key].myPointsFF1, modelpower, speed);
|
|
|
// //月---实际/保证
|
|
|
-// main1.DEVIATIONRATE2 = (decimal)pcl2(windDictionary[key].myPoints1, powerPoints, modelpower, speed);
|
|
|
+// main1.DEVIATIONRATE2 = (Double)pcl2(windMap[key].myPoints1, powerPoints, modelpower, speed);
|
|
|
// //月---最优/保证
|
|
|
-// main1.DEVIATIONRATE3 = (decimal)pcl2(windDictionary[key].myPointsFF1, powerPoints, modelpower, speed);
|
|
|
+// main1.DEVIATIONRATE3 = (Double)pcl2(windMap[key].myPointsFF1, powerPoints, modelpower, speed);
|
|
|
// //月---实际/上月实际
|
|
|
-// main1.MONTHDEVIATIONRATE = (decimal)pcl2(windDictionary[key].myPoints1, monthPoints, modelpower, speed);
|
|
|
+// main1.MONTHDEVIATIONRATE = (Double)pcl2(windMap[key].myPoints1, monthPoints, modelpower, speed);
|
|
|
// //月---实际/同期实际
|
|
|
-// main1.YEARDEVIATIONRATE = (decimal)pcl2(windDictionary[key].myPoints1, yearPoints, modelpower, speed);
|
|
|
+// main1.YEARDEVIATIONRATE = (Double)pcl2(windMap[key].myPoints1, yearPoints, modelpower, speed);
|
|
|
// //月---实际/标杆实际
|
|
|
-// main1.STANDARDDEVIATIONRATE = (decimal)pcl2(windDictionary[key].myPoints1, standardPoints, modelpower, speed);
|
|
|
+// main1.STANDARDDEVIATIONRATE = (Double)pcl2(windMap[key].myPoints1, standardPoints, modelpower, speed);
|
|
|
//
|
|
|
//
|
|
|
//
|
|
|
-// CURVEFITTINGSUB main2 = (from c in entities.CURVEFITTINGSUB
|
|
|
+// CURVEFITTINGSUB main2 = (from c : entities.CURVEFITTINGSUB
|
|
|
// where (c.WINDTURBINEID == key && c.RECORDDATE.Value.CompareTo(current) == 0 && c.SPEED == speedStr)
|
|
|
// select c).FirstOrDefault();
|
|
|
// if (main2 == null)
|
|
@@ -373,23 +414,23 @@
|
|
|
//
|
|
|
// }
|
|
|
// //日---实际/最优
|
|
|
-// main2.DEVIATIONRATE1 = (decimal)pcl2(windDictionary[key].myPoints2, windDictionary[key].myPointsFF2, modelpower, speed);
|
|
|
+// main2.DEVIATIONRATE1 = (Double)pcl2(windMap[key].myPoints2, windMap[key].myPointsFF2, modelpower, speed);
|
|
|
// //日---实际/保证
|
|
|
-// main2.DEVIATIONRATE2 = (decimal)pcl2(windDictionary[key].myPoints2, powerPoints, modelpower, speed);
|
|
|
+// main2.DEVIATIONRATE2 = (Double)pcl2(windMap[key].myPoints2, powerPoints, modelpower, speed);
|
|
|
// //日---最优/保证
|
|
|
-// main2.DEVIATIONRATE3 = (decimal)pcl2(windDictionary[key].myPointsFF2, powerPoints, modelpower, speed);
|
|
|
+// main2.DEVIATIONRATE3 = (Double)pcl2(windMap[key].myPointsFF2, powerPoints, modelpower, speed);
|
|
|
// //日---实际/上日实际
|
|
|
-// main2.MONTHDEVIATIONRATE = (decimal)pcl2(windDictionary[key].myPoints2, monthdayPoints, modelpower, speed);
|
|
|
+// main2.MONTHDEVIATIONRATE = (Double)pcl2(windMap[key].myPoints2, monthdayPoints, modelpower, speed);
|
|
|
// //日---实际/同期实际
|
|
|
-// main2.YEARDEVIATIONRATE = (decimal)pcl2(windDictionary[key].myPoints2, yeardayPoints, modelpower, speed);
|
|
|
+// main2.YEARDEVIATIONRATE = (Double)pcl2(windMap[key].myPoints2, yeardayPoints, modelpower, speed);
|
|
|
// //日---实际/标杆实际
|
|
|
-// main2.STANDARDDEVIATIONRATE = (decimal)pcl2(windDictionary[key].myPoints2, standarddayPoints, modelpower, speed);
|
|
|
+// main2.STANDARDDEVIATIONRATE = (Double)pcl2(windMap[key].myPoints2, standarddayPoints, modelpower, speed);
|
|
|
// }
|
|
|
//
|
|
|
//
|
|
|
-// private void InsertPoints(Date current, String year, String month, GdsjEntities entities, List<MyMath.Point> pointsF1, List<MyMath.Point> pointsFF1, List<MyMath.Point> pointsF2, List<MyMath.Point> pointsFF2, String windturbineId)
|
|
|
+// private void InsertPoints(Date current, String year, String month, GdsjEntities entities, List<PointVo> pointsF1, List<PointVo> pointsFF1, List<PointVo> pointsF2, List<PointVo> pointsFF2, String windturbineId)
|
|
|
// {
|
|
|
-// var data = (from c in entities.WINDTURBINECURVEFITTINGMONTH
|
|
|
+// var data = (from c : entities.ProEconWtCurveFittingMonth
|
|
|
// where (c.WINDTURBINEID == windturbineId && c.YEAR == year && c.MONTH == month)
|
|
|
// select c).ToList();
|
|
|
//
|
|
@@ -402,21 +443,21 @@
|
|
|
// {
|
|
|
// for (int i = 0; i < pointsF1.Count; i++)
|
|
|
// {
|
|
|
-// WINDTURBINECURVEFITTINGMONTH item = new WINDTURBINECURVEFITTINGMONTH();
|
|
|
+// ProEconWtCurveFittingMonth item = new ProEconWtCurveFittingMonth();
|
|
|
// item.WINDTURBINEID = windturbineId;
|
|
|
//
|
|
|
// if (type == "GDC")
|
|
|
// {
|
|
|
// continue;
|
|
|
-// item.SPEED = decimal.Truncate((decimal)pointsF1[i].X);
|
|
|
+// item.SPEED = Double.Truncate((Double)pointsF1[i].X);
|
|
|
// }
|
|
|
// else
|
|
|
// {
|
|
|
//
|
|
|
-// item.SPEED = (decimal)pointsF1[i].X;
|
|
|
+// item.SPEED = (Double)pointsF1[i].X;
|
|
|
// }
|
|
|
-// item.ACTUALPOWER = (decimal)pointsF1[i].Y;
|
|
|
-// item.OPTIMALPOWER = (decimal)pointsFF1[i].Y;
|
|
|
+// item.ACTUALPOWER = (Double)pointsF1[i].Y;
|
|
|
+// item.OPTIMALPOWER = (Double)pointsFF1[i].Y;
|
|
|
// item.YEAR = year.ToString();
|
|
|
// item.MONTH = month.ToString();
|
|
|
// entities.AddToWINDTURBINECURVEFITTINGMONTH(item);
|
|
@@ -429,20 +470,20 @@
|
|
|
//
|
|
|
// for (int i = 0; i < pointsF1.Count; i++)
|
|
|
// {
|
|
|
-// WINDTURBINECURVEFITTINGMONTH item = new WINDTURBINECURVEFITTINGMONTH();
|
|
|
+// ProEconWtCurveFittingMonth item = new ProEconWtCurveFittingMonth();
|
|
|
// item.WINDTURBINEID = windturbineId;
|
|
|
// if (type == "GDC")
|
|
|
// {
|
|
|
// continue;
|
|
|
-// item.SPEED = decimal.Truncate((decimal)pointsF1[i].X);
|
|
|
+// item.SPEED = Double.Truncate((Double)pointsF1[i].X);
|
|
|
// }
|
|
|
// else
|
|
|
// {
|
|
|
//
|
|
|
-// item.SPEED = (decimal)pointsF1[i].X;
|
|
|
+// item.SPEED = (Double)pointsF1[i].X;
|
|
|
// }
|
|
|
-// item.ACTUALPOWER = (decimal)pointsF1[i].Y;
|
|
|
-// item.OPTIMALPOWER = (decimal)pointsFF1.Where(it => it.X == pointsF1[i].X).Select(it => it.Y).FirstOrDefault();
|
|
|
+// item.ACTUALPOWER = (Double)pointsF1[i].Y;
|
|
|
+// item.OPTIMALPOWER = (Double)pointsFF1.Where(it => it.X == pointsF1[i].X).Select(it => it.Y).FirstOrDefault();
|
|
|
// item.YEAR = year.ToString();
|
|
|
// item.MONTH = month.ToString();
|
|
|
// entities.AddToWINDTURBINECURVEFITTINGMONTH(item);
|
|
@@ -450,7 +491,7 @@
|
|
|
// }
|
|
|
//
|
|
|
//
|
|
|
-// var data2 = (from c in entities.WINDTURBINECURVEFITTING
|
|
|
+// var data2 = (from c : entities.ProEconWtCurveFitting
|
|
|
// where (c.WINDTURBINEID == windturbineId && c.RECORDDATE.Value.CompareTo(current) == 0)
|
|
|
// select c).ToList();
|
|
|
//
|
|
@@ -464,21 +505,21 @@
|
|
|
// {
|
|
|
// for (int i = 0; i < pointsF2.Count; i++)
|
|
|
// {
|
|
|
-// WINDTURBINECURVEFITTING item = new WINDTURBINECURVEFITTING();
|
|
|
+// ProEconWtCurveFitting item = new ProEconWtCurveFitting();
|
|
|
// item.WINDTURBINEID = windturbineId;
|
|
|
// if (type == "GDC")
|
|
|
// {
|
|
|
// continue;
|
|
|
-// item.SPEED = decimal.Truncate((decimal)pointsF2[i].X);
|
|
|
+// item.SPEED = Double.Truncate((Double)pointsF2[i].X);
|
|
|
// }
|
|
|
// else
|
|
|
// {
|
|
|
-// bool l = pointsF2[i].X.ToString().Contains(".");
|
|
|
+// bool l = pointsF2[i].X.ToString().contains(".");
|
|
|
// if (l)
|
|
|
// {
|
|
|
// continue;
|
|
|
// }
|
|
|
-// item.SPEED = (decimal)pointsF2[i].X;
|
|
|
+// item.SPEED = (Double)pointsF2[i].X;
|
|
|
// }
|
|
|
// item.ACTUALPOWER = (int)pointsF2[i].Y;
|
|
|
// item.OPTIMALPOWER = (int)pointsFF2[i].Y;
|
|
@@ -493,21 +534,21 @@
|
|
|
//
|
|
|
// for (int i = 0; i < pointsF2.Count; i++)
|
|
|
// {
|
|
|
-// WINDTURBINECURVEFITTING item = new WINDTURBINECURVEFITTING();
|
|
|
+// ProEconWtCurveFitting item = new ProEconWtCurveFitting();
|
|
|
// item.WINDTURBINEID = windturbineId;
|
|
|
// if (type == "GDC")
|
|
|
// {
|
|
|
// continue;
|
|
|
-// item.SPEED = decimal.Truncate((decimal)pointsF2[i].X);
|
|
|
+// item.SPEED = Double.Truncate((Double)pointsF2[i].X);
|
|
|
// }
|
|
|
// else
|
|
|
// {
|
|
|
-// bool l = pointsF2[i].X.ToString().Contains(".");
|
|
|
+// bool l = pointsF2[i].X.ToString().contains(".");
|
|
|
// if (l)
|
|
|
// {
|
|
|
// continue;
|
|
|
// }
|
|
|
-// item.SPEED = (decimal)pointsF2[i].X;
|
|
|
+// item.SPEED = (Double)pointsF2[i].X;
|
|
|
// }
|
|
|
// item.ACTUALPOWER = (int)pointsF2[i].Y;
|
|
|
// item.OPTIMALPOWER = (int)pointsFF2.Where(it => it.X == pointsF2[i].X).Select(it => it.Y).FirstOrDefault();
|
|
@@ -520,9 +561,9 @@
|
|
|
//
|
|
|
//
|
|
|
//
|
|
|
-// private void InsertPoints2(Date current, String year, String month, GdsjEntities entities, List<MyMath.Point> pointsF1, List<MyMath.Point> pointsFF1, List<MyMath.Point> pointsF2, List<MyMath.Point> pointsFF2, String windturbineId)
|
|
|
+// private void InsertPoints2(Date current, String year, String month, GdsjEntities entities, List<PointVo> pointsF1, List<PointVo> pointsFF1, List<PointVo> pointsF2, List<PointVo> pointsFF2, String windturbineId)
|
|
|
// {
|
|
|
-// var data = (from c in entities.WINDTURBINEPOWERCURVEFITTING
|
|
|
+// var data = (from c : entities.WINDTURBINEPOWERCURVEFITTING
|
|
|
// where (c.WINDTURBINEID == windturbineId)
|
|
|
// select c).ToList();
|
|
|
//
|
|
@@ -542,19 +583,19 @@
|
|
|
// if (type == "GDC")
|
|
|
// {
|
|
|
// continue;
|
|
|
-// item.SPEED = decimal.Truncate((decimal)pointsF1[i].X);
|
|
|
+// item.SPEED = Double.Truncate((Double)pointsF1[i].X);
|
|
|
// }
|
|
|
// else
|
|
|
// {
|
|
|
-// bool l = pointsF1[i].X.ToString().Contains(".");
|
|
|
+// bool l = pointsF1[i].X.ToString().contains(".");
|
|
|
// if (l)
|
|
|
// {
|
|
|
// continue;
|
|
|
// }
|
|
|
-// item.SPEED = (decimal)pointsF1[i].X;
|
|
|
+// item.SPEED = (Double)pointsF1[i].X;
|
|
|
// }
|
|
|
-// item.ACTUALPOWER = (decimal)pointsF1[i].Y;
|
|
|
-// item.OPTIMALPOWER = (decimal)pointsFF1[i].Y;
|
|
|
+// item.ACTUALPOWER = (Double)pointsF1[i].Y;
|
|
|
+// item.OPTIMALPOWER = (Double)pointsFF1[i].Y;
|
|
|
//
|
|
|
// entities.AddToWINDTURBINEPOWERCURVEFITTING(item);
|
|
|
// }
|
|
@@ -572,19 +613,19 @@
|
|
|
// if (type == "GDC")
|
|
|
// {
|
|
|
// continue;
|
|
|
-// item.SPEED = decimal.Truncate((decimal)pointsF1[i].X);
|
|
|
+// item.SPEED = Double.Truncate((Double)pointsF1[i].X);
|
|
|
// }
|
|
|
// else
|
|
|
// {
|
|
|
-// bool l = pointsF1[i].X.ToString().Contains(".");
|
|
|
+// bool l = pointsF1[i].X.ToString().contains(".");
|
|
|
// if (l)
|
|
|
// {
|
|
|
// continue;
|
|
|
// }
|
|
|
-// item.SPEED = (decimal)pointsF1[i].X;
|
|
|
+// item.SPEED = (Double)pointsF1[i].X;
|
|
|
// }
|
|
|
-// item.ACTUALPOWER = (decimal)pointsF1[i].Y;
|
|
|
-// item.OPTIMALPOWER = (decimal)pointsFF1.Where(it => it.X == pointsF1[i].X).Select(it => it.Y).FirstOrDefault();
|
|
|
+// item.ACTUALPOWER = (Double)pointsF1[i].Y;
|
|
|
+// item.OPTIMALPOWER = (Double)pointsFF1.Where(it => it.X == pointsF1[i].X).Select(it => it.Y).FirstOrDefault();
|
|
|
//
|
|
|
// entities.AddToWINDTURBINEPOWERCURVEFITTING(item);
|
|
|
// }
|
|
@@ -592,26 +633,26 @@
|
|
|
// }
|
|
|
//
|
|
|
//
|
|
|
-// private void BuildPoints(List<WINDTURBINECURVEFITTINGMONTH> data, List<MyMath.Point> points)
|
|
|
+// private void BuildPoints(List<ProEconWtCurveFittingMonth> data, List<PointVo> points)
|
|
|
// {
|
|
|
// if (data != null)
|
|
|
// {
|
|
|
// for (int i = 0; i < data.Count; i++)
|
|
|
// {
|
|
|
-// MyMath.Point point = new MyMath.Point();
|
|
|
+// PointVo point = new PointVo();
|
|
|
// point.X = (double)data[i].SPEED.Value;
|
|
|
// point.Y = (double)data[i].ACTUALPOWER.Value;
|
|
|
// points.Add(point);
|
|
|
// }
|
|
|
// }
|
|
|
// }
|
|
|
-// private void BuildPoints(List<WINDTURBINECURVEFITTING> data, List<MyMath.Point> points)
|
|
|
+// private void BuildPoints(List<ProEconWtCurveFitting> data, List<PointVo> points)
|
|
|
// {
|
|
|
// if (data != null)
|
|
|
// {
|
|
|
// for (int i = 0; i < data.Count; i++)
|
|
|
// {
|
|
|
-// MyMath.Point point = new MyMath.Point();
|
|
|
+// PointVo point = new PointVo();
|
|
|
// point.X = (double)data[i].SPEED.Value;
|
|
|
// point.Y = (double)data[i].ACTUALPOWER.Value;
|
|
|
// points.Add(point);
|
|
@@ -619,7 +660,7 @@
|
|
|
// }
|
|
|
// }
|
|
|
// //曲线偏差率
|
|
|
-// private double pcl(List<MyMath.Point> Points1, List<MyMath.Point> Points2, decimal modelpower)
|
|
|
+// private double pcl(List<PointVo> Points1, List<PointVo> Points2, Double modelpower)
|
|
|
// {
|
|
|
// double result = -0;
|
|
|
// double pc = 0;
|
|
@@ -628,7 +669,7 @@
|
|
|
// double count = 0;
|
|
|
// double sum = 0;
|
|
|
// double max = (double)modelpower;
|
|
|
-// foreach (MyMath.Point point in Points1)
|
|
|
+// for (PointVo point : Points1)
|
|
|
// {
|
|
|
// var item = Points2.Where(it => it.X == point.X).ToList();
|
|
|
// if (item != null && item.Count > 0)
|
|
@@ -654,7 +695,7 @@
|
|
|
// return result;
|
|
|
// }
|
|
|
// //曲线偏差率2
|
|
|
-// private double pcl2(List<MyMath.Point> Points1, List<MyMath.Point> Points2, decimal modelpower, double speed)
|
|
|
+// private double pcl2(List<PointVo> Points1, List<PointVo> Points2, Double modelpower, double speed)
|
|
|
// {
|
|
|
// double minSpeed = speed;
|
|
|
// double maxSpeed = minSpeed + 1;
|
|
@@ -665,7 +706,7 @@
|
|
|
// double count = 0;
|
|
|
// double sum = 0;
|
|
|
// double max = (double)modelpower;
|
|
|
-// foreach (MyMath.Point point in Points1)
|
|
|
+// for (PointVo point : Points1)
|
|
|
// {
|
|
|
// var item = Points2.Where(it => it.X == point.X).ToList();
|
|
|
// if (item != null && item.Count > 0 && item[0].X >= minSpeed && item[0].X < maxSpeed)
|
|
@@ -693,11 +734,11 @@
|
|
|
//
|
|
|
//
|
|
|
// //功率曲线拟合
|
|
|
-// public void CurveFittingBuilder(Date begin, Date end, int dimension, double scale, String pointIdGL, String pointIdFS, String pointIdZT, List<MyMath.Point> myPoints, List<MyMath.Point> myPointsFF, String windturbineId)
|
|
|
+// public void CurveFittingBuilder(Date begin, Date end, int dimension, double scale, String pointIdGL, String pointIdFS, String pointIdZT, List<PointVo> myPoints, List<PointVo> myPointsFF, String windturbineId)
|
|
|
// {
|
|
|
// double maxPower = (double)windturbineCapacity[windturbineId] * 1.3;
|
|
|
-// List<PointF> pointsF = new List<PointF>();
|
|
|
-// Dictionary<float, PointF> pointsFF = new Dictionary<float, PointF>();
|
|
|
+// List<PointF> pointsF = new ArrayList<PointF>();
|
|
|
+// Map<float, PointF> pointsFF = new HashMap<float, PointF>();
|
|
|
//
|
|
|
// if (end > begin)
|
|
|
// {
|
|
@@ -774,7 +815,7 @@
|
|
|
// {
|
|
|
// pointsF.Add(new PointF(x1, y1));
|
|
|
//
|
|
|
-// if (pointsFF.ContainsKey(x1))
|
|
|
+// if (pointsFF.containsKey(x1))
|
|
|
// {
|
|
|
// if (pointsFF[x1].Y < y1)
|
|
|
// {
|
|
@@ -839,7 +880,7 @@
|
|
|
// {
|
|
|
// pointsF.Add(new PointF(x1, y1));
|
|
|
//
|
|
|
-// if (pointsFF.ContainsKey(x1))
|
|
|
+// if (pointsFF.containsKey(x1))
|
|
|
// {
|
|
|
// if (pointsFF[x1].Y < y1)
|
|
|
// {
|
|
@@ -868,7 +909,7 @@
|
|
|
//
|
|
|
//
|
|
|
//
|
|
|
-// if (!pointsFF.ContainsKey(0))
|
|
|
+// if (!pointsFF.containsKey(0))
|
|
|
// pointsFF.Add(0, new PointF(0, 0));
|
|
|
//
|
|
|
// List<PointF> FF = pointsFF.Values.Where(it => it.X >= 3).OrderBy(it => it.X).ToList();
|
|
@@ -889,7 +930,7 @@
|
|
|
// }
|
|
|
// }
|
|
|
//
|
|
|
-// private static void BuildMyPoints(List<MyMath.Point> myPoints, double scale)
|
|
|
+// private static void BuildMyPoints(List<PointVo> myPoints, double scale)
|
|
|
// {
|
|
|
// int coefficient = 1;
|
|
|
// int dec = 0;
|
|
@@ -916,7 +957,7 @@
|
|
|
//
|
|
|
// for (double i = 0; i < min; i += 1)
|
|
|
// {
|
|
|
-// MyMath.Point point = new MyMath.Point();
|
|
|
+// PointVo point = new PointVo();
|
|
|
// point.X = Math.Round(i / coefficient, dec);
|
|
|
// point.Y = 0;
|
|
|
// myPoints.Add(point);
|
|
@@ -927,14 +968,14 @@
|
|
|
//
|
|
|
// for (double i = smax; i > max; i -= 1)
|
|
|
// {
|
|
|
-// MyMath.Point point = new MyMath.Point();
|
|
|
+// PointVo point = new PointVo();
|
|
|
// point.X = Math.Round(i / coefficient, dec);
|
|
|
// point.Y = maxval;
|
|
|
// myPoints.Add(point);
|
|
|
// }
|
|
|
// }
|
|
|
//
|
|
|
-// private static void BuildMyPoints2(List<MyMath.Point> myPoints)
|
|
|
+// private static void BuildMyPoints2(List<PointVo> myPoints)
|
|
|
// {
|
|
|
// double min = myPoints.Min(it => it.X);
|
|
|
// double max = myPoints.Max(it => it.X);
|
|
@@ -943,7 +984,7 @@
|
|
|
//
|
|
|
// for (int i = 0; i < min; i += 1)
|
|
|
// {
|
|
|
-// MyMath.Point point = new MyMath.Point();
|
|
|
+// PointVo point = new PointVo();
|
|
|
// point.X = i;
|
|
|
// point.Y = 0;
|
|
|
// myPoints.Add(point);
|
|
@@ -954,7 +995,7 @@
|
|
|
//
|
|
|
// for (int i = 25; i > max; i -= 1)
|
|
|
// {
|
|
|
-// MyMath.Point point = new MyMath.Point();
|
|
|
+// PointVo point = new PointVo();
|
|
|
// point.X = i;
|
|
|
// point.Y = maxval;
|
|
|
// myPoints.Add(point);
|