Merge branch 'master' of http://10.153.19.25:10101/r/HangZhouMes
| | |
| | | <script setup> |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import {reactive} from "vue"; |
| | | import {reactive, onMounted} from "vue"; |
| | | import {useRouter} from "vue-router" |
| | | const router = useRouter() |
| | | |
| | | const dialogFormVisiblea = ref(false) |
| | | import { ref } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import Landingindication from "./Landingindication.vue"; |
| | | import Landingindicationtwo from "./Landingindicationtwo.vue"; |
| | | import unloadrequest from "@/utils/unloadrequest"; |
| | | const dialogFormVisiblea = ref(false) |
| | | |
| | | const tableData = [ |
| | | { |
| | | id: '1', |
| | | long: '1005', |
| | | wide: '183.6', |
| | | thick: '1991', |
| | | state: '未启用', |
| | | }, |
| | | { |
| | | id: '2', |
| | | long: '105', |
| | | wide: '183', |
| | | thick: '191', |
| | | state: '未启用' |
| | | }, |
| | | { |
| | | id: '3', |
| | | long: '105', |
| | | wide: '183', |
| | | thick: '191', |
| | | state: '未启用' |
| | | }, |
| | | { |
| | | id: '4', |
| | | long: '105', |
| | | wide: '183', |
| | | thick: '191', |
| | | state: '未启用' |
| | | }, |
| | | { |
| | | id: '5', |
| | | long: '105', |
| | | wide: '183', |
| | | thick: '191', |
| | | state: '未启用' |
| | | }, |
| | | ] |
| | | |
| | | |
| | | const dialogFormVisiblea2 = ref(false) |
| | | |
| | | |
| | | const tableData = reactive([]); |
| | | |
| | | |
| | | let socket; |
| | | |
| | | |
| | | const initWebSocket = (token) =>{ //初始化we |
| | | |
| | | let viewname = "unloadglass"; |
| | | |
| | | if (typeof WebSocket === "undefined") { |
| | | console.log("您的浏览器不支持WebSocket"); |
| | | } else { |
| | | let socketUrl = "ws://" + "localhost"+":88" + "/api/unLoadGlass/api/talk/" + viewname; |
| | | if (socket != null) { |
| | | socket.close(); |
| | | socket = null; |
| | | } |
| | | |
| | | // 开启一个websocket服务 |
| | | socket = new WebSocket(socketUrl); |
| | | |
| | | // 打开事件 |
| | | socket.onopen = function () { |
| | | console.log("websocket已打开"); |
| | | }; |
| | | |
| | | |
| | | |
| | | socket.onmessage = (msg) => { |
| | | if (!msg.data) { |
| | | return; // 如果收到空数据,则直接返回,不执行后续逻辑 |
| | | } |
| | | |
| | | |
| | | |
| | | let obj = JSON.parse(msg.data); |
| | | |
| | | |
| | | console.log('收到消息:', obj.data); |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | // 数据 |
| | | const loading = ref(false); |
| | | |
| | | |
| | | // 弹框显示控制 |
| | | |
| | | const dialogFormVisible = ref(false); |
| | | |
| | | // 表单数据 |
| | | const workstationId = ref(''); |
| | | const flowCardId = ref(''); |
| | | const flowCardOptions = ref([]); |
| | | |
| | | |
| | | // 方法 |
| | | const handleSelectionChange = () => { |
| | | // 处理表格行选择事件 |
| | | }; |
| | | |
| | | const handleBindRack = (row) => { |
| | | workstationId.value = row.workstationId; // 假设rackNumber是架号字段的属性名 |
| | | |
| | | // 发起接口请求获取流程卡号 |
| | | fetchFlowCardId(); |
| | | |
| | | |
| | | dialogFormVisiblea.value = true; // 打开绑定架子对话框 |
| | | }; |
| | | |
| | | |
| | | |
| | | //获取流程卡号 |
| | | const fetchFlowCardId = async () => { |
| | | try { |
| | | const response = await unloadrequest.get('/api/downWorkstation/getflowCardId'); |
| | | console.log(response) |
| | | if (response.code === 200) { |
| | | flowCardOptions.value = response.data.map(item => ({ flowcard_id: item.flowcard_id })); |
| | | } else { |
| | | ElMessage.error(response.msg); |
| | | } |
| | | } catch (error) { |
| | | console.error(error); |
| | | } |
| | | }; |
| | | //确认 |
| | | const handleConfirm = async () => { |
| | | try { |
| | | const response = await unloadrequest.post('/api/downWorkstation/updateFlowCardId', { |
| | | workstationId: workstationId.value, |
| | | flowCardId: flowCardId.value |
| | | }); |
| | | |
| | | console.log(response) |
| | | if (response.code == 200) { |
| | | // 绑定成功,处理逻辑 |
| | | console.log('绑定成功'); |
| | | ElMessage.success(response.message); |
| | | dialogFormVisiblea.value = false; |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | | } |
| | | } catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | const handleBindRack2 = (row) => { |
| | | workstationId.value = row.workstationId; // 假设rackNumber是架号字段的属性名 |
| | | |
| | | |
| | | |
| | | |
| | | dialogFormVisiblea2.value = true; // 打开绑定架子对话框 |
| | | }; |
| | | //清除内容 |
| | | const handleclear = async () => { |
| | | try { |
| | | const response = await unloadrequest.post('/api/downWorkstation/clear', { |
| | | workstationId: workstationId.value, |
| | | }); |
| | | |
| | | console.log(response); |
| | | |
| | | if (response.code === 200) { |
| | | // 清除成功的逻辑 |
| | | console.log('清除成功'); |
| | | ElMessage.success(response.message); |
| | | dialogFormVisiblea2.value = false; |
| | | } else if (response.code === 400) { |
| | | // 清除失败的逻辑 |
| | | console.log('清除失败'); |
| | | console.log(response.message); // 打印服务器返回的错误信息 |
| | | ElMessage.error(response.message); |
| | | dialogFormVisiblea2.value = false; |
| | | } |
| | | } catch (error) { |
| | | // console.log(error); |
| | | ElMessage.error("清除失败"); |
| | | dialogFormVisiblea2.value = false; |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // 发送获取表格数据的请求 |
| | | const fetchTableData = async () => { |
| | | try { |
| | | // 发送获取表格数据的请求,并等待响应 |
| | | const response = await unloadrequest.get('/api/downWorkstation/getone'); |
| | | |
| | | // 检查响应状态 |
| | | if (response.code === 200) { |
| | | // 更新表格数据 |
| | | console.log('成功获取表格数据:', response.data); |
| | | tableData.splice(0, tableData.length, ...response.data); |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.msg); |
| | | } |
| | | } catch (error) { |
| | | // 处理请求失败的情况 |
| | | ElMessage.error('获取表格数据失败,请重试'); |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | initWebSocket(); |
| | | onMounted(fetchTableData); |
| | | //setInterval(fetchTableData, 2000) |
| | | |
| | | const open = () => { |
| | | ElMessageBox.confirm( |
| | | '是否删除该条信息?', |
| | |
| | | } |
| | | } |
| | | |
| | | const dialogForm = () => { |
| | | ElMessageBox.confirm( |
| | | '是否清空该条信息?', |
| | | '提示', |
| | | { |
| | | confirmButtonText: '是', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | } |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | |
| | | ], |
| | | }) |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | <el-table height="100%" ref="table" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="id" align="center" label="下片位" min-width="80" /> |
| | | <el-table-column prop="long" align="center" label="架号" min-width="120" /> |
| | | <el-table-column prop="wide" align="center" label="流程卡号" min-width="120" /> |
| | | <el-table-column prop="wide" align="center" label="总数量" min-width="120" /> |
| | | <el-table-column prop="wide" align="center" label="已落架数量" min-width="120" /> |
| | | <el-table-column prop="state" align="center" label="启用状态" min-width="120" /> |
| | | <el-table-column prop="workstationId" align="center" label="下片位" min-width="80" /> |
| | | <el-table-column prop="workstationId" align="center" label="架号" min-width="120" /> |
| | | <el-table-column prop="flowCardId" align="center" label="流程卡号" min-width="120" /> |
| | | <el-table-column prop="totalquantity" align="center" label="总数量" min-width="120" /> |
| | | <el-table-column prop="racksnumber" align="center" label="已落架数量" min-width="120" /> |
| | | <el-table-column prop="work_state" align="center" label="状态" min-width="120" /> |
| | | <el-table-column prop="deviceId" align="center" label="设备号" min-width="120" /> |
| | | <el-table-column prop="enableState" align="center" label="启用状态" min-width="120" /> |
| | | <el-table-column fixed="right" label="操作" align="center" width="200"> |
| | | <template #default> |
| | | <el-button size="mini" type="text" plain v-show="state !== '已启用' " @click="dialogFormVisiblea = true">绑定架子</el-button> |
| | | <el-button size="mini" type="text" plain @click="dialogForm">清空</el-button> |
| | | <template #default="scope"> |
| | | <el-button size="mini" type="text" plain v-show="scope.row.enableState !== '已启用' " @click="handleBindRack(scope.row)">绑定架子</el-button> |
| | | <el-button size="mini" type="text" plain @click="handleBindRack2(scope.row)">清空</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </el-card> |
| | | |
| | | </div> |
| | | <div style="display: flex;"> |
| | | <div id="main-body"> |
| | | <Landingindication></Landingindication> |
| | | </div> |
| | | </div> |
| | | |
| | | <el-dialog v-model="dialogFormVisiblea" top="21vh" width="30%" title="绑定架子" > |
| | | <div style="margin-left: 50px;margin-top: 10px;margin-bottom: 10px;"> |
| | | <el-form size="mini" label-width="150px"> |
| | | <el-form label-width="100px" label-position="right"> |
| | | <el-form-item label="架号:" :required="true" style="width: 18vw"> |
| | | <el-input autocomplete="off"/> |
| | | <el-input v-model="workstationId" autocomplete="off"/> |
| | | </el-form-item> |
| | | <el-form-item label="流程卡号:" :required="true" style="width: 18vw;"> |
| | | <el-input autocomplete="off" /> |
| | | <el-select v-model="flowCardId" placeholder="请选择流程卡号"> |
| | | <el-option v-for="item in flowCardOptions" :key="item.flowcard_id" :label="item.flowcard_id" :value="item.flowcard_id" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-form> |
| | | </div> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="dialogFormVisiblea = false"> |
| | | <el-button type="primary" @click="handleConfirm"> |
| | | 确认 |
| | | </el-button> |
| | | <el-button @click="dialogFormVisiblea = false">取消</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | |
| | | |
| | | |
| | | <el-dialog v-model="dialogFormVisiblea2" top="21vh" width="30%" title="清除架子玻璃" > |
| | | |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="handleclear"> |
| | | 确认 |
| | | </el-button> |
| | | <el-button @click="dialogFormVisiblea2 = false">取消</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | |
| | | <!-- workstationId: '1', |
| | | workstationId: '1005', |
| | | flowCardId: '183.6', |
| | | totalquantity: '1991', |
| | | racksnumber:"1", |
| | | work_state: '待识别', --> |
| | | </div> |
| | | <div style="display: flex;"> |
| | | <div id="main-body"> |
| | | <Landingindication></Landingindication> |
| | | </div> |
| | | <div id="main-bodya"> |
| | | <Landingindicationtwo></Landingindicationtwo> |
| | | </div></div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | |
| | | height: 450px; |
| | | } |
| | | #main-body{ |
| | | margin-top: -20px; |
| | | margin-left: 300px; |
| | | } |
| | | #main-bodya{ |
| | | margin-top: -10px; |
| | | margin-left: 450px; |
| | | margin-left: 100px; |
| | | } |
| | | </style> |
| | |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 127.0.0.1:8848 |
| | | server-addr: 10.153.19.150:8848 |
| | | gateway: |
| | | discovery: |
| | | locator: |
New file |
| | |
| | | package com.mes.common; |
| | | import cn.hutool.json.JSONArray; |
| | | import cn.hutool.json.JSONObject; |
| | | import java.io.BufferedReader; |
| | | import java.io.FileReader; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | public class InitUtil { |
| | | //初始化word |
| | | public static PlcParameterObject initword(String jsonFilePath) { |
| | | try { |
| | | FileReader fileReader = new FileReader(jsonFilePath); |
| | | BufferedReader bufferedReader = new BufferedReader(fileReader); |
| | | |
| | | StringBuilder content = new StringBuilder(); |
| | | String line; |
| | | |
| | | while ((line = bufferedReader.readLine()) != null) { |
| | | content.append(line); |
| | | } |
| | | |
| | | bufferedReader.close(); |
| | | fileReader.close(); |
| | | |
| | | JSONObject jsonfileobj = new JSONObject(content.toString()); |
| | | JSONArray jsonArray = jsonfileobj.getJSONArray("parameteInfor"); |
| | | PlcParameterObject plcParameterObject = new PlcParameterObject(); |
| | | plcParameterObject.setPlcAddressBegin(jsonfileobj.getStr("plcAddressBegin"));//设置起始位地址 |
| | | plcParameterObject.setPlcAddressLength(Integer.valueOf(jsonfileobj.getStr("plcAddressLenght")));//设置地址长度 |
| | | |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject parameterObj = jsonArray.getJSONObject(i); |
| | | PlcParameterInfo plcParameterInfo = new PlcParameterInfo(jsonfileobj.getStr("plcAddressBegin")); //参数实例 |
| | | String codeid = parameterObj.getStr("codeId"); |
| | | plcParameterInfo.setCodeId(codeid); |
| | | plcParameterInfo.setAddressIndex(Integer.valueOf(parameterObj.getStr("addressIndex"))); |
| | | //plcParameterInfo.setRatio(Integer.valueOf(parameterObj.getStr("ratio"))); |
| | | plcParameterInfo.setAddressLength(Integer.valueOf(parameterObj.getStr("addressLenght"))); |
| | | plcParameterInfo.setUnit(parameterObj.getStr("unit")); |
| | | plcParameterObject.addPlcParameter(plcParameterInfo); |
| | | } |
| | | // byte[] getplcvlues = {0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02}; |
| | | // byte[] getplcvlues = S7control.getinstance().ReadByte(plcParameterObject.getPlcAddressBegin(), plcParameterObject.getPlcAddressLength()); |
| | | // plcParameterObject.setPlcParameterList(getplcvlues); |
| | | |
| | | return plcParameterObject; |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | //初始化bit |
| | | public static PlcBitObject initbit(String jsonFilePath) { |
| | | PlcBitObject plcBitObject = new PlcBitObject(); |
| | | |
| | | try { |
| | | FileReader fileReader = new FileReader(jsonFilePath); |
| | | BufferedReader bufferedReader = new BufferedReader(fileReader); |
| | | |
| | | StringBuilder content = new StringBuilder(); |
| | | String line; |
| | | |
| | | while ((line = bufferedReader.readLine()) != null) { |
| | | content.append(line); |
| | | } |
| | | |
| | | bufferedReader.close(); |
| | | fileReader.close(); |
| | | |
| | | JSONObject jsonfileobj = new JSONObject(content.toString()); |
| | | JSONArray jsonArray = jsonfileobj.getJSONArray("parameteInfor"); |
| | | plcBitObject.setPlcAddressBegin(jsonfileobj.getStr("plcAddressBegin"));//设置起始位地址 |
| | | plcBitObject.setPlcAddressLength(Integer.valueOf(jsonfileobj.getStr("plcAddressLenght")));//设置地址长度 |
| | | |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject parameterObj = jsonArray.getJSONObject(i); |
| | | |
| | | PlcBitInfo plcBitInfo = new PlcBitInfo(jsonfileobj.getStr("plcAddressBegin")); //参数实例 |
| | | String codeid = parameterObj.getStr("codeId"); |
| | | plcBitInfo.setCodeId(codeid); |
| | | plcBitInfo.setAddressIndex(Integer.valueOf(parameterObj.getStr("addressIndex"))); |
| | | |
| | | plcBitObject.addPlcBit(plcBitInfo); |
| | | } |
| | | System.out.println(""); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | //Boolean[] values1 = { false, true, true, true, false, false, true, false, |
| | | // false, true ,true }; |
| | | // List<Boolean> getplcvlues = new ArrayList<>(Arrays.asList(values1)); |
| | | |
| | | // List<Boolean> getplcvlues = S7control.getinstance().ReadBits(plcBitObject.getPlcAddressBegin(), plcBitObject.getPlcAddressLength()); |
| | | // plcBitObject.setPlcBitList(getplcvlues); |
| | | return plcBitObject; |
| | | } |
| | | |
| | | // |
| | | public static void readAndUpdateBitValues(PlcBitObject plcBitObject) { |
| | | |
| | | // Boolean[] values1 = { false, true, true, true, false, false, true, false, |
| | | // false, true ,true }; |
| | | // List<Boolean> getplcvlues = new ArrayList<>(Arrays.asList(values1)); |
| | | List<Boolean> getplcvlues = S7object.getinstance().plccontrol.ReadBits(plcBitObject.getPlcAddressBegin(), plcBitObject.getPlcAddressLength()); |
| | | plcBitObject.setPlcBitList(getplcvlues); |
| | | } |
| | | |
| | | |
| | | public static void readAndUpdateWordValues(PlcParameterObject plcParameterObject) { |
| | | |
| | | // byte[] getplcvlues = {0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02}; |
| | | byte[] getplcvlues = S7object.getinstance().plccontrol.ReadByte(plcParameterObject.getPlcAddressBegin(), plcParameterObject.getPlcAddressLength()); |
| | | plcParameterObject.setPlcParameterList(getplcvlues); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.common; |
| | | |
| | | |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import static com.mes.common.InitUtil.readAndUpdateWordValues; |
| | | |
| | | public class PLCAutoMes extends Thread { |
| | | |
| | | // // 用于存储应用程序的配置信息 |
| | | // private Configuration config; |
| | | private static InitUtil initUtil; |
| | | // public static PlcParameterObject PlcMesObject; |
| | | // public static PlcParameterObject PlcReadObject; |
| | | // public static PlcParameterObject PlcframeObject; |
| | | |
| | | // // 创建一个自定义的 S7 控制器消息处理器对象 |
| | | // MessageHandler customS7Control = new MessageHandler(); |
| | | |
| | | // 单例实例 |
| | | private static PLCAutoMes instance; |
| | | // private static String PlcMes = PLCAutoMes.class.getResource("/JsonFile/PlcMes.json").getPath(); |
| | | private static String PlcAlbania = PLCAutoMes.class.getResource("/JsonFile/PlcAlbania.json").getPath(); |
| | | // private static String PlcRead = PLCAutoMes.class.getResource("/JsonFile/PlcRead.json").getPath(); |
| | | // private static String Plcframe = PLCAutoMes.class.getResource("/JsonFile/Plcframe.json").getPath(); |
| | | // private static String PlcParameter = PLCAutomaticParameterSettingReview2.class.getResource("/JsonFile/PlcParameter.json").getPath(); |
| | | |
| | | // private static String PlcSign = PLCAutomaticParameterSettingReview2.class.getResource("/JsonFile/PlcSign.json").getPath(); |
| | | |
| | | // private static String PlcState = PLCAutomaticParameterSettingReview2.class.getResource("/JsonFile/PlcState.json").getPath(); |
| | | |
| | | // private static String PlcAlarm = PLCAutoMes.class.getResource("/JsonFile/PlcAlarm.json").getPath(); |
| | | // private static String PlcTest = PLCAutoMes.class.getResource("/JsonFile/PlcTest.json").getPath(); |
| | | |
| | | // 调用initword方法 |
| | | |
| | | // public static PlcParameterObject plcParameterObject = initUtil.initword(PlcParameter); |
| | | // public static PlcBitObject plcPlcTest = initUtil.initbit(PlcTest); |
| | | // public static PlcBitObject plcBitObject = initUtil.initbit(PlcSign); |
| | | // public static PlcParameterObject plcStateObject= initUtil.initword(PlcState); |
| | | // public static PlcBitObject plcPlcAlarm = initUtil.initbit(PlcAlarm); |
| | | public static PlcParameterObject PlcMesObject = InitUtil.initword(PlcAlbania); |
| | | // public static PlcParameterObject PlcReadObject = initUtil.initword(PlcRead); |
| | | // public static PlcParameterObject PlcframeObject = initUtil.initword(Plcframe); |
| | | |
| | | // 私有构造函数 |
| | | 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(100); |
| | | |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | // System.out.println(jsonFilePath); |
| | | |
| | | //readAndUpdateWordValues(PlcReadObject); |
| | | readAndUpdateWordValues(PlcMesObject); |
| | | //readAndUpdateWordValues(PlcframeObject); |
| | | // 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)); |
| | | |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.mes.common; |
| | | |
| | | |
| | | |
| | | public class PlcBitInfo { |
| | | |
| | | public PlcBitInfo(String startAddress) { |
| | | this.startAddress = startAddress; |
| | | } |
| | | private String startAddress; |
| | | // 参数标识 |
| | | private String codeId; |
| | | |
| | | // 参数名称 |
| | | private String name; |
| | | |
| | | // 读取 参数值 |
| | | private Boolean value; |
| | | // 参数地址 |
| | | private int addressIndex; |
| | | |
| | | public String getCodeId() { |
| | | return this.codeId; |
| | | } |
| | | |
| | | public void setCodeId(String codeId) { |
| | | this.codeId = codeId; |
| | | } |
| | | |
| | | public String getName() { |
| | | return this.name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public Boolean getValue() { |
| | | return this.value; |
| | | } |
| | | |
| | | public void setValue(Boolean value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | |
| | | public int getAddressIndex() { |
| | | return this.addressIndex; |
| | | } |
| | | /** |
| | | * 获取地址 |
| | | * |
| | | * @param index 索引地址 |
| | | */ |
| | | public String getAddress(int index) { |
| | | String[] stringdatas = this.startAddress.trim().split("\\."); |
| | | if (stringdatas.length < 2 ) |
| | | return null; |
| | | int dbwindex = 0; |
| | | int bitindex = 0; |
| | | if (stringdatas.length == 3) { |
| | | dbwindex = Integer.parseInt(stringdatas[1]); |
| | | bitindex = Integer.parseInt(stringdatas[2]); |
| | | } else |
| | | return null; |
| | | dbwindex+=index/8; |
| | | bitindex+=index%8; |
| | | return stringdatas[0]+"."+dbwindex+"."+bitindex; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | public void setAddressIndex(int addressindex) { |
| | | this.addressIndex = addressindex; |
| | | } |
| | | } |
New file |
| | |
| | | package com.mes.common; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public class PlcBitObject { |
| | | |
| | | // 该模块数据类型,数据起始位置 |
| | | private String plcAddressBegin; |
| | | // 数据地址长度:第一参数到最后一个参数的长度 |
| | | private int plcAddressLength; |
| | | private ArrayList<PlcBitInfo> plcBitList; |
| | | |
| | | /** |
| | | * @return 数据区开始地址 |
| | | */ |
| | | public String getPlcAddressBegin() { |
| | | return plcAddressBegin; |
| | | } |
| | | |
| | | /** |
| | | * @param plcAddressBegin 设置数据区开始地址 |
| | | */ |
| | | public void setPlcAddressBegin(String plcAddressBegin) { |
| | | this.plcAddressBegin = plcAddressBegin; |
| | | } |
| | | |
| | | /** |
| | | * @return 数据区 读取所有数据所需的长度(以byte类型为基准) |
| | | */ |
| | | public int getPlcAddressLength() { |
| | | return plcAddressLength; |
| | | } |
| | | |
| | | /** |
| | | * @return 设置:数据区 读取所有数据所需的长度(以byte类型为基准) |
| | | */ |
| | | public void setPlcAddressLength(int plcAddressLength) { |
| | | this.plcAddressLength = plcAddressLength; |
| | | } |
| | | |
| | | /** |
| | | * @return 获取参数实例集合 |
| | | */ |
| | | public ArrayList<PlcBitInfo> getBitList() { |
| | | return plcBitList; |
| | | } |
| | | |
| | | /** |
| | | * 根据参数标识 获取某个参数实例 |
| | | * |
| | | * @param codeid 参数标识 |
| | | * @return 获取某个参数实例 |
| | | */ |
| | | public PlcBitInfo getPlcBit(String codeid) { |
| | | if (plcBitList != null) { |
| | | for (PlcBitInfo plcbitInfo : plcBitList) { |
| | | if (plcbitInfo.getCodeId().equals(codeid)) |
| | | return plcbitInfo; |
| | | } |
| | | return null; |
| | | } else |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 根据参数标识 获取某个参数实例 |
| | | * |
| | | * @param codeid 参数标识 |
| | | * @return 获取某个参数实例 |
| | | */ |
| | | public List<Boolean> getPlcBitValues(List<String> codeids) { |
| | | List<Boolean> arrayList = new ArrayList<>(); |
| | | if (plcBitList != null) { |
| | | Map<String, Boolean> resultMap = new LinkedHashMap<>(); // 使用 LinkedHashMap 保留插入顺序 |
| | | for (PlcBitInfo plcBitInfo : plcBitList) { |
| | | if (codeids.contains(plcBitInfo.getCodeId().toString())) { |
| | | resultMap.put(plcBitInfo.getCodeId().toString(), plcBitInfo.getValue()); |
| | | } |
| | | } |
| | | for (String codeId : codeids) { // 按照传入参数的顺序遍历 |
| | | Boolean value = resultMap.get(codeId); |
| | | if (value != null) { |
| | | arrayList.add(value); |
| | | } else { |
| | | arrayList.add(null); // 如果找不到对应的值,添加 null |
| | | } |
| | | } |
| | | } |
| | | return arrayList; |
| | | } |
| | | |
| | | |
| | | public List<String> getAddressListByCodeId(List<String> codeIdList) { |
| | | List<String> addressList = new ArrayList<>(); |
| | | for (String codeId : codeIdList) { |
| | | for (PlcBitInfo plcBitInfo : plcBitList) { |
| | | if (plcBitInfo.getCodeId().equals(codeId)) { |
| | | int index = plcBitInfo.getAddressIndex(); |
| | | String address = plcBitInfo.getAddress(index); |
| | | if (address != null) { |
| | | addressList.add(address); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return addressList; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加参数实例 |
| | | * |
| | | * @param param 参数实例 |
| | | */ |
| | | public void addPlcBit(PlcBitInfo param) { |
| | | if (plcBitList != null) |
| | | plcBitList.add(param); |
| | | else { |
| | | plcBitList = new ArrayList<PlcBitInfo>(); |
| | | plcBitList.add(param); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据PLC返回的数据 给参数实例赋值 |
| | | * |
| | | * @param plcValueArray PLC读取回来的byte类型数据集合 |
| | | */ |
| | | public void setPlcBitList(List<Boolean> plcValueArray) { |
| | | if (plcBitList != null) { |
| | | for (PlcBitInfo plcbitInfo : plcBitList) { |
| | | plcbitInfo.setValue(plcValueArray.get(plcbitInfo.getAddressIndex())); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.common; |
| | | public class PlcParameterInfo { |
| | | public PlcParameterInfo(String startAddress) { |
| | | this.startAddress = startAddress; |
| | | } |
| | | private String startAddress; |
| | | // 参数标识 |
| | | private String codeId; |
| | | |
| | | // 参数名称 |
| | | private String name; |
| | | |
| | | // 读取 参数值 |
| | | private String value; |
| | | |
| | | // // 写入 参数值 |
| | | // private String writeValue; |
| | | |
| | | // 参数单位 |
| | | private String unit; |
| | | |
| | | // 参数值转换系数 |
| | | private int ratio; |
| | | |
| | | // 参数地址 |
| | | private int addressIndex; |
| | | |
| | | // 参数地址位长度 |
| | | private int addressLength; |
| | | |
| | | public String getCodeId() { |
| | | return this.codeId; |
| | | } |
| | | |
| | | public void setCodeId(String codeId) { |
| | | this.codeId = codeId; |
| | | } |
| | | |
| | | public String getName() { |
| | | return this.name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getValue() { |
| | | return this.value; |
| | | } |
| | | |
| | | public void setValue(String value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | // public String getWriteValue() { |
| | | // return this.writeValue; |
| | | // } |
| | | |
| | | // public void setWriteValue(String writeValue) { |
| | | // this.writeValue = writeValue; |
| | | // } |
| | | |
| | | public String getUnit() { |
| | | return this.unit; |
| | | } |
| | | |
| | | public void setUnit(String unit) { |
| | | this.unit = unit; |
| | | } |
| | | |
| | | public int getAddressIndex() { |
| | | return this.addressIndex; |
| | | } |
| | | |
| | | public void setAddressIndex(int addressindex) { |
| | | this.addressIndex = addressindex; |
| | | } |
| | | |
| | | public int getAddressLength() { |
| | | return this.addressLength; |
| | | } |
| | | |
| | | public void setAddressLength(int addresslength) { |
| | | this.addressLength = addresslength; |
| | | } |
| | | |
| | | public int getRatio() { |
| | | return this.ratio; |
| | | } |
| | | |
| | | public void setRatio(int ratio) { |
| | | this.ratio = ratio; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取地址 |
| | | * |
| | | * @param index 索引地址 |
| | | */ |
| | | public String getAddress(int index) { |
| | | String[] stringdatas = this.startAddress.trim().split("\\."); |
| | | int addressLength=this.addressLength; |
| | | if (addressLength < 2 ){ |
| | | return null; |
| | | } |
| | | |
| | | if (addressLength == 2 ) { |
| | | int wordindex = index; |
| | | |
| | | return stringdatas[0] + "." + wordindex; |
| | | } |
| | | if (addressLength == 14 ) { |
| | | int wordindex = index; |
| | | //int newIndex = wordindex + 13; |
| | | return stringdatas[0] + "." + wordindex ; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public int getPlcAddress() { |
| | | |
| | | return addressIndex; |
| | | } |
| | | public String getAddress() { |
| | | return getAddress(this.addressIndex); |
| | | } |
| | | } |
New file |
| | |
| | | package com.mes.common; |
| | | |
| | | import java.lang.reflect.Array; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.ArrayList; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public class PlcParameterObject { |
| | | |
| | | // 该模块数据类型,数据起始位置 |
| | | private String plcAddressBegin; |
| | | // 数据地址长度:第一参数到最后一个参数的长度 |
| | | private int plcAddressLength; |
| | | private ArrayList<PlcParameterInfo> plcParameterList; |
| | | |
| | | /** |
| | | * @return 数据区开始地址 |
| | | */ |
| | | public String getPlcAddressBegin() { |
| | | return plcAddressBegin; |
| | | } |
| | | |
| | | /** |
| | | * @param plcAddressBegin 设置数据区开始地址 |
| | | */ |
| | | public void setPlcAddressBegin(String plcAddressBegin) { |
| | | this.plcAddressBegin = plcAddressBegin; |
| | | } |
| | | |
| | | /** |
| | | * @return 数据区 读取所有数据所需的长度(以byte类型为基准) |
| | | */ |
| | | public int getPlcAddressLength() { |
| | | return plcAddressLength; |
| | | } |
| | | |
| | | /** |
| | | * @return 设置:数据区 读取所有数据所需的长度(以byte类型为基准) |
| | | */ |
| | | public void setPlcAddressLength(int plcAddressLength) { |
| | | this.plcAddressLength = plcAddressLength; |
| | | } |
| | | |
| | | /** |
| | | * @return 获取参数实例集合 |
| | | */ |
| | | public ArrayList<PlcParameterInfo> getPlcParameterList() { |
| | | return plcParameterList; |
| | | } |
| | | |
| | | /** |
| | | * 根据参数标识 获取某个参数实例 |
| | | * |
| | | * @param codeid 参数标识 |
| | | * @return 获取某个参数实例 |
| | | */ |
| | | public PlcParameterInfo getPlcParameter(String codeid) { |
| | | if (plcParameterList != null) { |
| | | for (PlcParameterInfo plcParameterInfo : plcParameterList) { |
| | | if (plcParameterInfo.getCodeId().equals(codeid)) |
| | | return plcParameterInfo; |
| | | } |
| | | return null; |
| | | } else |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据参数标识 获取某个参数实例 |
| | | * |
| | | * @param codeids 参数标识 |
| | | * @return 获取某个参数实例 |
| | | */ |
| | | public List<String> getPlcParameterValues(List<String> codeids) { |
| | | List<String> arrayList = new ArrayList<>(); |
| | | if (plcParameterList != null) { |
| | | Map<String, PlcParameterInfo> resultMap = new LinkedHashMap<>(); // 使用 LinkedHashMap 保留插入顺序 |
| | | for (PlcParameterInfo plcParameterInfo : plcParameterList) { |
| | | if (codeids.contains(plcParameterInfo.getCodeId())) { |
| | | resultMap.put(plcParameterInfo.getCodeId(), plcParameterInfo); |
| | | } |
| | | } |
| | | for (String codeId : codeids) { // 按照传入参数的顺序遍历 |
| | | PlcParameterInfo plcParameterInfo = resultMap.get(codeId); |
| | | if (plcParameterInfo != null) { |
| | | arrayList.add(plcParameterInfo.getValue()); |
| | | } else { |
| | | arrayList.add(null); // 如果找不到对应的值,添加 null |
| | | } |
| | | } |
| | | } |
| | | return arrayList; |
| | | } |
| | | |
| | | |
| | | public List<String> getAddressListByCodeId(List<String> codeIdList) { |
| | | List<String> addressList = new ArrayList<>(); |
| | | for (String codeId : codeIdList) { |
| | | for (PlcParameterInfo plcParameterInfo : plcParameterList) { |
| | | if (plcParameterInfo.getCodeId().equals(codeId)) { |
| | | int index = plcParameterInfo.getAddressIndex(); |
| | | String address = plcParameterInfo.getAddress(index); |
| | | if (address != null) { |
| | | addressList.add(address); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return addressList; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 添加参数实例 |
| | | * |
| | | * @param param 参数实例 |
| | | */ |
| | | public void addPlcParameter(PlcParameterInfo param) { |
| | | if (plcParameterList != null) |
| | | plcParameterList.add(param); |
| | | else { |
| | | plcParameterList = new ArrayList<PlcParameterInfo>(); |
| | | plcParameterList.add(param); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据PLC返回的数据 给参数实例赋值 |
| | | * |
| | | * @param plcValueArray PLC读取回来的byte类型数据集合 |
| | | */ |
| | | 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) { |
| | | plcParameterInfo.setValue(String.valueOf(byte2short(valueList))); |
| | | } |
| | | else if (plcParameterInfo.getAddressLength()==14) { |
| | | plcParameterInfo.setValue((byteToHexString(valueList))); |
| | | } |
| | | |
| | | else |
| | | { |
| | | String valuestr = new String(valueList); |
| | | plcParameterInfo.setValue(valuestr); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | /** |
| | | * short类型转byte[] |
| | | * |
| | | * @param s short类型值 |
| | | */ |
| | | public static byte[] short2byte(short s){ |
| | | byte[] b = new byte[2]; |
| | | for(int i = 0; i < 2; i++){ |
| | | int offset = 16 - (i+1)*8; //因为byte占4个字节,所以要计算偏移量 |
| | | b[i] = (byte)((s >> offset)&0xff); //把16位分为2个8位进行分别存储 |
| | | } |
| | | return b; |
| | | } |
| | | /** |
| | | * byte[]类型转short |
| | | * |
| | | * @param b byte[]类型值 |
| | | */ |
| | | public static short byte2short(byte[] b){ |
| | | short l = 0; |
| | | for (int i = 0; i < 2; i++) { |
| | | l<<=8; //<<=和我们的 +=是一样的,意思就是 l = l << 8 |
| | | l |= (b[i] & 0xff); //和上面也是一样的 l = l | (b[i]&0xff) |
| | | } |
| | | return l; |
| | | } |
| | | |
| | | public static String byteToHexString(byte[] bytes) { |
| | | |
| | | String str = new String(bytes, StandardCharsets.UTF_8); |
| | | return str; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.mes.taskcache.controller; |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.mes.taskcache.service.HangzhoumesService; |
| | | import com.mes.taskcache.service.PpService; |
| | | import com.mes.utils.Result; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RequestMapping("/taskCache") |
| | | public class TaskCacheController { |
| | | |
| | | @Autowired |
| | | private PpService ppService; |
| | | |
| | | @Autowired |
| | | private HangzhoumesService hangzhoumesService; |
| | | |
| | | // @GetMapping("/SelectTerritoryInfo") // 查询钢化版图信息-根据 工程号 |
| | | // @ResponseBody |
| | | // public Result SelectTerritoryInfo(@RequestParam(name = "ProcessId", required = false) String ProcessId) { |
| | | // List<Tempered> h = ppService.selectTemperedTerritory(ProcessId); |
| | | // return Result.seccess(h); |
| | | // } |
| | | |
| | | @GetMapping("/CutTerritory") // 查询切割版图信息-根据 工程号 |
| | | @ResponseBody |
| | | public Result CutTerritory(String ProcessId) { |
| | | List<Map> h = ppService.selectCutTerritory(ProcessId); |
| | | return Result.build(200,"成功",h); |
| | | } |
| | | |
| | | @GetMapping("/CurrentCutTerritory") // 识别显示 当前版图 |
| | | @ResponseBody |
| | | public Result CurrentCutTerritory() { |
| | | List<Map> h = ppService.selectCutTerritory(); |
| | | System.out.println(h); |
| | | return Result.build(200,"成功",h); |
| | | } |
| | | |
| | | @GetMapping("/SelectCutTerritory") // 识别显示 特定版图 |
| | | @ResponseBody |
| | | public Result SelectCutTerritory(String TerritoryId) { |
| | | List<Map> h = ppService.selectCutTerritory(TerritoryId); |
| | | return Result.build(200,"成功",h); |
| | | } |
| | | |
| | | @GetMapping("/IdentControls") // 识别操作: 破损/拿走 参数(ID,功能[0:破损,1:拿走]) |
| | | @ResponseBody |
| | | public Result Ident(@RequestParam(name = "IdentId", required = false) String ProcessId,@RequestParam(name = "ControlsId", required = false) String ControlsId) { |
| | | List<Map> h = ppService.selectCutTerritory("P24032508"); |
| | | return Result.build(200,"成功",h); |
| | | } |
| | | |
| | | @GetMapping("/SelectCageInfo") // 查询笼内信息 |
| | | @ResponseBody |
| | | public Result SelectCageInfo(String ProcessId) { |
| | | List<Map> h = hangzhoumesService.SelectCageInfo(); |
| | | return Result.build(200,"成功",h); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/SelectEdgTask") //磨边任务 |
| | | @ResponseBody |
| | | public Result SelectEdgTask(String ProcessId) { |
| | | List<Map> EdgTasks = hangzhoumesService.SelectEdgInfo("1"); |
| | | return Result.build(200,"成功",EdgTasks); |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.taskcache.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | @Data //lombok 简写java代码 实体类的get与set |
| | | @TableName("`edg_storage_cage`") |
| | | public class EdgStorageCage { |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id;//磨边前理片笼表id |
| | | private Integer flowcard_id;//设备id |
| | | private String glass_type;//栅格号 |
| | | private String height;//启用状态 |
| | | private Integer thickness;//剩余 |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.taskcache.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | @Data //lombok 简写java代码 实体类的get与set |
| | | @TableName("`edg_storage_cage_details`") |
| | | public class EdgStorageCageDetails { |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id;//磨边前理片笼详情表id |
| | | private Integer deviceid;//设备id |
| | | private Integer slot;//栅格号 |
| | | private Integer glassid;//玻璃id |
| | | private Integer sequence;//小片在格内的顺序 |
| | | private String flowcardid;//流程卡号 |
| | | private Integer glasstype;//玻璃类型 |
| | | private Double width;//宽 |
| | | private Double height;//高 |
| | | private Double thickness;//厚度 |
| | | private Double edgwidth;//磨前宽 |
| | | private Double edgheight;//磨前高 |
| | | private Integer temperinglayoutid;//钢化版图id |
| | | private Integer temperingfeedsequence;//钢化版图片序 |
| | | private Integer patternsequence;//原片顺序 |
| | | private Integer state;//状态 |
| | | private Integer gap;//玻璃间隙 |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.taskcache.entity; |
| | | |
| | | import java.math.BigInteger; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | @Data //lombok 简写java代码 实体类的get与set |
| | | @TableName("`engineering`") |
| | | public class Engineering { |
| | | @TableId(type = IdType.AUTO) |
| | | private BigInteger id;//工程表id |
| | | private Integer engineerid;//工程号 |
| | | private String engineername;//工程名称 |
| | | private Double avgavailability;//平均利用率 |
| | | private Double validavailability;//有效利用率 |
| | | private Double lastavailability;//尾片利用率 |
| | | private Integer state;//状态 |
| | | private Integer glasstotal;//小片总数 |
| | | private Double glasstotalarea;//小片总面积 |
| | | private Integer planpatterntotal;//计划原片总数 |
| | | private Double planpatterntotalarea;//计划原片总面积 |
| | | private Integer realitypatterntotal;//实际原片总数 |
| | | private Double realitypatterntotalarea;//实际原片总面积 |
| | | private Integer filmsid;//膜系id |
| | | private String notes;//备注 |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.taskcache.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | @Data //lombok 简写java代码 实体类的get与set |
| | | @TableName("`glass_films`") |
| | | public class GlassFilms { |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id;//膜系表id |
| | | private Integer films_id;//膜系id |
| | | private String films_name;//膜系 |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.taskcache.entity; |
| | | |
| | | import java.math.BigInteger; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | @Data //lombok 简写java代码 实体类的get与set |
| | | @TableName("`glass_info`") |
| | | public class GlassInfo { |
| | | @TableId(type = IdType.AUTO) |
| | | private BigInteger id;//玻璃信息表id |
| | | private String flowcardid;//流程卡 |
| | | private Integer glasstype;//流程卡玻璃类型 |
| | | private Double width;//宽 |
| | | private Double height;//高 |
| | | private Double thickness;//厚度 |
| | | private Integer filmsid;//膜系 |
| | | private Double edgwidth;//磨前宽 |
| | | private Double edgheight;//磨前高 |
| | | private Integer ismultiple;//是否配片 |
| | | private Double maxwidth;//配片最大宽 |
| | | private Double maxheight;//配片最大高 |
| | | private Integer ishorizontal;//钢化是否接受横放 |
| | | private Integer patternsequence;//原片顺序 |
| | | private Integer temperinglayoutid;//钢化版图id |
| | | private Integer temperingfeedsequence;//钢化版图片序 |
| | | private Integer xcoordinate;//x坐标 |
| | | private Integer ycoordinate;//y坐标 |
| | | private Integer angle;//旋转角度(逆时针) |
| | | |
| | | } |
| | |
| | | package com.mes.taskcache.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.io.Serializable; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-04-07 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class TaskCache implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ID编号 |
| | | */ |
| | | @TableId("ID") |
| | | private String id; |
| | | |
| | | /** |
| | | * 起始 |
| | | */ |
| | | private String startCell; |
| | | |
| | | /** |
| | | * 目标 |
| | | */ |
| | | private String endCell; |
| | | |
| | | /** |
| | | * 任务类型 1:进 2:出 |
| | | */ |
| | | private String taskType; |
| | | |
| | | /** |
| | | * 任务状态 0 未开始 1正在进行 2完成 |
| | | */ |
| | | private String taskStauts; |
| | | |
| | | @Data //lombok 简写java代码 实体类的get与set |
| | | @TableName("task_cache") |
| | | public class TaskCache { |
| | | private String ID;//任务编号 |
| | | private String startcell;//起始 |
| | | private String endcell;//结束 |
| | | private String tasktype;//任务类型 |
| | | private String taskstauts;//任务状态 |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.taskcache.mapper; |
| | | |
| | | |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.mes.taskcache.entity.EdgStorageCageDetails; |
| | | import com.mes.taskcache.entity.GlassInfo; |
| | | import com.mes.taskcache.entity.TaskCache; |
| | | import org.apache.ibatis.annotations.*; |
| | | |
| | | @Mapper |
| | | public interface HangzhouMesMapper { |
| | | |
| | | // 玻璃信息 按ID查询 |
| | | @Select("select * from `glass_info` where id=#{id}") |
| | | GlassInfo selectGlassId(String id); |
| | | // 查询磨边信息 |
| | | @Select("select * from task_cache where task_type='2' and task_stauts='2' and end_cell=#{EndCell}") |
| | | List<Map> selectEdgInfo(String EndCell); |
| | | |
| | | // 查询笼子内空闲 |
| | | @Select("select escd.* from edg_storage_cage as esc LEFT JOIN edg_storage_cage_details as escd on esc.slot=escd.slot where escd.slot is null order by escd.slot") |
| | | List<EdgStorageCageDetails> selectCacheLeisure(); |
| | | |
| | | // 查询笼子内出片任务 |
| | | @Select("select escd.* from edg_storage_cage as esc LEFT JOIN edg_storage_cage_details as escd on esc.slot=escd.slot WHERE escd.slot IS NOT NULL order by escd.tempering_layout_id,escd.tempering_feed_sequence") |
| | | List<EdgStorageCageDetails> selectCacheOut(); |
| | | |
| | | // 查询笼子内信息 |
| | | @Select("select esc.*,escd.id as detailsID,escd.device_id as details_device_id,escd.glass_id,escd.sequence,escd.flow_card_id,escd.glass_type,escd.width,escd.height,escd.thickness,escd.edg_width,escd.edg_height,escd.tempering_layout_id,escd.tempering_feed_sequence,escd.pattern_sequence,escd.state,escd.gap from edg_storage_cage as esc LEFT JOIN edg_storage_cage_details as escd on esc.slot=escd.slot order by esc.slot") |
| | | List<Map> selectCachInfo(); |
| | | |
| | | // 查询可进此片玻璃的栅格号 |
| | | @Select("select escd.* from edg_storage_cage as esc LEFT JOIN edg_storage_cage_details as escd on esc.slot=escd.slot where escd.slot is not null escd.tempering_layout_id=#{tempering_layout_id} and escd.tempering_feed_sequence<#{tempering_feed_sequence} and esc.remain_width-#{width}>0 order by escd.tempering_feed_sequence") |
| | | List<EdgStorageCageDetails> selectIsExistIntoCache(Integer tempering_layout_id, Integer tempering_feed_sequence,double width); |
| | | |
| | | // 查询可进此片玻璃的栅格号 |
| | | @Select("select escd.* from edg_storage_cage as esc LEFT JOIN edg_storage_cage_details as escd on esc.slot=escd.slot where escd.slot is not null escd.tempering_layout_id<#{tempering_layout_id} and esc.remain_width-#{width}>0 order by escd.tempering_layout_id desc,escd.tempering_feed_sequence") |
| | | List<EdgStorageCageDetails> selectIsExistIntoCache(Integer tempering_layout_id, double width); |
| | | |
| | | // 查询全部任务 |
| | | @Select("select * from task_cache") |
| | | List<TaskCache> selectCacheInfoAll(); |
| | | |
| | | // 查询进片任务 |
| | | @Select("select * from task_cache where task_type='1' and task_stauts='0'") |
| | | List<TaskCache> selectInputCacheInfo(); |
| | | |
| | | // 查询出片任务 |
| | | @Select("select * from task_cache where task_type='2' and task_stauts='0'") |
| | | List<TaskCache> selectOutCacheInfo(); |
| | | |
| | | // 查询 A09 或 A10 最新的一片 出片任务 |
| | | @Select("select * from task_cache where task_type='2' and task_stauts='2' and end_cell=#{EndCell} limit 1") |
| | | GlassInfo selectLastOutCacheInfo(String EndCell); |
| | | |
| | | // 修改笼子内信息 |
| | | @Update("update") |
| | | Integer updateCache(@Param("id") Integer id, @Param("order_id") String order_id); |
| | | |
| | | // 添加理片任务 |
| | | @Insert("INSERT into task_cache VALUES(#{id},#{start},#{end},#{type},0)") |
| | | Integer insertCacheTask(String id, String start, String end, String type); |
| | | |
| | | // |
| | | // @Insert("INSERT `order`(order_id)VALUES(#{order_id})") |
| | | // Integer insert(Order order); |
| | | // |
| | | // @Delete("delete from `order` where id=#{id}") |
| | | // Integer deleteById(@Param("id") Integer id); |
| | | // |
| | | // @Update("update `order` set order_id=#{order_id} where id=#{id}") |
| | | // Integer update(@Param("id") Integer id,@Param("order_id") String order_id); |
| | | } |
New file |
| | |
| | | package com.mes.taskcache.mapper; |
| | | |
| | | |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import org.apache.ibatis.annotations.*; |
| | | // |
| | | //@DS("pp") |
| | | @Mapper |
| | | public interface PpMapper { |
| | | |
| | | // // 钢化按工程查询 |
| | | // @Select("select * from `v_optimize_heat_layout` where project_no=#{projeceid} ") |
| | | // List<Tempered> selectTemperedTerritory(String projeceid); |
| | | |
| | | // 切割版图 按工程,版图编号查询 |
| | | @Select("select * from optimize_detail where project_no=#{projeceid} and stock_id=#{TerritoryId}") |
| | | List<Map> selectCutTerritory(String projeceid,String TerritoryId); |
| | | |
| | | // 切割版图 按工程查询 |
| | | @Select("select * from optimize_detail where project_no=#{projeceid} ") |
| | | List<Map> selectCutTerritory(String projeceid); |
| | | |
| | | // |
| | | // @Insert("INSERT `order`(order_id)VALUES(#{order_id})") |
| | | // Integer insert(Order order); |
| | | // |
| | | // @Delete("delete from `order` where id=#{id}") |
| | | // Integer deleteById(@Param("id") Integer id); |
| | | // |
| | | // @Update("update `order` set order_id=#{order_id} where id=#{id}") |
| | | // Integer update(@Param("id") Integer id,@Param("order_id") String order_id); |
| | | } |
New file |
| | |
| | | package com.mes.taskcache.service; |
| | | |
| | | |
| | | import com.mes.taskcache.entity.GlassInfo; |
| | | import com.mes.taskcache.mapper.HangzhouMesMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class HangzhoumesService { |
| | | |
| | | @Autowired |
| | | private HangzhouMesMapper hangzhouMesMapper; |
| | | //根据编号 查找玻璃小片信息 |
| | | public GlassInfo getUserInfo(String process_id){ |
| | | return hangzhouMesMapper.selectGlassId(process_id); |
| | | } |
| | | |
| | | //理片缓存 笼内信息 |
| | | public List<Map> SelectCageInfo(){ |
| | | return hangzhouMesMapper.selectCachInfo(); |
| | | } |
| | | |
| | | //磨边小片信息 |
| | | public List<Map> SelectEdgInfo(String line){ |
| | | return hangzhouMesMapper.selectEdgInfo(line); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.taskcache.service; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.mes.common.PLCAutoMes; |
| | | import com.mes.common.PlcParameterObject; |
| | | import com.mes.common.S7object; |
| | | import com.mes.taskcache.entity.EdgStorageCageDetails; |
| | | import com.mes.taskcache.entity.GlassInfo; |
| | | import com.mes.taskcache.mapper.HangzhouMesMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | |
| | | |
| | | |
| | | @Service |
| | | public class LogicService { |
| | | @Autowired |
| | | private HangzhouMesMapper hangzhouMesMapper; |
| | | |
| | | // //理片 |
| | | // public void Process(){ |
| | | // String Result= S7object.getinstance().plccontrol.ReadWord("DB14.0", 1).get(0)+""; |
| | | // String Number=S7object.getinstance().plccontrol.ReadWord("DB14.2", 1).get(0)+""; |
| | | // if(Result=="1"){//进片请求 |
| | | // processInto(Number); |
| | | // }else if(Result=="2"){//出片请求 |
| | | // processOut(); |
| | | // }else if(Result=="3"){//进出片请求 |
| | | // if (!processOut()) { //先出后进 |
| | | // processInto(Number); |
| | | // } |
| | | // } |
| | | // } |
| | | //理片 进 |
| | | public boolean processInto(String Number){ |
| | | //查询消息队列里的玻璃 |
| | | GlassInfo GlassInfo=hangzhouMesMapper.selectGlassId(Number); |
| | | PlcParameterObject plcmes= PLCAutoMes.PlcMesObject; |
| | | if(GlassInfo!=null){//存在此玻璃编号 |
| | | //同钢化版图内的栅格号 |
| | | List<EdgStorageCageDetails> list=hangzhouMesMapper.selectIsExistIntoCache(GlassInfo.getTemperinglayoutid(),GlassInfo.getTemperingfeedsequence(),GlassInfo.getWidth()); |
| | | //空栅格号 |
| | | if (list.size()==0) { |
| | | list=hangzhouMesMapper.selectCacheLeisure(); |
| | | } |
| | | //小于此玻璃钢化版图序号的栅格号 |
| | | if(list.size()==0){ |
| | | list=hangzhouMesMapper.selectIsExistIntoCache(GlassInfo.getTemperinglayoutid(),GlassInfo.getWidth()); |
| | | } |
| | | if(list.size()>0){ |
| | | //存在空格 |
| | | //1.生成任务: 起始位置0 结束位置this.slot 任务类型 1 (进片任务) |
| | | //2.回复 1进片 |
| | | EdgStorageCageDetails item=list.get(0); |
| | | hangzhouMesMapper.insertCacheTask(GlassInfo.getId()+"","0",item.getSlot()+"","1"); |
| | | S7object.getinstance().plccontrol.WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),(short) 1); |
| | | return true; |
| | | } |
| | | |
| | | }else{ |
| | | // ID编号不存在 不处理/回复PLC 进行报警提示 |
| | | } |
| | | //返回结果 |
| | | return false; |
| | | } |
| | | // //理片 出 |
| | | // public boolean processOut(){ |
| | | // //查询任务 |
| | | // String A09=S7object.getinstance().plccontrol.ReadWord("DB14.56", 1).get(0)+""; |
| | | // String A10=S7object.getinstance().plccontrol.ReadWord("DB14.58", 1).get(0)+""; |
| | | // PlcParameterObject plcmes=PLCAutoMes.PlcMesObject; |
| | | // List<EdgStorageCageDetails> list=hangzhouMesMapper.selectCacheOut(); |
| | | // boolean isOut=true;//其他情况条件 如:后续设备故障禁止理片出片 等 |
| | | // if (list.size()>0&&isOut) { |
| | | // EdgStorageCageDetails item=list.get(0); |
| | | // if(A09=="0"&&A10=="1"){ |
| | | // //出到 A09 |
| | | // hangzhouMesMapper.insertCacheTask(item.getGlassid()+"","0","09","2"); |
| | | // S7object.getinstance().plccontrol.writeString(plcmes.getPlcParameter("DB14.28").getAddress(), "1"); |
| | | // S7object.getinstance().plccontrol.writeString(plcmes.getPlcParameter("DB14.20").getAddress(), "1"); |
| | | // return true; |
| | | // }else if(A09=="1"&&A10=="0"){ |
| | | // //出到 A10 |
| | | // hangzhouMesMapper.insertCacheTask(item.getGlassid()+"","0","10","2"); |
| | | // S7object.getinstance().plccontrol.writeString(plcmes.getPlcParameter("DB14.28").getAddress(), "2"); |
| | | // S7object.getinstance().plccontrol.writeString(plcmes.getPlcParameter("DB14.20").getAddress(), "1"); |
| | | // return true; |
| | | // }else if(A09=="0"&&A10=="0"){ |
| | | // //都允许 A09/A10 上一片是否和此片玻璃尺寸尺寸相同 |
| | | // String endcell="09"; |
| | | // String SendEndcell="1"; |
| | | // boolean If_=false; |
| | | // GlassInfo glassInfo09= hangzhouMesMapper.selectLastOutCacheInfo("09"); |
| | | // GlassInfo glassInfo10= hangzhouMesMapper.selectLastOutCacheInfo("10"); |
| | | // if(glassInfo10!=null&&glassInfo10.getWidth()==item.getWidth()&&glassInfo10.getHeight()==item.getHeight()){ |
| | | // endcell="10"; |
| | | // SendEndcell="2"; |
| | | // }else if(glassInfo10!=null&&If_){ |
| | | // //其他条件 |
| | | // } |
| | | // hangzhouMesMapper.insertCacheTask(item.getGlassid()+"","0",endcell,"2"); |
| | | // S7object.getinstance().plccontrol.writeString(plcmes.getPlcParameter("DB14.28").getAddress(), SendEndcell); |
| | | // S7object.getinstance().plccontrol.writeString(plcmes.getPlcParameter("DB14.20").getAddress(), "1"); |
| | | // return true; |
| | | // } |
| | | // } |
| | | // //返回结果 |
| | | // return false; |
| | | // } |
| | | |
| | | // //磨边 不交互 理片和磨边机自己交互 |
| | | // public void processMb(String Number){ |
| | | // //查询任务 |
| | | // GlassInfo GlassInfo=hangzhouMesMapper.selectGlassId(Number); |
| | | // PlcParameterObject plcmes=PLCAutoMes.PlcMesObject; |
| | | // if(GlassInfo!=null){ |
| | | // //发送任务 ID 长 宽 厚 倒角 工艺功能等 |
| | | // S7object.getinstance().plccontrol.getinstance().writeString(plcmes.getPlcParameter("DB14.22").getAddress(),"N10000"); |
| | | // S7object.getinstance().plccontrol.getinstance().writeString(plcmes.getPlcParameter("DB14.24").getAddress(), "1000"); |
| | | // S7object.getinstance().plccontrol.getinstance().writeString(plcmes.getPlcParameter("DB14.26").getAddress(),"800"); |
| | | // S7object.getinstance().plccontrol.getinstance().writeString(plcmes.getPlcParameter("DB14.28").getAddress(),"60"); |
| | | // S7object.getinstance().plccontrol.getinstance().writeString(plcmes.getPlcParameter("DB14.30").getAddress(), "2"); |
| | | // S7object.getinstance().plccontrol.getinstance().writeString(plcmes.getPlcParameter("DB14.20").getAddress(), "1"); |
| | | // } |
| | | // //返回结果 |
| | | // } |
| | | |
| | | //查询消息队列里此玻璃ID的数据 |
| | | public boolean SelectMessageId(String num){ |
| | | //查询是否存在 |
| | | GlassInfo glassInfo=hangzhouMesMapper.selectGlassId(num); |
| | | if(glassInfo==null){ |
| | | return false;//返回 不存在 |
| | | } |
| | | return true;//返回 存在 |
| | | } |
| | | //删除消息队列里此玻璃ID的数据 |
| | | public boolean DeleteMessageId(String num){ |
| | | //查询是否存在 |
| | | GlassInfo glassInfo=hangzhouMesMapper.selectGlassId(num); |
| | | if(glassInfo==null){ |
| | | return false;//返回 不存在 |
| | | } |
| | | return true;//返回 存在 |
| | | } |
| | | |
| | | //是否存在此编号玻璃 |
| | | public boolean isExist(String num){ |
| | | //查询是否存在 |
| | | GlassInfo glassInfo=hangzhouMesMapper.selectGlassId(num); |
| | | if(glassInfo==null){ |
| | | return false;//返回 不存在 |
| | | } |
| | | return true;//返回 存在 |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.taskcache.service; |
| | | |
| | | |
| | | import com.mes.taskcache.mapper.HangzhouMesMapper; |
| | | import com.mes.taskcache.mapper.PpMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class PpService { |
| | | |
| | | @Autowired |
| | | private PpMapper selectInfoMapper; |
| | | @Autowired |
| | | private HangzhouMesMapper hangzhouMesMapper; |
| | | |
| | | // public GlassInfo getUserInfo(String process_id){ |
| | | // return hangzhouMesMapper.selectGlassId(process_id); |
| | | // } |
| | | |
| | | // public List<Tempered> selectTemperedTerritory(String process_id){ |
| | | // return selectInfoMapper.selectTemperedTerritory(process_id); |
| | | // } |
| | | |
| | | //切割版图 当前识别版图 |
| | | public List<Map> selectCutTerritory(){ |
| | | //得到要显示的 工程ID 以及版图ID |
| | | //1.在Hangzhoumes数据库里 得到目前已经 领取但未完成的 工程ID集合 |
| | | //2.拿工程集合去PP数据库里 得到对应的小片集合 |
| | | //3.拿对应的小片集合 与 缓存任务表进行对比 查找下一版图显示 |
| | | String process_id = "P24032204"; |
| | | String territory_id = "1"; |
| | | return selectInfoMapper.selectCutTerritory(process_id,territory_id); |
| | | } |
| | | //切割版图 根据工程号查询 所有版图小片数据 |
| | | public List<Map> selectCutTerritory(String process_id){ |
| | | return selectInfoMapper.selectCutTerritory(process_id); |
| | | } |
| | | //切割版图 根据工程号,版图编号查询 版图编号里所有小片数据 |
| | | public List<Map> selectCutTerritory(String process_id,String TerritoryId){ |
| | | return selectInfoMapper.selectCutTerritory(process_id,TerritoryId); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 127.0.0.1:8848 |
| | | server-addr: 10.153.19.150:8848 |
| | | application: |
| | | name: cacheGlass |
| | | redis: |
| | | database: 0 |
| | | host: 192.168.56.10 |
| | | host: 10.153.19.150 |
| | | port: 6379 |
| | | password: |
| | | password: 123456 |
| | | session: |
| | | store-type: redis |
| | | mybatis-plus: |
| | |
| | | }catch (Exception e){ |
| | | log.error(e.getMessage()); |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | package com.mes.bigstorage.controller; |
| | | |
| | | |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.service.impl.BigStorageCageDetailsServiceImpl; |
| | | import com.mes.bigstorage.service.impl.BigStorageCageServiceImpl; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RequestMapping("/bigStorageCage") |
| | | public class BigStorageCageController { |
| | | |
| | | private BigStorageCageServiceImpl bigStorageCageServiceImpl; |
| | | private BigStorageCageDetailsServiceImpl bigStorageCageDetailsServiceImpl; |
| | | |
| | | //todo: 实例代码 待删除 |
| | | @ApiOperation("测试") |
| | | @GetMapping("/index") |
| | | public String index() { |
| | | return "hello world"; |
| | | } |
| | | |
| | | @ApiOperation("理片笼信息") |
| | | @GetMapping("/BigStorageCage") |
| | | public List<BigStorageCage> BigStorageCage() { |
| | | return bigStorageCageServiceImpl.list(); |
| | | } |
| | | |
| | | @ApiOperation("理片笼详情") |
| | | @GetMapping("/BigStorageCageDetails") |
| | | public List<BigStorageCageDetails> BigStorageCageDetails() { |
| | | return bigStorageCageDetailsServiceImpl.list(); |
| | | } |
| | | |
| | | @ApiOperation("小车实时位置") |
| | | @GetMapping("/CarPosition") |
| | | public List<Integer> CarPosition() { |
| | | return bigStorageCageDetailsServiceImpl.GetCarposition(); |
| | | } |
| | | |
| | | @ApiOperation("手动完成任务") |
| | | @GetMapping("/FinishTask") |
| | | public void FinishTask(int type, int id) { |
| | | // bigStorageCageDetailsService.FinishTask(); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import feign.Param; |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | public interface BigStorageCageDetailsMapper extends BaseMapper<BigStorageCageDetails> { |
| | | |
| | | BigStorageCageDetails SelectTemperingFeedSlot(@Param("bigStorageCageDetails") BigStorageCageDetails bigStorageCageDetails); |
| | | |
| | | BigStorageCageDetails SelectEmptyFeedSlot(); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.uppattenusage.entity.GlassInfo; |
| | | import org.apache.ibatis.annotations.Update; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface BigStorageCageMapper extends BaseMapper<BigStorageCage> { |
| | | |
| | | |
| | | BigStorageCageDetails SelectEmptyFeedSlot(); |
| | | |
| | | @Update("update big_storage_cage set remain_width = #{width} where slot=#{slot}") |
| | | public void UpdateRemainWidth(int slot,int width); |
| | | |
| | | BigStorageCageDetails SelectTemperingFeedSlot(GlassInfo glassInfo); |
| | | |
| | | BigStorageCageDetails SelectOtherFeedSlot(); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.mapper.BigStorageCageMapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @since 2024-03-27 |
| | | */ |
| | | public interface BigStorageCageDetailsService extends IService<BigStorageCageDetails> { |
| | | List<Integer> GetCarposition(); |
| | | |
| | | |
| | | //获取小车实时位置 |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.mapper.BigStorageCageDetailsMapper; |
| | | import com.mes.bigstorage.mapper.BigStorageCageMapper; |
| | | import com.mes.uppattenusage.entity.GlassInfo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.mapper.BigStorageCageDetailsMapper; |
| | | import com.mes.bigstorage.mapper.BigStorageCageMapper; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.uppattenusage.entity.GlassInfo; |
| | | import com.mes.uppattenusage.mapper.GlassInfoMapper; |
| | | import com.mes.uppattenusage.service.GlassInfoService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @since 2024-03-27 |
| | | */ |
| | | @Service |
| | | public class BigStorageCageDetailsServiceImpl extends ServiceImpl<BigStorageCageDetailsMapper, BigStorageCageDetails> implements BigStorageCageDetailsService { |
| | | public abstract class BigStorageCageDetailsServiceImpl extends ServiceImpl<BigStorageCageDetailsMapper, BigStorageCageDetails> implements BigStorageCageDetailsService { |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.mapper.BigStorageCageDetailsMapper; |
| | | import com.mes.bigstorage.mapper.BigStorageCageMapper; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.uppattenusage.entity.GlassInfo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @Service |
| | | public class BigStorageCageServiceImpl extends ServiceImpl<BigStorageCageMapper, BigStorageCage> implements BigStorageCageService { |
| | | @Autowired |
| | | private BigStorageCageMapper bigStorageCageMapper; |
| | | @Autowired |
| | | private BigStorageCageDetailsMapper bigStorageCageDetailsMapper; |
| | | public BigStorageCageDetails FeedGlass(GlassInfo glassInfo, BigStorageCageDetails bigStorageCageDetails) { |
| | | |
| | | |
| | | //获取同钢化版图id可进片的格子 |
| | | BigStorageCageDetails layoutSlotInfo =bigStorageCageMapper.SelectTemperingFeedSlot(glassInfo); |
| | | //有符合条件的格子时 |
| | | if (layoutSlotInfo!=null) { |
| | | //将玻璃信息填入理片笼详情表 |
| | | bigStorageCageDetails.setSlot(layoutSlotInfo.getSlot()); |
| | | }else{ |
| | | //获取不到时: |
| | | |
| | | //获取可进片格子信息 |
| | | BigStorageCageDetails EmptySlotInfo=bigStorageCageMapper.SelectEmptyFeedSlot(); |
| | | if (EmptySlotInfo!=null){ |
| | | bigStorageCageDetails.setSlot(EmptySlotInfo.getSlot()); |
| | | }else{ |
| | | //获取其他笼格子- |
| | | BigStorageCageDetails OtherSlotInfo=bigStorageCageMapper.SelectOtherFeedSlot(); |
| | | bigStorageCageDetails.setSlot(OtherSlotInfo.getSlot()); |
| | | } |
| | | //将玻璃信息放入该格子 |
| | | |
| | | } |
| | | |
| | | updateRemainWidth(bigStorageCageDetails.getSlot()); |
| | | return bigStorageCageDetails; |
| | | } |
| | | |
| | | //修改格子剩余宽度 |
| | | private void updateRemainWidth(int Slot){ |
| | | //获取该格子内玻璃信息 |
| | | int width=5000; |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList= Collections.singletonList(bigStorageCageDetailsMapper.selectById(Slot)); |
| | | for (BigStorageCageDetails bigStorageCageDetails:bigStorageCageDetailsList |
| | | ) { |
| | | width-=Integer.parseInt(bigStorageCageDetails.getWidth().toString())+bigStorageCageDetails.getGap(); |
| | | } |
| | | //修改格子剩余宽度 |
| | | bigStorageCageMapper.UpdateRemainWidth(Slot,width); |
| | | } |
| | | } |
New file |
| | |
| | | package com.mes.component; |
| | | |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.service.impl.BigStorageCageServiceImpl; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.service.impl.TemperingGlassInfoServiceImpl; |
| | | import com.mes.uppattenusage.entity.GlassInfo; |
| | | import com.mes.uppattenusage.service.impl.GlassInfoServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import java.util.List; |
| | | |
| | | public class PlcStorageCage extends Thread { |
| | | |
| | | @Autowired |
| | | private BigStorageCageServiceImpl bigStorageCageServiceImpl; |
| | | @Autowired |
| | | private TemperingGlassInfoServiceImpl temperingGlassInfoServiceImpl; |
| | | @Autowired |
| | | private GlassInfoServiceImpl glassInfoServiceImpl; |
| | | @Override |
| | | public void run() { |
| | | while (this != null) { |
| | | try { |
| | | |
| | | Thread.sleep(500); |
| | | String plcFeedReq ="0"; |
| | | String plcFeedGlassid ="111"; |
| | | //Plc进片请求时 |
| | | if("1".equals(plcFeedReq)){ |
| | | BigStorageCageDetails bigStorageCageDetails=new BigStorageCageDetails(); |
| | | //传入玻璃id |
| | | GlassInfo glassInfo=glassInfoServiceImpl.getById(plcFeedGlassid); |
| | | |
| | | BigStorageCageDetails SlotInfo=bigStorageCageServiceImpl.FeedGlass(glassInfo,bigStorageCageDetails); |
| | | if(SlotInfo!=null){ |
| | | //发送任务给Plc |
| | | } |
| | | } |
| | | |
| | | //出片请求 |
| | | String plcOutReq ="0"; |
| | | if("1".equals(plcOutReq)){ |
| | | //获取钢化小片表未出笼信息 |
| | | List<TemperingGlassInfo> temperingGlassInfoList = temperingGlassInfoServiceImpl.SelectTemperingGlassInfo(); |
| | | //没有可出的玻璃时 |
| | | if(temperingGlassInfoList!=null){ |
| | | //查询是否有小片全部到齐的钢化版图 |
| | | }else{ |
| | | //继续当前钢化版图的任务 |
| | | temperingGlassInfoServiceImpl.addOutTask(temperingGlassInfoList); |
| | | } |
| | | } |
| | | |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | |
| | | @Service |
| | | public class TemperingGlassInfoServiceImpl extends ServiceImpl<TemperingGlassInfoMapper, TemperingGlassInfo> implements TemperingGlassInfoService { |
| | | |
| | | public void addOutTask(List<TemperingGlassInfo> temperingGlassInfoList) { |
| | | double carwidth=5000; |
| | | double gay=50; |
| | | //写入任务到任务表 |
| | | for (TemperingGlassInfo temperingGlassInfo:temperingGlassInfoList |
| | | ) { |
| | | if((carwidth-gay-temperingGlassInfo.getWidth())>0){ |
| | | //添加任务到任务表 |
| | | }else{ |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | public List<TemperingGlassInfo> SelectTemperingGlassInfo() { |
| | | return null; |
| | | } |
| | | } |
| | |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 127.0.0.1:8848 |
| | | server-addr: 10.153.19.150:8848 |
| | | application: |
| | | name: cacheVerticalGlass |
| | | redis: |
| | | database: 0 |
| | | host: 192.168.56.10 |
| | | host: 10.153.19.150 |
| | | port: 6379 |
| | | password: 123456 |
| | | mybatis-plus: |
| | | mapper-locations: classpath*:mapper/*.xml |
| | | configuration: |
| | |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 127.0.0.1:8848 |
| | | server-addr: 10.153.19.150:8848 |
| | | application: |
| | | name: loadGlass |
| | | redis: |
| | | database: 0 |
| | | host: 192.168.56.10 |
| | | host: 10.153.19.150 |
| | | port: 6379 |
| | | password: 123456 |
| | | mybatis-plus: |
| | | mapper-locations: classpath*:mapper/*.xml |
| | | configuration: |
| | |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 127.0.0.1:8848 |
| | | server-addr: 10.153.19.150:8848 |
| | | application: |
| | | name: temperingGlass |
| | | redis: |
| | | database: 0 |
| | | host: 192.168.56.10 |
| | | host: 10.153.19.150 |
| | | port: 6379 |
| | | password: 123456 |
| | | mybatis-plus: |
| | | mapper-locations: classpath*:mapper/*.xml |
| | | configuration: |
| | |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <artifactId>unLoadGlass</artifactId> |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>com.google.code.gson</groupId> |
| | | <artifactId>gson</artifactId> |
| | | <version>2.9.0</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.baomidou</groupId> |
| | | <artifactId>dynamic-datasource-spring-boot-starter</artifactId> |
| | | <version>3.5.2</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <properties> |
| | | <maven.compiler.source>8</maven.compiler.source> |
| | |
| | | package com.mes; |
| | | |
| | | import com.mes.tools.WebSocketServer; |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; |
| | | import org.springframework.context.ConfigurableApplicationContext; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | |
| | | @EnableDiscoveryClient |
| | | @MapperScan(basePackages = "com.mes.*.mapper") |
| | | public class UnLoadGlassApplication { |
| | | |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | SpringApplication.run(UnLoadGlassApplication.class, args); |
| | | SpringApplication springApplication = new SpringApplication(UnLoadGlassApplication.class); |
| | | ConfigurableApplicationContext applicationContext = springApplication.run(args); |
| | | WebSocketServer.setApplicationContext(applicationContext); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.common; |
| | | |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.tools.InitUtil; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import static com.mes.tools.InitUtil.readAndUpdateWordValues; |
| | | |
| | | public class PLCAutoMes extends Thread { |
| | | |
| | | // 用于存储应用程序的配置信息 |
| | | private Configuration config; |
| | | private static InitUtil initUtil; |
| | | |
| | | |
| | | // 单例实例 |
| | | private static PLCAutoMes instance; |
| | | private static String PlcMes = PLCAutoMes.class.getResource("/JsonFile/PlcMes.json").getPath(); |
| | | private static String PlcRead = PLCAutoMes.class.getResource("/JsonFile/PlcRead.json").getPath(); |
| | | private static String Plcframe = PLCAutoMes.class.getResource("/JsonFile/Plcframe.json").getPath(); |
| | | // private static String PlcParameter = PLCAutomaticParameterSettingReview2.class |
| | | // .getResource("/JsonFile/PlcParameter.json").getPath(); |
| | | // private static String PlcSign = PLCAutomaticParameterSettingReview2.class.getResource("/JsonFile/PlcSign.json") |
| | | // .getPath(); |
| | | // private static String PlcState = PLCAutomaticParameterSettingReview2.class.getResource("/JsonFile/PlcState.json") |
| | | // .getPath(); |
| | | private static String PlcAlarm = PLCAutoMes.class.getResource("/JsonFile/PlcAlarm.json").getPath(); |
| | | // private static String PlcTest = PLCAutoMes.class.getResource("/JsonFile/PlcTest.json").getPath(); |
| | | |
| | | // 调用initword方法 |
| | | |
| | | // |
| | | // public static PlcBitObject plcPlcAlarm = initUtil.initbit(PlcAlarm); |
| | | public static PlcParameterObject PlcMesObject = initUtil.initword(PlcMes); |
| | | public static PlcParameterObject PlcReadObject = initUtil.initword(PlcRead); |
| | | public static PlcParameterObject PlcframeObject = initUtil.initword(Plcframe); |
| | | |
| | | // 私有构造函数 |
| | | public PLCAutoMes() throws IOException { |
| | | |
| | | 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(100); |
| | | |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | // System.out.println(jsonFilePath); |
| | | |
| | | // readAndUpdateWordValues(PlcReadObject); |
| | | readAndUpdateWordValues(PlcMesObject); |
| | | // readAndUpdateWordValues(PlcframeObject); |
| | | // 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)); |
| | | |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.mes.common;
|
| | |
|
| | | import cn.hutool.json.JSONObject;
|
| | | import com.mes.downworkstation.service.DownGlassLogic;
|
| | | import com.mes.tools.WebSocketServer;
|
| | | import org.apache.logging.log4j.LogManager;
|
| | | import org.apache.logging.log4j.Logger;
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.function.Supplier;
|
| | |
|
| | | @Component
|
| | | public class Plchome extends Thread {
|
| | | private int i = 1;
|
| | | private static final Logger log = LogManager.getLogger(Plchome.class);
|
| | |
|
| | | private final Supplier<DownGlassLogic> plcServiceSupplier;
|
| | |
|
| | | public Plchome() {
|
| | | this.plcServiceSupplier = () -> WebSocketServer.applicationContext.getBean(DownGlassLogic.class);
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | @Override
|
| | | public void run() {
|
| | | while (!Thread.currentThread().isInterrupted()) {
|
| | | try {
|
| | | i++;
|
| | | Thread.sleep(100);
|
| | | DownGlassLogic plcService = plcServiceSupplier.get();
|
| | | // plcService.performPlcActions();
|
| | | //plcService.unloadpush();
|
| | |
|
| | | //当下片任务表状态为1时候将数据插入到下片玻璃信息表
|
| | | plcService.insertdownglassinfo();
|
| | |
|
| | |
|
| | |
|
| | | //当机械手任务表中状态为1 更新已经落架数量,并且把下片任务表的那条记录删掉 工位表流程卡绑定了架子
|
| | | plcService.downWorkstation();
|
| | |
|
| | |
|
| | | } catch (InterruptedException e) {
|
| | | Thread.currentThread().interrupt();
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | JSONObject jsonObject = new JSONObject();
|
| | | // System.out.println(arraylist6);
|
| | | jsonObject.append("data", 1);
|
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("unloadglass");
|
| | | if (sendwServer != null) {
|
| | | for (WebSocketServer webserver : sendwServer) {
|
| | | webserver.sendMessage(jsonObject.toString());
|
| | | log.info("准备向 WebSocket 服务器发送消息: {}", jsonObject.toString());
|
| | | }}
|
| | |
|
| | | }
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.mes.config; |
| | | |
| | | import com.mes.common.PLCAutoMes; |
| | | import com.mes.common.Plchome; |
| | | |
| | | import org.springframework.boot.ApplicationArguments; |
| | | import org.springframework.boot.ApplicationRunner; |
| | | import org.springframework.core.annotation.Order; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Component |
| | | @Order(1) |
| | | |
| | | public class AppRunnerConfig implements ApplicationRunner { |
| | | |
| | | @Override |
| | | public void run(ApplicationArguments args) throws Exception { |
| | | // TODO Auto-generated method stub |
| | | // |
| | | System.out.println("启动完成"); |
| | | |
| | | |
| | | |
| | | new PLCAutoMes().start(); |
| | | |
| | | new Plchome().start(); |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.mes.device; |
| | | |
| | | public class PlcBitInfo { |
| | | |
| | | public PlcBitInfo(String startAddress) { |
| | | this.startAddress = startAddress; |
| | | } |
| | | private String startAddress; |
| | | // 参数标识 |
| | | private String codeId; |
| | | |
| | | // 参数名称 |
| | | private String name; |
| | | |
| | | // 读取 参数值 |
| | | private Boolean value; |
| | | // 参数地址 |
| | | private int addressIndex; |
| | | |
| | | public String getCodeId() { |
| | | return this.codeId; |
| | | } |
| | | |
| | | public void setCodeId(String codeId) { |
| | | this.codeId = codeId; |
| | | } |
| | | |
| | | public String getName() { |
| | | return this.name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public Boolean getValue() { |
| | | return this.value; |
| | | } |
| | | |
| | | public void setValue(Boolean value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | |
| | | public int getAddressIndex() { |
| | | return this.addressIndex; |
| | | } |
| | | /** |
| | | * 获取地址 |
| | | * |
| | | * @param index 索引地址 |
| | | */ |
| | | public String getAddress(int index) { |
| | | String[] stringdatas = this.startAddress.trim().split("\\."); |
| | | if (stringdatas.length < 2 ) |
| | | return null; |
| | | int dbwindex = 0; |
| | | int bitindex = 0; |
| | | if (stringdatas.length == 3) { |
| | | dbwindex = Integer.parseInt(stringdatas[1]); |
| | | bitindex = Integer.parseInt(stringdatas[2]); |
| | | } else |
| | | return null; |
| | | dbwindex+=index/8; |
| | | bitindex+=index%8; |
| | | return stringdatas[0]+"."+dbwindex+"."+bitindex; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | public void setAddressIndex(int addressindex) { |
| | | this.addressIndex = addressindex; |
| | | } |
| | | } |
New file |
| | |
| | | package com.mes.device; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public class PlcBitObject { |
| | | |
| | | // 该模块数据类型,数据起始位置 |
| | | private String plcAddressBegin; |
| | | // 数据地址长度:第一参数到最后一个参数的长度 |
| | | private int plcAddressLength; |
| | | private ArrayList<PlcBitInfo> plcBitList; |
| | | |
| | | /** |
| | | * @return 数据区开始地址 |
| | | */ |
| | | public String getPlcAddressBegin() { |
| | | return plcAddressBegin; |
| | | } |
| | | |
| | | /** |
| | | * @param plcAddressBegin 设置数据区开始地址 |
| | | */ |
| | | public void setPlcAddressBegin(String plcAddressBegin) { |
| | | this.plcAddressBegin = plcAddressBegin; |
| | | } |
| | | |
| | | /** |
| | | * @return 数据区 读取所有数据所需的长度(以byte类型为基准) |
| | | */ |
| | | public int getPlcAddressLength() { |
| | | return plcAddressLength; |
| | | } |
| | | |
| | | /** |
| | | * @return 设置:数据区 读取所有数据所需的长度(以byte类型为基准) |
| | | */ |
| | | public void setPlcAddressLength(int plcAddressLength) { |
| | | this.plcAddressLength = plcAddressLength; |
| | | } |
| | | |
| | | /** |
| | | * @return 获取参数实例集合 |
| | | */ |
| | | public ArrayList<PlcBitInfo> getBitList() { |
| | | return plcBitList; |
| | | } |
| | | |
| | | /** |
| | | * 根据参数标识 获取某个参数实例 |
| | | * |
| | | * @param codeid 参数标识 |
| | | * @return 获取某个参数实例 |
| | | */ |
| | | public PlcBitInfo getPlcBit(String codeid) { |
| | | if (plcBitList != null) { |
| | | for (PlcBitInfo plcbitInfo : plcBitList) { |
| | | if (plcbitInfo.getCodeId().equals(codeid)) |
| | | return plcbitInfo; |
| | | } |
| | | return null; |
| | | } else |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 根据参数标识 获取某个参数实例 |
| | | * |
| | | * @param codeid 参数标识 |
| | | * @return 获取某个参数实例 |
| | | */ |
| | | public List<Boolean> getPlcBitValues(List<String> codeids) { |
| | | List<Boolean> arrayList = new ArrayList<>(); |
| | | if (plcBitList != null) { |
| | | Map<String, Boolean> resultMap = new LinkedHashMap<>(); // 使用 LinkedHashMap 保留插入顺序 |
| | | for (PlcBitInfo plcBitInfo : plcBitList) { |
| | | if (codeids.contains(plcBitInfo.getCodeId().toString())) { |
| | | resultMap.put(plcBitInfo.getCodeId().toString(), plcBitInfo.getValue()); |
| | | } |
| | | } |
| | | for (String codeId : codeids) { // 按照传入参数的顺序遍历 |
| | | Boolean value = resultMap.get(codeId); |
| | | if (value != null) { |
| | | arrayList.add(value); |
| | | } else { |
| | | arrayList.add(null); // 如果找不到对应的值,添加 null |
| | | } |
| | | } |
| | | } |
| | | return arrayList; |
| | | } |
| | | |
| | | |
| | | public List<String> getAddressListByCodeId(List<String> codeIdList) { |
| | | List<String> addressList = new ArrayList<>(); |
| | | for (String codeId : codeIdList) { |
| | | for (PlcBitInfo plcBitInfo : plcBitList) { |
| | | if (plcBitInfo.getCodeId().equals(codeId)) { |
| | | int index = plcBitInfo.getAddressIndex(); |
| | | String address = plcBitInfo.getAddress(index); |
| | | if (address != null) { |
| | | addressList.add(address); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return addressList; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加参数实例 |
| | | * |
| | | * @param param 参数实例 |
| | | */ |
| | | public void addPlcBit(PlcBitInfo param) { |
| | | if (plcBitList != null) |
| | | plcBitList.add(param); |
| | | else { |
| | | plcBitList = new ArrayList<PlcBitInfo>(); |
| | | plcBitList.add(param); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据PLC返回的数据 给参数实例赋值 |
| | | * |
| | | * @param plcValueArray PLC读取回来的byte类型数据集合 |
| | | */ |
| | | public void setPlcBitList(List<Boolean> plcValueArray) { |
| | | if (plcBitList != null) { |
| | | for (PlcBitInfo plcbitInfo : plcBitList) { |
| | | plcbitInfo.setValue(plcValueArray.get(plcbitInfo.getAddressIndex())); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.device; |
| | | public class PlcParameterInfo { |
| | | public PlcParameterInfo(String startAddress) { |
| | | this.startAddress = startAddress; |
| | | } |
| | | private String startAddress; |
| | | // 参数标识 |
| | | private String codeId; |
| | | |
| | | // 参数名称 |
| | | private String name; |
| | | |
| | | // 读取 参数值 |
| | | private String value; |
| | | |
| | | // // 写入 参数值 |
| | | // private String writeValue; |
| | | |
| | | // 参数单位 |
| | | private String unit; |
| | | |
| | | // 参数值转换系数 |
| | | private int ratio; |
| | | |
| | | // 参数地址 |
| | | private int addressIndex; |
| | | |
| | | // 参数地址位长度 |
| | | private int addressLength; |
| | | |
| | | public String getCodeId() { |
| | | return this.codeId; |
| | | } |
| | | |
| | | public void setCodeId(String codeId) { |
| | | this.codeId = codeId; |
| | | } |
| | | |
| | | public String getName() { |
| | | return this.name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getValue() { |
| | | return this.value; |
| | | } |
| | | |
| | | public void setValue(String value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | // public String getWriteValue() { |
| | | // return this.writeValue; |
| | | // } |
| | | |
| | | // public void setWriteValue(String writeValue) { |
| | | // this.writeValue = writeValue; |
| | | // } |
| | | |
| | | public String getUnit() { |
| | | return this.unit; |
| | | } |
| | | |
| | | public void setUnit(String unit) { |
| | | this.unit = unit; |
| | | } |
| | | |
| | | public int getAddressIndex() { |
| | | return this.addressIndex; |
| | | } |
| | | |
| | | public void setAddressIndex(int addressindex) { |
| | | this.addressIndex = addressindex; |
| | | } |
| | | |
| | | public int getAddressLength() { |
| | | return this.addressLength; |
| | | } |
| | | |
| | | public void setAddressLength(int addresslength) { |
| | | this.addressLength = addresslength; |
| | | } |
| | | |
| | | public int getRatio() { |
| | | return this.ratio; |
| | | } |
| | | |
| | | public void setRatio(int ratio) { |
| | | this.ratio = ratio; |
| | | } |
| | | |
| | | /** |
| | | * 获取地址 |
| | | * |
| | | * @param index 索引地址 |
| | | */ |
| | | public String getAddress(int index) { |
| | | String[] stringdatas = this.startAddress.trim().split("\\."); |
| | | int addressLength=this.addressLength; |
| | | if (addressLength < 2 ){ |
| | | return null; |
| | | } |
| | | |
| | | if (addressLength == 2 ) { |
| | | int wordindex = index; |
| | | |
| | | return stringdatas[0] + "." + wordindex; |
| | | } |
| | | if (addressLength == 14 ) { |
| | | int wordindex = index; |
| | | int newIndex = wordindex + 13; |
| | | return stringdatas[0] + "." + wordindex +"-" + newIndex; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public int getPlcAddress() { |
| | | |
| | | return addressIndex; |
| | | } |
| | | |
| | | public String getAddress() { |
| | | return getAddress(this.addressIndex); |
| | | } |
| | | } |
New file |
| | |
| | | package com.mes.device; |
| | | |
| | | import java.lang.reflect.Array; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.ArrayList; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public class PlcParameterObject { |
| | | |
| | | // 该模块数据类型,数据起始位置 |
| | | private String plcAddressBegin; |
| | | // 数据地址长度:第一参数到最后一个参数的长度 |
| | | private int plcAddressLength; |
| | | private ArrayList<PlcParameterInfo> plcParameterList; |
| | | |
| | | |
| | | |
| | | /** |
| | | * @return 数据区开始地址 |
| | | */ |
| | | public String getPlcAddressBegin() { |
| | | return plcAddressBegin; |
| | | } |
| | | |
| | | /** |
| | | * @param plcAddressBegin 设置数据区开始地址 |
| | | */ |
| | | public void setPlcAddressBegin(String plcAddressBegin) { |
| | | this.plcAddressBegin = plcAddressBegin; |
| | | } |
| | | |
| | | /** |
| | | * @return 数据区 读取所有数据所需的长度(以byte类型为基准) |
| | | */ |
| | | public int getPlcAddressLength() { |
| | | return plcAddressLength; |
| | | } |
| | | |
| | | /** |
| | | * @return 设置:数据区 读取所有数据所需的长度(以byte类型为基准) |
| | | */ |
| | | public void setPlcAddressLength(int plcAddressLength) { |
| | | this.plcAddressLength = plcAddressLength; |
| | | } |
| | | |
| | | /** |
| | | * @return 获取参数实例集合 |
| | | */ |
| | | public ArrayList<PlcParameterInfo> getPlcParameterList() { |
| | | return plcParameterList; |
| | | } |
| | | |
| | | /** |
| | | * 根据参数标识 获取某个参数实例 |
| | | * |
| | | * @param codeid 参数标识 |
| | | * @return 获取某个参数实例 |
| | | */ |
| | | public PlcParameterInfo getPlcParameter(String codeid) { |
| | | if (plcParameterList != null) { |
| | | for (PlcParameterInfo plcParameterInfo : plcParameterList) { |
| | | if (plcParameterInfo.getCodeId().equals(codeid)) |
| | | return plcParameterInfo; |
| | | } |
| | | return null; |
| | | } else |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据参数标识 获取某个参数实例 |
| | | * |
| | | * @param codeids 参数标识 |
| | | * @return 获取某个参数实例 |
| | | */ |
| | | public List<String> getPlcParameterValues(List<String> codeids) { |
| | | List<String> arrayList = new ArrayList<>(); |
| | | if (plcParameterList != null) { |
| | | Map<String, PlcParameterInfo> resultMap = new LinkedHashMap<>(); // 使用 LinkedHashMap 保留插入顺序 |
| | | for (PlcParameterInfo plcParameterInfo : plcParameterList) { |
| | | if (codeids.contains(plcParameterInfo.getCodeId())) { |
| | | resultMap.put(plcParameterInfo.getCodeId(), plcParameterInfo); |
| | | } |
| | | } |
| | | for (String codeId : codeids) { // 按照传入参数的顺序遍历 |
| | | PlcParameterInfo plcParameterInfo = resultMap.get(codeId); |
| | | if (plcParameterInfo != null) { |
| | | arrayList.add(plcParameterInfo.getValue()); |
| | | } else { |
| | | arrayList.add(null); // 如果找不到对应的值,添加 null |
| | | } |
| | | } |
| | | } |
| | | return arrayList; |
| | | } |
| | | |
| | | |
| | | public List<String> getAddressListByCodeId(List<String> codeIdList) { |
| | | List<String> addressList = new ArrayList<>(); |
| | | for (String codeId : codeIdList) { |
| | | for (PlcParameterInfo plcParameterInfo : plcParameterList) { |
| | | if (plcParameterInfo.getCodeId().equals(codeId)) { |
| | | int index = plcParameterInfo.getAddressIndex(); |
| | | String address = plcParameterInfo.getAddress(index); |
| | | if (address != null) { |
| | | addressList.add(address); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return addressList; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 添加参数实例 |
| | | * |
| | | * @param param 参数实例 |
| | | */ |
| | | public void addPlcParameter(PlcParameterInfo param) { |
| | | if (plcParameterList != null) |
| | | plcParameterList.add(param); |
| | | else { |
| | | plcParameterList = new ArrayList<PlcParameterInfo>(); |
| | | plcParameterList.add(param); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据PLC返回的数据 给参数实例赋值 |
| | | * |
| | | * @param plcValueArray PLC读取回来的byte类型数据集合 |
| | | */ |
| | | 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) { |
| | | plcParameterInfo.setValue(String.valueOf(byte2short(valueList))); |
| | | } |
| | | else if (plcParameterInfo.getAddressLength()==14) { |
| | | plcParameterInfo.setValue((byteToHexString(valueList))); |
| | | } |
| | | |
| | | else |
| | | { |
| | | String valuestr = new String(valueList); |
| | | plcParameterInfo.setValue(valuestr); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | /** |
| | | * short类型转byte[] |
| | | * |
| | | * @param s short类型值 |
| | | */ |
| | | public static byte[] short2byte(short s){ |
| | | byte[] b = new byte[2]; |
| | | for(int i = 0; i < 2; i++){ |
| | | int offset = 16 - (i+1)*8; //因为byte占4个字节,所以要计算偏移量 |
| | | b[i] = (byte)((s >> offset)&0xff); //把16位分为2个8位进行分别存储 |
| | | } |
| | | return b; |
| | | } |
| | | /** |
| | | * byte[]类型转short |
| | | * |
| | | * @param b byte[]类型值 |
| | | */ |
| | | public static short byte2short(byte[] b){ |
| | | short l = 0; |
| | | for (int i = 0; i < 2; i++) { |
| | | l<<=8; //<<=和我们的 +=是一样的,意思就是 l = l << 8 |
| | | l |= (b[i] & 0xff); //和上面也是一样的 l = l | (b[i]&0xff) |
| | | } |
| | | return l; |
| | | } |
| | | |
| | | public static String byteToHexString(byte[] bytes) { |
| | | |
| | | String str = new String(bytes, StandardCharsets.UTF_8); |
| | | return str; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @since 2024-03-27 |
| | | */ |
| | | @Data |
| | | @Component |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class DownGlassInfo implements Serializable { |
| | | |
| | |
| | | /** |
| | | * 下片玻璃信息表id |
| | | */ |
| | | private Integer id; |
| | | private int id; |
| | | |
| | | /** |
| | | * 流程卡号 |
| | |
| | | private Double thickness; |
| | | |
| | | |
| | | private int Filmsid; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-03-27 |
| | | */ |
| | | import java.util.List; |
| | | |
| | | @Repository |
| | | public interface DownGlassInfoMapper extends BaseMapper<DownGlassInfo> { |
| | | |
| | | // 查询下片任务表中状态为1的下片信息 |
| | | List<DownGlassInfo> selectunloadingtaskstate(); |
| | | |
| | | void updateTaskStateToZero(@Param("flowCardId") String flowCardId); |
| | | |
| | | Integer getMaxSequenceByFlowCardId(@Param("flowCardId") String flowCardId); |
| | | |
| | | void deletetask(@Param("flowCardId") String flowCardId); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface DownGlassInfoService extends IService<DownGlassInfo> { |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | @Service |
| | | public class DownGlassInfoServiceImpl extends ServiceImpl<DownGlassInfoMapper, DownGlassInfo> implements DownGlassInfoService { |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.mes.downworkstation.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | | import com.mes.downworkstation.service.DownWorkstationService; |
| | | import com.mes.uppattenusage.service.GlassInfoService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author zhoush |
| | | * @since 2024-03-27 |
| | | */ |
| | | |
| | | @RestController |
| | | @RequestMapping("/downWorkstation") |
| | | @RequestMapping("/api/downWorkstation") |
| | | public class DownWorkstationController { |
| | | |
| | | @Autowired |
| | | private DownWorkstationService downWorkstationService; |
| | | @Autowired |
| | | private GlassInfoService glassInfoService; |
| | | |
| | | @GetMapping("/getone") |
| | | public ResponseEntity<?> getOneDownWorkstations() { |
| | | try { |
| | | List<DownWorkstation> data = downWorkstationService.getoneDownWorkstations(); |
| | | // 构建符合预期格式的响应数据 |
| | | Map<String, Object> responseData = new HashMap<>(); |
| | | responseData.put("code", 200); |
| | | responseData.put("msg", "成功"); |
| | | responseData.put("data", data); |
| | | // 返回 ResponseEntity 对象,包含响应数据和状态码 |
| | | return ResponseEntity.ok(responseData); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | // 如果出现异常,返回错误信息 |
| | | Map<String, Object> errorResponse = new HashMap<>(); |
| | | errorResponse.put("code", 500); |
| | | errorResponse.put("msg", "服务器内部错误"); |
| | | return ResponseEntity.status(500).body(errorResponse); |
| | | } |
| | | } |
| | | |
| | | @GetMapping("/gettwo") |
| | | public List<DownWorkstation> gettwoDownWorkstations() { |
| | | return downWorkstationService.gettwoDownWorkstations(); |
| | | } |
| | | @GetMapping("/getflowCardId") |
| | | public ResponseEntity<Map<String, Object>> getflowCardId() { |
| | | Map<String, Object> responseData = new HashMap<>(); |
| | | try { |
| | | List<Map<String, Object>> data = downWorkstationService.getflowCardId(); |
| | | responseData.put("code", 200); |
| | | responseData.put("msg", "成功"); |
| | | responseData.put("data", data); |
| | | return ResponseEntity.ok(responseData); |
| | | } catch (Exception e) { |
| | | responseData.put("code", 500); |
| | | responseData.put("msg", "失败"); |
| | | responseData.put("data", null); |
| | | return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(responseData); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @PostMapping("/updateFlowCardId") |
| | | public ResponseEntity<Map<String, Object>> updateFlowCardId(@RequestBody Map<String, Object> requestData) { |
| | | // 从 requestData 中获取传入的 flowCardId |
| | | String flowCardId = (String) requestData.get("flowCardId"); |
| | | int workstationId = (int) requestData.get("workstationId"); |
| | | |
| | | // 查询对应 flowCardId 的玻璃信息总数量 |
| | | int glassInfoCount = glassInfoService.getGlassInfoCountByFlowCardId(flowCardId); |
| | | |
| | | // 更新 down_workstation 表中的总数量 |
| | | glassInfoService.updateFlowCardIdAndCount(flowCardId, glassInfoCount, workstationId); |
| | | |
| | | // 构建响应数据 |
| | | Map<String, Object> responseData = new HashMap<>(); |
| | | responseData.put("message", "updated successfully"); |
| | | responseData.put("code", 200); |
| | | // 返回处理结果 |
| | | return ResponseEntity.ok(responseData); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/clear") |
| | | public ResponseEntity<Map<String, Object>> clearWorkstationInfo(@RequestBody Map<String, Object> requestData) { |
| | | // 调用 DownWorkstationService 中的方法清除指定工位ID的信息 |
| | | int workstationId = (int) requestData.get("workstationId"); |
| | | |
| | | int totalWorkstations = downWorkstationService.getTotalQuantity(workstationId); |
| | | int downWorkstations = downWorkstationService.getRacksNumber(workstationId); |
| | | |
| | | |
| | | if (downWorkstations == totalWorkstations) { |
| | | downWorkstationService.clearFlowCardId(workstationId); |
| | | Map<String, Object> responseData = new HashMap<>(); |
| | | responseData.put("message", "cleared successfully"); |
| | | responseData.put("code", 200); |
| | | // 返回处理结果 |
| | | return ResponseEntity.ok(responseData); |
| | | } |
| | | else { |
| | | // 如果总数量和落架数量不一致,返回错误响应 |
| | | Map<String, Object> errorResponse = new HashMap<>(); |
| | | errorResponse.put("message", "Total workstations count does not match down workstations count."); |
| | | errorResponse.put("code", 400); |
| | | return ResponseEntity.badRequest().body(errorResponse); |
| | | } |
| | | |
| | | |
| | | // 构建响应数据 |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | private Integer workState; |
| | | |
| | | |
| | | private Integer Racksnumber; |
| | | |
| | | |
| | | } |
| | |
| | | package com.mes.downworkstation.mapper; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.annotation.InterceptorIgnore; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | | import org.apache.ibatis.annotations.*; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author zhoush |
| | | * @since 2024-03-27 |
| | | */ |
| | | @Mapper |
| | | @Repository |
| | | @InterceptorIgnore(tenantLine = "true") |
| | | @DS("hangzhoumes") // 指定使用 hangzhoumes 数据源 |
| | | public interface DownWorkstationMapper extends BaseMapper<DownWorkstation> { |
| | | |
| | | |
| | | //查询工位表和任务表中状态为1的流程卡号和已落架数量 |
| | | @Select("SELECT dwt.flow_card_id,dw.id,dw.racks_number FROM down_workstation_task dwt JOIN down_workstation dw ON dwt.flow_card_id = dw.flow_card_id WHERE dwt.state = 1 LIMIT 1") |
| | | List<DownWorkstation> selectdownWorkstationstate(); |
| | | //更新落架数量 |
| | | @Update("UPDATE down_workstation SET racks_number = #{racksNumber} " + |
| | | "WHERE flow_card_id = #{flowCardId}") |
| | | void update_racks_number(@Param("flowCardId") String flowCardId, |
| | | @Param("racksNumber") Integer racksNumber); |
| | | |
| | | //插入机械任务表 |
| | | @Insert("INSERT INTO down_workstation_task (flow_card_id, width, height, thickness, filmsid,state) " + |
| | | "VALUES (#{flowCardId}, #{width}, #{height}, #{thickness}, #{filmsid},1)") |
| | | void insertdownWorkstationtask(DownGlassInfo downGlassInfo); |
| | | |
| | | //根据工位id更新实体类接收的数据 |
| | | @Update("UPDATE down_workstation SET width = #{width}, height = #{height}, flow_card_id = #{flowCardId} WHERE workstation_id = #{workstationId}") |
| | | void updateFlowCardId(DownWorkstation downWorkstation); |
| | | |
| | | |
| | | |
| | | //满架拉走,清空信息 |
| | | @Update("UPDATE down_workstation SET width = null, height = null, flow_card_id = null WHERE workstation_id = #{workstationId}") |
| | | void clearFlowCardId(DownWorkstation downWorkstation); |
| | | |
| | | |
| | | |
| | | @Update("UPDATE down_workstation_task SET state = 0 WHERE flow_card_id = #{flowCardId}") |
| | | void update_task_state_to_zero(@Param("flowCardId") String flowCardId); |
| | | |
| | | |
| | | @Select(" SELECT * FROM down_workstation WHERE workstation_id >= 1 AND workstation_id <= 5") |
| | | List<DownWorkstation> getoneDownWorkstations(); |
| | | |
| | | |
| | | @Select(" SELECT * FROM down_workstation WHERE workstation_id >= 6 AND workstation_id <= 10") |
| | | List<DownWorkstation> gettwoDownWorkstations(); |
| | | |
| | | |
| | | |
| | | @Select("SELECT DISTINCT flowcard_id from glass_info") |
| | | @ResultType(Map.class) |
| | | List<Map<String, Object>> getflowCardId(); |
| | | |
| | | @Update("UPDATE down_workstation SET flow_card_id = NULL, total_quantity = 0, racks_number = 0 WHERE workstation_id = #{workstationId}") |
| | | void clearFlowCardInfoByWorkstationId(@Param("workstationId") int workstationId); |
| | | |
| | | // 获取总数量 |
| | | @Select("SELECT total_quantity FROM down_workstation WHERE workstation_id = #{workstationId}") |
| | | int getTotalQuantity(@Param("workstationId") int workstationId); |
| | | |
| | | // 获取落架数量 |
| | | @Select("SELECT racks_number FROM down_workstation WHERE workstation_id = #{workstationId}") |
| | | int getRacksNumber(@Param("workstationId") int workstationId); |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.downworkstation.service;
|
| | |
|
| | | import com.mes.common.PLCAutoMes;
|
| | | import com.mes.downglassinfo.entity.DownGlassInfo;
|
| | | import com.mes.downglassinfo.service.DownGlassInfoService;
|
| | | import com.mes.downstorage.entity.DownStorageCageDetails;
|
| | | import com.mes.downworkstation.entity.DownWorkstation;
|
| | | import com.mes.device.PlcParameterObject;
|
| | | import com.mes.downglassinfo.mapper.DownGlassInfoMapper;
|
| | | import com.mes.downworkstation.mapper.DownWorkstationMapper;
|
| | | import com.mes.tools.WebSocketServer;
|
| | | import lombok.Data;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | @Data
|
| | | @Service
|
| | | public class DownGlassLogic {
|
| | | @Autowired
|
| | | private DownGlassInfo downGlassInfo;
|
| | | private DownWorkstation downWorkstation;
|
| | | private DownGlassInfoMapper downGlassInfoMapper;
|
| | | private DownGlassInfoService downGlassInfoService;
|
| | | private DownWorkstationMapper downWorkstationMapper;
|
| | | PlcParameterObject plcread = PLCAutoMes.PlcReadObject;
|
| | | /**
|
| | | * // 机械手1PLC请求字
|
| | | */
|
| | | String robot1PLCrequestword = plcread.getPlcParameter("A01Position").getValue();
|
| | | /**
|
| | | * // 机械手2PLC请求字
|
| | | */
|
| | | String robot2PLCrequestword = plcread.getPlcParameter("A01Position").getValue();
|
| | | /**
|
| | | * // 玻璃id
|
| | | */
|
| | | String glassID = plcread.getPlcParameter("A01Position").getValue();
|
| | | String glasswidth = plcread.getPlcParameter("A01Position").getValue();
|
| | | String glassheight = plcread.getPlcParameter("A01Position").getValue();
|
| | | //
|
| | | String glassthickness = plcread.getPlcParameter("A01Position").getValue();
|
| | | String pLcwancheng = plcread.getPlcParameter("A01Position").getValue();
|
| | |
|
| | | /**
|
| | | * // 存放待处理的玻璃信息
|
| | | */
|
| | | private List<DownGlassInfo> glassList;
|
| | | /**
|
| | | * 存放玻璃放置在缓存笼中的详细信息
|
| | | */
|
| | | private List<DownStorageCageDetails> cageDetailsList;
|
| | |
|
| | | /**
|
| | | * //当下片任务表状态为1时候将数据插入到下片玻璃信息表
|
| | | */
|
| | |
|
| | | public void insertdownglassinfo() {
|
| | |
|
| | |
|
| | | downWorkstationMapper = WebSocketServer.applicationContext.getBean(DownWorkstationMapper.class);
|
| | | downGlassInfoService = WebSocketServer.applicationContext.getBean(DownGlassInfoService.class);
|
| | | downGlassInfoMapper = WebSocketServer.applicationContext.getBean(DownGlassInfoMapper.class);
|
| | | List<DownGlassInfo> taskdownGlassInf = downGlassInfoMapper.selectunloadingtaskstate();
|
| | | //
|
| | | if (taskdownGlassInf != null && !taskdownGlassInf.isEmpty()) {
|
| | |
|
| | | //
|
| | |
|
| | |
|
| | | for (DownGlassInfo downGlassInfo : taskdownGlassInf) {
|
| | | // 创建新的 DownGlassInfo 对象并设置相关属性
|
| | | DownGlassInfo newdownGlassInfo = new DownGlassInfo();
|
| | |
|
| | | newdownGlassInfo.setFlowCardId(downGlassInfo.getFlowCardId());
|
| | | Integer maxSequence = downGlassInfoMapper.getMaxSequenceByFlowCardId(downGlassInfo.getFlowCardId());
|
| | | // 初始化顺序字段值
|
| | | int sequence = maxSequence != null ? maxSequence + 1 : 1;
|
| | |
|
| | | newdownGlassInfo.setWidth(downGlassInfo.getWidth());
|
| | | newdownGlassInfo.setHeight(downGlassInfo.getHeight());
|
| | | newdownGlassInfo.setThickness(downGlassInfo.getThickness());
|
| | | newdownGlassInfo.setFilmsid(downGlassInfo.getFilmsid());
|
| | | // 设置顺序字段值
|
| | | newdownGlassInfo.setSequence(sequence);
|
| | |
|
| | | // 插入数据到下片玻璃信息表
|
| | | downGlassInfoMapper.insert(newdownGlassInfo);
|
| | | //插入数据到机械手任务表
|
| | | downWorkstationMapper.insertdownWorkstationtask(newdownGlassInfo);
|
| | | //更新下片任务表状态为0
|
| | | downGlassInfoMapper.updateTaskStateToZero(downGlassInfo.getFlowCardId());
|
| | |
|
| | | sequence++; // 递增顺序字段值
|
| | |
|
| | |
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * //当机械手任务表中状态为1,工位表流程卡绑定了架子 更新已经落架数量,并且把下片任务表的对应记录删掉
|
| | | */
|
| | |
|
| | | public void downWorkstation() {
|
| | |
|
| | |
|
| | | try {
|
| | | //查询下片工位表中架子是否绑定了流程卡号 工位表和任务表中状态为1的流程卡号和已落架数量
|
| | | List<DownWorkstation> taskdownWorkstation = downWorkstationMapper.selectdownWorkstationstate();
|
| | | if (taskdownWorkstation != null && !taskdownWorkstation.isEmpty()) {
|
| | | //,如果已经绑定则更新已落架数量,并且删除下片任务表中的记录
|
| | | for (DownWorkstation downWorkstation : taskdownWorkstation) {
|
| | |
|
| | | //更新下片工位表中已落架数量
|
| | | downWorkstationMapper.update_racks_number(downWorkstation.getFlowCardId(), downWorkstation.getRacksnumber() + 1);
|
| | |
|
| | | //更新机械任务表中状态为0
|
| | | downWorkstationMapper.update_task_state_to_zero(downWorkstation.getFlowCardId());
|
| | | //删除下片任务表中的记录
|
| | | downGlassInfoMapper.deletetask(downWorkstation.getFlowCardId());
|
| | |
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | | // 打印异常信息
|
| | | e.printStackTrace();
|
| | | // 或者可以进行其他异常处理,比如记录日志或者返回特定的错误信息
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * @param downWorkstation // 绑定流程卡号架子
|
| | | */
|
| | |
|
| | | public void bindingshelf(DownWorkstation downWorkstation) {
|
| | | downWorkstationMapper.updateFlowCardId(downWorkstation);
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * @param downWorkstation // 满架拉走 清除流程卡信息
|
| | | */
|
| | |
|
| | | public void clearFlowCardId(DownWorkstation downWorkstation) {
|
| | |
|
| | | downWorkstationMapper.clearFlowCardId(downWorkstation);
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | |
| | | */ |
| | | public interface DownWorkstationService extends IService<DownWorkstation> { |
| | | |
| | | List<DownWorkstation> getoneDownWorkstations(); |
| | | |
| | | List<DownWorkstation> gettwoDownWorkstations(); |
| | | |
| | | List<Map<String, Object>> getflowCardId(); |
| | | |
| | | int getTotalQuantity(int workstationId); |
| | | |
| | | int getRacksNumber(int workstationId); |
| | | |
| | | void clearFlowCardId(int workstationId); |
| | | } |
| | |
| | | package com.mes.downworkstation.service.impl; |
| | | |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | | import com.mes.downworkstation.mapper.DownWorkstationMapper; |
| | | import com.mes.downworkstation.service.DownWorkstationService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-03-27 |
| | | */ |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class DownWorkstationServiceImpl extends ServiceImpl<DownWorkstationMapper, DownWorkstation> implements DownWorkstationService { |
| | | |
| | | @Autowired |
| | | private DownWorkstationMapper downWorkstationMapper; |
| | | |
| | | @Override |
| | | public List<DownWorkstation> getoneDownWorkstations() { |
| | | return downWorkstationMapper.getoneDownWorkstations(); |
| | | } |
| | | |
| | | @Override |
| | | public List<DownWorkstation> gettwoDownWorkstations() { |
| | | return downWorkstationMapper.gettwoDownWorkstations(); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getflowCardId() { |
| | | return downWorkstationMapper.getflowCardId(); |
| | | } |
| | | |
| | | @Override |
| | | public int getTotalQuantity(int workstationId) { |
| | | Integer totalQuantity = downWorkstationMapper.getTotalQuantity(workstationId); |
| | | return totalQuantity != null ? totalQuantity : 0; |
| | | } |
| | | |
| | | @Override |
| | | public int getRacksNumber(int workstationId) { |
| | | Integer racksNumber = downWorkstationMapper.getRacksNumber(workstationId); |
| | | return racksNumber != null ? racksNumber : 0; |
| | | } |
| | | |
| | | @Override |
| | | public void clearFlowCardId(int workstationId) { |
| | | downWorkstationMapper.clearFlowCardInfoByWorkstationId(workstationId); |
| | | } |
| | | } |
New file |
| | |
| | | package com.mes.tools;
|
| | |
|
| | | import java.io.FileNotFoundException;
|
| | | import java.io.IOException;
|
| | | import java.io.InputStream;
|
| | | import java.util.Properties;
|
| | |
|
| | | /**
|
| | | * @author SNG-012
|
| | | *
|
| | | * Configuration 类用于加载配置文件并提供访问配置项的方法。
|
| | | */
|
| | | public class Configuration {
|
| | |
|
| | | /**
|
| | | * // Properties 对象,用于存储配置文件中的键值对。
|
| | | */
|
| | | private Properties properties;
|
| | |
|
| | | /**
|
| | | * @param fileName
|
| | | * @throws IOException
|
| | | * // 构造函数,根据传入的文件名加载配置文件。
|
| | | */
|
| | |
|
| | | public Configuration(String fileName) throws IOException {
|
| | | // 使用类加载器获取资源文件的输入流。
|
| | | InputStream inputStream = getClass().getClassLoader().getResourceAsStream(fileName);
|
| | | // 如果输入流为null,表示未找到文件,抛出FileNotFoundException。
|
| | | if (inputStream == null) {
|
| | | throw new FileNotFoundException("Property file '" + fileName + "' not found in the classpath");
|
| | | }
|
| | | // 实例化Properties对象。
|
| | | properties = new Properties();
|
| | | // 从输入流加载配置项。
|
| | | properties.load(inputStream);
|
| | | }
|
| | |
|
| | | /**
|
| | | * @param key
|
| | | * @return
|
| | | * // 根据配置项的键获取其对应的值。
|
| | | */
|
| | |
|
| | | public String getProperty(String key) {
|
| | | return properties.getProperty(key);
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.mes.tools;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import org.apache.poi.ss.usermodel.Cell;
|
| | | import org.apache.poi.ss.usermodel.Row;
|
| | | import org.apache.poi.ss.usermodel.Sheet;
|
| | | import org.apache.poi.ss.usermodel.Workbook;
|
| | | import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
| | |
|
| | | import java.io.FileInputStream;
|
| | | import java.io.FileWriter;
|
| | | import java.io.IOException;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Iterator;
|
| | | import java.util.LinkedHashMap;
|
| | | import java.util.List;
|
| | |
|
| | | public class ExcelToJsonConverter {
|
| | |
|
| | | public static void main(String[] args) {
|
| | | String excelFilePath = "src/main/resources/JsonFile/alarm.xlsx";
|
| | | String sheetName = "Sheet1";
|
| | | int addressColumnIndex = 0;
|
| | | int nameColumnIndex = 1;
|
| | |
|
| | | //int unitColumnIndex = 2;
|
| | | String outputFilePath = "src/main/resources/JsonFile/PlcAlarm.json";
|
| | |
|
| | | try (Workbook workbook = new XSSFWorkbook(new FileInputStream(excelFilePath))) {
|
| | | Sheet sheet = workbook.getSheet(sheetName);
|
| | |
|
| | | List<LinkedHashMap<String, Object>> jsonList = new ArrayList<>();
|
| | |
|
| | | Iterator<Row> rowIterator = sheet.iterator();
|
| | | // Skip the header row
|
| | | if (rowIterator.hasNext()) {
|
| | | rowIterator.next();
|
| | | }
|
| | |
|
| | | int plcAddressLength = 0; // 记录所有 addressLenght 的和
|
| | | int addressIndex = 0; // 自增的地址索引
|
| | | while (rowIterator.hasNext()) {
|
| | | Row row = rowIterator.next();
|
| | |
|
| | | Cell nameCell = row.getCell(nameColumnIndex);
|
| | | Cell addressCell = row.getCell(addressColumnIndex);
|
| | | // Cell unitCell = row.getCell(unitColumnIndex);
|
| | |
|
| | | String name = nameCell.getStringCellValue();
|
| | | String address = addressCell.getStringCellValue();
|
| | | // String unit = unitCell.getStringCellValue();
|
| | |
|
| | | // String addressIndex = extractAddressIndex(address);
|
| | |
|
| | | LinkedHashMap<String, Object> jsonObject = new LinkedHashMap<>();
|
| | | jsonObject.put("codeId", name);
|
| | | jsonObject.put("addressIndex", addressIndex);
|
| | |
|
| | | int addressLength = 0;
|
| | | if (address.contains("~")) {
|
| | | addressLength = 14;
|
| | | } else {
|
| | | addressLength = 2;
|
| | | }
|
| | | // jsonObject.put("addressLenght", String.valueOf(addressLength));
|
| | |
|
| | | //jsonObject.put("unit", unit);
|
| | |
|
| | | plcAddressLength += addressLength;
|
| | |
|
| | | jsonList.add(jsonObject);
|
| | | addressIndex++;
|
| | | }
|
| | |
|
| | | LinkedHashMap<String, Object> resultObject = new LinkedHashMap<>();
|
| | | resultObject.put("plcAddressBegin", "DB100.0");
|
| | | resultObject.put("plcAddressLenght", String.valueOf(plcAddressLength));
|
| | | // resultObject.put("dataType", "word");
|
| | | resultObject.put("dataType", "bit");
|
| | | resultObject.put("parameteInfor", jsonList);
|
| | |
|
| | | Gson gson = new Gson();
|
| | | String jsonOutput = gson.toJson(resultObject);
|
| | |
|
| | | try (FileWriter fileWriter = new FileWriter(outputFilePath)) {
|
| | | fileWriter.write(jsonOutput);
|
| | | }
|
| | | } catch (IOException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | private static String extractAddressIndex(String address) {
|
| | | // Assuming the address format is "DB103.DBW0" or "DB103.DBB100~DBB113"
|
| | | if (address.startsWith("DB") && address.contains(".DBW")) {
|
| | | int startIndex = address.indexOf(".DBW") + 4;
|
| | | int endIndex = address.length();
|
| | | return address.substring(startIndex, endIndex);
|
| | | } else if (address.startsWith("DB") && address.contains(".DBB")) {
|
| | | int startIndex2 = address.indexOf(".DBB") + 4;
|
| | | int endIndex2 = address.indexOf("~");
|
| | | return address.substring(startIndex2, endIndex2);
|
| | | }
|
| | | return "";
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.mes.tools;
|
| | |
|
| | | import cn.hutool.json.JSONArray;
|
| | | import cn.hutool.json.JSONObject;
|
| | | import com.mes.device.PlcBitInfo;
|
| | | import com.mes.device.PlcBitObject;
|
| | | import com.mes.device.PlcParameterInfo;
|
| | | import com.mes.device.PlcParameterObject;
|
| | |
|
| | | import java.io.BufferedReader;
|
| | | import java.io.FileReader;
|
| | | import java.io.IOException;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Arrays;
|
| | | import java.util.List;
|
| | |
|
| | | public class InitUtil {
|
| | | //初始化word
|
| | | public static PlcParameterObject initword(String jsonFilePath) {
|
| | | try {
|
| | | FileReader fileReader = new FileReader(jsonFilePath);
|
| | | BufferedReader bufferedReader = new BufferedReader(fileReader);
|
| | |
|
| | | StringBuilder content = new StringBuilder();
|
| | | String line;
|
| | |
|
| | | while ((line = bufferedReader.readLine()) != null) {
|
| | | content.append(line);
|
| | | }
|
| | |
|
| | | bufferedReader.close();
|
| | | fileReader.close();
|
| | |
|
| | | JSONObject jsonfileobj = new JSONObject(content.toString());
|
| | | JSONArray jsonArray = jsonfileobj.getJSONArray("parameteInfor");
|
| | | PlcParameterObject plcParameterObject = new PlcParameterObject();
|
| | | plcParameterObject.setPlcAddressBegin(jsonfileobj.getStr("plcAddressBegin"));//设置起始位地址
|
| | | plcParameterObject.setPlcAddressLength(Integer.valueOf(jsonfileobj.getStr("plcAddressLenght")));//设置地址长度
|
| | |
|
| | | for (int i = 0; i < jsonArray.size(); i++) {
|
| | | JSONObject parameterObj = jsonArray.getJSONObject(i);
|
| | | PlcParameterInfo plcParameterInfo = new PlcParameterInfo(jsonfileobj.getStr("plcAddressBegin")); //参数实例
|
| | | String codeid = parameterObj.getStr("codeId");
|
| | | plcParameterInfo.setCodeId(codeid);
|
| | | plcParameterInfo.setAddressIndex(Integer.valueOf(parameterObj.getStr("addressIndex")));
|
| | | //plcParameterInfo.setRatio(Integer.valueOf(parameterObj.getStr("ratio")));
|
| | | plcParameterInfo.setAddressLength(Integer.valueOf(parameterObj.getStr("addressLenght")));
|
| | | plcParameterInfo.setUnit(parameterObj.getStr("unit"));
|
| | | plcParameterObject.addPlcParameter(plcParameterInfo);
|
| | | }
|
| | | // byte[] getplcvlues = {0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02};
|
| | | // byte[] getplcvlues = S7control.getinstance().ReadByte(plcParameterObject.getPlcAddressBegin(), plcParameterObject.getPlcAddressLength());
|
| | | // plcParameterObject.setPlcParameterList(getplcvlues);
|
| | |
|
| | | return plcParameterObject;
|
| | | } catch (IOException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | //初始化bit
|
| | | public static PlcBitObject initbit(String jsonFilePath) {
|
| | | PlcBitObject plcBitObject = new PlcBitObject();
|
| | |
|
| | | try {
|
| | | FileReader fileReader = new FileReader(jsonFilePath);
|
| | | BufferedReader bufferedReader = new BufferedReader(fileReader);
|
| | |
|
| | | StringBuilder content = new StringBuilder();
|
| | | String line;
|
| | |
|
| | | while ((line = bufferedReader.readLine()) != null) {
|
| | | content.append(line);
|
| | | }
|
| | |
|
| | | bufferedReader.close();
|
| | | fileReader.close();
|
| | |
|
| | | JSONObject jsonfileobj = new JSONObject(content.toString());
|
| | | JSONArray jsonArray = jsonfileobj.getJSONArray("parameteInfor");
|
| | | plcBitObject.setPlcAddressBegin(jsonfileobj.getStr("plcAddressBegin"));//设置起始位地址
|
| | | plcBitObject.setPlcAddressLength(Integer.valueOf(jsonfileobj.getStr("plcAddressLenght")));//设置地址长度
|
| | |
|
| | | for (int i = 0; i < jsonArray.size(); i++) {
|
| | | JSONObject parameterObj = jsonArray.getJSONObject(i);
|
| | |
|
| | | PlcBitInfo plcBitInfo = new PlcBitInfo(jsonfileobj.getStr("plcAddressBegin")); //参数实例
|
| | | String codeid = parameterObj.getStr("codeId");
|
| | | plcBitInfo.setCodeId(codeid);
|
| | | plcBitInfo.setAddressIndex(Integer.valueOf(parameterObj.getStr("addressIndex")));
|
| | |
|
| | | plcBitObject.addPlcBit(plcBitInfo);
|
| | | }
|
| | | System.out.println("");
|
| | | } catch (IOException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | //Boolean[] values1 = { false, true, true, true, false, false, true, false,
|
| | | // false, true ,true };
|
| | | // List<Boolean> getplcvlues = new ArrayList<>(Arrays.asList(values1));
|
| | |
|
| | | // List<Boolean> getplcvlues = S7control.getinstance().ReadBits(plcBitObject.getPlcAddressBegin(), plcBitObject.getPlcAddressLength());
|
| | | // plcBitObject.setPlcBitList(getplcvlues);
|
| | | return plcBitObject;
|
| | | }
|
| | |
|
| | | //
|
| | | public static void readAndUpdateBitValues(PlcBitObject plcBitObject) {
|
| | |
|
| | | Boolean[] values1 = { false, true, true, true, false, false, true, false,
|
| | | false, true ,true };
|
| | | List<Boolean> getplcvlues = new ArrayList<>(Arrays.asList(values1));
|
| | | //List<Boolean> getplcvlues = S7control.getinstance().ReadBits(plcBitObject.getPlcAddressBegin(), plcBitObject.getPlcAddressLength());
|
| | | plcBitObject.setPlcBitList(getplcvlues);
|
| | | }
|
| | |
|
| | |
|
| | | public static void readAndUpdateWordValues(PlcParameterObject plcParameterObject) {
|
| | |
|
| | | byte[] getplcvlues = {0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03,0x03};
|
| | | // byte[] getplcvlues = MockS7PLC.getInstance().readByte(plcParameterObject.getPlcAddressBegin(), plcParameterObject.getPlcAddressLength());
|
| | | plcParameterObject.setPlcParameterList(getplcvlues);
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.mes.tools; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.auth0.jwt.JWT; |
| | | import com.auth0.jwt.algorithms.Algorithm; |
| | | |
| | | import java.util.Date; |
| | | |
| | | public class TokenTools { |
| | | |
| | | /** |
| | | * 生成token |
| | | * @return |
| | | */ |
| | | public static String getToken(String userid,String sign){ |
| | | return JWT.create().withAudience(userid) // 将 user id 保存到 token 里面,作为载荷 |
| | | .withExpiresAt(DateUtil.offsetHour(new Date(), 24)) // 2小时后token过期 |
| | | .sign(Algorithm.HMAC256(sign)); // 以 password 作为 token 的密钥 |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.mes.tools; |
| | | |
| | | import cn.hutool.json.JSONObject; |
| | | import cn.hutool.json.JSONUtil; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.context.ConfigurableApplicationContext; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.websocket.*; |
| | | import javax.websocket.server.PathParam; |
| | | import javax.websocket.server.ServerEndpoint; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | |
| | | @ServerEndpoint(value = "/api/talk/{username}") |
| | | @Component("webSocketServer") |
| | | public class WebSocketServer { |
| | | |
| | | // @Autowired |
| | | // HomeMapper homeMapper; |
| | | |
| | | public static ConfigurableApplicationContext applicationContext; |
| | | |
| | | // 解决无法注入mapper问题 //使用方法 |
| | | // homeMapper=WebSocketServer.applicationContext.getBean(HomeMapper.class); |
| | | public static void setApplicationContext(ConfigurableApplicationContext configurableApplicationContext) { |
| | | WebSocketServer.applicationContext = configurableApplicationContext; |
| | | } |
| | | |
| | | private static final Logger log = LoggerFactory.getLogger(WebSocketServer.class); |
| | | private List<String> messages; |
| | | /** |
| | | * 记录当前在线连接数 |
| | | */ |
| | | public static final Map<String, ArrayList<WebSocketServer>> sessionMap = new ConcurrentHashMap<>(); |
| | | |
| | | String username; |
| | | Session session; |
| | | |
| | | public WebSocketServer() { |
| | | this.messages = new ArrayList<>(); |
| | | } |
| | | |
| | | /** |
| | | * 连接建立成功调用的方法 |
| | | */ |
| | | @OnOpen |
| | | public void onOpen(Session session, @PathParam("username") String username) { |
| | | this.username = username; |
| | | this.session = session; |
| | | List<WebSocketServer> webSocketServers = sessionMap.get(username); |
| | | if (webSocketServers == null) { |
| | | ArrayList<WebSocketServer> arrayListwebserver = new ArrayList<WebSocketServer>(); |
| | | arrayListwebserver.add(this); |
| | | sessionMap.put(username, arrayListwebserver); |
| | | } else { |
| | | webSocketServers.add(this); |
| | | } |
| | | |
| | | log.info("有新用户加入,username={}, 当前在线人数为:{}", username, sessionMap.get(username).size()); |
| | | |
| | | // JSONObject result = new JSONObject(); |
| | | // JSONArray array = new JSONArray(); |
| | | // result.set("users", array); |
| | | // for (Object key : sessionMap.keySet()) { |
| | | // JSONObject jsonObject = new JSONObject(); |
| | | // jsonObject.set("username", key); |
| | | // array.add(jsonObject); |
| | | // } |
| | | |
| | | // sendAllMessage(JSONUtil.toJsonStr(result)); // 后台发送消息给所有的客户端 |
| | | } |
| | | |
| | | /** |
| | | * 连接关闭调用的方法 |
| | | */ |
| | | @OnClose |
| | | public void onClose(Session session, @PathParam("username") String username) { |
| | | List<WebSocketServer> webSocketServers = sessionMap.get(username); |
| | | ArrayList<WebSocketServer> arrayListwebserver = new ArrayList<WebSocketServer>(); |
| | | if (webSocketServers.size()>1) { |
| | | for (WebSocketServer webSocketServer : webSocketServers) { |
| | | if(webSocketServer!=this){ |
| | | arrayListwebserver.add(webSocketServer); |
| | | } |
| | | } |
| | | sessionMap.put(username, arrayListwebserver); |
| | | log.info("移除username={}一名用户session, {}的当前在线人数为:{}", username, username, sessionMap.get(username).size()); |
| | | }else{ |
| | | sessionMap.remove(username); |
| | | log.info("移除username={}一名用户session, {}连接关闭, 当前连接数为:{}", username, username, sessionMap.size()); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 收到客户端消息后调用的方法 |
| | | * 后台收到客户端发送过来的消息 |
| | | * onMessage 是一个消息的中转站 |
| | | * 接受 浏览器端 socket.send 发送过来的 json数据 |
| | | * |
| | | * @param message 客户端发送过来的消息 |
| | | */ |
| | | @OnMessage |
| | | public void onMessage(String message, Session session, @PathParam("username") String username) { |
| | | log.info("服务端收到用户username={}的消息:{}", username, message); |
| | | JSONObject obj = JSONUtil.parseObj(message); |
| | | String text = obj.getStr("data"); |
| | | |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.set("message", text); |
| | | this.messages.add(text); |
| | | this.sendMessage(jsonObject.toString()); // JSONUtil.toJsonStr(jsonObject) |
| | | |
| | | } |
| | | |
| | | @OnError |
| | | public void onError(Session session, Throwable error) { |
| | | log.error("发生错误"); |
| | | error.printStackTrace(); |
| | | } |
| | | |
| | | /** |
| | | * 服务端发送消息给客户端 |
| | | */ |
| | | public void sendMessage(String message) { |
| | | try { |
| | | // log.info("服务端给客户端[{}]发送消息{}", this.session.getId(), message); |
| | | this.session.getBasicRemote().sendText(message); |
| | | } catch (Exception e) { |
| | | log.error("服务端发送消息给客户端失败", e); |
| | | } |
| | | } |
| | | |
| | | // /** |
| | | // * 服务端发送消息给所有客户端 |
| | | // */ |
| | | // public void sendAllMessage(String message) { |
| | | // try { |
| | | // for (WebSocketServer webSocketServer : sessionMap.values()) { |
| | | // // log.info("服务端给客户端[{}]发送消息{}", this.session.getId(), message); |
| | | // webSocketServer.sendMessage(message); |
| | | // } |
| | | // } catch (Exception e) { |
| | | // log.error("服务端发送消息给客户端失败", e); |
| | | // } |
| | | // } |
| | | |
| | | public List<String> getMessages() { |
| | | return messages; |
| | | |
| | | } |
| | | |
| | | public void clearMessages() { |
| | | messages.clear(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.mes.uppattenusage.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import com.mes.uppattenusage.entity.GlassInfo; |
| | | import org.apache.ibatis.annotations.Delete; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.apache.ibatis.annotations.Update; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface GlassInfoMapper extends BaseMapper<GlassInfo> { |
| | | |
| | | |
| | | @Select("SELECT COUNT(*) FROM glass_info WHERE flowcard_id = #{flowCardId}") |
| | | int getGlassInfoCountByFlowCardId(@Param("flowCardId") String flowCardId); |
| | | |
| | | @Update("UPDATE down_workstation SET total_quantity = #{glassInfoCount},flow_card_id=#{flowCardId} WHERE workstation_id = #{workstationId}") |
| | | int updateFlowCardIdAndCount(@Param("flowCardId") String flowCardId, @Param("glassInfoCount") int glassInfoCount,@Param("workstationId")int workstationId); |
| | | |
| | | } |
| | |
| | | */ |
| | | public interface GlassInfoService extends IService<GlassInfo> { |
| | | |
| | | int getGlassInfoCountByFlowCardId(String flowCardId); |
| | | |
| | | void updateFlowCardIdAndCount(String flowCardId, int glassInfoCount, int workstationId); |
| | | } |
| | |
| | | import com.mes.uppattenusage.entity.GlassInfo; |
| | | import com.mes.uppattenusage.mapper.GlassInfoMapper; |
| | | import com.mes.uppattenusage.service.GlassInfoService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | |
| | | @Service |
| | | public class GlassInfoServiceImpl extends ServiceImpl<GlassInfoMapper, GlassInfo> implements GlassInfoService { |
| | | |
| | | private GlassInfoMapper glassInfoMapper; |
| | | |
| | | @Autowired |
| | | public GlassInfoServiceImpl(GlassInfoMapper glassInfoMapper) { |
| | | this.glassInfoMapper = glassInfoMapper; |
| | | } |
| | | |
| | | @Override |
| | | public int getGlassInfoCountByFlowCardId(String flowCardId) { |
| | | return glassInfoMapper.getGlassInfoCountByFlowCardId(flowCardId); |
| | | } |
| | | |
| | | @Override |
| | | public void updateFlowCardIdAndCount(String flowCardId, int glassInfoCount, int workstationId) { |
| | | int rowsAffected = glassInfoMapper.updateFlowCardIdAndCount(flowCardId, glassInfoCount, workstationId); |
| | | if (rowsAffected > 0) { |
| | | System.out.println("更新架子上流程卡 ID 和数量成功"); |
| | | } else { |
| | | System.out.println("更新架子上流程卡 ID 和数量失败"); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | {
|
| | | "plcAddressBegin": "DB104.0.0",
|
| | | "plcAddressLenght": "91",
|
| | | "dataType": "bit",
|
| | | "parameteInfor": [
|
| | | {
|
| | | "codeId": "D01VFDerror",
|
| | | "addressIndex": 0
|
| | | },
|
| | | {
|
| | | "codeId": "D02VFDerror",
|
| | | "addressIndex": 1
|
| | | },
|
| | | {
|
| | | "codeId": "D03VFDerror",
|
| | | "addressIndex": 2
|
| | | },
|
| | | {
|
| | | "codeId": "D04VFDerror",
|
| | | "addressIndex": 3
|
| | | },
|
| | | {
|
| | | "codeId": "D05VFDerror",
|
| | | "addressIndex": 4
|
| | | },
|
| | | {
|
| | | "codeId": "D06VFDerror",
|
| | | "addressIndex": 5
|
| | | },
|
| | | {
|
| | | "codeId": "B01VFDerror",
|
| | | "addressIndex": 6
|
| | | },
|
| | | {
|
| | | "codeId": "B02VFDerror",
|
| | | "addressIndex": 7
|
| | | },
|
| | | {
|
| | | "codeId": "A01VFDerror",
|
| | | "addressIndex": 8
|
| | | },
|
| | | {
|
| | | "codeId": "A02VFDerror",
|
| | | "addressIndex": 9
|
| | | },
|
| | | {
|
| | | "codeId": "A01servoturnerror",
|
| | | "addressIndex": 10
|
| | | },
|
| | | {
|
| | | "codeId": "A02servoturnerror",
|
| | | "addressIndex": 11
|
| | | },
|
| | | {
|
| | | "codeId": "A01servotravelerror",
|
| | | "addressIndex": 12
|
| | | },
|
| | | {
|
| | | "codeId": "A02servotravelerror",
|
| | | "addressIndex": 13
|
| | | },
|
| | | {
|
| | | "codeId": "B01servotravelerror",
|
| | | "addressIndex": 14
|
| | | },
|
| | | {
|
| | | "codeId": "B02servotravelerror",
|
| | | "addressIndex": 15
|
| | | },
|
| | | {
|
| | | "codeId": "D01DECerror",
|
| | | "addressIndex": 16
|
| | | },
|
| | | {
|
| | | "codeId": "D01poserror",
|
| | | "addressIndex": 17
|
| | | },
|
| | | {
|
| | | "codeId": "D02DECerror",
|
| | | "addressIndex": 18
|
| | | },
|
| | | {
|
| | | "codeId": "D02poserror",
|
| | | "addressIndex": 19
|
| | | },
|
| | | {
|
| | | "codeId": "D03DECerror",
|
| | | "addressIndex": 20
|
| | | },
|
| | | {
|
| | | "codeId": "D03poserror",
|
| | | "addressIndex": 21
|
| | | },
|
| | | {
|
| | | "codeId": "D04DECerror",
|
| | | "addressIndex": 22
|
| | | },
|
| | | {
|
| | | "codeId": "D04poserror",
|
| | | "addressIndex": 23
|
| | | },
|
| | | {
|
| | | "codeId": "D05DECerror",
|
| | | "addressIndex": 24
|
| | | },
|
| | | {
|
| | | "codeId": "D05poserror",
|
| | | "addressIndex": 25
|
| | | },
|
| | | {
|
| | | "codeId": "D06DECerror",
|
| | | "addressIndex": 26
|
| | | },
|
| | | {
|
| | | "codeId": "D06poserror",
|
| | | "addressIndex": 27
|
| | | },
|
| | | {
|
| | | "codeId": "A01DECerror",
|
| | | "addressIndex": 28
|
| | | },
|
| | | {
|
| | | "codeId": "A01poserror",
|
| | | "addressIndex": 29
|
| | | },
|
| | | {
|
| | | "codeId": "A02DECerror",
|
| | | "addressIndex": 30
|
| | | },
|
| | | {
|
| | | "codeId": "A02poserror",
|
| | | "addressIndex": 31
|
| | | },
|
| | | {
|
| | | "codeId": "B01INDECerror",
|
| | | "addressIndex": 32
|
| | | },
|
| | | {
|
| | | "codeId": "B01INposerror",
|
| | | "addressIndex": 33
|
| | | },
|
| | | {
|
| | | "codeId": "B01OUTDECerror",
|
| | | "addressIndex": 34
|
| | | },
|
| | | {
|
| | | "codeId": "B01OUTposerror",
|
| | | "addressIndex": 35
|
| | | },
|
| | | {
|
| | | "codeId": "B02INDECerror",
|
| | | "addressIndex": 36
|
| | | },
|
| | | {
|
| | | "codeId": "B02INposerror",
|
| | | "addressIndex": 37
|
| | | },
|
| | | {
|
| | | "codeId": "B02OUTDECerror",
|
| | | "addressIndex": 38
|
| | | },
|
| | | {
|
| | | "codeId": "B02OUTposerror",
|
| | | "addressIndex": 39
|
| | | },
|
| | | {
|
| | | "codeId": "D01Scanglassexceedinglimit",
|
| | | "addressIndex": 40
|
| | | },
|
| | | {
|
| | | "codeId": "emergencystopalarm",
|
| | | "addressIndex": 41
|
| | | },
|
| | | {
|
| | | "codeId": "Moreglassthanknown",
|
| | | "addressIndex": 42
|
| | | },
|
| | | {
|
| | | "codeId": "lessglassthanknown",
|
| | | "addressIndex": 43
|
| | | },
|
| | | {
|
| | | "codeId": "D01conveyortimeoutalarm",
|
| | | "addressIndex": 44
|
| | | },
|
| | | {
|
| | | "codeId": "D02conveyortimeoutalarm",
|
| | | "addressIndex": 45
|
| | | },
|
| | | {
|
| | | "codeId": "D03conveyortimeoutalarm",
|
| | | "addressIndex": 46
|
| | | },
|
| | | {
|
| | | "codeId": "D04conveyortimeoutalarm",
|
| | | "addressIndex": 47
|
| | | },
|
| | | {
|
| | | "codeId": "D05conveyortimeoutalarm",
|
| | | "addressIndex": 48
|
| | | },
|
| | | {
|
| | | "codeId": "D06conveyortimeoutalarm",
|
| | | "addressIndex": 49
|
| | | },
|
| | | {
|
| | | "codeId": "A01conveyortimeoutalarm",
|
| | | "addressIndex": 50
|
| | | },
|
| | | {
|
| | | "codeId": "A02conveyortimeoutalarm",
|
| | | "addressIndex": 51
|
| | | },
|
| | | {
|
| | | "codeId": "B01conveyortimeoutalarm",
|
| | | "addressIndex": 52
|
| | | },
|
| | | {
|
| | | "codeId": "B02conveyortimeoutalarm",
|
| | | "addressIndex": 53
|
| | | },
|
| | | {
|
| | | "codeId": "A01conveyorLeftsafetyalarm",
|
| | | "addressIndex": 54
|
| | | },
|
| | | {
|
| | | "codeId": "A01conveyorrightsafetyalarm",
|
| | | "addressIndex": 55
|
| | | },
|
| | | {
|
| | | "codeId": "A02conveyorLeftsafetyalarm",
|
| | | "addressIndex": 56
|
| | | },
|
| | | {
|
| | | "codeId": "A02conveyorrightsafetyalarm",
|
| | | "addressIndex": 57
|
| | | },
|
| | | {
|
| | | "codeId": "1#buffersafetyalarm",
|
| | | "addressIndex": 58
|
| | | },
|
| | | {
|
| | | "codeId": "2#buffersafetyalarm",
|
| | | "addressIndex": 59
|
| | | },
|
| | | {
|
| | | "codeId": "3#buffersafetyalarm",
|
| | | "addressIndex": 60
|
| | | },
|
| | | {
|
| | | "codeId": "4#buffersafetyalarm",
|
| | | "addressIndex": 61
|
| | | },
|
| | | {
|
| | | "codeId": "A01.SRrightinposerror",
|
| | | "addressIndex": 62
|
| | | },
|
| | | {
|
| | | "codeId": "A02.SRleftinposerror",
|
| | | "addressIndex": 63
|
| | | },
|
| | | {
|
| | | "codeId": "B01.SRleftinposerror",
|
| | | "addressIndex": 64
|
| | | },
|
| | | {
|
| | | "codeId": "B01.SRleftdecerror",
|
| | | "addressIndex": 65
|
| | | },
|
| | | {
|
| | | "codeId": "B01.SRrightdecerror",
|
| | | "addressIndex": 66
|
| | | },
|
| | | {
|
| | | "codeId": "B01.SRrightinposerror",
|
| | | "addressIndex": 67
|
| | | },
|
| | | {
|
| | | "codeId": "B02.SRleftinposerror",
|
| | | "addressIndex": 68
|
| | | },
|
| | | {
|
| | | "codeId": "B02.SRleftdecerror",
|
| | | "addressIndex": 69
|
| | | },
|
| | | {
|
| | | "codeId": "B02.SRrightdecerror",
|
| | | "addressIndex": 70
|
| | | },
|
| | | {
|
| | | "codeId": "B02.SRrightinposerror",
|
| | | "addressIndex": 71
|
| | | },
|
| | | {
|
| | | "codeId": "A01servoturnhomed",
|
| | | "addressIndex": 72
|
| | | },
|
| | | {
|
| | | "codeId": "A02servoturnhomed",
|
| | | "addressIndex": 73
|
| | | },
|
| | | {
|
| | | "codeId": "A01servotravelhomed",
|
| | | "addressIndex": 74
|
| | | },
|
| | | {
|
| | | "codeId": "A02servotravelhomed",
|
| | | "addressIndex": 75
|
| | | },
|
| | | {
|
| | | "codeId": "B01servotravelhomed",
|
| | | "addressIndex": 76
|
| | | },
|
| | | {
|
| | | "codeId": "B02servotravelhomed",
|
| | | "addressIndex": 77
|
| | | },
|
| | | {
|
| | | "codeId": "resetDelay",
|
| | | "addressIndex": 78
|
| | | },
|
| | | {
|
| | | "codeId": "A01travelNegativelimit",
|
| | | "addressIndex": 79
|
| | | },
|
| | | {
|
| | | "codeId": "A01travelPositivelimit",
|
| | | "addressIndex": 80
|
| | | },
|
| | | {
|
| | | "codeId": "A01turnuplimit",
|
| | | "addressIndex": 81
|
| | | },
|
| | | {
|
| | | "codeId": "A01turndownlimit",
|
| | | "addressIndex": 82
|
| | | },
|
| | | {
|
| | | "codeId": "A02travelNegativelimit",
|
| | | "addressIndex": 83
|
| | | },
|
| | | {
|
| | | "codeId": "A02travelPositivelimit",
|
| | | "addressIndex": 84
|
| | | },
|
| | | {
|
| | | "codeId": "A02turnuplimit",
|
| | | "addressIndex": 85
|
| | | },
|
| | | {
|
| | | "codeId": "A02turndownlimit",
|
| | | "addressIndex": 86
|
| | | },
|
| | | {
|
| | | "codeId": "B01travelNegativelimit",
|
| | | "addressIndex": 87
|
| | | },
|
| | | {
|
| | | "codeId": "B01travelPositivelimit",
|
| | | "addressIndex": 88
|
| | | },
|
| | | {
|
| | | "codeId": "B02travelNegativelimit",
|
| | | "addressIndex": 89
|
| | | },
|
| | | {
|
| | | "codeId": "B02travelPositivelimit",
|
| | | "addressIndex": 90
|
| | | }
|
| | | ]
|
| | | } |
New file |
| | |
| | | { |
| | | "plcAddressBegin":"DB105.0", |
| | | "plcAddressLenght":"12", |
| | | "dataType":"word", |
| | | "parameteInfor":[ |
| | | { |
| | | "codeId": "OutActivate", |
| | | "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" |
| | | } |
| | | |
| | | ] |
| | | } |
New file |
| | |
| | | { |
| | | "plcAddressBegin":"DB100.0", |
| | | "plcAddressLenght":"198", |
| | | "dataType":"word", |
| | | "parameteInfor":[ |
| | | { |
| | | "codeId": "conveyorVelocity(Max)", |
| | | "addressIndex":"0", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"m/min" |
| | | }, |
| | | { |
| | | "codeId": "conveyorVelocity(AutoFAST)", |
| | | "addressIndex":"2", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"m/min" |
| | | }, |
| | | { |
| | | "codeId": "conveyorVelocity(AutoSLOW)", |
| | | "addressIndex":"4", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"m/min" |
| | | }, |
| | | { |
| | | "codeId": "conveyorVelocity(Manual)", |
| | | "addressIndex":"6", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm/S" |
| | | }, |
| | | { |
| | | "codeId": "A01A02TURNJOGVelocity", |
| | | "addressIndex":"8", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm/S" |
| | | }, |
| | | { |
| | | "codeId": "A01A02TRAVELJOGVelocity", |
| | | "addressIndex":"10", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm/S" |
| | | }, |
| | | { |
| | | "codeId": "B01B02TRAVELJOGVelocity", |
| | | "addressIndex":"12", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm/S" |
| | | }, |
| | | { |
| | | "codeId": "A01A02TURNPOSVelocityAUTO", |
| | | "addressIndex":"14", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm/S" |
| | | }, |
| | | { |
| | | "codeId": "A01TURNPOSVelocitymanual", |
| | | "addressIndex":"16", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm/S" |
| | | }, |
| | | { |
| | | "codeId": "A01A02TRAVELPOSVelocityAUTO", |
| | | "addressIndex":"18", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm/S" |
| | | }, |
| | | { |
| | | "codeId": "A01TRAVELPOSVelocitymanual", |
| | | "addressIndex":"20", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm/S" |
| | | }, |
| | | { |
| | | "codeId": "B01B02TRAVELPOSVelocityAUTO", |
| | | "addressIndex":"22", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm/S" |
| | | }, |
| | | { |
| | | "codeId": "B01TRAVELPOSVelocitymanual", |
| | | "addressIndex":"24", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm/S" |
| | | }, |
| | | { |
| | | "codeId": "A01A02conveyorVelocity(Max)", |
| | | "addressIndex":"26", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"m/min" |
| | | }, |
| | | { |
| | | "codeId": "A01A02conveyorVelocity(AutoFAST)", |
| | | "addressIndex":"28", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"m/min" |
| | | }, |
| | | { |
| | | "codeId": "A01A02conveyorVelocity(AutoSLOW)", |
| | | "addressIndex":"30", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"m/min" |
| | | }, |
| | | { |
| | | "codeId": "B01B02conveyorVelocity(Manual)", |
| | | "addressIndex":"32", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"m/min" |
| | | }, |
| | | { |
| | | "codeId": "B01B02conveyorVelocity(Max)", |
| | | "addressIndex":"34", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"m/min" |
| | | }, |
| | | { |
| | | "codeId": "B01B02conveyorVelocity(AutoFAST)", |
| | | "addressIndex":"36", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"m/min" |
| | | }, |
| | | { |
| | | "codeId": "B01B02conveyorVelocity(AutoSLOW)", |
| | | "addressIndex":"38", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"m/min" |
| | | }, |
| | | { |
| | | "codeId": "B01B02conveyorVelocity(Manual)", |
| | | "addressIndex":"40", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"m/min" |
| | | }, |
| | | { |
| | | "codeId": "gridspacing", |
| | | "addressIndex":"42", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm" |
| | | }, |
| | | { |
| | | "codeId": "A01Spliceaddresssetting", |
| | | "addressIndex":"44", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm" |
| | | }, |
| | | { |
| | | "codeId": "A02Spliceaddresssetting", |
| | | "addressIndex":"46", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm" |
| | | }, |
| | | { |
| | | "codeId": "A011#gridaddress", |
| | | "addressIndex":"48", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm" |
| | | }, |
| | | { |
| | | "codeId": "A0122#gridaddress", |
| | | "addressIndex":"50", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm" |
| | | }, |
| | | { |
| | | "codeId": "A0143#gridaddress", |
| | | "addressIndex":"52", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm" |
| | | }, |
| | | { |
| | | "codeId": "A0164#gridaddress", |
| | | "addressIndex":"54", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm" |
| | | }, |
| | | { |
| | | "codeId": "A0185#gridaddress", |
| | | "addressIndex":"56", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm" |
| | | }, |
| | | { |
| | | "codeId": "A01106#gridaddress", |
| | | "addressIndex":"58", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm" |
| | | }, |
| | | { |
| | | "codeId": "A01127#gridaddress", |
| | | "addressIndex":"60", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm" |
| | | }, |
| | | { |
| | | "codeId": "A01148#gridaddress", |
| | | "addressIndex":"62", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm" |
| | | }, |
| | | { |
| | | "codeId": "A01169#gridaddress", |
| | | "addressIndex":"64", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm" |
| | | }, |
| | | { |
| | | "codeId": "A01190#gridaddress", |
| | | "addressIndex":"66", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm" |
| | | }, |
| | | { |
| | | "codeId": "A021#gridaddress", |
| | | "addressIndex":"68", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm" |
| | | }, |
| | | { |
| | | "codeId": "A0222#gridaddress", |
| | | "addressIndex":"70", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm" |
| | | }, |
| | | { |
| | | "codeId": "A0243#gridaddress", |
| | | "addressIndex":"72", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm" |
| | | }, |
| | | { |
| | | "codeId": "A0264#gridaddress", |
| | | "addressIndex":"74", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm" |
| | | }, |
| | | { |
| | | "codeId": "A0285#gridaddress", |
| | | "addressIndex":"76", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm" |
| | | }, |
| | | { |
| | | "codeId": "A02106#gridaddress", |
| | | "addressIndex":"78", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm" |
| | | }, |
| | | { |
| | | "codeId": "A02127#gridaddress", |
| | | "addressIndex":"80", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm" |
| | | }, |
| | | { |
| | | "codeId": "A02148#gridaddress", |
| | | "addressIndex":"82", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm" |
| | | }, |
| | | { |
| | | "codeId": "A02169#gridaddress", |
| | | "addressIndex":"84", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm" |
| | | }, |
| | | { |
| | | "codeId": "A02190#gridaddress", |
| | | "addressIndex":"86", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm" |
| | | }, |
| | | { |
| | | "codeId": "B011#gridaddress", |
| | | "addressIndex":"88", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm" |
| | | }, |
| | | { |
| | | "codeId": "B0122#gridaddress", |
| | | "addressIndex":"90", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm" |
| | | }, |
| | | { |
| | | "codeId": "B0143#gridaddress", |
| | | "addressIndex":"92", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm" |
| | | }, |
| | | { |
| | | "codeId": "B0164#gridaddress", |
| | | "addressIndex":"94", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm" |
| | | }, |
| | | { |
| | | "codeId": "B0185#gridaddress", |
| | | "addressIndex":"96", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm" |
| | | }, |
| | | { |
| | | "codeId": "B02106#gridaddress", |
| | | "addressIndex":"98", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm" |
| | | }, |
| | | { |
| | | "codeId": "B02127#gridaddress", |
| | | "addressIndex":"100", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm" |
| | | }, |
| | | { |
| | | "codeId": "B02148#gridaddress", |
| | | "addressIndex":"102", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm" |
| | | }, |
| | | { |
| | | "codeId": "B02169#gridaddress", |
| | | "addressIndex":"104", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm" |
| | | }, |
| | | { |
| | | "codeId": "B02190#gridaddress", |
| | | "addressIndex":"106", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm" |
| | | }, |
| | | { |
| | | "codeId": "A01Targetgrid(Manual)", |
| | | "addressIndex":"108", |
| | | "addressLenght":"2", |
| | | "ratio":"1" |
| | | |
| | | }, |
| | | { |
| | | "codeId": " A02Targetgrid(Manual)", |
| | | "addressIndex":"110", |
| | | "addressLenght":"2", |
| | | "ratio":"1" |
| | | |
| | | }, |
| | | { |
| | | "codeId": "B01Targetgrid(Manual)", |
| | | "addressIndex":"112", |
| | | "addressLenght":"2", |
| | | "ratio":"1" |
| | | |
| | | }, |
| | | { |
| | | "codeId": "B02Targetgrid(Manual)", |
| | | "addressIndex":"114", |
| | | "addressLenght":"2", |
| | | "ratio":"1" |
| | | |
| | | }, |
| | | { |
| | | "codeId": "A01turnTargetAngle(Manual)", |
| | | "addressIndex":"116", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"°" |
| | | }, |
| | | { |
| | | "codeId": "A02turnTargetAngle(Manual)", |
| | | "addressIndex":"118", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"°" |
| | | }, |
| | | { |
| | | "codeId": "A01turnAngle1", |
| | | "addressIndex":"120", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"°" |
| | | }, |
| | | { |
| | | "codeId": "A01turnAngle2", |
| | | "addressIndex":"122", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"°" |
| | | }, |
| | | { |
| | | "codeId": "A01turnAngle3", |
| | | "addressIndex":"124", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"°" |
| | | }, |
| | | { |
| | | "codeId": "A01turnAngle4", |
| | | "addressIndex":"126", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"°" |
| | | }, |
| | | { |
| | | "codeId": "A02turnAngle1", |
| | | "addressIndex":"128", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"°" |
| | | }, |
| | | { |
| | | "codeId": "A02turnAngle2", |
| | | "addressIndex":"130", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"°" |
| | | }, |
| | | { |
| | | "codeId": "A02turnAngle3", |
| | | "addressIndex":"132", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"°" |
| | | }, |
| | | { |
| | | "codeId": "A02turnAngle4", |
| | | "addressIndex":"134", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"°" |
| | | }, |
| | | { |
| | | "codeId": "Minimumglasslength", |
| | | "addressIndex":"136", |
| | | "addressLenght":"2", |
| | | "ratio":"1" |
| | | |
| | | }, |
| | | { |
| | | "codeId": "Minimumglassheight", |
| | | "addressIndex":"138", |
| | | "addressLenght":"2", |
| | | "ratio":"1" |
| | | |
| | | }, |
| | | { |
| | | "codeId": "Maximumglasslength", |
| | | "addressIndex":"140", |
| | | "addressLenght":"2", |
| | | "ratio":"1" |
| | | |
| | | }, |
| | | { |
| | | "codeId": "Maximumglassheight", |
| | | "addressIndex":"142", |
| | | "addressLenght":"2", |
| | | "ratio":"1" |
| | | |
| | | }, |
| | | { |
| | | "codeId": "A01cellsGlassNum", |
| | | "addressIndex":"144", |
| | | "addressLenght":"2", |
| | | "ratio":"1" |
| | | |
| | | }, |
| | | { |
| | | "codeId": "A02cellsGlassNum", |
| | | "addressIndex":"146", |
| | | "addressLenght":"2", |
| | | "ratio":"1" |
| | | |
| | | }, |
| | | { |
| | | "codeId": "A01ID", |
| | | "addressIndex":"148", |
| | | "addressLenght":"14", |
| | | "ratio":"1" |
| | | |
| | | }, |
| | | { |
| | | "codeId": "A02ID", |
| | | "addressIndex":"162", |
| | | "addressLenght":"14", |
| | | "ratio":"1" |
| | | |
| | | }, |
| | | { |
| | | "codeId": "A02TRAVELPOSVelocitymanual", |
| | | "addressIndex":"176", |
| | | "addressLenght":"2", |
| | | "ratio":"1" |
| | | |
| | | }, |
| | | { |
| | | "codeId": "B02TRAVELPOSVelocitymanual", |
| | | "addressIndex":"178", |
| | | "addressLenght":"2", |
| | | "ratio":"1" |
| | | |
| | | }, |
| | | { |
| | | "codeId": "Startingpositionofthefeedca", |
| | | "addressIndex":"180", |
| | | "addressLenght":"2", |
| | | "ratio":"1" |
| | | |
| | | }, |
| | | { |
| | | "codeId": "Targetpositionofthefeedcar", |
| | | "addressIndex":"182", |
| | | "addressLenght":"2", |
| | | "ratio":"1" |
| | | |
| | | }, |
| | | { |
| | | "codeId": "Lengthofincomingglass", |
| | | "addressIndex":"184", |
| | | "addressLenght":"2", |
| | | "ratio":"1" |
| | | |
| | | }, |
| | | { |
| | | "codeId": "Widthofincomingglass", |
| | | "addressIndex":"186", |
| | | "addressLenght":"2", |
| | | "ratio":"1" |
| | | |
| | | }, |
| | | { |
| | | "codeId": "Startingpositionoftheexitcar", |
| | | "addressIndex":"188", |
| | | "addressLenght":"2", |
| | | "ratio":"1" |
| | | |
| | | }, { |
| | | "codeId": "Exitcartargetposition", |
| | | "addressIndex":"190", |
| | | "addressLenght":"2", |
| | | "ratio":"1" |
| | | |
| | | } |
| | | , { |
| | | "codeId": "A02TURNPOSVelocitymanual", |
| | | "addressIndex":"192", |
| | | "addressLenght":"2", |
| | | "ratio":"1" |
| | | |
| | | } |
| | | , { |
| | | "codeId": "A01delayTime", |
| | | "addressIndex":"194", |
| | | "addressLenght":"2", |
| | | "ratio":"1" |
| | | |
| | | } |
| | | |
| | | |
| | | ] |
| | | } |
New file |
| | |
| | | { |
| | | "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" |
| | | } |
| | | ] |
| | | } |
New file |
| | |
| | | { |
| | | "plcAddressBegin": "DB102.0.0", |
| | | "plcAddressLenght": "112", |
| | | "dataType": "bit", |
| | | "parameteInfor": [ |
| | | { |
| | | "codeId": "D01.SRdec", |
| | | "addressIndex": 0 |
| | | }, |
| | | { |
| | | "codeId": "D01.SRinpos", |
| | | "addressIndex": 1 |
| | | }, |
| | | { |
| | | "codeId": "D02.SRdec", |
| | | "addressIndex": 2 |
| | | }, |
| | | { |
| | | "codeId": "D02.SRinpos", |
| | | "addressIndex": 3 |
| | | }, |
| | | { |
| | | "codeId": "D03.SRinto", |
| | | "addressIndex": 4 |
| | | }, |
| | | { |
| | | "codeId": "D03.SRdec", |
| | | "addressIndex": 5 |
| | | }, |
| | | { |
| | | "codeId": "D03.SRinpos", |
| | | "addressIndex": 6 |
| | | }, |
| | | { |
| | | "codeId": "D04.SRdec", |
| | | "addressIndex": 7 |
| | | }, |
| | | { |
| | | "codeId": "D04.SRinpos", |
| | | "addressIndex": 8 |
| | | }, |
| | | { |
| | | "codeId": "D05.SRdec", |
| | | "addressIndex": 9 |
| | | }, |
| | | { |
| | | "codeId": "D05.SRinpos", |
| | | "addressIndex": 10 |
| | | }, |
| | | { |
| | | "codeId": "D06.SRdec", |
| | | "addressIndex": 11 |
| | | }, |
| | | { |
| | | "codeId": "D06.SRinpos", |
| | | "addressIndex": 12 |
| | | }, |
| | | { |
| | | "codeId": "B01.SRindec", |
| | | "addressIndex": 13 |
| | | }, |
| | | { |
| | | "codeId": "B01.SRininpos", |
| | | "addressIndex": 14 |
| | | }, |
| | | { |
| | | "codeId": "B01.SRoutdec", |
| | | "addressIndex": 15 |
| | | }, |
| | | { |
| | | "codeId": "B01.SRoutinpos", |
| | | "addressIndex": 16 |
| | | }, |
| | | { |
| | | "codeId": "B01.SRturnon", |
| | | "addressIndex": 17 |
| | | }, |
| | | { |
| | | "codeId": "B01.SRturnoff", |
| | | "addressIndex": 18 |
| | | }, |
| | | { |
| | | "codeId": "B01.SRup", |
| | | "addressIndex": 19 |
| | | }, |
| | | { |
| | | "codeId": "B01.SRdown", |
| | | "addressIndex": 20 |
| | | }, |
| | | { |
| | | "codeId": "B02.SRoutdec", |
| | | "addressIndex": 21 |
| | | }, |
| | | { |
| | | "codeId": "B02.SRoutinpos", |
| | | "addressIndex": 22 |
| | | }, |
| | | { |
| | | "codeId": "B02.SRindec", |
| | | "addressIndex": 23 |
| | | }, |
| | | { |
| | | "codeId": "B02.SRininpos", |
| | | "addressIndex": 24 |
| | | }, |
| | | { |
| | | "codeId": "B02.SRturnon", |
| | | "addressIndex": 25 |
| | | }, |
| | | { |
| | | "codeId": "B02.SRturnoff", |
| | | "addressIndex": 26 |
| | | }, |
| | | { |
| | | "codeId": "B02.SRup", |
| | | "addressIndex": 27 |
| | | }, |
| | | { |
| | | "codeId": "B02.SRdown", |
| | | "addressIndex": 28 |
| | | }, |
| | | { |
| | | "codeId": "B01.SRinsafety", |
| | | "addressIndex": 29 |
| | | }, |
| | | { |
| | | "codeId": "B01.SRoutsafety", |
| | | "addressIndex": 30 |
| | | }, |
| | | { |
| | | "codeId": "B02.SRinsafety", |
| | | "addressIndex": 31 |
| | | }, |
| | | { |
| | | "codeId": "SB.start(+)", |
| | | "addressIndex": 32 |
| | | }, |
| | | { |
| | | "codeId": "SB.stop(-)", |
| | | "addressIndex": 33 |
| | | }, |
| | | { |
| | | "codeId": "SB.reset", |
| | | "addressIndex": 34 |
| | | }, |
| | | { |
| | | "codeId": "SB.auto/manul", |
| | | "addressIndex": 35 |
| | | }, |
| | | { |
| | | "codeId": "D01.SB.confirm", |
| | | "addressIndex": 36 |
| | | }, |
| | | { |
| | | "codeId": "SB.emg", |
| | | "addressIndex": 37 |
| | | }, |
| | | { |
| | | "codeId": "D01.SB.start", |
| | | "addressIndex": 38 |
| | | }, |
| | | { |
| | | "codeId": "D06.SB.start", |
| | | "addressIndex": 39 |
| | | }, |
| | | { |
| | | "codeId": "B02.SRoutsafety", |
| | | "addressIndex": 40 |
| | | }, |
| | | { |
| | | "codeId": "SafetyDoor.requset", |
| | | "addressIndex": 41 |
| | | }, |
| | | { |
| | | "codeId": "SafetyDoor.confirm", |
| | | "addressIndex": 42 |
| | | }, |
| | | { |
| | | "codeId": "SafetyDoor.reset", |
| | | "addressIndex": 43 |
| | | }, |
| | | { |
| | | "codeId": "Sspce", |
| | | "addressIndex": 44 |
| | | }, |
| | | { |
| | | "codeId": "Sspce", |
| | | "addressIndex": 45 |
| | | }, |
| | | { |
| | | "codeId": "Sspce", |
| | | "addressIndex": 46 |
| | | }, |
| | | { |
| | | "codeId": "Sspce", |
| | | "addressIndex": 47 |
| | | }, |
| | | { |
| | | "codeId": "A01.SRleftdec", |
| | | "addressIndex": 48 |
| | | }, |
| | | { |
| | | "codeId": "A01.SRleftinpos", |
| | | "addressIndex": 49 |
| | | }, |
| | | { |
| | | "codeId": "A01.SRleftsafety", |
| | | "addressIndex": 50 |
| | | }, |
| | | { |
| | | "codeId": "A01.SRrightdec", |
| | | "addressIndex": 51 |
| | | }, |
| | | { |
| | | "codeId": "A01.SRrightinpos", |
| | | "addressIndex": 52 |
| | | }, |
| | | { |
| | | "codeId": "A01.SRrightsafety", |
| | | "addressIndex": 53 |
| | | }, |
| | | { |
| | | "codeId": "A01.SRturnhome", |
| | | "addressIndex": 54 |
| | | }, |
| | | { |
| | | "codeId": "A01.SRturnup", |
| | | "addressIndex": 55 |
| | | }, |
| | | { |
| | | "codeId": "A01.SRturndown", |
| | | "addressIndex": 56 |
| | | }, |
| | | { |
| | | "codeId": "A01.SRtravelhome", |
| | | "addressIndex": 57 |
| | | }, |
| | | { |
| | | "codeId": "A01.SRtravelleftdec", |
| | | "addressIndex": 58 |
| | | }, |
| | | { |
| | | "codeId": "A01.SRtravelleftlimit", |
| | | "addressIndex": 59 |
| | | }, |
| | | { |
| | | "codeId": "A01.SRtravelrightdec", |
| | | "addressIndex": 60 |
| | | }, |
| | | { |
| | | "codeId": "A01.SRtravelrightlimit", |
| | | "addressIndex": 61 |
| | | }, |
| | | { |
| | | "codeId": "space", |
| | | "addressIndex": 62 |
| | | }, |
| | | { |
| | | "codeId": "space", |
| | | "addressIndex": 63 |
| | | }, |
| | | { |
| | | "codeId": "A02.SRleftdec", |
| | | "addressIndex": 64 |
| | | }, |
| | | { |
| | | "codeId": "A02.SRleftinpos", |
| | | "addressIndex": 65 |
| | | }, |
| | | { |
| | | "codeId": "A02.SRleftsafety", |
| | | "addressIndex": 66 |
| | | }, |
| | | { |
| | | "codeId": "A02.SRrightdec", |
| | | "addressIndex": 67 |
| | | }, |
| | | { |
| | | "codeId": "A02.SRrightinpos", |
| | | "addressIndex": 68 |
| | | }, |
| | | { |
| | | "codeId": "A02.SRrightsafety", |
| | | "addressIndex": 69 |
| | | }, |
| | | { |
| | | "codeId": "A02.SRturnhome", |
| | | "addressIndex": 70 |
| | | }, |
| | | { |
| | | "codeId": "A02.SRturnup", |
| | | "addressIndex": 71 |
| | | }, |
| | | { |
| | | "codeId": "A02.SRturndown", |
| | | "addressIndex": 72 |
| | | }, |
| | | { |
| | | "codeId": "A02.SRtravelhome", |
| | | "addressIndex": 73 |
| | | }, |
| | | { |
| | | "codeId": "A02.SRtravelleftdec", |
| | | "addressIndex": 74 |
| | | }, |
| | | { |
| | | "codeId": "A02.SRtravelleftlimit", |
| | | "addressIndex": 75 |
| | | }, |
| | | { |
| | | "codeId": "A02.SRtravelrightdec", |
| | | "addressIndex": 76 |
| | | }, |
| | | { |
| | | "codeId": "A02.SRtravelrightlimit", |
| | | "addressIndex": 77 |
| | | }, |
| | | { |
| | | "codeId": "space", |
| | | "addressIndex": 78 |
| | | }, |
| | | { |
| | | "codeId": "space", |
| | | "addressIndex": 79 |
| | | }, |
| | | { |
| | | "codeId": "B01.SRorigin", |
| | | "addressIndex": 80 |
| | | }, |
| | | { |
| | | "codeId": "B01.SRleftlimit", |
| | | "addressIndex": 81 |
| | | }, |
| | | { |
| | | "codeId": "B01.SRrightlimit", |
| | | "addressIndex": 82 |
| | | }, |
| | | { |
| | | "codeId": "B02.SRorigin", |
| | | "addressIndex": 83 |
| | | }, |
| | | { |
| | | "codeId": "B02.SRleftlimit", |
| | | "addressIndex": 84 |
| | | }, |
| | | { |
| | | "codeId": "B02.SRrightlimit", |
| | | "addressIndex": 85 |
| | | }, |
| | | { |
| | | "codeId": "space", |
| | | "addressIndex": 86 |
| | | }, |
| | | { |
| | | "codeId": "space", |
| | | "addressIndex": 87 |
| | | }, |
| | | { |
| | | "codeId": "LED.red", |
| | | "addressIndex": 88 |
| | | }, |
| | | { |
| | | "codeId": "LED.green", |
| | | "addressIndex": 89 |
| | | }, |
| | | { |
| | | "codeId": "LED.yellow", |
| | | "addressIndex": 90 |
| | | }, |
| | | { |
| | | "codeId": "D01.LED.green", |
| | | "addressIndex": 91 |
| | | }, |
| | | { |
| | | "codeId": "D06.LED.green", |
| | | "addressIndex": 92 |
| | | }, |
| | | { |
| | | "codeId": "B01.YV.turn", |
| | | "addressIndex": 93 |
| | | }, |
| | | { |
| | | "codeId": "B01.YV.updown", |
| | | "addressIndex": 94 |
| | | }, |
| | | { |
| | | "codeId": "B01.YV.gassing", |
| | | "addressIndex": 95 |
| | | }, |
| | | { |
| | | "codeId": "B02.YV.turn", |
| | | "addressIndex": 96 |
| | | }, |
| | | { |
| | | "codeId": "B02.YV.updown", |
| | | "addressIndex": 97 |
| | | }, |
| | | { |
| | | "codeId": "B02.YV.gassing", |
| | | "addressIndex": 98 |
| | | }, |
| | | { |
| | | "codeId": "SafetyDoor.Led", |
| | | "addressIndex": 99 |
| | | }, |
| | | { |
| | | "codeId": "SafetyDoor.open", |
| | | "addressIndex": 100 |
| | | }, |
| | | { |
| | | "codeId": "D01SB.confirm", |
| | | "addressIndex": 101 |
| | | }, |
| | | { |
| | | "codeId": "space", |
| | | "addressIndex": 102 |
| | | }, |
| | | { |
| | | "codeId": "space", |
| | | "addressIndex": 103 |
| | | }, |
| | | { |
| | | "codeId": "A01oilPump", |
| | | "addressIndex": 104 |
| | | }, |
| | | { |
| | | "codeId": "A01motorCtr", |
| | | "addressIndex": 105 |
| | | }, |
| | | { |
| | | "codeId": "space", |
| | | "addressIndex": 106 |
| | | }, |
| | | { |
| | | "codeId": "space", |
| | | "addressIndex": 107 |
| | | }, |
| | | { |
| | | "codeId": "A02oilPump", |
| | | "addressIndex": 108 |
| | | }, |
| | | { |
| | | "codeId": "A02motorCtr", |
| | | "addressIndex": 109 |
| | | }, |
| | | { |
| | | "codeId": "space", |
| | | "addressIndex": 110 |
| | | }, |
| | | { |
| | | "codeId": "space", |
| | | "addressIndex": 111 |
| | | } |
| | | , |
| | | { |
| | | "codeId": "space", |
| | | "addressIndex": 111 |
| | | } |
| | | ] |
| | | } |
New file |
| | |
| | | {
|
| | | "plcAddressBegin": "DB103.0",
|
| | | "plcAddressLenght": "258",
|
| | | "dataType": "word",
|
| | | "parameteInfor": [
|
| | | {
|
| | | "codeId": "D01.State",
|
| | | "addressIndex": "0",
|
| | | "addressLenght": "2",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "D02.State",
|
| | | "addressIndex": "2",
|
| | | "addressLenght": "2",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "B01.State",
|
| | | "addressIndex": "4",
|
| | | "addressLenght": "2",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "B02.State",
|
| | | "addressIndex": "6",
|
| | | "addressLenght": "2",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "A01.State",
|
| | | "addressIndex": "8",
|
| | | "addressLenght": "2",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "A02.State",
|
| | | "addressIndex": "10",
|
| | | "addressLenght": "2",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "D03.State",
|
| | | "addressIndex": "12",
|
| | | "addressLenght": "2",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "D04.State",
|
| | | "addressIndex": "14",
|
| | | "addressLenght": "2",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "D05.State",
|
| | | "addressIndex": "16",
|
| | | "addressLenght": "2",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "D06.State",
|
| | | "addressIndex": "18",
|
| | | "addressLenght": "2",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "A01tavelActualPosition",
|
| | | "addressIndex": "20",
|
| | | "addressLenght": "2",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "A01turnActualangle",
|
| | | "addressIndex": "22",
|
| | | "addressLenght": "2",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "A02tavelActualPosition",
|
| | | "addressIndex": "24",
|
| | | "addressLenght": "2",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "A02turnActualangle",
|
| | | "addressIndex": "26",
|
| | | "addressLenght": "2",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "B01tavelActualPosition",
|
| | | "addressIndex": "28",
|
| | | "addressLenght": "2",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "B02tavelActualPosition",
|
| | | "addressIndex": "30",
|
| | | "addressLenght": "2",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "A01CurrentGrid",
|
| | | "addressIndex": "32",
|
| | | "addressLenght": "2",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "A02CurrentGrid",
|
| | | "addressIndex": "34",
|
| | | "addressLenght": "2",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "B01CurrentGrid",
|
| | | "addressIndex": "36",
|
| | | "addressLenght": "2",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "B01TargetGrid",
|
| | | "addressIndex": "38",
|
| | | "addressLenght": "2",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "B02CurrentGrid",
|
| | | "addressIndex": "40",
|
| | | "addressLenght": "2",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "B02TargetGrid",
|
| | | "addressIndex": "42",
|
| | | "addressLenght": "2",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "D01ID",
|
| | | "addressIndex": "44",
|
| | | "addressLenght": "14",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "D02ID",
|
| | | "addressIndex": "58",
|
| | | "addressLenght": "14",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "D03ID",
|
| | | "addressIndex": "72",
|
| | | "addressLenght": "14",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "D04ID",
|
| | | "addressIndex": "86",
|
| | | "addressLenght": "14",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "D05ID",
|
| | | "addressIndex": "100",
|
| | | "addressLenght": "14",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "D06ID",
|
| | | "addressIndex": "114",
|
| | | "addressLenght": "14",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "A01ID1",
|
| | | "addressIndex": "128",
|
| | | "addressLenght": "14",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "A01ID2",
|
| | | "addressIndex": "142",
|
| | | "addressLenght": "14",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "A02ID1",
|
| | | "addressIndex": "156",
|
| | | "addressLenght": "14",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "A02ID2",
|
| | | "addressIndex": "170",
|
| | | "addressLenght": "14",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "B01ID1",
|
| | | "addressIndex": "184",
|
| | | "addressLenght": "14",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "B01ID2",
|
| | | "addressIndex": "198",
|
| | | "addressLenght": "14",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "B02ID1",
|
| | | "addressIndex": "212",
|
| | | "addressLenght": "14",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "B02ID2",
|
| | | "addressIndex": "226",
|
| | | "addressLenght": "14",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "A01conveyorFaultcodes",
|
| | | "addressIndex": "240",
|
| | | "addressLenght": "2",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "A01turnservoFaultcodes",
|
| | | "addressIndex": "242",
|
| | | "addressLenght": "2",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "A01travelservoFaultcodes",
|
| | | "addressIndex": "244",
|
| | | "addressLenght": "2",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "A02conveyorFaultcodes",
|
| | | "addressIndex": "246",
|
| | | "addressLenght": "2",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "A02turnservoFaultcodes",
|
| | | "addressIndex": "248",
|
| | | "addressLenght": "2",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "A02travelservoFaultcodes",
|
| | | "addressIndex": "250",
|
| | | "addressLenght": "2",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "B01travelservoFaultcodes",
|
| | | "addressIndex": "252",
|
| | | "addressLenght": "2",
|
| | | "unit": ""
|
| | | },
|
| | | {
|
| | | "codeId": "B02travelservoFaultcodes",
|
| | | "addressIndex": "254",
|
| | | "addressLenght": "2",
|
| | | "unit": ""
|
| | | }
|
| | | ,
|
| | | {
|
| | | "codeId": "Scanningguns",
|
| | | "addressIndex": "256",
|
| | | "addressLenght": "2",
|
| | | "unit": ""
|
| | | }
|
| | | ,
|
| | | {
|
| | | "codeId": "Frameid",
|
| | | "addressIndex": "270",
|
| | | "addressLenght": "2",
|
| | | "unit": ""
|
| | | }
|
| | | ]
|
| | | } |
New file |
| | |
| | | {
|
| | | "plcAddressBegin": "DB101.0.0",
|
| | | "plcAddressLenght": "93",
|
| | | "dataType": "bit",
|
| | | "parameteInfor": [
|
| | | {
|
| | | "codeId": "D01VFDconveyor",
|
| | | "addressIndex": 0
|
| | | },
|
| | | {
|
| | | "codeId": "D02VFDconveyor",
|
| | | "addressIndex": 1
|
| | | },
|
| | | {
|
| | | "codeId": "D03VFDconveyor",
|
| | | "addressIndex": 2
|
| | | },
|
| | | {
|
| | | "codeId": "D04VFDconveyor",
|
| | | "addressIndex": 3
|
| | | },
|
| | | {
|
| | | "codeId": "D05VFDconveyor",
|
| | | "addressIndex": 4
|
| | | },
|
| | | {
|
| | | "codeId": "D06VFDconveyor",
|
| | | "addressIndex": 5
|
| | | },
|
| | | {
|
| | | "codeId": "A01VFDconveyor",
|
| | | "addressIndex": 6
|
| | | },
|
| | | {
|
| | | "codeId": "A02VFDconveyor",
|
| | | "addressIndex": 7
|
| | | },
|
| | | {
|
| | | "codeId": "B01VFDconveyor",
|
| | | "addressIndex": 8
|
| | | },
|
| | | {
|
| | | "codeId": "B02VFDconveyor",
|
| | | "addressIndex": 9
|
| | | },
|
| | | {
|
| | | "codeId": "A01SERVETURN",
|
| | | "addressIndex": 10
|
| | | },
|
| | | {
|
| | | "codeId": "A02SERVETURN",
|
| | | "addressIndex": 11
|
| | | },
|
| | | {
|
| | | "codeId": "A01SERVETRAVEL",
|
| | | "addressIndex": 12
|
| | | },
|
| | | {
|
| | | "codeId": "A02SERVETRAVEL",
|
| | | "addressIndex": 13
|
| | | },
|
| | | {
|
| | | "codeId": "B01SERVETRAVEL",
|
| | | "addressIndex": 14
|
| | | },
|
| | | {
|
| | | "codeId": "B02SERVETRAVEL",
|
| | | "addressIndex": 15
|
| | | },
|
| | | {
|
| | | "codeId": "A01SERVETURNPOS",
|
| | | "addressIndex": 16
|
| | | },
|
| | | {
|
| | | "codeId": "A02SERVETURNPOS",
|
| | | "addressIndex": 17
|
| | | },
|
| | | {
|
| | | "codeId": "A01SERVETRAVELPOS",
|
| | | "addressIndex": 18
|
| | | },
|
| | | {
|
| | | "codeId": "A02SERVETRAVELPOS",
|
| | | "addressIndex": 19
|
| | | },
|
| | | {
|
| | | "codeId": "B01SERVETRAVELPOS",
|
| | | "addressIndex": 20
|
| | | },
|
| | | {
|
| | | "codeId": "B02SERVETRAVELPOS",
|
| | | "addressIndex": 21
|
| | | },
|
| | | {
|
| | | "codeId": "B01YVTURN",
|
| | | "addressIndex": 22
|
| | | },
|
| | | {
|
| | | "codeId": "B01YVUPDOWN",
|
| | | "addressIndex": 23
|
| | | },
|
| | | {
|
| | | "codeId": "B02YVTURN",
|
| | | "addressIndex": 24
|
| | | },
|
| | | {
|
| | | "codeId": "B02YVUPDOWN",
|
| | | "addressIndex": 25
|
| | | },
|
| | | {
|
| | | "codeId": "B01YVGassing",
|
| | | "addressIndex": 26
|
| | | },
|
| | | {
|
| | | "codeId": "B02YVGassing",
|
| | | "addressIndex": 27
|
| | | },
|
| | | {
|
| | | "codeId": "A01VFDconveyorreverse",
|
| | | "addressIndex": 28
|
| | | },
|
| | | {
|
| | | "codeId": "A02VFDconveyorreverse",
|
| | | "addressIndex": 29
|
| | | },
|
| | | {
|
| | | "codeId": "A01SERVETURNreset",
|
| | | "addressIndex": 30
|
| | | },
|
| | | {
|
| | | "codeId": "A01SERVETURNhome",
|
| | | "addressIndex": 31
|
| | | },
|
| | | {
|
| | | "codeId": "A01SERVETRAVELreset",
|
| | | "addressIndex": 32
|
| | | },
|
| | | {
|
| | | "codeId": "A02SERVETURNreset",
|
| | | "addressIndex": 33
|
| | | },
|
| | | {
|
| | | "codeId": "A02SERVETURNhome",
|
| | | "addressIndex": 34
|
| | | },
|
| | | {
|
| | | "codeId": "A02SERVETRAVELreset",
|
| | | "addressIndex": 35
|
| | | },
|
| | | {
|
| | | "codeId": "B01SERVETRAVELreset",
|
| | | "addressIndex": 36
|
| | | },
|
| | | {
|
| | | "codeId": "B01SERVETRAVELhome",
|
| | | "addressIndex": 37
|
| | | },
|
| | | {
|
| | | "codeId": "B02SERVETRAVELreset",
|
| | | "addressIndex": 38
|
| | | },
|
| | | {
|
| | | "codeId": "B02SERVETRAVELhome",
|
| | | "addressIndex": 39
|
| | | },
|
| | | {
|
| | | "codeId": "Manualstoragestartup",
|
| | | "addressIndex": 40
|
| | | },
|
| | | {
|
| | | "codeId": "Manualoutputstartup",
|
| | | "addressIndex": 41
|
| | | },
|
| | | {
|
| | | "codeId": "A01oilpump",
|
| | | "addressIndex": 42
|
| | | },
|
| | | {
|
| | | "codeId": "A02oilpump",
|
| | | "addressIndex": 43
|
| | | },
|
| | | {
|
| | | "codeId": "A01get1#gridaddress",
|
| | | "addressIndex": 44
|
| | | },
|
| | | {
|
| | | "codeId": "A01get22#gridaddress",
|
| | | "addressIndex": 45
|
| | | },
|
| | | {
|
| | | "codeId": "A01get43#gridaddress",
|
| | | "addressIndex": 46
|
| | | },
|
| | | {
|
| | | "codeId": "A01get64#gridaddress",
|
| | | "addressIndex": 47
|
| | | },
|
| | | {
|
| | | "codeId": "A01get85#gridaddress",
|
| | | "addressIndex": 48
|
| | | },
|
| | | {
|
| | | "codeId": "A01get106#gridaddress",
|
| | | "addressIndex": 49
|
| | | },
|
| | | {
|
| | | "codeId": "A01get127#gridaddress",
|
| | | "addressIndex": 50
|
| | | },
|
| | | {
|
| | | "codeId": "A01get148#gridaddress",
|
| | | "addressIndex": 51
|
| | | },
|
| | | {
|
| | | "codeId": "A01get169#gridaddress",
|
| | | "addressIndex": 52
|
| | | },
|
| | | {
|
| | | "codeId": "A02get190#gridaddress",
|
| | | "addressIndex": 53
|
| | | },
|
| | | {
|
| | | "codeId": "A02get1#gridaddress",
|
| | | "addressIndex": 54
|
| | | },
|
| | | {
|
| | | "codeId": "A02get22#gridaddress",
|
| | | "addressIndex": 55
|
| | | },
|
| | | {
|
| | | "codeId": "A02get43#gridaddress",
|
| | | "addressIndex": 56
|
| | | },
|
| | | {
|
| | | "codeId": "A02get64#gridaddress",
|
| | | "addressIndex": 57
|
| | | },
|
| | | {
|
| | | "codeId": "A02get85#gridaddress",
|
| | | "addressIndex": 58
|
| | | },
|
| | | {
|
| | | "codeId": "A02get106#gridaddress",
|
| | | "addressIndex": 59
|
| | | },
|
| | | {
|
| | | "codeId": "A02get127#gridaddress",
|
| | | "addressIndex": 60
|
| | | },
|
| | | {
|
| | | "codeId": "A02get148#gridaddress",
|
| | | "addressIndex": 61
|
| | | },
|
| | | {
|
| | | "codeId": "A02get169#gridaddress",
|
| | | "addressIndex": 62
|
| | | },
|
| | | {
|
| | | "codeId": "A02get190#gridaddress",
|
| | | "addressIndex": 63
|
| | | },
|
| | | {
|
| | | "codeId": "B01get1#gridaddress",
|
| | | "addressIndex": 64
|
| | | },
|
| | | {
|
| | | "codeId": "B01get22#gridaddress",
|
| | | "addressIndex": 65
|
| | | },
|
| | | {
|
| | | "codeId": "B01get43#gridaddress",
|
| | | "addressIndex": 66
|
| | | },
|
| | | {
|
| | | "codeId": "B01get64#gridaddress",
|
| | | "addressIndex": 67
|
| | | },
|
| | | {
|
| | | "codeId": "B01get85#gridaddress",
|
| | | "addressIndex": 68
|
| | | },
|
| | | {
|
| | | "codeId": "B02get106#gridaddress",
|
| | | "addressIndex": 69
|
| | | },
|
| | | {
|
| | | "codeId": "B02get127#gridaddress",
|
| | | "addressIndex": 70
|
| | | },
|
| | | {
|
| | | "codeId": "B02get148#gridaddress",
|
| | | "addressIndex": 71
|
| | | },
|
| | | {
|
| | | "codeId": "B02get169#gridaddress",
|
| | | "addressIndex": 72
|
| | | },
|
| | | {
|
| | | "codeId": "B02get190#gridaddress",
|
| | | "addressIndex": 73
|
| | | },
|
| | | {
|
| | | "codeId": "D01IDClean",
|
| | | "addressIndex": 74
|
| | | },
|
| | | {
|
| | | "codeId": "D02IDClean",
|
| | | "addressIndex": 75
|
| | | },
|
| | | {
|
| | | "codeId": "D03IDClean",
|
| | | "addressIndex": 76
|
| | | },
|
| | | {
|
| | | "codeId": "D04IDClean",
|
| | | "addressIndex": 77
|
| | | },
|
| | | {
|
| | | "codeId": "D05IDClean",
|
| | | "addressIndex": 78
|
| | | },
|
| | | {
|
| | | "codeId": "D06IDClean",
|
| | | "addressIndex": 79
|
| | | },
|
| | | {
|
| | | "codeId": "A01IDClean",
|
| | | "addressIndex": 80
|
| | | },
|
| | | {
|
| | | "codeId": "A02IDClean",
|
| | | "addressIndex": 81
|
| | | },
|
| | | {
|
| | | "codeId": "B01IDClean",
|
| | | "addressIndex": 82
|
| | | },
|
| | | {
|
| | | "codeId": "B02IDClean",
|
| | | "addressIndex": 83
|
| | | },
|
| | | {
|
| | | "codeId": "abort/resumeTasks",
|
| | | "addressIndex": 84
|
| | | },
|
| | | {
|
| | | "codeId": "A01SERVETRAVELhome",
|
| | | "addressIndex": 85
|
| | | },
|
| | | {
|
| | | "codeId": "A02SERVETRAVELhome",
|
| | | "addressIndex": 86
|
| | | },
|
| | | {
|
| | | "codeId": "A01A02travelHoming",
|
| | | "addressIndex": 87
|
| | | },
|
| | | {
|
| | | "codeId": "A01halfAutoSelect",
|
| | | "addressIndex": 88
|
| | | },
|
| | | {
|
| | | "codeId": "A02halfAutoSelect",
|
| | | "addressIndex": 89
|
| | | },
|
| | | {
|
| | | "codeId": "A02abortTasks",
|
| | | "addressIndex": 90
|
| | | },
|
| | | {
|
| | | "codeId": "emgHMI",
|
| | | "addressIndex": 91
|
| | | },
|
| | | {
|
| | | "codeId": "Scanningmethod",
|
| | | "addressIndex": 92
|
| | | ]
|
| | | } |
New file |
| | |
| | | { |
| | | "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" |
| | | } |
| | | |
| | | |
| | | ] |
| | | } |
| | |
| | | |
| | | spring: |
| | | datasource: |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | url: jdbc:mysql://10.153.19.150:3306/hangzhoumes?serverTimezone=GMT%2b8&characterEncoding=utf-8&useSSL=false |
| | | dynamic: |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://10.153.19.150:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 127.0.0.1:8848 |
| | | server-addr: 10.153.19.150:8848 |
| | | application: |
| | | name: unLoadGlass |
| | | redis: |
| | | database: 0 |
| | | host: 192.168.56.10 |
| | | host: 10.153.19.150 |
| | | port: 6379 |
| | | password: 123456 |
| | | mybatis-plus: |
| | | mapper-locations: classpath*:mapper/*.xml |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | |
| | | # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | # 设置 MyBatis 日志级别为 ERROR |
| | | logging: |
| | | level: |
| | | com: |
| | | baomidou: |
| | | mybatisplus=ERROR: |
New file |
| | |
| | | <?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.mes.downglassinfo.mapper.DownGlassInfoMapper">
|
| | |
|
| | | <select id="selectunloadingtaskstate" resultType="com.mes.downglassinfo.entity.DownGlassInfo">
|
| | | SELECT flow_card_id, filmsid, width, height, thickness FROM down_glass_task WHERE task_stauts = 1
|
| | | </select>
|
| | |
|
| | | <update id="updateTaskStateToZero">
|
| | | UPDATE down_glass_task SET task_stauts = 0 WHERE flow_card_id = #{flowCardId}
|
| | | </update>
|
| | |
|
| | | <select id="getMaxSequenceByFlowCardId" resultType="java.lang.Integer">
|
| | | SELECT MAX(sequence) FROM down_glass_info WHERE flow_card_id = #{flowCardId}
|
| | | </select>
|
| | |
|
| | | <delete id="deletetask">
|
| | | DELETE FROM down_glass_task WHERE flow_card_id = #{flowCardId}
|
| | | </delete>
|
| | |
|
| | | </mapper>
|