[2.13.2] wait to test

This commit is contained in:
zhongchao
2023-01-10 10:17:35 +08:00
parent cce9bde6c7
commit 775ec4be60
6 changed files with 132 additions and 42 deletions

View File

@@ -56,8 +56,8 @@ class SceneManager {
sceneModuleTAG.map[DEVA] = SceneModule(false, M_DEVA)
sceneModuleTAG.map[HMI] = SceneModule(false, M_HMI)
sceneModuleTAG.map[OBU] = SceneModule(false, M_OBU)
sceneModuleTAG.map[V2X] = SceneModule(false, M_V2X)
sceneModuleTAG.map[MAP] = SceneModule(false, M_MAP)
sceneModuleTAG.map[V2X] = SceneModule(true, M_V2X)
sceneModuleTAG.map[MAP] = SceneModule(true, M_MAP)
sceneModuleTAG.map[ROUTE] = SceneModule(true, M_OLD_ROUTE)
sceneModuleTAG.map[NET] = SceneModule(true, M_NETWORK)
sceneModuleTAG.map[BUS] = SceneModule(true, M_BUS)

View File

@@ -1,38 +0,0 @@
package com.mogo.eagle.core.function.business.ai
import android.content.Context
import com.mogo.cloud.socket.entity.SocketDownData
import com.mogo.commons.debug.DebugConfig
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.realtime.api.MoGoAiCloudRealTime
import com.mogo.realtime.socket.IMogoCloudOnMsgListener
class AiCloudIdentifyData{
companion object{
private const val TAG = "AiCloudIdentifyData"
@JvmStatic
val aiCloudIdentifyData by lazy(LazyThreadSafetyMode.SYNCHRONIZED){
AiCloudIdentifyData()
}
}
fun init(mContext:Context){
//todo emArrow
MoGoAiCloudRealTime.startRealTime(mContext, DebugConfig.getSocketAppId())
MoGoAiCloudRealTime.registerOnMsgListener(object :IMogoCloudOnMsgListener {
override fun onMsgSend(id: Long) {
}
override fun onMsgReceived(mogoSnapshotSetData: SocketDownData.LauncherSnapshotProto?) {
mogoSnapshotSetData?.let {
CallerLogger.d(TAG,"mogoSnapshotSetData : $mogoSnapshotSetData")
}
}
})
}
}

View File

@@ -0,0 +1,54 @@
package com.mogo.eagle.core.function.business.ai
import android.content.Context
import com.mogo.cloud.socket.entity.SocketDownData
import com.mogo.eagle.core.function.business.ai.net.AiCloudIdentifyNetWorkModel
import com.mogo.eagle.core.function.business.identify.MapIdentifySubscriber
import com.mogo.eagle.core.function.call.map.CallerMapIdentifyManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAP
import com.mogo.realtime.api.MoGoAiCloudRealTime
import com.mogo.realtime.socket.IMogoCloudOnMsgListener
class AiCloudIdentifyDataManager {
companion object {
private const val TAG = "AiCloudIdentifyData"
@JvmStatic
val aiCloudIdentifyDataManager by lazy(LazyThreadSafetyMode.SYNCHRONIZED) {
AiCloudIdentifyDataManager()
}
const val START_METRE = 140
const val END_METRE = 2000
}
private val aiCloudIdentifyNetWorkModel = AiCloudIdentifyNetWorkModel()
fun init(mContext: Context) {
MoGoAiCloudRealTime.registerOnMsgListener(object : IMogoCloudOnMsgListener {
override fun onMsgSend(id: Long) {
}
override fun onMsgReceived(mogoSnapshotSetData: SocketDownData.LauncherSnapshotProto?) {
mogoSnapshotSetData?.let {
CallerLogger.d(TAG, "mogoSnapshotSetData : $it")
//todo 感知数据转换
// MapIdentifySubscriber.instance.onAutopilotIdentifyDataUpdate()
}
}
})
changeRangeOfIdentify()
}
//todo 加调试广播
private fun changeRangeOfIdentify() {
aiCloudIdentifyNetWorkModel.requestIdentifyRange({
CallerLogger.d(M_MAP + TAG, "requestIdentifyRange ok")
}, {
CallerLogger.d(M_MAP + TAG, "requestIdentifyRange error : $it")
})
}
}

View File

@@ -0,0 +1,63 @@
package com.mogo.eagle.core.function.business.ai.net
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.commons.debug.DebugConfig
import com.mogo.eagle.core.data.BaseResponse
import com.mogo.eagle.core.function.business.ai.AiCloudIdentifyDataManager.Companion.END_METRE
import com.mogo.eagle.core.function.business.ai.AiCloudIdentifyDataManager.Companion.START_METRE
import com.mogo.eagle.core.network.MoGoRetrofitFactory
import com.mogo.eagle.core.network.apiCall
import com.mogo.eagle.core.network.request
import com.zhjt.service_biz.FuncConfig
class AiCloudIdentifyNetWorkModel {
companion object {
val aiCloudIdentifyNetWorkModel by lazy(LazyThreadSafetyMode.SYNCHRONIZED) {
AiCloudIdentifyNetWorkModel()
}
}
private fun getHost(): String {
var host = "https://dzt-city.zhidaozhixing.com"
when (DebugConfig.getNetMode()) {
DebugConfig.NET_MODE_DEV,
DebugConfig.NET_MODE_QA -> host = "https://dzt-qa-city.zhidaozhixing.com"
}
return host
}
private fun getNetWorkApi(baseUrl: String = getHost()): IAiCloudIdentifyApiService {
return MoGoRetrofitFactory.getInstanceNoCallAdapter(baseUrl)
.create(IAiCloudIdentifyApiService::class.java)
}
fun requestIdentifyRange(
onSuccess: (() -> Unit),
onError: ((String) -> Unit)
) {
request<BaseResponse<Any>> {
val map = mutableMapOf<String, Any>()
start {
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
map["status"] = true
map["startMetre"] = START_METRE
map["endMetre"] = END_METRE
map["type"] = 1
}
loader {
apiCall {
getNetWorkApi().identifyRange(map)
}
}
onSuccess {
onSuccess.invoke()
}
onError {
it.message?.let { errorMsg ->
onError.invoke(errorMsg)
}
}
}
}
}

View File

@@ -0,0 +1,11 @@
package com.mogo.eagle.core.function.business.ai.net
import com.mogo.eagle.core.data.BaseResponse
import retrofit2.http.Body
import retrofit2.http.POST
interface IAiCloudIdentifyApiService {
@POST("yycp-c-v2x-service/dataFusion/remoteDrivingSet")
suspend fun identifyRange(@Body map: MutableMap<String, Any>): BaseResponse<Any>
}

View File

@@ -16,7 +16,7 @@ import com.mogo.eagle.core.data.map.CenterLine;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener;
import com.mogo.eagle.core.function.api.map.hd.IMoGoMapFragmentProvider;
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener;
import com.mogo.eagle.core.function.business.ai.AiCloudIdentifyData;
import com.mogo.eagle.core.function.business.ai.AiCloudIdentifyDataManager;
import com.mogo.eagle.core.function.business.identify.MapIdentifySubscriber;
import com.mogo.eagle.core.function.business.MapPointCloudSubscriber;
import com.mogo.eagle.core.function.business.routeoverlay.MogoRouteOverlayManager;
@@ -193,7 +193,7 @@ public class MapFragment extends MvpFragment<MapView, MapPresenter>
MapIdentifySubscriber.Companion.getInstance();
MogoRouteOverlayManager.getInstance().init();
MapPointCloudSubscriber.Companion.getInstance();
AiCloudIdentifyData.Companion.getAiCloudIdentifyData().init(AbsMogoApplication.getApp());
AiCloudIdentifyDataManager.Companion.getAiCloudIdentifyDataManager().init(AbsMogoApplication.getApp());
}
private void queryInfStructure() {