feiyu02
2025-07-16 8fc27dba6719041402e3e3c099e2f3e01d9d52c7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package com.flightfeather.uav.socket.processor
 
import com.flightfeather.uav.common.utils.FileUtil
import com.flightfeather.uav.socket.DeviceSession
import io.netty.channel.ChannelHandlerContext
import java.text.SimpleDateFormat
import java.util.*
 
abstract class BaseProcessor {
 
    abstract var tag: String
 
    val deviceSession = DeviceSession()
 
    abstract fun dealStringMsg(msg: String, ctx: ChannelHandlerContext?)
 
    /**
     * 保存至txt文本
     */
    fun saveToTxt(msg: String) {
        val data = "[${SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Date())}]data=> $msg"
        FileUtil.instance?.saveObdData(data)
    }
}