ZengTao
2024-01-19 70a93a33fabd58e1f4b3a50410060ae1b855c8ed
springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
@@ -121,42 +121,51 @@
            // List<Short> listd17 = S7control.getinstance().ReadWord("DB17.0",10);
            // String id=spianService.queGlassid("DB17.10", 14).toString();
            //
            //
            // // 铝框线交互
            // try {
            //     if (CurrentFrame != null) {
            //         spianService.outmesid(CurrentFrame.getBarCode(), "DB17.0");
            //     }
            //     List<Short> framerequests = S7control.getinstance().ReadWord("铝框id请求字地址", 1);
            //     for (Short framerequest : framerequests) {
            //         if (framerequest == 1) {
            //             // 铝框id
            //             String franmeno = spianService.queGlassid("DB17.10", 14).toString();
            //             String position;
            //             try {
            //                 position = dbserve.SelectPositionByFrameBarcode(franmeno);
            //             } catch (SQLException e) {
            //                 // TODO Auto-generated catch block
            //                 position = "0";
            //                 e.printStackTrace();
            //             }
            //             Short send;
            //             if (position == "0") {
            //                 send = 0;
            //             } else {
            //                 send = 1;
            //             }
            //             S7control.getinstance().WriteWord("铝框翻转发送地址", (short) send);
            //         }
            //     }
            // if (CurrentFrame != null) {
            // spianService.outmesid(CurrentFrame.getBarCode(), "DB17.0");
            // }
            // List<Short> framerequests = S7control.getinstance().ReadWord("铝框id请求字地址", 1);
            // for (Short framerequest : framerequests) {
            // if (framerequest == 1) {
            // // 铝框id
            // String franmeno = spianService.queGlassid("DB17.10", 14).toString();
            // String position;
            // try {
            // position = dbserve.SelectPositionByFrameBarcode(franmeno);
            // } catch (SQLException e) {
            // // TODO Auto-generated catch block
            // position = "0";
            // e.printStackTrace();
            // }
            // Short send;
            // if (position == "0") {
            // send = 0;
            // } else {
            // send = 1;
            // }
            // S7control.getinstance().WriteWord("铝框翻转发送地址", (short) send);
            // }
            // }
            // } catch (Exception e) {
            //     // TODO: handle exception
            // // TODO: handle exception
            // }
            if (S7control.getinstance().CheckConnected() == true) {
                // 获取当前扫码方式
                List<Short> Scanningmethod = S7control.getinstance().ReadWord("DB103.255", 1);
                jsonObject.append("Scanningmethod", Scanningmethod);
                List<Boolean> Scanningmethods = S7control.getinstance().ReadBits("DB101.11.4", 1);
                if (Scanningmethods != null) {
                    for (Boolean Scanningmethod : Scanningmethods) {
                        jsonObject.append("Scanningmethod", Scanningmethod);
                    }
                }
                String CurrrentGlassId = spianService.queGlassid("DB103.256", 14).toString();
                jsonObject.append("CurrrentGlassId", CurrrentGlassId);
                // 获取D01-D06,A01,A02,B01,B02状态
                List<Short> DeviceList = S7control.getinstance().ReadWord("DB103.0", 10);
                jsonObject.append("DeviceList", DeviceList);