[8.0.0]自车决策信息进MogoMind
This commit is contained in:
@@ -42,7 +42,6 @@ import kotlinx.android.synthetic.main.taxt_u_p_base_fragment.light_setting
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_base_fragment.mHomeView
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_base_fragment.mv_music_info
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_base_fragment.overMapView
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_base_fragment.pcnActionView
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_base_fragment.romaDistanceView
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_base_fragment.romaPView
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_base_fragment.speedView
|
||||
@@ -154,7 +153,6 @@ class TaxiPassengerBaseFragment :
|
||||
}
|
||||
lbv_go2_center.visibility = View.VISIBLE
|
||||
lbv_go2_center.showAngle()
|
||||
pcnActionView.visibility = View.VISIBLE
|
||||
CallerHmiManager.showTrafficLightView()
|
||||
infoVideoView.visibility = View.GONE
|
||||
mv_music_info.visibility = View.GONE
|
||||
@@ -170,7 +168,6 @@ class TaxiPassengerBaseFragment :
|
||||
romaDistanceView.visibility = View.GONE
|
||||
lbv_go2_center.visibility = View.GONE
|
||||
//lbv_go2_center.showOnlyCenter()
|
||||
pcnActionView.visibility = View.VISIBLE
|
||||
CallerHmiManager.showTrafficLightView()
|
||||
infoVideoView.visibility = View.GONE
|
||||
mv_music_info.visibility = View.GONE
|
||||
@@ -185,7 +182,6 @@ class TaxiPassengerBaseFragment :
|
||||
lbv_go2_center.visibility = View.GONE
|
||||
romaPView.updateVisible(false)
|
||||
romaDistanceView.visibility = View.GONE
|
||||
pcnActionView.visibility = View.GONE
|
||||
CallerHmiManager.hideTrafficLightView()
|
||||
infoVideoView.visibility = View.VISIBLE
|
||||
mv_music_info.visibility = View.GONE
|
||||
@@ -200,7 +196,6 @@ class TaxiPassengerBaseFragment :
|
||||
lbv_go2_center.visibility = View.GONE
|
||||
romaPView.updateVisible(false)
|
||||
romaDistanceView.visibility = View.GONE
|
||||
pcnActionView.visibility = View.GONE
|
||||
CallerHmiManager.hideTrafficLightView()
|
||||
infoVideoView.visibility = View.GONE
|
||||
mv_music_info.visibility = View.VISIBLE
|
||||
|
||||
@@ -10,14 +10,19 @@ import android.view.View
|
||||
import android.widget.TextView
|
||||
import androidx.constraintlayout.motion.widget.MotionLayout
|
||||
import androidx.core.animation.addListener
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.findViewTreeLifecycleOwner
|
||||
import androidx.lifecycle.findViewTreeViewModelStoreOwner
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.autopilot.pnc.PncActionsHelper
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningActionsListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener.Companion.STATUS_AUTOPILOT_RUNNING
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningActionsListenerManager
|
||||
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.common.module.manager.logchainanalytic.OchChainLogManager
|
||||
import com.mogo.och.common.module.utils.BigFrameAnimatorContainer
|
||||
import com.mogo.och.common.module.utils.RxUtils
|
||||
@@ -36,12 +41,15 @@ import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.suspendCancellableCoroutine
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo.telematics.pad.MessagePad.DrivingState.USING_RSI_LINK_VALUE
|
||||
|
||||
class AiView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : MotionLayout(context, attrs, defStyleAttr), AIViewModel.AiViewCallback {
|
||||
) : MotionLayout(context, attrs, defStyleAttr), AIViewModel.AiViewCallback,
|
||||
IMoGoAutopilotPlanningActionsListener{
|
||||
|
||||
|
||||
|
||||
@@ -218,6 +226,7 @@ class AiView @JvmOverloads constructor(
|
||||
ViewModelProvider(it).get(AIViewModel::class.java)
|
||||
}
|
||||
viewModel?.setViewCallback(this)
|
||||
CallerPlanningActionsListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
private fun startListInfo(){
|
||||
@@ -271,6 +280,7 @@ class AiView @JvmOverloads constructor(
|
||||
aiAnimatorBg?.stop()
|
||||
aiAnimatorBg = null
|
||||
tipLooperJob?.cancel()
|
||||
CallerPlanningActionsListenerManager.removeListener(TAG)
|
||||
super.onDetachedFromWindow()
|
||||
}
|
||||
|
||||
@@ -327,5 +337,47 @@ class AiView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
override fun pncActions(planningActionMsg: MessagePad.PlanningActionMsg) {
|
||||
try {
|
||||
UiThreadHandler.post {
|
||||
//TODO !=
|
||||
if (CallerAutoPilotStatusListenerManager.getState() != STATUS_AUTOPILOT_RUNNING) {
|
||||
var actions: String? = null
|
||||
var isPlanningFromServer = false
|
||||
planningActionMsg.actionMsg?.let {
|
||||
try {
|
||||
if (it.drivingState.number == USING_RSI_LINK_VALUE) {
|
||||
isPlanningFromServer = true
|
||||
}
|
||||
actions = PncActionsHelper.getAction(
|
||||
it.drivingState.number,
|
||||
it.drivingAction.number
|
||||
)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
planningActionMsg.v2NActionMsgList?.forEach { v2nAction ->
|
||||
if (v2nAction.drivingState.number == USING_RSI_LINK_VALUE) {
|
||||
isPlanningFromServer = true
|
||||
}
|
||||
actions = PncActionsHelper.getAction(
|
||||
v2nAction.drivingState.number,
|
||||
v2nAction.drivingAction.number
|
||||
)
|
||||
}
|
||||
// update view
|
||||
if(actions?.isNotEmpty() == true){
|
||||
val action = AIMessage.PNCAction(actions!!,actions!!)
|
||||
AIMessageManager.post(action)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -20,6 +20,7 @@ class AIMessageAdapter : ListAdapter<AIMessage, MessageViewHolder>(MessageDiffCa
|
||||
val inflater = LayoutInflater.from(parent.context)
|
||||
return when (viewType) {
|
||||
AIMessage.TYPE_QA -> QAViewHolder(inflater.inflate(R.layout.item_ai_msg_qa, parent, false))
|
||||
AIMessage.TYPE_PNC_ACTION -> PNCActionViewHolder(inflater.inflate(R.layout.item_ai_pnc_action,parent,false))
|
||||
else -> throw IllegalArgumentException("Invalid view type")
|
||||
}
|
||||
}
|
||||
@@ -32,6 +33,7 @@ class AIMessageAdapter : ListAdapter<AIMessage, MessageViewHolder>(MessageDiffCa
|
||||
is AIMessage.Light -> AIMessage.TYPE_LIGHT
|
||||
is AIMessage.Speed -> AIMessage.TYPE_SPEED
|
||||
is AIMessage.Warning -> AIMessage.TYPE_WARNING
|
||||
is AIMessage.PNCAction -> AIMessage.TYPE_PNC_ACTION
|
||||
else -> AIMessage.TYPE_EVENT
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,6 +159,15 @@ class QAViewHolder(val binding: View) : MessageViewHolder(binding) {
|
||||
}
|
||||
}
|
||||
|
||||
class PNCActionViewHolder(val binding: View) : MessageViewHolder(binding){
|
||||
|
||||
private var tvPncAction: TextView = binding.findViewById(R.id.tvPncAction)
|
||||
|
||||
override fun bind(item: AIMessage, onItemClickListener: OnItemClickListener?) {
|
||||
tvPncAction.text = item.title
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
fun interface OnItemClickListener {
|
||||
|
||||
@@ -20,6 +20,7 @@ sealed class AIMessage(
|
||||
const val TYPE_LIGHT = 3
|
||||
const val TYPE_SPEED = 4
|
||||
const val TYPE_WARNING = 5
|
||||
const val TYPE_PNC_ACTION = 6
|
||||
}
|
||||
|
||||
data class Scan(
|
||||
@@ -126,4 +127,9 @@ sealed class AIMessage(
|
||||
override val tts: String = "",
|
||||
) : AIMessage(id, title, tts)
|
||||
|
||||
data class PNCAction(
|
||||
override val id: String,
|
||||
override val title: String
|
||||
): AIMessage(id,title)
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/tvPncAction"
|
||||
android:layout_width="@dimen/dp_747"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#394047"
|
||||
android:textSize="@dimen/sp_32"
|
||||
android:paddingStart="@dimen/dp_30"
|
||||
android:paddingEnd="@dimen/dp_30"
|
||||
android:paddingTop="@dimen/dp_22"
|
||||
android:paddingBottom="@dimen/dp_22"
|
||||
>
|
||||
|
||||
</TextView>
|
||||
@@ -40,19 +40,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<!--pnc行为决策-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
|
||||
android:id="@+id/pcnActionView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_81"
|
||||
android:layout_marginBottom="@dimen/dp_255"
|
||||
app:background_resource="@drawable/taxt_u_p_pnc_bg"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:pnc_size="@dimen/dp_40"
|
||||
app:pnc_txt_style="@style/AudioFileInfoOverlayText" />
|
||||
|
||||
<com.mogo.och.unmanned.passenger.ui.speed.SpeedView
|
||||
android:id="@+id/speedView"
|
||||
android:layout_width="@dimen/dp_240"
|
||||
|
||||
Reference in New Issue
Block a user