pms台账修改
This commit is contained in:
@@ -2,6 +2,7 @@ package com.njcn.device.biz.utils;
|
||||
|
||||
|
||||
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.system.enums.DicDataEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -28,6 +29,7 @@ public class COverlimit {
|
||||
private static float[] fUDevL_Limit = {-3, -7, -10};
|
||||
|
||||
|
||||
//谐波电流幅值系数
|
||||
private static final double[][] ARR = {
|
||||
{78, 62, 39, 62, 26, 44, 19, 21, 16, 28, 13, 24, 11, 12, 9.7, 18, 8.6, 16, 7.8, 8.9, 7.1, 14, 6.5, 12, 6.0, 6.9, 5.6, 11, 5.2, 10, 4.9, 5.6, 4.6, 8.9, 4.3, 8.4, 4.1, 4.8, 3.9, 7.6, 3.7, 7.2, 3.5, 4.1, 3.4, 6.6, 3.3, 6.3, 3.1},
|
||||
{43, 34, 21, 34, 14, 24, 11, 11, 8.5, 16, 7.1, 13, 6.1, 6.8, 5.3, 10, 4.7, 9, 4.3, 4.9, 3.9, 7.4, 3.6, 6.8, 3.3, 3.8, 3.1, 5.9, 2.9, 5.5, 2.7, 3.1, 2.5, 4.9, 2.4, 4.6, 2.3, 2.6, 2.2, 4.1, 2.0, 4.0, 2.0, 2.3, 1.9, 3.6, 1.8, 3.5, 1.7},
|
||||
@@ -38,9 +40,6 @@ public class COverlimit {
|
||||
};
|
||||
|
||||
|
||||
private static float[] fILimitCoe = {
|
||||
2.0f, 1.1f, 2.0f, 1.2f, 2.0f, 1.4f, 2.0f, 2.0f, 2.0f, 1.8f, 2.0f, 1.9f, 2.0f, 2.0f, 2.0f, 2.0f, 2.0f, 2.0f, 2.0f, 2.0f, 2.0f, 2.0f, 2.0f, 2.0f
|
||||
};
|
||||
|
||||
//间谐波含有率
|
||||
private static float[] InharmLimit1 = {
|
||||
@@ -52,10 +51,12 @@ public class COverlimit {
|
||||
|
||||
private static float GetVoltageLimit(int nHarm, int iScaleSelect)//谐波含有率
|
||||
{
|
||||
if (nHarm < 0)
|
||||
if (nHarm < 0) {
|
||||
return 0.0f;
|
||||
if (iScaleSelect >= MAX_SCALE_NO)
|
||||
}
|
||||
if (iScaleSelect >= MAX_SCALE_NO) {
|
||||
return 0.0f;
|
||||
}
|
||||
switch (iScaleSelect) {
|
||||
case 6:
|
||||
iScaleSelect = 4;
|
||||
@@ -67,13 +68,16 @@ public class COverlimit {
|
||||
iScaleSelect = 0;
|
||||
break;
|
||||
}
|
||||
if (iScaleSelect < 2)
|
||||
if (iScaleSelect < 2) {
|
||||
iScaleSelect = 0;
|
||||
else
|
||||
}
|
||||
else {
|
||||
iScaleSelect--;
|
||||
}
|
||||
int nSelect = iScaleSelect * 4 + 1;
|
||||
if (nHarm % 2 == 0)
|
||||
if (nHarm % 2 == 0) {
|
||||
nSelect = iScaleSelect * 4 + 2;
|
||||
}
|
||||
|
||||
return fULimit[nSelect];
|
||||
}
|
||||
@@ -93,18 +97,21 @@ public class COverlimit {
|
||||
iScaleSelect = 0;
|
||||
break;
|
||||
}
|
||||
if (iScaleSelect < 2)
|
||||
if (iScaleSelect < 2) {
|
||||
iScaleSelect = 0;
|
||||
else
|
||||
}
|
||||
else {
|
||||
iScaleSelect--;
|
||||
}
|
||||
int nSelect = iScaleSelect * 4;
|
||||
return fULimit[nSelect];
|
||||
}
|
||||
|
||||
private static float GetVoltageDevationLimit(int iScaleSelect)//电压偏差
|
||||
{
|
||||
if (iScaleSelect >= MAX_SCALE_NO)
|
||||
if (iScaleSelect >= MAX_SCALE_NO) {
|
||||
return 0.0f;
|
||||
}
|
||||
switch (iScaleSelect) {
|
||||
case 6:
|
||||
iScaleSelect = 4;
|
||||
@@ -116,23 +123,28 @@ public class COverlimit {
|
||||
iScaleSelect = 0;
|
||||
break;
|
||||
}
|
||||
if (iScaleSelect < 2)
|
||||
if (iScaleSelect < 2) {
|
||||
iScaleSelect = 0;
|
||||
else
|
||||
}
|
||||
else {
|
||||
iScaleSelect--;
|
||||
}
|
||||
int nSelect = iScaleSelect * 4 + 3;
|
||||
return fULimit[nSelect];
|
||||
}
|
||||
|
||||
private static float GetVoltageDevationLimit_L(int iScaleSelect)//电压偏差负数
|
||||
{
|
||||
if (iScaleSelect >= MAX_SCALE_NO)
|
||||
if (iScaleSelect >= MAX_SCALE_NO) {
|
||||
return 0.0f;
|
||||
}
|
||||
int nReturn = 0;
|
||||
if (iScaleSelect == 3 || iScaleSelect == 4 || iScaleSelect == 5 || iScaleSelect == 6)
|
||||
if (iScaleSelect == 3 || iScaleSelect == 4 || iScaleSelect == 5 || iScaleSelect == 6) {
|
||||
nReturn = 1;
|
||||
else if (iScaleSelect == -1)
|
||||
}
|
||||
else if (iScaleSelect == -1) {
|
||||
nReturn = 2;
|
||||
}
|
||||
return fUDevL_Limit[nReturn];
|
||||
}
|
||||
|
||||
@@ -194,40 +206,40 @@ public class COverlimit {
|
||||
public static float GetFCurrentLimit(String strScale, float fDLRL) {
|
||||
float uL = 0.0f;
|
||||
switch (strScale) {
|
||||
case "0.38kV":
|
||||
case "0.38":
|
||||
uL = 0.4f;
|
||||
break;
|
||||
case "6kV":
|
||||
case "6":
|
||||
uL = 6.3f;
|
||||
break;
|
||||
case "10kV":
|
||||
case "10":
|
||||
uL = 10.5f;
|
||||
break;
|
||||
case "20kV":
|
||||
case "20":
|
||||
uL = 21.0f;
|
||||
break;
|
||||
case "35kV":
|
||||
case "35":
|
||||
uL = 36.5f;
|
||||
break;
|
||||
case "66kV":
|
||||
case "66":
|
||||
uL = 69.0f;
|
||||
break;
|
||||
case "110kV":
|
||||
case "110":
|
||||
uL = 115.0f;
|
||||
break;
|
||||
case "220kV":
|
||||
case "220":
|
||||
uL = 230.0f;
|
||||
break;
|
||||
case "330kV":
|
||||
case "330":
|
||||
uL = 345.0f;
|
||||
break;
|
||||
case "500kV":
|
||||
case "500":
|
||||
uL = 520.0f;
|
||||
break;
|
||||
case "515kV":
|
||||
case "515":
|
||||
uL = 535.0f;
|
||||
break;
|
||||
case "800kV":
|
||||
case "800":
|
||||
uL = 825.0f;
|
||||
break;
|
||||
default:
|
||||
@@ -246,20 +258,26 @@ public class COverlimit {
|
||||
}
|
||||
|
||||
public static int TransStringScaleToInt(String strScale) {
|
||||
if (strScale.equals("110kV"))
|
||||
if (strScale.equals("110"))
|
||||
return 1;
|
||||
else if (strScale.equals("35kV") || strScale.equals("66kV"))
|
||||
else if (strScale.equals("35") || strScale.equals("66")) {
|
||||
return 2;
|
||||
else if (strScale.equals("10kV"))
|
||||
}
|
||||
else if (strScale.equals("10")) {
|
||||
return 3;
|
||||
else if (strScale.equals("6kV"))
|
||||
}
|
||||
else if (strScale.equals("6")) {
|
||||
return 4;
|
||||
else if (strScale.equals("0.38kV"))
|
||||
}
|
||||
else if (strScale.equals("0.38")) {
|
||||
return 5;
|
||||
else if (strScale.equals("20kV"))
|
||||
}
|
||||
else if (strScale.equals("20")) {
|
||||
return 6;
|
||||
else if (strScale.equals("220kV") || strScale.equals("500kV"))
|
||||
}
|
||||
else if (strScale.equals("220") || strScale.equals("500")) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
@@ -268,9 +286,9 @@ public class COverlimit {
|
||||
|
||||
/*单独处理闪变的*/
|
||||
public static float dealFlickerByScale(String strScale) {
|
||||
if (strScale.equals("110kV") || strScale.equals("35kV") || strScale.equals("66kV") || strScale.equals("10kV") || strScale.equals("6kV") || strScale.equals("0.38kV") || strScale.equals("20kV")) {
|
||||
if (strScale.equals("110") || strScale.equals("35") || strScale.equals("66") || strScale.equals("10") || strScale.equals("6") || strScale.equals("0.38") || strScale.equals("20")) {
|
||||
return 1.0f;
|
||||
} else if (strScale.equals("220kV") || strScale.equals("500kV")) {
|
||||
} else if (strScale.equals("220") || strScale.equals("500")) {
|
||||
return 0.8f;
|
||||
} else {
|
||||
return 1.0f;
|
||||
@@ -295,11 +313,13 @@ public class COverlimit {
|
||||
//畸变率
|
||||
fLimit[4] = GetVoltageJBLimit(nScale);
|
||||
//24谐波电压幅值
|
||||
for (i = 0; i < 24; i++)
|
||||
for (i = 0; i < 24; i++) {
|
||||
fLimit[5 + i] = GetVoltageLimit(i, nScale);
|
||||
}
|
||||
//24谐波电流幅值
|
||||
for (i = 0; i < 24; i++)
|
||||
fLimit[5 + 24 + i] = GetCurrentLimit(i+2, strScale, fDLRL, fJZRL, fXYRL, fSBRL);
|
||||
for (i = 0; i < 24; i++) {
|
||||
fLimit[5 + 24 + i] = GetCurrentLimit(i + 2, strScale, fDLRL, fJZRL, fXYRL, fSBRL);
|
||||
}
|
||||
/****************************
|
||||
* Modify by yexb 20181015
|
||||
*此项为电压下偏差
|
||||
@@ -312,11 +332,72 @@ public class COverlimit {
|
||||
fLimit[COverlimit.MAXOVERLIMITNUM - 1 - 16] = GetFCurrentLimit(strScale, fDLRL);
|
||||
|
||||
//间谐波电压含有率
|
||||
for (i = 0; i < 16; i++)
|
||||
for (i = 0; i < 16; i++) {
|
||||
fLimit[55 + i] = GetInHarm(i, nScale);
|
||||
}
|
||||
|
||||
return fLimit;
|
||||
}
|
||||
|
||||
|
||||
//处理基准容量
|
||||
public static float getStandShortCap(String voltageLevel){
|
||||
|
||||
if(DicDataEnum.KV038.getCode().equalsIgnoreCase(voltageLevel)){
|
||||
return 10;
|
||||
}else if(DicDataEnum.V380.getCode().equalsIgnoreCase(voltageLevel)){
|
||||
return 10;
|
||||
}else if(DicDataEnum.V022.getCode().equalsIgnoreCase(voltageLevel)){
|
||||
return 10;
|
||||
}else if(DicDataEnum.KV04.getCode().equalsIgnoreCase(voltageLevel)){
|
||||
return 100;
|
||||
}else if(DicDataEnum.V400.getCode().equalsIgnoreCase(voltageLevel)){
|
||||
return 100;
|
||||
}else if(DicDataEnum.KV6.getCode().equalsIgnoreCase(voltageLevel)){
|
||||
return 100;
|
||||
}else if(DicDataEnum.KV10.getCode().equalsIgnoreCase(voltageLevel)){
|
||||
return 100;
|
||||
}else if(DicDataEnum.KV20.getCode().equalsIgnoreCase(voltageLevel)){
|
||||
return 200;
|
||||
}else if(DicDataEnum.KV30.getCode().equalsIgnoreCase(voltageLevel)){
|
||||
//非标准
|
||||
return 250;
|
||||
}else if(DicDataEnum.KV35.getCode().equalsIgnoreCase(voltageLevel)){
|
||||
return 250;
|
||||
}else if(DicDataEnum.KV50.getCode().equalsIgnoreCase(voltageLevel)){
|
||||
return 500;
|
||||
}else if(DicDataEnum.KV66.getCode().equalsIgnoreCase(voltageLevel)){
|
||||
return 500;
|
||||
}else if(DicDataEnum.KV72_5.getCode().equalsIgnoreCase(voltageLevel)){
|
||||
return 500;
|
||||
}else if(DicDataEnum.KV110.getCode().equalsIgnoreCase(voltageLevel)){
|
||||
return 750;
|
||||
}else if(DicDataEnum.KV125.getCode().equalsIgnoreCase(voltageLevel)){
|
||||
return 750;
|
||||
}else if(DicDataEnum.KV200.getCode().equalsIgnoreCase(voltageLevel)){
|
||||
return 2000;
|
||||
}else if(DicDataEnum.KV220.getCode().equalsIgnoreCase(voltageLevel)){
|
||||
return 2000;
|
||||
}else if(DicDataEnum.KV320.getCode().equalsIgnoreCase(voltageLevel)){
|
||||
return 3000;
|
||||
}else if(DicDataEnum.KV330.getCode().equalsIgnoreCase(voltageLevel)){
|
||||
return 3000;
|
||||
}else if(DicDataEnum.KV500.getCode().equalsIgnoreCase(voltageLevel)){
|
||||
return 4500;
|
||||
}else if(DicDataEnum.KV600.getCode().equalsIgnoreCase(voltageLevel)){
|
||||
return 4500;
|
||||
}else if(DicDataEnum.KV660.getCode().equalsIgnoreCase(voltageLevel)){
|
||||
return 7000;
|
||||
}else if(DicDataEnum.KV750.getCode().equalsIgnoreCase(voltageLevel)){
|
||||
return 7000;
|
||||
}else if(DicDataEnum.KV1000.getCode().equalsIgnoreCase(voltageLevel)){
|
||||
return 7000;
|
||||
}else if(DicDataEnum.KV1100.getCode().equalsIgnoreCase(voltageLevel)){
|
||||
return 7000;
|
||||
}else {
|
||||
throw new BusinessException("没有对应电压等级,请先完善字典");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user