ZengTao
2024-01-26 f392f9d594095738ba4d82885251de40b752f843
代码更新
3个文件已修改
76 ■■■■■ 已修改文件
springboot-vue3/src/main/java/com/example/springboot/component/PLCAutoMes.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/PLCAutoMes.java
@@ -35,6 +35,14 @@
        return instance;
    }
    private static String jsonFilePath = PLCAutoMes.class.getResource("/JsonFile/PlcMes.json").getPath();
    private static String jsonFilePath2 = PLCAutoMes.class.getResource("/JsonFile/PlcRead.json").getPath();
    // 调用initword方法
    public static PlcParameterObject PlcMesObject = initUtil.initword(jsonFilePath);
    // 调用initbit方法
    public static PlcParameterObject PlcReadObject = initUtil.initword(jsonFilePath2);
    @Override
    public void run() {
        while (this != null) {
@@ -45,45 +53,32 @@
                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();
            // 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);
            // // 调用initbit方法
            // PlcParameterObject PlcframeObject= initUtil.initword(jsonFilePath3);
            PlcParameterObject PlcReadObjects=PlcReadObject;
            // readAndUpdateWordValues(PlcReadObject);
            // readAndUpdateWordValues(PlcMesObject);
            // readAndUpdateWordValues(PlcframeObject);
            // readAndUpdateWordValues(plcStateObject);
            int index = PlcMesObject.getPlcParameter("AddStart").getAddressIndex();
            //System.out.println(index);
            // System.out.println(index);
            PlcMesObject.getPlcParameter("AddStart").getAddress(index);
            //System.out.println(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));
            // 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));
        }
    }
springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
@@ -20,6 +20,7 @@
import com.example.springboot.entity.StorageCage;
import com.example.springboot.entity.alarmmg;
import com.example.springboot.entity.north_glass_buffer1;
import com.example.springboot.entity.device.PlcParameterObject;
import com.example.springboot.mapper.HomeMapper;
import com.example.springboot.mapper.SpianMapper;
@@ -63,6 +64,9 @@
            try {
                Thread.sleep(1000);
                // 注入mapper
                PlcParameterObject PlcReadObjects=PLCAutoMes.PlcMesObject;
                homeMapper = WebSocketServer.applicationContext.getBean(HomeMapper.class);
                spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class);
                spianService = WebSocketServer.applicationContext.getBean(SpianService.class);
springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java
@@ -17,35 +17,11 @@
        //
        System.out.println("启动完成");
<<<<<<< HEAD
        //  new PlcHold().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();
=======
       // new PlcHold().start();
        new PLCAutoMes().start();
        // new PLCAutomaticParameterSettingReview2().start();
        //new Plchome().start();
        new Plchome().start();
        // new PlcLayout().start();
        // new Plcalarm().start();
@@ -65,7 +41,6 @@
        // new Plclog().start();
        // new PlcInteractionState().start();
>>>>>>> f66c565a395e10901fc71abcfa37f4ff5a15be09
        //new PlcParameter1Review().start();
       // new PLCAutomaticParameterSettingReview().start();
    }