| | |
| | | String s="白玻"; |
| | | log.info(s); |
| | | } |
| | | @Test |
| | | public void testReadJson() { |
| | | try { |
| | | LogicConfig logicConfig=JsonConversion.jsonToObjectByJackson(ReadFile.readJson("shelfLogic.json").toString(), LogicConfig.class); |
| | | PlcParameters plcParameters=JsonConversion.jsonToObjectByJackson(ReadFile.readJson("shelf.json").toString(), PlcParameters.class); |
| | | log.info("{},{}",logicConfig,plcParameters); |
| | | }catch (Exception e) { |
| | | |
| | | } |
| | | } |
| | | @Test |
| | | public void testReadS7Old() throws IOException { |
| | | S7PLC s7PLC = new S7PLC(EPlcType.S1500, "10.153.19.191", 102, 0, 0); |
| | |
| | | // log.info("{}",resultView); |
| | | |
| | | // 示例 调用testProcedure存储过程 |
| | | // Map<String, Object> params = new HashMap<>(); |
| | | // params.put("dataParmars", "测试数据"); // 输入参数,对应存储过程中的IN参数 |
| | | // Map<String, Object> outParams = new HashMap<>(); |
| | | // outParams.put("messagedate", Types.VARCHAR); // 输出参数,对应存储过程中的OUT参数 |
| | | // String[] resultProcedure = api.procedureAPI("testProcedure", params, outParams); |
| | | // // 打印执行结果 |
| | | // log.info("{}存储过程执行结果:{}",params,resultProcedure); |
| | | Map<String, Object> params = new HashMap<>();// 参数 |
| | | Map<String, Object> inParams = new HashMap<>();// 输入参数 |
| | | Map<String, Object> outParams = new HashMap<>();// 输出参数 |
| | | inParams.put("dataParsers", "测试数据"); |
| | | outParams.put("messageDate", Types.VARCHAR); |
| | | outParams.put("messageDate2", Types.VARCHAR); |
| | | params.put("inParams", inParams); |
| | | params.put("outParams", outParams); |
| | | List<String> resultProcedure = api.procedureAPI("testProcedure", params); |
| | | // 打印执行结果 |
| | | log.info("{}存储过程执行结果:{}",params,resultProcedure); |
| | | } |
| | | @Test |
| | | public void testMainThread() { |