From 211cd083bc9fc1871779802650dfe0e607d8ca77 Mon Sep 17 00:00:00 2001
From: 严智鑫 <test>
Date: 星期五, 10 五月 2024 08:25:12 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/HangZhouMes
---
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/common/PlcHomeEdg.java | 50 ++++++++++----------------------------------------
1 files changed, 10 insertions(+), 40 deletions(-)
diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/common/PlcHomeEdg.java b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/common/PlcHomeEdg.java
index 08b144c..0421bed 100644
--- a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/common/PlcHomeEdg.java
+++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/common/PlcHomeEdg.java
@@ -3,6 +3,7 @@
import cn.hutool.core.date.DateTime;
import cn.hutool.json.JSONObject;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import com.mes.device.PlcParameterObject;
import com.mes.edgstoragecage.entity.EdgStorageCage;
import com.mes.edgstoragecage.entity.EdgStorageCageDetails;
import com.mes.edgstoragecage.mapper.EdgStorageCageDetailsMapper;
@@ -43,33 +44,6 @@
private Map<String, String> mapType = new HashMap<String, String>();
private Map<String, Object> mapSettings = new HashMap<String, Object>();
-
- private void initialize() {
-// mapParameter.put("A06_request_word", "DB11.0"); //work
-// mapParameter.put("A05_scanning_ID", "DB11.2");
-// mapParameter.put("MES_confirmation_word", "DB11.40");
-// mapParameter.put("A09_glass_status", "DB11.70");
-// //mapParameter.put("A10_glass_status", "DB11.72");
-// mapParameter.put("A09_prohibit_film_production", "DB11.74");
-// mapParameter.put("A10_prohibit_film_production", "DB11.76");
-// mapSettings.put("territoryPoor", 3);
-// mapType.put("A06_request_word", "Word");
-// mapType.put("A05_scanning_ID", "String");
-// mapType.put("MES_confirmation_word", "Word");
-// mapType.put("A09_glass_status", "Word");
-// //mapType.put("A10_glass_status", "Word");
-// mapType.put("A09_prohibit_film_production", "Word");
-// mapType.put("A10_prohibit_film_production", "Word");
- mapValue.put("A06_request_word","1");//璇锋眰瀛�
- mapValue.put("A05_scanning_ID","11111111111");//璇锋眰ID
- mapValue.put("MES_confirmation_word","0");//MES鍙戦�佸瓧
- mapValue.put("A09_glass_status","0");//A09鐜荤拑鐘舵��
- mapValue.put("A10_glass_status","0");//A09鐜荤拑鐘舵��
- mapValue.put("A09_prohibit_film_production","0");//A9绂佹鍑虹墖
- mapValue.put("A10_prohibit_film_production","0");//A10绂佹鍑虹墖
-
- }
-
private void inTo() {
List<GlassInfo> glassInfos = glassInfoService.selectId(mapValue.get("A05_scanning_ID"));
if (glassInfos.size() < 1) {
@@ -106,20 +80,20 @@
private void outTo(int line) {
int endcell = 0;
EdgStorageCageDetails outEdgStorageCageDetails = new EdgStorageCageDetails();
- TaskCache taskCacheA09 = taskCacheService.selectLastOutCacheInfo("");
- TaskCache taskCacheA10 = taskCacheService.selectLastOutCacheInfo("");
+ TaskCache taskCacheA09 = taskCacheService.selectLastOutCacheInfo(2001);
+ TaskCache taskCacheA10 = taskCacheService.selectLastOutCacheInfo(2002);
//涓ょ嚎鍚勮嚜瑕佸嚭鐨勭幓鐠�
EdgStorageCageDetails glassInfo09 = edgStorageCageDetailsService.selectConformGlass(taskCacheA09.getGlassId(), (int) mapSettings.get("territoryPoor"));
EdgStorageCageDetails glassInfo10 = edgStorageCageDetailsService.selectConformGlass(taskCacheA10.getGlassId(), (int) mapSettings.get("territoryPoor"));
//鍐冲畾绾胯矾
if (line == 1) {
- endcell = 9000;
+ endcell = 2001;
outEdgStorageCageDetails = glassInfo09;
} else if (line == 2) {
- endcell = 1000;
+ endcell = 2002;
outEdgStorageCageDetails = glassInfo10;
} else if (line == 3) {
- endcell = 9000;//榛樿璧颁竴鍙风嚎 浼樺寲鏂瑰悜鍙牴鎹� 瀵规瘮涓ょ嚎閫熷害/涓ょ嚎褰撳墠浠诲姟鎯呭喌鍋�
+ endcell = 2001;//榛樿璧颁竴鍙风嚎 浼樺寲鏂瑰悜鍙牴鎹� 瀵规瘮涓ょ嚎閫熷害/涓ょ嚎褰撳墠浠诲姟鎯呭喌鍋�
outEdgStorageCageDetails = glassInfo09;
}
if (outEdgStorageCageDetails != null && endcell > 0) {
@@ -140,7 +114,6 @@
@Override
public void run() {
boolean start = true;
- initialize();
log.info("褰撳墠鍙傛暟鍊硷細{}", mapValue);
while (this != null && start) {
JSONObject jsonObject = new JSONObject();
@@ -153,18 +126,15 @@
}
mapValue.put(key, value);
}
+ S7object.getinstance().plccontrol.WriteWord(S7object.getinstance().PlcMesObject.getPlcParameter("A06_request_word").getAddress(), (short)1);
try {
Thread.sleep(1000);
- taskCacheService = WebSocketServer.applicationContext.getBean(TaskCacheService.class);
- glassInfoService = WebSocketServer.applicationContext.getBean(GlassInfoService.class);
- edgStorageCageService = WebSocketServer.applicationContext.getBean(EdgStorageCageService.class);
- edgStorageCageDetailsMapper = WebSocketServer.applicationContext.getBean(EdgStorageCageDetailsMapper.class);
// initialize();//鍒濆鍖栨暟鎹�
- if ("0".equals(mapValue.get("A06_request_word"))) {
+ if ("0".equals(S7object.getinstance().PlcMesObject.getPlcParameter("A06_request_word"))) {
//娓呴櫎
S7object.getinstance().plccontrol.WriteWord(mapParameter.get("MES_confirmation_word"), (short) 0);
- } else if ("1".equals(mapValue.get("A06_request_word")) &&
- "0".equals(mapValue.get("MES_confirmation_word"))) {
+ } else if ("1".equals(S7object.getinstance().PlcMesObject.getPlcParameter("A06_request_word")) &&
+ "0".equals(S7object.getinstance().PlcMesObject.getPlcParameter("MES_confirmation_word"))) {
inTo();
} else if ("2".equals(mapValue.get("A06_request_word")) &&
--
Gitblit v1.8.0