diff --git a/OCH/common/biz/src/main/java/com/mogo/och/biz/routing/ui/runing/taxi/TaxiRunningView.kt b/OCH/common/biz/src/main/java/com/mogo/och/biz/routing/ui/runing/taxi/TaxiRunningView.kt index e65cc022eb..0706909876 100644 --- a/OCH/common/biz/src/main/java/com/mogo/och/biz/routing/ui/runing/taxi/TaxiRunningView.kt +++ b/OCH/common/biz/src/main/java/com/mogo/och/biz/routing/ui/runing/taxi/TaxiRunningView.kt @@ -26,6 +26,8 @@ import com.mogo.och.biz.routing.ui.RoutingSwitchModel import com.mogo.och.common.module.map.MapMakerManager import com.mogo.och.common.module.wigets.dialog.CommonDialogStatus import com.mogo.och.biz.routing.ui.errorpoint.ReportErrorPointView +import com.mogo.och.biz.routing.ui.runing.other.TaskRunningView +import com.mogo.och.biz.routing.ui.runing.other.TaskRunningView.Companion import com.mogo.och.biz.routing.ui.utils.TimeDistanceUtils import com.mogo.och.common.module.constant.OchCommonConst import kotlinx.android.synthetic.main.biz_taxi_running.view.actv_end_routing @@ -85,9 +87,11 @@ class TaxiRunningView: ConstraintLayout, TaxiRunningModel.RoutingRuningCallback, } private fun showFeedbackDialog(grayId: Long) { + CallerLogger.d(TAG, "showFeedbackDialog!") val occurrenceTime = System.currentTimeMillis() val topActivity = ActivityUtils.getTopActivity() if(closeRouting==null) { + CallerLogger.d(TAG, "closeRouting is null!") closeRouting = CommonDialogStatus .Builder() .title("路线验证结束") @@ -100,6 +104,7 @@ class TaxiRunningView: ConstraintLayout, TaxiRunningModel.RoutingRuningCallback, .build(topActivity) }else{ if(closeRouting?.isShowing==true){ + CallerLogger.d(TAG, "closeRouting is showing, return!") return } } diff --git a/OCH/taxi/unmanned-passenger/src/main/java/com/mogo/och/unmanned/passenger/ui/homepage/HomeView.kt b/OCH/taxi/unmanned-passenger/src/main/java/com/mogo/och/unmanned/passenger/ui/homepage/HomeView.kt index 041376229b..044d796dd1 100644 --- a/OCH/taxi/unmanned-passenger/src/main/java/com/mogo/och/unmanned/passenger/ui/homepage/HomeView.kt +++ b/OCH/taxi/unmanned-passenger/src/main/java/com/mogo/och/unmanned/passenger/ui/homepage/HomeView.kt @@ -7,13 +7,18 @@ import android.content.Context import android.os.Bundle import android.util.AttributeSet import android.view.LayoutInflater +import android.view.View import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.Guideline import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.findViewTreeViewModelStoreOwner import com.mogo.eagle.core.data.map.MogoLatLng +import com.mogo.eagle.core.data.multidisplay.TelematicConstant +import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener +import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager import com.mogo.eagle.core.utilcode.kotlin.onClick import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger +import com.mogo.eagle.core.utilcode.util.UiThreadHandler import com.mogo.och.bridge.autopilot.location.OchLocationManager import com.mogo.och.unmanned.passenger.ui.bar.LeftBarView import com.mogo.och.unmanned.taxi.passenger.R @@ -22,15 +27,14 @@ import kotlinx.android.synthetic.main.taxi_p_home.view.acbtn_show_hdmap import kotlinx.android.synthetic.main.taxi_p_home.view.hdMapView import kotlinx.android.synthetic.main.taxi_p_home.view.lbv_go2_center import kotlinx.android.synthetic.main.taxi_p_home.view.leftEndGuideline -import kotlinx.android.synthetic.main.taxi_p_home.view.midContainer -import kotlinx.android.synthetic.main.taxi_p_home.view.midStartGuideline -import kotlinx.android.synthetic.main.taxi_p_home.view.preContainer +import kotlinx.android.synthetic.main.taxi_p_home.view.rightContainer class HomeView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 -) : ConstraintLayout(context, attrs, defStyleAttr), HomeViewModel.HomeCallback { +) : ConstraintLayout(context, attrs, defStyleAttr), HomeViewModel.HomeCallback, + IReceivedMsgListener { private var isAMapShow = true @@ -40,8 +44,7 @@ class HomeView @JvmOverloads constructor( private var TAG = "HomeView" - private var viewModel: HomeViewModel?=null - + private var viewModel: HomeViewModel? = null private fun initView() { @@ -51,7 +54,7 @@ class HomeView @JvmOverloads constructor( } private fun initlistener() { - lbv_go2_center.setOrderIdCallback(object : LeftBarView.LeftBarCallback{ + lbv_go2_center.setOrderIdCallback(object : LeftBarView.LeftBarCallback { override fun setGo2CenterClick() { //切换到地图中间 hdMapView.getUI()?.let { @@ -64,10 +67,10 @@ class HomeView @JvmOverloads constructor( }) acbtn_show_hdmap.onClick { - showHdMap() + updateViewState(false) } acbtn_show_all.onClick { - showAmapAndHdMap() + updateViewState(true) } } @@ -75,50 +78,50 @@ class HomeView @JvmOverloads constructor( /** * 展示两屏幕 */ - fun showHdMap(){ - updateViewState(true,false,false) + fun showHdMap() { +// updateViewState(true,false,false) } /** * 展示3屏 */ - fun showAmapAndHdMap(){ - updateViewState(true,true,false) + fun showAmapAndHdMap() { +// updateViewState(true,true,false) } fun onCreate(savedInstanceState: Bundle?) { hdMapView.onCreate(savedInstanceState) - preContainer.onCreate(savedInstanceState) +// preContainer.onCreate(savedInstanceState) // decContainer.onCreate(savedInstanceState) } fun onSaveInstanceState(outState: Bundle) { hdMapView.onSaveInstanceState(outState) - preContainer.onSaveInstanceState(outState) +// preContainer.onSaveInstanceState(outState) // decContainer.onSaveInstanceState(outState) } fun onResume() { hdMapView.onResume() - preContainer.onResume() +// preContainer.onResume() // decContainer.onResume() } fun onLowMemory() { hdMapView.onLowMemory() - preContainer.onLowMemory() +// preContainer.onLowMemory() // decContainer.onLowMemory() } fun onPause() { hdMapView.onPause() - preContainer.onPause() +// preContainer.onPause() // decContainer.onPause() } fun onDestroy() { hdMapView.onDestroy() - preContainer.onDestroy() +// preContainer.onDestroy() // decContainer.onDestroy() } @@ -128,70 +131,30 @@ class HomeView @JvmOverloads constructor( ViewModelProvider(it).get(HomeViewModel::class.java) } viewModel?.setViewCallback(this) + CallerTelematicListenerManager.addListener(TAG, this) } + override fun onDetachedFromWindow() { + super.onDetachedFromWindow() + CallerTelematicListenerManager.removeListener(TAG) + } private fun updateViewState( - showHDMapView: Boolean, - showAMapView: Boolean, - animate: Boolean = true + showMogoMind: Boolean, + animate: Boolean = false ) { - // 展示预测地图和高精地图 - if (showHDMapView && showAMapView) { - CallerLogger.d(TAG,"展示高德地图和高精地图${showHDMapView}_$showAMapView") - midStartGuideline.setGuidelinePercent(0.333f) - if (animate) { - animateGuidelinePercent( - leftEndGuideline, - 0.333f, - 1000 - ) { - lbv_go2_center.visibility = GONE - midContainer.visibility = VISIBLE - } - } else { - leftEndGuideline.setGuidelinePercent(0.333f) - lbv_go2_center.visibility = GONE - midContainer.visibility = VISIBLE - } - } - // 不展示预测 展示高精 - if (showHDMapView && !showAMapView) { - CallerLogger.d(TAG,"展示高德 不展示高精${showHDMapView}_$showAMapView") - if (animate) { - animateGuidelinePercent( - leftEndGuideline, - 0.666f, - 1000, - end = { - lbv_go2_center.visibility = VISIBLE - midContainer.visibility = GONE - } - ) - } else { - leftEndGuideline.setGuidelinePercent(0.666f) - lbv_go2_center.visibility = VISIBLE - midContainer.visibility = GONE - } - } - // 不展示高精 展示高德 - if (!showHDMapView && showAMapView) { - CallerLogger.d(TAG,"展示高精 不展示高德${showHDMapView}_$showAMapView") - if (animate) { - midStartGuideline.setGuidelinePercent(0.0f) - animateGuidelinePercent( - leftEndGuideline, - 0.0f, - 1000 - ) { - lbv_go2_center.visibility = GONE - } - } - else { - leftEndGuideline.setGuidelinePercent(0.0f) - midStartGuideline.setGuidelinePercent(0.0f) - lbv_go2_center.visibility = GONE + CallerLogger.d(TAG, "展示MogoMind${showMogoMind}") + if (animate) { + animateGuidelinePercent( + leftEndGuideline, + if (showMogoMind) 0.666f else 1f, + 1000 + ) { + rightContainer.visibility = if (showMogoMind) View.VISIBLE else View.GONE } + } else { + leftEndGuideline.setGuidelinePercent(if (showMogoMind) 0.666f else 1f) + rightContainer.visibility = if (showMogoMind) View.VISIBLE else View.GONE } } @@ -256,4 +219,14 @@ class HomeView @JvmOverloads constructor( showAmapAndHdMap() } + override fun onReceivedMsg(type: Int, byteArray: ByteArray) { + if (type == TelematicConstant.CONTROL_PASSENGER_AI_SWITCH) { + UiThreadHandler.post { + when (String(byteArray)) { + "0" -> updateViewState(false) + else -> updateViewState(true) + } + } + } + } } \ No newline at end of file diff --git a/OCH/taxi/unmanned-passenger/src/main/res/layout/taxi_p_home.xml b/OCH/taxi/unmanned-passenger/src/main/res/layout/taxi_p_home.xml index ca7b9f7dd7..74e325ec9e 100644 --- a/OCH/taxi/unmanned-passenger/src/main/res/layout/taxi_p_home.xml +++ b/OCH/taxi/unmanned-passenger/src/main/res/layout/taxi_p_home.xml @@ -22,37 +22,37 @@ app:layout_constraintGuide_percent="0.333" /> - + + + + + + + + + + + - + + + + + + + + - + + + + + + + + - + + app:layout_constraintStart_toEndOf="@id/leftEndGuideline" + > { + CallerTelematicListenerManager.invokeReceivedMsg( + TelematicConstant.CONTROL_PASSENGER_AI_SWITCH, + it.body + ) + } + TelematicConstant.SHOW_TRAFFIC_LIGHT -> { val trafficLightJson = String(it.body) CallerTrafficLightListenerManager.invokeTrafficLightStatus( diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/OperatePanelLayout.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/OperatePanelLayout.kt index 3c7bccca8f..822b380a2c 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/OperatePanelLayout.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/OperatePanelLayout.kt @@ -1066,6 +1066,7 @@ class OperatePanelLayout : LinearLayout { private const val KEY_SWEEPER_CLOUD_CONTROL = "sweeper_cloud_control" private const val KEY_LOOK_AROUND_360 = "look_around_360" private const val KEY_DRIVE_SEAT_VIDEO_STREAM = "drive_seat_video_stream" + private const val KEY_MOGO_MIND_SWITCH = "mogo_mind_switch" } private var lastTimeOnSendDriveVideo = 0L @@ -1358,6 +1359,21 @@ class OperatePanelLayout : LinearLayout { CallerTelematicManager.sendMsgToAllClients(TelematicConstant.DRIVE_SEAT_VIDEO_STREAM_REQ, toJson(map).toByteArray()) return false } + KEY_MOGO_MIND_SWITCH -> { + val isChecked = newValue as? Boolean ?: false + if (isChecked) { + CallerTelematicManager.sendMsgToAllClients( + TelematicConstant.CONTROL_PASSENGER_AI_SWITCH, + "1".toByteArray() + ) + } else { + CallerTelematicManager.sendMsgToAllClients( + TelematicConstant.CONTROL_PASSENGER_AI_SWITCH, + "0".toByteArray() + ) + } + return true + } } return super.onPreferenceChange(preference, newValue) } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/xml/operate_panel_preference_details_business.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/xml/operate_panel_preference_details_business.xml index 7e1c73ca89..c05b802bd7 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/xml/operate_panel_preference_details_business.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/xml/operate_panel_preference_details_business.xml @@ -58,5 +58,12 @@ android:persistent="false" android:enabled="false" android:widgetLayout="@layout/layout_operate_panel_preference_widget_switch_compat" /> + \ No newline at end of file diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/multidisplay/TelematicConstant.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/multidisplay/TelematicConstant.kt index 7818326490..c2e98a2e06 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/multidisplay/TelematicConstant.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/multidisplay/TelematicConstant.kt @@ -13,6 +13,7 @@ class TelematicConstant { const val CONTROL_PASSENGER_DRIVER_MONITOR = 105 const val V2N_AI_ROAD_DATA_TO_PASSENGER = 106 // V2N老链路云端下发给司机屏的数据,转发给乘客端 const val WEATHER_SWITCH_STATUS = 107 // 司机屏的天气效果开关发给乘客端 + const val CONTROL_PASSENGER_AI_SWITCH = 108 const val OBU_RUNREDLIGHT_WARNING = 200 //闯红灯预警开关 const val OBU_GREENWAVE_WARNING = 201 //绿波通行开关