| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!-- ====================================================================== --> |
| | | <!-- --> |
| | | <!-- Generated by Maven Help Plugin on 2024-03-07T14:06:55+08:00 --> |
| | | <!-- Generated by Maven Help Plugin on 2024-03-19T08:09:38+08:00 --> |
| | | <!-- See: http://maven.apache.org/plugins/maven-help-plugin/ --> |
| | | <!-- --> |
| | | <!-- ====================================================================== --> |
| | |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi</artifactId> |
| | | <version>4.1.2</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi-ooxml</artifactId> |
| | | <version>4.1.2</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi-ooxml-schemas</artifactId> |
| | | <version>4.1.2</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-amqp</artifactId> |
| | | <version>2.3.2.RELEASE</version> |
| | |
| | | public class MyGenerator { |
| | | |
| | | /** 数据源配置*/ |
| | | private static final String jdbc = "jdbc:mysql://localhost:3306/albania?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai"; |
| | | private static final String jdbc = "jdbc:mysql://10.153.19.150:3306/albania?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai"; |
| | | private static final String driverName = "com.mysql.cj.jdbc.Driver"; |
| | | |
| | | private static final String username = "root"; |
| | |
| | | } |
| | | // List<Short> ss= S7control.getinstance().ReadWord("DB14.0", 1); |
| | | // System.out.println(ss); |
| | | |
| | | String E01id = S7control.getinstance().readStrings("DB14.0"); |
| | | System.out.println(E01id); |
| | | // System.out.println(111111); |
| | | // List<Short> E0sss1id = S7control.getinstance().ReadWord("DB14.0",1); |
| | | // String E01id = S7control.getinstance().readStrings("DB14.38"); |
| | | // System.out.println(E01id); |
| | | // if (S7control.getinstance().CheckConnected() == false) { |
| | | byte[] E0sss1id = S7control.getinstance().ReadByte("DB14.208",1); |
| | | spianService = WebSocketServer.applicationContext.getBean(SpianServiceNew.class); |
| | | albaniaMapper = WebSocketServer.applicationContext.getBean(AlbaniaMapper.class); |
| | | //spianService.selectAll(albaniaMapper.SelectGlass()); |
| | |
| | | S7PLC s7PLC; // PLC通讯类实例 |
| | | private EPlcType plcType = EPlcType.S1500; // 西门子PLC类型 |
| | | private String ip = "192.168.10.1"; // plc ip地址 |
| | | private int port = 65; // plc 端口号 |
| | | private int port = 102; // plc 端口号 |
| | | |
| | | private static volatile S7control instance = null; |
| | | |
| | |
| | | // TODO Auto-generated method stub |
| | | // |
| | | System.out.println("启动完成"); |
| | | |
| | | // new PLCAutoMes().start(); |
| | | // new PlcHold().start(); |
| | | // new PlcHoldNew().start(); |
| | | // new PLCAutoMes().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(); |
| | | |
| | |
| | | */ |
| | | public static Connection getConn() throws SQLException { |
| | | Connection conn = null; |
| | | conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/canadames?serverTimezone=GMT%2B8&characterEncoding=utf-8", "root", "beibo.123/"); |
| | | conn = DriverManager.getConnection("jdbc:mysql://10.153.19.150:3306/canadames?serverTimezone=GMT%2B8&characterEncoding=utf-8", "root", "beibo.123/"); |
| | | return conn; |
| | | } |
| | | |
| | |
| | | { |
| | | "plcAddressBegin":"DB14.0", |
| | | "plcAddressLenght":"210", |
| | | "plcAddressLenght":"208", |
| | | "dataType":"word", |
| | | "parameteInfor":[ |
| | | { |
| | |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm/S" |
| | | },{ |
| | | "codeId": "MainControl", |
| | | "addressIndex":"208", |
| | | "addressLenght":"2", |
| | | "ratio":"1", |
| | | "unit":"mm/S" |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | ] |
| | | } |