Merge branch 'dev2_aiSdk' into dev2_aiSdk_datalink

This commit is contained in:
zhongchao
2021-05-26 11:40:07 +08:00
13 changed files with 97 additions and 189 deletions

View File

@@ -940,7 +940,9 @@ public class MogoServices implements IMogoMapListener,
MogoApisHandler.getInstance().getApis().getStatusManagerApi().setVrMode( TAG, true );
MapCenterPointStrategy.resetByChangeMode();
MapMarkerManager.getInstance().redrawMarkerByStyleChanged();
AIAssist.getInstance( mContext ).speakTTSVoice( "已开启鹰眼模式" );
if (DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_LENOVO ) {
AIAssist.getInstance( mContext ).speakTTSVoice( "已开启鹰眼模式" );
}
mLastStatusIsVr = true;
}
} else {
@@ -949,7 +951,9 @@ public class MogoServices implements IMogoMapListener,
MogoApisHandler.getInstance().getApis().getStatusManagerApi().setVrMode( TAG, false );
MapCenterPointStrategy.resetByChangeMode();
MapMarkerManager.getInstance().redrawMarkerByStyleChanged();
AIAssist.getInstance( mContext ).speakTTSVoice( "已退出鹰眼模式" );
if (DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_LENOVO ) {
AIAssist.getInstance( mContext ).speakTTSVoice( "已退出鹰眼模式" );
}
}
}
}

View File

@@ -0,0 +1,37 @@
package com.mogo.module.service.network.bean;
public class MockSocketSendData {
private long systemTime;
private String uuid;
private long satelliteTime;
public MockSocketSendData(long systemTime, String uuid, long satelliteTime) {
this.systemTime = systemTime;
this.uuid = uuid;
this.satelliteTime = satelliteTime;
}
public long getSystemTime() {
return systemTime;
}
public void setSystemTime(long systemTime) {
this.systemTime = systemTime;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public long getSatelliteTime() {
return satelliteTime;
}
public void setSatelliteTime(long satelliteTime) {
this.satelliteTime = satelliteTime;
}
}

View File

@@ -10,17 +10,20 @@ import androidx.annotation.RequiresApi;
import com.mogo.cloud.socket.entity.SocketDownData;
import com.mogo.commons.data.BaseData;
import com.mogo.commons.network.SubscribeImpl;
import com.mogo.commons.network.Utils;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.uploadintime.SnapshotLocationController;
import com.mogo.module.service.MarkerServiceHandler;
import com.mogo.module.service.network.TimeDelayApiService;
import com.mogo.module.service.network.bean.MockSocketReceiverData;
import com.mogo.module.service.network.bean.MockSocketSendData;
import com.mogo.realtime.api.MoGoAiCloudRealTime;
import com.mogo.realtime.socket.IMogoCloudOnMsgListener;
import com.mogo.service.connection.IMogoOnMessageListener;
import com.mogo.utils.WorkThreadHandler;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.RequestOptions;
import com.mogo.utils.network.utils.GsonUtil;
import org.json.JSONException;
import org.json.JSONObject;
@@ -88,9 +91,7 @@ public class TimeDelayUploadManager implements IMogoOnMessageListener<MockSocket
} catch (JSONException e) {
e.printStackTrace();
}
Logger.d(TAG, "更改自车定位点");
MarkerServiceHandler.getApis().getMapServiceApi().getMapUIController().syncLocation2Map(jo);
Logger.d(TAG, "同步定位信息,用于上报");
SnapshotLocationController.getInstance().syncAdasLocationInfo(jo);
mockHandler.sendEmptyMessageDelayed(MOCK_MSG, 50);
}
@@ -144,13 +145,15 @@ public class TimeDelayUploadManager implements IMogoOnMessageListener<MockSocket
.findAny()
.orElse(null);
if (result == null) {
Logger.d(TAG,"未找到与之匹配数据");
Logger.d(TAG, "未找到与之匹配数据");
return;
}
MockSocketSendData mockSocketSendData = new MockSocketSendData(System.currentTimeMillis(), result.getUuid(), result.getSatelliteTime());
Map<String, Object> map = new HashMap<>();
map.put("systemTime", System.currentTimeMillis());
map.put("uuid", result.getUuid());
map.put("satelliteTime", result.getSatelliteTime());
map.put("sn", Utils.getSn());
map.put("data", GsonUtil.jsonFromObject(mockSocketSendData));
Logger.d(TAG, "mockSocketSendData : " + GsonUtil.jsonFromObject(mockSocketSendData));
Logger.d(TAG, "data uuid : " + result.getUuid() + " duration : " + (System.currentTimeMillis() - result.getSatelliteTime()));
timeDelayApiService.uploadDelayData(map)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())