| | |
| | | ExecutorService executor = Executors.newFixedThreadPool(THREAD_POOL_SIZE); |
| | | |
| | | try (DatagramSocket socket = new DatagramSocket(PORT)) { |
| | | System.out.println("UDPServer started on port " + PORT); |
| | | |
| | | while (!Thread.currentThread().isInterrupted()) { |
| | | byte[] buffer = new byte[BUFFER_SIZE]; |
| | | DatagramPacket packet = new DatagramPacket(buffer, buffer.length); |
| | |
| | | return; |
| | | } |
| | | int sequence = incrementReceivedPacketCounter(); |
| | | System.out.println("收到了差分数据(" + sequence + "):" + message); |
| | | |
| | | // 使用Gpstoxuzuobiao处理并获取XY坐标 |
| | | double[] xy = Gpstoxuzuobiao.processGNGGAToXY(message); |
| | |
| | | |
| | | Coordinate.parseGNGGAToCoordinateList(message); |
| | | int count = Coordinate.coordinates.size(); |
| | | System.out.println("savenum:" + count); |
| | | |
| | | Device.updateFromGNGGA(message, fields[15]); |
| | | } |
| | |
| | | return; |
| | | } |
| | | int sequence = incrementReceivedPacketCounter(); |
| | | System.out.println("收到了串口数据(" + sequence + "):" + message); |
| | | |
| | | // 使用Gpstoxuzuobiao处理并获取XY坐标 |
| | | double[] xy = Gpstoxuzuobiao.processGNGGAToXY(message); |
| | |
| | | |
| | | Coordinate.dellchuankougngga(message); |
| | | int count = Coordinate.coordinates.size(); |
| | | System.out.println("savenum:" + count); |
| | | |
| | | Device.updateFromSerialGNGGA(message); |
| | | } |