riku
6 天以前 20b8d870efbbb89564b599561fc69202ba41223f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package com.flightfeather.uav.socket
 
import com.flightfeather.uav.socket.processor.UnderwayProcessor
import org.junit.Test
import org.junit.runner.RunWith
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.test.context.junit4.SpringRunner
import java.io.File
import java.nio.file.Files
import java.nio.file.Paths
 
/**
 * @author riku
 * Date: 2019/9/16
 */
@RunWith(SpringRunner::class)
@SpringBootTest
class UnderwayProcessorTest {
 
    @Autowired
    lateinit var messageManager: UnderwayProcessor
 
    @Test
    fun bccCheck() {
        listOf(
            "01 04 0a 00 00 00 00 01 12 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 00 0c",
            "01 05 0a 00 00 00 00 01 52 00 05 af 00 cb f7 03 45 84 02 a1 65 00 71 92 01 ec 04 00 b7 9b 01 6e 0f 00 aa 9c 01 6b c4 00 0c 00 00 0d 00 00 1b 10 00 34 08 05 d3 1c 05 d4 7f 00 00 00 00 00 00 56 00 00 00 00 45 00 00 00 00 4e 00 00 00 50 01 06 08 0c 29 00 00 00 00 00 00 00 00 00 64"
        ).forEach {
            messageManager.dealStringMsg(it, null)
        }
//        println(messageManager.bccCheck(s))
//        val lines = Files.readAllLines(Paths.get("C:\\Users\\feiyu\\Desktop\\data-2026-04-10-10-03-14.txt"))
//        println("数据量:${lines.size - 1}")
//        lines.forEach {
//            val msg = it.split("data=> ")[1]
//            messageManager.dealStringMsg(msg, null)
//            Thread.sleep(4000)
//        }
    }
}