[6.2.0] remove impl of real time and tanlu service , update socket of heart beat func
This commit is contained in:
@@ -44,10 +44,6 @@ dependencies {
|
||||
api rootProject.ext.dependencies.mogoaicloudsocket
|
||||
implementation rootProject.ext.dependencies.mogoaicloudlocation
|
||||
|
||||
api rootProject.ext.dependencies.mogoaicloudrealtime
|
||||
|
||||
annotationProcessor 'com.elegant.spi:compiler:1.0.3'
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.mogo_core_utils
|
||||
implementation rootProject.ext.dependencies.mogo_core_data
|
||||
@@ -56,8 +52,6 @@ dependencies {
|
||||
implementation project(':core:mogo-core-utils')
|
||||
implementation project(':core:mogo-core-data')
|
||||
}
|
||||
|
||||
annotationProcessor 'com.elegant.spi:compiler:1.0.3'
|
||||
}
|
||||
|
||||
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
||||
@@ -1,68 +0,0 @@
|
||||
package com.mogo.aicloud.services.locationinfo;
|
||||
|
||||
public class RealTimeData {
|
||||
|
||||
private static volatile RealTimeData realTimeData;
|
||||
private static final byte[] bytes = new byte[0];
|
||||
|
||||
private double lat;
|
||||
private double lon;
|
||||
private double heading;
|
||||
private int speed;
|
||||
private long satelliteTime;
|
||||
|
||||
private RealTimeData() {
|
||||
|
||||
}
|
||||
|
||||
public static RealTimeData getInstance() {
|
||||
if (realTimeData == null) {
|
||||
synchronized (bytes) {
|
||||
if (realTimeData == null) {
|
||||
realTimeData = new RealTimeData();
|
||||
}
|
||||
}
|
||||
}
|
||||
return realTimeData;
|
||||
}
|
||||
|
||||
public void setLat(double lat) {
|
||||
this.lat = lat;
|
||||
}
|
||||
|
||||
public void setLon(double lon) {
|
||||
this.lon = lon;
|
||||
}
|
||||
|
||||
public void setHeading(double heading) {
|
||||
this.heading = heading;
|
||||
}
|
||||
|
||||
public void setSpeed(int speed) {
|
||||
this.speed = speed;
|
||||
}
|
||||
|
||||
public void setSatelliteTime(long satelliteTime) {
|
||||
this.satelliteTime = satelliteTime;
|
||||
}
|
||||
|
||||
public double getLat() {
|
||||
return lat;
|
||||
}
|
||||
|
||||
public double getLon() {
|
||||
return lon;
|
||||
}
|
||||
|
||||
public double getHeading() {
|
||||
return heading;
|
||||
}
|
||||
|
||||
public int getSpeed() {
|
||||
return speed;
|
||||
}
|
||||
|
||||
public long getSatelliteTime() {
|
||||
return satelliteTime;
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
package com.mogo.aicloud.services.locationinfo;
|
||||
|
||||
import com.elegant.spi.annotations.Service;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.realtime.api.IRealTimeProvider;
|
||||
import com.mogo.realtime.entity.SocketReceiveDataProto3;
|
||||
import com.mogo.realtime.util.MortonCode;
|
||||
|
||||
import static com.mogo.cloud.socket.SocketMsgType.MSG_TYPE_UPLINK_CAR_DATA;
|
||||
|
||||
@Service(value = IRealTimeProvider.class)
|
||||
public class SpiRealTimeProvider implements IRealTimeProvider {
|
||||
|
||||
@Override
|
||||
public SocketReceiveDataProto3.SocketReceiveDataProto getLocationMsg() {
|
||||
|
||||
double lat = RealTimeData.getInstance().getLat();
|
||||
double lon = RealTimeData.getInstance().getLon();
|
||||
if (lat == 0.0f || lon == 0.0f) {
|
||||
return null;
|
||||
}
|
||||
double heading = RealTimeData.getInstance().getHeading();
|
||||
int speed = RealTimeData.getInstance().getSpeed();
|
||||
long satelliteTime = RealTimeData.getInstance().getSatelliteTime();
|
||||
long mortonCode = MortonCode.encodeMorton(lon, lat);
|
||||
|
||||
SocketReceiveDataProto3.LocationInfoProto locationInfoProto =
|
||||
SocketReceiveDataProto3.LocationInfoProto.newBuilder()
|
||||
.setLat(lat)
|
||||
.setLon(lon)
|
||||
.setHeading(heading)
|
||||
.setSystemTime(System.currentTimeMillis())
|
||||
.setSatelliteTime(satelliteTime)
|
||||
.setAlt(0)
|
||||
.setDataAccuracy(1)
|
||||
.setSpeed(speed)
|
||||
.setMortonCode(mortonCode)
|
||||
.setSn(MoGoAiCloudClientConfig.getInstance().getSn())
|
||||
.build();
|
||||
|
||||
SocketReceiveDataProto3.MyLocationReq myLocationReq =
|
||||
SocketReceiveDataProto3.MyLocationReq.newBuilder()
|
||||
.setLastCoordinate(locationInfoProto)
|
||||
.setDataAccuracy(1)
|
||||
.setMortonCode(mortonCode)
|
||||
.setFromType(0)
|
||||
.setSn(MoGoAiCloudClientConfig.getInstance().getSn())
|
||||
.build();
|
||||
|
||||
SocketReceiveDataProto3.OnePerSecondSendReqProto self =
|
||||
SocketReceiveDataProto3.OnePerSecondSendReqProto.newBuilder()
|
||||
.setSelf(myLocationReq)
|
||||
.build();
|
||||
return SocketReceiveDataProto3.SocketReceiveDataProto.newBuilder()
|
||||
.setIPCSn(MoGoAiCloudClientConfig.getInstance().getSn() + "xavier")
|
||||
.setSn(MoGoAiCloudClientConfig.getInstance().getSn())
|
||||
.setData(self)
|
||||
.setMsgType(MSG_TYPE_UPLINK_CAR_DATA.getMsgType())
|
||||
.setSeq(System.currentTimeMillis()).build();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user