[2.13.2] wait to test
This commit is contained in:
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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")
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
}
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user