Merge branch 'master' of http://10.153.19.25:10101/r/CanadaMes
# Conflicts:
# springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java
| | |
| | | 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) {
|
| | |
| | | } 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;
|
| | | }
|
| | |
|
New file |
| | |
| | | package com.example.springboot.component; |
| | | |
| | | import com.example.springboot.entity.device.PlcBitObject; |
| | | import com.example.springboot.entity.device.PlcParameterObject; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import static com.example.springboot.component.InitUtil.readAndUpdateBitValues; |
| | | import static com.example.springboot.component.InitUtil.readAndUpdateWordValues; |
| | | |
| | | public class PLCAutoMes extends Thread { |
| | | |
| | | // 用于存储应用程序的配置信息 |
| | | private Configuration config; |
| | | private static InitUtil initUtil; |
| | | // 创建一个自定义的 S7 控制器消息处理器对象 |
| | | MessageHandler customS7Control = new MessageHandler(); |
| | | |
| | | // 单例实例 |
| | | private static PLCAutoMes instance; |
| | | |
| | | // 私有构造函数 |
| | | public PLCAutoMes() throws IOException { |
| | | config = new Configuration("config.properties"); |
| | | initUtil = new InitUtil(); |
| | | } |
| | | |
| | | // 获取单例实例 |
| | | public static synchronized PLCAutoMes getInstance() throws IOException { |
| | | if (instance == null) { |
| | | instance = new PLCAutoMes(); |
| | | } |
| | | return instance; |
| | | } |
| | | |
| | | @Override |
| | | public void run() { |
| | | while (this != null) { |
| | | try { |
| | | Thread.sleep(1000); |
| | | |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | |
| | | |
| | | String jsonFilePath = PLCAutoMes.class.getResource("/JsonFile/PlcMes.json").getPath(); |
| | | |
| | | String jsonFilePath2 = PLCAutoMes.class.getResource("/JsonFile/PlcRead.json").getPath(); |
| | | // String jsonFilePath3 = PLCAutoMes.class.getResource("/JsonFile/Plcframe.json").getPath(); |
| | | // System.out.println(jsonFilePath); |
| | | |
| | | // 调用initword方法 |
| | | PlcParameterObject PlcMesObject= initUtil.initword(jsonFilePath); |
| | | // 调用initbit方法 |
| | | PlcParameterObject PlcReadObject= initUtil.initword(jsonFilePath2); |
| | | // // 调用initbit方法 |
| | | // PlcParameterObject PlcframeObject= initUtil.initword(jsonFilePath3); |
| | | readAndUpdateWordValues(PlcReadObject); |
| | | readAndUpdateWordValues(PlcMesObject); |
| | | // readAndUpdateWordValues(PlcframeObject); |
| | | |
| | | |
| | | |
| | | |
| | | // readAndUpdateWordValues(plcStateObject); |
| | | int index = PlcMesObject.getPlcParameter("AddStart").getAddressIndex(); |
| | | //System.out.println(index); |
| | | PlcMesObject.getPlcParameter("AddStart").getAddress(index); |
| | | //System.out.println(PlcMesObject.getPlcParameter("AddStart").getAddress(index)); |
| | | List<String> addresses = new ArrayList<>(); |
| | | addresses.add("FeedID"); |
| | | addresses.add("AddStart"); |
| | | //System.out.println(addresses); |
| | | //System.out.println(PlcMesObject.getPlcParameterValues(addresses)); |
| | | List<String> addresses2 = new ArrayList<>(); |
| | | addresses2.add("FeedID"); |
| | | addresses2.add("FeedCarStatus"); |
| | | |
| | | System.out.println(PlcReadObject.getPlcParameterValues(addresses2)); |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.example.springboot.component; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.example.springboot.service.JdbcConnections; |
| | | import com.example.springboot.service.SpianService; |
| | | import com.example.springboot.entity.north_glass_buffer1; |
| | | import com.example.springboot.mapper.AlarmMapper; |
| | | import com.example.springboot.mapper.SpianMapper; |
| | | |
| | | public class PlcHoldNew extends Thread { |
| | | |
| | | private AlarmMapper alarmMapper; |
| | | |
| | | @Autowired |
| | | private JdbcConnections jdbcConnections; |
| | | private SpianMapper spianMapper; |
| | | private SpianService spianService; |
| | | int aaa; |
| | | |
| | | @Override |
| | | public void run() { |
| | | |
| | | while (this != null) { |
| | | try { |
| | | |
| | | Thread.sleep(100); |
| | | } catch (InterruptedException e) { |
| | | // \\ TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | // if (S7control.getinstance().CheckConnected() == false) { |
| | | spianService = WebSocketServer.applicationContext.getBean(SpianService.class); |
| | | spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class); |
| | | jdbcConnections = WebSocketServer.applicationContext.getBean(JdbcConnections.class); |
| | | // 根据玻璃id获取订单号,单独数据源 |
| | | // try { |
| | | // north_glass_buffer1 glass = jdbcConnections.selectGlass(112); |
| | | // // System.out.println(glass.getOrderId()); |
| | | // } catch (SQLException e) { |
| | | // // TODO Auto-generated catch block |
| | | // e.printStackTrace(); |
| | | // } |
| | | |
| | | // 出片任务//////////////////////////////// |
| | | List<Short> outlist = S7control.getinstance().ReadWord("DB106.20", 1); // 出片车状态 |
| | | List<Short> outlist1 = S7control.getinstance().ReadWord("DB105.18", 1); // 出片任务是否启动 |
| | | |
| | | boolean Plcout = spianService.listbool("DB106.64"); // 出片请求字 |
| | | boolean Plcout2 = spianService.listbool("DB105.18"); // 出片启动 |
| | | if (Plcout == false&&Plcout2==true) { |
| | | S7control.getinstance().WriteWord("DB105.18", (short) 0);// 出片任务启动改为0 |
| | | System.out.println("关闭出片启动" + LocalDateTime.now());// 出片任务发送字改为0 |
| | | } |
| | | boolean Plcadd = spianService.listbool("DB106.24"); // 进片请求字 |
| | | boolean Plcadd2 = spianService.listbool("DB105.16"); // 进片启动 |
| | | if (Plcadd == false&&Plcadd2==true) { |
| | | S7control.getinstance().WriteWord("DB105.16", (short) 0);//进片任务启动改为0 |
| | | System.out.println("关闭进片启动" + LocalDateTime.now());// 进片任务发送字改为0 |
| | | } |
| | | |
| | | |
| | | |
| | | // StringBuilder writedstrIdOut = new StringBuilder(); |
| | | // 获取已下发的出片id |
| | | byte[] writedglassidbytesOut = S7control.getinstance().ReadByte("DB105.30", 14); |
| | | String writedstrIdOut = new String(writedglassidbytesOut); |
| | | |
| | | |
| | | if (Plcout == true) { |
| | | // 判断当前是否有未执行的任务 |
| | | int outnum = spianMapper.SelectOutSliceshu();//是否有正在出片的任务 |
| | | int cageoutsum = spianMapper.Selectcageout(3);//笼子内是否还有在出片的玻璃 |
| | | // 当没有任务执行并且出片车空闲时 |
| | | if (outnum == 0 && Plchome.isAllowQueue == true && cageoutsum == 0) { |
| | | // 判断铝框出片队列表是否有待出片的玻璃 |
| | | String outglassid = spianMapper.SelectOutSlice(); |
| | | // 当有待出片的玻璃时 |
| | | if (outglassid != null) { |
| | | // 获取该玻璃是否被禁用 |
| | | int glassdisabled = spianMapper.SelectCageGlassState(outglassid); |
| | | // 未禁用下发任务 |
| | | if (glassdisabled == 0) { |
| | | spianService.selectout2(outglassid); |
| | | Plchome.isQueueWarning = false; |
| | | } else { // 禁用更改状态弹出提示 |
| | | Plchome.isQueueWarning = true; |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | ///////////// 进片任务 |
| | | List<Short> datas1List = S7control.getinstance().ReadWord("DB106.24", 1);// 获取prc进片请求数据 |
| | | List<Short> datas1ListState = S7control.getinstance().ReadWord("DB106.8", 1);// 获取进片车状态 |
| | | List<Short> datas1ListState2 = S7control.getinstance().ReadWord("DB105.16", 1);// 获取进片车任务是否启动 |
| | | |
| | | boolean B01backs = spianService.listbool("DB106.60");// b01汇报 |
| | | boolean B02backs = spianService.listbool("DB106.62");// b02汇报 |
| | | StringBuilder B01glassid = spianService.queGlassid("DB103.184", 14);// BO1的玻璃id |
| | | StringBuilder B02glassid = spianService.queGlassid("DB103.212", 14);// B02的玻璃id |
| | | |
| | | // 当进片小车完成任务时 |
| | | if (B01backs == true) { |
| | | // 判断是否汇报正确的id |
| | | int HB = spianMapper.SelectHB(B01glassid.toString()); |
| | | if (HB > 0) { |
| | | // 当B01小车汇报完成时更改玻璃状态 为1 |
| | | S7control.getinstance().WriteWord("DB105.48", (short) 1);// 恢复B01小车应答改为1 |
| | | boolean yingda = spianService.listbool("DB105.48");// b01汇报 |
| | | if (yingda == true) { |
| | | spianService.overtask(B01glassid.toString());// 完成任务 |
| | | } |
| | | System.out.println("汇报时B01|第" + aaa + "次" + B01glassid + "应答" + yingda); |
| | | aaa += 1; |
| | | } |
| | | |
| | | }else{ |
| | | S7control.getinstance().WriteWord("DB105.48", (short) 0);// 恢复B01小车应答改为1 |
| | | } |
| | | |
| | | // 当出片小车完成任务时 |
| | | if (B02backs == true) { |
| | | // 判断是否汇报正确的id |
| | | int HB = spianMapper.SelectHB(B02glassid.toString()); |
| | | System.out.println("汇报时B02|" + B02glassid); |
| | | if (HB > 0) { |
| | | // 当B02小车汇报完成时更改玻璃状态为0 |
| | | |
| | | S7control.getinstance().WriteWord("DB105.50", (short) 1);// 恢复B02小车应答改为1 |
| | | System.out.println("汇报时B02ID|" + B02glassid); |
| | | boolean yingda = spianService.listbool("DB105.50");// b02汇报 |
| | | if (yingda == true) { |
| | | spianService.overtask(B02glassid.toString());// 完成任务 |
| | | } |
| | | System.out.println("汇报时B02|第" + aaa + "次" + B02glassid + "应答" + yingda); |
| | | } |
| | | }else{ |
| | | S7control.getinstance().WriteWord("DB105.50", (short) 0);// 恢复B02小车应答改为0 |
| | | } |
| | | |
| | | |
| | | // 获取DO1数据 |
| | | StringBuilder queueid1 = spianService.queGlassid("DB106.26", 14);// 获取请求的id跟DO1同时清 |
| | | // 获取DO2数据 |
| | | StringBuilder queueid2 = spianService.queGlassid("DB103.58", 14); |
| | | |
| | | int questate = spianMapper.Selectquecount(queueid1.toString());// 判断扫码位是否有玻璃已确认 |
| | | // queueid1.toString().isEmpty() |
| | | north_glass_buffer1 glass1 = spianMapper.selectGlass(queueid1.toString());// D01的玻璃信息 |
| | | north_glass_buffer1 glass2 = spianMapper.selectGlass(queueid2.toString());// D02玻璃信息 |
| | | // 当扫码位玻璃id为空时 宽度为0 |
| | | if (queueid1 != null && questate == 0) { |
| | | // 写入D01的数据到上片队列表 |
| | | if (glass1 == null) { // 当没有值时传空 |
| | | spianMapper.Updatequeue(null, null, null, null, 0, null, null, null, null, 1); |
| | | } else { |
| | | |
| | | spianMapper.Updatequeue(queueid1.toString(), glass1.getordernumber(), glass1.getlistnumber(), |
| | | glass1.getboxnumber(), 0, glass1.getglasslengthmm().toString(), glass1.getglassheightmm().toString(), |
| | | glass1.getglasslength().toString(), glass1.getglassheight().toString(), 1); |
| | | } |
| | | |
| | | } |
| | | |
| | | if (queueid2 != null) { |
| | | // 写入D02的数据到上片队列表 |
| | | if (glass2 == null) { |
| | | spianMapper.Updatequeue(null, null, null, null, 0, null, null, null, null, 2); |
| | | } else { |
| | | spianMapper.Updatequeue(queueid2.toString(), glass2.getordernumber(), glass2.getlistnumber(), |
| | | glass2.getboxnumber(), 0, glass2.getglasslengthmm().toString(), glass2.getglassheightmm().toString(), |
| | | glass2.getglasslength().toString(), glass2.getglassheight().toString(), 2); |
| | | spianMapper.overqueue2(queueid2.toString(), 0, 1);// 更改扫码位任务表的状态为0 |
| | | S7control.getinstance().WriteWord("DB105.16", (short) 0);// 关闭任务启动 |
| | | } |
| | | |
| | | } |
| | | |
| | | // 查询数据库 |
| | | // 推送到前端 |
| | | |
| | | // } |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.example.springboot.component; |
| | | |
| | | import cn.hutool.json.JSONArray; |
| | | import cn.hutool.json.JSONObject; |
| | | |
| | | import java.io.BufferedReader; |
| | | import java.io.FileInputStream; |
| | | import java.io.FileNotFoundException; |
| | | import java.io.IOException; |
| | | import java.io.InputStreamReader; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Arrays; |
| | | |
| | | public class PlcRead extends Thread { |
| | | String name = ""; |
| | | Integer count = 0; |
| | | |
| | | public void readValue() { |
| | | String str = ""; |
| | | BufferedReader bufferedReader = null; |
| | | FileInputStream fileInputStream; |
| | | try { |
| | | // 从文件中读取字节数据存入 fileInputStream |
| | | fileInputStream = new FileInputStream("CanadaMes-ui/src/configuration/Read.json"); |
| | | // 读取 fileInputStream 中字节并将其解码为字符 |
| | | InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream, "utf-8"); |
| | | // 提高读取效率,在 BufferedReader 内包装 InputStreamReader |
| | | bufferedReader = new BufferedReader(inputStreamReader); |
| | | String line = null; |
| | | // 将 bufferedReader 内容一行一行赋值给str |
| | | while ((line = bufferedReader.readLine()) != null) { |
| | | str += line; |
| | | } |
| | | |
| | | // 将str字符串格式转为json |
| | | JSONObject jsonObject = new JSONObject(str); |
| | | |
| | | // 获取json中的值 |
| | | JSONArray address = jsonObject.getJSONArray("address"); |
| | | for (int i = 0; i < address.size(); i++) { |
| | | JSONObject ress = (JSONObject) address.get(i); |
| | | |
| | | this.name = ress.getStr("name"); |
| | | this.count = ress.getInt("count"); |
| | | |
| | | } |
| | | |
| | | } catch (FileNotFoundException e) { |
| | | e.printStackTrace(); |
| | | } catch (UnsupportedEncodingException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void run() { |
| | | while (this != null) { |
| | | try { |
| | | Thread.sleep(1000); |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | List<Boolean> plclist = S7control.getinstance().ReadBits("DB106.0.0", 78); |
| | | |
| | | if (plclist != null) { |
| | | // 将获取的布尔类型转换为整数类型 |
| | | List<Integer> Intlist = new ArrayList<>(); |
| | | for (Boolean value : plclist) { |
| | | if (value != null) { |
| | | Intlist.add(value == true ? 0 : 1); |
| | | } |
| | | |
| | | } |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.append("sig", Intlist); |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("Mes"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | |
|
| | | // if (S7control.getinstance().CheckConnected() == true) {
|
| | |
|
| | | |
| | |
|
| | | // 铝框线交互
|
| | | if (S7controlLK.getinstance().CheckConnected() == true) {
|
| | | if (CurrentFrame != null) {
|
| | |
| | | // |
| | | System.out.println("启动完成"); |
| | | |
| | | <<<<<<< HEAD |
| | | // new PlcHold().start(); |
| | | |
| | | // new Plchome().start(); |
| | |
| | | new Plclog().start(); |
| | | |
| | | new PlcInteractionState().start(); |
| | | ======= |
| | | // new PlcHold().start(); |
| | | new PLCAutoMes().start(); |
| | | // new PLCAutomaticParameterSettingReview2().start(); |
| | | |
| | | //new Plchome().start(); |
| | | // new PlcLayout().start(); |
| | | // new Plcalarm().start(); |
| | | |
| | | // new Plcsign().start(); |
| | | |
| | | // new Plcstate().start(); |
| | | // new PlcPositioning1().start(); |
| | | |
| | | // new PlcParameter2().start(); |
| | | |
| | | // new PLCAutomaticParameterSetting().start(); |
| | | |
| | | // new PlcManualonePosition().start(); |
| | | // new PlcManualonePosition2().start(); |
| | | // new PlcServoManualone().start(); |
| | | // new PLCManualJog().start(); |
| | | // new Plclog().start(); |
| | | |
| | | // new PlcInteractionState().start(); |
| | | >>>>>>> f66c565a395e10901fc71abcfa37f4ff5a15be09 |
| | | //new PlcParameter1Review().start(); |
| | | // new PLCAutomaticParameterSettingReview().start(); |
| | | } |
| | |
| | | */ |
| | | 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) { |
New file |
| | |
| | | { |
| | | "plcAddressBegin":"DB105.0", |
| | | "plcAddressLenght":"52", |
| | | "dataType":"word", |
| | | "parameteInfor":[ |
| | | { |
| | | "codeId": "AddStart", |
| | | "addressIndex":"0", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"m/min" |
| | | }, |
| | | { |
| | | "codeId": "Addgoal", |
| | | "addressIndex":"2", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"m/min" |
| | | }, |
| | | { |
| | | "codeId": "AddLength", |
| | | "addressIndex":"4", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"m/min" |
| | | }, |
| | | { |
| | | "codeId": "AddWidth", |
| | | "addressIndex":"6", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm/S" |
| | | }, |
| | | { |
| | | "codeId": "AddCount", |
| | | "addressIndex":"8", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm/S" |
| | | }, |
| | | { |
| | | "codeId": "OutStart", |
| | | "addressIndex":"10", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm/S" |
| | | }, |
| | | { |
| | | "codeId": "Outgoal", |
| | | "addressIndex":"12", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm/S" |
| | | }, |
| | | { |
| | | "codeId": "OutCount", |
| | | "addressIndex":"14", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm/S" |
| | | }, |
| | | { |
| | | "codeId": "AddActivate", |
| | | "addressIndex":"16", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm/S" |
| | | }, |
| | | { |
| | | "codeId": "OutActivate", |
| | | "addressIndex":"18", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm/S" |
| | | }, |
| | | { |
| | | "codeId": "FeedID", |
| | | "addressIndex":"20", |
| | | "addressLenght":"14", |
| | | "ratio":"1", |
| | | "unit":"mm/S" |
| | | }, |
| | | { |
| | | "codeId": "ReleaseID", |
| | | "addressIndex":"34", |
| | | "addressLenght":"14", |
| | | "ratio":"1", |
| | | "unit":"mm/S" |
| | | }, |
| | | { |
| | | "codeId": "B01report", |
| | | "addressIndex":"48", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm/S" |
| | | }, |
| | | { |
| | | "codeId": "B02report", |
| | | "addressIndex":"50", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"m/min" |
| | | } |
| | | |
| | | |
| | | ] |
| | | } |
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":"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" |
| | | } |
| | | |
| | | |
| | | ] |
| | | } |
New file |
| | |
| | | package com.canadames.controller.device; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author yyq |
| | | * @since 2024-01-17 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/device-entity") |
| | | public class DeviceController { |
| | | |
| | | } |
New file |
| | |
| | | package com.canadames.entity.device; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.io.Serializable; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author yyq |
| | | * @since 2024-01-17 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("device") |
| | | @ApiModel(value="DeviceEntity对象", description="") |
| | | public class DeviceEntity implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private String deviceId; |
| | | |
| | | private String createUser; |
| | | |
| | | private LocalDateTime createTime; |
| | | |
| | | private String deviceName; |
| | | |
| | | private String status; |
| | | |
| | | private String info; |
| | | |
| | | private String model; |
| | | |
| | | private LocalDateTime countTimeFlag; |
| | | |
| | | private String address; |
| | | |
| | | private String gps; |
| | | |
| | | private LocalDate debugTime; |
| | | |
| | | private LocalDate endTime; |
| | | |
| | | private String customerName; |
| | | |
| | | private String customerDeviceName; |
| | | |
| | | private LocalDate lastProductCountDate; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.canadames.mapper.device; |
| | | |
| | | import com.canadames.entity.device.DeviceEntity; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author yyq |
| | | * @since 2024-01-17 |
| | | */ |
| | | public interface DeviceDao extends BaseMapper<DeviceEntity> { |
| | | |
| | | } |
New file |
| | |
| | | package com.canadames.service.device; |
| | | |
| | | import com.canadames.entity.device.DeviceEntity; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author yyq |
| | | * @since 2024-01-17 |
| | | */ |
| | | public interface DeviceService extends IService<DeviceEntity> { |
| | | |
| | | } |
New file |
| | |
| | | package com.canadames.service.device.impl; |
| | | |
| | | import com.canadames.entity.device.DeviceEntity; |
| | | import com.canadames.mapper.device.DeviceDao; |
| | | import com.canadames.service.device.DeviceService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author yyq |
| | | * @since 2024-01-17 |
| | | */ |
| | | @Service |
| | | public class DeviceServiceImpl extends ServiceImpl<DeviceDao, DeviceEntity> implements DeviceService { |
| | | |
| | | } |
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.canadames.mapper.device.DeviceDao"> |
| | | |
| | | </mapper> |