微调
This commit is contained in:
@@ -17,6 +17,8 @@ import java.io.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.nio.file.Files;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
@@ -45,7 +47,7 @@ public class WaveFileComponent {
|
||||
throw new BusinessException(WaveFileResponseEnum.CFG_DATA_ERROR);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (comtradeCfgDTO.getNAnalogNum() % 3 == 0) {
|
||||
comtradeCfgDTO.setNPhasic(3);
|
||||
} else {
|
||||
@@ -63,7 +65,7 @@ public class WaveFileComponent {
|
||||
waveDataDTO.setListWaveData(listWaveData);
|
||||
|
||||
waveDataDTO.setTime(DateUtil.format(comtradeCfgDTO.getTimeTrige(), DatePattern.NORM_DATETIME_MS_PATTERN));
|
||||
|
||||
|
||||
|
||||
return waveDataDTO;
|
||||
}
|
||||
@@ -81,7 +83,7 @@ public class WaveFileComponent {
|
||||
}
|
||||
|
||||
int halfTs = comtradeCfgDTO.getFinalSampleRate().intValue();
|
||||
|
||||
|
||||
double iWave;
|
||||
int nPhasic;
|
||||
List<List<Float>> listRmsMin = new ArrayList<>();
|
||||
@@ -712,7 +714,7 @@ public class WaveFileComponent {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
switch (iType) {
|
||||
case 0:
|
||||
if (nMinOneSample < 32) {
|
||||
@@ -813,7 +815,7 @@ public class WaveFileComponent {
|
||||
}
|
||||
}
|
||||
int nSJ = comtradeCfgDTO.getFinalSampleRate().intValue();
|
||||
|
||||
|
||||
List<EigenvalueDTO> lstEigenvalueDTO = new ArrayList<>();
|
||||
for (int i = 0; i < 3; i++) {
|
||||
EigenvalueDTO eigenvalueDTO = new EigenvalueDTO();
|
||||
@@ -1088,6 +1090,38 @@ public class WaveFileComponent {
|
||||
private int tableIndex;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
/********************************************************
|
||||
* iFlag == 0 高级算法的要求,采样率只能是32-128
|
||||
* iFlag == 1 普通展示,采样率按照cfg里面最小的(大于32)
|
||||
* iFlag == 2 App抽点要求,采样率抽点成32
|
||||
* iFlag == 3 高级算法原始波形(大于32)
|
||||
********************************************************/
|
||||
/** 输出格式: 2014-5-05 00:00:00 大写H为24小时制 */
|
||||
DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
String s;
|
||||
Date d = new Date();
|
||||
s = sdf.format(d);
|
||||
System.out.println(s);
|
||||
WaveFileComponent waveFileComponent = new WaveFileComponent();
|
||||
InputStream cfgStream = waveFileComponent.getFileInputStreamByFilePath("C:\\Users\\Administrator\\Desktop\\wave\\PQMonitor_PQM1_000062_20260501_053729_063_WAV.cfg");
|
||||
InputStream datStream = waveFileComponent.getFileInputStreamByFilePath("C:\\Users\\Administrator\\Desktop\\wave\\PQMonitor_PQM1_000062_20260501_053729_063_WAV.dat");
|
||||
// 获取瞬时波形 //获取原始波形值
|
||||
WaveDataDTO waveDataDTO = waveFileComponent.getComtrade(cfgStream, datStream, 1);
|
||||
d = new Date();
|
||||
s = sdf.format(d);
|
||||
System.out.println(s);
|
||||
// 获取RMS波形
|
||||
WaveDataDTO waveDataDTO1 = waveFileComponent.getValidData(waveDataDTO);
|
||||
d = new Date();
|
||||
s = sdf.format(d);
|
||||
System.out.println(s);
|
||||
// 获取特征值
|
||||
List<EigenvalueDTO> lstEigenvalueDTO = waveFileComponent.getEigenvalue(waveDataDTO, true);
|
||||
System.out.println(1);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user