diff --git a/app/src/androidTest/java/com/mogo/functions/test/ReminderTest.kt b/app/src/androidTest/java/com/mogo/functions/test/ReminderTest.kt index 725ffc4de2..5cc40a03cc 100644 --- a/app/src/androidTest/java/com/mogo/functions/test/ReminderTest.kt +++ b/app/src/androidTest/java/com/mogo/functions/test/ReminderTest.kt @@ -206,48 +206,48 @@ class ReminderTest { @Test fun testWarningFloatForProject() = runBlocking { - launch.onActivity { - it.lifecycleScope.launchWhenResumed { - for (i in 1..10) { - val notificationView = V2XNotificationView(it) - notificationView.setWarningIcon(EventTypeEnum.getWarningIcon("10003")) - notificationView.setWarningContent("XXXXXX${i}") - WarningFloat.with(it) - .setTag("tag") - .setLayout(notificationView) - .setSidePattern(SidePattern.RESULT_TOP) - .setCountDownTime(5000) - .setGravity(Gravity.CENTER_HORIZONTAL, offsetY = 110) - .setImmersionStatusBar(true) - .addWarningStatusListener(object : IMoGoWarningStatusListener { - override fun onShow() { - } - }) - .setAnimator(object : DefaultAnimator() { - override fun enterAnim( - view: View, - params: WindowManager.LayoutParams, - windowManager: WindowManager, - sidePattern: SidePattern - ): Animator? = - super.enterAnim(view, params, windowManager, sidePattern)?.apply { - interpolator = OvershootInterpolator() - } - - override fun exitAnim( - view: View, - params: WindowManager.LayoutParams, - windowManager: WindowManager, - sidePattern: SidePattern - ): Animator? = - super.exitAnim(view, params, windowManager, sidePattern)?.setDuration(200) - }) - .show() - delay(2000) - } - } - } - delay(TimeUnit.SECONDS.toMillis(100)) +// launch.onActivity { +// it.lifecycleScope.launchWhenResumed { +// for (i in 1..10) { +// val notificationView = V2XNotificationView(it) +// notificationView.setWarningIcon(EventTypeEnum.getWarningIcon("10003")) +// notificationView.setWarningContent("XXXXXX${i}") +// WarningFloat.with(it) +// .setTag("tag") +// .setLayout(notificationView) +// .setSidePattern(SidePattern.RESULT_TOP) +// .setCountDownTime(5000) +// .setGravity(Gravity.CENTER_HORIZONTAL, offsetY = 110) +// .setImmersionStatusBar(true) +// .addWarningStatusListener(object : IMoGoWarningStatusListener { +// override fun onShow() { +// } +// }) +// .setAnimator(object : DefaultAnimator() { +// override fun enterAnim( +// view: View, +// params: WindowManager.LayoutParams, +// windowManager: WindowManager, +// sidePattern: SidePattern +// ): Animator? = +// super.enterAnim(view, params, windowManager, sidePattern)?.apply { +// interpolator = OvershootInterpolator() +// } +// +// override fun exitAnim( +// view: View, +// params: WindowManager.LayoutParams, +// windowManager: WindowManager, +// sidePattern: SidePattern +// ): Animator? = +// super.exitAnim(view, params, windowManager, sidePattern)?.setDuration(200) +// }) +// .show() +// delay(2000) +// } +// } +// } +// delay(TimeUnit.SECONDS.toMillis(100)) } diff --git a/app/src/androidTest/java/com/mogo/functions/test/RxJavaBackPressureTest.kt b/app/src/androidTest/java/com/mogo/functions/test/RxJavaBackPressureTest.kt new file mode 100644 index 0000000000..679ebda8ab --- /dev/null +++ b/app/src/androidTest/java/com/mogo/functions/test/RxJavaBackPressureTest.kt @@ -0,0 +1,57 @@ +package com.mogo.functions.test + +import android.os.Debug +import android.util.Log +import androidx.test.core.app.ActivityScenario +import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.test.filters.LargeTest +import com.mogo.eagle.core.function.main.MainLauncherActivity +import io.reactivex.Flowable +import io.reactivex.plugins.RxJavaPlugins +import io.reactivex.schedulers.Schedulers +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.delay +import kotlinx.coroutines.runBlocking +import org.junit.Before +import org.junit.Test +import org.junit.runner.RunWith +import java.text.SimpleDateFormat +import java.util.* +import java.util.concurrent.TimeUnit +import java.util.concurrent.TimeUnit.MILLISECONDS + +@RunWith(AndroidJUnit4::class) +@LargeTest +class RxJavaBackPressureTest { + + lateinit var launch: ActivityScenario + + @Before + fun before() { + launch = ActivityScenario.launch(MainLauncherActivity::class.java) + RxJavaPlugins.setErrorHandler { + Log.e("RxJava2", it.message, it) + } + } + + @Test + fun testIntervalBackPressure() = runBlocking(Dispatchers.Default) { + val subscription = Flowable.interval(50, MILLISECONDS).doOnNext { + Log.d("RxJava2", "-- do action --") + }.subscribeOn(Schedulers.computation()).observeOn(Schedulers.io()).subscribe { + Thread.sleep(2000) + } + repeat(10) { + delay(TimeUnit.SECONDS.toMillis(5)) + try { + Debug.dumpHprofData(Date().toFileName()) + } catch (t: Throwable) { + t.printStackTrace() + } + } + delay(TimeUnit.HOURS.toMillis(1)) + subscription.dispose() + } + + private fun Date.toFileName(): String = SimpleDateFormat("yyyyMMdd_HH_mm_ss", Locale.getDefault()).format(this) + ".hprof" +} \ No newline at end of file diff --git a/config.gradle b/config.gradle index b1598fc840..35a3b7c039 100644 --- a/config.gradle +++ b/config.gradle @@ -99,8 +99,8 @@ ext { videoprocessor : "com.zhidao.video:video-processor:1.0.2.1", livesdk : "com.tencent.liteavsdk:LiteAVSDK_Smart:7.4.9211", - coroutinescore : "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.3", - coroutinesandroid : "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.3", + coroutinescore : "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2", + coroutinesandroid : "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.2", aspectj : "org.aspectj:aspectjrt:1.8.9", @@ -147,6 +147,7 @@ ext { mogomap : "com.mogo.map:mogo-map:${MOGO_MAP_VERSION}", mogomapapi : "com.mogo.map:mogo-map-api:${MOGO_MAP_API_VERSION}", mogocustommap : "com.zhidaoauto.machine:map:${MAP_SDK_VERSION}", + mogocustommapoperational : "com.zhidaoauto.map:operational:${MAP_SDK_OPERATION_VERSION}", modulecommon : "com.mogo.module:module-common:${MOGO_MODULE_COMMON_VERSION}", modulemain : "com.mogo.module:module-main:${MOGO_MODULE_MAIN_VERSION}", diff --git a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/MoGoAutopilotProvider.kt b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/MoGoAutopilotProvider.kt index bb8b0559e3..8c90db8c76 100644 --- a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/MoGoAutopilotProvider.kt +++ b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/MoGoAutopilotProvider.kt @@ -10,10 +10,12 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.constants.MoGoConfig import com.mogo.eagle.core.data.constants.MogoServicePaths import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotProvider +import com.mogo.eagle.core.function.api.map.collect.IMoGoMapDataCollectProvider import com.mogo.eagle.core.function.autopilot.adapter.MoGoAdasListenerImpl import com.mogo.eagle.core.function.autopilot.adapter.MoGoAdasMsgConnectStatusListenerImpl import com.mogo.eagle.core.function.autopilot.adapter.MoGoHandAdasMsgManager import com.mogo.eagle.core.function.autopilot.server.AsyncDataToAutopilotServer +import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager import com.mogo.eagle.core.utilcode.mogo.logger.Logger import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr import com.mogo.eagle.core.utilcode.util.GsonUtils @@ -41,7 +43,7 @@ import java.util.* */ @Route(path = MogoServicePaths.PATH_AUTO_PILOT) class MoGoAutopilotProvider : - IMoGoAutopilotProvider { + IMoGoAutopilotProvider, IMoGoMapDataCollectProvider.OnMapCollectCmdListener { private val TAG = "MoGoAutoPilotProvider" private var mContext: Context? = null @@ -53,8 +55,8 @@ class MoGoAutopilotProvider : Logger.d(TAG, "初始化工控机连接……") mContext = context // 初始化ADAS 域控制器 - //CupidLogUtils.setEnableLog(false) - //CupidLogUtils.setIsWriteLog(false) + CupidLogUtils.setEnableLog(false) + CupidLogUtils.setIsWriteLog(false) // TODO 临时方案,根据不同的身份标识,连接不同的工控机IP when (FunctionBuildConfig.appIdentityMode) { 0 -> // 司机 @@ -158,6 +160,7 @@ class MoGoAutopilotProvider : } // 同步数据给工控机的服务 AsyncDataToAutopilotServer.INSTANCE.initServer() + CallerMapDataCollectorManager.registerOnMapCollectTaskListener(this) } /** @@ -187,6 +190,16 @@ class MoGoAutopilotProvider : }, 1000, TimeUnit.MILLISECONDS) } + override fun onMapCollectStart(cmdId: Int, cmdTime: Long) { + val result = recordPackage(2, cmdId) + Logger.d(TAG, "开始记录包: [$cmdId, $result]") + } + + override fun onMapCollectEnd(cmdId: Int, cmdTime: Long) { + val result = stopRecord(2, cmdId) + Logger.d(TAG, "结束记录包: [$cmdId, $result]") + } + override fun startAutoPilot(result: AutopilotControlParameters) { if (AdasManager.getInstance().isSocketConnect) { val parameter = AutopilotControlCmdParameter("aiCloudToStartAutopilot", result) @@ -213,6 +226,18 @@ class MoGoAutopilotProvider : .recordPackage(1, (System.currentTimeMillis() / 1000).toInt()) } + override fun recordPackage(type: Int, id: Int): Boolean { + return AdasManager.getInstance().recordPackage(type, id) + } + + override fun recordPackage(type: Int, id: Int, duration: Int): Boolean { + return AdasManager.getInstance().recordPackage(type, id, duration) + } + + override fun stopRecord(type: Int, id: Int): Boolean { + return AdasManager.getInstance().stopRecord(type, id) + } + override fun setEnableLog(isEnableLog: Boolean) { CupidLogUtils.setEnableLog(isEnableLog) } @@ -222,7 +247,7 @@ class MoGoAutopilotProvider : } override fun onDestroy() { - + CallerMapDataCollectorManager.unRegisterOnMapCollectTaskListener(this) } override fun setAutoPilotSpeed(speed: Int): Boolean { diff --git a/core/function-impl/mogo-core-function-main/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java b/core/function-impl/mogo-core-function-main/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java index 5c3941ac6d..1cc069f33e 100644 --- a/core/function-impl/mogo-core-function-main/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java +++ b/core/function-impl/mogo-core-function-main/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java @@ -329,6 +329,9 @@ public abstract class MainMoGoApplication extends AbsMogoApplication { // 推送模块 MogoModulePaths.addModule(new MogoModule(PushUIConstants.PATH, "PUSH_UI")); + // 地图数据收集模块 + MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_MAP_DATA_COLLECT_PROVIDER, "MoGoMapDataCollector")); + if (!DebugConfig.isLauncher()) { PersistentManager .getInstance().initManager(this); diff --git a/core/function-impl/mogo-core-function-map/build.gradle b/core/function-impl/mogo-core-function-map/build.gradle index a7f911ad00..a3a65d41fa 100644 --- a/core/function-impl/mogo-core-function-map/build.gradle +++ b/core/function-impl/mogo-core-function-map/build.gradle @@ -50,8 +50,8 @@ dependencies { implementation rootProject.ext.dependencies.rxandroid kapt rootProject.ext.dependencies.aroutercompiler -// implementation rootProject.ext.dependencies.adasHigh - + //implementation rootProject.ext.dependencies.adasHigh + implementation rootProject.ext.dependencies.mogocustommapoperational if (Boolean.valueOf(USE_MAVEN_PACKAGE)) { implementation rootProject.ext.dependencies.mogoserviceapi implementation rootProject.ext.dependencies.modulecommon diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/collect/MoGoMapDataCollectProvider.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/collect/MoGoMapDataCollectProvider.kt new file mode 100644 index 0000000000..6d1604610a --- /dev/null +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/collect/MoGoMapDataCollectProvider.kt @@ -0,0 +1,175 @@ +package com.mogo.eagle.core.function.impl.collect + +import android.content.Context +import android.text.TextUtils +import com.alibaba.android.arouter.facade.annotation.Route +import com.mogo.cloud.passport.IMoGoTokenCallback +import com.mogo.cloud.passport.MoGoAiCloudClient +import com.mogo.cloud.passport.MoGoAiCloudClientConfig +import com.mogo.eagle.core.data.constants.MogoServicePaths +import com.mogo.eagle.core.data.map.MogoLocation +import com.mogo.eagle.core.function.api.map.collect.IMoGoMapDataCollectProvider +import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener +import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager +import com.mogo.eagle.core.utilcode.mogo.logger.Logger +import com.zhidaoauto.map.operational.MapCollectionTaskRecive +import com.zhidaoauto.map.operational.abs.OnTaskListener +import java.util.concurrent.ConcurrentHashMap +import java.util.concurrent.CopyOnWriteArrayList +import java.util.concurrent.atomic.AtomicReference + +@Route(path = MogoServicePaths.PATH_MAP_DATA_COLLECT_PROVIDER) +class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener, IMoGoMapLocationListener, IMoGoTokenCallback { + + companion object { + const val TAG = "MoGoMapDataCollect" + } + + private val executor by lazy { + AtomicReference(null) + } + + private val listeners by lazy { + CopyOnWriteArrayList() + } + + private val map: MutableMap by lazy { + ConcurrentHashMap() + } + + override val functionName: String = TAG + + override fun init(context: Context?) { + CallerMapLocationListenerManager.addListener(functionName, this) + executor.set(context?.let { MapCollectionTaskRecive(it) }) + executor.get()?.setOnTaskListener(this) + val carSn = MoGoAiCloudClientConfig.getInstance().sn + if (!TextUtils.isEmpty(carSn)) { + executor.get()?.setCarSn(carSn) + } + MoGoAiCloudClient.getInstance().addTokenCallbacks(this) + Logger.d(TAG, "--------- init --------") + Logger.d(TAG, "executor: ${ executor.get()?.hashCode() ?: 0 }") + } + + override fun onDestroy() { + CallerMapLocationListenerManager.removeListener(TAG) + Logger.d(TAG, "--------- onDestroy --------") + executor.get()?.let { + it.setOnTaskListener(null) + it.destory() + } + listeners.clear() + map.clear() + } + + override fun registerOnMapCollectTaskListener(listener: IMoGoMapDataCollectProvider.OnMapCollectCmdListener?) { + Logger.d(TAG, "--------- registerOnMapCollectTaskListener --------") + listener ?: return + if (listeners.contains(listener)) { + return + } + listeners += listener + } + + override fun unRegisterOnMapCollectTaskListener(listener: IMoGoMapDataCollectProvider.OnMapCollectCmdListener?) { + Logger.d(TAG, "--------- unRegisterOnMapCollectTaskListener --------") + listener ?: return + if (!listeners.contains(listener)) { + return + } + listeners.remove(listener) + } + + override fun finish( + id: Int, + state: Int, + gpsPath: String, + videoPath: String, + reason: String + ) { + Logger.d(TAG, "-- finish:[$id, $state, $gpsPath, $videoPath, $reason]") + try { + if (isInValidStatus()) { + Logger.w(TAG, "-- finish: 状态无效") + return + } + if (!map.containsKey(id)) { + Logger.w(TAG, "-- finish: 无相关指令") + return + } + Logger.d(TAG, "-- finish: 结束任务[$id]") + executor.get()?.finishTask(id, state, gpsPath, videoPath, reason) + } catch (e : Throwable) { + e.printStackTrace() + Logger.e(TAG, "-- finish:\n$e"); + } finally { + map[id] = Status.FINISH + } + } + + override fun onTaskFinish(id: Int, time: Long) { + Logger.d(TAG, "地图模块下发结束采集指令 -> [$id, $time]") + if (!map.containsKey(id) || map[id] == Status.FINISH) { + Logger.w(TAG, "地图模块下发结束采集指令 -> 任务[$id]已经提前完成,无需再次请求自动驾驶模块结束采集") + return + } + Logger.d(TAG, "地图模块下发结束采集指令 -> [$id, $time] -> 调用自动驾驶模块,结束数据采集") + listeners.forEach { + it.onMapCollectEnd(id, time) + } + } + + override fun onTaskStart(id: Int, time: Long) { + Logger.d(TAG, "地图模块下发开始采集指令 -> [$id, $time]") + map[id] = Status.INIT + listeners.forEach { + it.onMapCollectStart(id, time) + } + map[id] = Status.START + } + + + override fun onLocationChanged(location: MogoLocation?) { + location ?: return + executor.get()?.onMapChange( + location.longitude, + location.latitude, + location.bearing, + location.speed, + location.provider == "GPS_SELF") + } + + + private fun isInValidStatus(): Boolean { + if (map.isEmpty()) { + return true + } + val iterator = map.iterator() + while (iterator.hasNext()) { + val next = iterator.next() + if (next.value == Status.FINISH) { + iterator.remove() + } + } + if (map.filter { it.value == Status.START }.isEmpty()) { + return true + } + return false + } + + override fun onTokenGot(token: String?, sn: String?) { + Logger.d(TAG, "-- onTokenGot --> $sn") + sn?.let { + executor.get()?.setCarSn(it) + } + } + + override fun onError(code: Int, msg: String?) = Unit + + private sealed class Status { + object INIT : Status() //初始状态 + object START : Status() //开始状态 + object FINISH : Status() //完成状态 + } +} \ No newline at end of file diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/FunctionBuildConfig.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/FunctionBuildConfig.kt index 3c9f81e04c..479edcb282 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/FunctionBuildConfig.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/FunctionBuildConfig.kt @@ -57,5 +57,5 @@ object FunctionBuildConfig { * false - 不忽略 */ @JvmField - var isIgnoreConditionsDrawAutopilotTrajectoryData = true + var isIgnoreConditionsDrawAutopilotTrajectoryData = false } \ No newline at end of file diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/MogoServicePaths.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/MogoServicePaths.java index aee937489f..9e910c1789 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/MogoServicePaths.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/MogoServicePaths.java @@ -268,4 +268,10 @@ public class MogoServicePaths { @Keep @Deprecated public static final String PATH_DEVA_TOOLS = "/deva/tools"; + + /** + * 地图数据更新输助类 + */ + @Keep + public static final String PATH_MAP_DATA_COLLECT_PROVIDER = "/map_x/collect"; } diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotProvider.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotProvider.kt index 34f2103554..b3d0d87a23 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotProvider.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotProvider.kt @@ -41,6 +41,33 @@ interface IMoGoAutopilotProvider : IMoGoFunctionServerProvider { */ fun recordPackage(): Boolean + /** + * 开启域控制器录制bag包 + * + * @return true-成功,false-失败 + * @param type 录制类型 1: badcase 2:map 3:rests + * @param id 指令/任务 ID + */ + fun recordPackage(type: Int, id: Int): Boolean + + /** + * 开启域控制器录制bag包 + * + * @return true-成功,false-失败 + * @param type 录制类型 1: badcase 2:map 3:rests + * @param id 指令/任务 ID + * @param duration 录制时长 + */ + fun recordPackage(type: Int, id: Int, duration: Int): Boolean + + /** + * 结束录制 + * @param type 录制类型 1: badcase 2:map 3:rests + * @param id 指令/任务 ID + * @return true: 成功; false 失败 + */ + fun stopRecord(type: Int, id: Int): Boolean + /** * Log 是否显示 * diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/collect/IMoGoMapDataCollectProvider.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/collect/IMoGoMapDataCollectProvider.kt new file mode 100644 index 0000000000..8172294b0c --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/collect/IMoGoMapDataCollectProvider.kt @@ -0,0 +1,43 @@ +package com.mogo.eagle.core.function.api.map.collect + +import com.mogo.eagle.core.function.api.base.IMoGoFunctionServerProvider + +/** + * @author renwj + * @date 2021/11/10 10:00 上午 + * 此类主要用来同步自动驾驶定位信息给各业务方 + */ +interface IMoGoMapDataCollectProvider: IMoGoFunctionServerProvider { + + /** + * 注册地图组下发收集数据任务指令监听,通知自动驾驶模块开始数据采集 + */ + fun registerOnMapCollectTaskListener(listener: OnMapCollectCmdListener?) + + /** + * 移除任务指令监听 + */ + fun unRegisterOnMapCollectTaskListener(listener: OnMapCollectCmdListener?) + + /** + * 此接口是自动驾驶模块使用,用于把自动驾驶模块收集的数据给地图组 + */ + fun finish(id: Int, state: Int, gpsPath: String, videoPath: String, reason: String) + + interface OnMapCollectCmdListener { + + /** + * 地图组下发地图数据收集开始指令 + * @param cmdId 指令ID + * @param cmdTime 指令下发时间 + */ + fun onMapCollectStart(cmdId: Int, cmdTime: Long) + + /** + * 地图组下发地图数据收集结束指令 + * @param cmdId 指令ID + * @param cmdTime 指令下发时间 + */ + fun onMapCollectEnd(cmdId: Int, cmdTime: Long) + } +} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotManager.kt index 0279c39f2f..901c127c52 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotManager.kt @@ -1,9 +1,12 @@ package com.mogo.eagle.core.function.call.autopilot +import android.os.SystemClock import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters import com.mogo.eagle.core.data.constants.MogoServicePaths import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotProvider import com.mogo.eagle.core.function.call.base.CallerBase +import com.mogo.eagle.core.utilcode.util.LogUtils +import kotlin.random.Random /** *@author xiaoyuzhou @@ -60,7 +63,15 @@ object CallerAutoPilotManager { * 开启域控制器录制bag包 */ fun recordPackage() { - providerApi?.recordPackage() + providerApi?.recordPackage(1, Random(SystemClock.elapsedRealtime()).nextInt()) + } + + fun recordPackage(type: Int, id: Int) { + providerApi?.recordPackage(type, id) + } + + fun recordPackage(type: Int, id: Int, duration: Int) { + providerApi?.recordPackage(type, id, duration) } fun setEnableLog(isEnableLog: Boolean) { diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapDataCollectorManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapDataCollectorManager.kt new file mode 100644 index 0000000000..86cb4dc777 --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapDataCollectorManager.kt @@ -0,0 +1,29 @@ +package com.mogo.eagle.core.function.call.map + +import com.mogo.eagle.core.data.constants.MogoServicePaths.PATH_MAP_DATA_COLLECT_PROVIDER +import com.mogo.eagle.core.function.api.map.collect.IMoGoMapDataCollectProvider +import com.mogo.eagle.core.function.call.base.CallerBase + +/** + * @author renwj + * @date 2021/11/10 10:30 上午 + * 此类主要提供给各业务方使用,便于业务层管理数据收集 + */ +object CallerMapDataCollectorManager { + + private val provider: IMoGoMapDataCollectProvider? by lazy { + CallerBase.getApiInstance(IMoGoMapDataCollectProvider::class.java, PATH_MAP_DATA_COLLECT_PROVIDER) + } + + fun registerOnMapCollectTaskListener(listener: IMoGoMapDataCollectProvider.OnMapCollectCmdListener?) { + provider?.registerOnMapCollectTaskListener(listener) + } + + fun unRegisterOnMapCollectTaskListener(listener: IMoGoMapDataCollectProvider.OnMapCollectCmdListener?) { + provider?.unRegisterOnMapCollectTaskListener(listener) + } + + fun finish(id: Int, state: Int, gpsPath: String, videoPath: String, reason: String) { + provider?.finish(id, state, gpsPath, videoPath, reason) + } +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index bf9b52b3af..4449d78212 100644 --- a/gradle.properties +++ b/gradle.properties @@ -82,7 +82,8 @@ MOGO_LOCATION_VERSION=1.3.19-beta MOGO_TELEMATIC_VERSION=1.3.19-beta ######## MogoAiCloudSDK Version ######## # 自研地图 -MAP_SDK_VERSION=2.0.0.24 +MAP_SDK_VERSION=2.0.1 +MAP_SDK_OPERATION_VERSION=1.0.11 # websocket WEBSOCKET_VERSION=1.1.7 ## 产品库必备配置,产品库自动对versionCode和versionName版本进行升级 diff --git a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java index 246a295648..ba15a9157a 100644 --- a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java +++ b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java @@ -130,6 +130,10 @@ public class AMapViewWrapper implements IMogoMapView, if (options != null) { //设置手势是否可以缩放 isCanZoom true 可缩放 false 不可缩放 options.setZoomGesturesEnabled(true); + options.setScaleVRMode(true); + if (options.getMyLocationStyle() != null) { + options.getMyLocationStyle().setDisplayAnimEnable(false); + } // 设置自车的图片对象 //options.setMyLocationStyle(options.getMyLocationStyle().myLocationIcon(DEFAULT_OPTION.getCarCursorRes())); } @@ -335,24 +339,6 @@ public class AMapViewWrapper implements IMogoMapView, moveToCenter(latLng, true); } - private void setUIMode(EnumMapUI ui) { - this.mCurrentCarUIMode = ui; - if (mMapView.getMapAutoViewHelper() != null) { - switch (ui) { - case CarUp_2D: - case CarUp_3D: - mMapView.getMapAutoViewHelper().setMapViewPerspective(MapAutoApi.MAP_PERSPECTIVE_UP_CAR); - break; - case NorthUP_2D: - if (mCurrentUI == EnumMapUI.Type_VR) { - return; - } - mMapView.getMapAutoViewHelper().setMapViewPerspective(MapAutoApi.MAP_PERSPECTIVE_UP_NORTH); - break; - } - } - } - private boolean checkAMapView() { if (mMapView == null || mMapView.getMapAutoViewHelper() == null) { Logger.e(TAG, "自研mapView实例为空,请检查"); diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/MockIntentHandler.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/MockIntentHandler.java index 26ba340c36..b4dffd4d1e 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/MockIntentHandler.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/MockIntentHandler.java @@ -15,7 +15,6 @@ import com.mogo.commons.AbsMogoApplication; import com.mogo.commons.debug.DebugConfig; import com.mogo.commons.voice.AIAssist; import com.mogo.eagle.core.data.autopilot.AutopilotCarStateInfo; -import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters; import com.mogo.eagle.core.data.config.FunctionBuildConfig; import com.mogo.eagle.core.data.map.MogoLatLng; import com.mogo.eagle.core.data.traffic.TrafficData; @@ -28,8 +27,6 @@ import com.mogo.eagle.core.utilcode.util.ThreadUtils; import com.mogo.eagle.core.utilcode.util.ToastUtils; import com.mogo.map.marker.IMogoMarker; import com.mogo.map.marker.MogoMarkerOptions; -import com.mogo.map.navi.IMogoNaviListener; -import com.mogo.map.navi.MogoNaviInfo; import com.mogo.map.search.geo.IMogoGeoSearch; import com.mogo.map.search.geo.IMogoGeoSearchListener; import com.mogo.map.search.geo.MogoGeocodeResult;