| | |
| | | package com.ard.utils.tcp; |
| | | |
| | | /** |
| | | * @Description: |
| | | * @ClassName: ClientHandler |
| | | * @Author: 刘苏义 |
| | | * @Date: 2023年07月05日13:13 |
| | | * @Version: 1.0 |
| | | **/ |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.ard.alarm.radar.domain.ArdAlarmRadar; |
| | | import com.ard.alarm.radar.domain.ArdEquipRadar; |
| | | import com.ard.alarm.radar.domain.RadarAlarmData; |
| | | import com.ard.utils.ByteUtils; |
| | | import com.ard.utils.GisUtils; |
| | | import com.ard.utils.other.ByteUtils; |
| | | import com.ard.utils.other.GisUtils; |
| | | import com.ard.utils.mqtt.MqttConsumer; |
| | | import io.netty.buffer.ByteBuf; |
| | | import io.netty.channel.ChannelHandlerContext; |
| | | import io.netty.channel.ChannelId; |
| | | import io.netty.channel.ChannelInboundHandlerAdapter; |
| | | import io.netty.channel.SimpleChannelInboundHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | import java.util.List; |
| | | import java.util.concurrent.ScheduledFuture; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | | * 客户端处理器 |
| | | * |
| | | * @author lijiamin |
| | | */ |
| | | * @Description: 客户端处理器 |
| | | * @ClassName: ClientHandler |
| | | * @Author: 刘苏义 |
| | | * @Date: 2023年07月05日13:13 |
| | | * @Version: 1.0 |
| | | **/ |
| | | |
| | | @Slf4j(topic = "netty") |
| | | public class ClientHandler extends SimpleChannelInboundHandler<ByteBuf> { |
| | | private ChannelHandlerContext context; |
| | |
| | | afTy = ByteUtils.toLittleEndian(afTy); |
| | | float fTy = ByteUtils.bytesToFloat(afTy); |
| | | // log.info("垂直角度:" + fTy); |
| | | Double[] radarXY = {radarLagitude, radarLagitude}; |
| | | Double[] radarXY = {radarLongitude, radarLagitude}; |
| | | Double[] alarmXY = GisUtils.CalculateCoordinates(radarXY, Distance, (double) fTx); |
| | | // log.info("报警信息:" + "【id】" + id + "【name】" + alarmPointName + "【alarmType】" + alarmType + "【alarmTime】" + alarmTime + "【distance】" + Distance + "【P】" + fTx + "【T】" + fTy + "【X】" + alarmXY[0] + "【Y】" + alarmXY[1]); |
| | | ArdAlarmRadar ardAlarmRadar = new ArdAlarmRadar(); |