波形解析bug

This commit is contained in:
2025-09-19 08:36:18 +08:00
parent d038dfe655
commit 08ec8591f1

View File

@@ -497,7 +497,7 @@ public class WaveFileComponent {
int nDigSize = (comtradeCfgDTO.getNDigitalNum() % 16) > 0 ? (comtradeCfgDTO.getNDigitalNum() / 16 + 1) * 2 : comtradeCfgDTO.getNDigitalNum() / 16 * 2;
int nBlockSize = 2 * Integer.SIZE / 8 + comtradeCfgDTO.getNAnalogNum() * 2 + nDigSize;
// 总长度除以每个块的大小
int nBlockNum = datArray.length / nBlockSize;
int nBlockNum = (int)Math.floor(datArray.length / nBlockSize);
// 获取采样率
int finalSampleRate = getFinalWaveSample(comtradeCfgDTO.getLstRate(), iType);
@@ -612,6 +612,9 @@ public class WaveFileComponent {
}
float fCoef = comtradeCfgDTO.getLstAnalogDTO().get(j).getFCoefficent();
if((i * nBlockSize + 2 * 4 + j * 2) == 2437568){
System.out.println(55);
}
fValue = BitConverter.byte2ToUnsignedShort(datArray, i * nBlockSize + 2 * 4 + j * 2) * fCoef;
//WW 2019-11-14
/*************************
@@ -767,6 +770,7 @@ public class WaveFileComponent {
}
}
} catch (Exception e) {
e.printStackTrace();
throw new BusinessException(WaveFileResponseEnum.DAT_DATA_ERROR);
}