From 818fdd469e2ed47c9e02e06fcb4c7dc791977a0b Mon Sep 17 00:00:00 2001
From: zhang <zc857179121@qq.com>
Date: 星期一, 13 四月 2026 10:07:32 +0800
Subject: [PATCH] 1
---
zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/properties/DevpSlave.java | 5 +-
zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/constant/DeviceField.java | 10 ++--
zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/service/Snap7Service.java | 2
zy-asc-conveyor/src/main/webapp/views/pipeline.html | 10 ++--
zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/controller/SiteController.java | 10 ++--
zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/operation/handler/OutOperationHandler.java | 2
zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/thread/SiemensDevpThread.java | 28 +++++++-------
7 files changed, 33 insertions(+), 34 deletions(-)
diff --git a/zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/controller/SiteController.java b/zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/controller/SiteController.java
index 350ad11..b7cd673 100644
--- a/zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/controller/SiteController.java
+++ b/zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/controller/SiteController.java
@@ -69,10 +69,10 @@
vo.setLoading(staProtocol.isLoading() ? "Y" : "N"); // 鏈夌墿
vo.setInEnable(staProtocol.isInEnable() ? "Y" : "N"); // 鍙叆
vo.setOutEnable(staProtocol.isOutEnable() ? "Y" : "N"); // 鍙嚭
- vo.setEmptyMk(staProtocol.isEmptyMk() !=staProtocol.isFullPlt() ? (staProtocol.isEmptyMk()?"绌�" : "婊�"): "-"); // 绌烘澘淇″彿
+ vo.setEmptyMk(staProtocol.isEmptyMk() != staProtocol.isFullPlt() ? (staProtocol.isEmptyMk() ? "绌�" : "婊�") : "-"); // 绌烘澘淇″彿
vo.setStaNo(staProtocol.getStaNo()); // 鐩爣绔�
vo.setWeight(staProtocol.getWeight() == null ? 0D : staProtocol.getWeight());
- vo.setLocType1(staProtocol.isHigh() != staProtocol.isLow()? ( staProtocol.isLow() ? "浣�" : "楂�"): "-"); //楂樹綆搴撲綅
+ vo.setLocType1(staProtocol.isHigh() != staProtocol.isLow() ? (staProtocol.isLow() ? "浣�" : "楂�") : "-"); //楂樹綆搴撲綅
}
@@ -111,10 +111,10 @@
vo.setLoading(staProtocol.isLoading() ? "Y" : "N"); // 鏈夌墿
vo.setInEnable(staProtocol.isInEnable() ? "Y" : "N"); // 鍙叆
vo.setOutEnable(staProtocol.isOutEnable() ? "Y" : "N"); // 鍙嚭
- vo.setEmptyMk(staProtocol.isEmptyMk() !=staProtocol.isFullPlt() ? (staProtocol.isEmptyMk()?"绌�" : "婊�"): "-"); // 绌烘澘淇″彿
+ vo.setEmptyMk(staProtocol.isEmptyMk() != staProtocol.isFullPlt() ? (staProtocol.isEmptyMk() ? "绌�" : "婊�") : "-"); // 绌烘澘淇″彿
vo.setStaNo(staProtocol.getStaNo()); // 鐩爣绔�
- vo.setWeight(staProtocol.getWeight() ==null ? 0D : staProtocol.getWeight());
- vo.setLocType1(staProtocol.isHigh() != staProtocol.isLow()? ( staProtocol.isLow() ? "浣�" : "楂�"): "-"); //楂樹綆搴撲綅
+ vo.setWeight(staProtocol.getWeight() == null ? 0D : staProtocol.getWeight());
+ vo.setLocType1(staProtocol.isHigh() != staProtocol.isLow() ? (staProtocol.isLow() ? "浣�" : "楂�") : "-"); //楂樹綆搴撲綅
return R.ok().add(vo);
}
}
diff --git a/zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/constant/DeviceField.java b/zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/constant/DeviceField.java
index ed3daf0..944b416 100644
--- a/zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/constant/DeviceField.java
+++ b/zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/constant/DeviceField.java
@@ -6,13 +6,13 @@
*/
public enum DeviceField {
// 鎵爜鍣細姣忕珯鐐�16瀛楄妭锛孲tring[14]
- BARCODE("DB103", 254, 18,new int[]{0,2},21),
+ BARCODE("DB103", 254, 18, new int[]{0, 2}, 21),
// 鍑哄叆搴撴ā寮�
- IO_MODE("DB103", 170, 4,new int[]{0,2},21),
+ IO_MODE("DB103", 170, 4, new int[]{0, 2}, 21),
// 绉伴噸锛氭瘡绔欑偣4瀛楄妭锛孎loat
- WEIGHT("DB103", 634, 6,new int[]{0,2},21),
+ WEIGHT("DB103", 634, 6, new int[]{0, 2}, 21),
// 灏哄寮傚父锛氭瘡绔欑偣2瀛楄妭锛孊it鏁扮粍
- DIMENSION_WORD("DB103", 2, 8,new int[]{0,2,4,6},21);
+ DIMENSION_WORD("DB103", 2, 8, new int[]{0, 2, 4, 6}, 21);
private final String addressPattern;
private final int offset;
@@ -20,7 +20,7 @@
private final int[] seg;
private final int arrLength;
- DeviceField(String addressPattern, int offset, int byteLength,int[] seg, int arrLength) {
+ DeviceField(String addressPattern, int offset, int byteLength, int[] seg, int arrLength) {
this.addressPattern = addressPattern;
this.offset = offset;
this.byteLength = byteLength;
diff --git a/zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/operation/handler/OutOperationHandler.java b/zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/operation/handler/OutOperationHandler.java
index 9a642a8..aad1ac7 100644
--- a/zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/operation/handler/OutOperationHandler.java
+++ b/zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/operation/handler/OutOperationHandler.java
@@ -26,7 +26,7 @@
@Slf4j
@Component
-public class OutOperationHandler implements OperationHandler {
+public class OutOperationHandler implements OperationHandler {
@Autowired
private SlaveProperties slaveProperties;
diff --git a/zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/properties/DevpSlave.java b/zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/properties/DevpSlave.java
index af7eb6f..8e14c64 100644
--- a/zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/properties/DevpSlave.java
+++ b/zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/properties/DevpSlave.java
@@ -20,9 +20,9 @@
private Boolean weight;
- private Boolean barcode ;
+ private Boolean barcode;
- private Boolean staNosError ;
+ private Boolean staNosError;
private List<Sta> releaseSta = new ArrayList<>();
@@ -31,7 +31,6 @@
private List<Sta> inSta = new ArrayList<>();
private List<Integer> staNos = new ArrayList<>();
-
@Data
diff --git a/zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/service/Snap7Service.java b/zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/service/Snap7Service.java
index bae6f06..a677866 100644
--- a/zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/service/Snap7Service.java
+++ b/zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/service/Snap7Service.java
@@ -62,7 +62,7 @@
return;
}
- int baseOffset = TaskField.ALL.getOffset() + index * TaskField.ALL.getByteLength();
+ int baseOffset = TaskField.ALL.getOffset() + index * TaskField.ALL.getByteLength();
String workNoAddr = TaskField.TASK_NUMBER.getAddressPattern() + PlcConstant.ADDRESS_CONCATENATION
+ (baseOffset + TaskField.TASK_NUMBER.getOffset());
String destStaAddr = TaskField.DEST_STATION.getAddressPattern() + PlcConstant.ADDRESS_CONCATENATION
diff --git a/zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/thread/SiemensDevpThread.java b/zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/thread/SiemensDevpThread.java
index 344a861..9ef89c7 100644
--- a/zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/thread/SiemensDevpThread.java
+++ b/zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/thread/SiemensDevpThread.java
@@ -164,7 +164,7 @@
OperateResultExOne<byte[]> result = siemensS7Net.Read(
DeviceField.BARCODE.buildAddress(),
- (short) ( DeviceField.BARCODE.getByteLength() * DeviceField.BARCODE.getArrLength()));
+ (short) (DeviceField.BARCODE.getByteLength() * DeviceField.BARCODE.getArrLength()));
if (!result.IsSuccess) {
log.warn("璇诲彇鏉$爜澶辫触 [id:{}]", slave.getId());
@@ -175,12 +175,12 @@
for (int i = 0; i < DeviceField.BARCODE.getArrLength(); i++) {
int[] seg = DeviceField.BARCODE.getSeg();
Short staNo = siemensS7Net.getByteTransform().TransInt16(
- content, seg[0]+i * DeviceField.BARCODE.getByteLength());
+ content, seg[0] + i * DeviceField.BARCODE.getByteLength());
String barcode = siemensS7Net.getByteTransform().TransString(
- content, seg[1]+i * DeviceField.BARCODE.getByteLength(),
- DeviceField.BARCODE.getByteLength()-seg[1], "UTF-8");
+ content, seg[1] + i * DeviceField.BARCODE.getByteLength(),
+ DeviceField.BARCODE.getByteLength() - seg[1], "UTF-8");
- if (!Cools.isEmpty(barcode)&& staNo !=null) {
+ if (!Cools.isEmpty(barcode) && staNo != null) {
StaProtocol staProtocol = station.get(staNo);
if (staProtocol == null) {
log.warn("鎵爜绔欑偣涓嶅瓨鍦� [id:{}] [staNo:{}]", slave.getId(), staNo);
@@ -196,7 +196,7 @@
* 璇诲彇閲嶉噺淇℃伅
*/
private void readWeight() {
- if ( slave.getWeight() == null || ! slave.getWeight()) {
+ if (slave.getWeight() == null || !slave.getWeight()) {
return;
}
@@ -209,13 +209,13 @@
return;
}
byte[] content = result.Content;
- for (int i = 0; i < DeviceField.WEIGHT.getArrLength() ; i++) {
+ for (int i = 0; i < DeviceField.WEIGHT.getArrLength(); i++) {
int[] seg = DeviceField.WEIGHT.getSeg();
Short staNo = siemensS7Net.getByteTransform().TransInt16(
- content, seg[0]+i * DeviceField.WEIGHT.getByteLength());
+ content, seg[0] + i * DeviceField.WEIGHT.getByteLength());
Double weight = (double) siemensS7Net.getByteTransform().TransSingle(
content, seg[1] + i * DeviceField.WEIGHT.getByteLength());
- if (!Cools.isEmpty(weight)&& staNo !=null) {
+ if (!Cools.isEmpty(weight) && staNo != null) {
StaProtocol staProtocol = station.get(staNo);
if (staProtocol == null) {
log.warn("绉伴噸绔欑偣涓嶅瓨鍦� [id:{}] [staNo:{}]", slave.getId(), staNo);
@@ -223,14 +223,14 @@
}
staProtocol.setWeight(BigDecimal.valueOf(weight).setScale(4, RoundingMode.HALF_UP).doubleValue());
}
- }
+ }
}
/**
* 璇诲彇澶栧舰妫�娴嬮敊璇�
*/
private void readDimensionErrors() {
- if ( slave.getStaNosError() == null || !slave.getStaNosError()) {
+ if (slave.getStaNosError() == null || !slave.getStaNosError()) {
return;
}
@@ -248,14 +248,14 @@
int[] seg = DeviceField.DIMENSION_WORD.getSeg();
Short staNo = siemensS7Net.getByteTransform().TransInt16(
content, seg[0]);
- if ( staNo !=null) {
+ if (staNo != null) {
StaProtocol staProtocol = station.get(staNo);
- if (staProtocol == null){
+ if (staProtocol == null) {
log.warn("寮傚父绔欑偣涓嶅瓨鍦� [id:{}] [staNo:{}]", slave.getId(), staNo);
continue;
}
boolean[] status = siemensS7Net.getByteTransform().TransBool(
- content, seg[1]+i * DeviceField.DIMENSION_WORD.getByteLength(),
+ content, seg[1] + i * DeviceField.DIMENSION_WORD.getByteLength(),
1);
//鏈娇鐢紝棰勭暀
// boolean[] status1 = siemensS7Net.getByteTransform().TransBool(
diff --git a/zy-asc-conveyor/src/main/webapp/views/pipeline.html b/zy-asc-conveyor/src/main/webapp/views/pipeline.html
index 40d2f98..90e4ce0 100644
--- a/zy-asc-conveyor/src/main/webapp/views/pipeline.html
+++ b/zy-asc-conveyor/src/main/webapp/views/pipeline.html
@@ -832,11 +832,11 @@
<input id="staNo" name="staNo" type="number" min="0" class="form-input"
autocomplete="off">
</div>
-<!-- <div class="form-group">-->
-<!-- <label class="form-label" for="pakMk">鍏ュ簱鏍囪:</label>-->
-<!-- <input id="pakMk" name="pakMk" type="text" class="form-input"-->
-<!-- autocomplete="off">-->
-<!-- </div>-->
+ <!-- <div class="form-group">-->
+ <!-- <label class="form-label" for="pakMk">鍏ュ簱鏍囪:</label>-->
+ <!-- <input id="pakMk" name="pakMk" type="text" class="form-input"-->
+ <!-- autocomplete="off">-->
+ <!-- </div>-->
</form>
</div>
<div class="modal-footer">
--
Gitblit v1.9.1