波形解析的电流一次值转二次值调整

This commit is contained in:
2026-04-15 10:20:48 +08:00
parent 59f2588488
commit 232e84aad3
2 changed files with 131 additions and 143 deletions

View File

@@ -26,8 +26,6 @@ import java.util.*;
public class AnalyWave { public class AnalyWave {
/***************************************** /*****************************************
* 解析comtrate文件工具类 * 解析comtrate文件工具类
* author yexb根据Ww算法装换 * author yexb根据Ww算法装换
@@ -94,7 +92,7 @@ public class AnalyWave {
** ** strFilePath *** cfg文件路径 ** ** strFilePath *** cfg文件路径
* *** auth *** 读取方式 null则使用本地读取方式读取 * *** auth *** 读取方式 null则使用本地读取方式读取
******************************************/ ******************************************/
public AnalyWaveModel.tagDataValue readComtrade(List<String> temCfgList,byte[] array, int iFlag) { public AnalyWaveModel.tagDataValue readComtrade(List<String> temCfgList, byte[] array, int iFlag) {
//初始化参数 //初始化参数
ComtradeCfg = new AnalyWaveModel.tagComtradeCfg(); ComtradeCfg = new AnalyWaveModel.tagComtradeCfg();
RatesCfg = new AnalyWaveModel.tagRates(); RatesCfg = new AnalyWaveModel.tagRates();
@@ -297,14 +295,11 @@ public class AnalyWave {
strBinType = iterable.next().toUpperCase(); strBinType = iterable.next().toUpperCase();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
logger.error("读取文件内容出错"+e.getMessage()); logger.error("读取文件内容出错" + e.getMessage());
return false; return false;
}finally { } finally {
} }
@@ -319,15 +314,8 @@ public class AnalyWave {
private List<List<Float>> AnalyseComtradeDat(byte[] array, int iFlag) { private List<List<Float>> AnalyseComtradeDat(byte[] array, int iFlag) {
float xValueAll = 0;//初始化xValue的值 float xValueAll = 0;//初始化xValue的值
boolean blxValue = false;//判断是否首次登陆 boolean blxValue = false;//判断是否首次登陆
List<List<Float>> listWaveData = new ArrayList<>();//返回数据 List<List<Float>> listWaveData = new ArrayList<>();//返回数据
try { try {
// 计算每个单独的数据块的大小 4字节的序号 4字节的时间 2字节的值 // 计算每个单独的数据块的大小 4字节的序号 4字节的时间 2字节的值
// 示例中的排布是 4字节的序号 4字节的时间 UA(2字节) UB(2字节) UC(2字节) IA(2字节) IB(2字节) // 示例中的排布是 4字节的序号 4字节的时间 UA(2字节) UB(2字节) UC(2字节) IA(2字节) IB(2字节)
// IC(2字节) // IC(2字节)
@@ -470,7 +458,7 @@ public class AnalyWave {
{ {
if (ComtradeCfg.OneChannleCfg.get(j).fPrimary != 0.0f)//根据cfg内的变比将一次值转换成二次值 if (ComtradeCfg.OneChannleCfg.get(j).fPrimary != 0.0f)//根据cfg内的变比将一次值转换成二次值
{ {
fValue = ComtradeCfg.OneChannleCfg.get(j).fSecondary / ComtradeCfg.OneChannleCfg.get(j).fPrimary; fValue = fValue * ComtradeCfg.OneChannleCfg.get(j).fSecondary / ComtradeCfg.OneChannleCfg.get(j).fPrimary;
} else { } else {
fValue = fValue; fValue = fValue;
} }
@@ -500,7 +488,7 @@ public class AnalyWave {
} catch (Exception e) { } catch (Exception e) {
logger.error("读取文件出错:" + e.getMessage()); logger.error("读取文件出错:" + e.getMessage());
return listWaveData; return listWaveData;
}finally { } finally {
} }

View File

@@ -641,7 +641,7 @@ public class WaveFileComponent {
{ {
//根据cfg内的变比将一次值转换成二次值 //根据cfg内的变比将一次值转换成二次值
if (comtradeCfgDTO.getLstAnalogDTO().get(j).getFPrimary() != 0.0f) { if (comtradeCfgDTO.getLstAnalogDTO().get(j).getFPrimary() != 0.0f) {
fValue = comtradeCfgDTO.getLstAnalogDTO().get(j).getFSecondary() / comtradeCfgDTO.getLstAnalogDTO().get(j).getFPrimary(); fValue = fValue * comtradeCfgDTO.getLstAnalogDTO().get(j).getFSecondary() / comtradeCfgDTO.getLstAnalogDTO().get(j).getFPrimary();
} else { } else {
fValue = fValue; fValue = fValue;
} }
@@ -724,7 +724,7 @@ public class WaveFileComponent {
{ {
//根据cfg内的变比将一次值转换成二次值 //根据cfg内的变比将一次值转换成二次值
if (comtradeCfgDTO.getLstAnalogDTO().get(j).getFPrimary() != 0.0f) { if (comtradeCfgDTO.getLstAnalogDTO().get(j).getFPrimary() != 0.0f) {
fValue = comtradeCfgDTO.getLstAnalogDTO().get(j).getFSecondary() / comtradeCfgDTO.getLstAnalogDTO().get(j).getFPrimary(); fValue = fValue * comtradeCfgDTO.getLstAnalogDTO().get(j).getFSecondary() / comtradeCfgDTO.getLstAnalogDTO().get(j).getFPrimary();
} else { } else {
fValue = fValue; fValue = fValue;
} }