修改GGA固定解统计的bug
This commit is contained in:
parent
d3ab02af53
commit
0797627f39
@ -7,6 +7,8 @@ import java.nio.charset.Charset;
|
||||
|
||||
@Data
|
||||
public class Gga {
|
||||
public static int FIX_RESULT = 4;
|
||||
public static int FLOAT_RESULT = 5;
|
||||
final static byte[] GGA_FLAG = {'$', 'G'};//$xxGGA
|
||||
|
||||
final static byte[] d331_flag = {(byte) 0xd3, (byte)0x31};
|
||||
@ -133,6 +135,6 @@ public class Gga {
|
||||
//Possible values for quality: 0 = No fix, 1 = autonomous GNSS fix, 2 = differential GNSS fix, 4 = RTK fixed, 5 = RTK float, 6 =
|
||||
//estimated/dead reckoning fix
|
||||
//return (quality==1 || quality==2 || quality==4);
|
||||
return (quality==4);
|
||||
return (quality==FIX_RESULT);
|
||||
}
|
||||
}
|
||||
|
||||
@ -79,7 +79,7 @@ public class SingleLineGNSSCalcService implements GNSSDataCalcService {
|
||||
if(device == null) return;
|
||||
GnssGroupCalc groupCalc = getGroupCalc(device.getCalcGroupId());
|
||||
if(groupCalc==null) return;
|
||||
device.setCalcVer(groupCalc.getVer());
|
||||
device.setB562AsCalc(groupCalc.getVer()!=3);
|
||||
|
||||
if(completeWhenIdle) resultOutputTimer(device, groupCalc, message.getCreateTime());
|
||||
|
||||
|
||||
@ -74,9 +74,9 @@ public class D341LocationMessageExecutor implements Executor<D341LocationMessage
|
||||
|
||||
// update trx
|
||||
device.updateRx(message.getHeader(), message.getLen(), 1);
|
||||
if(device.getCalcVer()==null || device.getCalcVer()!=3) {
|
||||
if(device.isB562AsCalc()) {
|
||||
double[] pos = message.getB562_loc();
|
||||
device.updateB562Quality((int) pos[3]);
|
||||
device.updateCalcQuality((int) pos[3]);
|
||||
}
|
||||
|
||||
Gga gga = message.getGga();
|
||||
@ -87,8 +87,8 @@ public class D341LocationMessageExecutor implements Executor<D341LocationMessage
|
||||
device.setLongitude(gga.getLongitude());
|
||||
device.setAltitude(gga.getAltitude());
|
||||
}
|
||||
if(device.getCalcVer()!=null && device.getCalcVer()==3){
|
||||
device.updateB562Quality(gga.getQuality());
|
||||
if(!device.isB562AsCalc()){
|
||||
device.updateCalcQuality(gga.getQuality());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.imdroid.sideslope.sal;
|
||||
|
||||
import com.imdroid.sideslope.bd.Gga;
|
||||
import com.imdroid.sideslope.bd.UBXUtil;
|
||||
import lombok.Data;
|
||||
|
||||
@ -37,7 +38,7 @@ public class Device {
|
||||
|
||||
private Integer calcGroupId;
|
||||
private Short opMode;
|
||||
private Short calcVer;//算法版本
|
||||
private boolean b562AsCalc = true;//算法版本
|
||||
|
||||
int d3xxCount = 0;
|
||||
int d3xxbytes = 0;
|
||||
@ -103,10 +104,16 @@ public class Device {
|
||||
}
|
||||
}
|
||||
|
||||
public void updateB562Quality(int quality){
|
||||
public void updateCalcQuality(int quality){
|
||||
if(b562AsCalc) {
|
||||
if (quality == UBXUtil.FIX_RESULT) fixedNum++;
|
||||
else if (quality == UBXUtil.FLOAT_RESULT) floatNum++;
|
||||
}
|
||||
else{
|
||||
if (quality == Gga.FIX_RESULT) fixedNum++;
|
||||
else if (quality == Gga.FLOAT_RESULT) floatNum++;
|
||||
}
|
||||
}
|
||||
|
||||
public void clearStat(){
|
||||
if(fixedNum+floatNum == 0) noFixedAndFloatResult++;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user