feiyu02
2025-09-12 61871594dfa0a5ac2c4d895d9ec4034feba57094
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)
    }
}