From 44810d2a6263c06044238a6f392d01622071f1d2 Mon Sep 17 00:00:00 2001
From: lsh <lsh@163.com>
Date: 星期四, 17 十月 2024 15:47:09 +0800
Subject: [PATCH] *
---
src/main/java/com/zy/asrs/controller/RgvController.java | 41 ++++++++++++++++++++++++++++++++++++-----
1 files changed, 36 insertions(+), 5 deletions(-)
diff --git a/src/main/java/com/zy/asrs/controller/RgvController.java b/src/main/java/com/zy/asrs/controller/RgvController.java
index 4cc777b..33a715a 100644
--- a/src/main/java/com/zy/asrs/controller/RgvController.java
+++ b/src/main/java/com/zy/asrs/controller/RgvController.java
@@ -22,12 +22,14 @@
import com.zy.core.enums.RgvModeType;
import com.zy.core.enums.RgvTaskModeType;
import com.zy.core.enums.SlaveType;
+import com.zy.core.model.DevpSlave;
import com.zy.core.model.RgvSlave;
import com.zy.core.model.Task;
import com.zy.core.model.command.RgvCommand;
import com.zy.core.model.protocol.RgvProtocol;
import com.zy.core.properties.SlaveProperties;
import com.zy.core.thread.RgvThread;
+import com.zy.core.thread.SiemensDevpThread;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@@ -340,7 +342,8 @@
ringThroughParam.setIndex(rgv.getId());
// ringThroughParam.setIndex(i);
- double[] doubles = Utils.RingThroughXY2(183.0, NumUtils.GetRandomIntInRange(183));
+// double[] doubles = Utils.RingThroughXY2(1737000.0, NumUtils.GetRandomIntInRange(183));
+ double[] doubles = Utils.RingThroughXY2(1737000.0, rgvProtocol.RgvPos.doubleValue());
// double[] doubles = Utils.RingThroughXY2(183.0, 100*i );
ringThroughParam.setValueX(doubles[0]-2.94);
@@ -383,10 +386,38 @@
// @ManagerAuth(memo = "杞ㄩ亾PLC鐘舵�佷俊鎭�")
public R wnergyGatheringRingParamTrack(){
List<EnergyGatheringRingParam> result = new ArrayList<>();
- EnergyGatheringRingParam energyGatheringRingParam = new EnergyGatheringRingParam();
- energyGatheringRingParam.setTrackColor("rgba(0, 230, 118, 0.5)");
- energyGatheringRingParam.setRadiationColor("rgba(0, 230, 118, 0.5)");
- result.add(energyGatheringRingParam);
+ try{
+ for (DevpSlave devp : slaveProperties.getDevp()) {
+ if (devp.getId()!=1){
+ break;
+ }
+ SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId());
+ if (devpThread.isResult()){
+ if (true){
+ EnergyGatheringRingParam energyGatheringRingParam = new EnergyGatheringRingParam();
+ energyGatheringRingParam.setTrackColor("rgba(0, 230, 118, 0.5)");
+ energyGatheringRingParam.setRadiationColor("rgba(0, 230, 118, 0.5)");
+ result.add(energyGatheringRingParam);
+ } else {
+ EnergyGatheringRingParam energyGatheringRingParam = new EnergyGatheringRingParam();
+ energyGatheringRingParam.setTrackColor("rgba(0, 230, 118, 0.5)");
+ energyGatheringRingParam.setRadiationColor("rgba(0, 230, 118, 0.5)");
+ result.add(energyGatheringRingParam);
+ }
+ }
+ }
+ if (result.isEmpty()){
+ EnergyGatheringRingParam energyGatheringRingParam = new EnergyGatheringRingParam();
+ energyGatheringRingParam.setTrackColor("rgba(0, 0, 0, 81)");
+ energyGatheringRingParam.setRadiationColor("rgba(0, 0, 0, 81)");
+ result.add(energyGatheringRingParam);
+ }
+ } catch (Exception e){
+ EnergyGatheringRingParam energyGatheringRingParam = new EnergyGatheringRingParam();
+ energyGatheringRingParam.setTrackColor("rgba(0, 0, 0, 81)");
+ energyGatheringRingParam.setRadiationColor("rgba(0, 0, 0, 81)");
+ result.add(energyGatheringRingParam);
+ }
return R.ok().add(result);
}
--
Gitblit v1.9.1