From 08cd84454ec525569c606e81a643fa8dc5759a35 Mon Sep 17 00:00:00 2001
From: Junjie <DELL@qq.com>
Date: 星期四, 25 十二月 2025 14:01:30 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/core/network/real/ZyStationRealConnect.java | 34 +++++++++++++++++++++++++++++++---
1 files changed, 31 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/zy/core/network/real/ZyStationRealConnect.java b/src/main/java/com/zy/core/network/real/ZyStationRealConnect.java
index bdde4d8..c73de43 100644
--- a/src/main/java/com/zy/core/network/real/ZyStationRealConnect.java
+++ b/src/main/java/com/zy/core/network/real/ZyStationRealConnect.java
@@ -73,7 +73,7 @@
}
@Override
- public List<ZyStationStatusEntity> getStatus() {
+ public List<ZyStationStatusEntity> getStatus(Integer deviceNo) {
if (statusList == null) {
BasDevpService basDevpService = SpringUtils.getBean(BasDevpService.class);
if (basDevpService == null) {
@@ -132,7 +132,7 @@
}
@Override
- public CommandResponse sendCommand(StationCommand command) {
+ public CommandResponse sendCommand(Integer deviceNo, StationCommand command) {
CommandResponse commandResponse = new CommandResponse(false);
if (null == command) {
commandResponse.setMessage("鍛戒护涓虹┖");
@@ -186,6 +186,34 @@
return commandResponse;
}
+ @Override
+ public CommandResponse sendOriginCommand(String address, short[] data) {
+ CommandResponse commandResponse = new CommandResponse(false);
+ if (null == data || data.length == 0) {
+ commandResponse.setMessage("鏁版嵁涓虹┖");
+ return commandResponse;
+ }
+
+ OperateResult write = siemensNet.Write(address, data);
+ if (write.IsSuccess) {
+ log.info("鍐欏叆鍘熷鍛戒护鎴愬姛銆傚湴鍧�={}锛屾暟鎹�={}", address, JSON.toJSON(data));
+ commandResponse.setResult(true);
+ } else {
+ log.error("鍐欏叆鍘熷鍛戒护澶辫触銆傚湴鍧�={}锛屾暟鎹�={}", address, JSON.toJSON(data));
+ commandResponse.setResult(false);
+ }
+ return commandResponse;
+ }
+
+ @Override
+ public byte[] readOriginCommand(String address, int length) {
+ OperateResultExOne<byte[]> result = siemensNet.Read(address, (short) length);
+ if (result.IsSuccess) {
+ return result.Content;
+ }
+ return new byte[0];
+ }
+
private ZyStationStatusEntity findStatusEntity(Integer stationId) {
for (ZyStationStatusEntity statusEntity : statusList) {
if (statusEntity.getStationId().equals(stationId)) {
@@ -204,4 +232,4 @@
}
return -1;
}
-}
\ No newline at end of file
+}
--
Gitblit v1.9.1