正在显示
3 个修改的文件
包含
22 行增加
和
15 行删除
| @@ -144,6 +144,10 @@ public class CameraConfig implements OperatingDataType{ | @@ -144,6 +144,10 @@ public class CameraConfig implements OperatingDataType{ | ||
| 144 | */ | 144 | */ |
| 145 | private Integer stopTriggeringConditions; | 145 | private Integer stopTriggeringConditions; |
| 146 | 146 | ||
| 147 | + /** | ||
| 148 | + * 是否需要发送鱼群规模识别记录 | ||
| 149 | + */ | ||
| 150 | + private Boolean ifSendFishSchoolSize; | ||
| 147 | 151 | ||
| 148 | public CameraConfig creteDefault() | 152 | public CameraConfig creteDefault() |
| 149 | { | 153 | { |
| @@ -177,6 +181,7 @@ public class CameraConfig implements OperatingDataType{ | @@ -177,6 +181,7 @@ public class CameraConfig implements OperatingDataType{ | ||
| 177 | this.collectionScale = 5; | 181 | this.collectionScale = 5; |
| 178 | this.scaleStep = 60; | 182 | this.scaleStep = 60; |
| 179 | this.stopTriggeringConditions = 30; | 183 | this.stopTriggeringConditions = 30; |
| 184 | + this.ifSendFishSchoolSize = false; | ||
| 180 | return this; | 185 | return this; |
| 181 | } | 186 | } |
| 182 | 187 |
| @@ -265,22 +265,25 @@ public class FishGroupImageRecognitionService { | @@ -265,22 +265,25 @@ public class FishGroupImageRecognitionService { | ||
| 265 | if(OperatingData.cameraData.getFishSchoolSize()!=grade) | 265 | if(OperatingData.cameraData.getFishSchoolSize()!=grade) |
| 266 | { | 266 | { |
| 267 | OperatingData.cameraData.setFishSchoolSize(grade); | 267 | OperatingData.cameraData.setFishSchoolSize(grade); |
| 268 | - int finalGrade = grade; | ||
| 269 | - ScheduledConfig.scheduler.schedule(() -> { | ||
| 270 | - | ||
| 271 | - String nowtime = DateUtils.getTime(); | ||
| 272 | - String[] ss = OperatingData.cameraConfig.getFishSchoolSizeConfigString(); | ||
| 273 | - String fishSchoolSizeStr = ss[finalGrade]; | ||
| 274 | - StringBuffer stringBuffer = new StringBuffer(); | ||
| 275 | - stringBuffer.append(nowtime); | ||
| 276 | - stringBuffer.append(" "); | ||
| 277 | - stringBuffer.append(fishSchoolSizeStr); | 268 | + if(OperatingData.cameraConfig.getIfSendFishSchoolSize()) |
| 269 | + { | ||
| 270 | + int finalGrade = grade; | ||
| 271 | + ScheduledConfig.scheduler.schedule(() -> { | ||
| 272 | + | ||
| 273 | + String nowtime = DateUtils.getTime(); | ||
| 274 | + String[] ss = OperatingData.cameraConfig.getFishSchoolSizeConfigString(); | ||
| 275 | + String fishSchoolSizeStr = ss[finalGrade]; | ||
| 276 | + StringBuffer stringBuffer = new StringBuffer(); | ||
| 277 | + stringBuffer.append(nowtime); | ||
| 278 | + stringBuffer.append(" "); | ||
| 279 | + stringBuffer.append(fishSchoolSizeStr); | ||
| 278 | // stringBuffer.append(",当前档位:"); | 280 | // stringBuffer.append(",当前档位:"); |
| 279 | // stringBuffer.append(null==OperatingData.cameraData.getNowGear()?0:OperatingData.cameraData.getNowGear()); | 281 | // stringBuffer.append(null==OperatingData.cameraData.getNowGear()?0:OperatingData.cameraData.getNowGear()); |
| 280 | // stringBuffer.append("档"); | 282 | // stringBuffer.append("档"); |
| 281 | - InitService.dateListenService.reportIntelligentFeeding(stringBuffer.toString()); | 283 | + InitService.dateListenService.reportIntelligentFeeding(stringBuffer.toString()); |
| 282 | 284 | ||
| 283 | - },0, TimeUnit.SECONDS); | 285 | + },0, TimeUnit.SECONDS); |
| 286 | + } | ||
| 284 | } | 287 | } |
| 285 | 288 | ||
| 286 | } | 289 | } |
| @@ -3,7 +3,6 @@ package com.zhonglai.luhui.smart.feeder.service; | @@ -3,7 +3,6 @@ package com.zhonglai.luhui.smart.feeder.service; | ||
| 3 | import com.ruoyi.common.utils.DateUtils; | 3 | import com.ruoyi.common.utils.DateUtils; |
| 4 | import com.zhonglai.luhui.smart.feeder.config.OperatingData; | 4 | import com.zhonglai.luhui.smart.feeder.config.OperatingData; |
| 5 | import com.zhonglai.luhui.smart.feeder.config.ScheduledConfig; | 5 | import com.zhonglai.luhui.smart.feeder.config.ScheduledConfig; |
| 6 | -import com.zhonglai.luhui.smart.feeder.dto.ModbusDto; | ||
| 7 | import com.zhonglai.luhui.smart.feeder.dto.mqtt.Condata; | 6 | import com.zhonglai.luhui.smart.feeder.dto.mqtt.Condata; |
| 8 | import com.zhonglai.luhui.smart.feeder.service.device.SerialPortService; | 7 | import com.zhonglai.luhui.smart.feeder.service.device.SerialPortService; |
| 9 | import com.zhonglai.luhui.smart.feeder.util.FeederCommd06ResponseType; | 8 | import com.zhonglai.luhui.smart.feeder.util.FeederCommd06ResponseType; |
| @@ -27,7 +26,7 @@ public class ScaleStepMethodService { | @@ -27,7 +26,7 @@ public class ScaleStepMethodService { | ||
| 27 | 26 | ||
| 28 | public void run() | 27 | public void run() |
| 29 | { | 28 | { |
| 30 | - scheduledFuture = ScheduledConfig.scheduler.scheduleAtFixedRate(() -> { | 29 | + scheduledFuture = ScheduledConfig.scheduler.scheduleWithFixedDelay(() -> { |
| 31 | if( OperatingData.cameraData.getScaleAreaList().size()==0) | 30 | if( OperatingData.cameraData.getScaleAreaList().size()==0) |
| 32 | { | 31 | { |
| 33 | return; | 32 | return; |
| @@ -87,7 +86,7 @@ public class ScaleStepMethodService { | @@ -87,7 +86,7 @@ public class ScaleStepMethodService { | ||
| 87 | } | 86 | } |
| 88 | 87 | ||
| 89 | //如果鱼群急剧增加,。。。 | 88 | //如果鱼群急剧增加,。。。 |
| 90 | - if (OperatingData.cameraData.getScaleAreaSumMax()-((OperatingData.cameraData.getScaleAreaSumMax()*OperatingData.cameraConfig.getStopTriggeringConditions())/100)-sum>=0) | 89 | + if (OperatingData.cameraData.getScaleAreaSumMax()-((OperatingData.cameraData.getScaleAreaSumMax()*OperatingData.cameraConfig.getStopTriggeringConditions())/100)-sum<=0) |
| 91 | { | 90 | { |
| 92 | stringBuffer.append("发现鱼群急剧增加,"); | 91 | stringBuffer.append("发现鱼群急剧增加,"); |
| 93 | 92 |
-
请 注册 或 登录 后发表评论