From 3fdf3c82bc1ac5f5fdce0f841db7bdeacf75704c Mon Sep 17 00:00:00 2001
From: wuyouming666 <2265557248@qq.com>
Date: 星期五, 26 一月 2024 13:53:34 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/CanadaMes
---
CanadaMes-ui/src/views/home/index.vue | 187 +-----
src/main/java/com/canadames/mapper/device/DeviceDao.java | 16
springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java | 191 +++++++
springboot-vue3/src/main/java/com/example/springboot/service/SpianService.java | 25
springboot-vue3/src/main/java/com/example/springboot/component/PlcRead.java | 91 +++
springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java | 408 +++++++-------
springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java | 2
springboot-vue3/src/main/resources/JsonFile/PlcMes.json | 107 +++
springboot-vue3/src/main/resources/JsonFile/Plcframe.json | 51 +
CanadaMes-ui/src/layout/index.vue | 4
springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java | 20
CanadaMes-ui/src/lang/locales/zh-CN.json | 2
springboot-vue3/src/main/java/com/example/springboot/service/StorageCageService.java | 93 ++-
src/main/java/com/canadames/service/device/impl/DeviceServiceImpl.java | 20
springboot-vue3/src/main/resources/JsonFile/PlcRead.json | 195 +++++++
src/main/java/com/canadames/service/device/DeviceService.java | 16
springboot-vue3/src/main/java/com/example/springboot/component/PLCAutoMes.java | 90 +++
springboot-vue3/src/main/java/com/example/springboot/entity/device/PlcParameterObject.java | 3
src/main/java/com/canadames/controller/device/DeviceController.java | 20
CanadaMes-ui/src/lang/locales/en-US.json | 2
src/main/resources/mapper/device/DeviceEntityMapper.xml | 5
src/main/java/com/canadames/entity/device/DeviceEntity.java | 61 ++
22 files changed, 1,214 insertions(+), 395 deletions(-)
diff --git a/CanadaMes-ui/src/lang/locales/en-US.json b/CanadaMes-ui/src/lang/locales/en-US.json
index ae14b57..4828184 100644
--- a/CanadaMes-ui/src/lang/locales/en-US.json
+++ b/CanadaMes-ui/src/lang/locales/en-US.json
@@ -1,6 +1,6 @@
{
"Clear":"Clear",
- "ip":"localhost",
+ "ip":"192.168.10.21",
"systemTitle": "Login System",
"usernamePlaceholder": "Please enter username",
"passwordPlaceholder": "Please enter password",
diff --git a/CanadaMes-ui/src/lang/locales/zh-CN.json b/CanadaMes-ui/src/lang/locales/zh-CN.json
index e12df6e..439e685 100644
--- a/CanadaMes-ui/src/lang/locales/zh-CN.json
+++ b/CanadaMes-ui/src/lang/locales/zh-CN.json
@@ -1,6 +1,6 @@
{
"Clear":"娓呴櫎",
- "ip":"localhost",
+ "ip":"192.168.10.21",
"systemTitle": "鐧诲綍绯荤粺",
"usernamePlaceholder": "璇疯緭鍏ョ敤鎴峰悕",
"passwordPlaceholder": "璇疯緭鍏ュ瘑鐮�",
diff --git a/CanadaMes-ui/src/layout/index.vue b/CanadaMes-ui/src/layout/index.vue
index 25a28ce..6fcf6cd 100644
--- a/CanadaMes-ui/src/layout/index.vue
+++ b/CanadaMes-ui/src/layout/index.vue
@@ -310,10 +310,10 @@
}
}
},
- //45绉掑浣嶅�掓暟璁℃椂
+ //60绉掑浣嶅�掓暟璁℃椂
CountDown() {
clearInterval(timer);
- let count = 45;
+ let count = 60;
timer = setInterval(
() => {
if (this.EmergencyStop == true) {
diff --git a/CanadaMes-ui/src/views/home/index.vue b/CanadaMes-ui/src/views/home/index.vue
index 64b1e31..14792be 100644
--- a/CanadaMes-ui/src/views/home/index.vue
+++ b/CanadaMes-ui/src/views/home/index.vue
@@ -375,6 +375,17 @@
<div class="device" :style="'top: 262px;left: 150px;background-color: ' + ShowDeviceList(8) + ';'">D05</div>
<div class="device" :style="'top: 339px;left: 150px;background-color: ' + ShowDeviceList(9) + ';'">D06</div>
+ <div class="device" :style="'top: 395px;left: 90px;background-color: ;'">E01</div>
+ <div class="device" :style="'top: 395px;left: 243px;background-color: ;'">E02</div>
+ <div class="device" :style="'top: 395px;left: 395px;background-color: ;'">E03</div>
+ <div class="device" :style="'top: 345px;left: 655px;background-color: ;'">E04</div>
+ <div class="device" :style="'top: 345px;left: 810px;background-color: ;'">E05</div>
+ <div class="device" :style="'top: 345px;left: 960px;background-color: ;'">E06</div>
+
+ <div class="device" :style="'top: 345px;left: 525px;background-color: ;'">J01</div>
+ <div class="device" :style="'top: 345px;left: 1100px;background-color: ;'">F01</div>
+ <div class="device" :style="'top: 275px;left: 1100px;background-color: ;'">G01</div>
+
<div class="glass D01" style="top: 39px;left: 1055px;position: absolute;">{{ ShowGlassIdList(0) }}
<br />
<el-button type="primary" size="mini" @click="ClearGlassId('DB101.9.2', 0)">
@@ -405,13 +416,13 @@
<div class="glass A01" style="top: 315px;left: 289px;position: absolute;">A01.2:{{ ShowGlassIdList(5) }}
<br />
- <el-button type="primary" size="mini" @click="ClearGlassId('DB101.10.1,5', 5)">
+ <el-button type="primary" size="mini" @click="ClearGlassId('DB101.10.0', 5)">
{{ $t('Clear') }}</el-button>
</div>
<div class="glass A02" style="top: 360px;left: 289px;position: absolute;">A02:{{ ShowGlassIdList(6) }}
<br />
- <el-button type="primary" size="mini" @click="ClearGlassId('DB101.10.2,6', 6)">
+ <el-button type="primary" size="mini" @click="ClearGlassId('DB101.10.1', 6)">
{{ $t('Clear') }}</el-button>
</div>
@@ -599,12 +610,6 @@
<el-dialog :visible.sync="dialogFormVisible5" :title="$t('Please confirm the glass information')">
<el-form :model="form" label-width="100px" style="padding-right: 30px">
<div style="display: flex;justify-content: center;">
- <!-- <el-form-item>
- <el-input style="width:50%;margin-left: 20%;" :placeholder="$t('Enter the glass barcode')"
- v-model="glassid2"></el-input>
- <el-button type="primary" @click="SelectGlassByGlassIDs(1)">{{ $t('Query')
- }}</el-button>
- </el-form-item> -->
<el-form-item>
{{ $t('Confirm State') }}:{{ this.isConfirm == true ? $t('Allow') : $t('Not Allow') }}
<el-button type="primary" @click="isConfirmState()">
@@ -723,22 +728,11 @@
</el-form-item>
</div>
<div style="display: flex;justify-content: right;">
- <!-- <el-button @click="DeleteQueueGlasss(2)" type="primary">{{ $t('Clear Current')
- }}</el-button>
- <el-button @click="InsertQueueGlass(2)" type="primary" :disabled="disabled">
- {{ $t('Confirm') }}</el-button>
- <el-button @click="DeleteQueueGlasss(1)" type="primary">{{ $t('Clear Current')
- }}</el-button> -->
<el-button @click="InsertQueueGlass(1)" style="margin-right: 100px;" type="primary"
:disabled="disabled1">
{{ $t('Confirm') }}</el-button>
</div>
</el-form>
- <!-- <template #footer>
- <span class="dialog-footer">
- <el-button @click="cancel3()">{{ $t('cancel') }}</el-button>
- </span>
- </template> -->
</el-dialog>
<el-dialog :visible.sync="dialogFormVisible6" :title="$t('Outing Queue')" top="5vh">
@@ -761,9 +755,6 @@
<label style="background-color:yellow;font-size: 23px;" for="">
{{ isQueueWarning == true ? $t('The cage is disabled') : "" }}
</label>
- <!-- <span style="background-color:yellow;">
- {{ isQueueWarning== true ? $t('The cage is disabled') : $t('The cage is disabled') }}
- </span> -->
<div style="display:flex;">
<div style="width:70%;">
<el-table :data="this.OutSlice" :height="700" :span-method="objectSpanMethod" border
@@ -793,45 +784,12 @@
}}</el-button>
</template>
</el-table-column>
- <!-- <el-table-column :min-width="300" prop="position" :label="$t('Position')" style="font-size: 20px;">
- <template slot-scope='scope'>
- <div
- :style="'width:' + (scope.row.position == 1 ? '300' : '100') + 'px;height:' + (scope.row.position == 1 ? '100' : '200') + 'px;background-Color:gray;margin:0 auto;'">
-
- </div>
- </template>
- </el-table-column> -->
- <!-- <el-table-column prop="position" :label="$t('Flipped')" :min-width="200">
- <template slot-scope='scope'>
- {{ scope.row.flip == true ? $t('EXTERIQR OUT AND BYPASS TO THE LEFT')
- : $t('EXTERIQR OUT AND BYPASS TO THE RIGHT') }}
- </template>
- </el-table-column> -->
<el-table-column :width="100" :label="$t('Operate')">
<template slot-scope='scope'>
- <!-- <el-button type="text" size="small" @click="getTopMove(scope.row, scope.$index)"
- style="font-size: 15px;"
- :disabled="(scope.$index == 0 || isAllowReordering == true || scope.row.state == 1)">
- {{ $t('Top') }}
- </el-button>
- <el-button type="text" size="small" @click="getUpMove(scope.row, scope.$index)"
- style="font-size: 15px;"
- :disabled="(scope.$index == 0 || isAllowReordering == true || scope.row.state == 1)">
- {{ $t('Up') }}
- </el-button>
- <el-button type="text" size="small" @click="getDownMove(scope.row, scope.$index)"
- style="font-size: 15px;"
- :disabled="(OutSlice.length - 1 == scope.$index || isAllowReordering == true || scope.row.state == 1)">
- {{ $t('Down') }}
- </el-button> -->
<el-button type="primary" style="padding: 4px 10px;font-size: 12px;"
:disabled="isAllowQueue" @click="deleteproductionqueueglass(scope.row.barcode)">{{
$t('Delete') }}</el-button>
-
- <!-- <el-button type="primary" style="padding: 4px 10px;font-size: 12px;" :disabled="isAllowQueue"
- @click="FrameStateUpdate(scope.row.barcode,scope.row.framestate)">{{
- scope.row.framestate == 0 ? $t('Stop') : $t('Start') }}</el-button> -->
</template>
</el-table-column>
</el-table>
@@ -881,7 +839,6 @@
</template>
</el-table-column>
- <!-- <el-table-column prop="Flip" :label="$t('Flipped')"></el-table-column> -->
<el-table-column prop="out_slice.state" :label="$t('In the queue')">
<template slot-scope='scope'>
{{ scope.row.out_slice != null ? $t('Yes') : $t('No') }}
@@ -893,12 +850,6 @@
{{ scope.row.storageCage != null ? $t('Yes') : $t('No') }}
</template>
</el-table-column>
- <!-- <el-table-column :width="80" :label="$t('Operate')">
- <template slot-scope='scope'>
- <el-checkbox label="" :disabled="!(scope.row.storageCage != null && scope.row.out_slice == null)"
- :checked="scope.row.isCheck" @change="CheckBoxchange(scope.row.barcode, $event)"></el-checkbox>
- </template>
- </el-table-column> -->
</el-table>
</el-dialog>
<el-dialog :visible.sync="dialogFormCountDown" :title="$t('Approximately resettable time')" top="5vh">
@@ -1019,6 +970,9 @@
},
created() {
this.load();
+
+ },
+ activated() {
this.init();
}
,
@@ -1045,14 +999,14 @@
//console.log("鏀跺埌鏁版嵁====" + msg.data);
let obj = JSON.parse(msg.data);
if (obj.params != null) {
- var zhi1=obj.params[0][0];
- var zhi2=obj.params[0][1];
+ var zhi1 = obj.params[0][0];
+ var zhi2 = obj.params[0][1];
this.car1 = 145 + 8.15 * Math.abs(zhi1 - this.carlist[0]['start']) / Math.abs(this.carlist[0]['end'] - this.carlist[0]['start']) * 100;
this.car2 = 210 + 8.15 * Math.abs(zhi2 - this.carlist[1]['start']) / Math.abs(this.carlist[1]['end'] - this.carlist[1]['start']) * 100;
// this.car1 = 210 + 11.25 * (obj.params[0][1]-this.carlist[1]['start'])/(this.carlist[1]['end']-this.carlist[1]['start'])*100;
// this.car2 = 300 + 11.25 * (obj.params[0][1]-this.carlist[1]['start'])/(this.carlist[1]['end']-this.carlist[1]['start'])*100;
}
-
+
this.tableData = obj.tableData[0];
this.cagelist1 = obj.cagelist1[0];
this.cagelist2 = obj.cagelist2[0];
@@ -1074,11 +1028,11 @@
//鏌ヨ褰撳墠閾濇淇℃伅
this.CurrentFrame = obj.CurrentFrame;
-
- //鑾峰彇璁惧鐘舵��
- // if (obj.DeviceList != null) {
- // this.DeviceList = obj.DeviceList[0];
- // }
+
+ // 鑾峰彇璁惧鐘舵��
+ if (obj.DeviceList != null) {
+ this.DeviceList = obj.DeviceList[0];
+ }
//鑾峰彇璁惧涓婄殑鐜荤拑id
if (obj.GlassIdList != null) {
this.GlassIdList = obj.GlassIdList[0];
@@ -1196,6 +1150,10 @@
socket.onerror = function () {
console.log("websocket鍙戠敓浜嗛敊璇�");
}
+ //璺宠浆椤甸潰鏃跺叧闂璼ocket
+ this.$router.afterEach(function () {
+ socket.close();
+ });
}
},
load() {
@@ -1248,14 +1206,6 @@
this.cagelist3 = res.data.list3;
this.cagelist4 = res.data.list4;
});
- // //鍔犺浇杩涚墖浠诲姟鏁版嵁
- // loadtask(this.task1).then(res => {
- // this.tasklist1 = res.data.list;
- // });
- // //鍔犺浇杩涘嚭鐗囦换鍔℃暟鎹�
- // loadtask(this.task2).then(res => {
- // this.tasklist2 = res.data.list;
- // });
//鍔犺浇鎶ヨ淇℃伅
SelectAlarmmgInfo().then(res => {
this.alarm = res.data.alarmmg;
@@ -1296,7 +1246,6 @@
},
//鎵嬪姩涓婄墖
sbumitglassid() {
- console.log(1111111);
if (this.form.order != "") {
if (this.form.height < 380 || this.form.width < 390 || this.form.height > 1810 || this.form.width > 2760) {
this.$message.error(this.$t('The glass size is not within the range'));
@@ -1371,36 +1320,6 @@
//鑾峰彇鎵爜浣嶅拰涓婄墖浣嶆暟鎹�
SelectGlassByGlassIDs() {
this.showform3();
- // if (parameter == 1) {
- // SelectGlassByGlassID(this.glassid2).then(res => {
- // if (res.data.form != null) {
- // if (res.data.form.glassId != null) {
- // this.form4 = res.data.form;
- // this.$message.success(this.$t('query was successful'));
- // this.Sizerange(this.form4, 2);
- // } else {
- // this.$message.error(this.$t('There is no such glass'));
- // }
-
- // } else {
- // this.$message.error(this.$t('There is no such glass'));
- // }
- // });
- // } else {
- // SelectGlassByGlassID(this.glassid1).then(res => {
- // if (res.data.form != null) {
- // if (res.data.form.glassId != null) {
- // this.form5 = res.data.form;
- // this.$message.success(this.$t('query was successful'));
- // this.Sizerange(this.form5, 1);
- // } else {
- // this.$message.error(this.$t('There is no such glass'));
- // }
- // } else {
- // this.$message.error(this.$t('There is no such glass'));
- // }
- // });
- // }
},
//鏌ヨ瀹㈡埛鐜荤拑淇℃伅
@@ -1426,16 +1345,6 @@
//鏌ヨ閾濇id瀵瑰簲鐜荤拑淇℃伅
SelectAluminumFrameInfoById(this.framebarcode).then(res => {
this.AluminumFrame = res.data.AluminumFrame;
- console.log(this.AluminumFrame);
- // this.AluminumFrame.forEach(item => {
- // if (item.storageCage != null && item.out_slice == null) {
- // item.isCheck = true;
- // } else {
- // item.isCheck = false;
- // }
- // item.Flip = res.data.flip;
- // item.FrameNo = this.framebarcode;
- // });
});
this.dialogFormVisible7 = true;
},
@@ -1632,7 +1541,7 @@
DeleteProductionQueueGlass(id).then(res => {
if (res.data.message == 200) {
this.$message.success(this.$t('Operation successful'));
- }else{
+ } else {
this.$message.error(this.$t('This frame has glass that is currently outing'));
}
});
@@ -1668,17 +1577,19 @@
InsertQueueGlass(parameter) {
if (parameter == 1 && this.form5.glassId != "") {
if (this.form5.glassId != this.form2.glassId && this.form5.glassId != this.form3.glassId) {
- InsertQueueGlassId(1, this.form5).then(res => {
- if (res.data.message == 200) {
- this.form5 = {};
- this.$message.success(this.$t('Operation successful'));
- }
- else if (res.data.message == 400) {
- this.$message.error(this.$t('The glass size is not within the range'));
- } else {
- this.$message.error(this.$t('This glass ID already exists in the sorting cage'));
- }
- });
+ if (this.dialogFormVisible5 == true) {
+ InsertQueueGlassId(1, this.form5).then(res => {
+ if (res.data.message == 200) {
+ this.form5 = {};
+ this.$message.success(this.$t('Operation successful'));
+ }
+ else if (res.data.message == 400) {
+ this.$message.error(this.$t('The glass size is not within the range'));
+ } else {
+ this.$message.error(this.$t('This glass ID already exists in the sorting cage'));
+ }
+ });
+ }
} else {
this.$message.error(this.$t('The glass ID already exists in the loading queue'));
}
@@ -1854,7 +1765,7 @@
}
this.UpdateSequence(Sequence);
},
- //淇敼椤哄簭
+ //淇敼鍑虹墖椤哄簭
UpdateSequence(Sequence) {
let i = 0;
this.OutSlice.forEach(item => {
@@ -1969,9 +1880,9 @@
} else {
this.disabled = false;
}
- if (position == 3 && this.isConfirm == true && this.D01RequestState == true) {
- this.InsertQueueGlass(1);
- }
+ // if (position == 3 && this.isConfirm == true && this.D01RequestState == true && this.dialogFormVisible5 == true) {
+ // this.InsertQueueGlass(1);
+ // }
}
}
},
@@ -1987,9 +1898,9 @@
}
});
},
- //45绉掑浣嶅�掓暟璁℃椂
+ //60绉掑浣嶅�掓暟璁℃椂
CountDown() {
- let count = 45;
+ let count = 60;
let timer = setInterval(
() => {
if (this.EmergencyStop == true) {
@@ -2094,7 +2005,7 @@
type: 'warning'
}).then(() => {
ClearGlassId(position, this.GlassIdList[num]).then(res => {
- if (res.data.message3 == 200) {
+ if (res.data.message == 200) {
this.$message.success(this.$t('Operation successful'));
} else {
this.$message.success(this.$t('operation failed'));
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/PLCAutoMes.java b/springboot-vue3/src/main/java/com/example/springboot/component/PLCAutoMes.java
new file mode 100644
index 0000000..6e6ef8a
--- /dev/null
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/PLCAutoMes.java
@@ -0,0 +1,90 @@
+package com.example.springboot.component;
+
+import com.example.springboot.entity.device.PlcBitObject;
+import com.example.springboot.entity.device.PlcParameterObject;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import static com.example.springboot.component.InitUtil.readAndUpdateBitValues;
+import static com.example.springboot.component.InitUtil.readAndUpdateWordValues;
+
+public class PLCAutoMes extends Thread {
+
+ // 鐢ㄤ簬瀛樺偍搴旂敤绋嬪簭鐨勯厤缃俊鎭�
+ private Configuration config;
+ private static InitUtil initUtil;
+ // 鍒涘缓涓�涓嚜瀹氫箟鐨� S7 鎺у埗鍣ㄦ秷鎭鐞嗗櫒瀵硅薄
+ MessageHandler customS7Control = new MessageHandler();
+
+ // 鍗曚緥瀹炰緥
+ private static PLCAutoMes instance;
+
+ // 绉佹湁鏋勯�犲嚱鏁�
+ public PLCAutoMes() throws IOException {
+ config = new Configuration("config.properties");
+ initUtil = new InitUtil();
+ }
+
+ // 鑾峰彇鍗曚緥瀹炰緥
+ public static synchronized PLCAutoMes getInstance() throws IOException {
+ if (instance == null) {
+ instance = new PLCAutoMes();
+ }
+ return instance;
+ }
+
+ @Override
+ public void run() {
+ while (this != null) {
+ try {
+ Thread.sleep(1000);
+
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+
+
+ String jsonFilePath = PLCAutoMes.class.getResource("/JsonFile/PlcMes.json").getPath();
+
+ String jsonFilePath2 = PLCAutoMes.class.getResource("/JsonFile/PlcRead.json").getPath();
+ // String jsonFilePath3 = PLCAutoMes.class.getResource("/JsonFile/Plcframe.json").getPath();
+ // System.out.println(jsonFilePath);
+
+ // 璋冪敤initword鏂规硶
+ PlcParameterObject PlcMesObject= initUtil.initword(jsonFilePath);
+ // 璋冪敤initbit鏂规硶
+ PlcParameterObject PlcReadObject= initUtil.initword(jsonFilePath2);
+ // // 璋冪敤initbit鏂规硶
+ // PlcParameterObject PlcframeObject= initUtil.initword(jsonFilePath3);
+ readAndUpdateWordValues(PlcReadObject);
+ readAndUpdateWordValues(PlcMesObject);
+ // readAndUpdateWordValues(PlcframeObject);
+
+
+
+
+ // readAndUpdateWordValues(plcStateObject);
+ int index = PlcMesObject.getPlcParameter("AddStart").getAddressIndex();
+ //System.out.println(index);
+ PlcMesObject.getPlcParameter("AddStart").getAddress(index);
+ //System.out.println(PlcMesObject.getPlcParameter("AddStart").getAddress(index));
+ List<String> addresses = new ArrayList<>();
+ addresses.add("FeedID");
+ addresses.add("AddStart");
+ //System.out.println(addresses);
+ //System.out.println(PlcMesObject.getPlcParameterValues(addresses));
+ List<String> addresses2 = new ArrayList<>();
+ addresses2.add("FeedID");
+ addresses2.add("FeedCarStatus");
+
+ System.out.println(PlcReadObject.getPlcParameterValues(addresses2));
+
+
+
+
+ }
+ }
+}
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java b/springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java
new file mode 100644
index 0000000..ada22ca
--- /dev/null
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java
@@ -0,0 +1,191 @@
+package com.example.springboot.component;
+
+import java.time.LocalDateTime;
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import com.example.springboot.service.JdbcConnections;
+import com.example.springboot.service.SpianService;
+import com.example.springboot.entity.north_glass_buffer1;
+import com.example.springboot.mapper.AlarmMapper;
+import com.example.springboot.mapper.SpianMapper;
+
+public class PlcHoldNew extends Thread {
+
+ private AlarmMapper alarmMapper;
+
+ @Autowired
+ private JdbcConnections jdbcConnections;
+ private SpianMapper spianMapper;
+ private SpianService spianService;
+ int aaa;
+
+ @Override
+ public void run() {
+
+ while (this != null) {
+ try {
+
+ Thread.sleep(100);
+ } catch (InterruptedException e) {
+ // \\ TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ // if (S7control.getinstance().CheckConnected() == false) {
+ spianService = WebSocketServer.applicationContext.getBean(SpianService.class);
+ spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class);
+ jdbcConnections = WebSocketServer.applicationContext.getBean(JdbcConnections.class);
+ // 鏍规嵁鐜荤拑id鑾峰彇璁㈠崟鍙�,鍗曠嫭鏁版嵁婧�
+ // try {
+ // north_glass_buffer1 glass = jdbcConnections.selectGlass(112);
+ // // System.out.println(glass.getOrderId());
+ // } catch (SQLException e) {
+ // // TODO Auto-generated catch block
+ // e.printStackTrace();
+ // }
+
+ // 鍑虹墖浠诲姟////////////////////////////////
+ List<Short> outlist = S7control.getinstance().ReadWord("DB106.20", 1); // 鍑虹墖杞︾姸鎬�
+ List<Short> outlist1 = S7control.getinstance().ReadWord("DB105.18", 1); // 鍑虹墖浠诲姟鏄惁鍚姩
+
+ boolean Plcout = spianService.listbool("DB106.64"); // 鍑虹墖璇锋眰瀛�
+ boolean Plcout2 = spianService.listbool("DB105.18"); // 鍑虹墖鍚姩
+ if (Plcout == false&&Plcout2==true) {
+ S7control.getinstance().WriteWord("DB105.18", (short) 0);// 鍑虹墖浠诲姟鍚姩鏀逛负0
+ System.out.println("鍏抽棴鍑虹墖鍚姩" + LocalDateTime.now());// 鍑虹墖浠诲姟鍙戦�佸瓧鏀逛负0
+ }
+ boolean Plcadd = spianService.listbool("DB106.24"); // 杩涚墖璇锋眰瀛�
+ boolean Plcadd2 = spianService.listbool("DB105.16"); // 杩涚墖鍚姩
+ if (Plcadd == false&&Plcadd2==true) {
+ S7control.getinstance().WriteWord("DB105.16", (short) 0);//杩涚墖浠诲姟鍚姩鏀逛负0
+ System.out.println("鍏抽棴杩涚墖鍚姩" + LocalDateTime.now());// 杩涚墖浠诲姟鍙戦�佸瓧鏀逛负0
+ }
+
+
+
+ // StringBuilder writedstrIdOut = new StringBuilder();
+ // 鑾峰彇宸蹭笅鍙戠殑鍑虹墖id
+ byte[] writedglassidbytesOut = S7control.getinstance().ReadByte("DB105.30", 14);
+ String writedstrIdOut = new String(writedglassidbytesOut);
+
+
+ if (Plcout == true) {
+ // 鍒ゆ柇褰撳墠鏄惁鏈夋湭鎵ц鐨勪换鍔�
+ int outnum = spianMapper.SelectOutSliceshu();//鏄惁鏈夋鍦ㄥ嚭鐗囩殑浠诲姟
+ int cageoutsum = spianMapper.Selectcageout(3);//绗煎瓙鍐呮槸鍚﹁繕鏈夊湪鍑虹墖鐨勭幓鐠�
+ // 褰撴病鏈変换鍔℃墽琛屽苟涓斿嚭鐗囪溅绌洪棽鏃�
+ if (outnum == 0 && Plchome.isAllowQueue == true && cageoutsum == 0) {
+ // 鍒ゆ柇閾濇鍑虹墖闃熷垪琛ㄦ槸鍚︽湁寰呭嚭鐗囩殑鐜荤拑
+ String outglassid = spianMapper.SelectOutSlice();
+ // 褰撴湁寰呭嚭鐗囩殑鐜荤拑鏃�
+ if (outglassid != null) {
+ // 鑾峰彇璇ョ幓鐠冩槸鍚﹁绂佺敤
+ int glassdisabled = spianMapper.SelectCageGlassState(outglassid);
+ // 鏈鐢ㄤ笅鍙戜换鍔�
+ if (glassdisabled == 0) {
+ spianService.selectout2(outglassid);
+ Plchome.isQueueWarning = false;
+ } else { // 绂佺敤鏇存敼鐘舵�佸脊鍑烘彁绀�
+ Plchome.isQueueWarning = true;
+ }
+
+ }
+ }
+
+ }
+
+ ///////////// 杩涚墖浠诲姟
+ List<Short> datas1List = S7control.getinstance().ReadWord("DB106.24", 1);// 鑾峰彇prc杩涚墖璇锋眰鏁版嵁
+ List<Short> datas1ListState = S7control.getinstance().ReadWord("DB106.8", 1);// 鑾峰彇杩涚墖杞︾姸鎬�
+ List<Short> datas1ListState2 = S7control.getinstance().ReadWord("DB105.16", 1);// 鑾峰彇杩涚墖杞︿换鍔℃槸鍚﹀惎鍔�
+
+ boolean B01backs = spianService.listbool("DB106.60");// b01姹囨姤
+ boolean B02backs = spianService.listbool("DB106.62");// b02姹囨姤
+ StringBuilder B01glassid = spianService.queGlassid("DB103.184", 14);// BO1鐨勭幓鐠僫d
+ StringBuilder B02glassid = spianService.queGlassid("DB103.212", 14);// B02鐨勭幓鐠僫d
+
+ // 褰撹繘鐗囧皬杞﹀畬鎴愪换鍔℃椂
+ if (B01backs == true) {
+ // 鍒ゆ柇鏄惁姹囨姤姝g‘鐨刬d
+ int HB = spianMapper.SelectHB(B01glassid.toString());
+ if (HB > 0) {
+ // 褰揃01灏忚溅姹囨姤瀹屾垚鏃舵洿鏀圭幓鐠冪姸鎬� 涓�1
+ S7control.getinstance().WriteWord("DB105.48", (short) 1);// 鎭㈠B01灏忚溅搴旂瓟鏀逛负1
+ boolean yingda = spianService.listbool("DB105.48");// b01姹囨姤
+ if (yingda == true) {
+ spianService.overtask(B01glassid.toString());// 瀹屾垚浠诲姟
+ }
+ System.out.println("姹囨姤鏃禕01|绗�" + aaa + "娆�" + B01glassid + "搴旂瓟" + yingda);
+ aaa += 1;
+ }
+
+ }else{
+ S7control.getinstance().WriteWord("DB105.48", (short) 0);// 鎭㈠B01灏忚溅搴旂瓟鏀逛负1
+ }
+
+ // 褰撳嚭鐗囧皬杞﹀畬鎴愪换鍔℃椂
+ if (B02backs == true) {
+ // 鍒ゆ柇鏄惁姹囨姤姝g‘鐨刬d
+ int HB = spianMapper.SelectHB(B02glassid.toString());
+ System.out.println("姹囨姤鏃禕02|" + B02glassid);
+ if (HB > 0) {
+ // 褰揃02灏忚溅姹囨姤瀹屾垚鏃舵洿鏀圭幓鐠冪姸鎬佷负0
+
+ S7control.getinstance().WriteWord("DB105.50", (short) 1);// 鎭㈠B02灏忚溅搴旂瓟鏀逛负1
+ System.out.println("姹囨姤鏃禕02ID|" + B02glassid);
+ boolean yingda = spianService.listbool("DB105.50");// b02姹囨姤
+ if (yingda == true) {
+ spianService.overtask(B02glassid.toString());// 瀹屾垚浠诲姟
+ }
+ System.out.println("姹囨姤鏃禕02|绗�" + aaa + "娆�" + B02glassid + "搴旂瓟" + yingda);
+ }
+ }else{
+ S7control.getinstance().WriteWord("DB105.50", (short) 0);// 鎭㈠B02灏忚溅搴旂瓟鏀逛负0
+ }
+
+
+ // 鑾峰彇DO1鏁版嵁
+ StringBuilder queueid1 = spianService.queGlassid("DB106.26", 14);// 鑾峰彇璇锋眰鐨刬d璺烡O1鍚屾椂娓�
+ // 鑾峰彇DO2鏁版嵁
+ StringBuilder queueid2 = spianService.queGlassid("DB103.58", 14);
+
+ int questate = spianMapper.Selectquecount(queueid1.toString());// 鍒ゆ柇鎵爜浣嶆槸鍚︽湁鐜荤拑宸茬‘璁�
+ // queueid1.toString().isEmpty()
+ north_glass_buffer1 glass1 = spianMapper.selectGlass(queueid1.toString());// D01鐨勭幓鐠冧俊鎭�
+ north_glass_buffer1 glass2 = spianMapper.selectGlass(queueid2.toString());// D02鐜荤拑淇℃伅
+ // 褰撴壂鐮佷綅鐜荤拑id涓虹┖鏃� 瀹藉害涓�0
+ if (queueid1 != null && questate == 0) {
+ // 鍐欏叆D01鐨勬暟鎹埌涓婄墖闃熷垪琛�
+ if (glass1 == null) { // 褰撴病鏈夊�兼椂浼犵┖
+ spianMapper.Updatequeue(null, null, null, null, 0, null, null, null, null, 1);
+ } else {
+
+ spianMapper.Updatequeue(queueid1.toString(), glass1.getordernumber(), glass1.getlistnumber(),
+ glass1.getboxnumber(), 0, glass1.getglasslengthmm().toString(), glass1.getglassheightmm().toString(),
+ glass1.getglasslength().toString(), glass1.getglassheight().toString(), 1);
+ }
+
+ }
+
+ if (queueid2 != null) {
+ // 鍐欏叆D02鐨勬暟鎹埌涓婄墖闃熷垪琛�
+ if (glass2 == null) {
+ spianMapper.Updatequeue(null, null, null, null, 0, null, null, null, null, 2);
+ } else {
+ spianMapper.Updatequeue(queueid2.toString(), glass2.getordernumber(), glass2.getlistnumber(),
+ glass2.getboxnumber(), 0, glass2.getglasslengthmm().toString(), glass2.getglassheightmm().toString(),
+ glass2.getglasslength().toString(), glass2.getglassheight().toString(), 2);
+ spianMapper.overqueue2(queueid2.toString(), 0, 1);// 鏇存敼鎵爜浣嶄换鍔¤〃鐨勭姸鎬佷负0
+ S7control.getinstance().WriteWord("DB105.16", (short) 0);// 鍏抽棴浠诲姟鍚姩
+ }
+
+ }
+
+ // 鏌ヨ鏁版嵁搴�
+ // 鎺ㄩ�佸埌鍓嶇
+
+ // }
+ }
+ }
+
+}
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/PlcRead.java b/springboot-vue3/src/main/java/com/example/springboot/component/PlcRead.java
new file mode 100644
index 0000000..4ba005c
--- /dev/null
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/PlcRead.java
@@ -0,0 +1,91 @@
+package com.example.springboot.component;
+
+import cn.hutool.json.JSONArray;
+import cn.hutool.json.JSONObject;
+
+import java.io.BufferedReader;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Arrays;
+
+public class PlcRead extends Thread {
+ String name = "";
+ Integer count = 0;
+
+ public void readValue() {
+ String str = "";
+ BufferedReader bufferedReader = null;
+ FileInputStream fileInputStream;
+ try {
+ // 浠庢枃浠朵腑璇诲彇瀛楄妭鏁版嵁瀛樺叆 fileInputStream
+ fileInputStream = new FileInputStream("CanadaMes-ui/src/configuration/Read.json");
+ // 璇诲彇 fileInputStream 涓瓧鑺傚苟灏嗗叾瑙g爜涓哄瓧绗�
+ InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream, "utf-8");
+ // 鎻愰珮璇诲彇鏁堢巼锛屽湪 BufferedReader 鍐呭寘瑁� InputStreamReader
+ bufferedReader = new BufferedReader(inputStreamReader);
+ String line = null;
+ // 灏� bufferedReader 鍐呭涓�琛屼竴琛岃祴鍊肩粰str
+ while ((line = bufferedReader.readLine()) != null) {
+ str += line;
+ }
+
+ // 灏唖tr瀛楃涓叉牸寮忚浆涓簀son
+ JSONObject jsonObject = new JSONObject(str);
+
+ // 鑾峰彇json涓殑鍊�
+ JSONArray address = jsonObject.getJSONArray("address");
+ for (int i = 0; i < address.size(); i++) {
+ JSONObject ress = (JSONObject) address.get(i);
+
+ this.name = ress.getStr("name");
+ this.count = ress.getInt("count");
+
+ }
+
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (UnsupportedEncodingException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void run() {
+ while (this != null) {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ List<Boolean> plclist = S7control.getinstance().ReadBits("DB106.0.0", 78);
+
+ if (plclist != null) {
+ // 灏嗚幏鍙栫殑甯冨皵绫诲瀷杞崲涓烘暣鏁扮被鍨�
+ List<Integer> Intlist = new ArrayList<>();
+ for (Boolean value : plclist) {
+ if (value != null) {
+ Intlist.add(value == true ? 0 : 1);
+ }
+
+ }
+ JSONObject jsonObject = new JSONObject();
+ jsonObject.append("sig", Intlist);
+
+ ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("Mes");
+ if (sendwServer != null) {
+ for (WebSocketServer webserver : sendwServer) {
+ webserver.sendMessage(jsonObject.toString());
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java b/springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
index d81c8d7..d178723 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
@@ -12,6 +12,7 @@
import com.example.springboot.service.*;
import org.springframework.beans.factory.annotation.Autowired;
+import com.example.springboot.entity.Glass;
import com.example.springboot.entity.Out_slice;
import com.example.springboot.entity.Queue;
import com.example.springboot.entity.StorageCage;
@@ -45,6 +46,8 @@
private StorageCageService storageCageService;
+ public static Boolean FeedState = false;
+
// public Plchome() throws IOException {
// config = new Configuration("config.properties");
// }
@@ -58,225 +61,228 @@
try {
Thread.sleep(1000);
// 娉ㄥ叆mapper
+ homeMapper = WebSocketServer.applicationContext.getBean(HomeMapper.class);
+ spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class);
+ spianService = WebSocketServer.applicationContext.getBean(SpianService.class);
+ outSliceServive = WebSocketServer.applicationContext.getBean(OutSliceServive.class);
+ north_Glass_Buffer1Service = WebSocketServer.applicationContext
+ .getBean(North_Glass_Buffer1Service.class);
+ storageCageService = WebSocketServer.applicationContext.getBean(StorageCageService.class);
+ dbserve = WebSocketServer.applicationContext.getBean(JdbcConnections.class);
- homeMapper = WebSocketServer.applicationContext.getBean(HomeMapper.class);
- spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class);
- spianService = WebSocketServer.applicationContext.getBean(SpianService.class);
- outSliceServive = WebSocketServer.applicationContext.getBean(OutSliceServive.class);
- north_Glass_Buffer1Service = WebSocketServer.applicationContext.getBean(North_Glass_Buffer1Service.class);
- storageCageService = WebSocketServer.applicationContext.getBean(StorageCageService.class);
- dbserve = WebSocketServer.applicationContext.getBean(JdbcConnections.class);
+ // 绗煎瓙浣跨敤鎯呭喌
+ List<StorageCage> tableData = homeMapper.selectAll();
+ jsonObject.append("tableData", tableData);
+ // 鏍肩悊鐗囩鏍煎瓙鐘舵��
+ List<StorageCage> cagelist1 = homeMapper.selectRack1();
+ List<StorageCage> cagelist2 = homeMapper.selectRack2();
+ List<StorageCage> cagelist3 = homeMapper.selectRack3();
+ List<StorageCage> cagelist4 = homeMapper.selectRack4();
+ jsonObject.append("cagelist1", cagelist1);
+ jsonObject.append("cagelist2", cagelist2);
+ jsonObject.append("cagelist3", cagelist3);
+ jsonObject.append("cagelist4", cagelist4);
+ // 杩涘嚭鐗囦换鍔�
+ List<StorageCage> tasklist1 = homeMapper.selectinout(3);
+ List<StorageCage> tasklist2 = homeMapper.selectinout(2);
+ jsonObject.append("tasklist1", tasklist1);
+ jsonObject.append("tasklist2", tasklist2);
+ // 鏌ヨ鎶ヨ淇℃伅
+ List<alarmmg> alarmmg = homeMapper.SelectAlarmmgInfo();
+ jsonObject.append("alarmmg", alarmmg);
- // 绗煎瓙浣跨敤鎯呭喌
- List<StorageCage> tableData = homeMapper.selectAll();
- jsonObject.append("tableData", tableData);
- // 鏍肩悊鐗囩鏍煎瓙鐘舵��
- List<StorageCage> cagelist1 = homeMapper.selectRack1();
- List<StorageCage> cagelist2 = homeMapper.selectRack2();
- List<StorageCage> cagelist3 = homeMapper.selectRack3();
- List<StorageCage> cagelist4 = homeMapper.selectRack4();
- jsonObject.append("cagelist1", cagelist1);
- jsonObject.append("cagelist2", cagelist2);
- jsonObject.append("cagelist3", cagelist3);
- jsonObject.append("cagelist4", cagelist4);
- // 杩涘嚭鐗囦换鍔�
- List<StorageCage> tasklist1 = homeMapper.selectinout(3);
- List<StorageCage> tasklist2 = homeMapper.selectinout(2);
- jsonObject.append("tasklist1", tasklist1);
- jsonObject.append("tasklist2", tasklist2);
- // 鏌ヨ鎶ヨ淇℃伅
- List<alarmmg> alarmmg = homeMapper.SelectAlarmmgInfo();
- jsonObject.append("alarmmg", alarmmg);
-
- // 浼� 鑾峰彇杩涙槸鍚︽湁寰呯‘璁ょ殑鐜荤拑id
- String queid = spianMapper.Selectqueueid();
- int state = spianMapper.Selectqueuestate();
- jsonObject.append("queid", queid);
- jsonObject.append("state", state);
- // 鑾峰彇鎵爜浣嶄笌涓婄墖浣嶇幓鐠冧俊鎭�
- Queue form2 = homeMapper.GetQueueInfo(2);
- Queue form3 = homeMapper.GetQueueInfo(1);
- if (form2.getglassId() != null && form2.getglassId() != "") {
- jsonObject.append("form2", form2);
- }
- if (form3.getglassId() != null && form3.getglassId() != "") {
- jsonObject.append("form3", form3);
- }
- // 鑾峰彇鍑虹墖闃熷垪淇℃伅
- List<Out_slice> listoutslice = outSliceServive.SelectProductionqueue();
- jsonObject.append("listoutslice", listoutslice);
- // 鑾峰彇褰撳墠鍑虹墖闃熷垪鍑虹墖鐘舵��
- jsonObject.append("isAllowQueue", Plchome.isAllowQueue);
- // 鑾峰彇鍑虹墖闃熷垪璀﹀憡鐘舵��
- jsonObject.append("isQueueWarning", Plchome.isQueueWarning);
- // 鑾峰彇褰撳墠鍑虹墖闃熷垪璋冨簭鐘舵��
- jsonObject.append("isAllowReordering", Plchome.isAllowReordering);
- // 鏄惁闇�瑕佷汉宸ョ‘璁や笂鐗囩幓鐠�
- jsonObject.append("isConfirm", isConfirm);
- // 鏌ヨ褰撳墠閾濇淇℃伅
- Out_slice CurrentFrame = outSliceServive.SelectCurrentFrame();
- jsonObject.append("CurrentFrame", CurrentFrame);
-
- // String E01id = new String( S7controlLK.getinstance().ReadByte("DB17.0",16));
- // String J01id = new String( S7controlLK.getinstance().ReadByte("DB17.22",14));
-
-
-
-
-
-
-
-
- // 閾濇绾夸氦浜�
- if (CurrentFrame != null) {
- S7controlLK.getinstance().writeStrings(CurrentFrame.getBarCode(),"DB17.0");
- }
- String E01id=S7controlLK.getinstance().readStrings("DB17.0");
- String J01id=S7controlLK.getinstance().readStrings("DB17.22");
-
- List<Short> liststates=S7controlLK.getinstance().ReadWord("DB17.38", 1);
- List<Short> liststate=S7controlLK.getinstance().ReadWord("DB17.20", 1);
- Short framerequest = liststate.get(0);
- if (framerequest == 1) {
- // 閾濇id
- String position;
- try {
- position = dbserve.SelectPositionByFrameBarcode(J01id);
- } catch (SQLException e) {
- // TODO Auto-generated catch block
- position = "0";
- e.printStackTrace();
- }
- Short send;
- if (position.equals("0")) {
- send = 0;
- } else {
- send = 1;
- }
- S7controlLK.getinstance().WriteWord("DB17.38", (short) send);
+ // 浼� 鑾峰彇杩涙槸鍚︽湁寰呯‘璁ょ殑鐜荤拑id
+ String queid = spianMapper.Selectqueueid();
+ int state = spianMapper.Selectqueuestate();
+ jsonObject.append("queid", queid);
+ jsonObject.append("state", state);
+ // 鑾峰彇鎵爜浣嶄笌涓婄墖浣嶇幓鐠冧俊鎭�
+ Queue form2 = homeMapper.GetQueueInfo(2);
+ Queue form3 = homeMapper.GetQueueInfo(1);
+ if (form2.getglassId() != null && form2.getglassId() != "") {
+ jsonObject.append("form2", form2);
}
-
-
-
- if (S7control.getinstance().CheckConnected() == true) {
- // 鑾峰彇褰撳墠鎵爜鏂瑰紡
-
- List<Boolean> Scanningmethods = S7control.getinstance().ReadBits("DB101.11.4", 1);
- if (Scanningmethods != null) {
- for (Boolean Scanningmethod : Scanningmethods) {
- jsonObject.append("Scanningmethod", Scanningmethod);
- }
+ if (form3.getglassId() != null && form3.getglassId() != "") {
+ jsonObject.append("form3", form3);
}
+ // 鑾峰彇鍑虹墖闃熷垪淇℃伅
+ List<Out_slice> listoutslice = outSliceServive.SelectProductionqueue();
+ jsonObject.append("listoutslice", listoutslice);
+ // 鑾峰彇褰撳墠鍑虹墖闃熷垪鍑虹墖鐘舵��
+ jsonObject.append("isAllowQueue", Plchome.isAllowQueue);
+ // 鑾峰彇鍑虹墖闃熷垪璀﹀憡鐘舵��
+ jsonObject.append("isQueueWarning", Plchome.isQueueWarning);
+ // 鑾峰彇褰撳墠鍑虹墖闃熷垪璋冨簭鐘舵��
+ jsonObject.append("isAllowReordering", Plchome.isAllowReordering);
+ // 鏄惁闇�瑕佷汉宸ョ‘璁や笂鐗囩幓鐠�
+ jsonObject.append("isConfirm", isConfirm);
+ // 鏌ヨ褰撳墠閾濇淇℃伅
+ Out_slice CurrentFrame = outSliceServive.SelectCurrentFrame();
+ jsonObject.append("CurrentFrame", CurrentFrame);
- String CurrrentGlassId = spianService.queGlassid("DB103.256", 14).toString();
- jsonObject.append("CurrrentGlassId", CurrrentGlassId);
+ // String E01id = new String( S7controlLK.getinstance().ReadByte("DB17.0",16));
+ // String J01id = new String( S7controlLK.getinstance().ReadByte("DB17.22",14));
- // 鑾峰彇D01-D06,A01,A02,B01,B02鐘舵��
- List<Short> DeviceList = S7control.getinstance().ReadWord("DB103.0", 10);
- jsonObject.append("DeviceList", DeviceList);
- // 鑾峰彇D01-D06,A01,A02,B01,B02鐜荤拑id
- List<String> GlassIdList = new ArrayList<String>();
- GlassIdList.add(spianService.queGlassid("DB103.44", 14).toString());
- GlassIdList.add(spianService.queGlassid("DB103.58", 14).toString());
+ if (S7control.getinstance().CheckConnected() == true) {
- GlassIdList.add(spianService.queGlassid("DB103.184", 14).toString());
- GlassIdList.add(spianService.queGlassid("DB103.212", 14).toString());
+ // 閾濇绾夸氦浜�
+ if (S7controlLK.getinstance().CheckConnected() == true) {
+ if (CurrentFrame != null) {
+ S7controlLK.getinstance().writeStrings(CurrentFrame.getBarCode(), "DB17.0");
+ }
+ String E01id = S7controlLK.getinstance().readStrings("DB17.0");
+ String J01id = S7controlLK.getinstance().readStrings("DB17.22");
- GlassIdList.add(spianService.queGlassid("DB103.128", 14).toString());
- GlassIdList.add(spianService.queGlassid("DB103.142", 14).toString());
- GlassIdList.add(spianService.queGlassid("DB103.156", 14).toString());
-
- GlassIdList.add(spianService.queGlassid("DB103.72", 14).toString());
- GlassIdList.add(spianService.queGlassid("DB103.86", 14).toString());
- GlassIdList.add(spianService.queGlassid("DB103.100", 14).toString());
- GlassIdList.add(spianService.queGlassid("DB103.114", 14).toString());
- jsonObject.append("GlassIdList", GlassIdList);
-
- // 璇诲幓Plc杩涚墖杞︿笌鍑虹墖杞︿綅缃甒
- List<String> addressList = new ArrayList<String>();
- addressList.add("DB106.12");
- addressList.add("DB106.0");
- List<Short> paramlist = S7control.getinstance().ReadWord(addressList);
- if (paramlist != null) {
- jsonObject.append("params", paramlist);
- }
- // 鑾峰彇杩涚墖杞︾姸鎬�
- List<Short> datas1ListState = S7control.getinstance().ReadWord("DB106.8",
- 1);// 鑾峰彇杩涚墖杞︾姸鎬�
- if (datas1ListState != null) {
- boolean exist1 = datas1ListState.contains((short) 0);
- jsonObject.append("zhuangtai", exist1);
- }
-
- // 鑾峰彇杩涚墖鐜荤拑淇℃伅
- List<Short> inglassInfo = S7control.getinstance().ReadWord("DB106.24", 1);
- if (inglassInfo != null) {
- if (inglassInfo.size() > 0) {
- jsonObject.append("loadglassheight", inglassInfo.get(0) * 70);
- }
- }
- // // 鑾峰彇閾濇idDB106.DBW64锛屾坊鍔犲埌鍑虹墖闃熷垪
- // String frameno="X21763329601FB";
- String frameno = spianService.queGlassid("DB103.270", 14).toString();
- if (!frameno.equals(Plchome.FrameNo)) {
- Plchome.FrameNo = frameno;
- try {
- Short num = 0;
- List<north_glass_buffer1> north_glass_buffer1s = north_Glass_Buffer1Service
- .SelectAluminumFrameInfoById(Plchome.FrameNo);
- for (north_glass_buffer1 north_glass_buffer1 : north_glass_buffer1s) {
- if (north_glass_buffer1.getstorageCage() == null) {
- break;
+ List<Short> liststates = S7controlLK.getinstance().ReadWord("DB17.38", 1);
+ List<Short> liststate = S7controlLK.getinstance().ReadWord("DB17.20", 1);
+ Short framerequest = liststate.get(0);
+ if (framerequest == 1) {
+ // 閾濇id
+ String position;
+ try {
+ position = dbserve.SelectPositionByFrameBarcode(J01id);
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ position = "0";
+ e.printStackTrace();
}
- num++;
+ Short send;
+ if (position.equals("0")) {
+ send = 0;
+ } else {
+ send = 1;
+ }
+ S7controlLK.getinstance().WriteWord("DB17.38", (short) send);
}
- if (num == north_glass_buffer1s.size()) {
- north_Glass_Buffer1Service.AddOutSliceS(Plchome.FrameNo);
- } else {
- Plchome.AluminumFrame = north_glass_buffer1s;
+ }
+
+ // 鑾峰彇褰撳墠鎵爜鏂瑰紡
+ List<Boolean> Scanningmethods = S7control.getinstance().ReadBits("DB101.11.4", 1);
+ if (Scanningmethods != null) {
+ for (Boolean Scanningmethod : Scanningmethods) {
+ jsonObject.append("Scanningmethod", Scanningmethod);
}
- } catch (SQLException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ }
+ // 鑾峰彇褰撳墠鎵爜鏋幓鐠僫d
+ String CurrrentGlassId = spianService.queGlassid("DB103.256", 14).toString();
+ jsonObject.append("CurrrentGlassId", CurrrentGlassId);
+
+ // 鑾峰彇D01-D06,A01,A02,B01,B02鐘舵��
+ List<Short> DeviceList = S7control.getinstance().ReadWord("DB103.0", 10);
+ jsonObject.append("DeviceList", DeviceList);
+ // 鑾峰彇D01-D06,A01,A02,B01,B02鐜荤拑id
+ List<String> GlassIdList = new ArrayList<String>();
+ GlassIdList.add(spianService.queGlassid("DB103.44", 14).toString());
+ GlassIdList.add(spianService.queGlassid("DB103.58", 14).toString());
+
+ GlassIdList.add(spianService.queGlassid("DB103.184", 14).toString());
+ GlassIdList.add(spianService.queGlassid("DB103.212", 14).toString());
+
+ GlassIdList.add(spianService.queGlassid("DB103.128", 14).toString());
+ GlassIdList.add(spianService.queGlassid("DB103.142", 14).toString());
+ GlassIdList.add(spianService.queGlassid("DB103.156", 14).toString());
+
+ GlassIdList.add(spianService.queGlassid("DB103.72", 14).toString());
+ GlassIdList.add(spianService.queGlassid("DB103.86", 14).toString());
+ GlassIdList.add(spianService.queGlassid("DB103.100", 14).toString());
+ GlassIdList.add(spianService.queGlassid("DB103.114", 14).toString());
+ jsonObject.append("GlassIdList", GlassIdList);
+
+ // 璇诲幓Plc杩涚墖杞︿笌鍑虹墖杞︿綅缃甒
+ List<String> addressList = new ArrayList<String>();
+ addressList.add("DB106.12");
+ addressList.add("DB106.0");
+ List<Short> paramlist = S7control.getinstance().ReadWord(addressList);
+ if (paramlist != null) {
+ jsonObject.append("params", paramlist);
+ }
+ // 鑾峰彇杩涚墖杞︾姸鎬�
+ List<Short> datas1ListState = S7control.getinstance().ReadWord("DB106.8",
+ 1);// 鑾峰彇杩涚墖杞︾姸鎬�
+ if (datas1ListState != null) {
+ boolean exist1 = datas1ListState.contains((short) 0);
+ jsonObject.append("zhuangtai", exist1);
+ }
+
+ // 鑾峰彇杩涚墖鐜荤拑淇℃伅
+ List<Short> inglassInfo = S7control.getinstance().ReadWord("DB106.24", 1);
+ if (inglassInfo != null) {
+ if (inglassInfo.size() > 0) {
+ jsonObject.append("loadglassheight", inglassInfo.get(0) * 70);
+ }
+ }
+ // // 鑾峰彇閾濇idDB106.DBW64锛屾坊鍔犲埌鍑虹墖闃熷垪
+ // String frameno="X21763329601FB";
+ String frameno = spianService.queGlassid("DB103.270", 14).toString();
+ if (!frameno.equals(Plchome.FrameNo)) {
+ Plchome.FrameNo = frameno;
+ try {
+ Short num = 0;
+ List<north_glass_buffer1> north_glass_buffer1s = north_Glass_Buffer1Service
+ .SelectAluminumFrameInfoById(Plchome.FrameNo);
+ for (north_glass_buffer1 north_glass_buffer1 : north_glass_buffer1s) {
+ if (north_glass_buffer1.getstorageCage() == null) {
+ break;
+ }
+ num++;
+ }
+ if (num == north_glass_buffer1s.size()) {
+ north_Glass_Buffer1Service.AddOutSliceS(Plchome.FrameNo);
+ } else {
+ Plchome.AluminumFrame = north_glass_buffer1s;
+ }
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ if (AluminumFrame != null) {
+ jsonObject.append("AluminumFrame", AluminumFrame);
+ }
+
+ // 澶嶄綅鍊掕鏃�
+ // 鍦板潃104.9.6
+ List<Boolean> countdown = S7control.getinstance().ReadBits("DB104.9.6", 1);
+ for (Boolean countdowns : countdown) {
+ jsonObject.append("countdown", countdowns);
+ }
+ // jsonObject.append("countdown", true);
+ // 澶嶄綅瀹屾垚淇″彿ss
+ List<Boolean> resetss = S7control.getinstance().ReadBits("DB103.284", 1);
+ for (Boolean reset : resetss) {
+ jsonObject.append("reset", reset);
+ }
+
+ // 鏄惁鎬ュ仠
+ List<Boolean> emergencystops = S7control.getinstance().ReadBits("DB104.5.1", 1);
+ for (Boolean emergencystop : emergencystops) {
+ jsonObject.append("emergencystop", emergencystop);
+ }
+ // 鑾峰彇杩涚墖璇锋眰鐘舵��
+ List<Short> D01Request = S7control.getinstance().ReadWord("DB106.24", 1);
+ boolean D01RequestState = D01Request.contains((short) 1);
+ jsonObject.append("D01RequestState", D01RequestState);
+
+ // 鑾峰彇杩涚墖鍙戦�佺姸鎬�
+ List<Short> D01respnse = S7control.getinstance().ReadWord("DB106.16", 1);
+ boolean D01ResponseState = D01respnse.contains((short) 1);
+ // jsonObject.append("D01RequestState", D01RequestState);
+ // 鑷姩杩涚墖
+ if ((form3.getglassheight() < 380 || form3.getglasswidth() < 390 || form3.getglassheight() > 1810
+ || form3.getglasswidth() > 2760)
+ || (form3.getglassheight() < 390 || form3.getglasswidth() < 380
+ || form3.getglassheight() > 2760 || form3.getglasswidth() > 1810)) {
+
+ if (isConfirm == true && D01RequestState == true && D01ResponseState == false) {
+ storageCageService.InsertQueueGlassId((short) 1, form3);
+ }
}
}
- if (AluminumFrame != null) {
- jsonObject.append("AluminumFrame", AluminumFrame);
- }
-
- // 鑾峰彇杩涚墖璇锋眰鐘舵��
- List<Short> D01Request = S7control.getinstance().ReadWord("DB106.24", 1);
- boolean D01RequestState = D01Request.contains((short) 1);
- // boolean D01RequestState =true;
- jsonObject.append("D01RequestState", D01RequestState);
-
- // 澶嶄綅鍊掕鏃�
- // 鍦板潃104.9.6
- List<Boolean> countdown = S7control.getinstance().ReadBits("DB104.9.6", 1);
- for (Boolean countdowns : countdown) {
- jsonObject.append("countdown", countdowns);
- }
- // jsonObject.append("countdown", true);
- // 澶嶄綅瀹屾垚淇″彿ss
- List<Boolean> resetss = S7control.getinstance().ReadBits("DB103.284", 1);
- for (Boolean reset : resetss) {
- jsonObject.append("reset", reset);
- }
-
- // 鏄惁鎬ュ仠
- List<Boolean> emergencystops = S7control.getinstance().ReadBits("DB104.5.1", 1);
- for (Boolean emergencystop : emergencystops) {
- jsonObject.append("emergencystop", emergencystop);
- }
- }
} catch (InterruptedException e) {
e.printStackTrace();
}
-
-
-
boolean dbconnected = false;
try {
dbserve.getConn();
diff --git a/springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java b/springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java
index ca448cd..c7a5a08 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java
@@ -274,24 +274,8 @@
// 鎵嬪姩娣诲姞鎵爜浣嶇幓鐠�
@PostMapping("/InsertQueueGlassId")
public Result InsertQueueGlassId(Short id, @RequestBody Queue queue) {
- Map<String, Object> map = new HashMap<>();
- Short zhi=200;
- short result = homeMapper.SelectStorageByGlassId(queue.getglassId());
- if (result > 0) {
- map.put("message", "300");
- } else {
-
- if (id == 1) {
- // 璋冪敤浼嶅瓨鍌ㄨ繃绋�
- zhi=spianService.selectAll(queue.getglassId());
- if(zhi==200){
- homeMapper.InsertQueueGlassId(queue, id);
- }
- }
-
- map.put("message",zhi);
- }
- return Result.success(map);
+ return storageCageService.InsertQueueGlassId(id, queue);
+
}
// 纭鎵爜浣嶇幓鐠冧俊鎭�
diff --git a/springboot-vue3/src/main/java/com/example/springboot/entity/device/PlcParameterObject.java b/springboot-vue3/src/main/java/com/example/springboot/entity/device/PlcParameterObject.java
index 422e8db..dec12e4 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/entity/device/PlcParameterObject.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/entity/device/PlcParameterObject.java
@@ -139,14 +139,15 @@
*/
public void setPlcParameterList(byte[] plcValueArray) {
if (plcParameterList != null) {
+
for (PlcParameterInfo plcParameterInfo : plcParameterList) {
+
byte[] valueList = new byte[plcParameterInfo.getAddressLength()];
// System.out.println(plcParameterInfo.getAddressLength());
for (int i = 0; i < plcParameterInfo.getAddressLength(); i++) {
Array.setByte(valueList, i, plcValueArray[plcParameterInfo.getAddressIndex() + i]);
-
}
if (plcParameterInfo.getAddressLength()==2) {
diff --git a/springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java b/springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java
index c81c75c..f85627b 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java
@@ -216,7 +216,7 @@
Out_slice SelectCurrentFrame();
//鏍规嵁鐜荤拑id鏌ヨ浠诲姟淇℃伅
- @Select("select task_type from storage_task where glass_id=#{glassid} and task_state!=2")
+ @Select("select task_type from storage_task where glass_id=#{glassid} and task_state!=1")
Short SelectTaskByGlassId(String glassid);
//淇敼鏍煎瓙瀹藉害
diff --git a/springboot-vue3/src/main/java/com/example/springboot/service/SpianService.java b/springboot-vue3/src/main/java/com/example/springboot/service/SpianService.java
index 74c092d..2988da2 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/service/SpianService.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/service/SpianService.java
@@ -117,6 +117,11 @@
int qidong2 = 0;
if (qidong == true) {
qidong2 = 1;
+ }else{
+ while (qidong) {
+ S7control.getinstance().WriteWord("DB105.16", (short) 1);// 鍑虹墖浠诲姟鍙戦�佸瓧鏀逛负1
+ qidong = listbool("DB105.16");
+ }
}
spianMapper.Inserttask(0, 0, 1000, ids, glassid.toString(), prctier,qidong2);// 鏂板浠诲姟
System.out.println("杩涚墖浠诲姟|" + datas);
@@ -193,6 +198,11 @@
int qidong2 = 0;
if (qidong == true) {
qidong2 = 1;
+ }else{
+ while (qidong) {
+ S7control.getinstance().WriteWord("DB105.18", (short) 1);// 鍑虹墖浠诲姟鍙戦�佸瓧鏀逛负1
+ qidong = listbool("DB105.18");
+ }
}
spianMapper.Inserttask(1, 0, cageout.getId(), 1000, glassid, state, qidong2);// 鏂板浠诲姟
outmesid(glassid, "DB105.34");// 娲惧彂鍑虹墖ID
@@ -221,6 +231,11 @@
int qidong2 = 0;
if (qidong == true) {
qidong2 = 1;
+ }else{
+ while (qidong) {
+ S7control.getinstance().WriteWord("DB105.18", (short) 1);// 鍑虹墖浠诲姟鍙戦�佸瓧鏀逛负1
+ qidong = listbool("DB105.18");
+ }
}
spianMapper.Inserttask(1, 0, cageout.getId(), 1000, glassid, 1, qidong2);// 鏂板浠诲姟
return (200);// 缁撴潫
@@ -259,6 +274,11 @@
int qidong2 = 0;
if (qidong == true) {
qidong2 = 1;
+ }else{
+ while (qidong) {
+ S7control.getinstance().WriteWord("DB105.18", (short) 1);// 鍑虹墖浠诲姟鍙戦�佸瓧鏀逛负1
+ qidong = listbool("DB105.18");
+ }
}
spianMapper.Inserttask(2, 0, cageout.getId(), ids, glassids, 2, qidong2);// 鏂板璋冨害浠诲姟
@@ -291,6 +311,11 @@
int qidong2 = 2;
if (qidong == true) {
qidong2 = 1;
+ }else{
+ while (qidong) {
+ S7control.getinstance().WriteWord("DB105.18", (short) 1);// 鍑虹墖浠诲姟鍙戦�佸瓧鏀逛负1
+ qidong = listbool("DB105.18");
+ }
}
spianMapper.Inserttask(2, 0, cageout.getId() + 1, ids, glassids, 2, qidong2);// 鏂板璋冨害浠诲姟
spianMapper.UpdateDBCage(ids, cage, cell, 2);// 灏嗗師鏍煎瓙鏁版嵁鏇存柊鍒版柊鏍煎瓙閲�
diff --git a/springboot-vue3/src/main/java/com/example/springboot/service/StorageCageService.java b/springboot-vue3/src/main/java/com/example/springboot/service/StorageCageService.java
index 619fd1b..cbbb948 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/service/StorageCageService.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/service/StorageCageService.java
@@ -9,7 +9,9 @@
import org.springframework.stereotype.Service;
import com.example.springboot.common.Result;
+import com.example.springboot.component.Plchome;
import com.example.springboot.component.S7control;
+import com.example.springboot.entity.Queue;
import com.example.springboot.entity.StorageCage;
import com.example.springboot.entity.StorageTask;
import com.example.springboot.mapper.HomeMapper;
@@ -36,15 +38,16 @@
List<StorageTask> cageList = homeMapper.SelectTaskByState(types);
for (StorageTask storageTask : cageList) {
// 鍒ゆ柇鍑虹墖浠诲姟浣嶇疆骞舵竻闄ゅ搴旂幓鐠僫d
- if ((storageTask.getGlassId().equals(A01glassid1)|| storageTask.getGlassId().equals(A01glassid2))&&DeviceList.get(4)==0) {
+ if ((storageTask.getGlassId().equals(A01glassid1) || storageTask.getGlassId().equals(A01glassid2))
+ && DeviceList.get(4) == 0) {
outSliceServive.StopTask(storageTask.getGlassId(), types);
ClearGlassId("DB101.10.0");
- }
- if (storageTask.getGlassId().equals(B01glassid)&&DeviceList.get(2)==0) {
+ }
+ if (storageTask.getGlassId().equals(B01glassid) && DeviceList.get(2) == 0) {
outSliceServive.StopTask(storageTask.getGlassId(), types);
ClearGlassId("DB101.10.2");
- }
- if (storageTask.getGlassId().equals(B02glassid)&&DeviceList.get(3)==0) {
+ }
+ if (storageTask.getGlassId().equals(B02glassid) && DeviceList.get(3) == 0) {
ClearGlassId("DB101.10.3");
outSliceServive.StopTask(storageTask.getGlassId(), types);
}
@@ -53,34 +56,34 @@
} else {// 缁堟鍑虹墖浠诲姟
List<StorageTask> cageLists = homeMapper.SelectTaskByState(types);
List<StorageTask> cageList2 = homeMapper.SelectTaskByState(2);
- if (cageList2.size()>0) {
+ if (cageList2.size() > 0) {
cageLists.add(cageList2.get(0));
}
for (StorageTask cageList : cageLists) {
if (cageList.getTaskType().equals("1")) {
System.out.println(DeviceList.get(5));
- if(cageList.getGlassId().equals(A02glassid1)&&DeviceList.get(5)==0){
+ if (cageList.getGlassId().equals(A02glassid1) && DeviceList.get(5) == 0) {
outSliceServive.StopTask(cageList.getGlassId(), types);
ClearGlassId("DB101.10.1");
}
- if(cageList.getGlassId().equals(B01glassid)&&DeviceList.get(2)==0){
+ if (cageList.getGlassId().equals(B01glassid) && DeviceList.get(2) == 0) {
outSliceServive.StopTask(cageList.getGlassId(), types);
ClearGlassId("DB101.10.2");
}
- if(cageList.getGlassId().equals(B02glassid)&&DeviceList.get(3)==0){
+ if (cageList.getGlassId().equals(B02glassid) && DeviceList.get(3) == 0) {
outSliceServive.StopTask(cageList.getGlassId(), types);
ClearGlassId("DB101.10.3");
}
- }else if (cageList.getTaskType().equals("2")) {
- if(cageList.getGlassId().equals(A02glassid1)&&DeviceList.get(5)==0){
+ } else if (cageList.getTaskType().equals("2")) {
+ if (cageList.getGlassId().equals(A02glassid1) && DeviceList.get(5) == 0) {
outSliceServive.StopTask(cageList.getGlassId(), 2);
ClearGlassId("DB101.10.1");
}
- if(cageList.getGlassId().equals(B01glassid)&&DeviceList.get(2)==0){
+ if (cageList.getGlassId().equals(B01glassid) && DeviceList.get(2) == 0) {
outSliceServive.StopTask(cageList.getGlassId(), 2);
ClearGlassId("DB101.10.2");
}
- if(cageList.getGlassId().equals(B02glassid)&&DeviceList.get(3)==0){
+ if (cageList.getGlassId().equals(B02glassid) && DeviceList.get(3) == 0) {
outSliceServive.StopTask(cageList.getGlassId(), 2);
ClearGlassId("DB101.10.3");
}
@@ -89,28 +92,29 @@
// List<StorageCage> storageCages = homeMapper.selectinout(3);
// for (StorageCage storageCage : storageCages) {
- // List<StorageCage> storageCagess = homeMapper.SelectStoragesGlassById(storageCage.getGlassId());
+ // List<StorageCage> storageCagess =
+ // homeMapper.SelectStoragesGlassById(storageCage.getGlassId());
- // for (StorageCage storageCagez : storageCagess) {
+ // for (StorageCage storageCagez : storageCagess) {
- // if (storageCagez.getState().equals("2")) {// 璋冩嫧杩涚墖
- // outSliceServive.StopTask(storageCagez.getGlassId(), 0);
- // } else {// 鍑虹墖
- // outSliceServive.StopTask(storageCagez.getGlassId(), types);
- // }
+ // if (storageCagez.getState().equals("2")) {// 璋冩嫧杩涚墖
+ // outSliceServive.StopTask(storageCagez.getGlassId(), 0);
+ // } else {// 鍑虹墖
+ // outSliceServive.StopTask(storageCagez.getGlassId(), types);
+ // }
- // // 鍒ゆ柇鍑虹墖浠诲姟浣嶇疆骞舵竻闄ゅ搴旂幓鐠僫d
- // if (storageCagez.getGlassId() == A02glassid1&&DeviceList.get(5)==0) {
- // outSliceServive.StopTask(storageCagez.getGlassId(), types);
- // ClearGlassId("DB101.10.1");
- // } else if (storageCagez.getGlassId() == B01glassid&&DeviceList.get(2)==0) {
- // outSliceServive.StopTask(storageCagez.getGlassId(), types);
- // ClearGlassId("DB101.10.2");
- // } else if (storageCagez.getGlassId() == B02glassid&&DeviceList.get(3)==0) {
- // ClearGlassId("DB101.10.3");
- // outSliceServive.StopTask(storageCagez.getGlassId(), types);
- // }
- // }
+ // // 鍒ゆ柇鍑虹墖浠诲姟浣嶇疆骞舵竻闄ゅ搴旂幓鐠僫d
+ // if (storageCagez.getGlassId() == A02glassid1&&DeviceList.get(5)==0) {
+ // outSliceServive.StopTask(storageCagez.getGlassId(), types);
+ // ClearGlassId("DB101.10.1");
+ // } else if (storageCagez.getGlassId() == B01glassid&&DeviceList.get(2)==0) {
+ // outSliceServive.StopTask(storageCagez.getGlassId(), types);
+ // ClearGlassId("DB101.10.2");
+ // } else if (storageCagez.getGlassId() == B02glassid&&DeviceList.get(3)==0) {
+ // ClearGlassId("DB101.10.3");
+ // outSliceServive.StopTask(storageCagez.getGlassId(), types);
+ // }
+ // }
// }
}
}
@@ -175,4 +179,29 @@
return Result.success(map);
}
+ public Result InsertQueueGlassId(Short id, Queue queue) {
+ Map<String, Object> map = new HashMap<>();
+ if (Plchome.FeedState == false) {
+ Plchome.FeedState = true;
+ Short zhi = 200;
+ short result = homeMapper.SelectStorageByGlassId(queue.getglassId());
+ if (result > 0) {
+ map.put("message", "300");
+ } else {
+ if (id == 1) {
+ // 璋冪敤浼嶅瓨鍌ㄨ繃绋�
+ zhi = spianService.selectAll(queue.getglassId());
+ if (zhi == 200) {
+ homeMapper.InsertQueueGlassId(queue, id);
+ }
+ }
+ map.put("message", zhi);
+ }
+ Plchome.FeedState = false;
+ } else {
+ map.put("message", 200);
+ }
+ return Result.success(map);
+ }
+
}
diff --git a/springboot-vue3/src/main/resources/JsonFile/PlcMes.json b/springboot-vue3/src/main/resources/JsonFile/PlcMes.json
new file mode 100644
index 0000000..25a48d6
--- /dev/null
+++ b/springboot-vue3/src/main/resources/JsonFile/PlcMes.json
@@ -0,0 +1,107 @@
+{
+ "plcAddressBegin":"DB105.0",
+ "plcAddressLenght":"52",
+ "dataType":"word",
+ "parameteInfor":[
+ {
+ "codeId": "AddStart",
+ "addressIndex":"0",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "Addgoal",
+ "addressIndex":"2",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "AddLength",
+ "addressIndex":"4",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "AddWidth",
+ "addressIndex":"6",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm/S"
+ },
+ {
+ "codeId": "AddCount",
+ "addressIndex":"8",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm/S"
+ },
+ {
+ "codeId": "OutStart",
+ "addressIndex":"10",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm/S"
+ },
+ {
+ "codeId": "Outgoal",
+ "addressIndex":"12",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm/S"
+ },
+ {
+ "codeId": "OutCount",
+ "addressIndex":"14",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm/S"
+ },
+ {
+ "codeId": "AddActivate",
+ "addressIndex":"16",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm/S"
+ },
+ {
+ "codeId": "OutActivate",
+ "addressIndex":"18",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm/S"
+ },
+ {
+ "codeId": "FeedID",
+ "addressIndex":"20",
+ "addressLenght":"14",
+ "ratio":"1",
+ "unit":"mm/S"
+ },
+ {
+ "codeId": "ReleaseID",
+ "addressIndex":"34",
+ "addressLenght":"14",
+ "ratio":"1",
+ "unit":"mm/S"
+ },
+ {
+ "codeId": "B01report",
+ "addressIndex":"48",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm/S"
+ },
+ {
+ "codeId": "B02report",
+ "addressIndex":"50",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ }
+
+
+ ]
+}
diff --git a/springboot-vue3/src/main/resources/JsonFile/PlcRead.json b/springboot-vue3/src/main/resources/JsonFile/PlcRead.json
new file mode 100644
index 0000000..f3ebb33
--- /dev/null
+++ b/springboot-vue3/src/main/resources/JsonFile/PlcRead.json
@@ -0,0 +1,195 @@
+{
+ "plcAddressBegin": "DB106.0",
+ "plcAddressLenght": "66",
+ "dataType": "word",
+ "parameteInfor": [{
+ "codeId": "A01Position",
+ "addressIndex": "0",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "A01FlipPosition",
+ "addressIndex": "2",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "A01QuestStartPosition",
+ "addressIndex": "4",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "A01EndPosition",
+ "addressIndex": "6",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "FeedCarStatus",
+ "addressIndex": "8",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "A02QuestOver",
+ "addressIndex": "10",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "A02Position",
+ "addressIndex": "12",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "A02FlipPosition",
+ "addressIndex": "14",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "A02QuestStartPosition",
+ "addressIndex": "16",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "A02EndPosition",
+ "addressIndex": "18",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "ExitCarStatus",
+ "addressIndex": "20",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "A02QuestOver",
+ "addressIndex": "22",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "FeedRequest",
+ "addressIndex": "24",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "FeedID",
+ "addressIndex": "26",
+ "addressLenght":"14",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "B01Position",
+ "addressIndex": "40",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "B01QuestPosition",
+ "addressIndex": "42",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "B01CurrentTaskMode",
+ "addressIndex": "44",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "B01CarStatus",
+ "addressIndex": "46",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "B01CarTaskStatus",
+ "addressIndex": "48",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "B02Position",
+ "addressIndex": "50",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "B02CarCurrentTask",
+ "addressIndex": "52",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "B02CurrentTaskMode",
+ "addressIndex": "54",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "B02CarStatus",
+ "addressIndex": "56",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "B02CarSaskStatus",
+ "addressIndex": "58",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "B01CompleteTheReport",
+ "addressIndex": "60",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "B02CompleteTheReport",
+ "addressIndex": "62",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "OutRequest",
+ "addressIndex": "64",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/springboot-vue3/src/main/resources/JsonFile/Plcframe.json b/springboot-vue3/src/main/resources/JsonFile/Plcframe.json
new file mode 100644
index 0000000..c270227
--- /dev/null
+++ b/springboot-vue3/src/main/resources/JsonFile/Plcframe.json
@@ -0,0 +1,51 @@
+{
+ "plcAddressBegin":"DB17.0",
+ "plcAddressLenght":"40",
+ "dataType":"word",
+ "parameteInfor":[
+ {
+ "codeId": "E01id",
+ "addressIndex":"0",
+ "addressLenght":"14",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "E01Quest",
+ "addressIndex":"16",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "E01Reply",
+ "addressIndex":"18",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "J01Quest",
+ "addressIndex":"20",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm/S"
+ },
+ {
+ "codeId": "J01id",
+ "addressIndex":"22",
+ "addressLenght":"14",
+ "ratio":"1",
+ "unit":"mm/S"
+ },
+ {
+ "codeId": "J01TurnGo",
+ "addressIndex":"38",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm/S"
+ }
+
+
+ ]
+}
diff --git a/src/main/java/com/canadames/controller/device/DeviceController.java b/src/main/java/com/canadames/controller/device/DeviceController.java
new file mode 100644
index 0000000..764defe
--- /dev/null
+++ b/src/main/java/com/canadames/controller/device/DeviceController.java
@@ -0,0 +1,20 @@
+package com.canadames.controller.device;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 鍓嶇鎺у埗鍣�
+ * </p>
+ *
+ * @author yyq
+ * @since 2024-01-17
+ */
+@RestController
+@RequestMapping("/device-entity")
+public class DeviceController {
+
+}
diff --git a/src/main/java/com/canadames/entity/device/DeviceEntity.java b/src/main/java/com/canadames/entity/device/DeviceEntity.java
new file mode 100644
index 0000000..c9d3d12
--- /dev/null
+++ b/src/main/java/com/canadames/entity/device/DeviceEntity.java
@@ -0,0 +1,61 @@
+package com.canadames.entity.device;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author yyq
+ * @since 2024-01-17
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("device")
+@ApiModel(value="DeviceEntity瀵硅薄", description="")
+public class DeviceEntity implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private String deviceId;
+
+ private String createUser;
+
+ private LocalDateTime createTime;
+
+ private String deviceName;
+
+ private String status;
+
+ private String info;
+
+ private String model;
+
+ private LocalDateTime countTimeFlag;
+
+ private String address;
+
+ private String gps;
+
+ private LocalDate debugTime;
+
+ private LocalDate endTime;
+
+ private String customerName;
+
+ private String customerDeviceName;
+
+ private LocalDate lastProductCountDate;
+
+
+}
diff --git a/src/main/java/com/canadames/mapper/device/DeviceDao.java b/src/main/java/com/canadames/mapper/device/DeviceDao.java
new file mode 100644
index 0000000..29ddbc7
--- /dev/null
+++ b/src/main/java/com/canadames/mapper/device/DeviceDao.java
@@ -0,0 +1,16 @@
+package com.canadames.mapper.device;
+
+import com.canadames.entity.device.DeviceEntity;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * Mapper 鎺ュ彛
+ * </p>
+ *
+ * @author yyq
+ * @since 2024-01-17
+ */
+public interface DeviceDao extends BaseMapper<DeviceEntity> {
+
+}
diff --git a/src/main/java/com/canadames/service/device/DeviceService.java b/src/main/java/com/canadames/service/device/DeviceService.java
new file mode 100644
index 0000000..ee32c88
--- /dev/null
+++ b/src/main/java/com/canadames/service/device/DeviceService.java
@@ -0,0 +1,16 @@
+package com.canadames.service.device;
+
+import com.canadames.entity.device.DeviceEntity;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 鏈嶅姟绫�
+ * </p>
+ *
+ * @author yyq
+ * @since 2024-01-17
+ */
+public interface DeviceService extends IService<DeviceEntity> {
+
+}
diff --git a/src/main/java/com/canadames/service/device/impl/DeviceServiceImpl.java b/src/main/java/com/canadames/service/device/impl/DeviceServiceImpl.java
new file mode 100644
index 0000000..7aefa58
--- /dev/null
+++ b/src/main/java/com/canadames/service/device/impl/DeviceServiceImpl.java
@@ -0,0 +1,20 @@
+package com.canadames.service.device.impl;
+
+import com.canadames.entity.device.DeviceEntity;
+import com.canadames.mapper.device.DeviceDao;
+import com.canadames.service.device.DeviceService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 鏈嶅姟瀹炵幇绫�
+ * </p>
+ *
+ * @author yyq
+ * @since 2024-01-17
+ */
+@Service
+public class DeviceServiceImpl extends ServiceImpl<DeviceDao, DeviceEntity> implements DeviceService {
+
+}
diff --git a/src/main/resources/mapper/device/DeviceEntityMapper.xml b/src/main/resources/mapper/device/DeviceEntityMapper.xml
new file mode 100644
index 0000000..71c82ba
--- /dev/null
+++ b/src/main/resources/mapper/device/DeviceEntityMapper.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.canadames.mapper.device.DeviceDao">
+
+</mapper>
--
Gitblit v1.8.0