微调
This commit is contained in:
@@ -1853,7 +1853,7 @@ public class SocketDevResponseService {
|
||||
if (ObjectUtil.isNotNull(dipData)) {
|
||||
Double fTransValue = dipData.getFTransValue();
|
||||
if (ObjectUtil.isNotNull(fTransValue) && ObjectUtil.isNotNull(fAmp)) {
|
||||
if (maxVoltage.compareTo(BigDecimal.valueOf(fTransValue).max(BigDecimal.valueOf(fAmp))) < 0) {
|
||||
if (maxVoltage.compareTo(BigDecimal.valueOf(fTransValue / 100).max(BigDecimal.valueOf(fAmp))) < 0) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -1862,7 +1862,7 @@ public class SocketDevResponseService {
|
||||
// 谐波判断
|
||||
if (channelListDTO.getHarmFlag()) {
|
||||
List<SourceIssue.ChannelListDTO.HarmModel> harmList = channelListDTO.getHarmList();
|
||||
double sum = harmList.stream().map(harmModel -> harmModel.getFAmp() * harmModel.getFAmp()).mapToDouble(x -> x).sum();
|
||||
double sum = harmList.stream().map(harmModel -> harmModel.getFAmp() * harmModel.getFAmp() / 10000).mapToDouble(x -> x).sum();
|
||||
if (channelType.contains("U")) {
|
||||
if (maxVoltage.compareTo(BigDecimal.valueOf(Math.sqrt(1 + sum) * fAmp)) < 0) {
|
||||
return 1;
|
||||
@@ -1876,7 +1876,7 @@ public class SocketDevResponseService {
|
||||
// 间谐波判断
|
||||
if (channelListDTO.getInHarmFlag()) {
|
||||
List<SourceIssue.ChannelListDTO.InharmModel> inharmList = channelListDTO.getInharmList();
|
||||
double sum = inharmList.stream().map(harmModel -> harmModel.getFAmp() * harmModel.getFAmp()).mapToDouble(x -> x).sum();
|
||||
double sum = inharmList.stream().map(harmModel -> harmModel.getFAmp() * harmModel.getFAmp() / 10000).mapToDouble(x -> x).sum();
|
||||
if (channelType.contains("U")) {
|
||||
if (maxVoltage.compareTo(BigDecimal.valueOf(Math.sqrt(1 + sum) * fAmp)) < 0) {
|
||||
return 1;
|
||||
|
||||
@@ -389,19 +389,22 @@ public class SocketSourceResponseService {
|
||||
overloadSocketDataMsg.setRequestId("overloadTest");
|
||||
overloadSocketDataMsg.setCode(FormalTestManager.overload);
|
||||
sendWebSocketMessage(param.getUserPageId(), overloadSocketDataMsg);
|
||||
|
||||
//todo 前端推送收到的消息暂未处理好
|
||||
sendWebSocketMessage(param.getUserPageId(), socketDataMsg);
|
||||
//开始设备通讯检测(发送设备初始化)
|
||||
Map<String, List<PreDetection>> map = new HashMap<>(1);
|
||||
map.put("deviceList", FormalTestManager.devList);
|
||||
String jsonString = JSON.toJSONString(map);
|
||||
socketMsg.setRequestId(SourceOperateCodeEnum.YJC_SBTXJY.getValue());
|
||||
socketMsg.setOperateCode(SourceOperateCodeEnum.DEV_INIT_GATHER_01.getValue());
|
||||
socketMsg.setData(jsonString);
|
||||
String json = JSON.toJSONString(socketMsg);
|
||||
// 使用智能发送工具类,自动管理设备连接
|
||||
socketManager.smartSendToDevice(param, json);
|
||||
if (FormalTestManager.overload != 4) {
|
||||
CnSocketUtil.quitSendSource(param);
|
||||
} else {
|
||||
//todo 前端推送收到的消息暂未处理好
|
||||
sendWebSocketMessage(param.getUserPageId(), socketDataMsg);
|
||||
//开始设备通讯检测(发送设备初始化)
|
||||
Map<String, List<PreDetection>> map = new HashMap<>(1);
|
||||
map.put("deviceList", FormalTestManager.devList);
|
||||
String jsonString = JSON.toJSONString(map);
|
||||
socketMsg.setRequestId(SourceOperateCodeEnum.YJC_SBTXJY.getValue());
|
||||
socketMsg.setOperateCode(SourceOperateCodeEnum.DEV_INIT_GATHER_01.getValue());
|
||||
socketMsg.setData(jsonString);
|
||||
String json = JSON.toJSONString(socketMsg);
|
||||
// 使用智能发送工具类,自动管理设备连接
|
||||
socketManager.smartSendToDevice(param, json);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case UNPROCESSED_BUSINESS:
|
||||
|
||||
Reference in New Issue
Block a user