分离Record回调监听管理。
以后这种监听没有特定关系的均需要单独管理

Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
donghongyu
2022-04-06 19:32:18 +08:00
parent e1508a3f0f
commit 2b4b2f2119
13 changed files with 127 additions and 74 deletions

View File

@@ -26,7 +26,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager.invokeAutopilotCarConfigData
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarStatusListenerManager.invokeAutopilotCarStateData
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager.invokeAutopilotIdentifyDataUpdate
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager.invokeAutopilotRecordResult
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager.invokeAutopilotRecordResult
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager.invokeAutopilotWarnMessage
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager.invokeAutopilotRotting
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager.invokeAutopilotTrajectory

View File

@@ -130,10 +130,6 @@ public class MoGoHandAdasMsgManager implements
}
@Override
public void onAutopilotRecordResult(RecordPanelOuterClass.RecordPanel recordPanel) {
}
@Override
public void onAutopilotCarConfig(@NotNull MessagePad.CarConfigResp carConfigResp) {

View File

@@ -8,11 +8,14 @@ import android.view.WindowManager
import android.widget.TextView
import androidx.fragment.app.FragmentActivity
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
import com.mogo.eagle.core.utilcode.kotlin.*
import com.mogo.eagle.core.utilcode.kotlin.PX
import com.mogo.eagle.core.utilcode.kotlin.onDetach
import com.mogo.eagle.core.utilcode.kotlin.safeCancel
import com.mogo.eagle.core.utilcode.kotlin.scope
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
@@ -31,7 +34,6 @@ import com.zhjt.mogo_core_function_devatools.feedback.callback.IFeedbackCallback
import kotlinx.coroutines.*
import record_cache.RecordPanelOuterClass
import java.io.File
import java.lang.IllegalStateException
import java.text.SimpleDateFormat
import java.util.*
import kotlin.Result.Companion
@@ -77,7 +79,7 @@ internal object FeedbackManager {
record.scope.launch {
val taskId = presenter.getBadCaseTaskId()
val listener = object : IMoGoAutopilotIdentifyListener {
val listener = object : IMoGoAutopilotRecordListener {
override fun onAutopilotRecordResult(recordPanel: RecordPanelOuterClass.RecordPanel) {
super.onAutopilotRecordResult(recordPanel)
record.scope.launch {
@@ -109,9 +111,9 @@ internal object FeedbackManager {
}
}
}
CallerAutopilotIdentifyListenerManager.addListener("Feedback", listener)
CallerAutopilotRecordListenerManager.addListener("Feedback", listener)
record.onDetach {
CallerAutopilotIdentifyListenerManager.removeListener("Feedback")
CallerAutopilotRecordListenerManager.removeListener("Feedback")
hideFloat = null
}
record.text = "结束录制"

View File

@@ -20,14 +20,14 @@ import com.mogo.eagle.core.data.enums.SidePattern
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
import com.mogo.eagle.core.data.notice.NoticeNormalData
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
import com.mogo.eagle.core.function.api.hmi.IMoGoHmiViewProxy
import com.mogo.eagle.core.function.api.hmi.view.IViewLimitingVelocity
import com.mogo.eagle.core.function.api.hmi.view.IViewNotification
import com.mogo.eagle.core.function.api.hmi.view.IViewTrafficLight
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWaringProvider
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
import com.mogo.eagle.core.function.call.check.CallerCheckManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager
@@ -64,7 +64,7 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
IMoGoWaringProvider,
IMoGoHmiViewProxy,
MoGoWarningContract.View,
IMoGoAutopilotIdentifyListener {
IMoGoAutopilotRecordListener {
private val TAG = "MoGoHmiFragment"
// DebugSettingView
@@ -136,7 +136,7 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
@OptIn(ExperimentalCoroutinesApi::class)
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
CallerAutopilotRecordListenerManager.addListener(TAG, this)
/*// TODO 这里后面需要改成独立进程通讯后台获取YUV
view.postDelayed({
@@ -167,7 +167,7 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
override fun onDestroyView() {
super.onDestroyView()
CallerAutopilotIdentifyListenerManager.removeListener(TAG)
CallerAutopilotRecordListenerManager.removeListener(TAG)
}

View File

@@ -6,40 +6,38 @@ import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.eagle.core.data.constants.MogoServicePaths;
import com.mogo.eagle.core.function.api.map.IMogoMapFrameController;
public
/**
* @author congtaowang
* @since 2020/10/23
*
* 描述
* <p>
* 地图控制交互层
*/
@Route( path = MogoServicePaths.PATH_MAP_FRAME_CONTROLLER )
class MapFrameController implements IMogoMapFrameController {
@Route(path = MogoServicePaths.PATH_MAP_FRAME_CONTROLLER)
public class MapFrameController implements IMogoMapFrameController {
private IMogoMapFrameController mController;
@Override
public void initDelegate( IMogoMapFrameController controller ) {
public void initDelegate(IMogoMapFrameController controller) {
mController = controller;
}
@Override
public void changeTo2dMode() {
if ( mController != null ) {
if (mController != null) {
mController.changeTo2dMode();
}
}
@Override
public void changeToVRMode() {
if ( mController != null ) {
if (mController != null) {
mController.changeToVRMode();
}
}
@Override
public void init( Context context ) {
public void init(Context context) {
}