增加卫星数统计
This commit is contained in:
parent
115bc5301b
commit
c02c085291
@ -36,7 +36,6 @@ public class GnssStatus {
|
||||
Integer voltage;
|
||||
Float temperature;
|
||||
Float humidity;
|
||||
Integer satelliteinview;
|
||||
Integer satelliteinuse;
|
||||
// 这里的收发都是服务端统计的,终端收发详细统计在msg_trx表里
|
||||
Integer txbytes;
|
||||
|
||||
@ -57,6 +57,7 @@ public class D331RtcmMessageExecutor implements Executor<D331RtcmMessage, Void>
|
||||
}
|
||||
Gga gga = message.getGga();
|
||||
if(gga != null) {
|
||||
device1.updateSatelitesNum(gga.getSatellitesInUsed());
|
||||
logger.info(message.getId()+
|
||||
" lat: "+gga.getLatitude()+
|
||||
" lon:"+gga.getLongitude()+
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.imdroid.sideslope.executor;
|
||||
|
||||
import com.imdroid.sideslope.bd.Gga;
|
||||
import com.imdroid.sideslope.calc.GNSSDataCalcService;
|
||||
import com.imdroid.sideslope.message.D341LocationMessage;
|
||||
import com.imdroid.sideslope.sal.Device;
|
||||
@ -36,6 +37,10 @@ public class D341LocationMessageExecutor implements Executor<D341LocationMessage
|
||||
if(device == null) return null;
|
||||
message.setTenantId(device.getTenantId());
|
||||
device.updateD341Bytes(message.getLen());
|
||||
Gga gga = message.getGga();
|
||||
if(gga != null) {
|
||||
device.updateSatelitesNum(gga.getSatellitesInUsed());
|
||||
}
|
||||
|
||||
ThreadManager.getFixedThreadPool().submit(() -> {
|
||||
gnssCalcService.calcSingle(message,true);
|
||||
|
||||
@ -56,7 +56,8 @@ public class D3F2StopIndicationMessageExecutor implements Executor<D3F2StopIndic
|
||||
ThreadManager.getFixedThreadPool().submit(() -> {
|
||||
LocalDateTime uploadTime = multiLineGNSSCalcService.checkUploadTime(
|
||||
device.getDeviceId(), device.getTenantId());
|
||||
dataPersistService.saveDeviceTrxStat(message, (uploadTime!=null));
|
||||
dataPersistService.saveDeviceTrxStat(message, (uploadTime!=null), device.getSatelitesInUse());
|
||||
device.setSatelitesInUse(0);
|
||||
// 通知beidou服务设备休眠
|
||||
beidouClient.onDeviceStop(deviceId,device.getTenantId());
|
||||
if(uploadTime!=null){
|
||||
|
||||
@ -39,6 +39,7 @@ public class Device {
|
||||
int d3xxbytes = 0;
|
||||
int d341Count = 0;
|
||||
int d341bytes = 0;
|
||||
int satelitesInUse = 0;
|
||||
|
||||
public void updateD331Bytes(int bytes){
|
||||
d3xxCount++;
|
||||
@ -50,6 +51,10 @@ public class Device {
|
||||
d341bytes += bytes;
|
||||
}
|
||||
|
||||
public void updateSatelitesNum(int num){
|
||||
satelitesInUse = num;
|
||||
}
|
||||
|
||||
public void clearStat(){
|
||||
d3xxCount = 0;
|
||||
d3xxbytes = 0;
|
||||
|
||||
@ -18,6 +18,6 @@ public interface DataPersistService {
|
||||
void updateDeviceState(GnssStatus gnssStatus);
|
||||
void saveDeviceState(D3F0SelfCheckMessage d3F0SelfCheckMessage);
|
||||
|
||||
void saveDeviceTrxStat(D3F2StopIndicationMessage d3F2StopIndicationMessage,boolean isUploading);
|
||||
void saveDeviceTrxStat(D3F2StopIndicationMessage d3F2StopIndicationMessage,boolean isUploading,int satelitesNum);
|
||||
|
||||
}
|
||||
|
||||
@ -86,7 +86,7 @@ public class DataPersistServiceImpl implements DataPersistService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveDeviceTrxStat(D3F2StopIndicationMessage message, boolean isUploading) {
|
||||
public void saveDeviceTrxStat(D3F2StopIndicationMessage message, boolean isUploading,int satelitesNum) {
|
||||
try {
|
||||
// 添加到trxmsg里
|
||||
GnssTrxMsg trxMsg = message.getTrxMsg();
|
||||
@ -104,6 +104,7 @@ public class DataPersistServiceImpl implements DataPersistService {
|
||||
deviceState.setRxbytes(rxbytes);*/
|
||||
deviceState.setD3xxbytes(trxMsg.getD3xxbytes());
|
||||
deviceState.setB562bytes(trxMsg.getB562bytes());
|
||||
deviceState.setSatelliteinuse(satelitesNum);
|
||||
deviceState.setState(isUploading?GnssStatus.STATE_UPLOADING:GnssStatus.STATE_IDLE);
|
||||
deviceStateRepository.updateById(deviceState);
|
||||
}
|
||||
|
||||
@ -111,7 +111,6 @@ CREATE TABLE IF NOT EXISTS `gnssstatus` (
|
||||
`voltage` int DEFAULT 0,
|
||||
`temperature` float DEFAULT 0,
|
||||
`humidity` float DEFAULT 0,
|
||||
`satelliteinview` float DEFAULT 0,
|
||||
`satelliteinuse` float DEFAULT 0,
|
||||
`txbytes` int DEFAULT 0,
|
||||
`rxbytes` int DEFAULT 0,
|
||||
|
||||
@ -107,6 +107,7 @@
|
||||
{field: 'temperature', title: '温度'},
|
||||
{field: 'humidity', title: '湿度'},
|
||||
{field: 'rssi', title: '信号'},
|
||||
{field: 'satelliteinuse', title: '使用卫星数'},
|
||||
{title: '操作', toolbar: '#currentTableBar', align: "center"}
|
||||
]],
|
||||
limits: [10, 15, 20, 25, 50, 100],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user